* [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj()
@ 2026-10-21 12:09 Lee Jones
2026-10-21 12:09 ` [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset() Lee Jones
` (27 more replies)
0 siblings, 28 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Ming Yu, mfd, linux-kernel; +Cc: stable
nct6694_usb_probe() allocates the USB transfer buffers usb_msg and
int_buffer using devm_kzalloc(). Because devm_kzalloc() prepends
internal devres metadata to the allocation, the returned buffer pointers
are not guaranteed to be ARCH_DMA_MINALIGN cacheline-aligned. Mapping
these unaligned buffers for USB bulk and interrupt DMA transfers risks
cacheline sharing and memory corruption on non-cache-coherent
architectures.
Allocate usb_msg and int_buffer using kzalloc_obj() to guarantee
DMA-safe alignment, and free them on probe failure and in
nct6694_usb_disconnect().
Fixes: 51dad33ede63 ("mfd: Add core driver for Nuvoton NCT6694")
Closes: https://sashiko.dev/#/bug/linux-6f9e5ba3-714e-41ad-b6cd-3a17c665b87f
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/nct6694.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/nct6694.c b/drivers/mfd/nct6694.c
index 308b2fda3055..e2957e587d1b 100644
--- a/drivers/mfd/nct6694.c
+++ b/drivers/mfd/nct6694.c
@@ -284,17 +284,21 @@ static int nct6694_usb_probe(struct usb_interface *iface,
if (!nct6694)
return -ENOMEM;
- nct6694->usb_msg = devm_kzalloc(dev, sizeof(union nct6694_usb_msg), GFP_KERNEL);
+ nct6694->usb_msg = kzalloc_obj(*nct6694->usb_msg);
if (!nct6694->usb_msg)
return -ENOMEM;
- nct6694->int_buffer = devm_kzalloc(dev, sizeof(*nct6694->int_buffer), GFP_KERNEL);
- if (!nct6694->int_buffer)
- return -ENOMEM;
+ nct6694->int_buffer = kzalloc_obj(*nct6694->int_buffer);
+ if (!nct6694->int_buffer) {
+ ret = -ENOMEM;
+ goto err_usb_msg;
+ }
nct6694->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
- if (!nct6694->int_in_urb)
- return -ENOMEM;
+ if (!nct6694->int_in_urb) {
+ ret = -ENOMEM;
+ goto err_int_buffer;
+ }
nct6694->domain = irq_domain_create_simple(NULL, NCT6694_NR_IRQS, 0,
&nct6694_irq_domain_ops,
@@ -352,6 +356,10 @@ static int nct6694_usb_probe(struct usb_interface *iface,
irq_domain_remove(nct6694->domain);
err_urb:
usb_free_urb(nct6694->int_in_urb);
+err_int_buffer:
+ kfree(nct6694->int_buffer);
+err_usb_msg:
+ kfree(nct6694->usb_msg);
return ret;
}
@@ -367,6 +375,8 @@ static void nct6694_usb_disconnect(struct usb_interface *iface)
ida_destroy(&nct6694->gpio_ida);
irq_domain_remove(nct6694->domain);
usb_free_urb(nct6694->int_in_urb);
+ kfree(nct6694->int_buffer);
+ kfree(nct6694->usb_msg);
}
static const struct usb_device_id nct6694_ids[] = {
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 13:57 ` Andy Shevchenko
2026-10-21 14:00 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 03/28] mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel() Lee Jones
` (26 subsequent siblings)
27 siblings, 2 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Binbin Zhou, Chong Qiao, Andy Shevchenko, Corey Minyard,
Huacai Chen, mfd, linux-kernel
Cc: stable
ls2k_bmc_init() unconditionally calls acpi_unregister_gsi() immediately
after requesting the GPIO interrupt via devm_request_irq(). This
prematurely disposes of the active IRQ mapping while the interrupt
handler remains registered, breaking the GPIO watchdog interrupt and
causing a use-after-free when devres later frees the disposed IRQ
descriptor on probe failure or device unbind.
Register a devm_add_action_or_reset() callback before devm_request_irq()
so that acpi_unregister_gsi() is invoked only after devres has freed the
interrupt.
Fixes: d952bba3fbb5 ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support")
Closes: https://sashiko.dev/#/bug/linux-cab8bfb6-4077-46f3-a173-ac2e2042cf66
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/ls2k-bmc-core.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/ls2k-bmc-core.c b/drivers/mfd/ls2k-bmc-core.c
index 408056bfb2fe..23c774a09842 100644
--- a/drivers/mfd/ls2k-bmc-core.c
+++ b/drivers/mfd/ls2k-bmc-core.c
@@ -363,6 +363,11 @@ static void ls2k_bmc_save_pci_data(struct pci_dev *pdev, struct ls2k_bmc_ddata *
pci_read_config_dword(pdev, PCI_INTERRUPT_LINE, &ddata->bmc_pci_data.interrupt_line);
}
+static void ls2k_bmc_unregister_gsi(void *data)
+{
+ acpi_unregister_gsi(LS2K_BMC_RESET_GPIO_GSI);
+}
+
static int ls2k_bmc_init(struct ls2k_bmc_ddata *ddata)
{
struct pci_dev *pdev = to_pci_dev(ddata->dev);
@@ -412,12 +417,15 @@ static int ls2k_bmc_init(struct ls2k_bmc_ddata *ddata)
if (gpio_irq < 0)
return gpio_irq;
+ ret = devm_add_action_or_reset(ddata->dev, ls2k_bmc_unregister_gsi, NULL);
+ if (ret)
+ return ret;
+
ret = devm_request_irq(ddata->dev, gpio_irq, ls2k_bmc_interrupt,
IRQF_SHARED | IRQF_TRIGGER_FALLING, "ls2kbmc gpio", ddata);
if (ret)
dev_err(ddata->dev, "Failed to request LS2KBMC GPIO IRQ %d.\n", gpio_irq);
- acpi_unregister_gsi(LS2K_BMC_RESET_GPIO_GSI);
return ret;
}
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 03/28] mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
2026-10-21 12:09 ` [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 13:59 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 04/28] mfd: ls2kbmc: Allocate simplefb platform_data on the heap Lee Jones
` (25 subsequent siblings)
27 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Binbin Zhou, Chong Qiao, Andy Shevchenko, Huacai Chen,
Corey Minyard, mfd, linux-kernel
Cc: stable
ls2k_bmc_init() initialises bmc_reset_work with INIT_WORK() and
immediately requests the PCIe and GPIO interrupts via devm_request_irq().
If an interrupt fires and schedules bmc_reset_work before a subsequent
step in ls2k_bmc_probe() fails, or when the device is unbound, devres
frees ddata whilst bmc_reset_work remains queued, leading to a
use-after-free in ls2k_bmc_events_fn().
Initialise bmc_reset_work with devm_work_autocancel() before requesting
the interrupts so that devres cancels any pending work after the
interrupts are freed and before ddata is released.
Fixes: d952bba3fbb5 ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support")
Closes: https://sashiko.dev/#/bug/linux-3089d131-9fcf-4753-b183-eebe0a6e020e
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/ls2k-bmc-core.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/ls2k-bmc-core.c b/drivers/mfd/ls2k-bmc-core.c
index 23c774a09842..e245bdee8226 100644
--- a/drivers/mfd/ls2k-bmc-core.c
+++ b/drivers/mfd/ls2k-bmc-core.c
@@ -12,6 +12,7 @@
#include <linux/aperture.h>
#include <linux/bitfield.h>
#include <linux/delay.h>
+#include <linux/devm-helpers.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/iopoll.h>
@@ -376,7 +377,9 @@ static int ls2k_bmc_init(struct ls2k_bmc_ddata *ddata)
ls2k_bmc_save_pci_data(pdev, ddata);
- INIT_WORK(&ddata->bmc_reset_work, ls2k_bmc_events_fn);
+ ret = devm_work_autocancel(ddata->dev, &ddata->bmc_reset_work, ls2k_bmc_events_fn);
+ if (ret)
+ return ret;
ret = devm_request_irq(&pdev->dev, pdev->irq, ls2k_bmc_interrupt,
IRQF_SHARED | IRQF_TRIGGER_FALLING, "ls2kbmc pcie", ddata);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 04/28] mfd: ls2kbmc: Allocate simplefb platform_data on the heap
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
2026-10-21 12:09 ` [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset() Lee Jones
2026-10-21 12:09 ` [PATCH 03/28] mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 13:58 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 05/28] mfd: bd96801: Allocate watchdog IRQ resource " Lee Jones
` (24 subsequent siblings)
27 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Binbin Zhou, Chong Qiao, Andy Shevchenko, mfd, linux-kernel
ls2k_bmc_probe() declares struct simplefb_platform_data on the stack and
assigns its address to the display MFD cell. Although mfd_add_device()
deep-copies platform_data via platform_device_add_data() before
ls2k_bmc_probe() returns, the shallow mfd_cell copy attached to the
child platform device retains a stale pointer to the expired stack
frame.
Allocate the simplefb_platform_data structure on the heap via
devm_kzalloc() prior to devm_mfd_add_devices() so the pointer remains
valid for the lifetime of the child platform device.
Closes: https://sashiko.dev/#/bug/linux-4e2dd9cb-310b-4bba-b305-ffacc738285c
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/ls2k-bmc-core.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/ls2k-bmc-core.c b/drivers/mfd/ls2k-bmc-core.c
index e245bdee8226..3e3bc835262e 100644
--- a/drivers/mfd/ls2k-bmc-core.c
+++ b/drivers/mfd/ls2k-bmc-core.c
@@ -470,7 +470,7 @@ static int ls2k_bmc_parse_mode(struct pci_dev *pdev, struct simplefb_platform_da
static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
{
- struct simplefb_platform_data pd;
+ struct simplefb_platform_data *pd;
struct ls2k_bmc_ddata *ddata;
resource_size_t base;
int ret;
@@ -489,12 +489,16 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (ret)
return ret;
- ret = ls2k_bmc_parse_mode(dev, &pd);
+ pd = devm_kzalloc(&dev->dev, sizeof(*pd), GFP_KERNEL);
+ if (!pd)
+ return -ENOMEM;
+
+ ret = ls2k_bmc_parse_mode(dev, pd);
if (ret)
return ret;
- ls2k_bmc_cells[LS2K_BMC_DISPLAY].platform_data = &pd;
- ls2k_bmc_cells[LS2K_BMC_DISPLAY].pdata_size = sizeof(pd);
+ ls2k_bmc_cells[LS2K_BMC_DISPLAY].platform_data = pd;
+ ls2k_bmc_cells[LS2K_BMC_DISPLAY].pdata_size = sizeof(*pd);
base = pci_resource_start(dev, 0) + LS2K_DISPLAY_RES_START;
/* Remove conflicting efifb device */
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 05/28] mfd: bd96801: Allocate watchdog IRQ resource on the heap
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (2 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 04/28] mfd: ls2kbmc: Allocate simplefb platform_data on the heap Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 06/28] mfd: ti_am335x_tscadc: Retrieve parent driver data via dev_get_drvdata() Lee Jones
` (23 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Matti Vaittinen, cover.1712920132.git.mazziesaccount, mfd,
linux-kernel
bd96801_i2c_probe() declares struct resource wdg_irq on the stack and
assigns its address to ddata->cells[WDG_CELL].resources. Although
mfd_add_device() deep-copies the resource table via
platform_device_add_resources() before bd96801_i2c_probe() returns, the
shared cell template and the shallow MFD cell copy attached to the child
platform device retain a stale pointer to the expired stack frame.
Allocate wdg_irq on the heap via devm_kzalloc() alongside regulator_res
so the stored pointer remains valid for the lifetime of the device.
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/rohm-bd96801.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/rohm-bd96801.c b/drivers/mfd/rohm-bd96801.c
index 66fa017ad568..eb7a7376ea89 100644
--- a/drivers/mfd/rohm-bd96801.c
+++ b/drivers/mfd/rohm-bd96801.c
@@ -642,8 +642,7 @@ static int bd96801_i2c_probe(struct i2c_client *i2c)
struct irq_domain *intb_domain, *errb_domain;
const struct bd968xx *ddata;
const struct fwnode_handle *fwnode;
- struct resource *regulator_res;
- struct resource wdg_irq;
+ struct resource *regulator_res, *wdg_irq;
struct regmap *regmap;
int intb_irq, errb_irq, num_errb = 0;
int num_regu_irqs, wdg_irq_no;
@@ -692,6 +691,10 @@ static int bd96801_i2c_probe(struct i2c_client *i2c)
if (!regulator_res)
return -ENOMEM;
+ wdg_irq = devm_kzalloc(&i2c->dev, sizeof(*wdg_irq), GFP_KERNEL);
+ if (!wdg_irq)
+ return -ENOMEM;
+
regmap = devm_regmap_init_i2c(i2c, ddata->regmap_config);
if (IS_ERR(regmap))
return dev_err_probe(&i2c->dev, PTR_ERR(regmap),
@@ -723,9 +726,9 @@ static int bd96801_i2c_probe(struct i2c_client *i2c)
}
wdg_irq_no = irq_create_mapping(intb_domain, BD96801_WDT_ERR_STAT);
- wdg_irq = DEFINE_RES_IRQ_NAMED(wdg_irq_no, "bd96801-wdg");
+ *wdg_irq = DEFINE_RES_IRQ_NAMED(wdg_irq_no, "bd96801-wdg");
- ddata->cells[WDG_CELL].resources = &wdg_irq;
+ ddata->cells[WDG_CELL].resources = wdg_irq;
ddata->cells[WDG_CELL].num_resources = 1;
if (!num_errb)
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 06/28] mfd: ti_am335x_tscadc: Retrieve parent driver data via dev_get_drvdata()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (3 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 05/28] mfd: bd96801: Allocate watchdog IRQ resource " Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 07/28] mfd: db8500-prcmu: Make AB8500 cell and IRQ resource static Lee Jones
` (22 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Rachna Patil, mfd, linux-kernel
ti_tscadc_probe() stores the address of the local pointer variable
tscadc (&tscadc) into cell->platform_data so child devices can retrieve
the parent struct ti_tscadc_dev pointer via ti_tscadc_dev_get().
Although mfd_add_device() deep-copies platform_data before
ti_tscadc_probe() returns, both tscadc->cells[].platform_data and the
shallow MFD cell copy attached to the child platform devices retain a
stale pointer to the expired stack frame.
Set the parent platform driver data before registering the MFD child
devices, update ti_tscadc_dev_get() to retrieve the parent driver data
via dev_get_drvdata(p->dev.parent), and drop the redundant cell
platform_data assignment.
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/ti_am335x_tscadc.c | 7 ++-----
include/linux/mfd/ti_am335x_tscadc.h | 4 +---
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335x_tscadc.c
index 068c25401c6c..4afa9928eba5 100644
--- a/drivers/mfd/ti_am335x_tscadc.c
+++ b/drivers/mfd/ti_am335x_tscadc.c
@@ -268,8 +268,6 @@ static int ti_tscadc_probe(struct platform_device *pdev)
cell = &tscadc->cells[cell_idx++];
cell->name = tscadc->data->secondary_feature_name;
cell->of_compatible = tscadc->data->secondary_feature_compatible;
- cell->platform_data = &tscadc;
- cell->pdata_size = sizeof(tscadc);
}
/* ADC Cell */
@@ -277,16 +275,15 @@ static int ti_tscadc_probe(struct platform_device *pdev)
cell = &tscadc->cells[cell_idx++];
cell->name = tscadc->data->adc_feature_name;
cell->of_compatible = tscadc->data->adc_feature_compatible;
- cell->platform_data = &tscadc;
- cell->pdata_size = sizeof(tscadc);
}
+ platform_set_drvdata(pdev, tscadc);
+
err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
tscadc->cells, cell_idx, NULL, 0, NULL);
if (err < 0)
goto err_disable_clk;
- platform_set_drvdata(pdev, tscadc);
return 0;
err_disable_clk:
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index 4063b0614d90..4a048a897cf3 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -177,9 +177,7 @@ struct ti_tscadc_dev {
static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
{
- struct ti_tscadc_dev **tscadc_dev = p->dev.platform_data;
-
- return *tscadc_dev;
+ return dev_get_drvdata(p->dev.parent);
}
static inline bool ti_adc_with_touchscreen(struct ti_tscadc_dev *tscadc)
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 07/28] mfd: db8500-prcmu: Make AB8500 cell and IRQ resource static
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (4 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 06/28] mfd: ti_am335x_tscadc: Retrieve parent driver data via dev_get_drvdata() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 08/28] mfd: nct6694: Do not resubmit interrupt URB on endpoint stall (-EPIPE) Lee Jones
` (21 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Linus Walleij, Kumar Sanghvi, Sundar Iyer, Mattias Nilsson,
linux-arm-kernel, mfd, linux-kernel
db8500_prcmu_register_ab8500() declares struct resource ab850x_resource
and the mfd_cell descriptors on the stack and assigns &ab850x_resource
to ab850x_cell->resources. Although mfd_add_device() deep-copies the
resource table via platform_device_add_resources() before
db8500_prcmu_register_ab8500() returns, the shallow MFD cell copy
attached to the child platform device retains a stale pointer to the
expired stack frame.
Mark ab850x_resource as static and the ab8500_cell and ab8505_cell
descriptors as static const so the resource pointer remains valid for
the lifetime of the device.
Closes: https://sashiko.dev/#/bug/linux-554f3a1f-ca41-4078-ae9e-66d0d7fb4c9d
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/db8500-prcmu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 6672c55f2ebc..cdfcbeb2a88c 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -2953,16 +2953,15 @@ static const struct mfd_cell db8500_prcmu_devs[] = {
static int db8500_prcmu_register_ab8500(struct device *parent)
{
- struct device_node *np;
- struct resource ab850x_resource;
- const struct mfd_cell ab8500_cell = {
+ static struct resource ab850x_resource;
+ static const struct mfd_cell ab8500_cell = {
.name = "ab8500-core",
.of_compatible = "stericsson,ab8500",
.id = AB8500_VERSION_AB8500,
.resources = &ab850x_resource,
.num_resources = 1,
};
- const struct mfd_cell ab8505_cell = {
+ static const struct mfd_cell ab8505_cell = {
.name = "ab8505-core",
.of_compatible = "stericsson,ab8505",
.id = AB8500_VERSION_AB8505,
@@ -2970,6 +2969,7 @@ static int db8500_prcmu_register_ab8500(struct device *parent)
.num_resources = 1,
};
const struct mfd_cell *ab850x_cell;
+ struct device_node *np;
if (!parent->of_node)
return -ENODEV;
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 08/28] mfd: nct6694: Do not resubmit interrupt URB on endpoint stall (-EPIPE)
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (5 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 07/28] mfd: db8500-prcmu: Make AB8500 cell and IRQ resource static Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 09/28] mfd: cgbc: Zero-initialise version buffer in cgbc_get_version() Lee Jones
` (20 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Ming Yu, mfd, linux-kernel; +Cc: stable
If the USB interrupt IN endpoint stalls (-EPIPE), usb_int_callback()
falls through to the default case and immediately resubmits the URB from
atomic completion context. Because a stalled endpoint completes newly
submitted URBs immediately with -EPIPE, this triggers a tight infinite
resubmission loop.
Treat -EPIPE as a terminal URB status in usb_int_callback() alongside
the existing teardown status codes, matching other USB MFD drivers.
Fixes: 51dad33ede63 ("mfd: Add core driver for Nuvoton NCT6694")
Closes: https://sashiko.dev/#/bug/linux-9d8d1902-140d-4559-b604-76ba76e778a2
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/nct6694.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/nct6694.c b/drivers/mfd/nct6694.c
index e2957e587d1b..40a29f8e0ff6 100644
--- a/drivers/mfd/nct6694.c
+++ b/drivers/mfd/nct6694.c
@@ -201,6 +201,7 @@ static void usb_int_callback(struct urb *urb)
break;
case -ECONNRESET:
case -ENOENT:
+ case -EPIPE:
case -ESHUTDOWN:
return;
default:
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 09/28] mfd: cgbc: Zero-initialise version buffer in cgbc_get_version()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (6 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 08/28] mfd: nct6694: Do not resubmit interrupt URB on endpoint stall (-EPIPE) Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 10/28] mfd: ioc3: Request parent IRQ via request_irq() and free before domain removal Lee Jones
` (19 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Thomas Richard, mfd, linux-kernel; +Cc: stable
If the Board Controller returns a short response to the firmware
revision query in cgbc_get_version(), cgbc_command() can succeed
without populating all bytes of the stack-allocated data buffer.
Those uninitialised stack bytes are then copied into cgbc->version
and exposed to userspace via the cgbc_version sysfs attribute.
Zero-initialise the data buffer on the stack to prevent leaking
uninitialised kernel stack memory.
Fixes: 6f1067cfbee7 ("mfd: Add Congatec Board Controller driver")
Closes: https://sashiko.dev/#/bug/linux-8c473713-527e-4619-8404-689f28c7654d
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/cgbc-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/cgbc-core.c b/drivers/mfd/cgbc-core.c
index 2becaf797646..f2615c783bc8 100644
--- a/drivers/mfd/cgbc-core.c
+++ b/drivers/mfd/cgbc-core.c
@@ -299,7 +299,7 @@ ATTRIBUTE_GROUPS(cgbc);
static int cgbc_get_version(struct cgbc_device_data *cgbc)
{
u8 cmd = CGBC_CMD_GET_FW_REV;
- u8 data[4];
+ u8 data[4] = {};
int ret;
ret = cgbc_command(cgbc, &cmd, 1, &data, sizeof(data), NULL);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 10/28] mfd: ioc3: Request parent IRQ via request_irq() and free before domain removal
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (7 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 09/28] mfd: cgbc: Zero-initialise version buffer in cgbc_get_version() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure Lee Jones
` (18 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Thomas Bogendoerfer, Stanislaw Skowronek, Joshua Kinard,
Brent Casavant, Pat Gefre, Paul Burton, mfd, linux-kernel
Cc: stable
ioc3_irq_domain_setup() registers ioc3_irq_handler() as a chained
interrupt handler using irq_set_chained_handler_and_data(), whilst
ioc3_mfd_remove() and the ioc3_mfd_probe() error path attempt to tear it
down with free_irq(ipd->domain_irq, (void *)ipd) after removing the IRQ
domain. Because chained handlers bypass the standard irqaction list,
free_irq() warns and fails to detach ioc3_irq_handler(), leaving a
dangling handler referencing the freed IRQ domain and driver private
data.
Register ioc3_irq_handler() with request_irq() to match free_irq(),
dispatch child interrupts via generic_handle_domain_irq_safe(), and free
the IRQ prior to removing the IRQ domain on teardown.
Fixes: 0ce5ebd24d25 ("mfd: ioc3: Add driver for SGI IOC3 chip")
Closes: https://sashiko.dev/#/bug/linux-81f02420-548c-47cf-bd46-0bdcfb5c1738
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/ioc3.c | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/drivers/mfd/ioc3.c b/drivers/mfd/ioc3.c
index 5f8ac364b610..885f19154e02 100644
--- a/drivers/mfd/ioc3.c
+++ b/drivers/mfd/ioc3.c
@@ -99,10 +99,9 @@ static const struct irq_domain_ops ioc3_irq_domain_ops = {
.unmap = ioc3_irq_domain_unmap,
};
-static void ioc3_irq_handler(struct irq_desc *desc)
+static irqreturn_t ioc3_irq_handler(int irq, void *data)
{
- struct irq_domain *domain = irq_desc_get_handler_data(desc);
- struct ioc3_priv_data *ipd = domain->host_data;
+ struct ioc3_priv_data *ipd = data;
struct ioc3 __iomem *regs = ipd->regs;
u32 pending, mask;
@@ -110,10 +109,12 @@ static void ioc3_irq_handler(struct irq_desc *desc)
mask = readl(®s->sio_ies);
pending &= mask; /* Mask off not enabled interrupts */
- if (pending)
- generic_handle_domain_irq(domain, __ffs(pending));
- else
- spurious_interrupt();
+ if (pending) {
+ generic_handle_domain_irq_safe(ipd->domain, __ffs(pending));
+ return IRQ_HANDLED;
+ }
+
+ return IRQ_NONE;
}
/*
@@ -133,6 +134,7 @@ static int ioc3_irq_domain_setup(struct ioc3_priv_data *ipd, int irq)
{
struct irq_domain *domain;
struct fwnode_handle *fn;
+ int ret = -ENOMEM;
fn = irq_domain_alloc_named_fwnode("IOC3");
if (!fn)
@@ -146,13 +148,19 @@ static int ioc3_irq_domain_setup(struct ioc3_priv_data *ipd, int irq)
ipd->domain = domain;
- irq_set_chained_handler_and_data(irq, ioc3_irq_handler, domain);
+ ret = request_irq(irq, ioc3_irq_handler, IRQF_SHARED, "IOC3", ipd);
+ if (ret) {
+ irq_domain_remove(domain);
+ irq_domain_free_fwnode(fn);
+ ipd->domain = NULL;
+ goto err;
+ }
ipd->domain_irq = irq;
return 0;
err:
dev_err(&ipd->pdev->dev, "irq domain setup failed\n");
- return -ENOMEM;
+ return ret;
}
static const struct resource ioc3_uarta_resources[] = {
@@ -615,9 +623,9 @@ static int ioc3_mfd_probe(struct pci_dev *pdev,
if (ipd->domain) {
struct fwnode_handle *fn = ipd->domain->fwnode;
+ free_irq(ipd->domain_irq, (void *)ipd);
irq_domain_remove(ipd->domain);
irq_domain_free_fwnode(fn);
- free_irq(ipd->domain_irq, (void *)ipd);
}
pci_iounmap(pdev, regs);
goto out_disable_device;
@@ -645,9 +653,9 @@ static void ioc3_mfd_remove(struct pci_dev *pdev)
if (ipd->domain) {
struct fwnode_handle *fn = ipd->domain->fwnode;
- irq_domain_remove(ipd->domain);
- irq_domain_free_fwnode(fn);
free_irq(ipd->domain_irq, (void *)ipd);
+ irq_domain_remove(ipd->domain);
+ irq_domain_free_fwnode(fn);
}
pci_iounmap(pdev, ipd->regs);
pci_disable_device(pdev);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (8 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 10/28] mfd: ioc3: Request parent IRQ via request_irq() and free before domain removal Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 14:01 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 12/28] mfd: max8907: Manage power-off handler via devm_register_sys_off_handler() Lee Jones
` (17 subsequent siblings)
27 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Andy Shevchenko, Mika Westerberg, Heikki Krogerus,
Jarkko Nikula, mfd, linux-kernel
Cc: stable
When intel_lpss_has_idma() is true, intel_lpss_probe() registers the
iDMA64 child device via mfd_add_devices() before registering the host
controller cell. If the second mfd_add_devices() call fails, the
err_remove_ltr error path returns without calling mfd_remove_devices(),
leaving the iDMA64 child device registered after the parent's
device-managed resources are freed.
Call mfd_remove_devices() on the probe error path to clean up any
previously registered MFD child devices, matching intel_lpss_remove().
Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices")
Closes: https://sashiko.dev/#/bug/linux-b0ba1dea-0272-491a-a1aa-2fd27c5eb9b0
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/intel-lpss.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c
index 63d6694f7145..657b1e3fb896 100644
--- a/drivers/mfd/intel-lpss.c
+++ b/drivers/mfd/intel-lpss.c
@@ -455,6 +455,7 @@ int intel_lpss_probe(struct device *dev,
return 0;
err_remove_ltr:
+ mfd_remove_devices(dev);
intel_lpss_debugfs_remove(lpss);
intel_lpss_ltr_hide(lpss);
intel_lpss_unregister_clock(lpss);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 12/28] mfd: max8907: Manage power-off handler via devm_register_sys_off_handler()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (9 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 13/28] mfd: twl-core: Clear pm_power_off callback in twl_remove() Lee Jones
` (16 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Gyungoh Yoo, Samuel Ortiz, Stephen Warren, mfd, linux-kernel; +Cc: stable
When the MAX8907 device is configured as the system power controller,
max8907_i2c_probe() assigns the devres-managed device context to
max8907_pm_off and registers max8907_power_off() as the global
pm_power_off handler. However, max8907_i2c_remove() does not clear
these pointers upon device unbind, leaving pm_power_off and
max8907_pm_off dangling after devres frees the driver state.
Convert max8907_power_off() to a sys_off_handler callback registered via
devm_register_sys_off_handler() so the handler is automatically
unregistered on device unbind and the global max8907_pm_off pointer can
be dropped.
Fixes: 9582fdcb6fcf ("mfd: max8907: Add power off control")
Closes: https://sashiko.dev/#/bug/linux-d73d6689-d160-447f-9b3c-710fd4c4b6fb
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/max8907.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
index 7bac1d651771..dab5706d4115 100644
--- a/drivers/mfd/max8907.c
+++ b/drivers/mfd/max8907.c
@@ -15,6 +15,7 @@
#include <linux/mfd/max8907.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/reboot.h>
#include <linux/regmap.h>
#include <linux/slab.h>
@@ -173,11 +174,14 @@ static const struct regmap_irq_chip max8907_rtc_irq_chip = {
.num_irqs = ARRAY_SIZE(max8907_rtc_irqs),
};
-static struct max8907 *max8907_pm_off;
-static void max8907_power_off(void)
+static int max8907_power_off(struct sys_off_data *data)
{
- regmap_update_bits(max8907_pm_off->regmap_gen, MAX8907_REG_RESET_CNFG,
- MAX8907_MASK_POWER_OFF, MAX8907_MASK_POWER_OFF);
+ struct max8907 *max8907 = data->cb_data;
+
+ regmap_update_bits(max8907->regmap_gen, MAX8907_REG_RESET_CNFG,
+ MAX8907_MASK_POWER_OFF, MAX8907_MASK_POWER_OFF);
+
+ return NOTIFY_DONE;
}
static int max8907_i2c_probe(struct i2c_client *i2c)
@@ -256,13 +260,23 @@ static int max8907_i2c_probe(struct i2c_client *i2c)
goto err_add_devices;
}
- if (pm_off && !pm_power_off) {
- max8907_pm_off = max8907;
- pm_power_off = max8907_power_off;
+ if (pm_off) {
+ ret = devm_register_sys_off_handler(&i2c->dev,
+ SYS_OFF_MODE_POWER_OFF,
+ SYS_OFF_PRIO_DEFAULT,
+ max8907_power_off, max8907);
+ if (ret) {
+ dev_err(&i2c->dev,
+ "failed to register sys-off handler: %d\n",
+ ret);
+ goto err_sys_off;
+ }
}
return 0;
+err_sys_off:
+ mfd_remove_devices(max8907->dev);
err_add_devices:
regmap_del_irq_chip(max8907->i2c_gen->irq, max8907->irqc_rtc);
err_irqc_rtc:
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 13/28] mfd: twl-core: Clear pm_power_off callback in twl_remove()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (10 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 12/28] mfd: max8907: Manage power-off handler via devm_register_sys_off_handler() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 14/28] mfd: twl-core: Clear twl_priv pointer on teardown and probe failure Lee Jones
` (15 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, Kai Svahn, syed khasim, linux-omap, mfd,
linux-kernel
Cc: stable
When a TWL6030-class device is configured as the system power
controller, twl_probe() registers twl6030_power_off() as the global
pm_power_off callback. However, twl_remove() does not clear
pm_power_off when tearing down the device on late probe failure or
driver unbind, leaving a dangling callback that dereferences the freed
twl_priv context during system shutdown.
Reset pm_power_off to NULL in twl_remove() when it points to
twl6030_power_off().
Fixes: ca9414a1d087 ("mfd: twl-core: Add power off implementation for twl603x")
Closes: https://sashiko.dev/#/bug/linux-f5847f26-c868-416a-b926-3fc3da57802d
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/twl-core.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index c024a28b057e..64b45fe79159 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -672,10 +672,26 @@ static void clocks_init(struct device *dev)
/*----------------------------------------------------------------------*/
+static void twl6030_power_off(void)
+{
+ int err;
+ u8 val;
+
+ err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val, TWL6030_PHOENIX_DEV_ON);
+ if (err)
+ return;
+
+ val |= TWL6030_APP_DEVOFF | TWL6030_CON_DEVOFF | TWL6030_MOD_DEVOFF;
+ twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val, TWL6030_PHOENIX_DEV_ON);
+}
+
static void twl_remove(struct i2c_client *client)
{
unsigned i, num_slaves;
+ if (pm_power_off == twl6030_power_off)
+ pm_power_off = NULL;
+
if (twl_class_is_4030())
twl4030_exit_irq();
else
@@ -692,19 +708,6 @@ static void twl_remove(struct i2c_client *client)
twl_priv->ready = false;
}
-static void twl6030_power_off(void)
-{
- int err;
- u8 val;
-
- err = twl_i2c_read_u8(TWL_MODULE_PM_MASTER, &val, TWL6030_PHOENIX_DEV_ON);
- if (err)
- return;
-
- val |= TWL6030_APP_DEVOFF | TWL6030_CON_DEVOFF | TWL6030_MOD_DEVOFF;
- twl_i2c_write_u8(TWL_MODULE_PM_MASTER, val, TWL6030_PHOENIX_DEV_ON);
-}
-
static struct of_dev_auxdata twl_auxdata_lookup[] = {
OF_DEV_AUXDATA("ti,twl4030-gpio", 0, "twl4030-gpio", NULL),
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 14/28] mfd: twl-core: Clear twl_priv pointer on teardown and probe failure
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (11 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 13/28] mfd: twl-core: Clear pm_power_off callback in twl_remove() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 15/28] mfd: loongson-se: Check return value of dma_set_mask_and_coherent() Lee Jones
` (14 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, Kai Svahn, syed khasim, Samuel Ortiz,
Peter Ujfalusi, linux-omap, mfd, linux-kernel
Cc: stable
twl_probe() allocates the file-scope twl_priv state with devm_kzalloc()
and checks for a non-NULL twl_priv at entry to reject multiple device
instances. However, twl_remove() and the early error paths in
twl_probe() never reset twl_priv to NULL, a failure when adding MFD
child devices bypasses twl_remove() by jumping to free instead of fail,
and twl_remove() tears down the IRQ domain and dummy I2C clients before
child devices are unregistered. After devres frees the underlying
memory on probe failure or unbind, twl_priv remains a dangling pointer,
causing subsequent exported API calls to dereference freed memory and
blocking future probe attempts with -EBUSY.
Unregister DT-populated and MFD child devices at the start of
twl_remove(), ensure mfd_add_devices() failures unwind via fail, and
reset twl_priv to NULL in twl_remove() and on probe error exit.
Fixes: 80a97ccd33be ("mfd: twl-core: Collect global variables behind one private structure (global)")
Closes: https://sashiko.dev/#/bug/linux-73e82f84-94de-4d08-82a4-f22d42a1dedf
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/twl-core.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
index 64b45fe79159..21fc0acb827b 100644
--- a/drivers/mfd/twl-core.c
+++ b/drivers/mfd/twl-core.c
@@ -689,6 +689,11 @@ static void twl_remove(struct i2c_client *client)
{
unsigned i, num_slaves;
+ of_platform_depopulate(&client->dev);
+
+ if (twl_class_is_6030())
+ mfd_remove_devices(&client->dev);
+
if (pm_power_off == twl6030_power_off)
pm_power_off = NULL;
@@ -706,6 +711,7 @@ static void twl_remove(struct i2c_client *client)
twl->client = NULL;
}
twl_priv->ready = false;
+ twl_priv = NULL;
}
@@ -880,10 +886,10 @@ twl_probe(struct i2c_client *client)
num_cells = ARRAY_SIZE(twl6030_cells);
}
- status = devm_mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,
- cells, num_cells, NULL, 0, NULL);
+ status = mfd_add_devices(&client->dev, PLATFORM_DEVID_NONE,
+ cells, num_cells, NULL, 0, NULL);
if (status < 0)
- goto free;
+ goto fail;
if (of_device_is_system_power_controller(node)) {
if (!pm_power_off)
@@ -900,8 +906,10 @@ twl_probe(struct i2c_client *client)
if (status < 0)
twl_remove(client);
free:
- if (status < 0)
+ if (status < 0) {
platform_device_unregister(pdev);
+ twl_priv = NULL;
+ }
return status;
}
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 15/28] mfd: loongson-se: Check return value of dma_set_mask_and_coherent()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (12 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 14/28] mfd: twl-core: Clear twl_priv pointer on teardown and probe failure Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 16/28] mfd: loongson-se: Zero-initialise controller command structures Lee Jones
` (13 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
loongson_se_probe() ignores the return value of
dma_set_mask_and_coherent() when requesting a 64-bit DMA mask before
allocating coherent DMA memory. Check the return value and abort probe
if the platform cannot satisfy the 64-bit DMA mask requirement.
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-6685ee0c-b7ed-4f21-8800-cc705cec449b
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index 3902ba377d69..8dcb90a067b3 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -199,7 +199,10 @@ static int loongson_se_probe(struct platform_device *pdev)
spin_lock_init(&se->dev_lock);
mutex_init(&se->engine_init_lock);
- dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
+ err = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64));
+ if (err)
+ return err;
+
if (device_property_read_u32(dev, "dmam_size", &se->dmam_size))
return -ENODEV;
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 16/28] mfd: loongson-se: Zero-initialise controller command structures
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (13 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 15/28] mfd: loongson-se: Check return value of dma_set_mask_and_coherent() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 17/28] mfd: loongson-se: Reinitialise completions and wait uninterruptibly for commands Lee Jones
` (12 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
loongson_se_init() and loongson_se_init_engine() declare struct
loongson_se_controller_cmd on the stack without zero-initialising it
and only populate a subset of its fields before
loongson_se_send_controller_cmd() writes all eight 32-bit words to the
controller MMIO registers. Zero-initialise the stack command structures
so that unused words do not leak residual kernel stack contents to the
hardware.
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-b81dca3d-6812-43b6-9ad9-912727674154
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index 8dcb90a067b3..485ee4a6ca5e 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -93,7 +93,7 @@ struct loongson_se_engine *loongson_se_init_engine(struct device *dev, int id)
{
struct loongson_se *se = dev_get_drvdata(dev);
struct loongson_se_engine *engine = &se->engines[id];
- struct loongson_se_controller_cmd cmd;
+ struct loongson_se_controller_cmd cmd = {};
engine->se = se;
engine->id = id;
@@ -162,7 +162,7 @@ static irqreturn_t se_irq_handler(int irq, void *dev_id)
static int loongson_se_init(struct loongson_se *se, dma_addr_t addr, int size)
{
- struct loongson_se_controller_cmd cmd;
+ struct loongson_se_controller_cmd cmd = {};
int err;
cmd.command_id = SE_CMD_START;
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 17/28] mfd: loongson-se: Reinitialise completions and wait uninterruptibly for commands
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (14 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 16/28] mfd: loongson-se: Zero-initialise controller command structures Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 18/28] mfd: loongson-se: Zero-allocate driver data and initialise engine completions in probe Lee Jones
` (11 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
loongson_se_send_controller_cmd() and loongson_se_send_engine_cmd() wait
on se->cmd_completion and engine->completion using
wait_for_completion_interruptible() without reinitialising the
completion before issuing a new command. Because the hardware has no
mechanism to abort an in-flight command once accepted by
loongson_se_poll(), returning early on a signal leaves the controller or
engine actively processing the shared command registers and DMA buffers
in the background, and its subsequent completion interrupt leaves a
stale completion token that causes the next command to return
prematurely.
Clear any stale pending interrupt status and reinitialise the target
completion inside loongson_se_poll() while holding se->dev_lock
immediately before notifying the controller, and wait uninterruptibly
via wait_for_completion() once loongson_se_poll() confirms the command
has been accepted by the hardware.
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-4661fb0d-d936-4168-89cd-2f6dec31a7b5
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index 485ee4a6ca5e..9b531e62fb85 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -37,13 +37,17 @@ struct loongson_se_controller_cmd {
u32 info[7];
};
-static int loongson_se_poll(struct loongson_se *se, u32 int_bit)
+static int loongson_se_poll(struct loongson_se *se, u32 int_bit,
+ struct completion *completion)
{
u32 status;
int err;
spin_lock_irq(&se->dev_lock);
+ writel(int_bit, se->base + SE_S2LINT_CL);
+ reinit_completion(completion);
+
/* Notify the controller that the engine needs to be started */
writel(int_bit, se->base + SE_L2SINT_SET);
@@ -66,11 +70,13 @@ static int loongson_se_send_controller_cmd(struct loongson_se *se,
for (i = 0; i < SE_SEND_CMD_REG_LEN; i++)
writel(send_cmd[i], se->base + SE_SEND_CMD_REG + i * 4);
- err = loongson_se_poll(se, SE_INT_CONTROLLER);
+ err = loongson_se_poll(se, SE_INT_CONTROLLER, &se->cmd_completion);
if (err)
return err;
- return wait_for_completion_interruptible(&se->cmd_completion);
+ wait_for_completion(&se->cmd_completion);
+
+ return 0;
}
int loongson_se_send_engine_cmd(struct loongson_se_engine *engine)
@@ -80,12 +86,15 @@ int loongson_se_send_engine_cmd(struct loongson_se_engine *engine)
* where to obtain engine commands from. Now all we need to
* do is notify the controller that the engine needs to be started.
*/
- int err = loongson_se_poll(engine->se, BIT(engine->id));
+ int err = loongson_se_poll(engine->se, BIT(engine->id),
+ &engine->completion);
if (err)
return err;
- return wait_for_completion_interruptible(&engine->completion);
+ wait_for_completion(&engine->completion);
+
+ return 0;
}
EXPORT_SYMBOL_GPL(loongson_se_send_engine_cmd);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 18/28] mfd: loongson-se: Zero-allocate driver data and initialise engine completions in probe
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (15 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 17/28] mfd: loongson-se: Reinitialise completions and wait uninterruptibly for commands Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 19/28] mfd: loongson-se: Prevent out-of-bounds engine access in se_irq_handler() Lee Jones
` (10 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
loongson_se_probe() allocates struct loongson_se using devm_kmalloc(),
leaving the se->engines array uninitialised until child MFD drivers
later invoke loongson_se_init_engine(). Meanwhile, hardware interrupts
are unmasked and se_irq_handler() is registered during probe. Any
engine interrupt arriving before loongson_se_init_engine() runs causes
se_irq_handler() to call complete() on an uninitialised completion
structure.
Allocate struct loongson_se with devm_kzalloc() and initialise all
engine completion structures in loongson_se_probe() before registering
interrupt handlers.
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-ad9310d7-13b2-4a4a-ad7d-78a4c612c78c
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index 9b531e62fb85..187ebbed0422 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -106,7 +106,6 @@ struct loongson_se_engine *loongson_se_init_engine(struct device *dev, int id)
engine->se = se;
engine->id = id;
- init_completion(&engine->completion);
/* Divide DMA memory equally among all engines */
engine->buffer_size = se->dmam_size / SE_ENGINE_MAX;
@@ -199,12 +198,14 @@ static int loongson_se_probe(struct platform_device *pdev)
int nr_irq, irq, err, i;
dma_addr_t paddr;
- se = devm_kmalloc(dev, sizeof(*se), GFP_KERNEL);
+ se = devm_kzalloc(dev, sizeof(*se), GFP_KERNEL);
if (!se)
return -ENOMEM;
dev_set_drvdata(dev, se);
init_completion(&se->cmd_completion);
+ for (i = 0; i < SE_ENGINE_MAX; i++)
+ init_completion(&se->engines[i].completion);
spin_lock_init(&se->dev_lock);
mutex_init(&se->engine_init_lock);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 19/28] mfd: loongson-se: Prevent out-of-bounds engine access in se_irq_handler()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (16 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 18/28] mfd: loongson-se: Zero-allocate driver data and initialise engine completions in probe Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 20/28] mfd: loongson-se: Stop controller and mask interrupts on teardown and shutdown Lee Jones
` (9 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
loongson_se_probe() enables all 32 interrupt bits via SE_INT_ALL
(0xffffffff), and se_irq_handler() uses the set bit index from the
32-bit status register directly to index se->engines, which only holds
SE_ENGINE_MAX (16) entries. Any interrupt bit asserted at index 16 or
above triggers an out-of-bounds access on se->engines.
Restrict SE_INT_ALL to GENMASK(SE_ENGINE_MAX - 1, 0) and bounds-check
the bit index against SE_ENGINE_MAX before completing the engine in
se_irq_handler().
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-bc962408-5c42-40af-8111-a8463a05ccdf
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 3 ++-
include/linux/mfd/loongson-se.h | 7 ++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index 187ebbed0422..10af13c3b7cc 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -158,7 +158,8 @@ static irqreturn_t se_irq_handler(int irq, void *dev_id)
/* For engines */
while (int_status) {
id = __ffs(int_status);
- complete(&se->engines[id].completion);
+ if (id < SE_ENGINE_MAX)
+ complete(&se->engines[id].completion);
int_status &= ~BIT(id);
writel(BIT(id), se->base + SE_S2LINT_CL);
}
diff --git a/include/linux/mfd/loongson-se.h b/include/linux/mfd/loongson-se.h
index 07afa0c2524d..2d0a8b1e5c9e 100644
--- a/include/linux/mfd/loongson-se.h
+++ b/include/linux/mfd/loongson-se.h
@@ -4,6 +4,8 @@
#ifndef __MFD_LOONGSON_SE_H__
#define __MFD_LOONGSON_SE_H__
+#include <linux/bits.h>
+
#define LOONGSON_ENGINE_CMD_TIMEOUT_US 10000
#define SE_SEND_CMD_REG 0x0
#define SE_SEND_CMD_REG_LEN 0x8
@@ -18,10 +20,9 @@
#define SE_L2SINT_STAT 0x98
#define SE_L2SINT_SET 0xa0
-#define SE_INT_ALL 0xffffffff
-#define SE_INT_CONTROLLER BIT(0)
-
#define SE_ENGINE_MAX 16
+#define SE_INT_ALL GENMASK(SE_ENGINE_MAX - 1, 0)
+#define SE_INT_CONTROLLER BIT(0)
#define SE_ENGINE_RNG 1
#define SE_CMD_RNG 0x100
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 20/28] mfd: loongson-se: Stop controller and mask interrupts on teardown and shutdown
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (17 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 19/28] mfd: loongson-se: Prevent out-of-bounds engine access in se_irq_handler() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 21/28] mfd: loongson-se: Validate engine ID, DMA buffer size, and IRQ registration Lee Jones
` (8 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
loongson_se_probe() enables hardware interrupts before registering IRQ
handlers and starts the controller via loongson_se_init(), but provides
no teardown or shutdown handler to stop the controller and mask
interrupts. If probe fails after loongson_se_init(), if the driver is
unbound, or during a system reboot or kexec transition, the controller
remains active with DMA configured to memory that is reclaimed.
Clear pending interrupts before requesting IRQs, unmask interrupts only
after IRQ handlers are registered, clean up on failure inside
loongson_se_init(), register a devres action after loongson_se_init()
succeeds to issue SE_CMD_STOP and mask interrupts on teardown, and wire
up the platform driver .shutdown callback.
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-15511672-7569-4eac-96a0-c08581925710
Closes: https://sashiko.dev/#/bug/linux-e6ed8d33-d641-4969-a5ea-959f21ae3696
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 51 +++++++++++++++++++++++++++++----
include/linux/mfd/loongson-se.h | 1 +
2 files changed, 46 insertions(+), 6 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index 10af13c3b7cc..bdbab4b91729 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -169,6 +169,23 @@ static irqreturn_t se_irq_handler(int irq, void *dev_id)
return IRQ_HANDLED;
}
+static void loongson_se_stop(void *data)
+{
+ struct loongson_se *se = data;
+ struct loongson_se_controller_cmd cmd = {};
+
+ mutex_lock(&se->engine_init_lock);
+
+ cmd.command_id = SE_CMD_STOP;
+ loongson_se_send_controller_cmd(se, &cmd);
+
+ spin_lock_irq(&se->dev_lock);
+ writel(0, se->base + SE_S2LINT_EN);
+ spin_unlock_irq(&se->dev_lock);
+
+ mutex_unlock(&se->engine_init_lock);
+}
+
static int loongson_se_init(struct loongson_se *se, dma_addr_t addr, int size)
{
struct loongson_se_controller_cmd cmd = {};
@@ -176,15 +193,23 @@ static int loongson_se_init(struct loongson_se *se, dma_addr_t addr, int size)
cmd.command_id = SE_CMD_START;
err = loongson_se_send_controller_cmd(se, &cmd);
- if (err)
+ if (err) {
+ writel(0, se->base + SE_S2LINT_EN);
return err;
+ }
cmd.command_id = SE_CMD_SET_DMA;
cmd.info[0] = lower_32_bits(addr);
cmd.info[1] = upper_32_bits(addr);
cmd.info[2] = size;
- return loongson_se_send_controller_cmd(se, &cmd);
+ err = loongson_se_send_controller_cmd(se, &cmd);
+ if (err) {
+ loongson_se_stop(se);
+ return err;
+ }
+
+ return 0;
}
static const struct mfd_cell engines[] = {
@@ -192,6 +217,13 @@ static const struct mfd_cell engines[] = {
{ .name = "tpm_loongson" },
};
+static void loongson_se_shutdown(struct platform_device *pdev)
+{
+ struct loongson_se *se = platform_get_drvdata(pdev);
+
+ loongson_se_stop(se);
+}
+
static int loongson_se_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -225,12 +257,12 @@ static int loongson_se_probe(struct platform_device *pdev)
if (IS_ERR(se->base))
return PTR_ERR(se->base);
- writel(SE_INT_ALL, se->base + SE_S2LINT_EN);
-
nr_irq = platform_irq_count(pdev);
if (nr_irq <= 0)
return -ENODEV;
+ writel(SE_INT_ALL, se->base + SE_S2LINT_CL);
+
for (i = 0; i < nr_irq; i++) {
irq = platform_get_irq(pdev, i);
err = devm_request_irq(dev, irq, se_irq_handler, 0, "loongson-se", se);
@@ -238,10 +270,16 @@ static int loongson_se_probe(struct platform_device *pdev)
dev_err(dev, "failed to request IRQ: %d\n", irq);
}
+ writel(SE_INT_ALL, se->base + SE_S2LINT_EN);
+
err = loongson_se_init(se, paddr, se->dmam_size);
if (err)
return err;
+ err = devm_add_action_or_reset(dev, loongson_se_stop, se);
+ if (err)
+ return err;
+
return devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE, engines,
ARRAY_SIZE(engines), NULL, 0, NULL);
}
@@ -253,8 +291,9 @@ static const struct acpi_device_id loongson_se_acpi_match[] = {
MODULE_DEVICE_TABLE(acpi, loongson_se_acpi_match);
static struct platform_driver loongson_se_driver = {
- .probe = loongson_se_probe,
- .driver = {
+ .probe = loongson_se_probe,
+ .shutdown = loongson_se_shutdown,
+ .driver = {
.name = "loongson-se",
.acpi_match_table = loongson_se_acpi_match,
},
diff --git a/include/linux/mfd/loongson-se.h b/include/linux/mfd/loongson-se.h
index 2d0a8b1e5c9e..dbe5992bd435 100644
--- a/include/linux/mfd/loongson-se.h
+++ b/include/linux/mfd/loongson-se.h
@@ -11,6 +11,7 @@
#define SE_SEND_CMD_REG_LEN 0x8
/* Controller command ID */
#define SE_CMD_START 0x0
+#define SE_CMD_STOP 0x1
#define SE_CMD_SET_DMA 0x3
#define SE_CMD_SET_ENGINE_CMDBUF 0x4
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 21/28] mfd: loongson-se: Validate engine ID, DMA buffer size, and IRQ registration
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (18 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 20/28] mfd: loongson-se: Stop controller and mask interrupts on teardown and shutdown Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 22/28] mfd: abx500-core: Unregister device ops on devm release Lee Jones
` (7 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Qunqin Zhao, Yinggang Gu, Huacai Chen, linux-crypto, mfd,
linux-kernel
Cc: stable
Harden input and error checking in loongson_se_init_engine() and
loongson_se_probe():
- Reject out-of-bounds engine IDs and engine 0 in
loongson_se_init_engine() before indexing se->engines.
- Store dmam_size as u32 to match device_property_read_u32() and verify
that it is large enough to hold the command buffers of all engines
within engine 0's data region.
- Propagate negative error codes from platform_irq_count(),
platform_get_irq(), and devm_request_irq() instead of ignoring IRQ
registration failures or masking -EPROBE_DEFER.
Fixes: e551fa3159e3 ("mfd: Add support for Loongson Security Engine chip controller")
Closes: https://sashiko.dev/#/bug/linux-89bf25f5-ecd9-40e3-bb4c-bd26d07c53a1
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/loongson-se.c | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/loongson-se.c b/drivers/mfd/loongson-se.c
index bdbab4b91729..23af05d388aa 100644
--- a/drivers/mfd/loongson-se.c
+++ b/drivers/mfd/loongson-se.c
@@ -26,7 +26,7 @@ struct loongson_se {
struct completion cmd_completion;
void *dmam_base;
- int dmam_size;
+ u32 dmam_size;
struct mutex engine_init_lock;
struct loongson_se_engine engines[SE_ENGINE_MAX];
@@ -101,8 +101,13 @@ EXPORT_SYMBOL_GPL(loongson_se_send_engine_cmd);
struct loongson_se_engine *loongson_se_init_engine(struct device *dev, int id)
{
struct loongson_se *se = dev_get_drvdata(dev);
- struct loongson_se_engine *engine = &se->engines[id];
struct loongson_se_controller_cmd cmd = {};
+ struct loongson_se_engine *engine;
+
+ if (id <= 0 || id >= SE_ENGINE_MAX)
+ return NULL;
+
+ engine = &se->engines[id];
engine->se = se;
engine->id = id;
@@ -186,7 +191,7 @@ static void loongson_se_stop(void *data)
mutex_unlock(&se->engine_init_lock);
}
-static int loongson_se_init(struct loongson_se *se, dma_addr_t addr, int size)
+static int loongson_se_init(struct loongson_se *se, dma_addr_t addr, u32 size)
{
struct loongson_se_controller_cmd cmd = {};
int err;
@@ -249,6 +254,9 @@ static int loongson_se_probe(struct platform_device *pdev)
if (device_property_read_u32(dev, "dmam_size", &se->dmam_size))
return -ENODEV;
+ if ((se->dmam_size / SE_ENGINE_MAX) < (SE_ENGINE_MAX * 2 * SE_ENGINE_CMD_SIZE))
+ return -EINVAL;
+
se->dmam_base = dmam_alloc_coherent(dev, se->dmam_size, &paddr, GFP_KERNEL);
if (!se->dmam_base)
return -ENOMEM;
@@ -258,16 +266,21 @@ static int loongson_se_probe(struct platform_device *pdev)
return PTR_ERR(se->base);
nr_irq = platform_irq_count(pdev);
- if (nr_irq <= 0)
+ if (!nr_irq)
return -ENODEV;
+ if (nr_irq < 0)
+ return nr_irq;
writel(SE_INT_ALL, se->base + SE_S2LINT_CL);
for (i = 0; i < nr_irq; i++) {
irq = platform_get_irq(pdev, i);
+ if (irq < 0)
+ return irq;
+
err = devm_request_irq(dev, irq, se_irq_handler, 0, "loongson-se", se);
if (err)
- dev_err(dev, "failed to request IRQ: %d\n", irq);
+ return dev_err_probe(dev, err, "Failed to request IRQ: %d\n", irq);
}
writel(SE_INT_ALL, se->base + SE_S2LINT_EN);
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 22/28] mfd: abx500-core: Unregister device ops on devm release
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (19 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 21/28] mfd: loongson-se: Validate engine ID, DMA buffer size, and IRQ registration Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 23/28] mfd: ab8500-core: Register sysfs attribute groups via devm_device_add_group() Lee Jones
` (6 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Linus Walleij, Mattias Wallin, Samuel Ortiz,
linux-arm-kernel, mfd, linux-kernel
Cc: stable
abx500_register_ops() allocates struct abx500_device_entry via
devm_kzalloc() and links it into the global abx500_list without
registering a devres cleanup action. If a caller's probe function
subsequently fails, devres frees the entry while it remains linked in
abx500_list, causing use-after-free and list corruption on later
traversals.
Register a devm_add_action_or_reset() callback in abx500_register_ops()
to remove the entry from abx500_list before devres frees it.
Fixes: c211b6b9c014 ("mfd: abx500-core: Convert to managed resources for allocating memory")
Closes: https://sashiko.dev/#/bug/linux-6a9c6b8b-8f89-4af5-8cb1-102822e44e6e
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/abx500-core.c | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
index e896531d0354..5873e335c395 100644
--- a/drivers/mfd/abx500-core.c
+++ b/drivers/mfd/abx500-core.c
@@ -5,6 +5,7 @@
* Author: Mattias Wallin <mattias.wallin@stericsson.com>
*/
+#include <linux/device.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/err.h>
@@ -33,6 +34,21 @@ static void lookup_ops(struct device *dev, struct abx500_ops **ops)
}
}
+void abx500_remove_ops(struct device *dev)
+{
+ struct abx500_device_entry *dev_entry, *tmp;
+
+ list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list)
+ if (dev_entry->dev == dev)
+ list_del(&dev_entry->list);
+}
+EXPORT_SYMBOL(abx500_remove_ops);
+
+static void abx500_unregister_ops(void *data)
+{
+ abx500_remove_ops(data);
+}
+
int abx500_register_ops(struct device *dev, struct abx500_ops *ops)
{
struct abx500_device_entry *dev_entry;
@@ -45,20 +61,11 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops)
memcpy(&dev_entry->ops, ops, sizeof(*ops));
list_add_tail(&dev_entry->list, &abx500_list);
- return 0;
+
+ return devm_add_action_or_reset(dev, abx500_unregister_ops, dev);
}
EXPORT_SYMBOL(abx500_register_ops);
-void abx500_remove_ops(struct device *dev)
-{
- struct abx500_device_entry *dev_entry, *tmp;
-
- list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list)
- if (dev_entry->dev == dev)
- list_del(&dev_entry->list);
-}
-EXPORT_SYMBOL(abx500_remove_ops);
-
int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
u8 value)
{
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 23/28] mfd: ab8500-core: Register sysfs attribute groups via devm_device_add_group()
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (20 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 22/28] mfd: abx500-core: Unregister device ops on devm release Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 24/28] mfd: tps65217: Manage IRQ domain teardown via devres Lee Jones
` (5 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Linus Walleij, Srinidhi Kasagar, Rabin Vincent,
Mattias Wallin, linux-arm-kernel, mfd, linux-kernel
Cc: stable
ab8500_probe() registers up to two sysfs attribute groups with
sysfs_create_group(). On AB8505 and AB9540 (cut 2.0 and later), the
second sysfs_create_group() call unconditionally overwrites the return
value of the first, and if the second call fails, ab8500_probe() returns
an error without removing the first group. Because the driver context
is freed and driver data is cleared on probe failure, reading any leaked
sysfs attribute dereferences a NULL ab8500 pointer in
get_register_interruptible().
Register the attribute groups via devm_device_add_group() and only
register the second group when the first succeeds so that devres
automatically cleans up registered sysfs attributes on probe failure.
Fixes: 93ff722e8853 ("ab8500-fg: Add power cut feature for ab8505 and ab8540")
Closes: https://sashiko.dev/#/bug/linux-a9ac1a9d-5a97-4ad3-b4c5-c7775c24a333
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/ab8500-core.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 86fa99022cb3..408bad2f577a 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -1232,16 +1232,13 @@ static int ab8500_probe(struct platform_device *pdev)
if (((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
ab8500->chip_id >= AB8500_CUT2P0) || is_ab8540(ab8500))
- ret = sysfs_create_group(&ab8500->dev->kobj,
- &ab9540_attr_group);
+ ret = devm_device_add_group(ab8500->dev, &ab9540_attr_group);
else
- ret = sysfs_create_group(&ab8500->dev->kobj,
- &ab8500_attr_group);
+ ret = devm_device_add_group(ab8500->dev, &ab8500_attr_group);
if ((is_ab8505(ab8500) || is_ab9540(ab8500)) &&
- ab8500->chip_id >= AB8500_CUT2P0)
- ret = sysfs_create_group(&ab8500->dev->kobj,
- &ab8505_attr_group);
+ ab8500->chip_id >= AB8500_CUT2P0 && !ret)
+ ret = devm_device_add_group(ab8500->dev, &ab8505_attr_group);
if (ret)
dev_err(ab8500->dev, "error creating sysfs entries\n");
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 24/28] mfd: tps65217: Manage IRQ domain teardown via devres
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (21 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 23/28] mfd: ab8500-core: Register sysfs attribute groups via devm_device_add_group() Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 25/28] mfd: mt6397: Manage IRQ domain lifecycle with devres Lee Jones
` (4 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, AnilKumar Ch, Milo Kim, linux-omap, mfd,
linux-kernel
Cc: stable
tps65217_irq_init() creates tps->irq_domain with an unmanaged call and
requests the parent interrupt via devm_request_threaded_irq(), while
tps65217_remove() manually disposes mappings and removes
tps->irq_domain. Because tps65217_remove() executes before devres
teardown, the IRQ domain is destroyed while tps65217_irq_thread() and
child MFD devices are still active, allowing a concurrent interrupt to
dereference a freed or NULL domain. Furthermore, if probe fails after
irq_domain_create_linear() or if tps65217_irq_init() fails, the IRQ
domain is leaked, and if the device is probed without an interrupt
(client->irq == 0), tps65217_remove() unconditionally passes a NULL
tps->irq_domain to irq_domain_remove().
Register a devres action to tear down the IRQ domain in
tps65217_irq_init() prior to devm_request_threaded_irq(), propagate
errors from tps65217_irq_init() in tps65217_probe(), and drop
tps65217_remove().
Fixes: 40a50f8b307d ("mfd: tps65217: Fix page fault on unloading modules")
Closes: https://sashiko.dev/#/bug/linux-7e358c08-6d75-48be-87d2-35dc037ea953
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/tps65217.c | 40 ++++++++++++++++++++++------------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/drivers/mfd/tps65217.c b/drivers/mfd/tps65217.c
index c240fac0ede7..a1e9b9e22d82 100644
--- a/drivers/mfd/tps65217.c
+++ b/drivers/mfd/tps65217.c
@@ -146,6 +146,21 @@ static const struct irq_domain_ops tps65217_irq_domain_ops = {
.map = tps65217_irq_map,
};
+static void tps65217_irq_exit(void *data)
+{
+ struct tps65217 *tps = data;
+ unsigned int virq;
+
+ for (int i = 0; i < TPS65217_NUM_IRQ; i++) {
+ virq = irq_find_mapping(tps->irq_domain, i);
+ if (virq)
+ irq_dispose_mapping(virq);
+ }
+
+ irq_domain_remove(tps->irq_domain);
+ tps->irq_domain = NULL;
+}
+
static int tps65217_irq_init(struct tps65217 *tps, int irq)
{
int ret;
@@ -165,6 +180,10 @@ static int tps65217_irq_init(struct tps65217 *tps, int irq)
return -ENOMEM;
}
+ ret = devm_add_action_or_reset(tps->dev, tps65217_irq_exit, tps);
+ if (ret)
+ return ret;
+
ret = devm_request_threaded_irq(tps->dev, irq, NULL,
tps65217_irq_thread, IRQF_ONESHOT,
"tps65217-irq", tps);
@@ -333,7 +352,9 @@ static int tps65217_probe(struct i2c_client *client)
}
if (client->irq) {
- tps65217_irq_init(tps, client->irq);
+ ret = tps65217_irq_init(tps, client->irq);
+ if (ret)
+ return ret;
} else {
int i;
@@ -373,22 +394,6 @@ static int tps65217_probe(struct i2c_client *client)
return 0;
}
-static void tps65217_remove(struct i2c_client *client)
-{
- struct tps65217 *tps = i2c_get_clientdata(client);
- unsigned int virq;
- int i;
-
- for (i = 0; i < TPS65217_NUM_IRQ; i++) {
- virq = irq_find_mapping(tps->irq_domain, i);
- if (virq)
- irq_dispose_mapping(virq);
- }
-
- irq_domain_remove(tps->irq_domain);
- tps->irq_domain = NULL;
-}
-
static const struct i2c_device_id tps65217_id_table[] = {
{"tps65217", TPS65217},
{ /* sentinel */ }
@@ -402,7 +407,6 @@ static struct i2c_driver tps65217_driver = {
},
.id_table = tps65217_id_table,
.probe = tps65217_probe,
- .remove = tps65217_remove,
};
static int __init tps65217_init(void)
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 25/28] mfd: mt6397: Manage IRQ domain lifecycle with devres
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (22 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 24/28] mfd: tps65217: Manage IRQ domain teardown via devres Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 26/28] mfd: mt6397: Unregister PM notifier on probe failure and unbind Lee Jones
` (3 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Matthias Brugger, AngeloGioacchino Del Regno, Sascha Hauer,
mfd, linux-kernel, linux-arm-kernel, linux-mediatek
Cc: stable
mt6397_irq_init() and mt6358_irq_init() create chip->irq_domain with
irq_domain_create_linear() before registering the parent interrupt via
devm_request_threaded_irq(). If devm_mfd_add_devices() fails in
mt6397_probe(), irq_domain_remove() is called before devres frees the
threaded IRQ and without disposing child IRQ mappings, allowing an
in-flight interrupt handler or late IRQ lookup to dereference the
removed domain. Conversely, when the driver is unbound, the IRQ
mappings and domain are never removed at all.
Register a devres action immediately after irq_domain_create_linear() to
dispose all mapped hardware interrupts and remove chip->irq_domain so
that the domain is torn down after child MFD devices and the managed IRQ
handler have been released on both probe failure and unbind.
Fixes: 6df8dd5c185b ("mfd: Add support for the MediaTek MT6397 PMIC")
Closes: https://sashiko.dev/#/bug/linux-b296fbe4-6e83-40c0-91c7-2c31e8d226d0
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/mt6358-irq.c | 17 ++++++++++++++++-
drivers/mfd/mt6397-core.c | 4 +---
drivers/mfd/mt6397-irq.c | 16 +++++++++++++++-
3 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/mt6358-irq.c b/drivers/mfd/mt6358-irq.c
index 74cf20843044..c747cae909ea 100644
--- a/drivers/mfd/mt6358-irq.c
+++ b/drivers/mfd/mt6358-irq.c
@@ -224,6 +224,17 @@ static const struct irq_domain_ops mt6358_irq_domain_ops = {
.xlate = irq_domain_xlate_twocell,
};
+static void mt6358_irq_domain_remove(void *data)
+{
+ struct mt6397_chip *chip = data;
+ struct pmic_irq_data *irqd = chip->irq_data;
+
+ for (unsigned int hwirq = 0; hwirq < irqd->num_pmic_irqs; hwirq++)
+ irq_dispose_mapping(irq_find_mapping(chip->irq_domain, hwirq));
+
+ irq_domain_remove(chip->irq_domain);
+}
+
int mt6358_irq_init(struct mt6397_chip *chip)
{
int i, j, ret;
@@ -279,13 +290,17 @@ int mt6358_irq_init(struct mt6397_chip *chip)
return -ENODEV;
}
+ ret = devm_add_action_or_reset(chip->dev, mt6358_irq_domain_remove,
+ chip);
+ if (ret)
+ return ret;
+
ret = devm_request_threaded_irq(chip->dev, chip->irq, NULL,
mt6358_irq_handler, IRQF_ONESHOT,
mt6358_irq_chip.name, chip);
if (ret) {
dev_err(chip->dev, "Failed to register IRQ=%d, ret=%d\n",
chip->irq, ret);
- irq_domain_remove(chip->irq_domain);
return ret;
}
diff --git a/drivers/mfd/mt6397-core.c b/drivers/mfd/mt6397-core.c
index 9ec951996588..e94e37cba249 100644
--- a/drivers/mfd/mt6397-core.c
+++ b/drivers/mfd/mt6397-core.c
@@ -395,10 +395,8 @@ static int mt6397_probe(struct platform_device *pdev)
ret = devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_NONE,
pmic_core->cells, pmic_core->cell_size,
NULL, 0, pmic->irq_domain);
- if (ret) {
- irq_domain_remove(pmic->irq_domain);
+ if (ret)
dev_err(&pdev->dev, "failed to add child devices: %d\n", ret);
- }
return ret;
}
diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c
index 5d2e5459f744..58645dbd8095 100644
--- a/drivers/mfd/mt6397-irq.c
+++ b/drivers/mfd/mt6397-irq.c
@@ -169,6 +169,16 @@ static int mt6397_irq_pm_notifier(struct notifier_block *notifier,
return NOTIFY_DONE;
}
+static void mt6397_irq_domain_remove(void *data)
+{
+ struct mt6397_chip *chip = data;
+
+ for (int hwirq = 0; hwirq < MT6397_IRQ_NR; hwirq++)
+ irq_dispose_mapping(irq_find_mapping(chip->irq_domain, hwirq));
+
+ irq_domain_remove(chip->irq_domain);
+}
+
int mt6397_irq_init(struct mt6397_chip *chip)
{
int ret;
@@ -223,13 +233,17 @@ int mt6397_irq_init(struct mt6397_chip *chip)
return -ENOMEM;
}
+ ret = devm_add_action_or_reset(chip->dev, mt6397_irq_domain_remove,
+ chip);
+ if (ret)
+ return ret;
+
ret = devm_request_threaded_irq(chip->dev, chip->irq, NULL,
mt6397_irq_thread, IRQF_ONESHOT,
"mt6397-pmic", chip);
if (ret) {
dev_err(chip->dev, "failed to register irq=%d; err: %d\n",
chip->irq, ret);
- irq_domain_remove(chip->irq_domain);
return ret;
}
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 26/28] mfd: mt6397: Unregister PM notifier on probe failure and unbind
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (23 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 25/28] mfd: mt6397: Manage IRQ domain lifecycle with devres Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 27/28] i2c: cgbc: Propagate hardware errors when polling read status Lee Jones
` (2 subsequent siblings)
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Matthias Brugger, AngeloGioacchino Del Regno,
Hsin-Hsiung Wang, mfd, linux-kernel, linux-arm-kernel,
linux-mediatek
Cc: stable
mt6397_irq_init() registers a power management notifier block embedded
in the devres-managed struct mt6397_chip via register_pm_notifier(),
but never unregisters it if mt6397_probe() later fails or when the
driver is unbound. Once devres frees struct mt6397_chip, the dangling
notifier block corrupts the global PM notifier chain and causes a
use-after-free on subsequent suspend or resume transitions.
Check the return value of register_pm_notifier() and register a devres
action to unregister the PM notifier on probe failure or device unbind.
Fixes: 4e2e7cfec13a ("mfd: mt6397: Modify suspend/resume behavior")
Closes: https://sashiko.dev/#/bug/linux-edb62fbc-213a-49a2-be55-c002e234e554
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/mfd/mt6397-irq.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/mt6397-irq.c b/drivers/mfd/mt6397-irq.c
index 58645dbd8095..bc7ca22d6f17 100644
--- a/drivers/mfd/mt6397-irq.c
+++ b/drivers/mfd/mt6397-irq.c
@@ -179,6 +179,13 @@ static void mt6397_irq_domain_remove(void *data)
irq_domain_remove(chip->irq_domain);
}
+static void mt6397_unregister_pm_notifier(void *data)
+{
+ struct mt6397_chip *chip = data;
+
+ unregister_pm_notifier(&chip->pm_nb);
+}
+
int mt6397_irq_init(struct mt6397_chip *chip)
{
int ret;
@@ -247,6 +254,10 @@ int mt6397_irq_init(struct mt6397_chip *chip)
return ret;
}
- register_pm_notifier(&chip->pm_nb);
- return 0;
+ ret = register_pm_notifier(&chip->pm_nb);
+ if (ret)
+ return ret;
+
+ return devm_add_action_or_reset(chip->dev,
+ mt6397_unregister_pm_notifier, chip);
}
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 27/28] i2c: cgbc: Propagate hardware errors when polling read status
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (24 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 26/28] mfd: mt6397: Unregister PM notifier on probe failure and unbind Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 12:09 ` [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper Lee Jones
2026-10-21 12:31 ` [PATCH 00/28] mfd: Assorted resource lifetime, teardown, and error-handling fixes Lee Jones
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Thomas Richard, Andi Shyti, linux-i2c, linux-kernel; +Cc: stable
In cgbc_i2c_xfer_msg(), read_poll_timeout() uses the same ret variable
to store the polled return value of cgbc_i2c_get_status() and the
timeout result of the macro itself. When cgbc_i2c_get_status() returns
a negative error code (such as -EIO on an I2C NACK), the loop condition
ret != CGBC_I2C_STAT_BUSY evaluates to true and read_poll_timeout()
overwrites ret with 0. The driver then issues CGBC_I2C_CMD_DATA, which
completes with CGBC_STATUS_CMD_READY without populating msg->buf,
leaving uninitialised heap memory in the caller's read buffer.
Store the polled status in a separate variable, verify that it equals
CGBC_I2C_STAT_DAT, and check that CGBC_I2C_CMD_DATA returns the expected
number of bytes.
Fixes: 6894f640b8f3 ("i2c: Congatec Board Controller i2c bus driver")
Closes: https://sashiko.dev/#/bug/linux-66cbf4b1-a219-4012-969d-236417bf419a
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/i2c/busses/i2c-cgbc.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-cgbc.c b/drivers/i2c/busses/i2c-cgbc.c
index 25a74fa51aa0..9909c25f0b18 100644
--- a/drivers/i2c/busses/i2c-cgbc.c
+++ b/drivers/i2c/busses/i2c-cgbc.c
@@ -205,9 +205,9 @@ static int cgbc_i2c_xfer_msg(struct i2c_adapter *adap)
struct cgbc_device_data *cgbc = i2c->cgbc;
struct i2c_msg *msg = i2c->msg;
u8 cmd[CGBC_I2C_CMD_SIZE];
- int ret, max_len, len, i;
+ int ret, status, max_len, len, i;
unsigned int cmd_len;
- u8 cmd_data;
+ u8 cmd_data, data_len;
struct cgbc_i2c_transfer xfer = {
.bus_id = algo_data->bus_id,
@@ -266,17 +266,32 @@ static int cgbc_i2c_xfer_msg(struct i2c_adapter *adap)
if (ret)
goto err;
- ret = read_poll_timeout(cgbc_i2c_get_status, ret,
- ret != CGBC_I2C_STAT_BUSY, 0,
+ ret = read_poll_timeout(cgbc_i2c_get_status, status,
+ status != CGBC_I2C_STAT_BUSY, 0,
2 * algo_data->read_maxtime_us, false, adap);
- if (ret < 0)
+ if (ret)
goto err;
+ if (status < 0) {
+ ret = status;
+ goto err;
+ }
+
+ if (status != CGBC_I2C_STAT_DAT) {
+ ret = -EIO;
+ goto err;
+ }
+
cmd_data = CGBC_I2C_CMD_DATA | algo_data->bus_id;
ret = cgbc_command(cgbc, &cmd_data, sizeof(cmd_data),
- msg->buf + i2c->pos, len, NULL);
+ msg->buf + i2c->pos, len, &data_len);
if (ret)
goto err;
+
+ if (data_len != len) {
+ ret = -EIO;
+ goto err;
+ }
}
if (len == (msg->len - i2c->pos)) {
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (25 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 27/28] i2c: cgbc: Propagate hardware errors when polling read status Lee Jones
@ 2026-10-21 12:09 ` Lee Jones
2026-10-21 14:02 ` Andy Shevchenko
2026-10-21 12:31 ` [PATCH 00/28] mfd: Assorted resource lifetime, teardown, and error-handling fixes Lee Jones
27 siblings, 1 reply; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:09 UTC (permalink / raw)
To: lee, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Dmitry Torokhov, Shi Hao, Rachna Patil,
linux-iio, linux-kernel, linux-input, mfd
Now that ti_tscadc_dev_get() is a single-line wrapper around
dev_get_drvdata(p->dev.parent), remove the bespoke helper and retrieve
the parent driver data directly in the child ADC and touchscreen
drivers.
Signed-off-by: Lee Jones <lee@kernel.org>
---
drivers/iio/adc/ti_am335x_adc.c | 2 +-
drivers/input/touchscreen/ti_am335x_tsc.c | 2 +-
include/linux/mfd/ti_am335x_tscadc.h | 5 -----
3 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c
index 1516dd332f90..77ea59d6c6b7 100644
--- a/drivers/iio/adc/ti_am335x_adc.c
+++ b/drivers/iio/adc/ti_am335x_adc.c
@@ -636,7 +636,7 @@ static int tiadc_probe(struct platform_device *pdev)
adc_dev = iio_priv(indio_dev);
- adc_dev->mfd_tscadc = ti_tscadc_dev_get(pdev);
+ adc_dev->mfd_tscadc = dev_get_drvdata(pdev->dev.parent);
tiadc_parse_dt(pdev, adc_dev);
indio_dev->name = dev_name(&pdev->dev);
diff --git a/drivers/input/touchscreen/ti_am335x_tsc.c b/drivers/input/touchscreen/ti_am335x_tsc.c
index 623546e80668..40ffdec9d207 100644
--- a/drivers/input/touchscreen/ti_am335x_tsc.c
+++ b/drivers/input/touchscreen/ti_am335x_tsc.c
@@ -418,7 +418,7 @@ static int titsc_probe(struct platform_device *pdev)
{
struct titsc *ts_dev;
struct input_dev *input_dev;
- struct ti_tscadc_dev *tscadc_dev = ti_tscadc_dev_get(pdev);
+ struct ti_tscadc_dev *tscadc_dev = dev_get_drvdata(pdev->dev.parent);
int err;
/* Allocate memory for device */
diff --git a/include/linux/mfd/ti_am335x_tscadc.h b/include/linux/mfd/ti_am335x_tscadc.h
index 4a048a897cf3..36d365b64fe6 100644
--- a/include/linux/mfd/ti_am335x_tscadc.h
+++ b/include/linux/mfd/ti_am335x_tscadc.h
@@ -175,11 +175,6 @@ struct ti_tscadc_dev {
struct adc_device *adc;
};
-static inline struct ti_tscadc_dev *ti_tscadc_dev_get(struct platform_device *p)
-{
- return dev_get_drvdata(p->dev.parent);
-}
-
static inline bool ti_adc_with_touchscreen(struct ti_tscadc_dev *tscadc)
{
return of_device_is_compatible(tscadc->dev->of_node,
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* [PATCH 00/28] mfd: Assorted resource lifetime, teardown, and error-handling fixes
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
` (26 preceding siblings ...)
2026-10-21 12:09 ` [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper Lee Jones
@ 2026-10-21 12:31 ` Lee Jones
27 siblings, 0 replies; 35+ messages in thread
From: Lee Jones @ 2026-10-21 12:31 UTC (permalink / raw)
To: lee; +Cc: mfd, linux-kernel
These issues were reported by Sashiko.
This series addresses a collection of resource lifetime, teardown
ordering, uninitialised memory, and error-handling issues across MFD
drivers (along with two related patches touching i2c-cgbc and the
ti_am335x_tscadc child drivers):
- Resource teardown & lifecycle fixes:
Ensure IRQ domains, chained/parent interrupts, GPIO GSIs, delayed/reset
work items, PM notifiers, system power-off handlers, sysfs groups, MFD
child devices, and global singleton pointers are properly unregistered
or managed via devres on probe failure and driver unbind (ls2kbmc,
ioc3, intel-lpss, max8907, twl-core, loongson-se, abx500-core,
ab8500-core, tps65217, mt6397/mt6358).
- DMA, URB, & hardware error handling:
Allocate USB transfer buffers on the heap rather than the stack, avoid
resubmitting interrupt URBs on endpoint stall (-EPIPE), zero-initialise
command and version buffers, and validate DMA masks, engine IDs, and
polled transfer status (nct6694, cgbc, i2c-cgbc, loongson-se).
- MFD cell descriptor & driver-data clean-ups:
Avoid storing stack frame addresses in MFD cell platform_data and
resource pointers, and retrieve parent driver data directly via
dev_get_drvdata() in the ti_am335x_tscadc child drivers (ls2kbmc,
bd96801, db8500-prcmu, ti_am335x_tscadc).
Lee Jones (28):
mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj()
mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset()
mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel()
mfd: ls2kbmc: Allocate simplefb platform_data on the heap
mfd: bd96801: Allocate watchdog IRQ resource on the heap
mfd: ti_am335x_tscadc: Retrieve parent driver data via
dev_get_drvdata()
mfd: db8500-prcmu: Make AB8500 cell and IRQ resource static
mfd: nct6694: Do not resubmit interrupt URB on endpoint stall (-EPIPE)
mfd: cgbc: Zero-initialise version buffer in cgbc_get_version()
mfd: ioc3: Request parent IRQ via request_irq() and free before domain
removal
mfd: intel-lpss: Remove registered MFD child devices on probe failure
mfd: max8907: Manage power-off handler via
devm_register_sys_off_handler()
mfd: twl-core: Clear pm_power_off callback in twl_remove()
mfd: twl-core: Clear twl_priv pointer on teardown and probe failure
mfd: loongson-se: Check return value of dma_set_mask_and_coherent()
mfd: loongson-se: Zero-initialise controller command structures
mfd: loongson-se: Reinitialise completions and wait uninterruptibly
for commands
mfd: loongson-se: Zero-allocate driver data and initialise engine
completions in probe
mfd: loongson-se: Prevent out-of-bounds engine access in
se_irq_handler()
mfd: loongson-se: Stop controller and mask interrupts on teardown and
shutdown
mfd: loongson-se: Validate engine ID, DMA buffer size, and IRQ
registration
mfd: abx500-core: Unregister device ops on devm release
mfd: ab8500-core: Register sysfs attribute groups via
devm_device_add_group()
mfd: tps65217: Manage IRQ domain teardown via devres
mfd: mt6397: Manage IRQ domain lifecycle with devres
mfd: mt6397: Unregister PM notifier on probe failure and unbind
i2c: cgbc: Propagate hardware errors when polling read status
mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper
drivers/i2c/busses/i2c-cgbc.c | 27 ++++--
drivers/iio/adc/ti_am335x_adc.c | 2 +-
drivers/input/touchscreen/ti_am335x_tsc.c | 2 +-
drivers/mfd/ab8500-core.c | 11 +--
drivers/mfd/abx500-core.c | 29 +++---
drivers/mfd/cgbc-core.c | 2 +-
drivers/mfd/db8500-prcmu.c | 8 +-
drivers/mfd/intel-lpss.c | 1 +
drivers/mfd/ioc3.c | 32 ++++---
drivers/mfd/loongson-se.c | 110 +++++++++++++++++-----
drivers/mfd/ls2k-bmc-core.c | 27 ++++--
drivers/mfd/max8907.c | 28 ++++--
drivers/mfd/mt6358-irq.c | 17 +++-
drivers/mfd/mt6397-core.c | 4 +-
drivers/mfd/mt6397-irq.c | 31 +++++-
drivers/mfd/nct6694.c | 23 +++--
drivers/mfd/rohm-bd96801.c | 11 ++-
drivers/mfd/ti_am335x_tscadc.c | 7 +-
drivers/mfd/tps65217.c | 40 ++++----
drivers/mfd/twl-core.c | 45 +++++----
include/linux/mfd/loongson-se.h | 8 +-
include/linux/mfd/ti_am335x_tscadc.h | 7 --
22 files changed, 327 insertions(+), 145 deletions(-)
--
2.56.0.218.g1ec904b173-goog
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset()
2026-10-21 12:09 ` [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset() Lee Jones
@ 2026-10-21 13:57 ` Andy Shevchenko
2026-10-21 14:00 ` Andy Shevchenko
1 sibling, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2026-10-21 13:57 UTC (permalink / raw)
To: Lee Jones
Cc: Binbin Zhou, Chong Qiao, Corey Minyard, Huacai Chen, mfd,
linux-kernel, stable
On Wed, Oct 21, 2026 at 12:09:24PM +0000, Lee Jones wrote:
> ls2k_bmc_init() unconditionally calls acpi_unregister_gsi() immediately
> after requesting the GPIO interrupt via devm_request_irq(). This
> prematurely disposes of the active IRQ mapping while the interrupt
> handler remains registered, breaking the GPIO watchdog interrupt and
> causing a use-after-free when devres later frees the disposed IRQ
> descriptor on probe failure or device unbind.
>
> Register a devm_add_action_or_reset() callback before devm_request_irq()
> so that acpi_unregister_gsi() is invoked only after devres has freed the
> interrupt.
...
> Fixes: d952bba3fbb5 ("mfd: ls2kbmc: Add Loongson-2K BMC reset function support")
> Closes: https://sashiko.dev/#/bug/linux-cab8bfb6-4077-46f3-a173-ac2e2042cf66
Don't we use the official Sachiko's email in Reported-by tag?
Reported-by: Sashiko <sashiko-bot@kernel.org>
> Signed-off-by: Lee Jones <lee@kernel.org>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 04/28] mfd: ls2kbmc: Allocate simplefb platform_data on the heap
2026-10-21 12:09 ` [PATCH 04/28] mfd: ls2kbmc: Allocate simplefb platform_data on the heap Lee Jones
@ 2026-10-21 13:58 ` Andy Shevchenko
0 siblings, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2026-10-21 13:58 UTC (permalink / raw)
To: Lee Jones; +Cc: Binbin Zhou, Chong Qiao, mfd, linux-kernel
On Wed, Oct 21, 2026 at 12:09:26PM +0000, Lee Jones wrote:
> ls2k_bmc_probe() declares struct simplefb_platform_data on the stack and
> assigns its address to the display MFD cell. Although mfd_add_device()
> deep-copies platform_data via platform_device_add_data() before
> ls2k_bmc_probe() returns, the shallow mfd_cell copy attached to the
> child platform device retains a stale pointer to the expired stack
> frame.
>
> Allocate the simplefb_platform_data structure on the heap via
> devm_kzalloc() prior to devm_mfd_add_devices() so the pointer remains
> valid for the lifetime of the child platform device.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
assuming you will add Reported-by: Sashiko...
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 03/28] mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel()
2026-10-21 12:09 ` [PATCH 03/28] mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel() Lee Jones
@ 2026-10-21 13:59 ` Andy Shevchenko
0 siblings, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2026-10-21 13:59 UTC (permalink / raw)
To: Lee Jones
Cc: Binbin Zhou, Chong Qiao, Huacai Chen, Corey Minyard, mfd,
linux-kernel, stable
On Wed, Oct 21, 2026 at 12:09:25PM +0000, Lee Jones wrote:
> ls2k_bmc_init() initialises bmc_reset_work with INIT_WORK() and
> immediately requests the PCIe and GPIO interrupts via devm_request_irq().
> If an interrupt fires and schedules bmc_reset_work before a subsequent
> step in ls2k_bmc_probe() fails, or when the device is unbound, devres
> frees ddata whilst bmc_reset_work remains queued, leading to a
> use-after-free in ls2k_bmc_events_fn().
>
> Initialise bmc_reset_work with devm_work_autocancel() before requesting
> the interrupts so that devres cancels any pending work after the
> interrupts are freed and before ddata is released.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
assuming you will add Reported-by: Sashiko...
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset()
2026-10-21 12:09 ` [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset() Lee Jones
2026-10-21 13:57 ` Andy Shevchenko
@ 2026-10-21 14:00 ` Andy Shevchenko
1 sibling, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2026-10-21 14:00 UTC (permalink / raw)
To: Lee Jones
Cc: Binbin Zhou, Chong Qiao, Corey Minyard, Huacai Chen, mfd,
linux-kernel, stable
On Wed, Oct 21, 2026 at 12:09:24PM +0000, Lee Jones wrote:
> ls2k_bmc_init() unconditionally calls acpi_unregister_gsi() immediately
> after requesting the GPIO interrupt via devm_request_irq(). This
> prematurely disposes of the active IRQ mapping while the interrupt
> handler remains registered, breaking the GPIO watchdog interrupt and
> causing a use-after-free when devres later frees the disposed IRQ
> descriptor on probe failure or device unbind.
>
> Register a devm_add_action_or_reset() callback before devm_request_irq()
> so that acpi_unregister_gsi() is invoked only after devres has freed the
> interrupt.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
assuming you will add Reported-by: Sashiko...
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure
2026-10-21 12:09 ` [PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure Lee Jones
@ 2026-10-21 14:01 ` Andy Shevchenko
0 siblings, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2026-10-21 14:01 UTC (permalink / raw)
To: Lee Jones
Cc: Mika Westerberg, Heikki Krogerus, Jarkko Nikula, mfd,
linux-kernel, stable
On Wed, Oct 21, 2026 at 12:09:33PM +0000, Lee Jones wrote:
> When intel_lpss_has_idma() is true, intel_lpss_probe() registers the
> iDMA64 child device via mfd_add_devices() before registering the host
> controller cell. If the second mfd_add_devices() call fails, the
> err_remove_ltr error path returns without calling mfd_remove_devices(),
> leaving the iDMA64 child device registered after the parent's
> device-managed resources are freed.
>
> Call mfd_remove_devices() on the probe error path to clean up any
> previously registered MFD child devices, matching intel_lpss_remove().
Good catch!
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
assuming you will add Reported-by: Sashiko...
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
* Re: [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper
2026-10-21 12:09 ` [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper Lee Jones
@ 2026-10-21 14:02 ` Andy Shevchenko
0 siblings, 0 replies; 35+ messages in thread
From: Andy Shevchenko @ 2026-10-21 14:02 UTC (permalink / raw)
To: Lee Jones
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Dmitry Torokhov, Shi Hao, Rachna Patil,
linux-iio, linux-kernel, linux-input, mfd
On Wed, Oct 21, 2026 at 12:09:50PM +0000, Lee Jones wrote:
> Now that ti_tscadc_dev_get() is a single-line wrapper around
> dev_get_drvdata(p->dev.parent), remove the bespoke helper and retrieve
> the parent driver data directly in the child ADC and touchscreen
> drivers.
I don't see more patches Cc'ed to me, so I don't know if this one makes sense
or not, but OTOH I don't care much, both approaches are fine with me.
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 35+ messages in thread
end of thread, other threads:[~2026-10-21 14:02 UTC | newest]
Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-21 12:09 [PATCH 01/28] mfd: nct6694: Allocate USB DMA buffers with kzalloc_obj() Lee Jones
2026-10-21 12:09 ` [PATCH 02/28] mfd: ls2kbmc: Unregister GPIO GSI via devm_add_action_or_reset() Lee Jones
2026-10-21 13:57 ` Andy Shevchenko
2026-10-21 14:00 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 03/28] mfd: ls2kbmc: Cancel reset work on teardown via devm_work_autocancel() Lee Jones
2026-10-21 13:59 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 04/28] mfd: ls2kbmc: Allocate simplefb platform_data on the heap Lee Jones
2026-10-21 13:58 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 05/28] mfd: bd96801: Allocate watchdog IRQ resource " Lee Jones
2026-10-21 12:09 ` [PATCH 06/28] mfd: ti_am335x_tscadc: Retrieve parent driver data via dev_get_drvdata() Lee Jones
2026-10-21 12:09 ` [PATCH 07/28] mfd: db8500-prcmu: Make AB8500 cell and IRQ resource static Lee Jones
2026-10-21 12:09 ` [PATCH 08/28] mfd: nct6694: Do not resubmit interrupt URB on endpoint stall (-EPIPE) Lee Jones
2026-10-21 12:09 ` [PATCH 09/28] mfd: cgbc: Zero-initialise version buffer in cgbc_get_version() Lee Jones
2026-10-21 12:09 ` [PATCH 10/28] mfd: ioc3: Request parent IRQ via request_irq() and free before domain removal Lee Jones
2026-10-21 12:09 ` [PATCH 11/28] mfd: intel-lpss: Remove registered MFD child devices on probe failure Lee Jones
2026-10-21 14:01 ` Andy Shevchenko
2026-10-21 12:09 ` [PATCH 12/28] mfd: max8907: Manage power-off handler via devm_register_sys_off_handler() Lee Jones
2026-10-21 12:09 ` [PATCH 13/28] mfd: twl-core: Clear pm_power_off callback in twl_remove() Lee Jones
2026-10-21 12:09 ` [PATCH 14/28] mfd: twl-core: Clear twl_priv pointer on teardown and probe failure Lee Jones
2026-10-21 12:09 ` [PATCH 15/28] mfd: loongson-se: Check return value of dma_set_mask_and_coherent() Lee Jones
2026-10-21 12:09 ` [PATCH 16/28] mfd: loongson-se: Zero-initialise controller command structures Lee Jones
2026-10-21 12:09 ` [PATCH 17/28] mfd: loongson-se: Reinitialise completions and wait uninterruptibly for commands Lee Jones
2026-10-21 12:09 ` [PATCH 18/28] mfd: loongson-se: Zero-allocate driver data and initialise engine completions in probe Lee Jones
2026-10-21 12:09 ` [PATCH 19/28] mfd: loongson-se: Prevent out-of-bounds engine access in se_irq_handler() Lee Jones
2026-10-21 12:09 ` [PATCH 20/28] mfd: loongson-se: Stop controller and mask interrupts on teardown and shutdown Lee Jones
2026-10-21 12:09 ` [PATCH 21/28] mfd: loongson-se: Validate engine ID, DMA buffer size, and IRQ registration Lee Jones
2026-10-21 12:09 ` [PATCH 22/28] mfd: abx500-core: Unregister device ops on devm release Lee Jones
2026-10-21 12:09 ` [PATCH 23/28] mfd: ab8500-core: Register sysfs attribute groups via devm_device_add_group() Lee Jones
2026-10-21 12:09 ` [PATCH 24/28] mfd: tps65217: Manage IRQ domain teardown via devres Lee Jones
2026-10-21 12:09 ` [PATCH 25/28] mfd: mt6397: Manage IRQ domain lifecycle with devres Lee Jones
2026-10-21 12:09 ` [PATCH 26/28] mfd: mt6397: Unregister PM notifier on probe failure and unbind Lee Jones
2026-10-21 12:09 ` [PATCH 27/28] i2c: cgbc: Propagate hardware errors when polling read status Lee Jones
2026-10-21 12:09 ` [PATCH 28/28] mfd: ti_am335x_tscadc: Remove redundant ti_tscadc_dev_get() helper Lee Jones
2026-10-21 14:02 ` Andy Shevchenko
2026-10-21 12:31 ` [PATCH 00/28] mfd: Assorted resource lifetime, teardown, and error-handling fixes Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®