linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip
@ 2020-05-01  6:30 Maulik Shah
  2020-05-01 15:10 ` Doug Anderson
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maulik Shah @ 2020-05-01  6:30 UTC (permalink / raw)
  To: andy.gross, bjorn.andersson, linus.walleij
  Cc: linux-arm-msm, linux-kernel, linux-gpio, dianders, swboyd,
	rnayak, ilina, lsrao, Venkata Narendra Kumar Gutta, Maulik Shah

From: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>

Wakeup capable GPIO IRQs routed via PDC are not being migrated when a CPU
is hotplugged. Add affinity callbacks to msmgpio IRQ chip to update the
affinity of wakeup capable IRQs.

Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
[mkshah: updated commit text and minor code fixes]
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 29259fe..83b7d64 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1033,6 +1033,29 @@ static void msm_gpio_irq_relres(struct irq_data *d)
 	module_put(gc->owner);
 }
 
+static int msm_gpio_irq_set_affinity(struct irq_data *d,
+				const struct cpumask *dest, bool force)
+{
+	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
+
+	if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
+		return irq_chip_set_affinity_parent(d, dest, force);
+
+	return 0;
+}
+
+static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
+{
+	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
+	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
+
+	if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
+		return irq_chip_set_vcpu_affinity_parent(d, vcpu_info);
+
+	return 0;
+}
+
 static void msm_gpio_irq_handler(struct irq_desc *desc)
 {
 	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
@@ -1131,6 +1154,8 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
 	pctrl->irq_chip.irq_set_wake = msm_gpio_irq_set_wake;
 	pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres;
 	pctrl->irq_chip.irq_release_resources = msm_gpio_irq_relres;
+	pctrl->irq_chip.irq_set_affinity = msm_gpio_irq_set_affinity;
+	pctrl->irq_chip.irq_set_vcpu_affinity = msm_gpio_irq_set_vcpu_affinity;
 
 	np = of_parse_phandle(pctrl->dev->of_node, "wakeup-parent", 0);
 	if (np) {
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip
  2020-05-01  6:30 [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip Maulik Shah
@ 2020-05-01 15:10 ` Doug Anderson
  2020-05-03  7:53 ` Stephen Boyd
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Doug Anderson @ 2020-05-01 15:10 UTC (permalink / raw)
  To: Maulik Shah
  Cc: Andy Gross, Bjorn Andersson, LinusW, linux-arm-msm, LKML,
	open list:GPIO SUBSYSTEM, Stephen Boyd, Rajendra Nayak,
	Lina Iyer, Srinivas Rao L, Venkata Narendra Kumar Gutta

Hi,

On Thu, Apr 30, 2020 at 11:31 PM Maulik Shah <mkshah@codeaurora.org> wrote:
>
> From: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
>
> Wakeup capable GPIO IRQs routed via PDC are not being migrated when a CPU
> is hotplugged. Add affinity callbacks to msmgpio IRQ chip to update the
> affinity of wakeup capable IRQs.
>
> Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
> Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
> [mkshah: updated commit text and minor code fixes]
> Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
> ---
>  drivers/pinctrl/qcom/pinctrl-msm.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)

Tested-by: Douglas Anderson <dianders@chromium.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip
  2020-05-01  6:30 [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip Maulik Shah
  2020-05-01 15:10 ` Doug Anderson
@ 2020-05-03  7:53 ` Stephen Boyd
  2020-05-12 12:30 ` Linus Walleij
  2020-05-12 22:22 ` Bjorn Andersson
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Boyd @ 2020-05-03  7:53 UTC (permalink / raw)
  To: Maulik Shah, andy.gross, bjorn.andersson, linus.walleij
  Cc: linux-arm-msm, linux-kernel, linux-gpio, dianders, rnayak, ilina,
	lsrao, Venkata Narendra Kumar Gutta, Maulik Shah, maz

Quoting Maulik Shah (2020-04-30 23:30:17)
> From: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
> 
> Wakeup capable GPIO IRQs routed via PDC are not being migrated when a CPU
> is hotplugged. Add affinity callbacks to msmgpio IRQ chip to update the
> affinity of wakeup capable IRQs.
> 
> Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
> Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
> [mkshah: updated commit text and minor code fixes]
> Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
> ---

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip
  2020-05-01  6:30 [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip Maulik Shah
  2020-05-01 15:10 ` Doug Anderson
  2020-05-03  7:53 ` Stephen Boyd
@ 2020-05-12 12:30 ` Linus Walleij
  2020-05-12 22:22 ` Bjorn Andersson
  3 siblings, 0 replies; 5+ messages in thread
From: Linus Walleij @ 2020-05-12 12:30 UTC (permalink / raw)
  To: Maulik Shah
  Cc: Andy Gross, Bjorn Andersson, MSM, linux-kernel,
	open list:GPIO SUBSYSTEM, Doug Anderson, Stephen Boyd,
	Rajendra Nayak, Lina Iyer, lsrao, Venkata Narendra Kumar Gutta

On Fri, May 1, 2020 at 8:31 AM Maulik Shah <mkshah@codeaurora.org> wrote:

> From: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
>
> Wakeup capable GPIO IRQs routed via PDC are not being migrated when a CPU
> is hotplugged. Add affinity callbacks to msmgpio IRQ chip to update the
> affinity of wakeup capable IRQs.
>
> Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
> Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
> [mkshah: updated commit text and minor code fixes]
> Signed-off-by: Maulik Shah <mkshah@codeaurora.org>

Patch applied for fixes, will go upstream soon (unless
Bjorn stops me).

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip
  2020-05-01  6:30 [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip Maulik Shah
                   ` (2 preceding siblings ...)
  2020-05-12 12:30 ` Linus Walleij
@ 2020-05-12 22:22 ` Bjorn Andersson
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2020-05-12 22:22 UTC (permalink / raw)
  To: Maulik Shah
  Cc: andy.gross, linus.walleij, linux-arm-msm, linux-kernel,
	linux-gpio, dianders, swboyd, rnayak, ilina, lsrao,
	Venkata Narendra Kumar Gutta

On Thu 30 Apr 23:30 PDT 2020, Maulik Shah wrote:

> From: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
> 
> Wakeup capable GPIO IRQs routed via PDC are not being migrated when a CPU
> is hotplugged. Add affinity callbacks to msmgpio IRQ chip to update the
> affinity of wakeup capable IRQs.
> 
> Fixes: e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy")
> Signed-off-by: Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
> [mkshah: updated commit text and minor code fixes]
> Signed-off-by: Maulik Shah <mkshah@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

Regards,
Bjorn

> ---
>  drivers/pinctrl/qcom/pinctrl-msm.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> index 29259fe..83b7d64 100644
> --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> @@ -1033,6 +1033,29 @@ static void msm_gpio_irq_relres(struct irq_data *d)
>  	module_put(gc->owner);
>  }
>  
> +static int msm_gpio_irq_set_affinity(struct irq_data *d,
> +				const struct cpumask *dest, bool force)
> +{
> +	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> +	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
> +
> +	if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
> +		return irq_chip_set_affinity_parent(d, dest, force);
> +
> +	return 0;
> +}
> +
> +static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
> +{
> +	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> +	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
> +
> +	if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
> +		return irq_chip_set_vcpu_affinity_parent(d, vcpu_info);
> +
> +	return 0;
> +}
> +
>  static void msm_gpio_irq_handler(struct irq_desc *desc)
>  {
>  	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
> @@ -1131,6 +1154,8 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
>  	pctrl->irq_chip.irq_set_wake = msm_gpio_irq_set_wake;
>  	pctrl->irq_chip.irq_request_resources = msm_gpio_irq_reqres;
>  	pctrl->irq_chip.irq_release_resources = msm_gpio_irq_relres;
> +	pctrl->irq_chip.irq_set_affinity = msm_gpio_irq_set_affinity;
> +	pctrl->irq_chip.irq_set_vcpu_affinity = msm_gpio_irq_set_vcpu_affinity;
>  
>  	np = of_parse_phandle(pctrl->dev->of_node, "wakeup-parent", 0);
>  	if (np) {
> -- 
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-12 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01  6:30 [PATCH] pinctrl: qcom: Add affinity callbacks to msmgpio IRQ chip Maulik Shah
2020-05-01 15:10 ` Doug Anderson
2020-05-03  7:53 ` Stephen Boyd
2020-05-12 12:30 ` Linus Walleij
2020-05-12 22:22 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).