Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH] ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails
@ 2026-09-08 14:15 Nikolay Borisov
  2026-09-08 14:30 ` sashiko-bot
  0 siblings, 1 reply; 4+ messages in thread
From: Nikolay Borisov @ 2026-09-08 14:15 UTC (permalink / raw)
  To: linux-ide; +Cc: dlemoal, cassel, rosenp, Nikolay Borisov

Recent 4bbc16a353a9 commit changed the timing when interrupts are
enabled. However it didn't account for the libATA registration step. So
it's possible that interrupts are enabled when the device is not
registered with libATA core.

Resolve the issue by failing the entire registration process in case of
failure to register with libATA.

Fixes: 4bbc16a353a9 ("ata: sata_dwc_460ex: enable SATA interrupts only after IRQ handler is registered")
Signed-off-by: Nikolay Borisov <nik.borisov@suse.com>
---

This was discovered during review of an internal backport by some internal
LLM-based tool but the fix is entirely cooked up by me.

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

diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index 8e3fc713891a..c3df2fce4af7 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -1185,8 +1185,10 @@ static int sata_dwc_probe(struct platform_device *ofdev)
 	 * error_handler() to execute a dummy Softreset EH session
 	 */
 	err = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht);
-	if (err)
+	if (err) {
 		dev_err(dev, "failed to activate host");
+		goto err;
+	}
 
 	/* Enable SATA Interrupts */
 	sata_dwc_enable_interrupts(hsdev);
--
2.55.0


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

end of thread, other threads:[~2026-09-09  9:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-08 14:15 [PATCH] ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails Nikolay Borisov
2026-09-08 14:30 ` sashiko-bot
2026-09-08 14:34   ` Nikolay Borisov
2026-09-09  9:27     ` Niklas Cassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox