Commit 0df34a80 authored by Liviu Dudau's avatar Liviu Dudau

drm/mali-dp: Check PM status when sharing interrupt lines

If an instance of Mali DP hardware shares the interrupt line with
another hardware (usually another instance of the Mali DP) its
interrupt handler can get called when the device is suspended.

Check the PM status before making access to the hardware registers
to avoid deadlocks.
Signed-off-by: default avatarLiviu Dudau <Liviu.Dudau@arm.com>
parent e2113c03
...@@ -766,12 +766,17 @@ static irqreturn_t malidp_de_irq(int irq, void *arg) ...@@ -766,12 +766,17 @@ static irqreturn_t malidp_de_irq(int irq, void *arg)
u32 status, mask, dc_status; u32 status, mask, dc_status;
irqreturn_t ret = IRQ_NONE; irqreturn_t ret = IRQ_NONE;
if (!drm->dev_private)
return IRQ_HANDLED;
hwdev = malidp->dev; hwdev = malidp->dev;
de = &hwdev->map.de_irq_map; de = &hwdev->map.de_irq_map;
/*
* if we are suspended it is likely that we were invoked because
* we share an interrupt line with some other driver, don't try
* to read the hardware registers
*/
if (hwdev->pm_suspended)
return IRQ_NONE;
/* first handle the config valid IRQ */ /* first handle the config valid IRQ */
dc_status = malidp_hw_read(hwdev, hwdev->map.dc_base + MALIDP_REG_STATUS); dc_status = malidp_hw_read(hwdev, hwdev->map.dc_base + MALIDP_REG_STATUS);
if (dc_status & hwdev->map.dc_irq_map.vsync_irq) { if (dc_status & hwdev->map.dc_irq_map.vsync_irq) {
...@@ -854,6 +859,14 @@ static irqreturn_t malidp_se_irq(int irq, void *arg) ...@@ -854,6 +859,14 @@ static irqreturn_t malidp_se_irq(int irq, void *arg)
struct malidp_hw_device *hwdev = malidp->dev; struct malidp_hw_device *hwdev = malidp->dev;
u32 status, mask; u32 status, mask;
/*
* if we are suspended it is likely that we were invoked because
* we share an interrupt line with some other driver, don't try
* to read the hardware registers
*/
if (hwdev->pm_suspended)
return IRQ_NONE;
status = malidp_hw_read(hwdev, hwdev->map.se_base + MALIDP_REG_STATUS); status = malidp_hw_read(hwdev, hwdev->map.se_base + MALIDP_REG_STATUS);
if (!(status & hwdev->map.se_irq_map.irq_mask)) if (!(status & hwdev->map.se_irq_map.irq_mask))
return IRQ_NONE; return IRQ_NONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment