linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: qcom: Return -EINVAL for setting affinity if no IRQ parent
@ 2022-01-13 16:26 Manivannan Sadhasivam
  2022-01-16 12:02 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Manivannan Sadhasivam @ 2022-01-13 16:26 UTC (permalink / raw)
  To: linus.walleij
  Cc: bjorn.andersson, dianders, linux-arm-msm, linux-gpio,
	linux-kernel, Manivannan Sadhasivam

The MSM GPIO IRQ controller relies on the parent IRQ controller to set the
CPU affinity for the IRQ. And this is only valid if there is any wakeup
parent available and defined in DT.

For the case of no parent IRQ controller defined in DT,
msm_gpio_irq_set_affinity() and msm_gpio_irq_set_vcpu_affinity() should
return -EINVAL instead of 0 as the affinity can't be set.

Otherwise, below warning will be printed by genirq:

genirq: irq_chip msmgpio did not update eff. affinity mask of irq 70

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
---
 drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
index 8476a8ac4451..a42ff4b22a04 100644
--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -1157,7 +1157,7 @@ static int msm_gpio_irq_set_affinity(struct irq_data *d,
 	if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
 		return irq_chip_set_affinity_parent(d, dest, force);
 
-	return 0;
+	return -EINVAL;
 }
 
 static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
@@ -1168,7 +1168,7 @@ static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
 	if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
 		return irq_chip_set_vcpu_affinity_parent(d, vcpu_info);
 
-	return 0;
+	return -EINVAL;
 }
 
 static void msm_gpio_irq_handler(struct irq_desc *desc)
-- 
2.25.1


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

* Re: [PATCH] pinctrl: qcom: Return -EINVAL for setting affinity if no IRQ parent
  2022-01-13 16:26 [PATCH] pinctrl: qcom: Return -EINVAL for setting affinity if no IRQ parent Manivannan Sadhasivam
@ 2022-01-16 12:02 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2022-01-16 12:02 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: bjorn.andersson, dianders, linux-arm-msm, linux-gpio, linux-kernel

On Thu, Jan 13, 2022 at 5:26 PM Manivannan Sadhasivam
<manivannan.sadhasivam@linaro.org> wrote:

> The MSM GPIO IRQ controller relies on the parent IRQ controller to set the
> CPU affinity for the IRQ. And this is only valid if there is any wakeup
> parent available and defined in DT.
>
> For the case of no parent IRQ controller defined in DT,
> msm_gpio_irq_set_affinity() and msm_gpio_irq_set_vcpu_affinity() should
> return -EINVAL instead of 0 as the affinity can't be set.
>
> Otherwise, below warning will be printed by genirq:
>
> genirq: irq_chip msmgpio did not update eff. affinity mask of irq 70
>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Patch applied for v5.18!

Yours,
Linus Walleij

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

end of thread, other threads:[~2022-01-16 12:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 16:26 [PATCH] pinctrl: qcom: Return -EINVAL for setting affinity if no IRQ parent Manivannan Sadhasivam
2022-01-16 12:02 ` Linus Walleij

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).