2022-09-28 14:49:43

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/2] slimbus: qcom-ngd-ctrl: check for device runtime PM status during ISR

Slimbus core interrupt is getting fired after suspend. At this point
ADSP slimbus hardware is off with gated clocks which is leading to an
unclocked access when HLOS slimbus tried to read the interrupt
status register in the ISR.

Co-developed-by: Chandana Kishori Chiluveru <[email protected]>
Signed-off-by: Chandana Kishori Chiluveru <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
drivers/slimbus/qcom-ngd-ctrl.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index cec11aa106bf..ba36eb5c0de3 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -763,7 +763,14 @@ static irqreturn_t qcom_slim_ngd_interrupt(int irq, void *d)
{
struct qcom_slim_ngd_ctrl *ctrl = d;
void __iomem *base = ctrl->ngd->base;
- u32 stat = readl(base + NGD_INT_STAT);
+ u32 stat;
+
+ if (pm_runtime_suspended(ctrl->ctrl.dev)) {
+ dev_warn_once(ctrl->dev, "Interrupt received while suspended\n");
+ return IRQ_NONE;
+ }
+
+ stat = readl(base + NGD_INT_STAT);

if ((stat & NGD_INT_MSG_BUF_CONTE) ||
(stat & NGD_INT_MSG_TX_INVAL) || (stat & NGD_INT_DEV_ERR) ||
--
2.34.1


2022-10-31 18:42:52

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH 1/2] slimbus: qcom-ngd-ctrl: check for device runtime PM status during ISR



On 28/09/2022 14:20, Krzysztof Kozlowski wrote:
> Slimbus core interrupt is getting fired after suspend. At this point
> ADSP slimbus hardware is off with gated clocks which is leading to an
> unclocked access when HLOS slimbus tried to read the interrupt
> status register in the ISR.
>
> Co-developed-by: Chandana Kishori Chiluveru <[email protected]>
> Signed-off-by: Chandana Kishori Chiluveru <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---

Applied both,

--srini
> drivers/slimbus/qcom-ngd-ctrl.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
> index cec11aa106bf..ba36eb5c0de3 100644
> --- a/drivers/slimbus/qcom-ngd-ctrl.c
> +++ b/drivers/slimbus/qcom-ngd-ctrl.c
> @@ -763,7 +763,14 @@ static irqreturn_t qcom_slim_ngd_interrupt(int irq, void *d)
> {
> struct qcom_slim_ngd_ctrl *ctrl = d;
> void __iomem *base = ctrl->ngd->base;
> - u32 stat = readl(base + NGD_INT_STAT);
> + u32 stat;
> +
> + if (pm_runtime_suspended(ctrl->ctrl.dev)) {
> + dev_warn_once(ctrl->dev, "Interrupt received while suspended\n");
> + return IRQ_NONE;
> + }
> +
> + stat = readl(base + NGD_INT_STAT);
>
> if ((stat & NGD_INT_MSG_BUF_CONTE) ||
> (stat & NGD_INT_MSG_TX_INVAL) || (stat & NGD_INT_DEV_ERR) ||