Skip to content

Commit 4bac415

Browse files
hoshinolinamarcan
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 <[email protected]>
1 parent 48571bf commit 4bac415

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
@@ -1276,6 +1276,17 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
12761276
return IRQ_HANDLED;
12771277
}
12781278

1279+
static irqreturn_t apple_dart_irq(int irq, void *dev)
1280+
{
1281+
irqreturn_t ret;
1282+
struct apple_dart *dart = dev;
1283+
1284+
WARN_ON(pm_runtime_get_sync(dart->dev) < 0);
1285+
ret = dart->hw->irq_handler(irq, dev);
1286+
pm_runtime_put(dart->dev);
1287+
return ret;
1288+
}
1289+
12791290
static bool apple_dart_is_locked(struct apple_dart *dart)
12801291
{
12811292
return !!(readl(dart->regs + dart->hw->lock) & dart->hw->lock_bit);
@@ -1387,7 +1398,7 @@ static int apple_dart_probe(struct platform_device *pdev)
13871398
goto err_clk_disable;
13881399
}
13891400

1390-
ret = request_irq(dart->irq, dart->hw->irq_handler, IRQF_SHARED,
1401+
ret = request_irq(dart->irq, apple_dart_irq, IRQF_SHARED,
13911402
"apple-dart fault handler", dart);
13921403
if (ret)
13931404
goto err_clk_disable;

0 commit comments

Comments
 (0)