Message ID | 771ced55-3efb-21f5-f21c-b99920aae611@omprussia.ru |
---|---|
State | New |
Headers | show |
Series | pata_rb532_cf: fix deferred probing | expand |
On 3/15/21 2:46 PM, Sergey Shtylyov wrote: > The driver overrides the error codes returned by platform_get_irq() to > -ENOENT, so if it returns -EPROBE_DEFER, the driver would fail the probe > permanently instead of the deferred probing. Switch to propagating the > error code upstream, still checking/overriding IRQ0 as libata regards it > as "no IRQ" (thus polling) anyway... > > Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") > Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru> [...] Again, 2 months have passed, and it seems the patch has been lost somewhere... MNR, Sergey
On 3/15/21 5:46 AM, Sergey Shtylyov wrote: > The driver overrides the error codes returned by platform_get_irq() to > -ENOENT, so if it returns -EPROBE_DEFER, the driver would fail the probe > permanently instead of the deferred probing. Switch to propagating the > error code upstream, still checking/overriding IRQ0 as libata regards it > as "no IRQ" (thus polling) anyway... Applied, sorry about the delay.
Index: linux-block/drivers/ata/pata_rb532_cf.c =================================================================== --- linux-block.orig/drivers/ata/pata_rb532_cf.c +++ linux-block/drivers/ata/pata_rb532_cf.c @@ -115,10 +115,12 @@ static int rb532_pata_driver_probe(struc } irq = platform_get_irq(pdev, 0); - if (irq <= 0) { + if (irq < 0) { dev_err(&pdev->dev, "no IRQ resource found\n"); - return -ENOENT; + return irq; } + if (!irq) + return -EINVAL; gpiod = devm_gpiod_get(&pdev->dev, NULL, GPIOD_IN); if (IS_ERR(gpiod)) {
The driver overrides the error codes returned by platform_get_irq() to -ENOENT, so if it returns -EPROBE_DEFER, the driver would fail the probe permanently instead of the deferred probing. Switch to propagating the error code upstream, still checking/overriding IRQ0 as libata regards it as "no IRQ" (thus polling) anyway... Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru> --- This patch is against the 'master' branch of Jens Axboe's 'linux-block.git' repo. drivers/ata/pata_rb532_cf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)