All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pata_octeon_cf: avoid WARN_ON() in ata_host_activate()
@ 2021-05-18 20:38 Sergey Shtylyov
  2021-05-18 21:23 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Sergey Shtylyov @ 2021-05-18 20:38 UTC (permalink / raw)
  To: Jens Axboe, linux-ide

Iff platform_get_irq() fails (or returns IRQ0) and thus the polling mode
has to be used, ata_host_activate() hits the WARN_ON() due to 'irq_handler'
parameter being non-NULL if the polling mode is selected.  Let's only set
the pointer to the driver's IRQ handler if platform_get_irq() returns a
valid IRQ # -- this should avoid the unnecessary WARN_ON()...

Fixes: 3c929c6f5aa7 ("MIPS/OCTEON/ata: Convert pata_octeon_cf.c to use device tree.")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

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

 drivers/ata/pata_octeon_cf.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Index: linux-block/drivers/ata/pata_octeon_cf.c
===================================================================
--- linux-block.orig/drivers/ata/pata_octeon_cf.c
+++ linux-block/drivers/ata/pata_octeon_cf.c
@@ -898,10 +898,11 @@ static int octeon_cf_probe(struct platfo
 					return -EINVAL;
 				}
 
-				irq_handler = octeon_cf_interrupt;
 				i = platform_get_irq(dma_dev, 0);
-				if (i > 0)
+				if (i > 0) {
 					irq = i;
+					irq_handler = octeon_cf_interrupt;
+				}
 			}
 			of_node_put(dma_node);
 		}

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

* Re: [PATCH] pata_octeon_cf: avoid WARN_ON() in ata_host_activate()
  2021-05-18 20:38 [PATCH] pata_octeon_cf: avoid WARN_ON() in ata_host_activate() Sergey Shtylyov
@ 2021-05-18 21:23 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-05-18 21:23 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-ide

On 5/18/21 2:38 PM, Sergey Shtylyov wrote:
> Iff platform_get_irq() fails (or returns IRQ0) and thus the polling mode
> has to be used, ata_host_activate() hits the WARN_ON() due to 'irq_handler'
> parameter being non-NULL if the polling mode is selected.  Let's only set
> the pointer to the driver's IRQ handler if platform_get_irq() returns a
> valid IRQ # -- this should avoid the unnecessary WARN_ON()...

Applied, thanks.

-- 
Jens Axboe


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

end of thread, other threads:[~2021-05-18 21:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18 20:38 [PATCH] pata_octeon_cf: avoid WARN_ON() in ata_host_activate() Sergey Shtylyov
2021-05-18 21:23 ` Jens Axboe

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.