diff mbox series

sata_rcar: fix deferred probing

Message ID b28a6c60-1f20-e054-7f2a-c5a6cafde8a1@cogentembedded.com
State Not Applicable
Delegated to: David Miller
Headers show
Series sata_rcar: fix deferred probing | expand

Commit Message

Sergei Shtylyov Nov. 24, 2018, 6:14 p.m. UTC
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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against the 'master' branch of Jens Axboe's 'linux-block.git'
repo.

 drivers/ata/sata_rcar.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Simon Horman Nov. 26, 2018, 8:33 a.m. UTC | #1
On Sat, Nov 24, 2018 at 09:14:16PM +0300, Sergei 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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> 
> ---
> This patch is against the 'master' branch of Jens Axboe's 'linux-block.git'
> repo.
> 
>  drivers/ata/sata_rcar.c |    4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> Index: linux-block/drivers/ata/sata_rcar.c
> ===================================================================
> --- linux-block.orig/drivers/ata/sata_rcar.c
> +++ linux-block/drivers/ata/sata_rcar.c
> @@ -891,7 +891,9 @@ static int sata_rcar_probe(struct platfo
>  	int ret = 0;
>  
>  	irq = platform_get_irq(pdev, 0);
> -	if (irq <= 0)
> +	if (irq < 0)
> +		return irq;
> +	if (!irq)
>  		return -EINVAL;
>  
>  	priv = devm_kzalloc(dev, sizeof(struct sata_rcar_priv), GFP_KERNEL);
>
Geert Uytterhoeven Nov. 26, 2018, 10:16 a.m. UTC | #2
On Sat, Nov 24, 2018 at 7:14 PM Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> 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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert
Sergei Shtylyov Dec. 10, 2018, 4:41 p.m. UTC | #3
On 11/24/2018 09:14 PM, Sergei 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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> This patch is against the 'master' branch of Jens Axboe's 'linux-block.git'
> repo.

   Jens, what about this patch? 2 weeks passed, there were 2 R-b tags, and
that's all...

MBR, Sergei
Jens Axboe Dec. 10, 2018, 6:09 p.m. UTC | #4
On 12/10/18 9:41 AM, Sergei Shtylyov wrote:
> On 11/24/2018 09:14 PM, Sergei 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: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>> This patch is against the 'master' branch of Jens Axboe's 'linux-block.git'
>> repo.
> 
>    Jens, what about this patch? 2 weeks passed, there were 2 R-b tags, and
> that's all...

I'll queue it up, thanks.
diff mbox series

Patch

Index: linux-block/drivers/ata/sata_rcar.c
===================================================================
--- linux-block.orig/drivers/ata/sata_rcar.c
+++ linux-block/drivers/ata/sata_rcar.c
@@ -891,7 +891,9 @@  static int sata_rcar_probe(struct platfo
 	int ret = 0;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0)
+	if (irq < 0)
+		return irq;
+	if (!irq)
 		return -EINVAL;
 
 	priv = devm_kzalloc(dev, sizeof(struct sata_rcar_priv), GFP_KERNEL);