Patchwork [v3,6/9] drivers: pinctrl: msm: setup GPIO irqchip hierarchy

login
register
mail settings
Submitter Stephen Boyd
Date March 8, 2019, 12:59 a.m.
Message ID <155200677430.20095.14337964669558394653@swboyd.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/744185/
State New
Headers show

Comments

Stephen Boyd - March 8, 2019, 12:59 a.m.
Quoting Lina Iyer (2019-02-22 14:18:47)
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index ee8119879c4c..83053b45982e 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -890,6 +918,9 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
>  
>         raw_spin_unlock_irqrestore(&pctrl->lock, flags);

Can we remove the above hunk of code in this function? From what I can
tell we're trying to set wake on the GIC SPI line and that won't ever
work because it doesn't support wakeup support. Furthermore, I get a
lockdep splat when I try to set wake on a GPIO irq with this patchset
applied. It's probably a false positive though because it's warning
about an AA deadlock with the irq descriptor lock, which is aliased
between the two controllers.

>  
> +       if (d->parent_data)
> +               irq_chip_set_wake_parent(d, on);
> +
>         return 0;
>  }
>  

Here's a patch on top. If you need my signed-off-by please feel free to
add it:

Signed-off-by: Stephen Boyd <swboyd@chromium.org>

-----8<-------
Lina Iyer - March 8, 2019, 10:30 p.m.
On Thu, Mar 07 2019 at 17:59 -0700, Stephen Boyd wrote:
>Quoting Lina Iyer (2019-02-22 14:18:47)
>> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
>> index ee8119879c4c..83053b45982e 100644
>> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
>> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
>> @@ -890,6 +918,9 @@ static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
>>
>>         raw_spin_unlock_irqrestore(&pctrl->lock, flags);
>
>Can we remove the above hunk of code in this function? From what I can
>tell we're trying to set wake on the GIC SPI line and that won't ever
>work because it doesn't support wakeup support. Furthermore, I get a
>lockdep splat when I try to set wake on a GPIO irq with this patchset
>applied. It's probably a false positive though because it's warning
>about an AA deadlock with the irq descriptor lock, which is aliased
>between the two controllers.
>
>>
>> +       if (d->parent_data)
>> +               irq_chip_set_wake_parent(d, on);
>> +
>>         return 0;
>>  }
>>
>
>Here's a patch on top. If you need my signed-off-by please feel free to
>add it:
>
I will fold it in in my patch. It has your Co-developed-by anyways.

Thanks,
Lina

>Signed-off-by: Stephen Boyd <swboyd@chromium.org>
>
>-----8<-------
>diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
>index cdbc06ec5e96..4e81dad80a4d 100644
>--- a/drivers/pinctrl/qcom/pinctrl-msm.c
>+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
>@@ -852,20 +852,10 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
>
> static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
> {
>-	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
>-	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
>-	unsigned long flags;
>-
>-	raw_spin_lock_irqsave(&pctrl->lock, flags);
>-
>-	irq_set_irq_wake(pctrl->irq, on);
>-
>-	raw_spin_unlock_irqrestore(&pctrl->lock, flags);
>-
> 	if (d->parent_data)
>-		irq_chip_set_wake_parent(d, on);
>+		return irq_chip_set_wake_parent(d, on);
>
>-	return 0;
>+	return -ENOSYS;
> }
>
> static int msm_gpio_irq_reqres(struct irq_data *d)

Patch

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index cdbc06ec5e96..4e81dad80a4d 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -852,20 +852,10 @@  static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int type)
 
 static int msm_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
 {
-	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
-	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
-	unsigned long flags;
-
-	raw_spin_lock_irqsave(&pctrl->lock, flags);
-
-	irq_set_irq_wake(pctrl->irq, on);
-
-	raw_spin_unlock_irqrestore(&pctrl->lock, flags);
-
 	if (d->parent_data)
-		irq_chip_set_wake_parent(d, on);
+		return irq_chip_set_wake_parent(d, on);
 
-	return 0;
+	return -ENOSYS;
 }
 
 static int msm_gpio_irq_reqres(struct irq_data *d)