* [PATCH 00/42] of: reserved_mem: Introduce devres helpers and convert drivers
From: Mukesh Ojha @ 2026-07-03 19:38 UTC (permalink / raw)
To: Bjorn Andersson, Konrad Dybcio, Liviu Dudau, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Joel Stanley, Andrew Jeffery, Paul Cercueil, Anitha Chrisanthus,
Paul Kocialkowski, Linus Walleij, Chen-Yu Tsai, Jernej Skrabec,
Samuel Holland, Alexey Brodkin, Laurent Pinchart, Tomi Valkeinen,
Michal Simek, Daniel Scally, Jacopo Mondi, Mauro Carvalho Chehab,
Eddie James, Tiffany Lin, Andrew-CT Chen, Yunfei Dong,
Minghsiu Tsai, Houlong Wei, Matthias Brugger,
AngeloGioacchino Del Regno, Joseph Liu, Marvin Lin,
Dmitry Osipenko, Krzysztof Kozlowski, Thierry Reding,
Jonathan Hunter, Srinivas Kandagatla, Arnd Bergmann,
Greg Kroah-Hartman, Ge Gordon, Adrian Hunter, Ulf Hansson,
Rob Herring, Saravana Kannan, Mathieu Poirier, Jaroslav Kysela,
Takashi Iwai, Shengjiu Wang, Xiubo Li, Liam Girdwood, Mark Brown,
Frank Li, Sascha Hauer, Peter Ujfalusi, Bard Liao, Daniel Baluta,
Orson Zhai, Baolin Wang, Peter Chen, Fugang Duan
Cc: Ekansh Gupta, BST Linux Kernel Upstream Group, Fabio Estevam,
Nicolin Chen, Pengutronix Kernel Team, Kai Vehmanen,
Pierre-Louis Bossart, Vijendar Mukunda, Chunyan Zhang,
CIX Linux Kernel Upstream Group, linux-arm-msm, linux-kernel,
dri-devel, linux-aspeed, linux-arm-kernel, linux-mips,
linux-sunxi, linux-media, openbmc, linux-mediatek, kernel,
linux-tegra, linux-mmc, devicetree, linux-remoteproc,
linux-staging, linux-sound, linuxppc-dev, imx,
sound-open-firmware, Mukesh Ojha
Drivers using of_reserved_mem_device_init() and its variants must
manually call of_reserved_mem_device_release() in their remove and
error-unwind paths. This is repetitive boilerplate that is easy to
get wrong, and several drivers have open-coded the teardown
inconsistently or skipped it entirely, leading to dangling reserved
memory references.
This series introduces devres-managed wrappers —
devm_of_reserved_mem_device_init(), devm_of_reserved_mem_device_init_by_idx(),
and devm_of_reserved_mem_device_init_by_name() — that tie the reserved
memory region lifetime to the device, releasing it automatically on
unbind. The remaining 40 patches convert drivers across the drm, media,
ASoC, remoteproc, firmware, mmc, memory and misc subsystems to use these
helpers, yielding a net reduction of ~90 lines of boilerplate.
This series depends on https://lore.kernel.org/lkml/20260703164457.4040457-1-mukesh.ojha@oss.qualcomm.com/
Konrad Dybcio (1):
of: reserved_mem: Introduce devres-managed initialization functions
Mukesh Ojha (41):
of: reserved_mem: Add devm_of_reserved_mem_device_init_by_name()
firmware: qcom: scm: Use devm_of_reserved_mem_device_init()
remoteproc: da8xx: Use devm_of_reserved_mem_device_init()
remoteproc: keystone: Use devm_of_reserved_mem_device_init()
media: synopsys: hdmirx: Use devm_of_reserved_mem_device_init()
remoteproc: omap: Use devm_of_reserved_mem_device_init()
drm: logicvc: Use devm_of_reserved_mem_device_init()
drm: hdlcd: Use devm_of_reserved_mem_device_init()
drm: pl111: Use devm_of_reserved_mem_device_init()
remoteproc: mtk_scp: Use devm_of_reserved_mem_device_init()
media: aspeed: Use devm_of_reserved_mem_device_init()
media: nuvoton: npcm-video: Use devm_of_reserved_mem_device_init()
memory: tegra210-emc: Use devm_of_reserved_mem_device_init_by_name()
drm: komeda: Use devm_of_reserved_mem_device_init()
drm: malidp: Use devm_of_reserved_mem_device_init()
drm: ingenic: Use devm_of_reserved_mem_device_init()
drm: kmb: Use devm_of_reserved_mem_device_init()
drm: sun4i: Use devm_of_reserved_mem_device_init()
drm: xlnx: zynqmp_dpsub: Use devm_of_reserved_mem_device_init()
media: arm: mali-c55: Use devm_of_reserved_mem_device_init()
media: mediatek: vpu: Use devm_of_reserved_mem_device_init()
mmc: sdhci-of-bst: Use devm_of_reserved_mem_device_init_by_idx()
remoteproc: ti_k3: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8192: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8196: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8183: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8189: Use devm_of_reserved_mem_device_init()
ASoC: SOF: imx: Use devm_of_reserved_mem_device_init_by_name()
staging: media: cedrus: Use devm_of_reserved_mem_device_init()
ASoC: cix-ipbloq: Use devm_of_reserved_mem_device_init()
drm: aspeed: Use devm_of_reserved_mem_device_init()
drm: arcpgu: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8173: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8186: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8188: Use devm_of_reserved_mem_device_init()
ASoC: mediatek: mt8195: Use devm_of_reserved_mem_device_init()
ASoC: SOF: mediatek: mt8186: Use devm_of_reserved_mem_device_init()
ASoC: SOF: mediatek: mt8195: Use devm_of_reserved_mem_device_init()
misc: fastrpc: Use devm_of_reserved_mem_device_init()
ASoC: fsl: imx-rpmsg: Use devm_of_reserved_mem_device_init_by_idx()
ASoC: sprd: Use devm_of_reserved_mem_device_init()
drivers/firmware/qcom/qcom_scm.c | 22 +++------
.../gpu/drm/arm/display/komeda/komeda_dev.c | 4 +-
drivers/gpu/drm/arm/hdlcd_drv.c | 6 +--
drivers/gpu/drm/arm/malidp_drv.c | 4 +-
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +-
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 13 +-----
drivers/gpu/drm/kmb/kmb_drv.c | 12 +----
drivers/gpu/drm/logicvc/logicvc_drm.c | 21 ++++-----
drivers/gpu/drm/pl111/pl111_drv.c | 4 +-
drivers/gpu/drm/sun4i/sun4i_drv.c | 4 +-
drivers/gpu/drm/tiny/arcpgu.c | 2 +-
drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 4 +-
.../platform/arm/mali-c55/mali-c55-core.c | 12 ++---
drivers/media/platform/aspeed/aspeed-video.c | 12 ++---
drivers/media/platform/mediatek/vpu/mtk_vpu.c | 3 +-
drivers/media/platform/nuvoton/npcm-video.c | 9 +---
.../platform/synopsys/hdmirx/snps_hdmirx.c | 16 +------
drivers/memory/tegra/tegra210-emc-core.c | 21 ++++-----
drivers/misc/fastrpc.c | 2 +-
drivers/mmc/host/sdhci-of-bst.c | 7 +--
drivers/of/of_reserved_mem.c | 41 +++++++++++++++++
drivers/remoteproc/da8xx_remoteproc.c | 10 +---
drivers/remoteproc/keystone_remoteproc.c | 16 +------
drivers/remoteproc/mtk_scp.c | 3 +-
drivers/remoteproc/omap_remoteproc.c | 13 +-----
drivers/remoteproc/ti_k3_common.c | 13 +-----
drivers/remoteproc/ti_k3_common.h | 1 -
.../staging/media/sunxi/cedrus/cedrus_hw.c | 6 +--
include/linux/of_reserved_mem.h | 46 +++++++++++++++++++
sound/hda/controllers/cix-ipbloq.c | 2 +-
sound/soc/fsl/imx-rpmsg.c | 2 +-
sound/soc/mediatek/mt8173/mt8173-afe-pcm.c | 2 +-
sound/soc/mediatek/mt8183/mt8183-afe-pcm.c | 13 +-----
sound/soc/mediatek/mt8186/mt8186-afe-pcm.c | 2 +-
sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 2 +-
sound/soc/mediatek/mt8189/mt8189-afe-pcm.c | 16 +------
sound/soc/mediatek/mt8192/mt8192-afe-pcm.c | 11 +----
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c | 2 +-
sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 14 +-----
sound/soc/sof/imx/imx-common.c | 9 ++--
sound/soc/sof/mediatek/mt8186/mt8186.c | 2 +-
sound/soc/sof/mediatek/mt8195/mt8195.c | 2 +-
sound/soc/sprd/sprd-pcm-dma.c | 3 +-
43 files changed, 162 insertions(+), 249 deletions(-)
--
2.53.0
^ permalink raw reply
* [PATCH 02/12] dt-bindings: soc: fsl: qe: Set #interrupt-cells to 2 to support interrupt type encoding
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
The QUICC Engine port interrupt controller can be configured to generate
an interrupt on either a high-to-low transition or any change in the
signal state on the related GPIOs.
Update the #interrupt-cells property to 2 so consumers can encode
interrupt level information.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
.../devicetree/bindings/interrupt-controller/fsl,qe-ports-ic.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/interrupt-controller/fsl,qe-ports-ic.yaml b/Documentation/devicetree/bindings/interrupt-controller/fsl,qe-ports-ic.yaml
index 2b8e7b9c6d7a..2b7c6b4f0389 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/fsl,qe-ports-ic.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/fsl,qe-ports-ic.yaml
@@ -23,7 +23,7 @@ properties:
const: 0
'#interrupt-cells':
- const: 1
+ const: 2
interrupts:
maxItems: 1
@@ -45,7 +45,7 @@ examples:
reg = <0xc00 0x18>;
interrupt-controller;
#address-cells = <0>;
- #interrupt-cells = <1>;
+ #interrupt-cells = <2>;
interrupts = <74 0x8>;
interrupt-parent = <&ipic>;
};
--
2.55.0
^ permalink raw reply related
* [PATCH 10/12] soc: fsl: qe: Rename host member to domain in struct qepic_data
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Rename the host field to domain to match the common kernel naming
convention for irq_domain pointers.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/qe_ports_ic.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index 718703dab024..1bf2af087b78 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -18,8 +18,8 @@
struct qepic_data {
void __iomem *reg;
- struct irq_domain *host;
int parent_irq;
+ struct irq_domain *domain;
struct irq_chip_generic *gc;
};
@@ -85,7 +85,7 @@ static void qepic_cascade(struct irq_desc *desc)
}
for_each_set_bit(bit, &event, 32)
- generic_handle_domain_irq(data->host, 32 - bit);
+ generic_handle_domain_irq(data->domain, 32 - bit);
out:
chained_irq_exit(chip, desc);
@@ -158,11 +158,11 @@ static int qepic_probe(struct platform_device *pdev)
if (data->parent_irq < 0)
return data->parent_irq;
- data->host = devm_irq_domain_instantiate(dev, &d_info);
- if (IS_ERR(data->host))
- return PTR_ERR(data->host);
+ data->domain = devm_irq_domain_instantiate(dev, &d_info);
+ if (IS_ERR(data->domain))
+ return PTR_ERR(data->domain);
- data->gc = irq_get_domain_generic_chip(data->host, 0);
+ data->gc = irq_get_domain_generic_chip(data->domain, 0);
if (!data->gc)
return -ENODEV;
data->gc->reg_base = data->reg;
--
2.55.0
^ permalink raw reply related
* [PATCH 08/12] soc: fsl: qe: Convert to generic IRQ chip
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
The generic IRQ chip framework is available to handle IRQ chips. Using
this framework for the QE interrupt controller allows to simplify the
driver. Indeed, the framework internally handles operations coded
directly in the driver.
Add a select dependency to GENERIC_IRQ_CHIP in the PPC platform Kconfig.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
arch/powerpc/platforms/Kconfig | 1 +
drivers/soc/fsl/qe/qe_ports_ic.c | 103 ++++++++++++++++++++++++++-------------
2 files changed, 70 insertions(+), 34 deletions(-)
diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig
index c4e61843d9d9..b0b3a80f8cde 100644
--- a/arch/powerpc/platforms/Kconfig
+++ b/arch/powerpc/platforms/Kconfig
@@ -232,6 +232,7 @@ config QE_GPIO
bool "QE GPIO support"
depends on QUICC_ENGINE
select GPIOLIB
+ select GENERIC_IRQ_CHIP
help
Say Y here if you're going to use hardware that connects to the
QE GPIOs.
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index c8b73b0aa233..d022aa224f6d 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -20,63 +20,65 @@ struct qepic_data {
void __iomem *reg;
struct irq_domain *host;
int irq;
+ struct irq_chip_generic *gc;
};
static void qepic_mask(struct irq_data *d)
{
- struct qepic_data *data = irq_data_get_irq_chip_data(d);
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct irq_chip_type *ct = irq_data_get_chip_type(d);
- clrbits32(data->reg + CEPIMR, 1 << (31 - irqd_to_hwirq(d)));
+ clrbits32(gc->reg_base + ct->regs.mask, d->mask);
}
static void qepic_unmask(struct irq_data *d)
{
- struct qepic_data *data = irq_data_get_irq_chip_data(d);
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct irq_chip_type *ct = irq_data_get_chip_type(d);
- setbits32(data->reg + CEPIMR, 1 << (31 - irqd_to_hwirq(d)));
+ setbits32(gc->reg_base + ct->regs.mask, d->mask);
}
static void qepic_end(struct irq_data *d)
{
- struct qepic_data *data = irq_data_get_irq_chip_data(d);
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct irq_chip_type *ct = irq_data_get_chip_type(d);
- out_be32(data->reg + CEPIER, 1 << (31 - irqd_to_hwirq(d)));
+ out_be32(gc->reg_base + ct->regs.eoi, d->mask);
+}
+
+static void qepic_calc_mask(struct irq_data *d)
+{
+ d->mask = 1 << (31 - irqd_to_hwirq(d));
}
static int qepic_set_type(struct irq_data *d, unsigned int flow_type)
{
- struct qepic_data *data = irq_data_get_irq_chip_data(d);
- unsigned int vec = (unsigned int)irqd_to_hwirq(d);
+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
+ struct irq_chip_type *ct = irq_data_get_chip_type(d);
switch (flow_type & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_FALLING:
- setbits32(data->reg + CEPICR, 1 << (31 - vec));
+ setbits32(gc->reg_base + ct->regs.type, d->mask);
return 0;
case IRQ_TYPE_EDGE_BOTH:
case IRQ_TYPE_NONE:
- clrbits32(data->reg + CEPICR, 1 << (31 - vec));
+ clrbits32(gc->reg_base + ct->regs.type, d->mask);
return 0;
}
return -EINVAL;
}
-static struct irq_chip qepic = {
- .name = "QEPIC",
- .irq_mask = qepic_mask,
- .irq_unmask = qepic_unmask,
- .irq_eoi = qepic_end,
- .irq_set_type = qepic_set_type,
-};
-
static void qepic_cascade(struct irq_desc *desc)
{
struct qepic_data *data = irq_desc_get_handler_data(desc);
+ struct irq_chip_type *ct = data->gc->chip_types;
struct irq_chip *chip = irq_desc_get_chip(desc);
unsigned long event, bit;
chained_irq_enter(chip, desc);
- event = in_be32(data->reg + CEPIER);
+ event = in_be32(data->gc->reg_base + ct->regs.eoi);
if (!event) {
handle_bad_irq(desc);
goto out;
@@ -89,33 +91,64 @@ static void qepic_cascade(struct irq_desc *desc)
chained_irq_exit(chip, desc);
}
-static int qepic_host_map(struct irq_domain *h, unsigned int virq, irq_hw_number_t hw)
+static int qepic_chip_init(struct irq_chip_generic *gc)
{
- irq_set_chip_data(virq, h->host_data);
- irq_set_chip_and_handler(virq, &qepic, handle_fasteoi_irq);
+ struct irq_chip_type *ct = gc->chip_types;
+
+ ct->regs.mask = CEPIMR;
+ ct->chip.irq_mask = qepic_mask;
+ ct->chip.irq_unmask = qepic_unmask;
+ ct->regs.eoi = CEPIER;
+ ct->chip.irq_eoi = qepic_end;
+ ct->regs.type = CEPICR;
+ ct->chip.irq_set_type = qepic_set_type;
+ ct->chip.irq_calc_mask = qepic_calc_mask;
+
return 0;
}
-static const struct irq_domain_ops qepic_host_ops = {
- .map = qepic_host_map,
-};
+static int qepic_domain_init(struct irq_domain *d)
+{
+ struct qepic_data *data = d->host_data;
-static void qepic_remove(void *res)
+ irq_set_chained_handler_and_data(data->irq, qepic_cascade, data);
+
+ return 0;
+}
+
+static void qepic_domain_exit(struct irq_domain *d)
{
- struct qepic_data *data = res;
+ struct qepic_data *data = d->host_data;
irq_set_chained_handler_and_data(data->irq, NULL, NULL);
- irq_domain_remove(data->host);
}
static int qepic_probe(struct platform_device *pdev)
{
+ struct irq_domain_chip_generic_info dgc_info = {
+ .name = "QEPIC",
+ .handler = handle_fasteoi_irq,
+ .irqs_per_chip = 32,
+ .num_ct = 1,
+ .init = qepic_chip_init,
+ };
+ struct irq_domain_info d_info = {
+ .fwnode = of_fwnode_handle(pdev->dev.of_node),
+ .domain_flags = IRQ_DOMAIN_FLAG_DESTROY_GC,
+ .size = 32,
+ .hwirq_max = 32,
+ .ops = &irq_generic_chip_ops,
+ .dgc_info = &dgc_info,
+ .init = qepic_domain_init,
+ .exit = qepic_domain_exit,
+ };
struct device *dev = &pdev->dev;
struct qepic_data *data;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
+ d_info.host_data = data;
data->reg = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(data->reg))
@@ -125,14 +158,16 @@ static int qepic_probe(struct platform_device *pdev)
if (data->irq < 0)
return data->irq;
- data->host = irq_domain_create_linear(dev_fwnode(dev), 32, &qepic_host_ops, data);
- if (!data->host)
- return -ENODEV;
+ data->host = devm_irq_domain_instantiate(dev, &d_info);
+ if (IS_ERR(data->host))
+ return PTR_ERR(data->host);
- irq_set_chained_handler_and_data(data->irq, qepic_cascade, data);
-
- return devm_add_action_or_reset(dev, qepic_remove, data);
+ data->gc = irq_get_domain_generic_chip(data->host, 0);
+ if (!data->gc)
+ return -ENODEV;
+ data->gc->reg_base = data->reg;
+ return 0;
}
static const struct of_device_id qepic_match[] = {
--
2.55.0
^ permalink raw reply related
* [PATCH 07/12] soc: fsl: qe: Handle spurious interrupts
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
When no interrupt bits are set in the event register, call
handle_bad_irq() to account for the spurious interrupt before
exiting the cascade handler.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/qe_ports_ic.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index 27b62f4e3afb..c8b73b0aa233 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -77,9 +77,15 @@ static void qepic_cascade(struct irq_desc *desc)
chained_irq_enter(chip, desc);
event = in_be32(data->reg + CEPIER);
+ if (!event) {
+ handle_bad_irq(desc);
+ goto out;
+ }
+
for_each_set_bit(bit, &event, 32)
generic_handle_domain_irq(data->host, 32 - bit);
+out:
chained_irq_exit(chip, desc);
}
--
2.55.0
^ permalink raw reply related
* [PATCH 04/12] dt-bindings: soc: fsl: qe: Add support of IRQ in QE GPIO
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Some QE GPIO pins have an associated interrupt line in the QE PIC to
signal state changes on the pin. Add the corresponding
interrupt-controller / nexus properties to the QE GPIO binding.
Because the GPIO controller does not perform any interrupt handling
itself, a nexus node (interrupt-map) is used to map each GPIO line
supporting IRQ to the parent QE PIC interrupt domain.
As the QE PIC can be configured to generate an interrupt on either a
high-to-low transition or any change in signal state, three
interrupt-map entries are needed per GPIO pin that can yield an
interrupt (falling, both, and the "none" case which defaults to both in
QE PIC). This overhead is necessary because the interrupt-map-pass-thru
property is not part of the DT specification.
The interrupt-map property is optional: it is not required for GPIO
banks that have no interrupt capable GPIO line (e.g. port D on MPC8323),
or when interrupt functionality is not used.
Update the example to show a scenario where each bank supports a
different numbers of IRQs, or no IRQs at all.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
.../bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml | 69 +++++++++++++++++++++-
1 file changed, 66 insertions(+), 3 deletions(-)
diff --git a/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml b/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml
index 1af99339ff40..0c849a5698f4 100644
--- a/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml
+++ b/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml
@@ -27,6 +27,17 @@ properties:
"#gpio-cells":
const: 2
+ "#address-cells":
+ const: 0
+
+ "#interrupt-cells":
+ const: 2
+
+ interrupt-map:
+ description: |
+ Specifies the mapping of GPIO lines to the parent interrupt controller, as the
+ GPIO controller does not do interrupt handling itself.
+
required:
- compatible
- reg
@@ -37,9 +48,61 @@ additionalProperties: false
examples:
- |
- gpio-controller@1400 {
- compatible = "fsl,mpc8360-qe-pario-bank", "fsl,mpc8323-qe-pario-bank";
- reg = <0x1400 0x18>;
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ pic: interrupt-controller {
+ interrupt-controller;
+ #address-cells = <0>;
+ #interrupt-cells = <2>;
+ };
+
+ gpio-controller@1418 {
+ #gpio-cells = <2>;
+ #address-cells = <0>;
+ #interrupt-cells = <2>;
+ compatible = "fsl,mpc8323-qe-pario-bank";
+ reg = <0x1418 0x18>;
gpio-controller;
+ interrupt-map = <
+ 7 IRQ_TYPE_EDGE_FALLING &pic 4 IRQ_TYPE_EDGE_FALLING
+ 7 IRQ_TYPE_EDGE_BOTH &pic 4 IRQ_TYPE_EDGE_BOTH
+ 7 0 &pic 4 IRQ_TYPE_NONE
+
+ 9 IRQ_TYPE_EDGE_FALLING &pic 5 IRQ_TYPE_EDGE_FALLING
+ 9 IRQ_TYPE_EDGE_BOTH &pic 5 IRQ_TYPE_EDGE_BOTH
+ 9 0 &pic 5 IRQ_TYPE_NONE
+
+ 25 IRQ_TYPE_EDGE_FALLING &pic 6 IRQ_TYPE_EDGE_FALLING
+ 25 IRQ_TYPE_EDGE_BOTH &pic 6 IRQ_TYPE_EDGE_BOTH
+ 25 0 &pic 6 IRQ_TYPE_NONE
+
+ 27 IRQ_TYPE_EDGE_FALLING &pic 7 IRQ_TYPE_EDGE_FALLING
+ 27 IRQ_TYPE_EDGE_BOTH &pic 7 IRQ_TYPE_EDGE_BOTH
+ 27 0 &pic 7 IRQ_TYPE_NONE
+ >;
+ };
+
+ gpio-controller@1430 {
#gpio-cells = <2>;
+ #address-cells = <0>;
+ #interrupt-cells = <2>;
+ compatible = "fsl,mpc8323-qe-pario-bank";
+ reg = <0x1430 0x18>;
+ gpio-controller;
+ interrupt-map = <
+ 24 IRQ_TYPE_EDGE_FALLING &pic 8 IRQ_TYPE_EDGE_FALLING
+ 24 IRQ_TYPE_EDGE_BOTH &pic 8 IRQ_TYPE_EDGE_BOTH
+ 24 0 &pic 8 IRQ_TYPE_NONE
+
+ 29 IRQ_TYPE_EDGE_FALLING &pic 9 IRQ_TYPE_EDGE_FALLING
+ 29 IRQ_TYPE_EDGE_BOTH &pic 9 IRQ_TYPE_EDGE_BOTH
+ 29 0 &pic 9 IRQ_TYPE_NONE
+ >;
+ };
+
+ gpio-controller@1448 {
+ #gpio-cells = <2>;
+ compatible = "fsl,mpc8323-qe-pario-bank";
+ reg = <0x1448 0x18>;
+ gpio-controller;
};
--
2.55.0
^ permalink raw reply related
* [PATCH 05/12] soc: fsl: qe: Use generic_handle_domain_irq()
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Replace the irq_find_mapping() + generic_handle_irq() pattern with
generic_handle_domain_irq(), which handles the IRQ domain lookup
internally. This is less error-prone and more idiomatic.
Remove the now-unused irq_find_mapping() call from qepic_get_irq().
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/qe_ports_ic.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index 73a77763210d..3bca116fd2f5 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -75,16 +75,17 @@ static int qepic_get_irq(struct irq_desc *desc)
if (!event)
return -1;
- return irq_find_mapping(data->host, 32 - ffs(event));
+ return 32 - ffs(event);
}
static void qepic_cascade(struct irq_desc *desc)
{
+ struct qepic_data *data = irq_desc_get_handler_data(desc);
struct irq_chip *chip = irq_desc_get_chip(desc);
chained_irq_enter(chip, desc);
- generic_handle_irq(qepic_get_irq(desc));
+ generic_handle_domain_irq(data->host, qepic_get_irq(desc));
chained_irq_exit(chip, desc);
}
--
2.55.0
^ permalink raw reply related
* [PATCH 09/12] soc: fsl: qe: Rename irq variable to parent_irq
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Rename the local variable holding the platform IRQ to parent_irq, which
better describes its role as the upstream/chained interrupt in the
hierarchy.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/qe_ports_ic.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index d022aa224f6d..718703dab024 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -19,7 +19,7 @@
struct qepic_data {
void __iomem *reg;
struct irq_domain *host;
- int irq;
+ int parent_irq;
struct irq_chip_generic *gc;
};
@@ -111,7 +111,7 @@ static int qepic_domain_init(struct irq_domain *d)
{
struct qepic_data *data = d->host_data;
- irq_set_chained_handler_and_data(data->irq, qepic_cascade, data);
+ irq_set_chained_handler_and_data(data->parent_irq, qepic_cascade, data);
return 0;
}
@@ -120,7 +120,7 @@ static void qepic_domain_exit(struct irq_domain *d)
{
struct qepic_data *data = d->host_data;
- irq_set_chained_handler_and_data(data->irq, NULL, NULL);
+ irq_set_chained_handler_and_data(data->parent_irq, NULL, NULL);
}
static int qepic_probe(struct platform_device *pdev)
@@ -154,9 +154,9 @@ static int qepic_probe(struct platform_device *pdev)
if (IS_ERR(data->reg))
return PTR_ERR(data->reg);
- data->irq = platform_get_irq(pdev, 0);
- if (data->irq < 0)
- return data->irq;
+ data->parent_irq = platform_get_irq(pdev, 0);
+ if (data->parent_irq < 0)
+ return data->parent_irq;
data->host = devm_irq_domain_instantiate(dev, &d_info);
if (IS_ERR(data->host))
--
2.55.0
^ permalink raw reply related
* [PATCH 03/12] dt-bindings: soc: fsl: qe: Convert QE GPIO to DT schema
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni, Christophe Leroy
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
From: Christophe Leroy <christophe.leroy@csgroup.eu>
Convert QE GPIO devicetree binding to DT schema.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
.../bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml | 45 ++++++++++++++++++++++
.../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 26 +------------
2 files changed, 46 insertions(+), 25 deletions(-)
diff --git a/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml b/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml
new file mode 100644
index 000000000000..1af99339ff40
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/fsl,mpc8323-qe-pario-bank.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale QUICC Engine Parallel I/O (QE PARIO) GPIO Bank
+
+maintainers:
+ - Christophe Leroy <christophe.leroy@csgroup.eu>
+
+properties:
+ compatible:
+ oneOf:
+ - items:
+ - enum:
+ - fsl,mpc8360-qe-pario-bank
+ - fsl,mpc8569-qe-pario-bank
+ - const: fsl,mpc8323-qe-pario-bank
+ - const: fsl,mpc8323-qe-pario-bank
+
+ reg:
+ maxItems: 1
+
+ gpio-controller: true
+
+ "#gpio-cells":
+ const: 2
+
+required:
+ - compatible
+ - reg
+ - gpio-controller
+ - "#gpio-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ gpio-controller@1400 {
+ compatible = "fsl,mpc8360-qe-pario-bank", "fsl,mpc8323-qe-pario-bank";
+ reg = <0x1400 0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ };
diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt
index 09b1b05fa677..782699c14567 100644
--- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt
+++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/qe/par_io.txt
@@ -24,28 +24,4 @@ par_io@1400 {
Note that "par_io" nodes are obsolete, and should not be used for
the new device trees. Instead, each Par I/O bank should be represented
-via its own gpio-controller node:
-
-Required properties:
-- #gpio-cells : should be "2".
-- compatible : should be "fsl,<chip>-qe-pario-bank",
- "fsl,mpc8323-qe-pario-bank".
-- reg : offset to the register set and its length.
-- gpio-controller : node to identify gpio controllers.
-
-Example:
- qe_pio_a: gpio-controller@1400 {
- #gpio-cells = <2>;
- compatible = "fsl,mpc8360-qe-pario-bank",
- "fsl,mpc8323-qe-pario-bank";
- reg = <0x1400 0x18>;
- gpio-controller;
- };
-
- qe_pio_e: gpio-controller@1460 {
- #gpio-cells = <2>;
- compatible = "fsl,mpc8360-qe-pario-bank",
- "fsl,mpc8323-qe-pario-bank";
- reg = <0x1460 0x18>;
- gpio-controller;
- };
+via its own gpio-controller node.
--
2.55.0
^ permalink raw reply related
* [PATCH 00/12] soc: fsl: qe: QE PIC improvement and add support of IRQs to QUICC ENGINE GPIOs
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni, stable,
Christophe Leroy
This series modernizes the QUICC Engine Port Interrupt Controller (QE
PIC) driver and adds the ability for QE GPIO pins to generate interrupts
through the QE PIC, completing Christophe Leroy's prior work [1].
Christophe's series was partially merged; patches 4, 6 and 7 did not
make it to mainline.
The series is organized in three parts:
1) Add missing chained_irq_{enter,exit}() calls
- In a chained handler, the parent controller need to mask and ack
the interrupt source.
2) DT binding updates
- Update #interrupt-cells from 1 to 2 in the QE PIC binding so
consumers can encode the interrupt type (falling-edge or
both-edges).
- Convert the QE GPIO binding from freeform text to DT schema.
- Extend the QE GPIO binding with an interrupt-map (nexus node) that
maps GPIO lines to parent QE PIC interrupts. This approach was
suggested by Rob Herring [2] as an alternative to using compatible
strings and driver data to specify which pins support interrupts in
a given bank.
3) QE PIC driver refactoring
- The QE PIC is a perfect fit to use the generic irq framework
instead. Perform the necessary changes to the driver to convert it.
- Minor cleanups.
4) QE GPIO interrupt support
- Add a to_irq() method to the QE GPIO driver that perform the
mapping of the GPIO pin to the parent interrupt domain, allowing
GPIO pins to be used as interrupt sources through the QE PIC via
gpio_to_irq().
[1] https://lore.kernel.org/all/cover.1758212309.git.christophe.leroy@csgroup.eu/
[2] https://lore.kernel.org/all/20250919152414.GB852815-robh@kernel.org/
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
Christophe Leroy (1):
dt-bindings: soc: fsl: qe: Convert QE GPIO to DT schema
Paul Louvel (11):
soc: fsl: qe: Add chained_irq_{enter,exit}() calls in cascade handler
dt-bindings: soc: fsl: qe: Set #interrupt-cells to 2 to support interrupt type encoding
dt-bindings: soc: fsl: qe: Add support of IRQ in QE GPIO
soc: fsl: qe: Use generic_handle_domain_irq()
soc: fsl: qe: Iterate over all pending interrupts in cascade handler
soc: fsl: qe: Handle spurious interrupts
soc: fsl: qe: Convert to generic IRQ chip
soc: fsl: qe: Rename irq variable to parent_irq
soc: fsl: qe: Rename host member to domain in struct qepic_data
soc: fsl: qe: Remove useless struct member
soc: fsl: qe: Add support of IRQs in QE GPIO
.../bindings/gpio/fsl,mpc8323-qe-pario-bank.yaml | 108 ++++++++++++++++
.../interrupt-controller/fsl,qe-ports-ic.yaml | 4 +-
.../bindings/soc/fsl/cpm_qe/qe/par_io.txt | 26 +---
arch/powerpc/platforms/Kconfig | 1 +
drivers/soc/fsl/qe/gpio.c | 28 +++-
drivers/soc/fsl/qe/qe_ports_ic.c | 144 +++++++++++++--------
6 files changed, 232 insertions(+), 79 deletions(-)
---
base-commit: f1b7f9c6e1a7fc549f37cafb48d233c9f7c26adc
change-id: 20260513-qe-pic-gpios-073e284615a3
Best regards,
--
Paul Louvel, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply
* [PATCH 11/12] soc: fsl: qe: Remove useless struct member
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
The reg member from the struct qepic_data is no longer needed, since it
is now embedded in reg_base of struct irq_chip_generic. Remove it.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/qe_ports_ic.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index 1bf2af087b78..6cf23a721ff3 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -17,7 +17,6 @@
#define CEPICR 0x14
struct qepic_data {
- void __iomem *reg;
int parent_irq;
struct irq_domain *domain;
struct irq_chip_generic *gc;
@@ -144,15 +143,16 @@ static int qepic_probe(struct platform_device *pdev)
};
struct device *dev = &pdev->dev;
struct qepic_data *data;
+ void __iomem *reg;
data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
if (!data)
return -ENOMEM;
d_info.host_data = data;
- data->reg = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(data->reg))
- return PTR_ERR(data->reg);
+ reg = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(reg))
+ return PTR_ERR(reg);
data->parent_irq = platform_get_irq(pdev, 0);
if (data->parent_irq < 0)
@@ -165,7 +165,7 @@ static int qepic_probe(struct platform_device *pdev)
data->gc = irq_get_domain_generic_chip(data->domain, 0);
if (!data->gc)
return -ENODEV;
- data->gc->reg_base = data->reg;
+ data->gc->reg_base = reg;
return 0;
}
--
2.55.0
^ permalink raw reply related
* [PATCH 12/12] soc: fsl: qe: Add support of IRQs in QE GPIO
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Some QE GPIO pins have an associated interrupt line in the QE PIC to
signal state changes on the pin.
Because the GPIO controller does not perform any interrupt handling
itself, a nexus node (interrupt-map) is used to map each GPIO line
supporting IRQ to the parent QE PIC interrupt domain.
Add the to_irq() method in the corresponding GPIO controller driver,
that uses the nexus node to perform the translation.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/gpio.c | 28 +++++++++++++++++++++++++++-
1 file changed, 27 insertions(+), 1 deletion(-)
diff --git a/drivers/soc/fsl/qe/gpio.c b/drivers/soc/fsl/qe/gpio.c
index 66828f2a3577..f8919642f40d 100644
--- a/drivers/soc/fsl/qe/gpio.c
+++ b/drivers/soc/fsl/qe/gpio.c
@@ -16,6 +16,7 @@
#include <linux/gpio/driver.h>
#include <linux/slab.h>
#include <linux/export.h>
+#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <soc/fsl/qe/qe.h>
@@ -23,6 +24,7 @@
#define PIN_MASK(gpio) (1UL << (QE_PIO_PINS - 1 - (gpio)))
struct qe_gpio_chip {
+ struct device_node *np;
struct gpio_chip gc;
void __iomem *regs;
spinlock_t lock;
@@ -135,6 +137,29 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
return 0;
}
+static int qe_gpio_to_irq(struct gpio_chip *gc, unsigned int gpio)
+{
+ struct qe_gpio_chip *qe_gc = gpiochip_get_data(gc);
+ struct of_phandle_args oirq;
+ struct irq_domain *domain;
+ int ret;
+
+ oirq.np = qe_gc->np;
+ oirq.args_count = 2;
+ oirq.args[0] = gpio;
+ oirq.args[1] = 0;
+
+ ret = of_irq_parse_raw(NULL, &oirq);
+ if (ret)
+ return ret;
+
+ domain = irq_find_host(oirq.np);
+ if (!domain)
+ return -EPROBE_DEFER;
+
+ return irq_create_of_mapping(&oirq);
+}
+
struct qe_pin {
/*
* The qe_gpio_chip name is unfortunate, we should change that to
@@ -299,7 +324,7 @@ static int qe_gpio_probe(struct platform_device *ofdev)
qe_gc = devm_kzalloc(dev, sizeof(*qe_gc), GFP_KERNEL);
if (!qe_gc)
return -ENOMEM;
-
+ qe_gc->np = np;
spin_lock_init(&qe_gc->lock);
gc = &qe_gc->gc;
@@ -311,6 +336,7 @@ static int qe_gpio_probe(struct platform_device *ofdev)
gc->get = qe_gpio_get;
gc->set = qe_gpio_set;
gc->set_multiple = qe_gpio_set_multiple;
+ gc->to_irq = qe_gpio_to_irq;
gc->parent = dev;
gc->owner = THIS_MODULE;
--
2.55.0
^ permalink raw reply related
* [PATCH 06/12] soc: fsl: qe: Iterate over all pending interrupts in cascade handler
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Instead of only servicing a single interrupt, the chained handler can
handle all IRQs that have their bit set in the event register.
This avoid multiple parent IRQ handler being serviced if more than one
interrupt are pending on the QE PIC.
Remove unused code.
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
---
drivers/soc/fsl/qe/qe_ports_ic.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index 3bca116fd2f5..27b62f4e3afb 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -5,6 +5,7 @@
* Copyright (c) 2025 Christophe Leroy CS GROUP France (christophe.leroy@csgroup.eu)
*/
+#include <linux/bitops.h>
#include <linux/irq.h>
#include <linux/irqchip/chained_irq.h>
#include <linux/irqdomain.h>
@@ -67,25 +68,17 @@ static struct irq_chip qepic = {
.irq_set_type = qepic_set_type,
};
-static int qepic_get_irq(struct irq_desc *desc)
-{
- struct qepic_data *data = irq_desc_get_handler_data(desc);
- u32 event = in_be32(data->reg + CEPIER);
-
- if (!event)
- return -1;
-
- return 32 - ffs(event);
-}
-
static void qepic_cascade(struct irq_desc *desc)
{
struct qepic_data *data = irq_desc_get_handler_data(desc);
struct irq_chip *chip = irq_desc_get_chip(desc);
+ unsigned long event, bit;
chained_irq_enter(chip, desc);
- generic_handle_domain_irq(data->host, qepic_get_irq(desc));
+ event = in_be32(data->reg + CEPIER);
+ for_each_set_bit(bit, &event, 32)
+ generic_handle_domain_irq(data->host, 32 - bit);
chained_irq_exit(chip, desc);
}
--
2.55.0
^ permalink raw reply related
* [PATCH 01/12] soc: fsl: qe: Add chained_irq_{enter,exit}() calls in cascade handler
From: Paul Louvel @ 2026-07-03 13:30 UTC (permalink / raw)
To: Qiang Zhao, Christophe Leroy (CS GROUP), Thomas Gleixner,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Linus Walleij,
Bartosz Golaszewski, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin
Cc: linuxppc-dev, linux-arm-kernel, linux-kernel, devicetree,
linux-gpio, Paul Louvel, Thomas Petazzoni, stable
In-Reply-To: <20260703-qe-pic-gpios-v1-0-6c3e706e27dc@bootlin.com>
Wrap the cascade handler body with chained_irq_{enter,exit}() to
properly inform the parent IRQ chip that a chained interrupt is being
serviced.
Fixes: f0bcd784e1b76 ("soc: fsl: qe: Add an interrupt controller for QUICC Engine Ports")
Signed-off-by: Paul Louvel <paul.louvel@bootlin.com>
Cc: stable@kernel.org
---
drivers/soc/fsl/qe/qe_ports_ic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/soc/fsl/qe/qe_ports_ic.c b/drivers/soc/fsl/qe/qe_ports_ic.c
index 9b0bba64e91e..73a77763210d 100644
--- a/drivers/soc/fsl/qe/qe_ports_ic.c
+++ b/drivers/soc/fsl/qe/qe_ports_ic.c
@@ -6,6 +6,7 @@
*/
#include <linux/irq.h>
+#include <linux/irqchip/chained_irq.h>
#include <linux/irqdomain.h>
#include <linux/platform_device.h>
@@ -79,7 +80,13 @@ static int qepic_get_irq(struct irq_desc *desc)
static void qepic_cascade(struct irq_desc *desc)
{
+ struct irq_chip *chip = irq_desc_get_chip(desc);
+
+ chained_irq_enter(chip, desc);
+
generic_handle_irq(qepic_get_irq(desc));
+
+ chained_irq_exit(chip, desc);
}
static int qepic_host_map(struct irq_domain *h, unsigned int virq, irq_hw_number_t hw)
--
2.55.0
^ permalink raw reply related
* [PATCH] powerpc/ps3: Fix repository.c build failure
From: Thorsten Blum @ 2026-07-03 16:58 UTC (permalink / raw)
To: Geoff Levand, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy (CS GROUP), Justin Stitt,
Kees Cook
Cc: Thorsten Blum, stable, linuxppc-dev, linux-kernel
GCC fails to build ps3_defconfig with the following errors:
arch/powerpc/platforms/ps3/repository.c: In function ‘make_first_field.constprop’:
arch/powerpc/platforms/ps3/repository.c:78:9: error: ‘strnlen’ specified bound 8 exceeds source size 3 [-Werror=stringop-overread]
78 | memcpy((char *)&n, text, strnlen(text, sizeof(n)));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/platforms/ps3/repository.c: In function ‘make_first_field.constprop’:
arch/powerpc/platforms/ps3/repository.c:78:9: error: ‘strnlen’ specified bound 8 exceeds source size 4 [-Werror=stringop-overread]
78 | memcpy((char *)&n, text, strnlen(text, sizeof(n)));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The current use of strnlen(text, sizeof(n)) triggers -Wstringop-overread
when text is a short string literal that is smaller than sizeof(n), such
as "bi" or "bus". Use strlen(text) instead and clamp the copy length to
sizeof(n) before memcpy().
Drop the redundant char * cast while at it.
Fixes: f94a84a09148 ("powerpc/ps3: refactor strncpy usage")
Cc: stable@vger.kernel.org
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
arch/powerpc/platforms/ps3/repository.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index b8c030eab138..0cc755ac3e7f 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -6,6 +6,8 @@
* Copyright 2006 Sony Corp.
*/
+#include <linux/minmax.h>
+
#include <asm/lv1call.h>
#include "platform.h"
@@ -74,8 +76,9 @@ static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4,
static u64 make_first_field(const char *text, u64 index)
{
u64 n = 0;
+ size_t len = min(strlen(text), sizeof(n));
- memcpy((char *)&n, text, strnlen(text, sizeof(n)));
+ memcpy(&n, text, len);
return PS3_VENDOR_ID_NONE + (n >> 32) + index;
}
^ permalink raw reply related
* Re: [PATCH v3 4/4] panic: use sys_info_with_filter() to avoid duplicate backtraces
From: Bradley Morgan @ 2026-07-03 15:25 UTC (permalink / raw)
To: Petr Mladek
Cc: Feng Tang, Andrew Morton, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Madhavan Srinivasan, Douglas Anderson,
linux-kernel, linuxppc-dev, stable
In-Reply-To: <akevFNCaXnt0kRVC@pathway.suse.cz>
On July 3, 2026 1:46:12 PM GMT+01:00, Petr Mladek <pmladek@suse.com> wrote:
>On Thu 2026-07-02 19:13:26, Bradley Morgan wrote:
>> On July 2, 2026 10:09:41 AM GMT+01:00, Petr Mladek <pmladek@suse.com>
>> wrote:
>> >On Mon 2026-06-29 13:54:18, Bradley Morgan wrote:
>> >> On 29 June 2026 12:40:52 BST, Feng Tang <feng.tang@linux.alibaba.com>
>> >> wrote:
>> >> >On Fri, Jun 26, 2026 at 02:14:14PM +0200, Petr Mladek wrote:
>> >> >> On Fri 2026-06-26 12:23:50, Petr Mladek wrote:
>> >> >> > On Thu 2026-06-25 15:25:58, Bradley Morgan wrote:
>> >> >> In watchdog, panic, and hung task detection scenarios, sys_info()
>can
>> >> >> be called multiple times or alongside direct backtrace triggers
>like
>> >> >> trigger_allbutcpu_cpu_backtrace(). This results in identical
>> >backtraces
>> >> >> being dumped repeatedly from all CPUs, cluttering the kernel log
>and
>> >> >> delaying or obscuring critical debug details.
>> >>
>> >> im feeling a new file to do all the force panic jazz, but putting
>tape
>> >> on sys_info.c isn't bd either.
>> >
>> >I wonder how to move forward with this.
>> >
>> >Honestly, I am not sure what exactly you mean by creating another
>> >API for tracking the reports so I could not judge it. Feel free
>> >to sent some POC.
>>
>> sup petr, here's my poc
>>
>> This should make my entire thing make sense
>>
>> >From eb587ed749ff5993c517f29799b369185c5ee7d8 Mon Sep 17 00:00:00 2001
>> From: Bradley Morgan <include@grrlz.net>
>> Date: Thu, 2 Jul 2026 18:09:23 +0000
>> Subject: [POC] sys_info: Introduce incident state-tracking to prevent
>> duplicate diagnostics
>>
>> In watchdog, panic, and hung task detection scenarios, sys_info()
>> can be called multiple times or alongside direct debug output
>> functions (like trigger_allbutcpu_cpu_backtrace(), print_modules(),
>> print_irqtrace_events(), and dump_stack()). This leads to identical
>> diagnostics and stack traces being dumped repeatedly, cluttering the
>> kernel log and delaying critical panics.
>>
>> Introduce a state tracking bitmask and helpers in a new file,
>> lib/sys_info_filter.c:
>
>New file suggests that it would implement an API using
>sys_info_filter() prefix.
>
>> - sys_info_filter_and_set(mask): Atomically tests which bits in a mask
>> have not yet been printed during the current incident, marks them as
>> printed, and returns that subset.
>
>The name of the funtion is a kind of puzzle. I think that we
>could do a better job.
>
>> - sys_info_reset(): Clears the printed mask state.
>
>This function has sys_info* prefix. It would expect it in sys_info.c
>
>> Add SYS_INFO_MODULES, SYS_INFO_IRQTRACE, and SYS_INFO_STACK flags to
>> include/linux/sys_info.h, and handle them inside sys_info's diagnostic
>> dispatch.
>
>I though about adding an information that we printed backtrace for this
>CPU as well. But it not trivial. Different API shows different extra
>info, like modules, IRQ backtrace, registers, code. I would leave
>this complexity aside for now.
>
>> Update the watchdogs, hung task detector, and panic core to call
>> sys_info_filter_and_set() to deduplicate their diagnostic printouts, and
>> sys_info_reset() when a warning incident concludes (e.g., when a stuck
>> CPU recovers, or a new hung task check round begins).
>>
>> This ensures each piece of system diagnostic is printed at most once per
>> lockup/panic event, preventing console log spam.
>>
>> Assisted-by: Gemini:gemini-3.5-flash
>> Signed-off-by: Bradley Morgan <include@grrlz.net>
>
>> --- /dev/null
>> +++ b/lib/sys_info_filter.c
>> @@ -0,0 +1,120 @@
>> +static unsigned long sys_info_printed;
>> +
>> +unsigned long sys_info_filter_and_set(unsigned long si_mask)
>> +{
>> + unsigned long old, new;
>> +
>> + if (!si_mask)
>> + return 0;
>> +
>> + do {
>> + old = READ_ONCE(sys_info_printed);
>> + if (!(si_mask & ~old))
>> + return 0;
>> + new = old | si_mask;
>> + } while (cmpxchg(&sys_info_printed, old, new) != old);
>
>It is a good question whether to update the info using atomic
>operations. One problem is that the mask is "unsigned long".
>I am not sure if it natively atomic on all architectures.
>32-bit architecures use extra locking when implementing
>atomic operations with 64-bit values. And we should rather
>avoid any locking in this code.
>
>Well, long seems to be 32-bit on 32-bit x86 so it might be
>safe after all.
>
>> +void sys_info_reset(void)
>> +static void __sys_info(unsigned long si_mask)
>> +void sys_info(unsigned long si_mask)
>
>I wonder why this sys_info*() API implementation has been moved
>from sys_info.c to sys_info_filter.c.
>
>I am sorry but I do not see any advantage in adding the new file
>sys_info_filter.c
>
>> NOTE!!: This is AI generated!! This **MAY** not be the finished product,
>> this is ONLY the model!
>
>IMHO, Gemini did pretty bad job in this case. Please, try to review
>the AI generated before you send it. And send it only when you think
>that it is reasonable enough. :-)
>
>It is even fine to send "crap" but you should start the mail
>with a warning that you send it just give us an idea what you
>had it mind. And you should explain why you actually do not like.
>
>Best Regards,
>Petr
>
for now, I'll go with your approach, I'll split up and submit your
patch(es) in the coming days.
Because the whole new file idea is super complicated and requires a
load of discussion before a model could be completed.
One of my ideas is to just kill sys_info. and/or make it better.
Other ideas I need to think.
Thanks a lot for reviewing my model though.
Thanks!
^ permalink raw reply
* Re: [PATCH 01/13] mm: introduce vma_flags_can_grow() and vma_can_grow()
From: Zi Yan @ 2026-07-03 15:19 UTC (permalink / raw)
To: Lorenzo Stoakes, Andrew Morton
Cc: Thomas Bogendoerfer, Madhavan Srinivasan, Michael Ellerman,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Lucas Stach, Inki Dae, Seung-Woo Kim,
Kyungmin Park, Krzysztof Kozlowski, Peter Griffin, Jani Nikula,
Joonas Lahtinen, Rodrigo Vivi, Tvrtko Ursulin, Rob Clark,
Dmitry Baryshkov, Lyude Paul, Danilo Krummrich, Tomi Valkeinen,
Sandy Huang, Heiko Stübner, Andy Yan, Thierry Reding,
Mikko Perttunen, Jonathan Hunter, Gerd Hoffmann, Dmitry Osipenko,
Zack Rusin, Matthew Brost, Thomas Hellstrom,
Oleksandr Andrushchenko, Helge Deller, Benjamin LaHaise,
Alexander Viro, Christian Brauner, Muchun Song, Oscar Salvador,
David Hildenbrand, Baolin Wang, Liam R . Howlett, Nico Pache,
Ryan Roberts, Dev Jain, Barry Song, Lance Yang, Hugh Dickins,
Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
Jann Horn, Pedro Falcato, Kees Cook, Jaroslav Kysela,
Takashi Iwai, linux-mips, linux-kernel, linuxppc-dev, dri-devel,
etnaviv, linux-arm-kernel, linux-samsung-soc, intel-gfx,
linux-arm-msm, freedreno, nouveau, linux-rockchip, linux-tegra,
virtualization, intel-xe, xen-devel, linux-fbdev, linux-aio,
linux-fsdevel, linux-mm, linux-sound
In-Reply-To: <f2e8c32515d328db62279cc8bab8398ea278d74f.1782760670.git.ljs@kernel.org>
On Mon Jun 29, 2026 at 3:25 PM EDT, Lorenzo Stoakes wrote:
> These test whether the VMA has stack sematics, i.e. is able to grow upwards
> or downwards depending on the architecture.
>
> In order to account for arches which do not support upward-growing stacks,
> introduce VMA_GROWSUP whose definition depends on the architecture
> supporting it, and use vma_flags_test_single_mask() in vma_flags_can_grow()
> to account for this.
>
> Update the VMA userland tests to reflect the changes
>
> No functional change intended.
>
> Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
> ---
> include/linux/mm.h | 21 ++++++++++++++++++---
> tools/testing/vma/include/dup.h | 4 ++++
> 2 files changed, 22 insertions(+), 3 deletions(-)
>
Reviewed-by: Zi Yan <ziy@nvidia.com>
--
Best Regards,
Yan, Zi
^ permalink raw reply
* Re: [PATCH v3 4/4] panic: use sys_info_with_filter() to avoid duplicate backtraces
From: Petr Mladek @ 2026-07-03 12:46 UTC (permalink / raw)
To: Bradley Morgan
Cc: Feng Tang, Andrew Morton, Michael Ellerman, Nicholas Piggin,
Christophe Leroy, Madhavan Srinivasan, Douglas Anderson,
linux-kernel, linuxppc-dev, stable
In-Reply-To: <EC1E5A79-524A-45C2-9FE8-964EB0E18D76@grrlz.net>
On Thu 2026-07-02 19:13:26, Bradley Morgan wrote:
> On July 2, 2026 10:09:41 AM GMT+01:00, Petr Mladek <pmladek@suse.com>
> wrote:
> >On Mon 2026-06-29 13:54:18, Bradley Morgan wrote:
> >> On 29 June 2026 12:40:52 BST, Feng Tang <feng.tang@linux.alibaba.com>
> >> wrote:
> >> >On Fri, Jun 26, 2026 at 02:14:14PM +0200, Petr Mladek wrote:
> >> >> On Fri 2026-06-26 12:23:50, Petr Mladek wrote:
> >> >> > On Thu 2026-06-25 15:25:58, Bradley Morgan wrote:
> >> >> In watchdog, panic, and hung task detection scenarios, sys_info() can
> >> >> be called multiple times or alongside direct backtrace triggers like
> >> >> trigger_allbutcpu_cpu_backtrace(). This results in identical
> >backtraces
> >> >> being dumped repeatedly from all CPUs, cluttering the kernel log and
> >> >> delaying or obscuring critical debug details.
> >>
> >> im feeling a new file to do all the force panic jazz, but putting tape
> >> on sys_info.c isn't bd either.
> >
> >I wonder how to move forward with this.
> >
> >Honestly, I am not sure what exactly you mean by creating another
> >API for tracking the reports so I could not judge it. Feel free
> >to sent some POC.
>
> sup petr, here's my poc
>
> This should make my entire thing make sense
>
> >From eb587ed749ff5993c517f29799b369185c5ee7d8 Mon Sep 17 00:00:00 2001
> From: Bradley Morgan <include@grrlz.net>
> Date: Thu, 2 Jul 2026 18:09:23 +0000
> Subject: [POC] sys_info: Introduce incident state-tracking to prevent
> duplicate diagnostics
>
> In watchdog, panic, and hung task detection scenarios, sys_info()
> can be called multiple times or alongside direct debug output
> functions (like trigger_allbutcpu_cpu_backtrace(), print_modules(),
> print_irqtrace_events(), and dump_stack()). This leads to identical
> diagnostics and stack traces being dumped repeatedly, cluttering the
> kernel log and delaying critical panics.
>
> Introduce a state tracking bitmask and helpers in a new file,
> lib/sys_info_filter.c:
New file suggests that it would implement an API using
sys_info_filter() prefix.
> - sys_info_filter_and_set(mask): Atomically tests which bits in a mask
> have not yet been printed during the current incident, marks them as
> printed, and returns that subset.
The name of the funtion is a kind of puzzle. I think that we
could do a better job.
> - sys_info_reset(): Clears the printed mask state.
This function has sys_info* prefix. It would expect it in sys_info.c
> Add SYS_INFO_MODULES, SYS_INFO_IRQTRACE, and SYS_INFO_STACK flags to
> include/linux/sys_info.h, and handle them inside sys_info's diagnostic
> dispatch.
I though about adding an information that we printed backtrace for this
CPU as well. But it not trivial. Different API shows different extra
info, like modules, IRQ backtrace, registers, code. I would leave
this complexity aside for now.
> Update the watchdogs, hung task detector, and panic core to call
> sys_info_filter_and_set() to deduplicate their diagnostic printouts, and
> sys_info_reset() when a warning incident concludes (e.g., when a stuck
> CPU recovers, or a new hung task check round begins).
>
> This ensures each piece of system diagnostic is printed at most once per
> lockup/panic event, preventing console log spam.
>
> Assisted-by: Gemini:gemini-3.5-flash
> Signed-off-by: Bradley Morgan <include@grrlz.net>
> --- /dev/null
> +++ b/lib/sys_info_filter.c
> @@ -0,0 +1,120 @@
> +static unsigned long sys_info_printed;
> +
> +unsigned long sys_info_filter_and_set(unsigned long si_mask)
> +{
> + unsigned long old, new;
> +
> + if (!si_mask)
> + return 0;
> +
> + do {
> + old = READ_ONCE(sys_info_printed);
> + if (!(si_mask & ~old))
> + return 0;
> + new = old | si_mask;
> + } while (cmpxchg(&sys_info_printed, old, new) != old);
It is a good question whether to update the info using atomic
operations. One problem is that the mask is "unsigned long".
I am not sure if it natively atomic on all architectures.
32-bit architecures use extra locking when implementing
atomic operations with 64-bit values. And we should rather
avoid any locking in this code.
Well, long seems to be 32-bit on 32-bit x86 so it might be
safe after all.
> +void sys_info_reset(void)
> +static void __sys_info(unsigned long si_mask)
> +void sys_info(unsigned long si_mask)
I wonder why this sys_info*() API implementation has been moved
from sys_info.c to sys_info_filter.c.
I am sorry but I do not see any advantage in adding the new file
sys_info_filter.c
> NOTE!!: This is AI generated!! This **MAY** not be the finished product,
> this is ONLY the model!
IMHO, Gemini did pretty bad job in this case. Please, try to review
the AI generated before you send it. And send it only when you think
that it is reasonable enough. :-)
It is even fine to send "crap" but you should start the mail
with a warning that you send it just give us an idea what you
had it mind. And you should explain why you actually do not like.
Best Regards,
Petr
^ permalink raw reply
* Re: [PATCH v16 01/18] seccomp: Convert __secure_computing() to return boolean
From: Kevin Brodsky @ 2026-07-03 11:59 UTC (permalink / raw)
To: Michal Suchánek, Mark Rutland
Cc: Thomas Gleixner, Jinjie Ruan, oleg, richard.henderson, mattst88,
linmag7, linux, catalin.marinas, will, kees, guoren, chenhuacai,
kernel, geert, tsbogend, James.Bottomley, deller, maddy, mpe,
npiggin, chleroy, pjw, palmer, aou, alex, hca, gor, agordeev,
borntraeger, svens, ysato, dalias, glaubitz, richard,
anton.ivanov, johannes, luto, mingo, bp, dave.hansen, hpa, chris,
jcmvbkbc, peterz, wad, thuth, ada.coupriediaz, linusw,
yeoreum.yun, song, james.morse, anshuman.khandual, broonie,
liqiang01, pengcan, ryan.roberts, yangtiezhu, sshegde, mchauras,
austin.kim, jchrist, arnd, thomas.weissschuh, sohil.mehta,
andrew.cooper3, jgross, kas, x86, linux-alpha, linux-kernel,
linux-arm-kernel, linux-mm, linux-csky, loongarch, linux-m68k,
linux-mips, linux-parisc, linuxppc-dev, linux-riscv, linux-s390,
linux-sh, linux-um
In-Reply-To: <akeOjqMy7HVgRRCr@kunlun.suse.cz>
On 03/07/2026 12:27, Michal Suchánek wrote:
> On Fri, Jul 03, 2026 at 11:00:11AM +0100, Mark Rutland wrote:
>> On Fri, Jul 03, 2026 at 11:48:49AM +0200, Thomas Gleixner wrote:
>>> On Fri, Jul 03 2026 at 09:51, Michal Suchánek wrote:
>>>> On Mon, Jun 29, 2026 at 09:05:59PM +0800, Jinjie Ruan wrote:
>>>>> - if (secure_computing())
>>>>> + if (!secure_computing())
>>>>> return -1;
>>>> Hello,
>>>>
>>>> I am not fond of this logic inversion. The boolean is meaningless in
>>>> itself.
>>>>
>>>> Previously -1 was used to indicate that the syscall was filtered but you
>>>> chose to invert the logic choosing true to mean syscall was not filtered.
>>>>
>>>> You could choose true to mean that syscall was fitered avoiding this
>>>> inversion.
>>> That's just wrong. Boolean logic makes more sense with having
>>> (!condition()). Just because the old 0/-1 nonsense had it the other way
>>> round does not mean it has to stay that way.
>> 100% agreed!
>>
>> Bikeshedding below; sorry.
>>
>> I think the bigger problem is just that secure_computing() is a terrible
>> name that does not express the intended semantic -- it's not clear
>> whether "secure computing" means "seccomp permit the syscall" or
>> "seccomp is enabled and some special rules now apply" or something else
>> entirely.
>>
>> If we're changing the return type, it might be worth renaming the
>> function something like:
>>
>> seccomp_permits_syscall()
> Then not only it is clear which way the boolean value should be
> interpreted, it also pervents the accidental inversion of existing
> calls. Overall great.
Totally agreed, if we have the opportunity to rename a completely
undescriptive function name like "secure_computing" we should take it.
- Kevin
^ permalink raw reply
* Re: [PATCH v6 03/20] dma-direct: use DMA_ATTR_CC_SHARED in alloc/free paths
From: Jason Gunthorpe @ 2026-07-03 11:46 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: Aneesh Kumar K.V (Arm), iommu, linux-arm-kernel, linux-kernel,
linux-coco, Robin Murphy, Marek Szyprowski, Will Deacon,
Marc Zyngier, Steven Price, Suzuki K Poulose, Catalin Marinas,
Jiri Pirko, Mostafa Saleh, Petr Tesarik, Dan Williams, Xu Yilun,
linuxppc-dev, linux-s390, Madhavan Srinivasan, Michael Ellerman,
Nicholas Piggin, Christophe Leroy (CS GROUP), Alexander Gordeev,
Gerald Schaefer, Heiko Carstens, Vasily Gorbik,
Christian Borntraeger, Sven Schnelle, x86, Jiri Pirko,
Michael Kelley, Cheloha, Scott
In-Reply-To: <58bb92a9-c5ea-47a3-b19a-934573f15305@amd.com>
On Fri, Jul 03, 2026 at 08:15:49PM +1000, Alexey Kardashevskiy wrote:
> On 3/7/26 00:47, Jason Gunthorpe wrote:
> > On Thu, Jul 02, 2026 at 10:25:16AM +1000, Alexey Kardashevskiy wrote:
> >
> > > > > not externally available so I'll have to trick the DMA layer into
> > > > > using SWIOTLB (which is still all shared, right?) as I specifically
> > > > > want to skip page conversions. Setting low DMA mask won't guarantee
> > > > > that the DMA layer won't allocate a page outside of SWIOTLB and
> > > > > convert it. Manually do
> > > >
> > > > Why so particular?
> > >
> > > aahhh I missed "pre-". I need a way to get pre-shared pages for my
> > > sev-guest activities.
> >
> > It sounds to me like you don't, what you are worried about is
> > optimizing the dma_alloc_coherent flow to avoid fragmentation and all
> > CC architetures require this optimization.
>
> It is not about fragmentation, it is about unwanted page state
> changes when few pages are shared for a very short time.
That's really basically the same thing. The responsiblity for
optimizing the shared/private conversion lies with the DMA API not the
callers.
> When I needed these pages, I could: get a private page, convert,
> (possibly trigger RMP and IO PDE smashing if that 4K is backed with
> 2M), do the VM<->HV communication, convert back to private (and
> possibly unsmash the page).
IMHO it would be better to use something like dma_pool to amortize the
coherent allocations instead of trying to hack with swiotlb.
Jason
^ permalink raw reply
* Re: [PATCH v16 02/18] syscall_user_dispatch: Introduce a weak fallback for arch_syscall_is_vdso_sigreturn()
From: Mark Rutland @ 2026-07-03 11:43 UTC (permalink / raw)
To: Jinjie Ruan
Cc: oleg, richard.henderson, mattst88, linmag7, linux,
catalin.marinas, will, kees, guoren, chenhuacai, kernel, geert,
tsbogend, James.Bottomley, deller, maddy, mpe, npiggin, chleroy,
pjw, palmer, aou, alex, hca, gor, agordeev, borntraeger, svens,
ysato, dalias, glaubitz, richard, anton.ivanov, johannes, luto,
tglx, mingo, bp, dave.hansen, hpa, chris, jcmvbkbc, peterz, wad,
thuth, ada.coupriediaz, kevin.brodsky, linusw, yeoreum.yun, song,
james.morse, anshuman.khandual, broonie, liqiang01, pengcan,
ryan.roberts, yangtiezhu, sshegde, mchauras, austin.kim, jchrist,
arnd, thomas.weissschuh, sohil.mehta, andrew.cooper3, jgross, kas,
x86, linux-alpha, linux-kernel, linux-arm-kernel, linux-mm,
linux-csky, loongarch, linux-m68k, linux-mips, linux-parisc,
linuxppc-dev, linux-riscv, linux-s390, linux-sh, linux-um
In-Reply-To: <20260629130616.642022-3-ruanjinjie@huawei.com>
On Mon, Jun 29, 2026 at 09:06:00PM +0800, Jinjie Ruan wrote:
> Currently, multiple architectures (LoongArch, RISC-V, S390, Powerpc)
> provide identical stubs for arch_syscall_is_vdso_sigreturn() that simply
> return false. This results in redundant boilerplate code across the tree.
>
> Introduce a default __weak implementation of
> arch_syscall_is_vdso_sigreturn() directly in syscall_user_dispatch.c that
> returns false. This allows architectures that do not utilize a vDSO
> sigreturn to entirely drop their redundant inline definitions.
>
> Architectures requiring a specialized check (such as x86) will continue to
> override this fallback with their strong symbol definitions.
>
> Clean up the redundant implementations in loongarch, riscv, s390
> and powerpc.
> +bool __weak arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> +{
> + return false;
> +}
If we need this, please make it:
#ifndef arch_syscall_is_vdso_sigreturn
static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
{
return false;
}
#endif
... and require that architectures which need this provide a CPP
definition.
The use of __weak is generally problematic, as it prevents the compiler
form being able to elide code, and gets in the way of symbol resolution.
It's perfectly fine to require that architectures need to provide a CPP
definition alongside their own implementation of this function.
That said, as per my comment on v15, I'd prefer that for now we DO NOT
enable syscall user dispatch on arm64, and we first make it possible for
architecture to express whether or not they support that, even if they
use GENERIC_ENTRY. That might mean this patch isn't necessary right now.
[1] https://lore.kernel.org/linux-arm-kernel/akZgV0Y4YAmB43_g@J2N7QTR9R3.cambridge.arm.com/
Mark.
^ permalink raw reply
* Re: [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR
From: Sven Schnelle @ 2026-07-03 11:39 UTC (permalink / raw)
To: Michal Suchánek
Cc: Peter Zijlstra, Thomas Gleixner, H. Peter Anvin, Jonathan Corbet,
Shuah Khan, Huacai Chen, WANG Xuerui, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Andy Lutomirski, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, Andrew Donnellan, Mark Rutland,
Arnd Bergmann, Jiaxun Yang, Ryan Roberts, Greg Kroah-Hartman,
Mukesh Kumar Chaurasiya, Shrikanth Hegde, Zong Li, Nam Cao,
Deepak Gupta, Lukas Gerlach, Rui Qi, Kees Cook, linux-doc,
linux-kernel, loongarch, linuxppc-dev, linux-riscv, linux-s390
In-Reply-To: <akecJWAJP-e5CYP_@kunlun.suse.cz>
Michal Suchánek <msuchanek@suse.de> writes:
> The same could be asked of syscall_enter_from_user_mode. I find it very
> odd. Why does it conflate the syscall number with its return value?
>
> It never uses the syscall number passed in except when returning it
> unchanged. When it pokes the registers it reads the syscall number from
> them.
>
> If the caller of syscall_enter_from_user_mode only read the syscall
> number from the registers when syscall_enter_from_user_mode returns and
> indicates the syscall should be still executed this whole shenigan would
I agree. The fact that if (nr < NR_syscall) just works because -1 gets
casted to 0xffffffff and is therefore out of bounds is very odd.
^ permalink raw reply
* Re: [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR
From: Michal Suchánek @ 2026-07-03 11:25 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Sven Schnelle, Thomas Gleixner, H. Peter Anvin, Jonathan Corbet,
Shuah Khan, Huacai Chen, WANG Xuerui, Madhavan Srinivasan,
Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti,
Heiko Carstens, Vasily Gorbik, Alexander Gordeev,
Christian Borntraeger, Andy Lutomirski, Ingo Molnar,
Borislav Petkov, Dave Hansen, x86, Andrew Donnellan, Mark Rutland,
Arnd Bergmann, Jiaxun Yang, Ryan Roberts, Greg Kroah-Hartman,
Mukesh Kumar Chaurasiya, Shrikanth Hegde, Zong Li, Nam Cao,
Deepak Gupta, Lukas Gerlach, Rui Qi, Kees Cook, linux-doc,
linux-kernel, loongarch, linuxppc-dev, linux-riscv, linux-s390
In-Reply-To: <20260703105718.GO751831@noisy.programming.kicks-ass.net>
On Fri, Jul 03, 2026 at 12:57:18PM +0200, Peter Zijlstra wrote:
> On Fri, Jul 03, 2026 at 11:59:07AM +0200, Sven Schnelle wrote:
> > Thomas Gleixner <tglx@kernel.org> writes:
> >
> > > On Fri, Jul 03 2026 at 08:26, Sven Schnelle wrote:
> > >> Thomas Gleixner <tglx@kernel.org> writes:
> > >>> It's less than obvious and I have no objections to clean that up and
> > >>> make it more intuitive, but I still fail to see what Michal is actually
> > >>> trying to solve and what the magic flag is for. If s390 requires it,
> > >>> then that's an s390 problem, but definitely x86 does not.
> > >>
> > >> The difference between x86 and s390 is that on s390, regs->gprs[2] is
> > >> used for both the syscall number and the syscall return value.
> > >> That was a design mistake early in the begin about 25 years ago, but
> > >> it's ABI now, so it cannot be changed.
> > >
> > > Cute.
> > >
> > >> When seccomp decides to skip a syscall, it write a return value into
> > >> regs->gprs[2]. When syscall_enter_from_user_mode_work() returns, it
> > >> returns this number. If it's negative all is good - the 'if (likely(nr <
> > >> NR_syscalls))' conditiion would just catch it and skip the syscall.
> > >>
> > >> But if it's a positive number, the code cannot distinguish whether
> > >> that's a return value or a syscall number.
> > >>
> > >> So I introduced PIF_SYSCALL_RET_SET when converting s390 to generic
> > >> entry. This flag tells the syscall code that a return value was set in
> > >> ptregs and the syscall should be skipped.
> > >
> > > You also could have added a 'syscall_ret' member to pt_regs, operate
> > > on that for the return values (seccomp, syscall...) and swap it into
> > > gprs[2] right before returning to user space.
> >
> > That would likely also work, but I found it easier to read and
> > understand to have an additional flag with a descriptive name than having
> > yet another 'somehow-related-to-gpr2' member in ptregs.
>
> I find this very odd; I would think that having both syscall-nr and
> syscall-ret in separate (virtual) registers for most of the normal cycle
> would be most obvious and less surprising -- given that this is what all
> other architectures do.
>
> Entry either grabs a copy of gpr2 and preserves it in orig_gpr2 as the
> syscall nr, or as Thomas suggests, you keep syscall_ret and copy that
> into gpr2 on return to userspace (and ptrace and signal and whatever
> other surface bits are affected).
>
> Either way around you then have separate values for the entire range of
> at least the C part of the kernel syscall handling -- just like every
> other arch. How is munging things in a single value and a flag easier?
The same could be asked of syscall_enter_from_user_mode. I find it very
odd. Why does it conflate the syscall number with its return value?
It never uses the syscall number passed in except when returning it
unchanged. When it pokes the registers it reads the syscall number from
them.
If the caller of syscall_enter_from_user_mode only read the syscall
number from the registers when syscall_enter_from_user_mode returns and
indicates the syscall should be still executed this whole shenigan would
be avoided.
Thanks
Michal
^ permalink raw reply
* Re: [RFC] entry: Untangle the return value of syscall_enter_from_user_mode from syscall NR
From: Sven Schnelle @ 2026-07-03 11:17 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Thomas Gleixner, H. Peter Anvin, Michal Suchánek,
Jonathan Corbet, Shuah Khan, Huacai Chen, WANG Xuerui,
Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
Christophe Leroy (CS GROUP), Paul Walmsley, Palmer Dabbelt,
Albert Ou, Alexandre Ghiti, Heiko Carstens, Vasily Gorbik,
Alexander Gordeev, Christian Borntraeger, Andy Lutomirski,
Ingo Molnar, Borislav Petkov, Dave Hansen, x86, Andrew Donnellan,
Mark Rutland, Arnd Bergmann, Jiaxun Yang, Ryan Roberts,
Greg Kroah-Hartman, Mukesh Kumar Chaurasiya, Shrikanth Hegde,
Zong Li, Nam Cao, Deepak Gupta, Lukas Gerlach, Rui Qi, Kees Cook,
linux-doc, linux-kernel, loongarch, linuxppc-dev, linux-riscv,
linux-s390
In-Reply-To: <20260703105718.GO751831@noisy.programming.kicks-ass.net>
Peter Zijlstra <peterz@infradead.org> writes:
> On Fri, Jul 03, 2026 at 11:59:07AM +0200, Sven Schnelle wrote:
>> Thomas Gleixner <tglx@kernel.org> writes:
>>
>> > On Fri, Jul 03 2026 at 08:26, Sven Schnelle wrote:
>> >> Thomas Gleixner <tglx@kernel.org> writes:
>> >>> It's less than obvious and I have no objections to clean that up and
>> >>> make it more intuitive, but I still fail to see what Michal is actually
>> >>> trying to solve and what the magic flag is for. If s390 requires it,
>> >>> then that's an s390 problem, but definitely x86 does not.
>> >>
>> >> The difference between x86 and s390 is that on s390, regs->gprs[2] is
>> >> used for both the syscall number and the syscall return value.
>> >> That was a design mistake early in the begin about 25 years ago, but
>> >> it's ABI now, so it cannot be changed.
>> >
>> > Cute.
>> >
>> >> When seccomp decides to skip a syscall, it write a return value into
>> >> regs->gprs[2]. When syscall_enter_from_user_mode_work() returns, it
>> >> returns this number. If it's negative all is good - the 'if (likely(nr <
>> >> NR_syscalls))' conditiion would just catch it and skip the syscall.
>> >>
>> >> But if it's a positive number, the code cannot distinguish whether
>> >> that's a return value or a syscall number.
>> >>
>> >> So I introduced PIF_SYSCALL_RET_SET when converting s390 to generic
>> >> entry. This flag tells the syscall code that a return value was set in
>> >> ptregs and the syscall should be skipped.
>> >
>> > You also could have added a 'syscall_ret' member to pt_regs, operate
>> > on that for the return values (seccomp, syscall...) and swap it into
>> > gprs[2] right before returning to user space.
>>
>> That would likely also work, but I found it easier to read and
>> understand to have an additional flag with a descriptive name than having
>> yet another 'somehow-related-to-gpr2' member in ptregs.
>
> I find this very odd; I would think that having both syscall-nr and
> syscall-ret in separate (virtual) registers for most of the normal cycle
> would be most obvious and less surprising -- given that this is what all
> other architectures do.
>
> Entry either grabs a copy of gpr2 and preserves it in orig_gpr2 as the
> syscall nr, or as Thomas suggests, you keep syscall_ret and copy that
> into gpr2 on return to userspace (and ptrace and signal and whatever
> other surface bits are affected).
>
> Either way around you then have separate values for the entire range of
> at least the C part of the kernel syscall handling -- just like every
> other arch. How is munging things in a single value and a flag easier?
Looks like we have different opinions on that - I find the flag way
easier, and we don't need additional space for a long in ptregs and copy
things around.
^ permalink raw reply
* Re: [PATCH v16 02/18] syscall_user_dispatch: Introduce a weak fallback for arch_syscall_is_vdso_sigreturn()
From: Mukesh Kumar Chaurasiya @ 2026-07-03 11:13 UTC (permalink / raw)
To: Jinjie Ruan
Cc: oleg, richard.henderson, mattst88, linmag7, linux,
catalin.marinas, will, kees, guoren, chenhuacai, kernel, geert,
tsbogend, James.Bottomley, deller, maddy, mpe, npiggin, chleroy,
pjw, palmer, aou, alex, hca, gor, agordeev, borntraeger, svens,
ysato, dalias, glaubitz, richard, anton.ivanov, johannes, luto,
tglx, mingo, bp, dave.hansen, hpa, chris, jcmvbkbc, peterz, wad,
thuth, mark.rutland, ada.coupriediaz, kevin.brodsky, linusw,
yeoreum.yun, song, james.morse, anshuman.khandual, broonie,
liqiang01, pengcan, ryan.roberts, yangtiezhu, sshegde, mchauras,
austin.kim, jchrist, arnd, thomas.weissschuh, sohil.mehta,
andrew.cooper3, jgross, kas, x86, linux-alpha, linux-kernel,
linux-arm-kernel, linux-mm, linux-csky, loongarch, linux-m68k,
linux-mips, linux-parisc, linuxppc-dev, linux-riscv, linux-s390,
linux-sh, linux-um
In-Reply-To: <20260629130616.642022-3-ruanjinjie@huawei.com>
On Mon, Jun 29, 2026 at 09:06:00PM +0800, Jinjie Ruan wrote:
> Currently, multiple architectures (LoongArch, RISC-V, S390, Powerpc)
> provide identical stubs for arch_syscall_is_vdso_sigreturn() that simply
> return false. This results in redundant boilerplate code across the tree.
>
> Introduce a default __weak implementation of
> arch_syscall_is_vdso_sigreturn() directly in syscall_user_dispatch.c that
> returns false. This allows architectures that do not utilize a vDSO
> sigreturn to entirely drop their redundant inline definitions.
>
> Architectures requiring a specialized check (such as x86) will continue to
> override this fallback with their strong symbol definitions.
>
> Clean up the redundant implementations in loongarch, riscv, s390
> and powerpc.
>
> Cc: Thomas Gleixner <tglx@kernel.org>
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> arch/loongarch/include/asm/syscall.h | 5 -----
> arch/powerpc/include/asm/syscall.h | 5 -----
> arch/riscv/include/asm/syscall.h | 5 -----
> arch/s390/include/asm/syscall.h | 5 -----
> include/linux/syscall_user_dispatch.h | 1 +
> kernel/entry/syscall_user_dispatch.c | 5 +++++
> 6 files changed, 6 insertions(+), 20 deletions(-)
>
> diff --git a/arch/loongarch/include/asm/syscall.h b/arch/loongarch/include/asm/syscall.h
> index df8ea223c77b..946886794ced 100644
> --- a/arch/loongarch/include/asm/syscall.h
> +++ b/arch/loongarch/include/asm/syscall.h
> @@ -85,9 +85,4 @@ static inline int syscall_get_arch(struct task_struct *task)
> #endif
> }
>
> -static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> -{
> - return false;
> -}
> -
> #endif /* __ASM_LOONGARCH_SYSCALL_H */
> diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
> index 834fcc4f7b54..4b3c52ed6e9d 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -139,9 +139,4 @@ static inline int syscall_get_arch(struct task_struct *task)
> else
> return AUDIT_ARCH_PPC64;
> }
> -
> -static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> -{
> - return false;
> -}
> #endif /* _ASM_SYSCALL_H */
> diff --git a/arch/riscv/include/asm/syscall.h b/arch/riscv/include/asm/syscall.h
> index 8067e666a4ca..987c9a78806f 100644
> --- a/arch/riscv/include/asm/syscall.h
> +++ b/arch/riscv/include/asm/syscall.h
> @@ -112,11 +112,6 @@ static inline void syscall_handler(struct pt_regs *regs, ulong syscall)
> regs->a0 = fn(regs);
> }
>
> -static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> -{
> - return false;
> -}
> -
> asmlinkage long sys_riscv_flush_icache(uintptr_t, uintptr_t, uintptr_t);
>
> asmlinkage long sys_riscv_hwprobe(struct riscv_hwprobe *, size_t, size_t,
> diff --git a/arch/s390/include/asm/syscall.h b/arch/s390/include/asm/syscall.h
> index 4271e4169f45..5f310caad1fc 100644
> --- a/arch/s390/include/asm/syscall.h
> +++ b/arch/s390/include/asm/syscall.h
> @@ -89,11 +89,6 @@ static inline int syscall_get_arch(struct task_struct *task)
> return AUDIT_ARCH_S390X;
> }
>
> -static inline bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> -{
> - return false;
> -}
> -
> #define SYSCALL_FMT_0
> #define SYSCALL_FMT_1 , "0" (r2)
> #define SYSCALL_FMT_2 , "d" (r3) SYSCALL_FMT_1
> diff --git a/include/linux/syscall_user_dispatch.h b/include/linux/syscall_user_dispatch.h
> index 3858a6ffdd5c..73d69e02807d 100644
> --- a/include/linux/syscall_user_dispatch.h
> +++ b/include/linux/syscall_user_dispatch.h
> @@ -10,6 +10,7 @@
>
> #ifdef CONFIG_GENERIC_ENTRY
>
> +bool arch_syscall_is_vdso_sigreturn(struct pt_regs *regs);
> int set_syscall_user_dispatch(unsigned long mode, unsigned long offset,
> unsigned long len, char __user *selector);
>
> diff --git a/kernel/entry/syscall_user_dispatch.c b/kernel/entry/syscall_user_dispatch.c
> index d89dffcc2d64..acf545774d37 100644
> --- a/kernel/entry/syscall_user_dispatch.c
> +++ b/kernel/entry/syscall_user_dispatch.c
> @@ -32,6 +32,11 @@ static void trigger_sigsys(struct pt_regs *regs)
> force_sig_info(&info);
> }
>
> +bool __weak arch_syscall_is_vdso_sigreturn(struct pt_regs *regs)
> +{
> + return false;
> +}
> +
> bool syscall_user_dispatch(struct pt_regs *regs)
> {
> struct syscall_user_dispatch *sd = ¤t->syscall_dispatch;
> --
> 2.34.1
>
Build and boot tested on ppc with P11 LPAR. LGTM.
Tested-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
Reviewed-by: Mukesh Kumar Chaurasiya (IBM) <mkchauras@gmail.com>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox