Skip to content

Commit 4bbc16a

Browse files
nehebdamien-lemoal
authored andcommitted
ata: sata_dwc_460ex: enable SATA interrupts only after IRQ handler is registered
sata_dwc_enable_interrupts() is called before platform_get_irq() and ata_host_activate(), leaving the SATA controller's interrupt mask enabled without a registered handler. If a later step fails (irq request, phy init, etc.) or if the controller asserts an interrupt during probe, the irq line may fire with no handler, causing a spurious interrupt storm. Move sata_dwc_enable_interrupts() after ata_host_activate() so that interrupts are only unmasked once the handler is registered and the core is fully initialized. Fixes: 6293600 ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex") Assisted-by: opencode:big-pickle Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 793bf19 commit 4bbc16a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/ata/sata_dwc_460ex.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,6 @@ static int sata_dwc_probe(struct platform_device *ofdev)
11691169
/* Save dev for later use in dev_xxx() routines */
11701170
hsdev->dev = dev;
11711171

1172-
/* Enable SATA Interrupts */
1173-
sata_dwc_enable_interrupts(hsdev);
1174-
11751172
/* Get SATA interrupt number */
11761173
irq = irq_of_parse_and_map(np, 0);
11771174
if (!irq) {
@@ -1204,6 +1201,8 @@ static int sata_dwc_probe(struct platform_device *ofdev)
12041201
if (err)
12051202
dev_err(dev, "failed to activate host");
12061203

1204+
/* Enable SATA Interrupts */
1205+
sata_dwc_enable_interrupts(hsdev);
12071206
return 0;
12081207

12091208
error_out:

0 commit comments

Comments
 (0)