Skip to content

Commit b6e59e7

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 4000aa2 commit b6e59e7

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
@@ -1316,6 +1316,17 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
13161316
return IRQ_HANDLED;
13171317
}
13181318

1319+
static irqreturn_t apple_dart_irq(int irq, void *dev)
1320+
{
1321+
irqreturn_t ret;
1322+
struct apple_dart *dart = dev;
1323+
1324+
WARN_ON(pm_runtime_get_sync(dart->dev) < 0);
1325+
ret = dart->hw->irq_handler(irq, dev);
1326+
pm_runtime_put(dart->dev);
1327+
return ret;
1328+
}
1329+
13191330
static bool apple_dart_is_locked(struct apple_dart *dart)
13201331
{
13211332
return !!(readl(dart->regs + dart->hw->lock) & dart->hw->lock_bit);
@@ -1425,7 +1436,7 @@ static int apple_dart_probe(struct platform_device *pdev)
14251436
goto err_clk_disable;
14261437
}
14271438

1428-
ret = request_irq(dart->irq, dart->hw->irq_handler, IRQF_SHARED,
1439+
ret = request_irq(dart->irq, apple_dart_irq, IRQF_SHARED,
14291440
"apple-dart fault handler", dart);
14301441
if (ret)
14311442
goto err_clk_disable;

0 commit comments

Comments
 (0)