796ca74b4d6464395933fa777ba81b742c18200c
[openwrt/staging/981213.git] /
1 From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2 To: linus.walleij@linaro.org
3 Cc: bjorn.andersson@linaro.org, dianders@chromium.org,
4 linux-arm-msm@vger.kernel.org, linux-gpio@vger.kernel.org,
5 linux-kernel@vger.kernel.org,
6 Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
7 Subject: [PATCH] pinctrl: qcom: Return -EINVAL for setting affinity if no IRQ
8 parent
9 Date: Thu, 13 Jan 2022 21:56:17 +0530
10 Message-Id: <20220113162617.131697-1-manivannan.sadhasivam@linaro.org>
11
12 The MSM GPIO IRQ controller relies on the parent IRQ controller to set the
13 CPU affinity for the IRQ. And this is only valid if there is any wakeup
14 parent available and defined in DT.
15
16 For the case of no parent IRQ controller defined in DT,
17 msm_gpio_irq_set_affinity() and msm_gpio_irq_set_vcpu_affinity() should
18 return -EINVAL instead of 0 as the affinity can't be set.
19
20 Otherwise, below warning will be printed by genirq:
21
22 genirq: irq_chip msmgpio did not update eff. affinity mask of irq 70
23
24 Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
25 ---
26 drivers/pinctrl/qcom/pinctrl-msm.c | 4 ++--
27 1 file changed, 2 insertions(+), 2 deletions(-)
28
29 diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
30 index 8476a8ac4451..a42ff4b22a04 100644
31 --- a/drivers/pinctrl/qcom/pinctrl-msm.c
32 +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
33 @@ -1157,7 +1157,7 @@ static int msm_gpio_irq_set_affinity(struct irq_data *d,
34 if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
35 return irq_chip_set_affinity_parent(d, dest, force);
36
37 - return 0;
38 + return -EINVAL;
39 }
40
41 static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
42 @@ -1168,7 +1168,7 @@ static int msm_gpio_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu_info)
43 if (d->parent_data && test_bit(d->hwirq, pctrl->skip_wake_irqs))
44 return irq_chip_set_vcpu_affinity_parent(d, vcpu_info);
45
46 - return 0;
47 + return -EINVAL;
48 }
49
50 static void msm_gpio_irq_handler(struct irq_desc *desc)