Skip to content

Commit a3d4cd5

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 8ac42a6 commit a3d4cd5

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
@@ -1085,6 +1085,17 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
10851085
return IRQ_HANDLED;
10861086
}
10871087

1088+
static irqreturn_t apple_dart_irq(int irq, void *dev)
1089+
{
1090+
irqreturn_t ret;
1091+
struct apple_dart *dart = dev;
1092+
1093+
WARN_ON(pm_runtime_get_sync(dart->dev) < 0);
1094+
ret = dart->hw->irq_handler(irq, dev);
1095+
pm_runtime_put(dart->dev);
1096+
return ret;
1097+
}
1098+
10881099
static int apple_dart_probe(struct platform_device *pdev)
10891100
{
10901101
int ret;
@@ -1156,7 +1167,7 @@ static int apple_dart_probe(struct platform_device *pdev)
11561167
if (ret)
11571168
goto err_clk_disable;
11581169

1159-
ret = request_irq(dart->irq, dart->hw->irq_handler, IRQF_SHARED,
1170+
ret = request_irq(dart->irq, apple_dart_irq, IRQF_SHARED,
11601171
"apple-dart fault handler", dart);
11611172
if (ret)
11621173
goto err_clk_disable;

0 commit comments

Comments
 (0)