Skip to contentSkip to conversation

ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails

PATCH Applied Nikolay Borisov 2 participants 2 messages Sep 17 libata

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails

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")

---

Changes since v1:
* Added proper goto label
Changes since v2:
* Rework logic so that interrupts are enabled if everything is successful and don't call phy_exit otherwise, as the driver is quite broken w.r.t to it.
Changes since v3:
* Revert to the code as in v2 of the patch following a series that has been merged in the mean time

 drivers/ata/sata_dwc_460ex.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/ata/sata_dwc_460ex.c +4 -1
index 8e3fc713891a..aa816a1a4c54 100644
@@ -1185,11 +1185,14 @@ 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 error_out;
+	}
 
 	/* Enable SATA Interrupts */
 	sata_dwc_enable_interrupts(hsdev);
+
 	return 0;
 
 error_out:

base-commit: 52d19459ca79fef362126e472b9e9a3bfc5020b8 --
2.55.0

maintainer Applied
#1 lore raw
Quoted 9 lines · 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.

[...]

Applied to libata/linux.git (for-7.4), thanks!

[1/1] ata: sata_dwc_460ex: Don't enable interrupt if libATA core registration fails

      https://git.kernel.org/libata/linux/c/e137035f

Kind regards,
Niklas