Skip to content

Commit 2686fe8

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 967e9f6 commit 2686fe8

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

1277+
static irqreturn_t apple_dart_irq(int irq, void *dev)
1278+
{
1279+
irqreturn_t ret;
1280+
struct apple_dart *dart = dev;
1281+
1282+
WARN_ON(pm_runtime_get_sync(dart->dev) < 0);
1283+
ret = dart->hw->irq_handler(irq, dev);
1284+
pm_runtime_put(dart->dev);
1285+
return ret;
1286+
}
1287+
12771288
static bool apple_dart_is_locked(struct apple_dart *dart)
12781289
{
12791290
return !!(readl(dart->regs + dart->hw->lock) & dart->hw->lock_bit);
@@ -1385,7 +1396,7 @@ static int apple_dart_probe(struct platform_device *pdev)
13851396
goto err_clk_disable;
13861397
}
13871398

1388-
ret = request_irq(dart->irq, dart->hw->irq_handler, IRQF_SHARED,
1399+
ret = request_irq(dart->irq, apple_dart_irq, IRQF_SHARED,
13891400
"apple-dart fault handler", dart);
13901401
if (ret)
13911402
goto err_clk_disable;

0 commit comments

Comments
 (0)