* 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
* RE: [PATCH v1] arm64: dts: imx94: Add Root Port node and PERST property
From: Sherry Sun @ 2026-06-04 3:32 UTC (permalink / raw)
To: Hongxing Zhu (OSS), robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Frank Li, s.hauer@pengutronix.de,
festevam@gmail.com
Cc: kernel@pengutronix.de, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Hongxing Zhu
In-Reply-To: <20260604022420.120294-1-hongxing.zhu@oss.nxp.com>
> Subject: [PATCH v1] arm64: dts: imx94: Add Root Port node and PERST
> property
>
> 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>;
Hi Richard,
This reset-gpio property should be deleted, for new i.MX, we can use the
reset-gpios under Root Port directly.
> 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>;
Same here.
Best Regards
Sherry
> 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
* [PATCH v2 0/3] ASoC: rockchip: Use guard() for spin locks
From: phucduc.bui @ 2026-06-04 3:35 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood
Cc: Nicolas Frattaroli, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-rockchip, linux-arm-kernel, linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Hi all,
This series converts spinlock handling in the Rockchip sound drivers
to use guard() helpers.
The changes are code cleanup only and should have no functional impact.
Changes in v2:
- Remove the unnecessary err_pm_put label in rockchip_sai_hw_params().
Compile tested only.
Best regards,
Phuc
bui duc phuc (3):
ASoC: rockchip: rockchip_i2s: Use guard() for spin locks
ASoC: rockchip: i2s-tdm: Use guard() for spin locks
ASoC: rockchip: rockchip_sai: Use guard() for spin locks
sound/soc/rockchip/rockchip_i2s.c | 160 ++++++++--------
sound/soc/rockchip/rockchip_i2s_tdm.c | 8 +-
sound/soc/rockchip/rockchip_sai.c | 262 +++++++++++++-------------
3 files changed, 211 insertions(+), 219 deletions(-)
--
2.43.0
^ permalink raw reply
* [PATCH v2 1/3] ASoC: rockchip: rockchip_i2s: Use guard() for spin locks
From: phucduc.bui @ 2026-06-04 3:35 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood
Cc: Nicolas Frattaroli, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-rockchip, linux-arm-kernel, linux-kernel, bui duc phuc
In-Reply-To: <20260604033554.96996-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only.
sound/soc/rockchip/rockchip_i2s.c | 160 +++++++++++++++---------------
1 file changed, 80 insertions(+), 80 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c
index 0a0a95b4f520..5a5087f4ae03 100644
--- a/sound/soc/rockchip/rockchip_i2s.c
+++ b/sound/soc/rockchip/rockchip_i2s.c
@@ -127,52 +127,52 @@ static int rockchip_snd_txctrl(struct rk_i2s_dev *i2s, int on)
unsigned int val = 0;
int ret = 0;
- spin_lock(&i2s->lock);
- if (on) {
- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
- I2S_DMACR_TDE_ENABLE,
- I2S_DMACR_TDE_ENABLE);
- if (ret < 0)
- goto end;
- ret = regmap_update_bits(i2s->regmap, I2S_XFER,
- I2S_XFER_TXS_START | I2S_XFER_RXS_START,
- I2S_XFER_TXS_START | I2S_XFER_RXS_START);
- if (ret < 0)
- goto end;
- i2s->tx_start = true;
- } else {
- i2s->tx_start = false;
-
- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
- I2S_DMACR_TDE_ENABLE,
- I2S_DMACR_TDE_DISABLE);
- if (ret < 0)
- goto end;
-
- if (!i2s->rx_start) {
+ scoped_guard(spinlock, &i2s->lock) {
+ if (on) {
+ ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
+ I2S_DMACR_TDE_ENABLE,
+ I2S_DMACR_TDE_ENABLE);
+ if (ret < 0)
+ break;
ret = regmap_update_bits(i2s->regmap, I2S_XFER,
I2S_XFER_TXS_START | I2S_XFER_RXS_START,
- I2S_XFER_TXS_STOP | I2S_XFER_RXS_STOP);
+ I2S_XFER_TXS_START | I2S_XFER_RXS_START);
if (ret < 0)
- goto end;
- udelay(150);
- ret = regmap_update_bits(i2s->regmap, I2S_CLR,
- I2S_CLR_TXC | I2S_CLR_RXC,
- I2S_CLR_TXC | I2S_CLR_RXC);
- if (ret < 0)
- goto end;
- ret = regmap_read_poll_timeout_atomic(i2s->regmap,
- I2S_CLR,
- val,
- val == 0,
- 20,
- 200);
+ break;
+ i2s->tx_start = true;
+ } else {
+ i2s->tx_start = false;
+
+ ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
+ I2S_DMACR_TDE_ENABLE,
+ I2S_DMACR_TDE_DISABLE);
if (ret < 0)
- dev_warn(i2s->dev, "fail to clear: %d\n", ret);
+ break;
+
+ if (!i2s->rx_start) {
+ ret = regmap_update_bits(i2s->regmap, I2S_XFER,
+ I2S_XFER_TXS_START | I2S_XFER_RXS_START,
+ I2S_XFER_TXS_STOP | I2S_XFER_RXS_STOP);
+ if (ret < 0)
+ break;
+ udelay(150);
+ ret = regmap_update_bits(i2s->regmap, I2S_CLR,
+ I2S_CLR_TXC | I2S_CLR_RXC,
+ I2S_CLR_TXC | I2S_CLR_RXC);
+ if (ret < 0)
+ break;
+ ret = regmap_read_poll_timeout_atomic(i2s->regmap,
+ I2S_CLR,
+ val,
+ val == 0,
+ 20,
+ 200);
+ if (ret < 0)
+ dev_warn(i2s->dev, "fail to clear: %d\n", ret);
+ }
}
}
-end:
- spin_unlock(&i2s->lock);
+
if (ret < 0)
dev_err(i2s->dev, "lrclk update failed\n");
@@ -184,53 +184,53 @@ static int rockchip_snd_rxctrl(struct rk_i2s_dev *i2s, int on)
unsigned int val = 0;
int ret = 0;
- spin_lock(&i2s->lock);
- if (on) {
- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
- I2S_DMACR_RDE_ENABLE,
- I2S_DMACR_RDE_ENABLE);
- if (ret < 0)
- goto end;
-
- ret = regmap_update_bits(i2s->regmap, I2S_XFER,
- I2S_XFER_TXS_START | I2S_XFER_RXS_START,
- I2S_XFER_TXS_START | I2S_XFER_RXS_START);
- if (ret < 0)
- goto end;
- i2s->rx_start = true;
- } else {
- i2s->rx_start = false;
-
- ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
- I2S_DMACR_RDE_ENABLE,
- I2S_DMACR_RDE_DISABLE);
- if (ret < 0)
- goto end;
+ scoped_guard(spinlock, &i2s->lock) {
+ if (on) {
+ ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
+ I2S_DMACR_RDE_ENABLE,
+ I2S_DMACR_RDE_ENABLE);
+ if (ret < 0)
+ break;
- if (!i2s->tx_start) {
ret = regmap_update_bits(i2s->regmap, I2S_XFER,
I2S_XFER_TXS_START | I2S_XFER_RXS_START,
- I2S_XFER_TXS_STOP | I2S_XFER_RXS_STOP);
+ I2S_XFER_TXS_START | I2S_XFER_RXS_START);
if (ret < 0)
- goto end;
- udelay(150);
- ret = regmap_update_bits(i2s->regmap, I2S_CLR,
- I2S_CLR_TXC | I2S_CLR_RXC,
- I2S_CLR_TXC | I2S_CLR_RXC);
- if (ret < 0)
- goto end;
- ret = regmap_read_poll_timeout_atomic(i2s->regmap,
- I2S_CLR,
- val,
- val == 0,
- 20,
- 200);
+ break;
+ i2s->rx_start = true;
+ } else {
+ i2s->rx_start = false;
+
+ ret = regmap_update_bits(i2s->regmap, I2S_DMACR,
+ I2S_DMACR_RDE_ENABLE,
+ I2S_DMACR_RDE_DISABLE);
if (ret < 0)
- dev_warn(i2s->dev, "fail to clear: %d\n", ret);
+ break;
+
+ if (!i2s->tx_start) {
+ ret = regmap_update_bits(i2s->regmap, I2S_XFER,
+ I2S_XFER_TXS_START | I2S_XFER_RXS_START,
+ I2S_XFER_TXS_STOP | I2S_XFER_RXS_STOP);
+ if (ret < 0)
+ break;
+ udelay(150);
+ ret = regmap_update_bits(i2s->regmap, I2S_CLR,
+ I2S_CLR_TXC | I2S_CLR_RXC,
+ I2S_CLR_TXC | I2S_CLR_RXC);
+ if (ret < 0)
+ break;
+ ret = regmap_read_poll_timeout_atomic(i2s->regmap,
+ I2S_CLR,
+ val,
+ val == 0,
+ 20,
+ 200);
+ if (ret < 0)
+ dev_warn(i2s->dev, "fail to clear: %d\n", ret);
+ }
}
}
-end:
- spin_unlock(&i2s->lock);
+
if (ret < 0)
dev_err(i2s->dev, "lrclk update failed\n");
--
2.43.0
^ permalink raw reply related
* [PATCH v2 2/3] ASoC: rockchip: i2s-tdm: Use guard() for spin locks
From: phucduc.bui @ 2026-06-04 3:35 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood
Cc: Nicolas Frattaroli, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-rockchip, linux-arm-kernel, linux-kernel, bui duc phuc
In-Reply-To: <20260604033554.96996-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only.
sound/soc/rockchip/rockchip_i2s_tdm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
index fc52149ed6ae..3f3db28b8940 100644
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
@@ -285,9 +285,8 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai, int on)
{
struct rk_i2s_tdm_dev *i2s_tdm = to_info(dai);
- unsigned long flags;
- spin_lock_irqsave(&i2s_tdm->lock, flags);
+ guard(spinlock_irqsave)(&i2s_tdm->lock);
if (on) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
rockchip_enable_tde(i2s_tdm->regmap);
@@ -313,7 +312,6 @@ static void rockchip_snd_txrxctrl(struct snd_pcm_substream *substream,
I2S_CLR_TXC | I2S_CLR_RXC);
}
}
- spin_unlock_irqrestore(&i2s_tdm->lock, flags);
}
static void rockchip_snd_txctrl(struct rk_i2s_tdm_dev *i2s_tdm, int on)
@@ -587,12 +585,11 @@ static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream,
unsigned int fmt)
{
struct rk_i2s_tdm_dev *i2s_tdm = to_info(dai);
- unsigned long flags;
if (!i2s_tdm->clk_trcm)
return 0;
- spin_lock_irqsave(&i2s_tdm->lock, flags);
+ guard(spinlock_irqsave)(&i2s_tdm->lock);
if (i2s_tdm->refcount)
rockchip_i2s_tdm_xfer_pause(substream, i2s_tdm);
@@ -614,7 +611,6 @@ static int rockchip_i2s_trcm_mode(struct snd_pcm_substream *substream,
if (i2s_tdm->refcount)
rockchip_i2s_tdm_xfer_resume(substream, i2s_tdm);
- spin_unlock_irqrestore(&i2s_tdm->lock, flags);
return 0;
}
--
2.43.0
^ permalink raw reply related
* [PATCH v2 3/3] ASoC: rockchip: rockchip_sai: Use guard() for spin locks
From: phucduc.bui @ 2026-06-04 3:35 UTC (permalink / raw)
To: Heiko Stuebner, Mark Brown, Liam Girdwood
Cc: Nicolas Frattaroli, Jaroslav Kysela, Takashi Iwai, linux-sound,
linux-rockchip, linux-arm-kernel, linux-kernel, bui duc phuc
In-Reply-To: <20260604033554.96996-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
NOTE: This patch is compile-tested only.
Changes in v2:
- Remove the unnecessary err_pm_put label in rockchip_sai_hw_params().
sound/soc/rockchip/rockchip_sai.c | 262 +++++++++++++++---------------
1 file changed, 129 insertions(+), 133 deletions(-)
diff --git a/sound/soc/rockchip/rockchip_sai.c b/sound/soc/rockchip/rockchip_sai.c
index ed393e5034a4..a195e96fed0a 100644
--- a/sound/soc/rockchip/rockchip_sai.c
+++ b/sound/soc/rockchip/rockchip_sai.c
@@ -18,7 +18,6 @@
#include <sound/pcm_params.h>
#include <sound/dmaengine_pcm.h>
#include <sound/tlv.h>
-
#include "rockchip_sai.h"
#define DRV_NAME "rockchip-sai"
@@ -216,14 +215,12 @@ static void rockchip_sai_xfer_clk_stop_and_wait(struct rk_sai_dev *sai, unsigned
static int rockchip_sai_runtime_suspend(struct device *dev)
{
struct rk_sai_dev *sai = dev_get_drvdata(dev);
- unsigned long flags;
rockchip_sai_fsync_lost_detect(sai, 0);
rockchip_sai_fsync_err_detect(sai, 0);
- spin_lock_irqsave(&sai->xfer_lock, flags);
- rockchip_sai_xfer_clk_stop_and_wait(sai, NULL);
- spin_unlock_irqrestore(&sai->xfer_lock, flags);
+ scoped_guard(spinlock_irqsave, &sai->xfer_lock)
+ rockchip_sai_xfer_clk_stop_and_wait(sai, NULL);
regcache_cache_only(sai->regmap, true);
/*
@@ -483,7 +480,6 @@ static int rockchip_sai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
struct rk_sai_dev *sai = snd_soc_dai_get_drvdata(dai);
unsigned int mask = 0, val = 0;
unsigned int clk_gates;
- unsigned long flags;
int ret = 0;
pm_runtime_get_sync(dai->dev);
@@ -499,56 +495,56 @@ static int rockchip_sai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
sai->is_master_mode = false;
break;
default:
- ret = -EINVAL;
- goto err_pm_put;
- }
-
- spin_lock_irqsave(&sai->xfer_lock, flags);
- rockchip_sai_xfer_clk_stop_and_wait(sai, &clk_gates);
- if (sai->initialized) {
- if (sai->has_capture && sai->has_playback)
- rockchip_sai_xfer_stop(sai, -1);
- else if (sai->has_capture)
- rockchip_sai_xfer_stop(sai, SNDRV_PCM_STREAM_CAPTURE);
- else
- rockchip_sai_xfer_stop(sai, SNDRV_PCM_STREAM_PLAYBACK);
- } else {
- rockchip_sai_clear(sai, 0);
- sai->initialized = true;
+ pm_runtime_put(dai->dev);
+ return -EINVAL;
}
- regmap_update_bits(sai->regmap, SAI_CKR, mask, val);
+ scoped_guard(spinlock_irqsave, &sai->xfer_lock) {
+ rockchip_sai_xfer_clk_stop_and_wait(sai, &clk_gates);
+ if (sai->initialized) {
+ if (sai->has_capture && sai->has_playback)
+ rockchip_sai_xfer_stop(sai, -1);
+ else if (sai->has_capture)
+ rockchip_sai_xfer_stop(sai, SNDRV_PCM_STREAM_CAPTURE);
+ else
+ rockchip_sai_xfer_stop(sai, SNDRV_PCM_STREAM_PLAYBACK);
+ } else {
+ rockchip_sai_clear(sai, 0);
+ sai->initialized = true;
+ }
- mask = SAI_CKR_CKP_MASK | SAI_CKR_FSP_MASK;
- switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
- case SND_SOC_DAIFMT_NB_NF:
- val = SAI_CKR_CKP_NORMAL | SAI_CKR_FSP_NORMAL;
- break;
- case SND_SOC_DAIFMT_NB_IF:
- val = SAI_CKR_CKP_NORMAL | SAI_CKR_FSP_INVERTED;
- break;
- case SND_SOC_DAIFMT_IB_NF:
- val = SAI_CKR_CKP_INVERTED | SAI_CKR_FSP_NORMAL;
- break;
- case SND_SOC_DAIFMT_IB_IF:
- val = SAI_CKR_CKP_INVERTED | SAI_CKR_FSP_INVERTED;
- break;
- default:
- ret = -EINVAL;
- goto err_xfer_unlock;
- }
+ regmap_update_bits(sai->regmap, SAI_CKR, mask, val);
+
+ mask = SAI_CKR_CKP_MASK | SAI_CKR_FSP_MASK;
+ switch (fmt & SND_SOC_DAIFMT_INV_MASK) {
+ case SND_SOC_DAIFMT_NB_NF:
+ val = SAI_CKR_CKP_NORMAL | SAI_CKR_FSP_NORMAL;
+ break;
+ case SND_SOC_DAIFMT_NB_IF:
+ val = SAI_CKR_CKP_NORMAL | SAI_CKR_FSP_INVERTED;
+ break;
+ case SND_SOC_DAIFMT_IB_NF:
+ val = SAI_CKR_CKP_INVERTED | SAI_CKR_FSP_NORMAL;
+ break;
+ case SND_SOC_DAIFMT_IB_IF:
+ val = SAI_CKR_CKP_INVERTED | SAI_CKR_FSP_INVERTED;
+ break;
+ default:
+ ret = -EINVAL;
+ break;
+ }
- regmap_update_bits(sai->regmap, SAI_CKR, mask, val);
+ if (ret == 0) {
+ regmap_update_bits(sai->regmap, SAI_CKR, mask, val);
+ rockchip_sai_fmt_create(sai, fmt);
+ }
- rockchip_sai_fmt_create(sai, fmt);
+ if (clk_gates)
+ regmap_update_bits(sai->regmap, SAI_XFER,
+ SAI_XFER_CLK_MASK | SAI_XFER_FSS_MASK,
+ clk_gates);
+ }
-err_xfer_unlock:
- if (clk_gates)
- regmap_update_bits(sai->regmap, SAI_XFER,
- SAI_XFER_CLK_MASK | SAI_XFER_FSS_MASK,
- clk_gates);
- spin_unlock_irqrestore(&sai->xfer_lock, flags);
-err_pm_put:
pm_runtime_put(dai->dev);
return ret;
@@ -564,7 +560,6 @@ static int rockchip_sai_hw_params(struct snd_pcm_substream *substream,
unsigned int ch_per_lane, slot_width;
unsigned int val, fscr, reg;
unsigned int lanes, req_lanes;
- unsigned long flags;
int ret = 0;
if (!rockchip_sai_stream_valid(substream, dai))
@@ -591,8 +586,8 @@ static int rockchip_sai_hw_params(struct snd_pcm_substream *substream,
dev_err(sai->dev, "not enough lanes (%d) for requested number of %s channels (%d)\n",
lanes, reg == SAI_TXCR ? "playback" : "capture",
params_channels(params));
- ret = -EINVAL;
- goto err_pm_put;
+ pm_runtime_put(sai->dev);
+ return -EINVAL;
} else {
lanes = req_lanes;
}
@@ -618,84 +613,88 @@ static int rockchip_sai_hw_params(struct snd_pcm_substream *substream,
val = SAI_XCR_VDW(32);
break;
default:
- ret = -EINVAL;
- goto err_pm_put;
+ pm_runtime_put(sai->dev);
+ return -EINVAL;
}
val |= SAI_XCR_CSR(lanes);
- spin_lock_irqsave(&sai->xfer_lock, flags);
-
- regmap_update_bits(sai->regmap, reg, SAI_XCR_VDW_MASK | SAI_XCR_CSR_MASK, val);
+ scoped_guard(spinlock_irqsave, &sai->xfer_lock) {
- if (!sai->is_tdm)
- regmap_update_bits(sai->regmap, reg, SAI_XCR_SBW_MASK,
- SAI_XCR_SBW(params_physical_width(params)));
+ regmap_update_bits(sai->regmap, reg, SAI_XCR_VDW_MASK | SAI_XCR_CSR_MASK, val);
- regmap_read(sai->regmap, reg, &val);
+ if (!sai->is_tdm)
+ regmap_update_bits(sai->regmap, reg, SAI_XCR_SBW_MASK,
+ SAI_XCR_SBW(params_physical_width(params)));
- slot_width = SAI_XCR_SBW_V(val);
- ch_per_lane = params_channels(params) / lanes;
+ regmap_read(sai->regmap, reg, &val);
- regmap_update_bits(sai->regmap, reg, SAI_XCR_SNB_MASK,
- SAI_XCR_SNB(ch_per_lane));
+ slot_width = SAI_XCR_SBW_V(val);
+ ch_per_lane = params_channels(params) / lanes;
- fscr = SAI_FSCR_FW(sai->fw_ratio * slot_width * ch_per_lane);
+ regmap_update_bits(sai->regmap, reg, SAI_XCR_SNB_MASK,
+ SAI_XCR_SNB(ch_per_lane));
- switch (sai->fpw) {
- case FPW_ONE_BCLK_WIDTH:
- fscr |= SAI_FSCR_FPW(1);
- break;
- case FPW_ONE_SLOT_WIDTH:
- fscr |= SAI_FSCR_FPW(slot_width);
- break;
- case FPW_HALF_FRAME_WIDTH:
- fscr |= SAI_FSCR_FPW(sai->fw_ratio * slot_width * ch_per_lane / 2);
- break;
- default:
- dev_err(sai->dev, "Invalid Frame Pulse Width %d\n", sai->fpw);
- ret = -EINVAL;
- goto err_xfer_unlock;
- }
+ fscr = SAI_FSCR_FW(sai->fw_ratio * slot_width * ch_per_lane);
- regmap_update_bits(sai->regmap, SAI_FSCR,
- SAI_FSCR_FW_MASK | SAI_FSCR_FPW_MASK, fscr);
-
- if (sai->is_master_mode) {
- bclk_rate = sai->fw_ratio * slot_width * ch_per_lane * params_rate(params);
- ret = clk_set_rate(sai->mclk, sai->mclk_rate);
- if (ret) {
- dev_err(sai->dev, "Failed to set mclk to %u: %pe\n",
- sai->mclk_rate, ERR_PTR(ret));
- goto err_xfer_unlock;
- }
-
- mclk_rate = clk_get_rate(sai->mclk);
- if (mclk_rate < bclk_rate) {
- dev_err(sai->dev, "Mismatch mclk: %u, at least %u\n",
- mclk_rate, bclk_rate);
+ switch (sai->fpw) {
+ case FPW_ONE_BCLK_WIDTH:
+ fscr |= SAI_FSCR_FPW(1);
+ break;
+ case FPW_ONE_SLOT_WIDTH:
+ fscr |= SAI_FSCR_FPW(slot_width);
+ break;
+ case FPW_HALF_FRAME_WIDTH:
+ fscr |= SAI_FSCR_FPW(sai->fw_ratio * slot_width * ch_per_lane / 2);
+ break;
+ default:
+ dev_err(sai->dev, "Invalid Frame Pulse Width %d\n", sai->fpw);
ret = -EINVAL;
- goto err_xfer_unlock;
+ break;
}
- div_bclk = DIV_ROUND_CLOSEST(mclk_rate, bclk_rate);
- mclk_req_rate = bclk_rate * div_bclk;
-
- if (mclk_rate < mclk_req_rate - CLK_SHIFT_RATE_HZ_MAX ||
- mclk_rate > mclk_req_rate + CLK_SHIFT_RATE_HZ_MAX) {
- dev_err(sai->dev, "Mismatch mclk: %u, expected %u (+/- %dHz)\n",
- mclk_rate, mclk_req_rate, CLK_SHIFT_RATE_HZ_MAX);
- ret = -EINVAL;
- goto err_xfer_unlock;
+ if (ret == 0) {
+ regmap_update_bits(sai->regmap, SAI_FSCR,
+ SAI_FSCR_FW_MASK | SAI_FSCR_FPW_MASK, fscr);
+
+ if (sai->is_master_mode) {
+ bclk_rate = sai->fw_ratio * slot_width *
+ ch_per_lane * params_rate(params);
+ ret = clk_set_rate(sai->mclk, sai->mclk_rate);
+ if (ret)
+ dev_err(sai->dev, "Failed to set mclk to %u: %pe\n",
+ sai->mclk_rate, ERR_PTR(ret));
+ else {
+ mclk_rate = clk_get_rate(sai->mclk);
+ if (mclk_rate < bclk_rate) {
+ dev_err(sai->dev, "Mismatch mclk: %u, at least %u\n",
+ mclk_rate, bclk_rate);
+ ret = -EINVAL;
+ } else {
+
+ div_bclk = DIV_ROUND_CLOSEST(mclk_rate, bclk_rate);
+ mclk_req_rate = bclk_rate * div_bclk;
+
+ if (mclk_rate <
+ mclk_req_rate - CLK_SHIFT_RATE_HZ_MAX ||
+ mclk_rate >
+ mclk_req_rate + CLK_SHIFT_RATE_HZ_MAX) {
+ dev_err(sai->dev,
+ "Mismatch mclk: %u, expected %u (+/- %dHz)\n",
+ mclk_rate, mclk_req_rate,
+ CLK_SHIFT_RATE_HZ_MAX);
+ ret = -EINVAL;
+ } else
+ regmap_update_bits(sai->regmap,
+ SAI_CKR,
+ SAI_CKR_MDIV_MASK,
+ SAI_CKR_MDIV(div_bclk));
+ }
+ }
+ }
}
-
- regmap_update_bits(sai->regmap, SAI_CKR, SAI_CKR_MDIV_MASK,
- SAI_CKR_MDIV(div_bclk));
}
-err_xfer_unlock:
- spin_unlock_irqrestore(&sai->xfer_lock, flags);
-err_pm_put:
pm_runtime_put(sai->dev);
return ret;
@@ -705,7 +704,6 @@ static int rockchip_sai_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct rk_sai_dev *sai = snd_soc_dai_get_drvdata(dai);
- unsigned long flags;
if (!rockchip_sai_stream_valid(substream, dai))
return 0;
@@ -726,13 +724,12 @@ static int rockchip_sai_prepare(struct snd_pcm_substream *substream,
* udelay falls short.
*/
udelay(20);
- spin_lock_irqsave(&sai->xfer_lock, flags);
- regmap_update_bits(sai->regmap, SAI_XFER,
- SAI_XFER_CLK_MASK |
- SAI_XFER_FSS_MASK,
- SAI_XFER_CLK_EN |
- SAI_XFER_FSS_EN);
- spin_unlock_irqrestore(&sai->xfer_lock, flags);
+ scoped_guard(spinlock_irqsave, &sai->xfer_lock)
+ regmap_update_bits(sai->regmap, SAI_XFER,
+ SAI_XFER_CLK_MASK |
+ SAI_XFER_FSS_MASK,
+ SAI_XFER_CLK_EN |
+ SAI_XFER_FSS_EN);
}
rockchip_sai_fsync_lost_detect(sai, 1);
@@ -915,7 +912,6 @@ static int rockchip_sai_set_tdm_slot(struct snd_soc_dai *dai,
int slots, int slot_width)
{
struct rk_sai_dev *sai = snd_soc_dai_get_drvdata(dai);
- unsigned long flags;
unsigned int clk_gates;
int sw = slot_width;
@@ -931,16 +927,16 @@ static int rockchip_sai_set_tdm_slot(struct snd_soc_dai *dai,
return -EINVAL;
pm_runtime_get_sync(dai->dev);
- spin_lock_irqsave(&sai->xfer_lock, flags);
- rockchip_sai_xfer_clk_stop_and_wait(sai, &clk_gates);
- regmap_update_bits(sai->regmap, SAI_TXCR, SAI_XCR_SBW_MASK,
- SAI_XCR_SBW(sw));
- regmap_update_bits(sai->regmap, SAI_RXCR, SAI_XCR_SBW_MASK,
- SAI_XCR_SBW(sw));
- regmap_update_bits(sai->regmap, SAI_XFER,
- SAI_XFER_CLK_MASK | SAI_XFER_FSS_MASK,
- clk_gates);
- spin_unlock_irqrestore(&sai->xfer_lock, flags);
+ scoped_guard(spinlock_irqsave, &sai->xfer_lock) {
+ rockchip_sai_xfer_clk_stop_and_wait(sai, &clk_gates);
+ regmap_update_bits(sai->regmap, SAI_TXCR, SAI_XCR_SBW_MASK,
+ SAI_XCR_SBW(sw));
+ regmap_update_bits(sai->regmap, SAI_RXCR, SAI_XCR_SBW_MASK,
+ SAI_XCR_SBW(sw));
+ regmap_update_bits(sai->regmap, SAI_XFER,
+ SAI_XFER_CLK_MASK | SAI_XFER_FSS_MASK,
+ clk_gates);
+ }
pm_runtime_put(dai->dev);
return 0;
--
2.43.0
^ permalink raw reply related
* Re: [PATCH] arm: gen-mach-types: don't include absolute filename
From: Alexander Stein @ 2026-06-04 5:26 UTC (permalink / raw)
To: Russell King, Sascha Hauer
Cc: linux-arm-kernel, linux-kernel, Marco Felsch,
Uwe Kleine-König, Ryan Eatmon, kernel, Sascha Hauer
In-Reply-To: <20260603-arm-remove-path-from-mach-types-h-v1-1-cda9890ba788@pengutronix.de>
Hi Sascha,
thanks for bringing this up (again).
Am Mittwoch, 3. Juni 2026, 16:12:10 CEST schrieb Sascha Hauer:
> mach-types.h is part of the kapi and as such shipped in the
> linux-headers package. The embedded build path makes that package
> non-reproducible without going through an extra step of normalizing the
> path. YOCTO has similar problems in the kernel debug source package.
>
> Make the path relative to the kernel source tree which is enough to
> find the tool that has generated the file.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> This topic comes up every once in a while, without any clear objection
> other than "Or just leave it as is. It's in a comment, it doesn't get
> into the executable, and thus is harmless.", from which I am not sure if
> it actually is an objection. Cced the authors of the previous patches
> that I am aware of:
>
> https://lore.kernel.org/all/20241114130021.2802803-1-m.felsch@pengutronix.de/
> https://lore.kernel.org/all/13360982.O9o76ZdvQC@steina-w/
> https://lore.kernel.org/all/20240213092835.754462-2-u.kleine-koenig@pengutronix.de/
> https://lore.kernel.org/all/20241002175049.15219-1-reatmon@ti.com/
This is much simpler as it hard-codes the file name. I don't have a preference
on that, so
Acked-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Thanks
Alexander
> ---
> arch/arm/tools/gen-mach-types | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/tools/gen-mach-types b/arch/arm/tools/gen-mach-types
> index cbe1c33bb8710..65ec262b31e65 100644
> --- a/arch/arm/tools/gen-mach-types
> +++ b/arch/arm/tools/gen-mach-types
> @@ -24,7 +24,7 @@ NF == 3 {
>
> END {
> printf("/*\n");
> - printf(" * This was automagically generated from %s!\n", FILENAME);
> + printf(" * This was automagically generated from arch/arm/tools/gen-mach-types!\n");
> printf(" * Do NOT edit\n");
> printf(" */\n\n");
> printf("#ifndef __ASM_ARM_MACH_TYPE_H\n");
>
> ---
> base-commit: ba3e43a9e601636f5edb54e259a74f96ca3b8fd8
> change-id: 20260603-arm-remove-path-from-mach-types-h-a6f528d60e00
>
> Best regards,
>
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/
^ permalink raw reply
* [PATCH v3] ARM: OMAP2+: Add CFI type for omap4_finish_suspend
From: Mithil Bavishi @ 2026-06-04 5:40 UTC (permalink / raw)
To: Aaro Koskinen, Andreas Kemnade, Kevin Hilman, Roger Quadros,
Tony Lindgren, Russell King
Cc: Sami Tolvanen, Kees Cook, Nathan Chancellor, linux-arm-kernel,
linux-omap, llvm, linux-kernel, Mithil Bavishi
With CONFIG_CFI enabled, OMAP4 can trap in omap4_enter_lowpower()
because omap_pm_ops.finish_suspend points directly to the assembly
routine omap4_finish_suspend, which lacks the expected KCFI type
metadata.
Annotate omap4_finish_suspend with SYM_TYPED_FUNC_START so the assembly
routine carries the KCFI type metadata.
Signed-off-by: Mithil Bavishi <bavishimithil@gmail.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
---
arch/arm/mach-omap2/sleep44xx.S | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/sleep44xx.S b/arch/arm/mach-omap2/sleep44xx.S
index f09c91978..8b515f300 100644
--- a/arch/arm/mach-omap2/sleep44xx.S
+++ b/arch/arm/mach-omap2/sleep44xx.S
@@ -6,6 +6,7 @@
* Santosh Shilimkar <santosh.shilimkar@ti.com>
*/
+#include <linux/cfi_types.h>
#include <linux/linkage.h>
#include <asm/assembler.h>
#include <asm/smp_scu.h>
@@ -58,7 +59,7 @@
* stack frame and it expects the caller to take care of it. Hence the entire
* stack frame is saved to avoid possible stack corruption.
*/
-ENTRY(omap4_finish_suspend)
+SYM_TYPED_FUNC_START(omap4_finish_suspend)
stmfd sp!, {r4-r12, lr}
cmp r0, #0x0
beq do_WFI @ No lowpower state, jump to WFI
@@ -223,7 +224,7 @@ skip_scu_gp_clear:
isb
dsb
ldmfd sp!, {r4-r12, pc}
-ENDPROC(omap4_finish_suspend)
+SYM_FUNC_END(omap4_finish_suspend)
/*
* ============================
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v2] ARM: OMAP2+: Add CFI type for omap4_finish_suspend
From: Mithil Bavishi @ 2026-06-04 5:43 UTC (permalink / raw)
To: nathan
Cc: aaro.koskinen, andreas, bavishimithil, kees, khilman,
linux-arm-kernel, linux-kernel, linux-omap, linux, lkp, llvm,
oe-kbuild-all, rogerq, samitolvanen, tony
In-Reply-To: <20260525165527.GA18457@ax162>
> are both pointing out that cfi_types.h needs to be included in
> arch/arm/mach-omap2/sleep44xx.S for SYM_TYPED_FUNC_START to always be
> expanded properly. I tested adding
>
> #include <linux/cfi_types.h>
>
> as the first include line and both issues were resolved.
My apologies, I was switching systems and seem to have lost this somewhere
in the process. Sent a v3 with the include, thanks a lot!
Best,
Mithil Bavishi
^ permalink raw reply
* [PATCH] arm64: dts: nuvoton: ma35d1: add CAN nodes
From: Zi-Yu Chen @ 2026-06-04 6:01 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt
Cc: ychuang3, schung, linux-arm-kernel, devicetree, linux-kernel,
Zi-Yu Chen
Add controller nodes for the four Bosch M_CAN blocks found on the
Nuvoton MA35D1 SoC.
Additionally, configure pinctrl and enable CAN1 and CAN3 on the
MA35D1 SOM board.
Signed-off-by: Zi-Yu Chen <zychennvt@gmail.com>
---
.../boot/dts/nuvoton/ma35d1-som-256m.dts | 26 ++++++++
arch/arm64/boot/dts/nuvoton/ma35d1.dtsi | 60 +++++++++++++++++++
2 files changed, 86 insertions(+)
diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts b/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
index f6f20a17e501..1b8ea14d3446 100644
--- a/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
+++ b/arch/arm64/boot/dts/nuvoton/ma35d1-som-256m.dts
@@ -37,6 +37,18 @@ clk_hxt: clock-hxt {
};
};
+&can1 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_can1>;
+};
+
+&can3 {
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_can3>;
+};
+
&clk {
assigned-clocks = <&clk CAPLL>,
<&clk DDRPLL>,
@@ -56,6 +68,20 @@ &clk {
};
&pinctrl {
+ can-grp {
+ pinctrl_can1: can1-pins {
+ nuvoton,pins = <11 14 4>,
+ <11 15 4>;
+ bias-disable;
+ };
+
+ pinctrl_can3: can3-pins {
+ nuvoton,pins = <11 10 3>,
+ <11 11 3>;
+ bias-disable;
+ };
+ };
+
uart-grp {
pinctrl_uart0: uart0-pins {
nuvoton,pins = <4 14 1>,
diff --git a/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi b/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
index e51b98f5bdce..584dd8d44701 100644
--- a/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
+++ b/arch/arm64/boot/dts/nuvoton/ma35d1.dtsi
@@ -244,6 +244,66 @@ gpion: gpio@340 {
};
};
+ can0: can@403c0000 {
+ compatible = "bosch,m_can";
+ reg = <0x0 0x403c0000 0x0 0x200>, <0x0 0x403c0200 0x0 0x2000>;
+ reg-names = "m_can", "message_ram";
+ interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "int0", "int1";
+ clocks = <&clk HCLK3>, <&clk CAN0_GATE>;
+ clock-names = "hclk", "cclk";
+ assigned-clocks = <&clk APLL>, <&clk CAN0_DIV>;
+ assigned-clock-rates = <200000000>, <50000000>;
+ bosch,mram-cfg = <0x0 4 4 32 32 32 8 8>;
+ status = "disabled";
+ };
+
+ can1: can@403d0000 {
+ compatible = "bosch,m_can";
+ reg = <0x0 0x403d0000 0x0 0x200>, <0x0 0x403d0200 0x0 0x2000>;
+ reg-names = "m_can", "message_ram";
+ interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 132 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "int0", "int1";
+ clocks = <&clk HCLK3>, <&clk CAN1_GATE>;
+ clock-names = "hclk", "cclk";
+ assigned-clocks = <&clk APLL>, <&clk CAN1_DIV>;
+ assigned-clock-rates = <200000000>, <50000000>;
+ bosch,mram-cfg = <0x0 4 4 32 32 32 8 8>;
+ status = "disabled";
+ };
+
+ can2: can@403e0000 {
+ compatible = "bosch,m_can";
+ reg = <0x0 0x403e0000 0x0 0x200>, <0x0 0x403e0200 0x0 0x2000>;
+ reg-names = "m_can", "message_ram";
+ interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "int0", "int1";
+ clocks = <&clk HCLK3>, <&clk CAN2_GATE>;
+ clock-names = "hclk", "cclk";
+ assigned-clocks = <&clk APLL>, <&clk CAN2_DIV>;
+ assigned-clock-rates = <200000000>, <50000000>;
+ bosch,mram-cfg = <0x0 4 4 32 32 32 8 8>;
+ status = "disabled";
+ };
+
+ can3: can@403f0000 {
+ compatible = "bosch,m_can";
+ reg = <0x0 0x403f0000 0x0 0x200>, <0x0 0x403f0200 0x0 0x2000>;
+ reg-names = "m_can", "message_ram";
+ interrupts = <GIC_SPI 126 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "int0", "int1";
+ clocks = <&clk HCLK3>, <&clk CAN3_GATE>;
+ clock-names = "hclk", "cclk";
+ assigned-clocks = <&clk APLL>, <&clk CAN3_DIV>;
+ assigned-clock-rates = <200000000>, <50000000>;
+ bosch,mram-cfg = <0x0 4 4 32 32 32 8 8>;
+ status = "disabled";
+ };
+
uart0: serial@40700000 {
compatible = "nuvoton,ma35d1-uart";
reg = <0x0 0x40700000 0x0 0x100>;
--
2.34.1
^ permalink raw reply related
* [PATCH v2] arm64: dts: imx94: Add Root Port node and PERST property
From: hongxing.zhu @ 2026-06-04 6:28 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>
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, 30 insertions(+), 2 deletions(-)
---
Changes in v2:
- Delete reset-gpio properties in PCIe bridge node.
- Correct the "reset-gpio" property to "reset-gpios".
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..99d66484ded04 100644
--- a/arch/arm64/boot/dts/freescale/imx943-evk.dts
+++ b/arch/arm64/boot/dts/freescale/imx943-evk.dts
@@ -1034,12 +1034,15 @@ &pcie0 {
<&pcie_ref_clk>;
clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux",
"ref", "extref";
- reset-gpio = <&pcal6416_i2c3_u46 3 GPIO_ACTIVE_LOW>;
vpcie3v3aux-supply = <®_m2_wlan>;
supports-clkreq;
status = "okay";
};
+&pcie0_port0 {
+ reset-gpios = <&pcal6416_i2c3_u46 3 GPIO_ACTIVE_LOW>;
+};
+
&pcie0_ep {
pinctrl-0 = <&pinctrl_pcie0>;
pinctrl-names = "default";
@@ -1058,12 +1061,15 @@ &pcie1 {
<&pcie_ref_clk>;
clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux",
"ref", "extref";
- reset-gpio = <&pcal6416_i2c3_u46 1 GPIO_ACTIVE_LOW>;
vpcie3v3aux-supply = <®_slot_pwr>;
supports-clkreq;
status = "okay";
};
+&pcie1_port0 {
+ reset-gpios = <&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 v8 11/12] iommu/arm-smmu-v3: Invoke pm_runtime before hw access
From: Pranjal Shrivastava @ 2026-06-04 6:27 UTC (permalink / raw)
To: Daniel Mentz
Cc: iommu, Will Deacon, Joerg Roedel, Robin Murphy, Jason Gunthorpe,
Mostafa Saleh, Nicolin Chen, Ashish Mhetre, linux-arm-kernel
In-Reply-To: <CAE2F3rCPgnFU=d5At1zrOLhsuVEbsweogOHGz9gDddRx73zRtw@mail.gmail.com>
On Wed, Jun 03, 2026 at 01:28:19PM -0700, Daniel Mentz wrote:
> On Mon, Jun 1, 2026 at 2:59 PM Pranjal Shrivastava <praan@google.com> wrote:
> > @@ -2361,8 +2394,33 @@ static irqreturn_t arm_smmu_handle_gerror(struct arm_smmu_device *smmu)
> > static irqreturn_t arm_smmu_gerror_handler(int irq, void *dev)
> > {
> > struct arm_smmu_device *smmu = dev;
> > + irqreturn_t ret;
> > +
> > + /*
> > + * Global Errors are only processed if the SMMU is active.
> > + *
> > + * If the STOP_FLAG is set (can_elide == true), the hardware is
> > + * either already disabled or in the process of being disabled.
> > + * Any errors captured during the quiesce/drain phase will be
> > + * handled by the explicit arm_smmu_handle_gerror() call at the
> > + * end of arm_smmu_runtime_suspend() callback. On resume, the
> > + * STOP_FLAG is cleared before interrupts are re-enabled, ensuring
> > + * no valid errors are missed.
> > + *
> > + * A lockless check is favoured here over a dynamic PM core check
> > + * since the runtime_pm_get_if_active would return false during
> > + * transient states like RPM_RESUMING & ignore level-triggered
> > + * interrupts.
> > + */
> > + if (arm_smmu_cmdq_can_elide(smmu)) {
> > + dev_err(smmu->dev,
> > + "Ignoring gerror interrupt because the SMMU is suspended\n");
> > + return IRQ_NONE;
> > + }
>
> Have you considered using arm_smmu_rpm_get() here instead?
> I can see two issues with the currenlty proposal:
> * Returning IRQ_NONE when an interrupt is indeed active and needs to
> be handled. This might be interpreted as a spurious interrupt
> * Nothing is preventing the suspend handler from running while
> arm_smmu_gerror_handler is in the middle of handling an interrupt
>
> I understand that using arm_smmu_rpm_get() also has downsides,
> including an unnecessary resume operation when the SMMU is already in
> RPM_SUSPENDING state. However, using arm_smmu_rpm_get() would make it
> easier to ensure correctness.
>
I don't think using arm_smmu_rpm_get() here is possible..
GERROR is registered as a hard IRQ handler, so calling rpm_get (which
can sleep) would be wrong.
Regarding the race, the STOP_FLAG is set at the very beginning of the
suspend sequence. If an IRQ fires after that, we return IRQ_NONE and
let the explicit arm_smmu_handle_gerror() call at the end of
runtime_suspend catch and clear it. After CMDQEN, PRIQEN, EVTQEN &
SMMUEN are all cleared, getting a Gerror should be treated as spurious
That said, I understand your concerns about a real IRQ being interpreted
as a spurious one, and creating an IRQ storm since the gerror register
isn't really written. I have 2 ideas here:
1. We could have a "suspended" flag and check it with can_elide here:
arm_smmu_cmdq_can_elide() && is_suspended() to correctly return IRQ_NONE
2. We could explicitly disable Gerror in IRQ_CTRL write after setting
the CMDQ_STOP_FLAG. Even if there are Gerrors during the CMDQ drain,
we'll catcup to those at the end of our suspend callback.
I'm more inclined towards 2 as it prevents potential races (execution of
an IRQ handler with handle_gerror calls at the end of the suspend).
WDYT?
Thanks.
Praan
^ permalink raw reply
* Re: [PATCH] char: xilinx_hwicap: replace in_be32/out_be32 with ioread32be/iowrite32be
From: Michal Simek @ 2026-06-04 6:30 UTC (permalink / raw)
To: Rosen Penev
Cc: linux-kernel, Arnd Bergmann, chleroy, Greg Kroah-Hartman,
moderated list:ARM/ZYNQ ARCHITECTURE
In-Reply-To: <CAKxU2N_U=Wk4f9ankopVBMRGH+YdTn8FOuyoDs4Of04o63bTHg@mail.gmail.com>
On 6/3/26 21:52, Rosen Penev wrote:
> On Mon, Jun 1, 2026 at 11:22 PM Michal Simek <michal.simek@amd.com> wrote:
>>
>>
>>
>> On 6/2/26 05:57, Rosen Penev wrote:
>>> Mechanical conversion of the ppc4xx-specific accessors to the generic
>>> portable helpers.
>>>
>>> As a result, COMPILE_TEST is added for extra compile coverage.
>>>
>>> Assisted-by: opencode:big-pickle
>>> Signed-off-by: Rosen Penev <rosenp@gmail.com>
>>> ---
>>> drivers/char/Kconfig | 2 +-
>>> drivers/char/xilinx_hwicap/buffer_icap.c | 16 +++++------
>>> drivers/char/xilinx_hwicap/fifo_icap.c | 34 +++++++++++-------------
>>> 3 files changed, 24 insertions(+), 28 deletions(-)
>>
>> I don't really mind about this because I think that we can also remove the whole
>> driver.
> I looked into this. The problem here is that there are actual users
>
> arch/microblaze/boot/dts/system.dts
>
> and
>
> arch/mips/boot/dts/xilfpga/nexys4ddr.dts
I can't see users of it.
on v7.1-rc1
$ git grep opb-hwicap
Documentation/devicetree/bindings/xilinx.txt:126:
"xlnx,opb-hwicap-1.00.b".
drivers/char/xilinx_hwicap/xilinx_hwicap.c:733: { .compatible =
"xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
$ git grep xps-hwicap
Documentation/devicetree/bindings/xilinx.txt:125: - compatible :
should contain "xlnx,xps-hwicap-1.00.a" or
drivers/char/xilinx_hwicap/xilinx_hwicap.c:734: { .compatible =
"xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config},
Thanks,
Michal
^ permalink raw reply
* Re: [PATCH] KVM/arm64: vgic-its: Fix memory leak when vgic_its_set_abi() fails
From: Oliver Upton @ 2026-06-04 6:41 UTC (permalink / raw)
To: Jackie Liu; +Cc: maz, linux-arm-kernel, yuzenghui, will, kvmarm
In-Reply-To: <20260604031426.16109-1-liu.yun@linux.dev>
On Thu, Jun 04, 2026 at 11:14:26AM +0800, Jackie Liu wrote:
> 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>
vgic_its_set_abi() always succeeds so there's no actual memory leak
here. I'd prefer getting rid of the return value instead.
Thanks,
Oliver
^ permalink raw reply
* RE: [PATCH 01/11] net: wwan: t9xx: Add PCIe core
From: Wu. JackBB (GSM) @ 2026-06-04 6:42 UTC (permalink / raw)
To: Jagielski, Jedrzej, Loic Poulain, Sergey Ryazanov, Johannes Berg,
Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Wen-Zhi Huang, Shi-Wei Yeh, Minano Tseng,
Matthias Brugger, AngeloGioacchino Del Regno, Simon Horman,
Jonathan Corbet, Shuah Khan
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-doc@vger.kernel.org
In-Reply-To: <PH0PR11MB5902127C590230B9FE50F78AF0152@PH0PR11MB5902.namprd11.prod.outlook.com>
> Sent: Friday, May 29, 2026 12:32 PM
>
> > +
>
> please also take a look on sashiko notes, there is some number of them
Hi Jagielski,
Thank you for your review. We have fixed some issues and are still discussing others with MediaTek. All of them will be addressed in V2.
Regarding sashiko notes, how should I handle them if discussion is needed? I cannot find sashiko's email address, and its website does not have a reply option.
For example:
https://sashiko.dev/#/patchset/20260529-t9xx_driver_v1-v1-0-bdbfe2c01e57%40compal.com?part=2
Q1:
The commit message mentions implementing TX and RX services, but the patch primarily adds empty structures and boilerplate code. Is the patch missing the actual TX/RX implementation described here?
Reply:
We plan to update the commit message. Would the following be acceptable?
Add the control plane transaction layer framework for the t9xx
WWAN driver, including configuration options, device structure
definitions, and initialization/cleanup functions.
The actual TX/RX service implementations that use this framework
are introduced in subsequent patches.
Thanks.
================================================================================================================================================================
This message may contain information which is private, privileged or confidential of Compal Electronics, Inc. If you are not the intended recipient of this message, please notify the sender and destroy/delete the message. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon this information, by persons or entities other than the intended recipient is prohibited.
================================================================================================================================================================
^ permalink raw reply
* RE: [PATCH v2] arm64: dts: imx94: Add Root Port node and PERST property
From: Sherry Sun @ 2026-06-04 6:49 UTC (permalink / raw)
To: Hongxing Zhu (OSS), robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, Frank Li, s.hauer@pengutronix.de,
festevam@gmail.com
Cc: kernel@pengutronix.de, devicetree@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Hongxing Zhu
In-Reply-To: <20260604062846.310810-1-hongxing.zhu@oss.nxp.com>
> From: Richard Zhu <hongxing.zhu@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>
Reviewed-by: Sherry Sun <sherry.sun@nxp.com>
Best Regards
Sherry
> ---
> 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, 30 insertions(+), 2 deletions(-)
> ---
> Changes in v2:
> - Delete reset-gpio properties in PCIe bridge node.
> - Correct the "reset-gpio" property to "reset-gpios".
>
> 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..99d66484ded04 100644
> --- a/arch/arm64/boot/dts/freescale/imx943-evk.dts
> +++ b/arch/arm64/boot/dts/freescale/imx943-evk.dts
> @@ -1034,12 +1034,15 @@ &pcie0 {
> <&pcie_ref_clk>;
> clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux",
> "ref", "extref";
> - reset-gpio = <&pcal6416_i2c3_u46 3 GPIO_ACTIVE_LOW>;
> vpcie3v3aux-supply = <®_m2_wlan>;
> supports-clkreq;
> status = "okay";
> };
>
> +&pcie0_port0 {
> + reset-gpios = <&pcal6416_i2c3_u46 3 GPIO_ACTIVE_LOW>; };
> +
> &pcie0_ep {
> pinctrl-0 = <&pinctrl_pcie0>;
> pinctrl-names = "default";
> @@ -1058,12 +1061,15 @@ &pcie1 {
> <&pcie_ref_clk>;
> clock-names = "pcie", "pcie_bus", "pcie_phy", "pcie_aux",
> "ref", "extref";
> - reset-gpio = <&pcal6416_i2c3_u46 1 GPIO_ACTIVE_LOW>;
> vpcie3v3aux-supply = <®_slot_pwr>;
> supports-clkreq;
> status = "okay";
> };
>
> +&pcie1_port0 {
> + reset-gpios = <&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
* Re: [PATCH] KVM/arm64: vgic-its: Fix memory leak when vgic_its_set_abi() fails
From: Jackie Liu @ 2026-06-04 6:59 UTC (permalink / raw)
To: Oliver Upton; +Cc: maz, linux-arm-kernel, yuzenghui, will, kvmarm
In-Reply-To: <aiEeKGsLg9098OUt@kernel.org>
2026年6月4日 14:41, "Oliver Upton" <oupton@kernel.org mailto:oupton@kernel.org?to=%22Oliver%20Upton%22%20%3Coupton%40kernel.org%3E > 写到:
>
> On Thu, Jun 04, 2026 at 11:14:26AM +0800, Jackie Liu wrote:
>
> >
> > 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>
> >
> vgic_its_set_abi() always succeeds so there's no actual memory leak
> here. I'd prefer getting rid of the return value instead.
That was my original thought as well. However, I kept the defensive cleanup logic in place
to make future extensions easier. This way, if additional resource allocation paths are
introduced later, we're less likely to miss the corresponding cleanup.
That said, looking at the current code, the return value no longer serves any real
purpose, so removing it would also be a reasonable and cleaner approach.
I'll send a V2 with this change.
Thanks.
Jackie
>
> Thanks,
> Oliver
>
^ permalink raw reply
* [PATCH net] net: airoha: Add NULL check for of_reserved_mem_lookup() in airoha_qdma_init_hfwd_queues()
From: ZhaoJinming @ 2026-06-04 7:03 UTC (permalink / raw)
To: lorenzo, andrew+netdev, davem, edumazet, kuba, pabeni
Cc: horms, linux-arm-kernel, linux-mediatek, netdev, linux-kernel,
stable, ZhaoJinming
of_reserved_mem_lookup() may return NULL if the reserved memory region
referenced by the "memory-region" phandle is not found in the reserved
memory table (e.g. due to a misconfigured DTS or a removed
memory-region node). The current code dereferences the returned
pointer without checking for NULL, leading to a kernel NULL pointer
dereference at the following lines:
dma_addr = rmem->base; // line 1156
num_desc = div_u64(rmem->size, buf_size); // line 1160
Add a NULL check after of_reserved_mem_lookup() and return -ENODEV if
the lookup fails, which is consistent with the existing error handling
for of_parse_phandle() failure in the same code block.
Fixes: 3a1ce9e3d01b ("net: airoha: Add the capability to allocate hwfd buffers via reserved-memory")
Cc: stable@vger.kernel.org
Signed-off-by: ZhaoJinming<zhaojinming@uniontech.com>
---
drivers/net/ethernet/airoha/airoha_eth.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/airoha/airoha_eth.c b/drivers/net/ethernet/airoha/airoha_eth.c
index cecd66251dba..2444d3275a81 100644
--- a/drivers/net/ethernet/airoha/airoha_eth.c
+++ b/drivers/net/ethernet/airoha/airoha_eth.c
@@ -1153,6 +1153,9 @@ static int airoha_qdma_init_hfwd_queues(struct airoha_qdma *qdma)
rmem = of_reserved_mem_lookup(np);
of_node_put(np);
+ if (!rmem)
+ return -ENODEV;
+
dma_addr = rmem->base;
/* Compute the number of hw descriptors according to the
* reserved memory size and the payload buffer size
--
2.25.1
^ permalink raw reply related
* Re: [PATCH 1/2] dt-bindings: spi: Add for Nuvoton MA35D1 SoC QSPI Controller
From: Chi-Wen Weng @ 2026-06-04 7:07 UTC (permalink / raw)
To: Conor Dooley
Cc: broonie, robh, krzk+dt, conor+dt, linux-arm-kernel, linux-spi,
devicetree, linux-kernel, cwweng
In-Reply-To: <20260603-daybed-absentee-1b64f5caabe0@spud>
Hi Conor,
Thanks for the review.
> Missing commit message for one, but why can't your Nuvoton mail be used
> here?
I apologize for the missing commit message; I will add a proper
description in v2.
Regarding the email address, my Nuvoton mail adds a corporate
confidentiality disclaimer to outgoing
external mail, so I use my personal address for sending kernel patches.
> Sashiko had two comments about resets and num-cs that looked valid.
Noted. I will add the `num-cs` and `resets` properties in v2.
> Drop this flash node, it serves no purpose here.
Understood, I will remove the flash child node from the example in v2.
Thanks,
Chi-Wen Weng
Conor Dooley 於 2026/6/3 下午 11:24 寫道:
> On Wed, Jun 03, 2026 at 12:35:50PM +0800, Chi-Wen Weng wrote:
>> Signed-off-by: Chi-Wen Weng <cwweng.linux@gmail.com>
> Missing commit message for one, but why can't your Nuvoton mail be used
> here?
>
> Sashiko had two comments about resets and num-cs that looked valid.
>
>> ---
>> .../bindings/spi/nuvoton,ma35d1-qspi.yaml | 61 +++++++++++++++++++
>> 1 file changed, 61 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/spi/nuvoton,ma35d1-qspi.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/spi/nuvoton,ma35d1-qspi.yaml b/Documentation/devicetree/bindings/spi/nuvoton,ma35d1-qspi.yaml
>> new file mode 100644
>> index 000000000000..f7b9cb52d8e5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/spi/nuvoton,ma35d1-qspi.yaml
>> @@ -0,0 +1,61 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/spi/nuvoton,ma35d1-qspi.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Nuvoton MA35D1 Quad SPI Controller
>> +
>> +maintainers:
>> + - Chi-Wen Weng <cwweng@nuvoton.com>
>> +
>> +allOf:
>> + - $ref: spi-controller.yaml#
>> +
>> +properties:
>> + compatible:
>> + const: nuvoton,ma35d1-qspi
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + interrupts:
>> + maxItems: 1
>> +
>> + clocks:
>> + maxItems: 1
>> +
>> +required:
>> + - compatible
>> + - reg
>> + - clocks
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> + - |
>> + #include <dt-bindings/interrupt-controller/arm-gic.h>
>> + #include <dt-bindings/clock/nuvoton,ma35d1-clk.h>
>> +
>> + soc {
>> + #address-cells = <2>;
>> + #size-cells = <2>;
>> +
>> + spi@40680000 {
>> + compatible = "nuvoton,ma35d1-qspi";
>> + reg = <0x0 0x40680000 0x0 0x100>;
>> + interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
>> + clocks = <&clk QSPI0_GATE>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> +
>> + flash@0 {
> Drop this flash node, it serves no purpose here.
>
> pw-bot: changes-requested
>
> Thanks,
> Conor.
>
>> + compatible = "jedec,spi-nor";
>> + spi-max-frequency = <30000000>;
>> + reg = <0>;
>> + spi-rx-bus-width = <4>;
>> + spi-tx-bus-width = <1>;
>> + };
>> + };
>> + };
>> +
>> --
>> 2.25.1
>>
^ permalink raw reply
* Re: [PATCH] char: xilinx_hwicap: replace in_be32/out_be32 with ioread32be/iowrite32be
From: Rosen Penev @ 2026-06-04 7:13 UTC (permalink / raw)
To: Michal Simek, Rosen Penev
Cc: linux-kernel, Arnd Bergmann, chleroy, Greg Kroah-Hartman,
moderated list:ARM/ZYNQ ARCHITECTURE
In-Reply-To: <e331f8d0-11e7-40c1-b4f5-76a591e93bd9@amd.com>
On Wed Jun 3, 2026 at 11:30 PM PDT, Michal Simek wrote:
>
>
> On 6/3/26 21:52, Rosen Penev wrote:
>> On Mon, Jun 1, 2026 at 11:22 PM Michal Simek <michal.simek@amd.com> wrote:
>>>
>>>
>>>
>>> On 6/2/26 05:57, Rosen Penev wrote:
>>>> Mechanical conversion of the ppc4xx-specific accessors to the generic
>>>> portable helpers.
>>>>
>>>> As a result, COMPILE_TEST is added for extra compile coverage.
>>>>
>>>> Assisted-by: opencode:big-pickle
>>>> Signed-off-by: Rosen Penev <rosenp@gmail.com>
>>>> ---
>>>> drivers/char/Kconfig | 2 +-
>>>> drivers/char/xilinx_hwicap/buffer_icap.c | 16 +++++------
>>>> drivers/char/xilinx_hwicap/fifo_icap.c | 34 +++++++++++-------------
>>>> 3 files changed, 24 insertions(+), 28 deletions(-)
>>>
>>> I don't really mind about this because I think that we can also remove the whole
>>> driver.
>> I looked into this. The problem here is that there are actual users
>>
>> arch/microblaze/boot/dts/system.dts
>>
>> and
>>
>> arch/mips/boot/dts/xilfpga/nexys4ddr.dts
>
>
> I can't see users of it.
Hrm looks like I just grepped xlns,xps and found system.dts. You're
right.
>
> on v7.1-rc1
> $ git grep opb-hwicap
> Documentation/devicetree/bindings/xilinx.txt:126:
> "xlnx,opb-hwicap-1.00.b".
> drivers/char/xilinx_hwicap/xilinx_hwicap.c:733: { .compatible =
> "xlnx,opb-hwicap-1.00.b", .data = &buffer_icap_config},
> $ git grep xps-hwicap
> Documentation/devicetree/bindings/xilinx.txt:125: - compatible :
> should contain "xlnx,xps-hwicap-1.00.a" or
> drivers/char/xilinx_hwicap/xilinx_hwicap.c:734: { .compatible =
> "xlnx,xps-hwicap-1.00.a", .data = &fifo_icap_config},
>
> Thanks,
> Michal
^ permalink raw reply
* Re: [PATCH v7 10/11] iommu/arm-smmu-v3: Invoke pm_runtime before hw access
From: Pranjal Shrivastava @ 2026-06-04 7:18 UTC (permalink / raw)
To: Daniel Mentz
Cc: Nicolin Chen, iommu, Will Deacon, Joerg Roedel, Robin Murphy,
Jason Gunthorpe, Mostafa Saleh, Ashish Mhetre, linux-arm-kernel
In-Reply-To: <CAE2F3rDeZe+w7-V6hyJtSOwCj619E5SNtjJjZ1-yu1sVdf=35A@mail.gmail.com>
On Wed, Jun 03, 2026 at 03:18:32PM -0700, Daniel Mentz wrote:
> On Thu, May 28, 2026 at 2:46 PM Pranjal Shrivastava <praan@google.com> wrote:
> >
> > On Thu, May 28, 2026 at 01:28:15PM -0700, Nicolin Chen wrote:
> > > On Wed, May 27, 2026 at 10:14:06PM +0000, Pranjal Shrivastava wrote:
> > > > TLB and CFG invalidations are
> > > > elided if the SMMU is suspended by observing the CMDQ_PROD_STOP_FLAG via
> > > > the arm_smmu_can_elide() helper.
> > >
> > > All the arm_smmu_can_elide() call sites here would eventually elide
> > > the commands in arm_smmu_cmdq_issue_cmdlist() that is already gated
> > > by CMDQ_PROD_STOP_FLAG? It doesn't seem necessary to gate again?
> >
> > While issue_cmdlist() would eventually elide these commands, the
> > can_elide() check is necessary to return early during suspension.
> >
> > This avoids unnecessary stack allocation, cmd building, and spinlock
> > contention on the cmdq->lock for threads that are anyway about to be
> > elided.
> >
> > By dropping these requests immediately, we significantly reduce cacheline
> > bouncing and contention during unmap storms. Furthermore, the early check
> > also allows us to specifically trigger the WARN_ON_ONCE() for broken
> > devlinks.
>
> Hi Pranjal,
>
> Have you observed unmap storms in a real-world use case, or is this a
> preemptive optimization? I would not expect a high rate of map/unmap
> operations while the SMMU is suspended. If a client device calls
> iommu_map/iommu_unmap (directly or indirectly), it suggests the client
> device is RPM_ACTIVE, meaning the SMMU should be active as well.
>
> I am in favor of removing arm_smmu_can_elide().
I saw some with DMA_FQ (fq_timer does batched async invalidations) but
the early ellision doesn't really help with perf which I agreed to in my
reply to Nicolin as well.
The early checks were dropped in v8 (except for invs_array and for the
WARN_ON in inv_master).
Thanks,
Praan
^ permalink raw reply
* Re: [PATCH 10/12] crypto: atmel - update workqueue flags and add flush on exit
From: Lothar Rubusch @ 2026-06-04 7:22 UTC (permalink / raw)
To: Marco Crivellari
Cc: alexandre.belloni, claudiu.beznea, davem, herbert,
linux-arm-kernel, linux-crypto, linux-kernel, nicolas.ferre,
thorsten.blum
In-Reply-To: <20260601090329.52616-1-marco.crivellari@suse.com>
Hi Marco,
On Mon, Jun 1, 2026 at 11:03 AM Marco Crivellari
<marco.crivellari@suse.com> wrote:
>
> Hi,
>
> > Update workqueue initialization to use WQ_MEM_RECLAIM instead of
> > WQ_PERCPU
>
> Not sure if you're working on this series right now, but this must keep
> the WQ_PERCPU flag. WQ_PERCPU has been added to mark explicitly mark
> workqueue that are per-CPU (it is the complement of WQ_UNBOUND).
>
Yes. I plan on splitting up the material presented in this series.
This particular patch was one of the things I was a unsure, if this
actually could be done.
Therefore it was already separted out. I highly appreciate your
feedback. I will drop this
change and leave WQ_PERCPU until I get there.
>
> Thanks!
>
^ permalink raw reply
* Re: [PATCH v3 5/5] KVM: arm64: nv: Create nested IPA direct map to speed up reverse map removal
From: Itaru Kitayama @ 2026-06-04 7:24 UTC (permalink / raw)
To: Wei-Lin Chang
Cc: linux-arm-kernel, kvmarm, linux-kernel, Marc Zyngier,
Oliver Upton, Joey Gouly, Suzuki K Poulose, Zenghui Yu,
Catalin Marinas, Will Deacon
In-Reply-To: <20260510145338.322962-6-weilin.chang@arm.com>
On Sun, May 10, 2026 at 03:53:38PM +0100, Wei-Lin Chang wrote:
> Iterating through the whole reverse map to find which entries to remove
> when handling guest hypervisor TLBIs is not efficient. Create a direct
> map that goes from nested IPA to canonical IPA so that the canonical
> IPA range affected by the TLBI can be quickly determined, then remove
> the entries in the reverse map accordingly.
>
> Suggested-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Wei-Lin Chang <weilin.chang@arm.com>
> ---
> arch/arm64/include/asm/kvm_host.h | 5 ++
> arch/arm64/kvm/mmu.c | 9 ++-
> arch/arm64/kvm/nested.c | 124 ++++++++++++++++++++++--------
> 3 files changed, 104 insertions(+), 34 deletions(-)
>
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index dc4c0bce1bbb..f9e95a023ec4 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -226,6 +226,11 @@ struct kvm_s2_mmu {
> bool nested_revmap_broken;
> /* canonical IPA to nested IPA range lookup */
> struct maple_tree nested_revmap_mt;
> + /*
> + * Nested IPA to canonical IPA range lookup, essentially a cache of
> + * the guest's stage-2.
> + */
> + struct maple_tree nested_direct_mt;
>
> #ifdef CONFIG_PTDUMP_STAGE2_DEBUGFS
> struct dentry *shadow_pt_debugfs_dentry;
> diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
> index ce0bd88cd3c1..77146431be6d 100644
> --- a/arch/arm64/kvm/mmu.c
> +++ b/arch/arm64/kvm/mmu.c
> @@ -1101,6 +1101,7 @@ void kvm_free_stage2_pgd(struct kvm_s2_mmu *mmu)
> struct kvm *kvm = kvm_s2_mmu_to_kvm(mmu);
> struct kvm_pgtable *pgt = NULL;
> struct maple_tree *revmap_mt = &mmu->nested_revmap_mt;
Naming, do you prefer revmap over rmap?
> + struct maple_tree *direct_mt = &mmu->nested_direct_mt;
>
> write_lock(&kvm->mmu_lock);
> pgt = mmu->pgt;
> @@ -1111,8 +1112,12 @@ void kvm_free_stage2_pgd(struct kvm_s2_mmu *mmu)
> }
>
> if (kvm_is_nested_s2_mmu(kvm, mmu)) {
> - if (!mtree_empty(revmap_mt))
> - mtree_destroy(revmap_mt);
> + if (!mtree_empty(revmap_mt) || !mtree_empty(direct_mt)) {
> + mtree_lock(revmap_mt);
> + __mt_destroy(revmap_mt);
> + __mt_destroy(direct_mt);
> + mtree_unlock(revmap_mt);
> + }
> kvm_init_nested_s2_mmu(mmu);
> }
>
> diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
> index 96b88d9c0c2a..fcb6a88047e1 100644
> --- a/arch/arm64/kvm/nested.c
> +++ b/arch/arm64/kvm/nested.c
> @@ -45,14 +45,14 @@ struct vncr_tlb {
> #define S2_MMU_PER_VCPU 2
>
> /*
> - * Per shadow S2 reverse map (IPA -> nested IPA range) maple tree payload
> - * layout:
> + * Per shadow S2 reverse & direct map maple tree payload layout:
> *
> - * bit 62: valid, prevents the case where the nested IPA is 0 and turning
> + * bit 62: valid, prevents the case where the address is 0 and turning
> * the whole value to 0
> - * bits 55-12: nested IPA bits 55-12
> + * bits 55-12: {nested, canonical} IPA bits 55-12
> * bit 0: UNKNOWN_IPA bit, 1 indicates we give up on tracking what nested
> - * IPA maps to this canonical IPA in the shadow stage-2
> + * IPA maps to this canonical IPA in the shadow stage-2, only used
> + * in reverse map
> */
> #define VALID_ENTRY BIT(62)
> #define ADDR_MASK GENMASK_ULL(55, 12)
> @@ -787,37 +787,67 @@ static struct kvm_s2_mmu *get_s2_mmu_nested(struct kvm_vcpu *vcpu)
> void kvm_remove_nested_revmap(struct kvm_s2_mmu *mmu, u64 nested_ipa, size_t size)
> {
> /*
> - * Iterate through the mt of this mmu, remove all canonical ipa ranges
> - * with !UNKNOWN_IPA that maps to ranges that are strictly within
> - * [addr, addr + size).
> + * For all ranges in direct_mt that are completely covered by the range
> + * we are TLBIing [gpa, gpa + size), remove the reverse map and its
> + * corresponding direct map together, when these conditions are met:
> + *
> + * 1. The reverse map is not UNKNOWN_IPA.
> + * 2. The reverse map is completely covered by the TLBI range.
> + * 3. The reverse map and the direct map are symmetric i.e. they map to
> + * each other, with the same size.
> + *
> + * Symmetry must be checked because there are three places where the
> + * direct map could become inconsistent:
> + *
> + * 1. Direct map removal failure during an mmu notifier in
> + * unmap_mmu_ipa_range().
> + * 2. Direct map insertion failure during an s2 fault in
> + * kvm_record_nested_revmap().
> + * 3. Direct map removal failure during a previous call of this very
> + * function.
> */
> struct maple_tree *revmap_mt = &mmu->nested_revmap_mt;
> - void *entry;
> - u64 entry_val, nested_ipa_end = nested_ipa + size;
> - u64 this_nested_ipa, this_nested_ipa_end;
> - size_t revmap_size;
> -
> - MA_STATE(mas_rev, revmap_mt, 0, ULONG_MAX);
> -
> + struct maple_tree *direct_mt = &mmu->nested_direct_mt;
> + gpa_t nested_ipa_end = nested_ipa + size - 1;
> + u64 entry_dir;
> + struct mapping {
> + u64 from;
> + u64 to;
> + size_t size;
entry_dir sounds like a directory related one, if entry_drect is too
long, perhaps entry_d? But it's up to you and Marc and Oliver.
Thanks,
Itaru.
> + };
> +
> + MA_STATE(mas_dir, direct_mt, nested_ipa, nested_ipa_end);
> mtree_lock(revmap_mt);
> - mas_for_each(&mas_rev, entry, ULONG_MAX) {
> - entry_val = xa_to_value(entry);
> - if (entry_val & UNKNOWN_IPA)
> - continue;
> -
> - revmap_size = mas_rev.last - mas_rev.index + 1;
> - this_nested_ipa = entry_val & ADDR_MASK;
> - this_nested_ipa_end = this_nested_ipa + revmap_size;
> -
> - if (this_nested_ipa >= nested_ipa &&
> - this_nested_ipa_end <= nested_ipa_end) {
> - /*
> - * As the shadow stage-2 is about to be unmapped
> - * after this function, it doesn't matter whether the
> - * removal of the reverse map failed or not.
> - */
> + entry_dir = xa_to_value(mas_find_range(&mas_dir, nested_ipa_end));
> +
> + while (entry_dir && mas_dir.index <= nested_ipa_end) {
> + struct mapping dir, rev;
> + u64 entry_rev;
> +
> + dir.from = mas_dir.index;
> + dir.to = entry_dir & ADDR_MASK;
> + dir.size = mas_dir.last - mas_dir.index + 1;
> +
> + /* Use ipa range to find the corresponding entry in revmap. */
> + MA_STATE(mas_rev, revmap_mt, dir.to, dir.to + dir.size - 1);
> + entry_rev = xa_to_value(mas_find_range(&mas_rev,
> + dir.to + dir.size - 1));
> +
> + rev.from = mas_rev.index;
> + rev.to = entry_rev & ADDR_MASK;
> + rev.size = mas_rev.last - mas_rev.index + 1;
> +
> + /* The three conditions outlined above. */
> + if (entry_rev && !(entry_rev & UNKNOWN_IPA) &&
> + dir.from >= nested_ipa &&
> + dir.from + dir.size - 1 <= nested_ipa_end &&
> + dir.from == rev.to &&
> + rev.from == dir.to &&
> + dir.size == rev.size) {
> + mas_store_gfp(&mas_dir, NULL, GFP_NOWAIT | __GFP_ACCOUNT);
> mas_store_gfp(&mas_rev, NULL, GFP_NOWAIT | __GFP_ACCOUNT);
> }
> + entry_dir = xa_to_value(mas_find_range(&mas_dir, nested_ipa_end));
> }
> mtree_unlock(revmap_mt);
> }
> @@ -826,9 +856,12 @@ void kvm_record_nested_revmap(gpa_t ipa, struct kvm_s2_mmu *mmu,
> gpa_t fault_ipa, size_t map_size)
> {
> struct maple_tree *revmap_mt = &mmu->nested_revmap_mt;
> + struct maple_tree *direct_mt = &mmu->nested_direct_mt;
> gpa_t ipa_end = ipa + map_size - 1;
> + gpa_t fault_ipa_end = fault_ipa + map_size - 1;
> u64 entry, new_entry = 0;
> MA_STATE(mas_rev, revmap_mt, ipa, ipa_end);
> + MA_STATE(mas_dir, direct_mt, fault_ipa, fault_ipa_end);
>
> if (mmu->nested_revmap_broken)
> return;
> @@ -861,6 +894,15 @@ void kvm_record_nested_revmap(gpa_t ipa, struct kvm_s2_mmu *mmu,
> if (mas_store_gfp(&mas_rev, xa_mk_value(new_entry),
> GFP_NOWAIT | __GFP_ACCOUNT))
> mmu->nested_revmap_broken = true;
> +
> + /*
> + * Add direct map but ignore the result, missing a direct map does not
> + * affect correctness.
> + */
> + if (new_entry & VALID_ENTRY && !mmu->nested_revmap_broken)
> + mas_store_gfp(&mas_dir, xa_mk_value(ipa | VALID_ENTRY),
> + GFP_NOWAIT | __GFP_ACCOUNT);
> +
> unlock:
> mtree_unlock(revmap_mt);
> }
> @@ -872,6 +914,8 @@ void kvm_init_nested_s2_mmu(struct kvm_s2_mmu *mmu)
> mmu->nested_stage2_enabled = false;
> atomic_set(&mmu->refcnt, 0);
> mt_init(&mmu->nested_revmap_mt);
> + mt_init_flags(&mmu->nested_direct_mt, MT_FLAGS_LOCK_EXTERN);
> + mt_set_external_lock(&mmu->nested_direct_mt, &mmu->nested_revmap_mt.ma_lock);
> mmu->nested_revmap_broken = false;
> }
>
> @@ -1250,7 +1294,10 @@ void kvm_nested_s2_wp(struct kvm *kvm)
>
> static void reset_revmap_and_unmap(struct kvm_s2_mmu *mmu, bool may_block)
> {
> - mtree_destroy(&mmu->nested_revmap_mt);
> + mtree_lock(&mmu->nested_revmap_mt);
> + __mt_destroy(&mmu->nested_revmap_mt);
> + __mt_destroy(&mmu->nested_direct_mt);
> + mtree_unlock(&mmu->nested_revmap_mt);
> mmu->nested_revmap_broken = false;
> kvm_stage2_unmap_range(mmu, 0, kvm_phys_size(mmu), may_block);
> }
> @@ -1259,11 +1306,14 @@ static void unmap_mmu_ipa_range(struct kvm_s2_mmu *mmu, gpa_t gpa,
> size_t unmap_size, bool may_block)
> {
> struct maple_tree *revmap_mt = &mmu->nested_revmap_mt;
> + struct maple_tree *direct_mt = &mmu->nested_direct_mt;
> gpa_t ipa = gpa;
> gpa_t ipa_end = gpa + unmap_size - 1;
> + gpa_t nested_ipa, nested_ipa_end;
> u64 entry;
> size_t entry_size;
> MA_STATE(mas_rev, revmap_mt, gpa, ipa_end);
> + MA_STATE(mas_dir, direct_mt, 0, ULONG_MAX);
>
> if (mmu->nested_revmap_broken) {
> reset_revmap_and_unmap(mmu, may_block);
> @@ -1292,6 +1342,16 @@ static void unmap_mmu_ipa_range(struct kvm_s2_mmu *mmu, gpa_t gpa,
> */
> mas_store_gfp(&mas_rev, NULL, GFP_NOWAIT | __GFP_ACCOUNT);
>
> + /*
> + * Try to also remove the direct map, it is okay if this fails,
> + * as we check for direct map consistency in
> + * kvm_remove_nested_revmap().
> + */
> + nested_ipa = entry & ADDR_MASK;
> + nested_ipa_end = nested_ipa + entry_size - 1;
> + mas_set_range(&mas_dir, nested_ipa, nested_ipa_end);
> + mas_store_gfp(&mas_dir, NULL, GFP_NOWAIT | __GFP_ACCOUNT);
> +
> mtree_unlock(revmap_mt);
> kvm_stage2_unmap_range(mmu, entry & ADDR_MASK, entry_size,
> may_block);
> --
> 2.43.0
>
^ permalink raw reply
* Re: [PATCH net-next] net: stmmac: dwmac4: Report DCB feature capability
From: Maxime Chevallier @ 2026-06-04 7:24 UTC (permalink / raw)
To: Ovidiu Panait, andrew+netdev, davem, edumazet, kuba, pabeni,
mcoquelin.stm32, alexandre.torgue, rmk+kernel, o.rempel
Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel
In-Reply-To: <20260603173644.24371-1-ovidiu.panait.rb@renesas.com>
Hi,
On 6/3/26 19:36, Ovidiu Panait wrote:
> Bit 16 of the MAC HW Feature1 register reports the DCB (Data Centre
> Bridging) feature. Read it so that dma_cap.dcben and the debugfs
> report it accurately. Right now it is always reported as being disabled.
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
This matches with what I have in the iMX8MP ref manual :)
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Thank you,
Maxime
> ---
> drivers/net/ethernet/stmicro/stmmac/dwmac4.h | 1 +
> drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c | 1 +
> 2 files changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
> index ffcd036d4c02..6382836828ba 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4.h
> @@ -198,6 +198,7 @@ enum power_event {
> #define GMAC_HW_FEAT_AVSEL BIT(20)
> #define GMAC_HW_TSOEN BIT(18)
> #define GMAC_HW_FEAT_SPHEN BIT(17)
> +#define GMAC_HW_FEAT_DCBEN BIT(16)
> #define GMAC_HW_ADDR64 GENMASK(15, 14)
> #define GMAC_HW_TXFIFOSIZE GENMASK(10, 6)
> #define GMAC_HW_RXFIFOSIZE GENMASK(4, 0)
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> index 28728271fbc9..829a23bdad01 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c
> @@ -391,6 +391,7 @@ static int dwmac4_get_hw_feature(void __iomem *ioaddr,
> dma_cap->av = (hw_cap & GMAC_HW_FEAT_AVSEL) >> 20;
> dma_cap->tsoen = (hw_cap & GMAC_HW_TSOEN) >> 18;
> dma_cap->sphen = (hw_cap & GMAC_HW_FEAT_SPHEN) >> 17;
> + dma_cap->dcben = (hw_cap & GMAC_HW_FEAT_DCBEN) >> 16;
>
> dma_cap->addr64 = (hw_cap & GMAC_HW_ADDR64) >> 14;
> switch (dma_cap->addr64) {
^ permalink raw reply
* [PATCH] coresight: ultrasoc-smb: Fix OOB write in smb_sync_perf_buffer()
From: Junrui Luo @ 2026-06-04 7:34 UTC (permalink / raw)
To: Suzuki K Poulose, Mike Leach, James Clark, Leo Yan,
Alexander Shishkin, Qi Liu, Junhao He, Jonathan Cameron
Cc: coresight, linux-arm-kernel, linux-kernel, Yuhao Jiang, stable,
Junrui Luo
When the SMB sink is used as a perf AUX sink, smb_update_buffer() calls
smb_sync_perf_buffer() to copy hardware trace data into the perf AUX ring
buffer pages. It derives pg_idx = head >> PAGE_SHIFT from @head, which is
handle->head, and indexes dst_pages[pg_idx]. The pg_idx %= nr_pages
normalization is only applied after the first loop iteration.
This leaves the initial page index underived from the buffer size, which
can result in an out-of-bounds write past dst_pages[] when head exceeds
the AUX buffer size.
Normalize head modulo the AUX buffer size before deriving the page index
and offset, mirroring tmc_etr_sync_perf_buffer().
Fixes: 06f5c2926aaa ("drivers/coresight: Add UltraSoc System Memory Buffer driver")
Reported-by: Yuhao Jiang <danisjiang@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Junrui Luo <moonafterrain@outlook.com>
---
drivers/hwtracing/coresight/ultrasoc-smb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hwtracing/coresight/ultrasoc-smb.c b/drivers/hwtracing/coresight/ultrasoc-smb.c
index 5776f63468fa..20a950b9dd4f 100644
--- a/drivers/hwtracing/coresight/ultrasoc-smb.c
+++ b/drivers/hwtracing/coresight/ultrasoc-smb.c
@@ -337,6 +337,7 @@ static void smb_sync_perf_buffer(struct smb_drv_data *drvdata,
unsigned long to_copy;
long pg_idx, pg_offset;
+ head %= (unsigned long)buf->nr_pages << PAGE_SHIFT;
pg_idx = head >> PAGE_SHIFT;
pg_offset = head & (PAGE_SIZE - 1);
---
base-commit: e43ffb69e0438cddd72aaa30898b4dc446f664f8
change-id: 20260604-fixes-edc5369a8aca
Best regards,
--
Junrui Luo <moonafterrain@outlook.com>
^ permalink raw reply related
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