* [PATCH 0/2] watchdog: sama5d4: fix IRQ and timeout bugs, use platform_get_irq_optional
From: Rosen Penev @ 2026-06-04 1:05 UTC (permalink / raw)
To: linux-watchdog
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Wim Van Sebroeck, Guenter Roeck,
moderated list:ARM/Microchip (AT91) SoC support, open list
This series fixes three pre-existing issues in the sama5d4 watchdog
driver (unsafe IRQF_SHARED, incorrect IRQ_HANDLED return, ignored
device-tree timeout), then simplifies interrupt acquisition by
switching from irq_of_parse_and_map() to platform_get_irq_optional().
Rosen Penev (2):
watchdog: sama5d4: fix shared IRQ and hardcoded timeout issues
watchdog: sama5d4: use platform_get_irq_optional()
drivers/watchdog/sama5d4_wdt.c | 33 ++++++++++++++++++---------------
1 file changed, 18 insertions(+), 15 deletions(-)
--
2.54.0
^ permalink raw reply
* [PATCH 1/2] watchdog: sama5d4: fix shared IRQ and hardcoded timeout issues
From: Rosen Penev @ 2026-06-04 1:05 UTC (permalink / raw)
To: linux-watchdog
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Wim Van Sebroeck, Guenter Roeck,
moderated list:ARM/Microchip (AT91) SoC support, open list
In-Reply-To: <20260604010542.23177-1-rosenp@gmail.com>
Fix three pre-existing issues in the sama5d4 watchdog driver:
1. Unsafe IRQF_SHARED | IRQF_NO_SUSPEND combination: The watchdog
interrupt is a dedicated peripheral line, not shared with other
devices. Drop IRQF_SHARED to avoid the documented unsafe interaction
where IRQF_NO_SUSPEND keeps the line enabled during suspend while
other sharing devices may be powered down.
2. Unconditional IRQ_HANDLED on shared line: The handler returned
IRQ_HANDLED even when the status register indicated no watchdog
interrupt was pending. Return IRQ_NONE in that case so the kernel
can properly detect spurious interrupts on the line.
3. Hardcoded 16-second timeout: sama5d4_wdt_init() unconditionally
used WDT_DEFAULT_TIMEOUT (16s) for the hardware timeout, ignoring
any timeout configured via device tree (watchdog_init_timeout) or
userspace. Pass wdd->timeout to sama5d4_wdt_init() so the
configured timeout is honored during probe and resume.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/watchdog/sama5d4_wdt.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c
index 704b786cc2ec..b7a8cfed335d 100644
--- a/drivers/watchdog/sama5d4_wdt.c
+++ b/drivers/watchdog/sama5d4_wdt.c
@@ -169,11 +169,12 @@ static irqreturn_t sama5d4_wdt_irq_handler(int irq, void *dev_id)
else
reg = wdt_read(wdt, AT91_WDT_SR);
- if (reg) {
- pr_crit("Atmel Watchdog Software Reset\n");
- emergency_restart();
- pr_crit("Reboot didn't succeed\n");
- }
+ if (!reg)
+ return IRQ_NONE;
+
+ pr_crit("Atmel Watchdog Software Reset\n");
+ emergency_restart();
+ pr_crit("Reboot didn't succeed\n");
return IRQ_HANDLED;
}
@@ -197,11 +198,11 @@ static int of_sama5d4_wdt_init(struct device_node *np, struct sama5d4_wdt *wdt)
return 0;
}
-static int sama5d4_wdt_init(struct sama5d4_wdt *wdt)
+static int sama5d4_wdt_init(struct sama5d4_wdt *wdt, unsigned int timeout)
{
u32 reg, val;
- val = WDT_SEC2TICKS(WDT_DEFAULT_TIMEOUT);
+ val = WDT_SEC2TICKS(timeout);
/*
* When booting and resuming, the bootloader may have changed the
* watchdog configuration.
@@ -289,8 +290,8 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
if (wdt->need_irq) {
ret = devm_request_irq(dev, irq, sama5d4_wdt_irq_handler,
- IRQF_SHARED | IRQF_IRQPOLL |
- IRQF_NO_SUSPEND, pdev->name, pdev);
+ IRQF_IRQPOLL | IRQF_NO_SUSPEND,
+ pdev->name, pdev);
if (ret) {
dev_err(dev, "cannot register interrupt handler\n");
return ret;
@@ -305,7 +306,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
set_bit(WDOG_HW_RUNNING, &wdd->status);
}
- ret = sama5d4_wdt_init(wdt);
+ ret = sama5d4_wdt_init(wdt, wdd->timeout);
if (ret)
return ret;
@@ -358,7 +359,7 @@ static int sama5d4_wdt_resume_early(struct device *dev)
* This should only be done when the registers are lost on suspend but
* there is no way to get this information right now.
*/
- sama5d4_wdt_init(wdt);
+ sama5d4_wdt_init(wdt, wdt->wdd.timeout);
if (watchdog_active(&wdt->wdd))
sama5d4_wdt_start(&wdt->wdd);
--
2.54.0
^ permalink raw reply related
* [PATCH 2/2] watchdog: sama5d4: use platform_get_irq_optional()
From: Rosen Penev @ 2026-06-04 1:05 UTC (permalink / raw)
To: linux-watchdog
Cc: Nicolas Ferre, Alexandre Belloni, Claudiu Beznea,
Wim Van Sebroeck, Guenter Roeck,
moderated list:ARM/Microchip (AT91) SoC support, open list
In-Reply-To: <20260604010542.23177-1-rosenp@gmail.com>
irq_of_parse_and_map() requires irq_dispose_mapping() on failure. Don't
bother with it as platform_get_irq_optional() doesn't need it.
Also handle EPROBE_DEFER.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/watchdog/sama5d4_wdt.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/watchdog/sama5d4_wdt.c b/drivers/watchdog/sama5d4_wdt.c
index b7a8cfed335d..030029d50257 100644
--- a/drivers/watchdog/sama5d4_wdt.c
+++ b/drivers/watchdog/sama5d4_wdt.c
@@ -11,7 +11,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
-#include <linux/of_irq.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/watchdog.h>
@@ -245,7 +244,7 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
struct watchdog_device *wdd;
struct sama5d4_wdt *wdt;
void __iomem *regs;
- u32 irq = 0;
+ int irq = 0;
u32 reg;
int ret;
@@ -281,8 +280,11 @@ static int sama5d4_wdt_probe(struct platform_device *pdev)
return ret;
if (wdt->need_irq) {
- irq = irq_of_parse_and_map(dev->of_node, 0);
- if (!irq) {
+ irq = platform_get_irq_optional(pdev, 0);
+ if (irq == -EPROBE_DEFER)
+ return irq;
+
+ if (irq < 0) {
dev_warn(dev, "failed to get IRQ from DT\n");
wdt->need_irq = false;
}
--
2.54.0
^ permalink raw reply related
* [PATCHv2] thermal/drivers/exynos: fix clock ordering race and shared IRQ handling
From: Rosen Penev @ 2026-06-04 1:42 UTC (permalink / raw)
To: linux-pm
Cc: Bartlomiej Zolnierkiewicz, Krzysztof Kozlowski, Rafael J. Wysocki,
Daniel Lezcano, Zhang Rui, Lukasz Luba, Peter Griffin,
Alim Akhtar, open list:SAMSUNG THERMAL DRIVER,
moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES,
open list
Fix two pre-existing issues in exynos_tmu_probe/remove:
1. Clock ordering race: The driver manually unprepares clocks in
exynos_tmu_remove() and the probe error path, but the IRQ handler and
thermal zone are devm-managed and remain active until after the manual
cleanup. If the shared IRQ fires or the thermal zone is polled in that
window, clk_enable() is called on an unprepared clock, which is illegal.
Replace devm_clk_get() + manual clk_prepare() with devm_clk_get_prepared(),
and devm_clk_get() + manual clk_prepare_enable() with
devm_clk_get_enabled(), so clock unprepare is tied to the devm lifetime
and happens after the IRQ and thermal zone are released. Remove the
now-redundant manual cleanup from the error path and remove function.
2. Shared IRQ handling: The driver requests a shared IRQ (IRQF_SHARED) with
NULL as the hardirq handler, causing irq_default_primary_handler to wake
the threaded handler for every interrupt on the shared line and, combined
with IRQF_ONESHOT, mask the line until the thread completes. Replace the
NULL handler with a hardirq handler that reads the TMU interrupt status
register and returns IRQ_NONE when the TMU is not the interrupt source,
so other devices on the shared line are not delayed. Also return IRQ_NONE
from the threaded handler as a safety net if the interrupt was already
handled or cleared between the hardirq and threaded handler.
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
v2: fixed sashiko comments and moved TODO.
drivers/thermal/samsung/exynos_tmu.c | 104 ++++++++++++---------------
1 file changed, 46 insertions(+), 58 deletions(-)
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 47a99b3c5395..11b2f1e2670c 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -196,7 +196,7 @@ struct exynos_tmu_data {
void (*tmu_control)(struct platform_device *pdev, bool on);
int (*tmu_read)(struct exynos_tmu_data *data);
void (*tmu_set_emulation)(struct exynos_tmu_data *data, int temp);
- void (*tmu_clear_irqs)(struct exynos_tmu_data *data);
+ u32 (*tmu_clear_irqs)(struct exynos_tmu_data *data);
};
/*
@@ -756,28 +756,53 @@ static int exynos7_tmu_read(struct exynos_tmu_data *data)
EXYNOS7_TMU_TEMP_MASK;
}
-static irqreturn_t exynos_tmu_threaded_irq(int irq, void *id)
+static u32 exynos_tmu_intstat_offset(struct exynos_tmu_data *data)
+{
+ if (data->soc == SOC_ARCH_EXYNOS5260)
+ return EXYNOS5260_TMU_REG_INTSTAT;
+ if (data->soc == SOC_ARCH_EXYNOS7)
+ return EXYNOS7_TMU_REG_INTPEND;
+ if (data->soc == SOC_ARCH_EXYNOS5433)
+ return EXYNOS5433_TMU_REG_INTPEND;
+ return EXYNOS_TMU_REG_INTSTAT;
+}
+
+static irqreturn_t exynos_tmu_irq(int irq, void *id)
{
struct exynos_tmu_data *data = id;
- thermal_zone_device_update(data->tzd, THERMAL_EVENT_UNSPECIFIED);
+ if (!readl(data->base + exynos_tmu_intstat_offset(data)))
+ return IRQ_NONE;
+
+ return IRQ_WAKE_THREAD;
+}
+
+static irqreturn_t exynos_tmu_threaded_irq(int irq, void *id)
+{
+ struct exynos_tmu_data *data = id;
mutex_lock(&data->lock);
clk_enable(data->clk);
/* TODO: take action based on particular interrupt */
- data->tmu_clear_irqs(data);
+
+ if (!data->tmu_clear_irqs(data)) {
+ clk_disable(data->clk);
+ mutex_unlock(&data->lock);
+ return IRQ_NONE;
+ }
clk_disable(data->clk);
mutex_unlock(&data->lock);
+ thermal_zone_device_update(data->tzd, THERMAL_EVENT_UNSPECIFIED);
+
return IRQ_HANDLED;
}
-static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data)
+static u32 exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data)
{
- unsigned int val_irq;
- u32 tmu_intstat, tmu_intclear;
+ u32 val_irq, tmu_intstat, tmu_intclear;
if (data->soc == SOC_ARCH_EXYNOS5260) {
tmu_intstat = EXYNOS5260_TMU_REG_INTSTAT;
@@ -803,6 +828,8 @@ static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data)
* support FALL IRQs at all).
*/
writel(val_irq, data->base + tmu_intclear);
+
+ return val_irq;
}
static const struct of_device_id exynos_tmu_match[] = {
@@ -1036,43 +1063,22 @@ static int exynos_tmu_probe(struct platform_device *pdev)
if (ret)
return ret;
- data->clk = devm_clk_get(dev, "tmu_apbif");
+ data->clk = devm_clk_get_prepared(dev, "tmu_apbif");
if (IS_ERR(data->clk))
return dev_err_probe(dev, PTR_ERR(data->clk), "Failed to get clock\n");
- data->clk_sec = devm_clk_get(dev, "tmu_triminfo_apbif");
- if (IS_ERR(data->clk_sec)) {
+ data->clk_sec = devm_clk_get_prepared(dev, "tmu_triminfo_apbif");
+ if (IS_ERR(data->clk_sec))
if (data->soc == SOC_ARCH_EXYNOS5420_TRIMINFO)
return dev_err_probe(dev, PTR_ERR(data->clk_sec),
"Failed to get triminfo clock\n");
- } else {
- ret = clk_prepare(data->clk_sec);
- if (ret) {
- dev_err(dev, "Failed to get clock\n");
- return ret;
- }
- }
-
- ret = clk_prepare(data->clk);
- if (ret) {
- dev_err(dev, "Failed to get clock\n");
- goto err_clk_sec;
- }
switch (data->soc) {
case SOC_ARCH_EXYNOS5433:
case SOC_ARCH_EXYNOS7:
- data->sclk = devm_clk_get(dev, "tmu_sclk");
- if (IS_ERR(data->sclk)) {
- ret = dev_err_probe(dev, PTR_ERR(data->sclk), "Failed to get sclk\n");
- goto err_clk;
- } else {
- ret = clk_prepare_enable(data->sclk);
- if (ret) {
- dev_err(dev, "Failed to enable sclk\n");
- goto err_clk;
- }
- }
+ data->sclk = devm_clk_get_enabled(dev, "tmu_sclk");
+ if (IS_ERR(data->sclk))
+ return dev_err_probe(dev, PTR_ERR(data->sclk), "Failed to get sclk\n");
break;
default:
break;
@@ -1081,55 +1087,37 @@ static int exynos_tmu_probe(struct platform_device *pdev)
ret = exynos_tmu_initialize(pdev);
if (ret) {
dev_err(dev, "Failed to initialize TMU\n");
- goto err_sclk;
+ return ret;
}
data->tzd = devm_thermal_of_zone_register(dev, 0, data,
&exynos_sensor_ops);
- if (IS_ERR(data->tzd)) {
- ret = dev_err_probe(dev, PTR_ERR(data->tzd), "Failed to register sensor\n");
- goto err_sclk;
- }
+ if (IS_ERR(data->tzd))
+ return dev_err_probe(dev, PTR_ERR(data->tzd), "Failed to register sensor\n");
ret = exynos_thermal_zone_configure(pdev);
if (ret) {
dev_err(dev, "Failed to configure the thermal zone\n");
- goto err_sclk;
+ return ret;
}
- ret = devm_request_threaded_irq(dev, data->irq, NULL,
+ ret = devm_request_threaded_irq(dev, data->irq, exynos_tmu_irq,
exynos_tmu_threaded_irq,
IRQF_TRIGGER_RISING
| IRQF_SHARED | IRQF_ONESHOT,
dev_name(dev), data);
if (ret) {
dev_err(dev, "Failed to request irq: %d\n", data->irq);
- goto err_sclk;
+ return ret;
}
exynos_tmu_control(pdev, true);
return 0;
-
-err_sclk:
- clk_disable_unprepare(data->sclk);
-err_clk:
- clk_unprepare(data->clk);
-err_clk_sec:
- if (!IS_ERR(data->clk_sec))
- clk_unprepare(data->clk_sec);
- return ret;
}
static void exynos_tmu_remove(struct platform_device *pdev)
{
- struct exynos_tmu_data *data = platform_get_drvdata(pdev);
-
exynos_tmu_control(pdev, false);
-
- clk_disable_unprepare(data->sclk);
- clk_unprepare(data->clk);
- if (!IS_ERR(data->clk_sec))
- clk_unprepare(data->clk_sec);
}
#ifdef CONFIG_PM_SLEEP
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] regulator: dt-bindings: mt6311: Convert to DT schema
From: Rob Herring @ 2026-06-04 1:47 UTC (permalink / raw)
To: Ninad Naik
Cc: lgirdwood, broonie, krzk+dt, conor+dt, matthias.bgg,
angelogioacchino.delregno, devicetree, linux-kernel,
linux-arm-kernel, linux-mediatek, me, linux-kernel-mentees, skhan
In-Reply-To: <20260531165712.729635-1-ninadnaik07@gmail.com>
On Sun, May 31, 2026 at 10:27:12PM +0530, Ninad Naik wrote:
> Convert mediatek,mt6311 to DT schema.
>
> Signed-off-by: Ninad Naik <ninadnaik07@gmail.com>
> ---
> .../regulator/mediatek,mt6311-regulator.yaml | 72 +++++++++++++++++++
> .../bindings/regulator/mt6311-regulator.txt | 35 ---------
> 2 files changed, 72 insertions(+), 35 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/regulator/mediatek,mt6311-regulator.yaml
> delete mode 100644 Documentation/devicetree/bindings/regulator/mt6311-regulator.txt
>
> diff --git a/Documentation/devicetree/bindings/regulator/mediatek,mt6311-regulator.yaml b/Documentation/devicetree/bindings/regulator/mediatek,mt6311-regulator.yaml
> new file mode 100644
> index 000000000000..a51db46b0f41
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/regulator/mediatek,mt6311-regulator.yaml
> @@ -0,0 +1,72 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/regulator/mediatek,mt6311-regulator.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Mediatek MT6311 Regulator
> +
> +maintainers:
> + - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
> +
> +description: |
Don't need '|' if no formatting.
> + The MediaTek MT6311 is an I2C power management IC that provides one step-down
> + converter and one low-dropout regulator. The regulators are named VDVFS and
> + VBIASN, respectively.
> +
> +properties:
> + compatible:
> + const: mediatek,mt6311-regulator
> +
> + reg:
> + description: I2C slave address.
> + maxItems: 1
> +
> + regulators:
> + type: object
> + description: List of regulators provided by this controller.
> +
> + patternProperties:
> + "^(VDVFS|VBIASN)$":
> + type: object
> + $ref: regulator.yaml#
> + description: |
> + Regulator nodes.
Drop. That's obvious with the $ref.
> + unevaluatedProperties: false
> +
> + additionalProperties: false
> +
> +required:
> + - compatible
> + - reg
> + - regulators
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + i2c {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + mt6311: pmic@6b {
Drop unused label.
> + compatible = "mediatek,mt6311-regulator";
> + reg = <0x6b>;
> +
> + regulators {
> + mt6311_vcpu_reg: VDVFS {
Drop unused label.
> + regulator-name = "VDVFS";
> + regulator-min-microvolt = <600000>;
> + regulator-max-microvolt = <1400000>;
> + regulator-ramp-delay = <10000>;
> + };
> +
> + mt6311_ldo_reg: VBIASN {
Drop unused label.
> + regulator-name = "VBIASN";
> + regulator-min-microvolt = <200000>;
> + regulator-max-microvolt = <800000>;
> + };
> + };
> + };
> + };
> +...
> diff --git a/Documentation/devicetree/bindings/regulator/mt6311-regulator.txt b/Documentation/devicetree/bindings/regulator/mt6311-regulator.txt
> deleted file mode 100644
> index 84d544d8c1b1..000000000000
> --- a/Documentation/devicetree/bindings/regulator/mt6311-regulator.txt
> +++ /dev/null
> @@ -1,35 +0,0 @@
> -Mediatek MT6311 Regulator
> -
> -Required properties:
> -- compatible: "mediatek,mt6311-regulator"
> -- reg: I2C slave address, usually 0x6b.
> -- regulators: List of regulators provided by this controller. It is named
> - to VDVFS and VBIASN.
> - The definition for each of these nodes is defined using the standard binding
> - for regulators at Documentation/devicetree/bindings/regulator/regulator.txt.
> -
> -The valid names for regulators are:
> -BUCK:
> - VDVFS
> -LDO:
> - VBIASN
> -
> -Example:
> - mt6311: pmic@6b {
> - compatible = "mediatek,mt6311-regulator";
> - reg = <0x6b>;
> -
> - regulators {
> - mt6311_vcpu_reg: VDVFS {
> - regulator-name = "VDVFS";
> - regulator-min-microvolt = < 600000>;
> - regulator-max-microvolt = <1400000>;
> - regulator-ramp-delay = <10000>;
> - };
> - mt6311_ldo_reg: VBIASN {
> - regulator-name = "VBIASN";
> - regulator-min-microvolt = <200000>;
> - regulator-max-microvolt = <800000>;
> - };
> - };
> - };
> --
> 2.54.0
>
>
^ permalink raw reply
* Re: [PATCH v3 03/11] of: reserved_mem: avoid post-init UAF when alloc_reserved_mem_array() fails
From: Wandun @ 2026-06-04 1:48 UTC (permalink / raw)
To: Rob Herring
Cc: linux-arm-kernel, linux-kernel, loongarch, linux-riscv,
devicetree, kexec, iommu, zhaomeijing, catalin.marinas, will,
chenhuacai, kernel, pjw, palmer, aou, alex, saravanak, akpm, bhe,
rppt, pasha.tatashin, pratyush, ruirui.yang, m.szyprowski,
robin.murphy, quic_obabatun
In-Reply-To: <CAL_JsqJOC1ko1Len3Dyc5SNKrHmhQn9uiDAkFfVbYa2wAfFUTg@mail.gmail.com>
On 6/4/26 01:44, Rob Herring wrote:
> On Wed, Jun 3, 2026 at 1:44 AM Wandun <chenwandun1@gmail.com> wrote:
>>
>>
>> On 6/3/26 00:24, Rob Herring wrote:
>>> On Wed, May 27, 2026 at 11:29:09AM +0800, Wandun Chen wrote:
>>>> From: Wandun Chen <chenwandun@lixiang.com>
>>>>
>>>> The global pointer 'reserved_mem' continues to reference the
>>>> reserved_mem_array which lives in __initdata if
>>>> alloc_reserved_mem_array() fails. of_reserved_mem_lookup() is
>>>> exported for post-init use, that would dereference freed memory
>>>> and trigger a use-after-free.
>>>>
>>>> So reset reserved_mem_count to 0 when alloc_reserved_mem_array()
>>>> fails.
>>>>
>>>> Fixes: 00c9a452a235 ("of: reserved_mem: Add code to dynamically allocate reserved_mem array")
>>> Fixes should come first in a series.
>> Understood, will do in future submissions.
>>>> Signed-off-by: Wandun Chen <chenwandun@lixiang.com>
>>>> ---
>>>> drivers/of/of_reserved_mem.c | 20 ++++++++++++++------
>>>> 1 file changed, 14 insertions(+), 6 deletions(-)
>>>>
>>>> diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
>>>> index 313cbc57aa45..6d479381ff1f 100644
>>>> --- a/drivers/of/of_reserved_mem.c
>>>> +++ b/drivers/of/of_reserved_mem.c
>>>> @@ -69,29 +69,31 @@ static int __init early_init_dt_alloc_reserved_memory_arch(phys_addr_t size,
>>>> * the initial static array is copied over to this new array and
>>>> * the new array is used from this point on.
>>>> */
>>>> -static void __init alloc_reserved_mem_array(void)
>>>> +static bool __init alloc_reserved_mem_array(void)
>>>> {
>>>> struct reserved_mem *new_array;
>>>> size_t alloc_size, copy_size, memset_size;
>>>>
>>>> + if (!total_reserved_mem_cnt)
>>>> + return true;
>>>> +
>>>> alloc_size = array_size(total_reserved_mem_cnt, sizeof(*new_array));
>>>> if (alloc_size == SIZE_MAX) {
>>>> pr_err("Failed to allocate memory for reserved_mem array with err: %d", -EOVERFLOW);
>>>> - return;
>>>> + goto fail;
>>>> }
>>>>
>>>> new_array = memblock_alloc(alloc_size, SMP_CACHE_BYTES);
>>>> if (!new_array) {
>>>> pr_err("Failed to allocate memory for reserved_mem array with err: %d", -ENOMEM);
>>>> - return;
>>>> + goto fail;
>>>> }
>>>>
>>>> copy_size = array_size(reserved_mem_count, sizeof(*new_array));
>>>> if (copy_size == SIZE_MAX) {
>>>> memblock_free(new_array, alloc_size);
>>>> - total_reserved_mem_cnt = MAX_RESERVED_REGIONS;
>>>> pr_err("Failed to allocate memory for reserved_mem array with err: %d", -EOVERFLOW);
>>> These prints could be moved to 'fail'. Perhaps instead of just printing
>>> an error value, you can return the error value instead of boolean.
>> Will do, consolidating pr_err() under 'fail' and changing the return type
>> to int.
>>> If you respin just this patch, I can pick it up for 7.2.
>> Before I respin, I'd like to flag a dependency:
>> patch 05/07 in this series build on the signature change introduced by this
>> patch ("the void -> bool return type change of alloc_reserved_mem_array()")
>>
>> Could you let me know which of the following you'd prefer:
>> a) Take patch 03 alone via your tree as you suggested, after it lands, I'll
>> respin the remaining patches of this series.
> I would go with this option. AIUI, this series isn't going to land in
> 7.2, so ultimately you will rebase on v7.2-rc1 which will have the
> fix.
OK, will send v4.
Best regards,
Wandun
>
>> b) Keep patch 03 in the v4 respin of the full series, reordered to the front
>> per your earlier comment.
>
> Rob
^ permalink raw reply
* [PATCH v1] arm64: dts: imx94: Add Root Port node and PERST property
From: hongxing.zhu @ 2026-06-04 2:24 UTC (permalink / raw)
To: sherry.sun, robh, krzk+dt, conor+dt, frank.li, s.hauer, festevam
Cc: kernel, devicetree, imx, linux-arm-kernel, linux-kernel,
Richard Zhu, Richard Zhu
From: Richard Zhu <hongxing.zhu@oss.nxp.com>
Since describing the PCIe PERST# property under Host Bridge node is now
deprecated, it is recommended to add it to the Root Port node, so
creating the Root Port node and add the reset-gpios property in Root
Port.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx94.dtsi | 11 +++++++++++
arch/arm64/boot/dts/freescale/imx943-evk.dts | 10 ++++++++++
arch/arm64/boot/dts/freescale/imx943.dtsi | 11 +++++++++++
3 files changed, 32 insertions(+)
---
Since the patch-set [1] issued by Sherry had been landed. Add according
changes on i.MX943 board too.
[1] https://lkml.org/lkml/2026/6/1/1461
diff --git a/arch/arm64/boot/dts/freescale/imx94.dtsi b/arch/arm64/boot/dts/freescale/imx94.dtsi
index 1f9035e6cf159..dfbb73603cb24 100644
--- a/arch/arm64/boot/dts/freescale/imx94.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx94.dtsi
@@ -1411,6 +1411,17 @@ pcie0: pcie@4c300000 {
power-domains = <&scmi_devpd IMX94_PD_HSIO_TOP>;
fsl,max-link-speed = <3>;
status = "disabled";
+
+ pcie0_port0: pcie@0 {
+ compatible = "pciclass,0604";
+ device_type = "pci";
+ reg = <0x0 0x0 0x0 0x0 0x0>;
+ bus-range = <0x01 0xff>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+ };
};
pcie0_ep: pcie-ep@4c300000 {
diff --git a/arch/arm64/boot/dts/freescale/imx943-evk.dts b/arch/arm64/boot/dts/freescale/imx943-evk.dts
index 7cfd424689507..ed3abd3e76e56 100644
--- a/arch/arm64/boot/dts/freescale/imx943-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx943-evk.dts
@@ -1034,12 +1034,17 @@ &pcie0 {
<&pcie_ref_clk>;
clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux",
"ref", "extref";
+ /* This property is deprecated, use reset-gpios from the Root Port node. */
reset-gpio = <&pcal6416_i2c3_u46 3 GPIO_ACTIVE_LOW>;
vpcie3v3aux-supply = <®_m2_wlan>;
supports-clkreq;
status = "okay";
};
+&pcie0_port0 {
+ reset-gpio = <&pcal6416_i2c3_u46 3 GPIO_ACTIVE_LOW>;
+};
+
&pcie0_ep {
pinctrl-0 = <&pinctrl_pcie0>;
pinctrl-names = "default";
@@ -1058,12 +1063,17 @@ &pcie1 {
<&pcie_ref_clk>;
clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux",
"ref", "extref";
+ /* This property is deprecated, use reset-gpios from the Root Port node. */
reset-gpio = <&pcal6416_i2c3_u46 1 GPIO_ACTIVE_LOW>;
vpcie3v3aux-supply = <®_slot_pwr>;
supports-clkreq;
status = "okay";
};
+&pcie1_port0 {
+ reset-gpio = <&pcal6416_i2c3_u46 1 GPIO_ACTIVE_LOW>;
+};
+
&pcie1_ep {
pinctrl-0 = <&pinctrl_pcie1>;
pinctrl-names = "default";
diff --git a/arch/arm64/boot/dts/freescale/imx943.dtsi b/arch/arm64/boot/dts/freescale/imx943.dtsi
index cf5b3dbb47ff7..01152fd0efa5e 100644
--- a/arch/arm64/boot/dts/freescale/imx943.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx943.dtsi
@@ -255,6 +255,17 @@ pcie1: pcie@4c380000 {
power-domains = <&scmi_devpd IMX94_PD_HSIO_TOP>;
fsl,max-link-speed = <3>;
status = "disabled";
+
+ pcie1_port0: pcie@0 {
+ compatible = "pciclass,0604";
+ device_type = "pci";
+ reg = <0x0 0x0 0x0 0x0 0x0>;
+ bus-range = <0x01 0xff>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ ranges;
+ };
};
pcie1_ep: pcie-ep@4c380000 {
--
2.34.1
^ permalink raw reply related
* Re: [PATCH net 0/2] Fix use-after-free in metadata dst teardown in airoha_eth and mtk_eth_soc drivers
From: patchwork-bot+netdevbpf @ 2026-06-04 2:30 UTC (permalink / raw)
To: Lorenzo Bianconi
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, nbd, matthias.bgg,
angelogioacchino.delregno, fw, linux-arm-kernel, linux-mediatek,
netdev
In-Reply-To: <20260602-airoha-mtk-metadata-uaf-fix-v1-0-3aaa99d83351@kernel.org>
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 02 Jun 2026 11:21:03 +0200 you wrote:
> airoha_metadata_dst_free() and mtk_free_dev() call metadata_dst_free()
> which frees the metadata_dst with kfree() immediately, bypassing the RCU
> grace period.
> Replace metadata_dst_free() with dst_release() which properly goes
> through the refcount path and runs call_rcu_hurry() if refcount goes to
> zero.
>
> [...]
Here is the summary with links:
- [net,1/2] net: airoha: Fix use-after-free in metadata dst teardown
https://git.kernel.org/netdev/net/c/b38cae85d1c4
- [net,2/2] net: ethernet: mtk_eth_soc: Fix use-after-free in metadata dst teardown
https://git.kernel.org/netdev/net/c/80df409e1a48
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH net next] net: axienet: Use dedicated ethtool_ops for the dmaengine path
From: patchwork-bot+netdevbpf @ 2026-06-04 2:30 UTC (permalink / raw)
To: Suraj Gupta
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, michal.simek,
sean.anderson, radhey.shyam.pandey, horms, netdev,
linux-arm-kernel, linux-kernel, harini.katakam
In-Reply-To: <20260601124454.3384601-1-suraj.gupta2@amd.com>
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 1 Jun 2026 18:14:54 +0530 you wrote:
> The dmaengine path shares ethtool_ops with the legacy AXI DMA path,
> including .get_coalesce/.set_coalesce that poke XAXIDMA_*_CR_OFFSET
> directly. In dmaengine mode lp->dma_regs is not mapped by axienet, so
> those ethtool calls touch unmapped/unrelated memory and report values
> unrelated to the channel actually in use.
>
> .get_ringparam/.set_ringparam only touch lp->rx_bd_num/lp->tx_bd_num,
> fields used only by the legacy path for BD ring sizing. In dmaengine
> mode the descriptor ring is owned by the dmaengine provider and these
> fields are not consulted, so reporting them is misleading.
>
> [...]
Here is the summary with links:
- [net,next] net: axienet: Use dedicated ethtool_ops for the dmaengine path
https://git.kernel.org/netdev/net-next/c/c1c3d01e3a90
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply
* Re: [PATCH v3 1/5] phy: fsl-imx8mq-usb: fix typec switch leak on probe error path
From: Xu Yang @ 2026-06-04 2:29 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Neil Armstrong, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jun Li, linux-phy, imx, linux-arm-kernel,
linux-kernel, Felix Gu, stable, Xu Yang
In-Reply-To: <aiBxqjm5lsPDXEtW@lizhi-Precision-Tower-5810>
On Wed, Jun 03, 2026 at 02:25:46PM -0400, Frank Li wrote:
> On Wed, Jun 03, 2026 at 01:37:14PM +0800, Xu Yang wrote:
> > From: Felix Gu <ustc.gu@gmail.com>
> >
> > If probe fails after imx95_usb_phy_get_tca() succeeds, the typec
> > switch leaks because the only cleanup path was in .remove, which
> > never runs on probe failure.
> >
> > Use devm_add_action_or_reset() so the switch is cleaned up on both
> > probe failure and driver removal. The .remove callback and
> > imx95_usb_phy_put_tca() are no longer needed.
> >
> > Fixes: b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")
> > Cc: stable@vger.kernel.org
> > Reviewed-by: Frank Li <Frank.Li@nxp.com>
> > Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
> > Signed-off-by: Felix Gu <ustc.gu@gmail.com>
>
> Xu yang, if you send out patch, need your s-o-b tag
OK. Will add it in v2.
Thanks,
Xu Yang
^ permalink raw reply
* [STATUS] arm64/for-kernelci - ec7ef10b77a69d482f7c78c8236389e64a08eb98
From: KernelCI bot @ 2026-06-04 2:30 UTC (permalink / raw)
To: kernelci-results; +Cc: will, linux-arm-kernel
Hello,
Status summary for arm64/for-kernelci
Dashboard:
https://d.kernelci.org/c/arm64/for-kernelci/ec7ef10b77a69d482f7c78c8236389e64a08eb98/
giturl: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
branch: for-kernelci
commit hash: ec7ef10b77a69d482f7c78c8236389e64a08eb98
origin: maestro
test start time: 2026-06-03 21:07:25.834000+00:00
Builds: 8 ✅ 0 ❌ 0 ⚠️
Boots: 35 ✅ 0 ❌ 1 ⚠️
Tests: 9865 ✅ 0 ❌ 93 ⚠️
### POSSIBLE REGRESSIONS
No possible regressions observed.
### FIXED REGRESSIONS
No fixed regressions observed.
### UNSTABLE TESTS
Hardware: bcm2711-rpi-4-b
> Config: defconfig+lab-setup+kselftest
- Architecture/compiler: arm64/gcc-14
- boot
last run: https://d.kernelci.org/test/maestro:6a20a0dc2cc72b6e94bc36ea
history: > ⚠️ > ⚠️ > ✅ > ✅ > ✅
Sent every day if there were changes in the past 24 hours.
Legend: ✅ PASS ❌ FAIL ⚠️ INCONCLUSIVE
--
This is an experimental report format. Please send feedback in!
Talk to us at kernelci@lists.linux.dev
Made with love by the KernelCI team - https://kernelci.org
^ permalink raw reply
* Re: [PATCH v3 3/5] phy: fsl-imx8mq-usb: add runtime PM support
From: Xu Yang @ 2026-06-04 2:31 UTC (permalink / raw)
To: Frank Li
Cc: Vinod Koul, Neil Armstrong, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, Jun Li, linux-phy, imx, linux-arm-kernel,
linux-kernel, Xu Yang
In-Reply-To: <aiB0Ivrz-Y-Ilv_W@lizhi-Precision-Tower-5810>
On Wed, Jun 03, 2026 at 02:36:18PM -0400, Frank Li wrote:
> On Wed, Jun 03, 2026 at 01:37:16PM +0800, Xu Yang wrote:
> > From: Xu Yang <xu.yang_2@nxp.com>
> >
> > Add runtime PM to ensure the PHY is properly powered and clocked during
> > register access, preventing potential system hangs.
> >
> > It guards register access in the following scenarios:
> > - PHY operations: init() and power_on/off() callbacks are guarded by
> > phy core
> > - Type-C orientation switching when PHY/Controller are suspended which
> > needs explicitly care
> > - Future PHY control port register regmap debugfs access
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> >
> > ---
> > Changes in v3:
> > - new patch
> > ---
> > drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 60 ++++++++++++++++++++----------
> > 1 file changed, 41 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > index 591ddf346061..b0092c34416e 100644
> > --- a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > +++ b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > @@ -9,6 +9,7 @@
> > #include <linux/of.h>
> > #include <linux/phy/phy.h>
> > #include <linux/platform_device.h>
> > +#include <linux/pm_runtime.h>
> > #include <linux/regulator/consumer.h>
> > #include <linux/usb/typec_mux.h>
> >
> > @@ -136,17 +137,13 @@ static int tca_blk_typec_switch_set(struct typec_switch_dev *sw,
> > {
> > struct imx8mq_usb_phy *imx_phy = typec_switch_get_drvdata(sw);
> > struct tca_blk *tca = imx_phy->tca;
> > - int ret;
> >
> > if (tca->orientation == orientation)
> > return 0;
> >
> > - ret = clk_prepare_enable(imx_phy->clk);
> > - if (ret)
> > - return ret;
> > + guard(pm_runtime_active)(&imx_phy->phy->dev);
>
> use PM_RUNTIME_ACQUIRE macro
OK
>
> >
> > tca_blk_orientation_set(tca, orientation);
> > - clk_disable_unprepare(imx_phy->clk);
> >
> > return 0;
> > }
> > @@ -620,16 +617,6 @@ static int imx8mq_phy_power_on(struct phy *phy)
> > if (ret)
> > return ret;
> >
> > - ret = clk_prepare_enable(imx_phy->clk);
> > - if (ret)
> > - return ret;
> > -
> > - ret = clk_prepare_enable(imx_phy->alt_clk);
> > - if (ret) {
> > - clk_disable_unprepare(imx_phy->clk);
> > - return ret;
> > - }
> > -
> > /* Disable rx term override */
> > value = readl(imx_phy->base + PHY_CTRL6);
> > value &= ~PHY_CTRL6_RXTERM_OVERRIDE_SEL;
> > @@ -648,8 +635,6 @@ static int imx8mq_phy_power_off(struct phy *phy)
> > value |= PHY_CTRL6_RXTERM_OVERRIDE_SEL;
> > writel(value, imx_phy->base + PHY_CTRL6);
> >
> > - clk_disable_unprepare(imx_phy->alt_clk);
> > - clk_disable_unprepare(imx_phy->clk);
> > regulator_disable(imx_phy->vbus);
> >
> > return 0;
> > @@ -686,6 +671,7 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)
> > struct device *dev = &pdev->dev;
> > struct imx8mq_usb_phy *imx_phy;
> > const struct phy_ops *phy_ops;
> > + int ret;
> >
> > imx_phy = devm_kzalloc(dev, sizeof(*imx_phy), GFP_KERNEL);
> > if (!imx_phy)
> > @@ -693,13 +679,13 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)
> >
> > platform_set_drvdata(pdev, imx_phy);
> >
> > - imx_phy->clk = devm_clk_get(dev, "phy");
> > + imx_phy->clk = devm_clk_get_enabled(dev, "phy");
> > if (IS_ERR(imx_phy->clk)) {
> > dev_err(dev, "failed to get imx8mq usb phy clock\n");
> > return PTR_ERR(imx_phy->clk);
> > }
> >
> > - imx_phy->alt_clk = devm_clk_get_optional(dev, "alt");
> > + imx_phy->alt_clk = devm_clk_get_optional_enabled(dev, "alt");
> > if (IS_ERR(imx_phy->alt_clk))
> > return dev_err_probe(dev, PTR_ERR(imx_phy->alt_clk),
> > "Failed to get alt clk\n");
> > @@ -708,6 +694,10 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)
> > if (IS_ERR(imx_phy->base))
> > return PTR_ERR(imx_phy->base);
> >
> > + ret = devm_pm_runtime_set_active_enabled(dev);
> > + if (ret)
> > + return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
> > +
>
> you enable runtime pm here, when runtimes suspend
devm_pm_runtime_set_active_enabled() will firstly change status as runtime active,
then enable runtime PM. So it's already not in suspend state.
Thanks,
Xu Yang
^ permalink raw reply
* [PATCH v1 1/2] arm64: dts: imx94: Correct PCIe outbound address space configuration
From: hongxing.zhu @ 2026-06-04 2:38 UTC (permalink / raw)
To: sherry.sun, robh, krzk+dt, conor+dt, frank.li, s.hauer, festevam
Cc: kernel, devicetree, imx, linux-arm-kernel, linux-kernel,
Richard Zhu
From: Richard Zhu <hongxing.zhu@nxp.com>
Fix the PCIe outbound memory ranges for both pcie0 controllers on i.MX94.
The memory window size was incorrectly set to 256MB during initial
bring-up, but the hardware supports up to 4GB of outbound address space
per controller.
Additionally, the ECAM region cannot be mapped as I/O space. Use a
memory-mapped region for I/O space instead, and relocate the 1MB I/O
region to immediately follow the memory region at offset 0xf0000000
within each window.
Update the outbound address space layout per controller as follows:
- 3.5GB 64-bit prefetchable memory
- 256MB 32-bit non-prefetchable memory
- 1MB I/O
Fixes: 8cd439f17758 ("arm64: dts: imx94: Add pcie0 and pcie0-ep supports")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx94.dtsi | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
Since the correction of i.MX95 PCIe had been landed. Add same changes
for i.MX94 PCIe0.
[1] https://lkml.org/lkml/2026/5/20/427
diff --git a/arch/arm64/boot/dts/freescale/imx94.dtsi b/arch/arm64/boot/dts/freescale/imx94.dtsi
index a6cb5a6e848b3..1f9035e6cf159 100644
--- a/arch/arm64/boot/dts/freescale/imx94.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx94.dtsi
@@ -1374,8 +1374,9 @@ pcie0: pcie@4c300000 {
<0 0x4c360000 0 0x10000>,
<0 0x4c340000 0 0x4000>;
reg-names = "dbi", "config", "atu", "app";
- ranges = <0x81000000 0x0 0x00000000 0x0 0x6ff00000 0 0x00100000>,
- <0x82000000 0x0 0x10000000 0x9 0x10000000 0 0x80000000>;
+ ranges = <0x43000000 0x9 0x00000000 0x9 0x00000000 0x0 0xe0000000>,
+ <0x82000000 0x0 0xe0000000 0x9 0xe0000000 0x0 0x10000000>,
+ <0x81000000 0x0 0x00000000 0x9 0xf0000000 0x0 0x00100000>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
--
2.34.1
^ permalink raw reply related
* [PATCH v1 2/2] arm64: dts: imx943: Correct PCIe outbound address space configuration
From: hongxing.zhu @ 2026-06-04 2:38 UTC (permalink / raw)
To: sherry.sun, robh, krzk+dt, conor+dt, frank.li, s.hauer, festevam
Cc: kernel, devicetree, imx, linux-arm-kernel, linux-kernel,
Richard Zhu
In-Reply-To: <20260604023821.134372-1-hongxing.zhu@oss.nxp.com>
From: Richard Zhu <hongxing.zhu@nxp.com>
Fix the PCIe outbound memory ranges for both pcie1 controllers on i.MX943.
The memory window size was incorrectly set to 256MB during initial
bring-up, but the hardware supports up to 4GB of outbound address space
per controller.
Additionally, the ECAM region cannot be mapped as I/O space. Use a
memory-mapped region for I/O space instead, and relocate the 1MB I/O
region to immediately follow the memory region at offset 0xf0000000
within each window.
Update the outbound address space layout per controller as follows:
- 3.5GB 64-bit prefetchable memory
- 256MB 32-bit non-prefetchable memory
- 1MB I/O
Fixes: fa6067fd8ea7 ("arm64: dts: imx943: Add pcie1 and pcie1-ep supports")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
---
arch/arm64/boot/dts/freescale/imx943.dtsi | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
Since the correction of i.MX95 PCIe had been landed. Add same changes
for i.MX943 PCIe1.
[1] https://lkml.org/lkml/2026/5/20/427
diff --git a/arch/arm64/boot/dts/freescale/imx943.dtsi b/arch/arm64/boot/dts/freescale/imx943.dtsi
index ed030d4bc7bd9..cf5b3dbb47ff7 100644
--- a/arch/arm64/boot/dts/freescale/imx943.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx943.dtsi
@@ -218,8 +218,9 @@ pcie1: pcie@4c380000 {
<0 0x4c3e0000 0 0x10000>,
<0 0x4c3c0000 0 0x4000>;
reg-names = "dbi", "config", "atu", "app";
- ranges = <0x81000000 0 0x00000000 0x8 0x8ff00000 0 0x00100000>,
- <0x82000000 0 0x10000000 0xa 0x10000000 0 0x80000000>;
+ ranges = <0x43000000 0xa 0x00000000 0xa 0x00000000 0x0 0xe0000000>,
+ <0x82000000 0x0 0xe0000000 0xa 0xe0000000 0x0 0x10000000>,
+ <0x81000000 0x0 0x00000000 0xa 0xf0000000 0x0 0x00100000>;
#address-cells = <3>;
#size-cells = <2>;
device_type = "pci";
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v3 4/5] phy: fsl-imx8mq-usb: add control register regmap
From: Xu Yang @ 2026-06-04 2:34 UTC (permalink / raw)
To: Bough Chen
Cc: Vinod Koul, Neil Armstrong, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Jun Li, linux-phy, imx,
linux-arm-kernel, linux-kernel, Xu Yang
In-Reply-To: <20260603072107.xhrzxrgbrb7q6fhe@nxp.com>
On Wed, Jun 03, 2026 at 03:21:07PM +0800, Bough Chen wrote:
> On Wed, Jun 03, 2026 at 01:37:17PM +0800, Xu Yang wrote:
> > From: Xu Yang <xu.yang_2@nxp.com>
> >
> > The CR port is a simple 16-bit data/address parallel port that is
> > provided for on-chip access to the control registers inside the
> > USB 3.0 femtoPHY. Add control register regmap and export these
> > registers by debugfs to help PHY's diagnostic.
> >
> > Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> >
> > ---
> > Changes in v3:
> > - drop Frank's tag because it includes other changes
> > - new patch
> > ---
> > drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 27 ++++++++++++++++++++++++++-
> > 1 file changed, 26 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > index b0092c34416e..cda88ea1f12d 100644
> > --- a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > +++ b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
> > @@ -1,5 +1,5 @@
> > // SPDX-License-Identifier: GPL-2.0+
> > -/* Copyright (c) 2017 NXP. */
> > +/* Copyright 2017-2026 NXP. */
>
> Should be : Copyright 2017, 2026 NXP.
The Copyright hasn't been updated in a long time. So I want to extend the
period here.
>
> >
> > #include <linux/bitfield.h>
> > #include <linux/clk.h>
> > @@ -11,6 +11,7 @@
> > #include <linux/platform_device.h>
> > #include <linux/pm_runtime.h>
> > #include <linux/regulator/consumer.h>
> > +#include <linux/regmap.h>
> > #include <linux/usb/typec_mux.h>
> >
> > #define PHY_CTRL0 0x0
> > @@ -56,6 +57,8 @@
> > #define PHY_CTRL6_ALT_CLK_EN BIT(1)
> > #define PHY_CTRL6_ALT_CLK_SEL BIT(0)
> >
> > +#define PHY_CRCTL 0x30
> > +
> > #define PHY_TUNE_DEFAULT 0xffffffff
> >
> > #define TCA_CLK_RST 0x00
> > @@ -119,6 +122,7 @@ struct imx8mq_usb_phy {
> > void __iomem *base;
> > struct regulator *vbus;
> > struct tca_blk *tca;
> > + struct regmap *cr_regmap;
> > u32 pcs_tx_swing_full;
> > u32 pcs_tx_deemph_3p5db;
> > u32 tx_vref_tune;
> > @@ -665,6 +669,14 @@ static const struct of_device_id imx8mq_usb_phy_of_match[] = {
> > };
> > MODULE_DEVICE_TABLE(of, imx8mq_usb_phy_of_match);
> >
> > +static const struct regmap_config imx_cr_regmap_config = {
> > + .name = "cr",
> > + .reg_bits = 32,
> > + .val_bits = 32,
> > + .reg_stride = 4,
> > + .max_register = 0x7,
> > +};
> > +
>
> Your commit message says: The CR port is a simple 16-bit data/address parallel port
> But here you use 32 bit mmio, which is a bit confuse to reader.
> Maybe you can add the following comment before the regmap config:
>
> /*
> * CR Port MMIO Register Map
> *
> * The CR (Control Register) port uses a 16-bit data/address protocol,
> * but is accessed through 32-bit MMIO registers:
> *
> * Offset 0x0: CR Control Register
> * [31:16] - Control/Status flags
> * [15:0] - 16-bit CR Address
> *
> * Offset 0x4: CR Data Register
> * [31:16] - Reserved/Status
> * [15:0] - 16-bit CR Data
> */
>
> Or change your commit log like this:
>
> The CR port is a 16-bit data/address parallel port protocol that is
> accessed through 32-bit MMIO registers for on-chip access to the
> control registers inside the USB 3.0 femtoPHY. Add control register
> regmap and export these registers by debugfs to help PHY's diagnostic.
OK. Thanks for the suggestion.
Thanks,
Xu Yang
^ permalink raw reply
* Re: [PATCH v3 01/32] iommu: introduce iova_to_phys_length in iommu_domain_ops
From: Baolu Lu @ 2026-06-04 2:44 UTC (permalink / raw)
To: Guanghui Feng, jgg
Cc: adrian.larumbe, airlied, alex, alikernel-developer,
boris.brezillon, dri-devel, dwmw2, iommu, joro, kevin.tian, kvm,
linux-arm-kernel, linux-kernel, liviu.dudau, maarten.lankhorst,
mripard, oliver.yang, robh, robin.murphy, shiyu.zsq, steven.price,
suravee.suthikulpanit, tzimmermann, wei.guo.simon, will, xlpang
In-Reply-To: <20260603151804.1963871-2-guanghuifeng@linux.alibaba.com>
On 6/3/26 23:17, Guanghui Feng wrote:
> Add iova_to_phys_length callback to struct iommu_domain_ops alongside
> the existing iova_to_phys. The new callback returns both the physical
> address and the PTE mapping page size in a single page table walk.
>
> Add iommu_iova_to_phys_length() core function that:
> - Checks ops->iova_to_phys_length first (preferred path)
> - Falls back to ops->iova_to_phys for unmigrated drivers
>
> This enables callers like VFIO to efficiently traverse IOVA space
> by actual mapping granularity instead of fixed PAGE_SIZE steps.
>
> Signed-off-by: Guanghui Feng<guanghuifeng@linux.alibaba.com>
> Acked-by: Shiqiang Zhang<shiyu.zsq@linux.alibaba.com>
> Acked-by: Simon Guo<wei.guo.simon@linux.alibaba.com>
> ---
> drivers/iommu/iommu.c | 50 ++++++++++++++++++++++++++++++++++++++-----
> include/linux/iommu.h | 9 ++++++++
> 2 files changed, 54 insertions(+), 5 deletions(-)
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
^ permalink raw reply
* Re: [PATCH v10 0/4] Add support for Orange Pi 5 Pro
From: Dennis Gilmore @ 2026-06-04 2:49 UTC (permalink / raw)
To: Heiko Stuebner
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Jonas Karlman,
Alexey Charkov, Quentin Schulz, FUKAUMI Naoki, Peter Robinson,
devicetree, linux-rockchip, linux-arm-kernel, linux-kernel
In-Reply-To: <20260511025352.106126-1-dennis@ausil.us>
Hi,
Just checking if anything else is needed.
Dennis
On Sun, May 10, 2026 at 9:53 PM Dennis Gilmore <dennis@ausil.us> wrote:
>
> This series adds initial support for the Xunlong Orange Pi 5 Pro, based on
> the Rockchip RK3588S SoC. The board features eMMC, SD card, NVMe (PCIe),
> a Motorcomm YT6801 NIC (PCIe), WiFi/BT (BCM43456), HDMI connected to SoC
> (Second port is disabled in this patch), and a 40-pin expansion header.
>
> The series was tested against Linux 7.0
>
> Please take a look.
>
> Thank you,
>
> Dennis Gilmore
>
> Changes in v10:
> - rename rk806_single to rk806
> - link to v9: https://lore.kernel.org/linux-devicetree/20260429024737.544813-5-dennis@ausil.us/
>
> Changes in v9:
> - removed support for the dp-to-HDMI bridge, will send in a second patch
> set to enable discusion to finish on how to handle its two operating
> modes
> - link to v8: https://lore.kernel.org/linux-devicetree/20260425031011.2529364-1-dennis@ausil.us/
>
> Changes in v8:
> - Bridge node: renamed label from lt8711uxd to hdmi-bridge
> - Bridge node: added vdd-supply = <&vcc3v3_dp>. The vcc3v3_dp regulator
> gates power to the LT8711UXD. regulator-always-on is kept because
> drm_simple_bridge only enables vdd-supply with HPD which does not
> happen without power on
> - GPIO output pinctrl groups (bt_wake_gpio, dp_bridge_en, ethernet_en,
> vcc5v0_otg_en, wifi_enable_h) changed from pcfg_pull_none to
> pcfg_pull_down to match the RK3588S power-on-reset default state
> - pcie2x1l1 (NVMe): switched from GPIO-mode reset to hardware sideband pins
> using pinctrl-0 = <&pcie30x1m1_1_perstn>, <&pcie30x1m1_1_clkreqn>,
> <&pcie30x1m1_1_waken>. Note: despite the "pcie30" prefix in the DTSI
> group names, the SoC pin-mux table confirms these alt-function 4 pads
> physically route to pcie2x1l1's native PERST#/CLKREQ#/WAKE# inputs.
> reset-gpios is retained alongside the pinctrl entry for U-Boot
> compatibility (pcie_dw_rockchip in U-Boot requires reset-gpios).
> - pcie2x1l2 (NIC): added &pcie20x1m0_clkreqn and &pcie20x1m0_waken to
> pinctrl-0
> - Renamed pinctrl group vcc3v3_phy1_en to ethernet_en to match the
> schematic signal name (Ethernet_EN)
> - link to v7: https://lore.kernel.org/linux-devicetree/20260414214104.1363987-1-dennis@ausil.us/
>
> Changes in v7:
> - Fix up whitespace issues identified by checkpatch.pl --strict in
> rk3588s-orangepi-5-5b.dtsi
> - checkpatch gave a warning for WARNING: phy-mode "rgmii-rxid" without
> comment, as this was moved over I left it untouched
> - Added lontium,lt8711uxd to the compatible enum in the simple-bridge
> binding
> - Added lontium,lt8711uxd match entry with DRM_MODE_CONNECTOR_HDMIA to
> the simple-bridge driver
> - New patch to rename the regulator labels for the es8388 supplies to
> match the schematics and they all use vcca_*
> - Fixed ES8388 PVDD-supply — vcca_3v3_s0 → vcca_1v8_s0, 5 Pro is
> different to 5 and 5b.
> - analog-sound: use CPU-as-clock-master on the Pro. The ES8388 is wired to
> i2s2_2ch (the only I2S block physically routed to the codec pins on this
> board), which uses the legacy rockchip_i2s driver. That driver's
> slave-mode trigger path hangs for 200 µs polling I2S_CLR and bails with
> -ETIMEDOUT ("lrclk update failed"). The TDM-capable i2s0/i2s1/i2s5
> blocks served by rockchip_i2s_tdm don't have this issue, which is why
> other mainline ES8388 boards get away with bitclock-master = masterdai.
> Drop bitclock-master/frame-master and the masterdai label to let the I2S
> block generate BCLK/LRCK itself
> - Removed regulator-always-on/regulator-boot-on from vcc3v3_dp
> - Added pinctrl entries for all GPIO pins (dp_bridge_en, vcc3v3_phy1_en,
> wifi_enable_h, pcie2x1l1_rst, pcie2x1l2_rst)
> - DP bridge rework — replaced dp-connector node with proper chain:
> - lt8711uxd bridge node (compatible lontium,lt8711uxd, with port@0/port@1
> endpoints). Bridge power is gated by the vcc3v3_dp regulator, whose
> enable GPIO (GPIO3_PC2) is driven via the dp_bridge_en pinctrl group;
> no enable-gpios/vdd-supply on the bridge node itself.
> - hdmi1-con connector node (compatible hdmi-connector, type a)
> - dp0_out endpoint now points to bridge input instead of old connector
> - remove accidentally included unnecessary changes
> - link to v6: https://lore.kernel.org/linux-devicetree/20260411024743.195385-1-dennis@ausil.us/
>
> Changes in v6:
> - Move the shared configs for the Orange Pi 5 and Orange Pi 5b from each
> devices dts to a shared rk3588s-orangepi-5-5b.dtsi to avoid duplication
> - Remove empty ports subnodeis from typea_con
> - Move i2s2m1_mclk pinctrl from &i2s2 to the es8388 codec node
> - Add dp-con, dp0_out, dp0_in, and vp1 nodes, plus the vcc3v3_dp regulator
> in order to get the second HDMI port working via its transparent
> LT8711UXD DP to HDMI bridge
> - link to v5: https://lore.kernel.org/linux-devicetree/20260401010707.2584962-1-dennis@ausil.us/
>
> Changes in v5:
> - define a connector node for Type-A port, and list the regulator as its VBUS supply explicitly.
> - Requires https://lore.kernel.org/all/20260217-typea-vbus-v1-1-657b4e55a4c2@flipper.net/
> - link to v4: https://lore.kernel.org/linux-devicetree/20260310031002.3921234-1-dennis@ausil.us/
>
> Changes in v4:
> - rename vcc3v3_pcie20 copied from rk3588s-orangepi-5.dts to vcc3v3_phy1 to match the schematic
> - use vcc_3v3_s3 as the supply not vcc5v0_sys for PCIe
> - remove the definition for vcc3v3_pcie_m2 as it does not really exist
> as a regulator
> - link to v3: https://lore.kernel.org/linux-devicetree/20260306024634.239614-1-dennis@ausil.us/
>
> Changes in v3:
> - moved leds from gpio-leds to pwm-leds
> - remove disable-wp from sdio
> - rename vcc3v3_pcie_eth regulator to vcc3v3_pcie_m2 to reflect the
> purpose
> - actually clean up the delete lines and comments missed in v2
> - link to v2: https://lore.kernel.org/linux-devicetree/20260304025521.210377-1-dennis@ausil.us/
>
> Changes in v2:
> - moved items not shared by orangepi 5/5b/5 Pro from dtsi to 5 and 5b
> dts files
> - removed all the comments and deleted properties from 5 Pro dts
> - link to v1: https://lore.kernel.org/linux-devicetree/20260228205418.2944620-1-dennis@ausil.us/
>
> Dennis Gilmore (4):
> dt-bindings: arm: rockchip: Add Orange Pi 5 Pro
> arm64: dts: rockchip: rk3588s-orangepi-5: rename PLDO regulator labels
> to match schematic
> arm64: dts: rockchip: refactor items from Orange Pi 5/b to prep for
> Pro
> arm64: dts: rockchip: Add Orange Pi 5 Pro board support
>
> .../devicetree/bindings/arm/rockchip.yaml | 1 +
> arch/arm64/boot/dts/rockchip/Makefile | 1 +
> .../dts/rockchip/rk3588s-orangepi-5-5b.dtsi | 256 +++++++++++++
> .../dts/rockchip/rk3588s-orangepi-5-pro.dts | 358 ++++++++++++++++++
> .../boot/dts/rockchip/rk3588s-orangepi-5.dts | 6 +-
> .../boot/dts/rockchip/rk3588s-orangepi-5.dtsi | 263 +------------
> .../boot/dts/rockchip/rk3588s-orangepi-5b.dts | 2 +-
> 7 files changed, 637 insertions(+), 250 deletions(-)
> create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5-5b.dtsi
> create mode 100644 arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5-pro.dts
>
> --
> 2.54.0
>
^ permalink raw reply
* [PATCH] clk: mvebu: ap-cpu: fix missing clk_put() in ap_cpu_clock_probe()
From: Wentao Liang @ 2026-06-04 2:51 UTC (permalink / raw)
To: andrew, gregory.clement, sebastian.hesselbarth, mturquette, sboyd
Cc: bmasney, linux-arm-kernel, linux-clk, linux-kernel, Wentao Liang,
stable
The function ap_cpu_clock_probe() calls of_clk_get() to obtain a
reference to the parent clock for each CPU cluster, but it never
releases it with clk_put(). The returned clk is used only to read
the parent's name via __clk_get_name(), and the reference is leaked
on every successful cluster initialization as well as on the error
path when devm_clk_hw_register() fails.
Add the missing clk_put() after the name has been extracted and
before returning on error to fix the leak.
Fixes: af9617b419f7 ("clk: mvebu: ap-cpu-clk: Fix a memory leak in error handling paths")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/clk/mvebu/ap-cpu-clk.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clk/mvebu/ap-cpu-clk.c b/drivers/clk/mvebu/ap-cpu-clk.c
index 1e44ace7d951..a8175908e353 100644
--- a/drivers/clk/mvebu/ap-cpu-clk.c
+++ b/drivers/clk/mvebu/ap-cpu-clk.c
@@ -328,9 +328,11 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
ret = devm_clk_hw_register(dev, &ap_cpu_clk[cluster_index].hw);
if (ret) {
of_node_put(dn);
+ clk_put(parent);
return ret;
}
ap_cpu_data->hws[cluster_index] = &ap_cpu_clk[cluster_index].hw;
+ clk_put(parent);
}
ap_cpu_data->num = cluster_index + 1;
--
2.34.1
^ permalink raw reply related
* Re: [PATCH v2] clk: keystone: don't cache clock rate
From: Nishanth Menon @ 2026-06-04 2:59 UTC (permalink / raw)
To: Tero Kristo, Santosh Shilimkar, Michael Turquette, Stephen Boyd,
Brian Masney, a-christidis
Cc: Nishanth Menon, linux-arm-kernel, linux-kernel, linux-clk,
Michael Walle, Kevin Hilman, Randolph Sapp
In-Reply-To: <20260507-clk-sci-v2-1-38f59b48777a@ti.com>
Hi a-christidis@ti.com,
On Thu, 07 May 2026 11:09:34 -0500, a-christidis@ti.com wrote:
> The TISCI firmware will return 0 if the clock or consumer is not
> enabled although there is a stored value in the firmware. IOW a call to
> set rate will work but at get rate will always return 0 if the clock is
> disabled.
> The clk framework will try to cache the clock rate when it's requested
> by a consumer. If the clock or consumer is not enabled at that point,
> the cached value is 0, which is wrong. Thus, disable the cache
> altogether.
>
> [...]
I have applied the following to branch ti-k3-sci-clk-next on [1].
Thank you!
[1/1] clk: keystone: don't cache clock rate
commit: a80b32a140c8612bbaed27009c383d43304db6d5
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
^ permalink raw reply
* Re: [PATCH V2] clk: keystone: sci-clk: fix application of sizeof to pointer
From: Nishanth Menon @ 2026-06-04 2:59 UTC (permalink / raw)
To: Brian Masney, Stephen Boyd, Michael Turquette, Nishanth Menon
Cc: Santosh Shilimkar, Tero Kristo, linux-clk, linux-kernel,
linux-arm-kernel, afd, sozdayvek, Jing Yangyang, Zeal Robot,
kernel test robot, Julia Lawall, David Yang
In-Reply-To: <20260512110028.2999471-1-nm@ti.com>
Hi Nishanth Menon,
On Tue, 12 May 2026 06:00:28 -0500, Nishanth Menon wrote:
> Coccinelle (scripts/coccinelle/misc/noderef.cocci) reports:
>
> drivers/clk/keystone/sci-clk.c:391:8-14: ERROR: application of
> sizeof to pointer
>
> In sci_clk_get(), 'clk' is declared as 'struct sci_clk **', so
> sizeof(clk) is sizeof(struct sci_clk **) which is the size of a
> pointer rather than the size of an array element. provider->clocks
> is an array of 'struct sci_clk *', so the canonical size argument
> to bsearch() is sizeof(*clk) (i.e. sizeof(struct sci_clk *)).
>
> [...]
I have applied the following to branch ti-k3-sci-clk-next on [1].
Thank you!
[1/1] clk: keystone: sci-clk: fix application of sizeof to pointer
commit: 2b0123e4a9257fa2933d13d1bca9ac36467efac1
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
^ permalink raw reply
* [GIT PULL] clk: ti: sci: TI updates for v7.2
From: Nishanth Menon @ 2026-06-04 3:09 UTC (permalink / raw)
To: Stephen Boyd, Michael Turquette
Cc: linux-clk, linux-arm-kernel, linux-kernel, Vignesh Raghavendra,
Nishanth Menon, Tero Kristo, Tony Lindgren, Santosh Shilimkar
[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]
Hi Stephen, Mike,
We have a couple of minor patches lying around for some time that
was'nt getting in, so took advice Brian made.. Here is the PR.
I have cross checked this on top of next-20260602, applies clean,
passes the build static checks and functions on all the TI K3
platforms I have access to. Thanks in advance for pulling..
Please Pull:
The following changes since commit 254f49634ee16a731174d2ae34bc50bd5f45e731:
Linux 7.1-rc1 (2026-04-26 14:19:00 -0700)
are available in the Git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git tags/ti-k3-sci-clk-for-v7.2
for you to fetch changes up to 2b0123e4a9257fa2933d13d1bca9ac36467efac1:
clk: keystone: sci-clk: fix application of sizeof to pointer (2026-06-03 21:46:01 -0500)
----------------------------------------------------------------
TI K3 SCI clock updates for v7.2
- Fix incorrect application of sizeof to a pointer type in sci-clk driver
- Disable clock rate caching in the keystone clock driver to ensure
accurate rate reporting
----------------------------------------------------------------
Jing Yangyang (1):
clk: keystone: sci-clk: fix application of sizeof to pointer
Michael Walle (1):
clk: keystone: don't cache clock rate
drivers/clk/keystone/sci-clk.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* [PATCH] KVM/arm64: vgic-its: Fix memory leak when vgic_its_set_abi() fails
From: Jackie Liu @ 2026-06-04 3:14 UTC (permalink / raw)
To: maz, linux-arm-kernel; +Cc: oupton, yuzenghui, will, kvmarm
From: Jackie Liu <liuyun01@kylinos.cn>
In vgic_its_create(), if vgic_its_set_abi() fails after allocating the
its structure and setting kvm state, the allocated 'its' is leaked
because the function returns without freeing it.
Fix by rolling back the kvm state flags and freeing the its structure
when vgic_its_set_abi() returns an error.
Fixes: 71afe470e20d ("KVM: arm64: vgic-its: Introduce migration ABI infrastructure")
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
---
arch/arm64/kvm/vgic/vgic-its.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/arch/arm64/kvm/vgic/vgic-its.c b/arch/arm64/kvm/vgic/vgic-its.c
index 1d7e5d560af4..83718eab4e06 100644
--- a/arch/arm64/kvm/vgic/vgic-its.c
+++ b/arch/arm64/kvm/vgic/vgic-its.c
@@ -1878,8 +1878,6 @@ static int vgic_its_create(struct kvm_device *dev, u32 type)
INIT_LIST_HEAD(&its->collection_list);
xa_init(&its->translation_cache);
- dev->kvm->arch.vgic.msis_require_devid = true;
- dev->kvm->arch.vgic.has_its = true;
its->enabled = false;
its->dev = dev;
@@ -1887,15 +1885,21 @@ static int vgic_its_create(struct kvm_device *dev, u32 type)
((u64)GITS_BASER_TYPE_DEVICE << GITS_BASER_TYPE_SHIFT);
its->baser_coll_table = INITIAL_BASER_VALUE |
((u64)GITS_BASER_TYPE_COLLECTION << GITS_BASER_TYPE_SHIFT);
- dev->kvm->arch.vgic.propbaser = INITIAL_PROPBASER_VALUE;
-
- dev->private = its;
ret = vgic_its_set_abi(its, NR_ITS_ABIS - 1);
+ if (ret) {
+ mutex_unlock(&dev->kvm->arch.config_lock);
+ kfree(its);
+ return ret;
+ }
- mutex_unlock(&dev->kvm->arch.config_lock);
+ dev->kvm->arch.vgic.msis_require_devid = true;
+ dev->kvm->arch.vgic.has_its = true;
+ dev->kvm->arch.vgic.propbaser = INITIAL_PROPBASER_VALUE;
+ dev->private = its;
- return ret;
+ mutex_unlock(&dev->kvm->arch.config_lock);
+ return 0;
}
static void vgic_its_destroy(struct kvm_device *kvm_dev)
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] clk: mvebu: ap-cpu: fix missing clk_put() in ap_cpu_clock_probe()
From: Andrew Lunn @ 2026-06-04 3:21 UTC (permalink / raw)
To: Wentao Liang
Cc: gregory.clement, sebastian.hesselbarth, mturquette, sboyd,
bmasney, linux-arm-kernel, linux-clk, linux-kernel, stable
In-Reply-To: <20260604025115.3763823-1-vulab@iscas.ac.cn>
On Thu, Jun 04, 2026 at 02:51:15AM +0000, Wentao Liang wrote:
> The function ap_cpu_clock_probe() calls of_clk_get() to obtain a
> reference to the parent clock for each CPU cluster, but it never
> releases it with clk_put(). The returned clk is used only to read
> the parent's name via __clk_get_name(), and the reference is leaked
> on every successful cluster initialization as well as on the error
> path when devm_clk_hw_register() fails.
Is there potentially a different interpretation?
If the parent clock was to disappear, the clocks to the CPU would
disappear, resulting in a dead system. By keeping a reference on the
parent, it cannot disappear?
Also, do we care that much about the error case? If we fail to setup
the CPU clock, how much longer is the CPU going to run before it dies
a horrible death?
> Add the missing clk_put() after the name has been extracted and
> before returning on error to fix the leak.
>
> Fixes: af9617b419f7 ("clk: mvebu: ap-cpu-clk: Fix a memory leak in error handling paths")
> Cc: stable@vger.kernel.org
Does this actually bother people? It needs to in order to be sent to
stable:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Andrew
^ permalink raw reply
* Re: [PATCH v3 05/32] iommu/generic_pt: implement iova_to_phys_length
From: Baolu Lu @ 2026-06-04 3:30 UTC (permalink / raw)
To: Guanghui Feng, jgg
Cc: adrian.larumbe, airlied, alex, alikernel-developer,
boris.brezillon, dri-devel, dwmw2, iommu, joro, kevin.tian, kvm,
linux-arm-kernel, linux-kernel, liviu.dudau, maarten.lankhorst,
mripard, oliver.yang, robh, robin.murphy, shiyu.zsq, steven.price,
suravee.suthikulpanit, tzimmermann, wei.guo.simon, will, xlpang
In-Reply-To: <20260603151804.1963871-6-guanghuifeng@linux.alibaba.com>
On 6/3/26 23:17, Guanghui Feng wrote:
> Extend the Generic Page Table framework to implement iova_to_phys_length.
> Use pt_entry_oa_lg2sz() to determine PTE block size. Update
> IOMMU_PT_DOMAIN_OPS macro to set .iova_to_phys_length.
>
> Signed-off-by: Guanghui Feng <guanghuifeng@linux.alibaba.com>
> Acked-by: Shiqiang Zhang <shiyu.zsq@linux.alibaba.com>
> Acked-by: Simon Guo <wei.guo.simon@linux.alibaba.com>
> ---
> drivers/iommu/generic_pt/iommu_pt.h | 84 +++++++++++++++++++++--------
> include/linux/generic_pt/iommu.h | 13 ++---
> 2 files changed, 69 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/iommu/generic_pt/iommu_pt.h b/drivers/iommu/generic_pt/iommu_pt.h
> index dc91fb4e2f61..e362e819ef9c 100644
> --- a/drivers/iommu/generic_pt/iommu_pt.h
> +++ b/drivers/iommu/generic_pt/iommu_pt.h
> @@ -145,13 +145,21 @@ static inline unsigned int compute_best_pgsize(struct pt_state *pts,
> pts->range->va, pts->range->last_va, oa);
> }
>
> -static __always_inline int __do_iova_to_phys(struct pt_range *range, void *arg,
> - unsigned int level,
> - struct pt_table_p *table,
> - pt_level_fn_t descend_fn)
> +struct iova_to_phys_length_data {
> + pt_oaddr_t phys;
> + size_t length;
> +};
> +
> +static __always_inline int __do_iova_to_phys_length(struct pt_range *range,
> + void *arg, unsigned int level,
> + struct pt_table_p *table,
> + pt_level_fn_t descend_fn)
> {
> struct pt_state pts = pt_init(range, level, table);
> - pt_oaddr_t *res = arg;
> + struct iova_to_phys_length_data *data = arg;
> + unsigned int entry_lg2sz;
> + size_t entry_sz;
> + pt_oaddr_t expected_oa;
>
> switch (pt_load_single_entry(&pts)) {
> case PT_ENTRY_EMPTY:
> @@ -159,45 +167,77 @@ static __always_inline int __do_iova_to_phys(struct pt_range *range, void *arg,
> case PT_ENTRY_TABLE:
> return pt_descend(&pts, arg, descend_fn);
> case PT_ENTRY_OA:
> - *res = pt_entry_oa_exact(&pts);
> - return 0;
> + break;
> }
> - return -ENOENT;
> +
> + data->phys = pt_entry_oa_exact(&pts);
> + entry_lg2sz = pt_entry_oa_lg2sz(&pts);
> + entry_sz = log2_to_int(entry_lg2sz);
> +
> + /* Start with the full mapping size of the first entry */
> + data->length = entry_sz;
data->length doesn't account for iova offset. Is this by design? We
should document this clearly somewhere.
Sashiko reported the same issue too.
[Severity: High]
Does this calculation overstate the mapped length for unaligned IOVAs?
If the IOVA is not aligned to the PTE block size, pt_entry_oa_exact()
includes the intra-page offset in data->phys. However, data->length
is unconditionally initialized to the full entry_sz rather than
entry_sz - offset. Callers relying on mapped_length might operate
on out-of-bounds memory because data->phys + data->length extends
beyond the valid mapped physical memory by the unaligned offset amount.
> +
> + /* Accumulate subsequent physically contiguous entries */
> + expected_oa = pt_entry_oa(&pts) + entry_sz;
> + pts.end_index = log2_to_int(pt_num_items_lg2(&pts));
> + pt_next_entry(&pts);
> +
> + while (pts.index < pts.end_index) {
> + pt_load_entry(&pts);
> + if (pts.type != PT_ENTRY_OA)
> + break;
> + if (pt_entry_oa_lg2sz(&pts) != entry_lg2sz)
> + break;
> + if (pt_entry_oa(&pts) != expected_oa)
> + break;
> + data->length += entry_sz;
> + expected_oa += entry_sz;
> + pt_next_entry(&pts);
> + }
> +
> + return 0;
> }
> -PT_MAKE_LEVELS(__iova_to_phys, __do_iova_to_phys);
> +PT_MAKE_LEVELS(__iova_to_phys_length, __do_iova_to_phys_length);
>
> /**
> - * iova_to_phys() - Return the output address for the given IOVA
> + * iova_to_phys_length() - Translate IOVA returning phys and contiguous length
> * @domain: Table to query
> * @iova: IO virtual address to query
> + * @mapped_length: Output for the total contiguous mapped length in bytes
> *
> - * Determine the output address from the given IOVA. @iova may have any
> - * alignment, the returned physical will be adjusted with any sub page offset.
> + * Walk the IOMMU page table to translate @iova to a physical address while
> + * also returning the total contiguous physically mapped length through
> + * @mapped_length. The function accumulates consecutive page table entries that
> + * are physically contiguous, so callers can determine the full contiguous
> + * mapping extent with a single call.
> *
> * Context: The caller must hold a read range lock that includes @iova.
> *
> - * Return: 0 if there is no translation for the given iova.
> + * Return: The physical address, or PHYS_ADDR_MAX if there is no translation.
> */
> -phys_addr_t DOMAIN_NS(iova_to_phys)(struct iommu_domain *domain,
> - dma_addr_t iova)
> +phys_addr_t DOMAIN_NS(iova_to_phys_length)(struct iommu_domain *domain,
> + dma_addr_t iova,
> + size_t *mapped_length)
> {
> struct pt_iommu *iommu_table =
> container_of(domain, struct pt_iommu, domain);
> struct pt_range range;
> - pt_oaddr_t res;
> + struct iova_to_phys_length_data data;
> int ret;
>
> ret = make_range(common_from_iommu(iommu_table), &range, iova, 1);
> if (ret)
> - return ret;
> + return PHYS_ADDR_MAX;
>
> - ret = pt_walk_range(&range, __iova_to_phys, &res);
> - /* PHYS_ADDR_MAX would be a better error code */
> + ret = pt_walk_range(&range, __iova_to_phys_length, &data);
> if (ret)
> - return 0;
> - return res;
> + return PHYS_ADDR_MAX;
> +
> + if (mapped_length)
> + *mapped_length = data.length;
> + return data.phys;
> }
> -EXPORT_SYMBOL_NS_GPL(DOMAIN_NS(iova_to_phys), "GENERIC_PT_IOMMU");
> +EXPORT_SYMBOL_NS_GPL(DOMAIN_NS(iova_to_phys_length), "GENERIC_PT_IOMMU");
>
> struct pt_iommu_dirty_args {
> struct iommu_dirty_bitmap *dirty;
> diff --git a/include/linux/generic_pt/iommu.h b/include/linux/generic_pt/iommu.h
> index dd0edd02a48a..859b853e9dc7 100644
> --- a/include/linux/generic_pt/iommu.h
> +++ b/include/linux/generic_pt/iommu.h
> @@ -249,8 +249,9 @@ struct pt_iommu_cfg {
>
> /* Generate the exported function signatures from iommu_pt.h */
> #define IOMMU_PROTOTYPES(fmt) \
> - phys_addr_t pt_iommu_##fmt##_iova_to_phys(struct iommu_domain *domain, \
> - dma_addr_t iova); \
> + phys_addr_t pt_iommu_##fmt##_iova_to_phys_length( \
> + struct iommu_domain *domain, dma_addr_t iova, \
> + size_t *mapped_length); \
> int pt_iommu_##fmt##_read_and_clear_dirty( \
> struct iommu_domain *domain, unsigned long iova, size_t size, \
> unsigned long flags, struct iommu_dirty_bitmap *dirty); \
> @@ -267,11 +268,11 @@ struct pt_iommu_cfg {
> IOMMU_PROTOTYPES(fmt)
>
> /*
> - * A driver uses IOMMU_PT_DOMAIN_OPS to populate the iommu_domain_ops for the
> - * iommu_pt
> + * A driver uses IOMMU_PT_DOMAIN_OPS to populate the iommu_domain_ops for
> + * the iommu_pt
> */
> -#define IOMMU_PT_DOMAIN_OPS(fmt) \
> - .iova_to_phys = &pt_iommu_##fmt##_iova_to_phys
> +#define IOMMU_PT_DOMAIN_OPS(fmt) \
> + .iova_to_phys_length = &pt_iommu_##fmt##_iova_to_phys_length
> #define IOMMU_PT_DIRTY_OPS(fmt) \
> .read_and_clear_dirty = &pt_iommu_##fmt##_read_and_clear_dirty
>
Thanks,
baolu
^ permalink raw reply
* Re: [PATCH 0/2] HiSilicon TRNG fix and simplification
From: liulongfang @ 2026-06-04 3:32 UTC (permalink / raw)
To: Eric Biggers, linux-crypto, Herbert Xu
Cc: Olivia Mackall, Weili Qian, Wei Xu, linux-arm-kernel,
linux-kernel
In-Reply-To: <20260530202624.20768-1-ebiggers@kernel.org>
On 2026/5/31 4:26, Eric Biggers wrote:
> This series fixes and greatly simplifies the HiSilicon TRNG driver by
> removing the gratuitous crypto_rng interface, leaving just hwrng which
> is the one that actually matters.
>
> Note that this mirrors similar changes in other drivers such as qcom-rng
> (https://lore.kernel.org/r/20260530020332.143058-1-ebiggers@kernel.org)
>
> Eric Biggers (2):
> crypto: hisi-trng - Remove crypto_rng interface
> hwrng: hisi-trng - Move hisi-trng into drivers/char/hw_random/
>
> MAINTAINERS | 2 +-
> arch/arm64/configs/defconfig | 2 +-
> drivers/char/hw_random/Kconfig | 10 +
> drivers/char/hw_random/Makefile | 1 +
> drivers/char/hw_random/hisi-trng-v2.c | 98 +++++++
> drivers/crypto/hisilicon/Kconfig | 8 -
> drivers/crypto/hisilicon/Makefile | 1 -
> drivers/crypto/hisilicon/trng/Makefile | 2 -
> drivers/crypto/hisilicon/trng/trng.c | 390 -------------------------
> 9 files changed, 111 insertions(+), 403 deletions(-)
> create mode 100644 drivers/char/hw_random/hisi-trng-v2.c
> delete mode 100644 drivers/crypto/hisilicon/trng/Makefile
> delete mode 100644 drivers/crypto/hisilicon/trng/trng.c
>
>
> base-commit: 5624ea54f3ba5c83d2e5503411a31a8be0278c1e
> prerequisite-patch-id: 07e982b663ac3f8312ca524f6b91b5b38661df5e
> prerequisite-patch-id: 72064361a8f36e015ab0b7e1fa4d364b40d90506
> prerequisite-patch-id: 8978b8e0db7f47935e5f6f0aff14a97f55d3073c
> prerequisite-patch-id: 6aa0e3e93a008279d71e535a3d0cf48643f55e19
>
Acked-by: Longfang Liu <liulongfang@huawei.com>
Thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox