Skip to contentSkip to conversation

pinctrl: intel: irq_pipeline: enable pipelined interrupt control for pintctrl-intel

PATCH In review Hongzhan Chen 3 participants 4 messages Sep 4, 2023 – Jul 12, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pinctrl: intel: irq_pipeline: enable pipelined interrupt control for pintctrl-intel

This is required to run the locking code from the pipeline entry context and the out-of-band stage.

drivers/pinctrl/intel/pinctrl-intel.c +2 -1
index 2ef9e2d8fd9c..7797618a899b 100644
@@ -1322,7 +1322,8 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
 	pctrl->irqchip.irq_unmask = intel_gpio_irq_unmask;
 	pctrl->irqchip.irq_set_type = intel_gpio_irq_type;
 	pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake;
-	pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND;
+	pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND |
+			IRQCHIP_PIPELINE_SAFE;
 
 	/*
 	 * On some platforms several GPIO controllers share the same interrupt
drivers/pinctrl/intel/pinctrl-intel.h +1 -1
index ad34b7a3f6ed..89ef4e37511f 100644
@@ -228,7 +228,7 @@ struct intel_pinctrl_context {
  */
 struct intel_pinctrl {
 	struct device *dev;
-	raw_spinlock_t lock;
+	hard_spinlock_t lock;
 	struct pinctrl_desc pctldesc;
 	struct pinctrl_dev *pctldev;
 	struct gpio_chip chip;
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 pinctrl: intel: irq_pipeline: enable pipelined interrupt control for pinctrl-baytrail

This is required to run the locking code from the pipeline entry context and the out-of-band stage.

drivers/pinctrl/intel/pinctrl-baytrail.c +3 -2
index 394a421a19d5..6fae9ab9d913 100644
@@ -538,7 +538,7 @@ static const struct intel_pinctrl_soc_data *byt_soc_data[] = {
 	NULL
 };
 
-static DEFINE_RAW_SPINLOCK(byt_lock);
+static DEFINE_HARD_SPINLOCK(byt_lock);
 
 static struct intel_community *byt_get_community(struct intel_pinctrl *vg,
 						 unsigned int pin)
@@ -1580,7 +1580,8 @@ static int byt_gpio_probe(struct intel_pinctrl *vg)
 		vg->irqchip.irq_mask = byt_irq_mask,
 		vg->irqchip.irq_unmask = byt_irq_unmask,
 		vg->irqchip.irq_set_type = byt_irq_type,
-		vg->irqchip.flags = IRQCHIP_SKIP_SET_WAKE,
+		vg->irqchip.flags = IRQCHIP_SKIP_SET_WAKE |
+			IRQCHIP_PIPELINE_SAFE,
 
 		girq = &gc->irq;
 		girq->chip = &vg->irqchip;
Signature · 1 line
2.17.1
#2 lore raw
In reply to Hongzhan Chen
Quoted 25 lines · Hongzhan Chen

This is required to run the locking code from the pipeline entry context and the out-of-band stage.

drivers/pinctrl/intel/pinctrl-intel.c +2 -1
index 2ef9e2d8fd9c..7797618a899b 100644
@@ -1322,7 +1322,8 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
        pctrl->irqchip.irq_unmask = intel_gpio_irq_unmask;
        pctrl->irqchip.irq_set_type = intel_gpio_irq_type;
        pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake;
-       pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND;
+       pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND |
+                       IRQCHIP_PIPELINE_SAFE;
 
        /*
         * On some platforms several GPIO controllers share the same interrupt
drivers/pinctrl/intel/pinctrl-intel.h +0 -0
index ad34b7a3f6ed..89ef4e37511f 100644

drivers/pinctrl/intel/pinctrl-intel.h struct intel_pinctrl_context {

Quoted 9 lines
drivers/pinctrl/intel/pinctrl-intel.h +1 -2
@@ -228,7 +228,7 @@ struct intel_pinctrl_context {
  */
 struct intel_pinctrl {
        struct device *dev;
-       raw_spinlock_t lock;
+       hard_spinlock_t lock;
        struct pinctrl_desc pctldesc;
        struct pinctrl_dev *pctldev;
        struct gpio_chip chip;
--

What is the status of these two patches?
AFAIK, they never made it upstream.

Signature · 2 lines
Thanks,
//richard
#3 lore raw
Quoted 30 lines · Richard Weinberger
Quoted 29 lines · Hongzhan Chen

This is required to run the locking code from the pipeline entry context and the out-of-band stage.

drivers/pinctrl/intel/pinctrl-intel.c +2 -1
index 2ef9e2d8fd9c..7797618a899b 100644
@@ -1322,7 +1322,8 @@ static int intel_gpio_probe(struct intel_pinctrl *pctrl, int irq)
        pctrl->irqchip.irq_unmask = intel_gpio_irq_unmask;
        pctrl->irqchip.irq_set_type = intel_gpio_irq_type;
        pctrl->irqchip.irq_set_wake = intel_gpio_irq_wake;
-       pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND;
+       pctrl->irqchip.flags = IRQCHIP_MASK_ON_SUSPEND |
+                       IRQCHIP_PIPELINE_SAFE;
 
        /*
         * On some platforms several GPIO controllers share the same interrupt
drivers/pinctrl/intel/pinctrl-intel.h +0 -1
index ad34b7a3f6ed..89ef4e37511f 100644
@@ -228,7 +228,7 @@ struct intel_pinctrl_context {
  */
 struct intel_pinctrl {
        struct device *dev;
-       raw_spinlock_t lock;
Quoted 8 lines

drivers/pinctrl/intel/pinctrl-intel.h struct intel_pinctrl_context {

Quoted 5 lines
drivers/pinctrl/intel/pinctrl-intel.h +1 -1
+       hard_spinlock_t lock;
        struct pinctrl_desc pctldesc;
        struct pinctrl_dev *pctldev;
        struct gpio_chip chip;
--

What is the status of these two patches?
AFAIK, they never made it upstream.

These fell through the cracks in the -rebase branches, at least, likely because the target kernel was unspecified. They look ok to me (baytail may need actual testing, but looks good at first glance).

These patches do not apply to any of the current Dovetail stable releases (v6.1, v6.6). It looks like those patches may apply cleanly to to v5.10 and v5.15 though. IOW, a forward port is needed for v6.x and on.

Signature · 1 line
Philippe.