Skip to contentSkip to conversation

FAILED: patch "[PATCH] pinctrl: qcom: Properly clear "intr_ack_high" interrupts when" failed to apply to 5.10-stable tree

PATCH [email protected] 2 participants 3 messages Jan 25, 2021

Subsystems (5)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From a95881d6aa2c000e3649f27a1a7329cf356e6bb3 Mon Sep 17 00:00:00 2001
From: Douglas Anderson <[email protected]>
Date: Thu, 14 Jan 2021 19:16:23 -0800
Subject: [PATCH] pinctrl: qcom: Properly clear "intr_ack_high" interrupts when
unmasking

In commit 4b7618fdc7e6 ("pinctrl: qcom: Add irq_enable callback for msm gpio") we tried to Ack interrupts during unmask. However, that patch forgot to check "intr_ack_high" so, presumably, it only worked for a certain subset of SoCs.

Let's add a small accessor so we don't need to open-code the logic in both places.

This was found by code inspection. I don't have any access to the hardware in question nor software that needs the Ack during unmask.

drivers/pinctrl/qcom/pinctrl-msm.c +10 -4
index 2f363c28d9d9..192ed31eabf4 100644
@@ -96,6 +96,14 @@ MSM_ACCESSOR(intr_cfg)
 MSM_ACCESSOR(intr_status)
 MSM_ACCESSOR(intr_target)
 
+static void msm_ack_intr_status(struct msm_pinctrl *pctrl,
+				const struct msm_pingroup *g)
+{
+	u32 val = g->intr_ack_high ? BIT(g->intr_status_bit) : 0;
+
+	msm_writel_intr_status(val, pctrl, g);
+}
+
 static int msm_get_groups_count(struct pinctrl_dev *pctldev)
 {
 	struct msm_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev);
@@ -797,7 +805,7 @@ static void msm_gpio_irq_clear_unmask(struct irq_data *d, bool status_clear)
 	 * when the interrupt is not in use.
 	 */
 	if (status_clear)
-		msm_writel_intr_status(0, pctrl, g);
+		msm_ack_intr_status(pctrl, g);
 
 	val = msm_readl_intr_cfg(pctrl, g);
 	val |= BIT(g->intr_raw_status_bit);
@@ -890,7 +898,6 @@ static void msm_gpio_irq_ack(struct irq_data *d)
 	struct msm_pinctrl *pctrl = gpiochip_get_data(gc);
 	const struct msm_pingroup *g;
 	unsigned long flags;
-	u32 val;
 
 	if (test_bit(d->hwirq, pctrl->skip_wake_irqs)) {
 		if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
@@ -902,8 +909,7 @@ static void msm_gpio_irq_ack(struct irq_data *d)
 
 	raw_spin_lock_irqsave(&pctrl->lock, flags);
 
-	val = g->intr_ack_high ? BIT(g->intr_status_bit) : 0;
-	msm_writel_intr_status(val, pctrl, g);
+	msm_ack_intr_status(pctrl, g);
 
 	if (test_bit(d->hwirq, pctrl->dual_edge_irqs))
 		msm_gpio_update_dual_edge_pos(pctrl, g, d);
#1 lore raw

Hi,

Quoted 11 lines · On Mon, Jan 25, 2021 at 6:41 AM <[email protected]> wrote:

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

Quoted 7 lines

------------------ original commit in Linus's tree ------------------

From a95881d6aa2c000e3649f27a1a7329cf356e6bb3 Mon Sep 17 00:00:00 2001
From: Douglas Anderson <[email protected]>
Date: Thu, 14 Jan 2021 19:16:23 -0800
Subject: [PATCH] pinctrl: qcom: Properly clear "intr_ack_high" interrupts when
unmasking

For 5.10, we should just take these 4 patches:

cf9d052aa600 pinctrl: qcom: Don't clear pending interrupts when enabling a95881d6aa2c pinctrl: qcom: Properly clear "intr_ack_high" interrupts when unmasking
4079d35fa4fc pinctrl: qcom: No need to read-modify-write the interrupt status a82e537807d5 pinctrl: qcom: Allow SoCs to specify a GPIO function that's not 0

If we apply all 4 together we should be good and no backport should be needed.

-Doug

author maintainer
#2 lore raw
Quoted 24 lines · Doug Anderson

Hi,

Quoted 11 lines · On Mon, Jan 25, 2021 at 6:41 AM <[email protected]> wrote:

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

Quoted 7 lines

------------------ original commit in Linus's tree ------------------

From a95881d6aa2c000e3649f27a1a7329cf356e6bb3 Mon Sep 17 00:00:00 2001
From: Douglas Anderson <[email protected]>
Date: Thu, 14 Jan 2021 19:16:23 -0800
Subject: [PATCH] pinctrl: qcom: Properly clear "intr_ack_high" interrupts when
unmasking

For 5.10, we should just take these 4 patches:

Quoted 7 lines

cf9d052aa600 pinctrl: qcom: Don't clear pending interrupts when enabling a95881d6aa2c pinctrl: qcom: Properly clear "intr_ack_high" interrupts when unmasking
4079d35fa4fc pinctrl: qcom: No need to read-modify-write the interrupt status a82e537807d5 pinctrl: qcom: Allow SoCs to specify a GPIO function that's not 0

If we apply all 4 together we should be good and no backport should be needed.

That worked, thanks!

greg k-h