Skip to content

Commit 976123a

Browse files
hoshinolinajannau
authored andcommitted
iommu: apple-dart: Power on device when handling IRQs
It's possible for an IRQ to fire and the device to be RPM suspended before we can handle it, which then causes device register accesses to fail in the IRQ handler. Since RPM is IRQ-safe for this device, just make sure we power on the DART in the IRQ handler too. Signed-off-by: Asahi Lina <lina@asahilina.net>
1 parent 7d0a66e commit 976123a

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

drivers/iommu/apple-dart.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,17 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
10971097
return IRQ_HANDLED;
10981098
}
10991099

1100+
static irqreturn_t apple_dart_irq(int irq, void *dev)
1101+
{
1102+
irqreturn_t ret;
1103+
struct apple_dart *dart = dev;
1104+
1105+
WARN_ON(pm_runtime_get_sync(dart->dev) < 0);
1106+
ret = dart->hw->irq_handler(irq, dev);
1107+
pm_runtime_put(dart->dev);
1108+
return ret;
1109+
}
1110+
11001111
static int apple_dart_probe(struct platform_device *pdev)
11011112
{
11021113
int ret;
@@ -1169,7 +1180,7 @@ static int apple_dart_probe(struct platform_device *pdev)
11691180
if (ret)
11701181
goto err_clk_disable;
11711182

1172-
ret = request_irq(dart->irq, dart->hw->irq_handler, IRQF_SHARED,
1183+
ret = request_irq(dart->irq, apple_dart_irq, IRQF_SHARED,
11731184
"apple-dart fault handler", dart);
11741185
if (ret)
11751186
goto err_clk_disable;

0 commit comments

Comments
 (0)