+++ /dev/null
-From d9d8939dd5a7255811fcb467b5951a5c3ba1cbbe Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 19 Apr 2022 15:18:39 +0100
-Subject: gpio: Add helpers to ease the transition towards immutable irq_chip
-
-From: Marc Zyngier <maz@kernel.org>
-
-[ Upstream commit 36b78aae4bfee749bbde73be570796bfd0f56bec ]
-
-Add a couple of new helpers to make it slightly simpler to convert
-drivers to immutable irq_chip structures:
-
-- GPIOCHIP_IRQ_RESOURCE_HELPERS populates the irq_chip structure
- with the resource management callbacks
-
-- gpio_irq_chip_set_chip() populates the gpio_irq_chip.chip
- structure, avoiding the proliferation of ugly casts
-
-Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
-Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
-Signed-off-by: Marc Zyngier <maz@kernel.org>
-Link: https://lore.kernel.org/r/20220419141846.598305-4-maz@kernel.org
-Stable-dep-of: 9860370c2172 ("gpio: xilinx: Convert gpio_lock to raw spinlock")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- include/linux/gpio/driver.h | 12 ++++++++++++
- 1 file changed, 12 insertions(+)
-
-diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
-index b241fc23ff3a2..91f60d1e3eb31 100644
---- a/include/linux/gpio/driver.h
-+++ b/include/linux/gpio/driver.h
-@@ -599,6 +599,18 @@ void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset);
- int gpiochip_irq_reqres(struct irq_data *data);
- void gpiochip_irq_relres(struct irq_data *data);
-
-+/* Paste this in your irq_chip structure */
-+#define GPIOCHIP_IRQ_RESOURCE_HELPERS \
-+ .irq_request_resources = gpiochip_irq_reqres, \
-+ .irq_release_resources = gpiochip_irq_relres
-+
-+static inline void gpio_irq_chip_set_chip(struct gpio_irq_chip *girq,
-+ const struct irq_chip *chip)
-+{
-+ /* Yes, dropping const is ugly, but it isn't like we have a choice */
-+ girq->chip = (struct irq_chip *)chip;
-+}
-+
- /* Line status inquiry for drivers */
- bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset);
- bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset);
---
-2.39.5
-
+++ /dev/null
-From dd90d8333e44d313ef8adebadb597025d77c844e Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 19 Apr 2022 15:18:37 +0100
-Subject: gpio: Don't fiddle with irqchips marked as immutable
-
-From: Marc Zyngier <maz@kernel.org>
-
-[ Upstream commit 6c846d026d490b2383d395bc8e7b06336219667b ]
-
-In order to move away from gpiolib messing with the internals of
-unsuspecting irqchips, add a flag by which irqchips advertise
-that they are not to be messed with, and do solemnly swear that
-they correctly call into the gpiolib helpers when required.
-
-Also nudge the users into converting their drivers to the
-new model.
-
-Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
-Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
-Signed-off-by: Marc Zyngier <maz@kernel.org>
-Link: https://lore.kernel.org/r/20220419141846.598305-2-maz@kernel.org
-Stable-dep-of: 9860370c2172 ("gpio: xilinx: Convert gpio_lock to raw spinlock")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib.c | 7 ++++++-
- include/linux/irq.h | 2 ++
- kernel/irq/debugfs.c | 1 +
- 3 files changed, 9 insertions(+), 1 deletion(-)
-
-diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 5eb4edcf03bd4..631eaf2e418a7 100644
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -1484,6 +1484,11 @@ static void gpiochip_set_irq_hooks(struct gpio_chip *gc)
- {
- struct irq_chip *irqchip = gc->irq.chip;
-
-+ if (irqchip->flags & IRQCHIP_IMMUTABLE)
-+ return;
-+
-+ chip_warn(gc, "not an immutable chip, please consider fixing it!\n");
-+
- if (!irqchip->irq_request_resources &&
- !irqchip->irq_release_resources) {
- irqchip->irq_request_resources = gpiochip_irq_reqres;
-@@ -1651,7 +1656,7 @@ static void gpiochip_irqchip_remove(struct gpio_chip *gc)
- irq_domain_remove(gc->irq.domain);
- }
-
-- if (irqchip) {
-+ if (irqchip && !(irqchip->flags & IRQCHIP_IMMUTABLE)) {
- if (irqchip->irq_request_resources == gpiochip_irq_reqres) {
- irqchip->irq_request_resources = NULL;
- irqchip->irq_release_resources = NULL;
-diff --git a/include/linux/irq.h b/include/linux/irq.h
-index 4fd8d900a1b86..38399d7f508fd 100644
---- a/include/linux/irq.h
-+++ b/include/linux/irq.h
-@@ -570,6 +570,7 @@ struct irq_chip {
- * IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND: Invokes __enable_irq()/__disable_irq() for wake irqs
- * in the suspend path if they are in disabled state
- * IRQCHIP_AFFINITY_PRE_STARTUP: Default affinity update before startup
-+ * IRQCHIP_IMMUTABLE: Don't ever change anything in this chip
- */
- enum {
- IRQCHIP_SET_TYPE_MASKED = (1 << 0),
-@@ -583,6 +584,7 @@ enum {
- IRQCHIP_SUPPORTS_NMI = (1 << 8),
- IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND = (1 << 9),
- IRQCHIP_AFFINITY_PRE_STARTUP = (1 << 10),
-+ IRQCHIP_IMMUTABLE = (1 << 11),
- };
-
- #include <linux/irqdesc.h>
-diff --git a/kernel/irq/debugfs.c b/kernel/irq/debugfs.c
-index e4cff358b437e..7ff52d94b42c0 100644
---- a/kernel/irq/debugfs.c
-+++ b/kernel/irq/debugfs.c
-@@ -58,6 +58,7 @@ static const struct irq_bit_descr irqchip_flags[] = {
- BIT_MASK_DESCR(IRQCHIP_SUPPORTS_LEVEL_MSI),
- BIT_MASK_DESCR(IRQCHIP_SUPPORTS_NMI),
- BIT_MASK_DESCR(IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND),
-+ BIT_MASK_DESCR(IRQCHIP_IMMUTABLE),
- };
-
- static void
---
-2.39.5
-
+++ /dev/null
-From 8eddfca81184e45bb228f8e23535629a15724fd2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Tue, 19 Apr 2022 15:18:38 +0100
-Subject: gpio: Expose the gpiochip_irq_re[ql]res helpers
-
-From: Marc Zyngier <maz@kernel.org>
-
-[ Upstream commit 704f08753b6dcd0e08c1953af0b2c7f3fac87111 ]
-
-The GPIO subsystem has a couple of internal helpers to manage
-resources on behalf of the irqchip. Expose them so that GPIO
-drivers can use them directly.
-
-Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
-Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
-Signed-off-by: Marc Zyngier <maz@kernel.org>
-Link: https://lore.kernel.org/r/20220419141846.598305-3-maz@kernel.org
-Stable-dep-of: 9860370c2172 ("gpio: xilinx: Convert gpio_lock to raw spinlock")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib.c | 6 ++++--
- include/linux/gpio/driver.h | 4 ++++
- 2 files changed, 8 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
-index 631eaf2e418a7..d1e553529b354 100644
---- a/drivers/gpio/gpiolib.c
-+++ b/drivers/gpio/gpiolib.c
-@@ -1432,19 +1432,21 @@ static int gpiochip_to_irq(struct gpio_chip *gc, unsigned int offset)
- return irq_create_mapping(domain, offset);
- }
-
--static int gpiochip_irq_reqres(struct irq_data *d)
-+int gpiochip_irq_reqres(struct irq_data *d)
- {
- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
-
- return gpiochip_reqres_irq(gc, d->hwirq);
- }
-+EXPORT_SYMBOL(gpiochip_irq_reqres);
-
--static void gpiochip_irq_relres(struct irq_data *d)
-+void gpiochip_irq_relres(struct irq_data *d)
- {
- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
-
- gpiochip_relres_irq(gc, d->hwirq);
- }
-+EXPORT_SYMBOL(gpiochip_irq_relres);
-
- static void gpiochip_irq_mask(struct irq_data *d)
- {
-diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
-index 65df2ce96f0b1..b241fc23ff3a2 100644
---- a/include/linux/gpio/driver.h
-+++ b/include/linux/gpio/driver.h
-@@ -595,6 +595,10 @@ void gpiochip_relres_irq(struct gpio_chip *gc, unsigned int offset);
- void gpiochip_disable_irq(struct gpio_chip *gc, unsigned int offset);
- void gpiochip_enable_irq(struct gpio_chip *gc, unsigned int offset);
-
-+/* irq_data versions of the above */
-+int gpiochip_irq_reqres(struct irq_data *data);
-+void gpiochip_irq_relres(struct irq_data *data);
-+
- /* Line status inquiry for drivers */
- bool gpiochip_line_is_open_drain(struct gpio_chip *gc, unsigned int offset);
- bool gpiochip_line_is_open_source(struct gpio_chip *gc, unsigned int offset);
---
-2.39.5
-
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/gpio/gpio-xilinx.c | 32 ++++++++++++++++----------------
+ drivers/gpio/gpio-xilinx.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
-diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
-index 067ac1805853c..908730d8dc955 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -66,7 +66,7 @@ struct xgpio_instance {
- spinlock_t gpio_lock; /* For serializing operations */
+ raw_spinlock_t gpio_lock; /* For serializing operations */
int irq;
+ struct irq_chip irqchip;
DECLARE_BITMAP(enable, 64);
- DECLARE_BITMAP(rising_edge, 64);
-@@ -178,14 +178,14 @@ static void xgpio_set(struct gpio_chip *gc, unsigned int gpio, int val)
+@@ -179,14 +179,14 @@ static void xgpio_set(struct gpio_chip *
struct xgpio_instance *chip = gpiochip_get_data(gc);
int bit = xgpio_to_bit(chip, gpio);
}
/**
-@@ -209,7 +209,7 @@ static void xgpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
+@@ -210,7 +210,7 @@ static void xgpio_set_multiple(struct gp
bitmap_remap(hw_mask, mask, chip->sw_map, chip->hw_map, 64);
bitmap_remap(hw_bits, bits, chip->sw_map, chip->hw_map, 64);
bitmap_replace(state, chip->state, hw_bits, hw_mask, 64);
-@@ -217,7 +217,7 @@ static void xgpio_set_multiple(struct gpio_chip *gc, unsigned long *mask,
+@@ -218,7 +218,7 @@ static void xgpio_set_multiple(struct gp
bitmap_copy(chip->state, state, 64);
}
/**
-@@ -235,13 +235,13 @@ static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
+@@ -236,13 +236,13 @@ static int xgpio_dir_in(struct gpio_chip
struct xgpio_instance *chip = gpiochip_get_data(gc);
int bit = xgpio_to_bit(chip, gpio);
return 0;
}
-@@ -264,7 +264,7 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
+@@ -265,7 +265,7 @@ static int xgpio_dir_out(struct gpio_chi
struct xgpio_instance *chip = gpiochip_get_data(gc);
int bit = xgpio_to_bit(chip, gpio);
/* Write state of GPIO signal */
__assign_bit(bit, chip->state, val);
-@@ -274,7 +274,7 @@ static int xgpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
+@@ -275,7 +275,7 @@ static int xgpio_dir_out(struct gpio_chi
__clear_bit(bit, chip->dir);
xgpio_write_ch(chip, XGPIO_TRI_OFFSET, bit, chip->dir);
return 0;
}
-@@ -404,7 +404,7 @@ static void xgpio_irq_mask(struct irq_data *irq_data)
+@@ -405,7 +405,7 @@ static void xgpio_irq_mask(struct irq_da
int bit = xgpio_to_bit(chip, irq_offset);
u32 mask = BIT(bit / 32), temp;
__clear_bit(bit, chip->enable);
-@@ -414,7 +414,7 @@ static void xgpio_irq_mask(struct irq_data *irq_data)
+@@ -415,7 +415,7 @@ static void xgpio_irq_mask(struct irq_da
temp &= ~mask;
xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, temp);
}
- spin_unlock_irqrestore(&chip->gpio_lock, flags);
+ raw_spin_unlock_irqrestore(&chip->gpio_lock, flags);
-
- gpiochip_disable_irq(&chip->gc, irq_offset);
}
-@@ -434,7 +434,7 @@ static void xgpio_irq_unmask(struct irq_data *irq_data)
- gpiochip_enable_irq(&chip->gc, irq_offset);
+ /**
+@@ -431,7 +431,7 @@ static void xgpio_irq_unmask(struct irq_
+ u32 old_enable = xgpio_get_value32(chip->enable, bit);
+ u32 mask = BIT(bit / 32), val;
- spin_lock_irqsave(&chip->gpio_lock, flags);
+ raw_spin_lock_irqsave(&chip->gpio_lock, flags);
__set_bit(bit, chip->enable);
-@@ -453,7 +453,7 @@ static void xgpio_irq_unmask(struct irq_data *irq_data)
+@@ -450,7 +450,7 @@ static void xgpio_irq_unmask(struct irq_
xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, val);
}
}
/**
-@@ -518,7 +518,7 @@ static void xgpio_irqhandler(struct irq_desc *desc)
+@@ -515,7 +515,7 @@ static void xgpio_irqhandler(struct irq_
chained_irq_enter(irqchip, desc);
xgpio_read_ch_all(chip, XGPIO_DATA_OFFSET, all);
-@@ -535,7 +535,7 @@ static void xgpio_irqhandler(struct irq_desc *desc)
+@@ -532,7 +532,7 @@ static void xgpio_irqhandler(struct irq_
bitmap_copy(chip->last_irq_read, all, 64);
bitmap_or(all, rising, falling, 64);
dev_dbg(gc->parent, "IRQ rising %*pb falling %*pb\n", 64, rising, 64, falling);
-@@ -636,7 +636,7 @@ static int xgpio_probe(struct platform_device *pdev)
+@@ -623,7 +623,7 @@ static int xgpio_probe(struct platform_d
bitmap_set(chip->hw_map, 0, width[0]);
bitmap_set(chip->hw_map, 32, width[1]);
chip->gc.base = -1;
chip->gc.ngpio = bitmap_weight(chip->hw_map, 64);
---
-2.39.5
-
+++ /dev/null
-From df3ea82de54a8228241d9d417377bf2ad77453d2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 20 Mar 2023 10:55:15 +0100
-Subject: gpio: xilinx: Convert to immutable irq_chip
-
-From: Linus Walleij <linus.walleij@linaro.org>
-
-[ Upstream commit b4510f8fd5d0e9afa777f115871f5d522540c417 ]
-
-Convert the driver to immutable irq-chip with a bit of
-intuition.
-
-Cc: Marc Zyngier <maz@kernel.org>
-Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-Reviewed-by: Marc Zyngier <maz@kernel.org>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: 9860370c2172 ("gpio: xilinx: Convert gpio_lock to raw spinlock")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpio-xilinx.c | 23 +++++++++++++++--------
- 1 file changed, 15 insertions(+), 8 deletions(-)
-
-diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
-index db616ae560a3c..067ac1805853c 100644
---- a/drivers/gpio/gpio-xilinx.c
-+++ b/drivers/gpio/gpio-xilinx.c
-@@ -68,7 +68,6 @@ struct xgpio_instance {
- DECLARE_BITMAP(dir, 64);
- spinlock_t gpio_lock; /* For serializing operations */
- int irq;
-- struct irq_chip irqchip;
- DECLARE_BITMAP(enable, 64);
- DECLARE_BITMAP(rising_edge, 64);
- DECLARE_BITMAP(falling_edge, 64);
-@@ -416,6 +415,8 @@ static void xgpio_irq_mask(struct irq_data *irq_data)
- xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, temp);
- }
- spin_unlock_irqrestore(&chip->gpio_lock, flags);
-+
-+ gpiochip_disable_irq(&chip->gc, irq_offset);
- }
-
- /**
-@@ -431,6 +432,8 @@ static void xgpio_irq_unmask(struct irq_data *irq_data)
- u32 old_enable = xgpio_get_value32(chip->enable, bit);
- u32 mask = BIT(bit / 32), val;
-
-+ gpiochip_enable_irq(&chip->gc, irq_offset);
-+
- spin_lock_irqsave(&chip->gpio_lock, flags);
-
- __set_bit(bit, chip->enable);
-@@ -544,6 +547,16 @@ static void xgpio_irqhandler(struct irq_desc *desc)
- chained_irq_exit(irqchip, desc);
- }
-
-+static const struct irq_chip xgpio_irq_chip = {
-+ .name = "gpio-xilinx",
-+ .irq_ack = xgpio_irq_ack,
-+ .irq_mask = xgpio_irq_mask,
-+ .irq_unmask = xgpio_irq_unmask,
-+ .irq_set_type = xgpio_set_irq_type,
-+ .flags = IRQCHIP_IMMUTABLE,
-+ GPIOCHIP_IRQ_RESOURCE_HELPERS,
-+};
-+
- /**
- * xgpio_probe - Probe method for the GPIO device.
- * @pdev: pointer to the platform device
-@@ -664,12 +677,6 @@ static int xgpio_probe(struct platform_device *pdev)
- if (chip->irq <= 0)
- goto skip_irq;
-
-- chip->irqchip.name = "gpio-xilinx";
-- chip->irqchip.irq_ack = xgpio_irq_ack;
-- chip->irqchip.irq_mask = xgpio_irq_mask;
-- chip->irqchip.irq_unmask = xgpio_irq_unmask;
-- chip->irqchip.irq_set_type = xgpio_set_irq_type;
--
- /* Disable per-channel interrupts */
- xgpio_writereg(chip->regs + XGPIO_IPIER_OFFSET, 0);
- /* Clear any existing per-channel interrupts */
-@@ -679,7 +686,7 @@ static int xgpio_probe(struct platform_device *pdev)
- xgpio_writereg(chip->regs + XGPIO_GIER_OFFSET, XGPIO_GIER_IE);
-
- girq = &chip->gc.irq;
-- girq->chip = &chip->irqchip;
-+ gpio_irq_chip_set_chip(girq, &xgpio_irq_chip);
- girq->parent_handler = xgpio_irqhandler;
- girq->num_parents = 1;
- girq->parents = devm_kcalloc(&pdev->dev, 1,
---
-2.39.5
-
usb-chipidea-ci_hdrc_imx-decrement-device-s-refcount.patch
net-ncsi-add-nc-si-1.2-get-mc-mac-address-command.patch
net-ncsi-fix-locking-in-get-mac-address-handling.patch
-gpio-don-t-fiddle-with-irqchips-marked-as-immutable.patch
-gpio-expose-the-gpiochip_irq_re-ql-res-helpers.patch
-gpio-add-helpers-to-ease-the-transition-towards-immu.patch
-gpio-xilinx-convert-to-immutable-irq_chip.patch
gpio-xilinx-convert-gpio_lock-to-raw-spinlock.patch
xfs-report-realtime-block-quota-limits-on-realtime-d.patch
xfs-don-t-over-report-free-space-or-inodes-in-statvf.patch