[PATCH 3/8] ARM: locomo: fix locomo irq handling
Accidentally booting Collie on Assabet reveals that the locomo driver incorrectly overwrites gpio-sa1100's chip data for its parent interrupt, leading to oops in sa1100_gpio_unmask() and sa1100_update_edge_regs() when "gpio: sa1100: convert to use IO accessors" is applied. Fix locomo to use the handler data rather than chip data for its parent interrupt. Signed-off-by: Russell King --- arch/arm/common/locomo.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 0e97b4b871f9..6c7b06854fce 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c @@ -140,7 +140,7 @@ static struct locomo_dev_info locomo_devices[] = { static void locomo_handler(struct irq_desc *desc) { - struct locomo *lchip = irq_desc_get_chip_data(desc); + struct locomo *lchip = irq_desc_get_handler_data(desc); int req, i; /* Acknowledge the parent IRQ */ @@ -200,8 +200,7 @@ static void locomo_setup_irq(struct locomo *lchip) * Install handler for IRQ_LOCOMO_HW. */ irq_set_irq_type(lchip->irq, IRQ_TYPE_EDGE_FALLING); - irq_set_chip_data(lchip->irq, lchip); - irq_set_chained_handler(lchip->irq, locomo_handler); + irq_set_chained_handler_and_data(lchip->irq, locomo_handler, lchip); /* Install handlers for IRQ_LOCOMO_* */ for ( ; irq <= lchip->irq_base + 3; irq++) { -- 2.1.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH 8/8] ARM: pxa/lubbock: add pcmcia clock
Russell King writes: > Add the required PCMCIA clock for the SA "1800" device. This clock > is used to compute timing information for the PCMCIA interface in the > SoC device, rather than the SA. Hence, the provision of this clock > is a convenience for the driver and does not reflect the hardware, so > this must not be copied into DT. > > Signed-off-by: Russell King Acked-by: Robert Jarzmik But more importantly: Tested-by: Robert Jarzmik Cheers. -- Robert ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 7/8] ARM: sa1111: fix missing clk_disable()
SA forgets to call clk_disable() in the probe error cleanup path. Add the necessary call. Signed-off-by: Russell King --- arch/arm/common/sa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/arm/common/sa.c b/arch/arm/common/sa.c index 7838659b870a..2e076c492005 100644 --- a/arch/arm/common/sa.c +++ b/arch/arm/common/sa.c @@ -754,7 +754,7 @@ static int __sa_probe(struct device *me, struct resource *mem, int irq) if (sachip->irq != NO_IRQ) { ret = sa_setup_irq(sachip, pd->irq_base); if (ret) - goto err_unmap; + goto err_clk; } #ifdef CONFIG_ARCH_SA1100 @@ -799,6 +799,8 @@ static int __sa_probe(struct device *me, struct resource *mem, int irq) return 0; + err_clk: + clk_disable(sachip->clk); err_unmap: iounmap(sachip->base); err_clk_unprep: -- 2.1.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 8/8] ARM: pxa/lubbock: add pcmcia clock
Add the required PCMCIA clock for the SA "1800" device. This clock is used to compute timing information for the PCMCIA interface in the SoC device, rather than the SA. Hence, the provision of this clock is a convenience for the driver and does not reflect the hardware, so this must not be copied into DT. Signed-off-by: Russell King --- arch/arm/mach-pxa/lubbock.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 7245f3359564..d6159f8ef0c2 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c @@ -137,6 +137,18 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = { // no D+ pullup; lubbock can't connect/disconnect in software }; +static void lubbock_init_pcmcia(void) +{ + struct clk *clk; + + /* Add an alias for the SA PCMCIA clock */ + clk = clk_get_sys("pxa2xx-pcmcia", NULL); + if (!IS_ERR(clk)) { + clkdev_create(clk, NULL, "1800"); + clk_put(clk); + } +} + static struct resource sa_resources[] = { [0] = { .start = 0x1000, @@ -467,6 +479,8 @@ static void __init lubbock_init(void) pxa_set_btuart_info(NULL); pxa_set_stuart_info(NULL); + lubbock_init_pcmcia(); + clk_add_alias("SA_CLK", NULL, "GPIO11_CLK", NULL); pxa_set_udc_info(&udc_info); pxa_set_fb_info(NULL, &sharp_lm8v31); -- 2.1.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 1/8] pcmcia: sa1111: fix propagation of lowlevel board init return code
When testing Lubbock, it was noticed that the sa pcmcia driver bound but was not functional due to no sockets being registered. This is because the return code from the lowlevel board initialisation was not being propagated out of the probe function. Fix this. Tested-by: Robert Jarzmik Signed-off-by: Russell King --- drivers/pcmcia/sa_badge4.c | 22 -- drivers/pcmcia/sa_generic.c| 22 +- drivers/pcmcia/sa_jornada720.c | 25 ++--- drivers/pcmcia/sa_lubbock.c| 32 +--- drivers/pcmcia/sa_neponset.c | 26 ++ 5 files changed, 58 insertions(+), 69 deletions(-) diff --git a/drivers/pcmcia/sa_badge4.c b/drivers/pcmcia/sa_badge4.c index 12f0dd091477..2f490930430d 100644 --- a/drivers/pcmcia/sa_badge4.c +++ b/drivers/pcmcia/sa_badge4.c @@ -134,20 +134,14 @@ static struct pcmcia_low_level badge4_pcmcia_ops = { int pcmcia_badge4_init(struct sa_dev *dev) { - int ret = -ENODEV; - - if (machine_is_badge4()) { - printk(KERN_INFO - "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", - __func__, - badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); - - sa11xx_drv_pcmcia_ops(&badge4_pcmcia_ops); - ret = sa_pcmcia_add(dev, &badge4_pcmcia_ops, - sa11xx_drv_pcmcia_add_one); - } - - return ret; + printk(KERN_INFO + "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n", + __func__, + badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc); + + sa11xx_drv_pcmcia_ops(&badge4_pcmcia_ops); + return sa_pcmcia_add(dev, &badge4_pcmcia_ops, +sa11xx_drv_pcmcia_add_one); } static int __init pcmv_setup(char *s) diff --git a/drivers/pcmcia/sa_generic.c b/drivers/pcmcia/sa_generic.c index a1531feb8460..3d95dffcff7a 100644 --- a/drivers/pcmcia/sa_generic.c +++ b/drivers/pcmcia/sa_generic.c @@ -18,6 +18,7 @@ #include #include +#include #include #include "sa_generic.h" @@ -203,19 +204,30 @@ static int pcmcia_probe(struct sa_dev *dev) sa_writel(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR); sa_writel(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR); + ret = -ENODEV; #ifdef CONFIG_SA1100_BADGE4 - pcmcia_badge4_init(dev); + if (machine_is_badge4()) + ret = pcmcia_badge4_init(dev); #endif #ifdef CONFIG_SA1100_JORNADA720 - pcmcia_jornada720_init(dev); + if (machine_is_jornada720()) + ret = pcmcia_jornada720_init(dev); #endif #ifdef CONFIG_ARCH_LUBBOCK - pcmcia_lubbock_init(dev); + if (machine_is_lubbock()) + ret = pcmcia_lubbock_init(dev); #endif #ifdef CONFIG_ASSABET_NEPONSET - pcmcia_neponset_init(dev); + if (machine_is_assabet()) + ret = pcmcia_neponset_init(dev); #endif - return 0; + + if (ret) { + release_mem_region(dev->res.start, 512); + sa_disable_device(dev); + } + + return ret; } static int pcmcia_remove(struct sa_dev *dev) diff --git a/drivers/pcmcia/sa_jornada720.c b/drivers/pcmcia/sa_jornada720.c index c2c30580c83f..480a3ede27c8 100644 --- a/drivers/pcmcia/sa_jornada720.c +++ b/drivers/pcmcia/sa_jornada720.c @@ -94,22 +94,17 @@ static struct pcmcia_low_level jornada720_pcmcia_ops = { int pcmcia_jornada720_init(struct sa_dev *sadev) { - int ret = -ENODEV; + unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; - if (machine_is_jornada720()) { - unsigned int pin = GPIO_A0 | GPIO_A1 | GPIO_A2 | GPIO_A3; + /* Fixme: why messing around with SA11x0's GPIO1? */ + GRER |= 0x0002; - GRER |= 0x0002; + /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ + sa_set_io_dir(sadev, pin, 0, 0); + sa_set_io(sadev, pin, 0); + sa_set_sleep_io(sadev, pin, 0); - /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */ - sa_set_io_dir(sadev, pin, 0, 0); - sa_set_io(sadev, pin, 0); - sa_set_sleep_io(sadev, pin, 0); - - sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops); - ret = sa_pcmcia_add(sadev, &jornada720_pcmcia_ops, - sa11xx_drv_pcmcia_add_one); - } - - return ret; + sa11xx_drv_pcmcia_ops(&jornada720_pcmcia_ops); + return sa_pcmcia_add(sadev, &jornada720_pcmcia_ops, +sa11xx_drv_pcmcia_add_one); } diff --git a/drivers/pcmcia/sa_lubbock.c b/drivers/pcmcia/sa_lubbock.c index c5caf5790451..df2b6b28b1d1 100644 --- a/drivers/pcmcia/sa_lubbock.c
[PATCH 2/8] pcmcia: lubbock: fix sockets configuration
From: Robert Jarzmik On lubbock board, the probe of the driver crashes by dereferencing very early a platform_data structure which is not set, in pxa2xx_configure_sockets(). The stack fixed is : [0.244353] SA Microprocessor Companion Chip: silicon revision 1, metal revision 1 [0.256321] sa sa: Providing IRQ336-390 [0.340899] clocksource: Switched to clocksource oscr0 [0.472263] Unable to handle kernel NULL pointer dereference at virtual address 0004 [0.480469] pgd = c0004000 [0.483432] [0004] *pgd= [0.487105] Internal error: Oops: f5 [#1] ARM [0.491497] Modules linked in: [0.494650] CPU: 0 PID: 1 Comm: swapper Not tainted 4.8.0-rc3-00080-g1aaa68426f0c-dirty #2068 [0.503229] Hardware name: Intel DBPXA250 Development Platform (aka Lubbock) [0.510344] task: c3e42000 task.stack: c3e44000 [0.514984] PC is at pxa2xx_configure_sockets+0x4/0x24 (drivers/pcmcia/pxa2xx_base.c:227) [0.520193] LR is at pcmcia_lubbock_init+0x1c/0x38 [0.525079] pc : []lr : []psr: a053 [0.525079] sp : c3e45e70 ip : 100019ff fp : [0.536651] r10: c0828900 r9 : c0434838 r8 : [0.541953] r7 : c0820700 r6 : c0857b30 r5 : c3ec1400 r4 : c0820758 [0.548549] r3 : r2 : 000c r1 : c3c09c40 r0 : c3ec1400 [0.555154] Flags: NzCv IRQs on FIQs off Mode SVC_32 ISA ARM Segment none [0.562450] Control: 397f Table: a0004000 DAC: 0053 [0.568257] Process swapper (pid: 1, stack limit = 0xc3e44190) [0.574154] Stack: (0xc3e45e70 to 0xc3e46000) [0.578610] 5e60: c4849800 c3ec1400 c024769c [0.586928] 5e80: c3ec140c c3c0ee0c c3ec1400 c3ec1434 c020c410 c3ec1400 c3ec1434 [0.595244] 5ea0: c0820700 c080b408 c0828900 c020c5f8 c0820700 c020c578 c020ac5c [0.603560] 5ec0: c3e687cc c3e71e10 c0820700 c3c02de0 c020bae4 c03c62f7 c03c62f7 [0.611872] 5ee0: c3e68780 c0820700 c042e034 c043c440 c020cdec c080b408 0005 [0.620188] 5f00: c042e034 c00096c0 c0034440 c01c730c 2053 [0.628502] 5f20: c3ffcb87 c3ffcb90 c00346ac c3e66ba0 c03f7914 0092 0005 [0.636811] 5f40: 0005 c03f847c 0091 c03f847c 0005 c0434828 0005 [0.645125] 5f60: c043482c 0092 c043c440 c0828900 c0434838 c0418d2c 0005 0005 [0.653430] 5f80: c041858c c032e9f0 [0.661729] 5fa0: c032e9f8 c000f0f0 [0.670020] 5fc0: [0.678311] 5fe0: 0013 [0.686673] (pxa2xx_configure_sockets) from pcmcia_lubbock_init (/drivers/pcmcia/sa_lubbock.c:161) [0.696026] (pcmcia_lubbock_init) from pcmcia_probe (/drivers/pcmcia/sa_generic.c:213) [0.704358] (pcmcia_probe) from driver_probe_device (/drivers/base/dd.c:378 /drivers/base/dd.c:499) [0.712848] (driver_probe_device) from __driver_attach (/./include/linux/device.h:983 /drivers/base/dd.c:733) [0.721414] (__driver_attach) from bus_for_each_dev (/drivers/base/bus.c:313) [0.729723] (bus_for_each_dev) from bus_add_driver (/drivers/base/bus.c:708) [0.738036] (bus_add_driver) from driver_register (/drivers/base/driver.c:169) [0.746185] (driver_register) from do_one_initcall (/init/main.c:778) [0.754561] (do_one_initcall) from kernel_init_freeable (/init/main.c:843 /init/main.c:851 /init/main.c:869 /init/main.c:1016) [0.763409] (kernel_init_freeable) from kernel_init (/init/main.c:944) [0.771660] (kernel_init) from ret_from_fork (/arch/arm/kernel/entry-common.S:119) [ 0.779347] Code: c03c6305 c03c631e c03c632e e5903048 (e993000c) All code 0: c03c6305eorsgt r6, ip, r5, lsl #6 4: c03c631eeorsgt r6, ip, lr, lsl r3 8: c03c632eeorsgt r6, ip, lr, lsr #6 c: e5903048ldr r3, [r0, #72] ; 0x48 10:* e993000cldmib r3, {r2, r3}<-- trapping instruction Signed-off-by: Robert Jarzmik Signed-off-by: Russell King --- drivers/pcmcia/pxa2xx_base.c| 9 + drivers/pcmcia/pxa2xx_base.h| 2 +- drivers/pcmcia/sa_lubbock.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index 483f919e0d2e..91b5f5724cba 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c @@ -214,9 +214,8 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, } #endif -void pxa2xx_configure_sockets(struct device *dev) +void pxa2xx_configure_sockets(struct device *dev, struct pcmcia_low_level *ops) { - struct pcmcia_low_level *ops = dev->platform_data; /* * We have at least one socket, so set M
[PATCH 6/8] ARM: sa1111: fix pcmcia suspend/resume
SA PCMCIA was broken when PCMCIA switched to using dev_pm_ops for the PCMCIA socket class. PCMCIA used to handle suspend/resume via the socket hosting device, which happened at normal device suspend/resume time. However, the referenced commit changed this: much of the resume now happens much earlier, in the noirq resume handler of dev_pm_ops. However, on SA, the PCMCIA device is not accessible as the SA has not been resumed at _noirq time. It's slightly worse than that, because the SA has already been put to sleep at _noirq time, so suspend doesn't work properly. Fix this by converting the core SA code to use dev_pm_ops as well, and performing its own suspend/resume at noirq time. This fixes these errors in the kernel log: pcmcia_socket pcmcia_socket0: time out after reset pcmcia_socket pcmcia_socket1: time out after reset and the resulting lack of PCMCIA cards after a S2RAM cycle. Fixes: d7646f7632549 ("pcmcia: use dev_pm_ops for class pcmcia_socket_class") Signed-off-by: Russell King --- arch/arm/common/sa.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/arch/arm/common/sa.c b/arch/arm/common/sa.c index cfa61b857cad..7838659b870a 100644 --- a/arch/arm/common/sa.c +++ b/arch/arm/common/sa.c @@ -869,9 +869,9 @@ struct sa_save_data { #ifdef CONFIG_PM -static int sa_suspend(struct platform_device *dev, pm_message_t state) +static int sa_suspend_noirq(struct device *dev) { - struct sa *sachip = platform_get_drvdata(dev); + struct sa *sachip = dev_get_drvdata(dev); struct sa_save_data *save; unsigned long flags; unsigned int val; @@ -934,9 +934,9 @@ static int sa_suspend(struct platform_device *dev, pm_message_t state) * restored by their respective drivers, and must be called * via LDM after this function. */ -static int sa_resume(struct platform_device *dev) +static int sa_resume_noirq(struct device *dev) { - struct sa *sachip = platform_get_drvdata(dev); + struct sa *sachip = dev_get_drvdata(dev); struct sa_save_data *save; unsigned long flags, id; void __iomem *base; @@ -952,7 +952,7 @@ static int sa_resume(struct platform_device *dev) id = sa_readl(sachip->base + SA_SKID); if ((id & SKID_ID_MASK) != SKID_SA_ID) { __sa_remove(sachip); - platform_set_drvdata(dev, NULL); + dev_set_drvdata(dev, NULL); kfree(save); return 0; } @@ -1003,8 +1003,8 @@ static int sa_resume(struct platform_device *dev) } #else -#define sa_suspend NULL -#define sa_resume NULL +#define sa_suspend_noirq NULL +#define sa_resume_noirq NULL #endif static int sa_probe(struct platform_device *pdev) @@ -1038,6 +1038,11 @@ static int sa_remove(struct platform_device *pdev) return 0; } +static struct dev_pm_ops sa_pm_ops = { + .suspend_noirq = sa_suspend_noirq, + .resume_noirq = sa_resume_noirq, +}; + /* * Not sure if this should be on the system bus or not yet. * We really want some way to register a system device at @@ -1050,10 +1055,9 @@ static int sa_remove(struct platform_device *pdev) static struct platform_driver sa_device_driver = { .probe = sa_probe, .remove = sa_remove, - .suspend= sa_suspend, - .resume = sa_resume, .driver = { .name = "sa", + .pm = &sa_pm_ops, }, }; -- 2.1.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 5/8] ARM: sa1111: fix pcmcia interrupt mask polarity
The polarity of the high IRQs was being calculated using SA_IRQMASK_HI(), but this assumes a Linux interrupt number, not a hardware interrupt number. Hence, the resulting mask was incorrect. Fix this. Signed-off-by: Russell King --- arch/arm/common/sa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/common/sa.c b/arch/arm/common/sa.c index 332b92317fd8..cfa61b857cad 100644 --- a/arch/arm/common/sa.c +++ b/arch/arm/common/sa.c @@ -472,8 +472,8 @@ static int sa_setup_irq(struct sa *sachip, unsigned irq_base) * specifies that S0ReadyInt and S1ReadyInt should be '1'. */ sa_writel(0, irqbase + SA_INTPOL0); - sa_writel(SA_IRQMASK_HI(IRQ_S0_READY_NINT) | - SA_IRQMASK_HI(IRQ_S1_READY_NINT), + sa_writel(BIT(IRQ_S0_READY_NINT & 31) | + BIT(IRQ_S1_READY_NINT & 31), irqbase + SA_INTPOL1); /* clear all IRQs */ -- 2.1.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 4/8] ARM: sa1111: fix error code propagation in sa1111_probe()
Ensure that we propagate the platform_get_irq() error code out of the probe function. This allows probe deferrals to work correctly should platform_get_irq() not be able to resolve the interrupt in a DT environment at probe time. Signed-off-by: Russell King --- arch/arm/common/sa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/common/sa.c b/arch/arm/common/sa.c index fb0a0a4dfea4..332b92317fd8 100644 --- a/arch/arm/common/sa.c +++ b/arch/arm/common/sa.c @@ -1017,7 +1017,7 @@ static int sa_probe(struct platform_device *pdev) return -EINVAL; irq = platform_get_irq(pdev, 0); if (irq < 0) - return -ENXIO; + return irq; return __sa_probe(&pdev->dev, mem, irq); } -- 2.1.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 0/8] More SA11x0/PXA related fixes
More fixes for SA11x0/PXA: * Locomo blows up because it uses the wrong data for the handler, overwriting the chip's data. * Fixes for PCMCIA problems discovered by Robert. * Fixing SA suspend/resume Can I have acks for these please, so I can push them to Linus later this week. Thanks. arch/arm/common/locomo.c | 5 ++--- arch/arm/common/sa.c | 32 +++- arch/arm/mach-pxa/lubbock.c| 14 ++ drivers/pcmcia/pxa2xx_base.c | 9 + drivers/pcmcia/pxa2xx_base.h | 2 +- drivers/pcmcia/sa_badge4.c | 22 -- drivers/pcmcia/sa_generic.c| 22 +- drivers/pcmcia/sa_jornada720.c | 25 ++--- drivers/pcmcia/sa_lubbock.c| 32 +--- drivers/pcmcia/sa_neponset.c | 26 ++ 10 files changed, 99 insertions(+), 90 deletions(-) -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
Re: [PATCH 0/3] SA11x0/PXA pcmcia fixes
On Mon, Aug 29, 2016 at 11:02:32AM +0100, Russell King - ARM Linux wrote: > Further to the DS suspend/resume fix, here's a few more for SA11x0/PXA. > > drivers/pcmcia/sa11xx_base.c | 8 > drivers/pcmcia/soc_common.c | 2 +- > 2 files changed, 5 insertions(+), 5 deletions(-) If no one objects, I'll queue these three fixes for -rc6 as well. Thanks. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net. ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH 4/4] pcmcia: soc-common: remove incorrect NO_IRQ use
The soc_common driver (used on ARM sa1100 and pxa) initializes the socket->pci_irq member to NO_IRQ by default to signify an invalid interrupt, and normally overrides this with a proper interrupt later. However, the code that checks socked->pci_irq for validity compares it to zero instead of NO_IRQ, as most drivers do, so this cannot work right. While zero is a valid interrupt number on PXA (and in the past also on sa1100), it is the interrupt line for the 'ssp' serial port, so there is no possible conflict in practice and we can simply change the default to zero. Signed-off-by: Arnd Bergmann --- drivers/pcmcia/soc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index eed5e9c05353..339ce29fa97b 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -691,7 +691,7 @@ void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt, skt->ops = ops; skt->socket.owner = ops->owner; skt->socket.dev.parent = dev; - skt->socket.pci_irq = NO_IRQ; + skt->socket.pci_irq = 0; for (i = 0; i < ARRAY_SIZE(skt->stat); i++) skt->stat[i].gpio = -EINVAL; -- 2.9.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia
[PATCH] pcmcia: soc-common: remove incorrect NO_IRQ use
The soc_common driver (used on ARM sa1100 and pxa) initializes the socket->pci_irq member to NO_IRQ by default to signify an invalid interrupt, and normally overrides this with a proper interrupt later. However, the code that checks socked->pci_irq for validity compares it to zero instead of NO_IRQ, as most drivers do, so this cannot work right. While zero is a valid interrupt number on PXA (and in the past also on sa1100), it is the interrupt line for the 'ssp' serial port, so there is no possible conflict in practice and we can simply change the default to zero. Signed-off-by: Arnd Bergmann --- drivers/pcmcia/soc_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index eed5e9c05353..339ce29fa97b 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c @@ -691,7 +691,7 @@ void soc_pcmcia_init_one(struct soc_pcmcia_socket *skt, skt->ops = ops; skt->socket.owner = ops->owner; skt->socket.dev.parent = dev; - skt->socket.pci_irq = NO_IRQ; + skt->socket.pci_irq = 0; for (i = 0; i < ARRAY_SIZE(skt->stat); i++) skt->stat[i].gpio = -EINVAL; -- 2.9.0 ___ Linux PCMCIA reimplementation list http://lists.infradead.org/mailman/listinfo/linux-pcmcia