All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ata: libahci_platform: fix IRQ check
@ 2021-03-15 19:47 Sergey Shtylyov
  2021-03-15 20:09 ` Sergey Shtylyov
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2021-03-15 19:47 UTC (permalink / raw)
  To: Hans de Goede, Jens Axboe, linux-ide

Iff platform_get_irq() returns 0, ahci_platform_init_host() would return 0
early (as if the call was successful). Override IRQ0 with -EINVAL instead
as the 'libata' regards 0 as "no IRQ" (thus polling) anyway...

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/libahci_platform.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: linux-block/drivers/ata/libahci_platform.c
===================================================================
--- linux-block.orig/drivers/ata/libahci_platform.c
+++ linux-block/drivers/ata/libahci_platform.c
@@ -582,11 +582,13 @@ int ahci_platform_init_host(struct platf
 	int i, irq, n_ports, rc;
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq <= 0) {
+	if (irq < 0) {
 		if (irq != -EPROBE_DEFER)
 			dev_err(dev, "no irq\n");
 		return irq;
 	}
+	if (!irq)
+		return -EINVAL;
 
 	hpriv->irq = irq;
 

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

* Re: [PATCH] ata: libahci_platform: fix IRQ check
  2021-03-15 19:47 [PATCH] ata: libahci_platform: fix IRQ check Sergey Shtylyov
@ 2021-03-15 20:09 ` Sergey Shtylyov
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Shtylyov @ 2021-03-15 20:09 UTC (permalink / raw)
  To: Hans de Goede, Jens Axboe, linux-ide

On 3/15/21 10:47 PM, Sergey Shtylyov wrote:

> Iff platform_get_irq() returns 0, ahci_platform_init_host() would return 0
> early (as if the call was successful). Override IRQ0 with -EINVAL instead
> as the 'libata' regards 0 as "no IRQ" (thus polling) anyway...
> 
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru>

   Oops, forgot the "Fixes: tag, will repost! :-)

MBR, Sergey

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

end of thread, other threads:[~2021-03-15 20:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-15 19:47 [PATCH] ata: libahci_platform: fix IRQ check Sergey Shtylyov
2021-03-15 20:09 ` Sergey Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.