linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sata_highbank: fix deferred probing
@ 2021-03-14 20:34 Sergey Shtylyov
  2021-05-18 18:30 ` Sergey Shtylyov
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Sergey Shtylyov @ 2021-03-14 20:34 UTC (permalink / raw)
  To: Jens Axboe, linux-ide

The driver overrides the error codes returned by platform_get_irq() to
-EINVAL, 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 againt the 'master' branch of Jens Axboe's linux-block repo.

drivers/ata/sata_highbank.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: linux-block/drivers/ata/sata_highbank.c
===================================================================
--- linux-block.orig/drivers/ata/sata_highbank.c
+++ linux-block/drivers/ata/sata_highbank.c
@@ -469,10 +469,12 @@ static int ahci_highbank_probe(struct pl
 	}
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	if (irq < 0) {
 		dev_err(dev, "no irq\n");
-		return -EINVAL;
+		return irq;
 	}
+	if (!irq)
+		return -EINVAL;
 
 	hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
 	if (!hpriv) {

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sata_highbank: fix deferred probing
  2021-03-14 20:34 [PATCH] sata_highbank: fix deferred probing Sergey Shtylyov
@ 2021-05-18 18:30 ` Sergey Shtylyov
  2021-05-18 21:18 ` Jens Axboe
  2021-05-19  7:33 ` Geert Uytterhoeven
  2 siblings, 0 replies; 5+ messages in thread
From: Sergey Shtylyov @ 2021-05-18 18:30 UTC (permalink / raw)
  To: Sergey Shtylyov, Jens Axboe, linux-ide

Hello!

On 3/14/21 11:34 PM, Sergey Shtylyov wrote:

> The driver overrides the error codes returned by platform_get_irq() to
> -EINVAL, 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>

[...]

   2 months have passed, and it seems the patch has been lost somewhere...

MBR, Sergey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sata_highbank: fix deferred probing
  2021-03-14 20:34 [PATCH] sata_highbank: fix deferred probing Sergey Shtylyov
  2021-05-18 18:30 ` Sergey Shtylyov
@ 2021-05-18 21:18 ` Jens Axboe
  2021-05-19  7:33 ` Geert Uytterhoeven
  2 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2021-05-18 21:18 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-ide

On 3/14/21 2:34 PM, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -EINVAL, 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sata_highbank: fix deferred probing
  2021-03-14 20:34 [PATCH] sata_highbank: fix deferred probing Sergey Shtylyov
  2021-05-18 18:30 ` Sergey Shtylyov
  2021-05-18 21:18 ` Jens Axboe
@ 2021-05-19  7:33 ` Geert Uytterhoeven
  2021-05-19 15:19   ` Sergey Shtylyov
  2 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2021-05-19  7:33 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: Jens Axboe, linux-ide

 	Hi Sergei,

On Sun, 14 Mar 2021, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -EINVAL, 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>

Thanks for your patch, which is now commit 4a24efa16e7db023
("sata_highbank: fix deferred probing") in block/for-next.

> --- linux-block.orig/drivers/ata/sata_highbank.c
> +++ linux-block/drivers/ata/sata_highbank.c
> @@ -469,10 +469,12 @@ static int ahci_highbank_probe(struct pl
> 	}
>
> 	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0) {
> +	if (irq < 0) {
> 		dev_err(dev, "no irq\n");

This message should not be printed in case of -EPROBE_DEFER...

> -		return -EINVAL;
> +		return irq;

... hence

     return dev_err_probe(dev, irq, "no irq\n");

Same for pata_rb532_cf.

> 	}
> +	if (!irq)
> +		return -EINVAL;
>
> 	hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
> 	if (!hpriv) {
>
Gr{oetje,eeting}s,

 						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
 							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sata_highbank: fix deferred probing
  2021-05-19  7:33 ` Geert Uytterhoeven
@ 2021-05-19 15:19   ` Sergey Shtylyov
  0 siblings, 0 replies; 5+ messages in thread
From: Sergey Shtylyov @ 2021-05-19 15:19 UTC (permalink / raw)
  To: Geert Uytterhoeven, Sergey Shtylyov; +Cc: Jens Axboe, linux-ide

On 5/19/21 10:33 AM, Geert Uytterhoeven wrote:

>> The driver overrides the error codes returned by platform_get_irq() to
>> -EINVAL, 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>
> 
> Thanks for your patch, which is now commit 4a24efa16e7db023
> ("sata_highbank: fix deferred probing") in block/for-next.
> 
>> --- linux-block.orig/drivers/ata/sata_highbank.c
>> +++ linux-block/drivers/ata/sata_highbank.c
>> @@ -469,10 +469,12 @@ static int ahci_highbank_probe(struct pl
>>     }
>>
>>     irq = platform_get_irq(pdev, 0);
>> -    if (irq <= 0) {
>> +    if (irq < 0) {
>>         dev_err(dev, "no irq\n");
> 
> This message should not be printed in case of -EPROBE_DEFER...

    I fact, platform_get_irq() now prints erors, even checking for EPROBE_DEFER,
so the message may be removed completely... :-)

> 
>> -        return -EINVAL;
>> +        return irq;
[...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-19 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-14 20:34 [PATCH] sata_highbank: fix deferred probing Sergey Shtylyov
2021-05-18 18:30 ` Sergey Shtylyov
2021-05-18 21:18 ` Jens Axboe
2021-05-19  7:33 ` Geert Uytterhoeven
2021-05-19 15:19   ` Sergey Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).