Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 3/9] iio: adc: dln2-adc: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/dln2-adc.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/iio/adc/dln2-adc.c b/drivers/iio/adc/dln2-adc.c
index eb902a946efe..b01c6f5a73b1 100644
--- a/drivers/iio/adc/dln2-adc.c
+++ b/drivers/iio/adc/dln2-adc.c
@@ -444,16 +444,6 @@ static int dln2_update_scan_mode(struct iio_dev *indio_dev,
 	lval.scan_type.endianness = IIO_LE;				\
 }
 
-/* Assignment version of IIO_CHAN_SOFT_TIMESTAMP */
-#define IIO_CHAN_SOFT_TIMESTAMP_ASSIGN(lval, _si) {	\
-	lval.type = IIO_TIMESTAMP;			\
-	lval.channel = -1;				\
-	lval.scan_index = _si;				\
-	lval.scan_type.sign = 's';			\
-	lval.scan_type.realbits = 64;			\
-	lval.scan_type.storagebits = 64;		\
-}
-
 static const struct iio_info dln2_adc_info = {
 	.read_raw = dln2_adc_read_raw,
 	.write_raw = dln2_adc_write_raw,
@@ -614,7 +604,7 @@ static int dln2_adc_probe(struct platform_device *pdev)
 
 	for (i = 0; i < chans; ++i)
 		DLN2_ADC_CHAN(dln2->iio_channels[i], i)
-	IIO_CHAN_SOFT_TIMESTAMP_ASSIGN(dln2->iio_channels[i], i);
+	dln2->iio_channels[i] = IIO_CHAN_SOFT_TIMESTAMP(i);
 
 	indio_dev->name = DLN2_ADC_MOD_NAME;
 	indio_dev->info = &dln2_adc_info;

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 1/9] iio: Convert IIO_CHAN_SOFT_TIMESTAMP() to be compound literal
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner, Andy Shevchenko
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Currently IIO_CHAN_SOFT_TIMESTAMP() can only be used to fill the static
data.  In some cases it would be convenient to use it as right value in
the assignment operation. But it can't be done as is, because compiler
has no clue about the data layout. Converting it to be a compound literal
allows the above mentioned usage.

While at it, tidy up the indentation.

We also have to change existing uses of compound literal at the same
time to avoid compiler errors.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David Lechner <dlechner@baylibre.com> (fixed compile errors)
---
 drivers/iio/adc/ad7606.c   | 2 +-
 drivers/iio/adc/max11410.c | 2 +-
 include/linux/iio/iio.h    | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index d9271894f091..cebb8ed8dcb1 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -1475,7 +1475,7 @@ static int ad7606_probe_channels(struct iio_dev *indio_dev)
 	}
 
 	if (slow_bus)
-		channels[i] = (struct iio_chan_spec)IIO_CHAN_SOFT_TIMESTAMP(i);
+		channels[i] = IIO_CHAN_SOFT_TIMESTAMP(i);
 
 	indio_dev->channels = channels;
 
diff --git a/drivers/iio/adc/max11410.c b/drivers/iio/adc/max11410.c
index 69351f4f10bb..dc1b96356592 100644
--- a/drivers/iio/adc/max11410.c
+++ b/drivers/iio/adc/max11410.c
@@ -804,7 +804,7 @@ static int max11410_parse_channels(struct max11410_state *st,
 		chan_idx++;
 	}
 
-	channels[chan_idx] = (struct iio_chan_spec)IIO_CHAN_SOFT_TIMESTAMP(chan_idx);
+	channels[chan_idx] = IIO_CHAN_SOFT_TIMESTAMP(chan_idx);
 
 	indio_dev->num_channels = chan_idx + 1;
 	indio_dev->channels = channels;
diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
index 96b05c86c325..711c00f67371 100644
--- a/include/linux/iio/iio.h
+++ b/include/linux/iio/iio.h
@@ -353,15 +353,15 @@ static inline bool iio_channel_has_available(const struct iio_chan_spec *chan,
 		(chan->info_mask_shared_by_all_available & BIT(type));
 }
 
-#define IIO_CHAN_SOFT_TIMESTAMP(_si) {					\
+#define IIO_CHAN_SOFT_TIMESTAMP(_si) (struct iio_chan_spec) {		\
 	.type = IIO_TIMESTAMP,						\
 	.channel = -1,							\
 	.scan_index = _si,						\
 	.scan_type = {							\
 		.sign = 's',						\
-		.realbits = 64,					\
+		.realbits = 64,						\
 		.storagebits = 64,					\
-		},							\
+	},								\
 }
 
 s64 iio_get_time_ns(const struct iio_dev *indio_dev);

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 2/9] iio: common: scmi_sensors: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

In fact, there was an error here as the sign should be 's' instead of
'u' which is now changed to 's' by using IIO_CHAN_SOFT_TIMESTAMP().

If we find that this breaks userspace, we will have to revert this
change, but seems unlikely since the timestamp channel is well-known to
be a signed 64-bit integer globally.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/common/scmi_sensors/scmi_iio.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/iio/common/scmi_sensors/scmi_iio.c b/drivers/iio/common/scmi_sensors/scmi_iio.c
index 5136ad9ada04..442b40ef27cf 100644
--- a/drivers/iio/common/scmi_sensors/scmi_iio.c
+++ b/drivers/iio/common/scmi_sensors/scmi_iio.c
@@ -419,17 +419,6 @@ static const struct iio_chan_spec_ext_info scmi_iio_ext_info[] = {
 	{ }
 };
 
-static void scmi_iio_set_timestamp_channel(struct iio_chan_spec *iio_chan,
-					   int scan_index)
-{
-	iio_chan->type = IIO_TIMESTAMP;
-	iio_chan->channel = -1;
-	iio_chan->scan_index = scan_index;
-	iio_chan->scan_type.sign = 'u';
-	iio_chan->scan_type.realbits = 64;
-	iio_chan->scan_type.storagebits = 64;
-}
-
 static void scmi_iio_set_data_channel(struct iio_chan_spec *iio_chan,
 				      enum iio_chan_type type,
 				      enum iio_modifier mod, int scan_index)
@@ -629,7 +618,7 @@ scmi_alloc_iiodev(struct scmi_device *sdev,
 					 "Error in registering sensor update notifier for sensor %s\n",
 					 sensor->sensor_info->name);
 
-	scmi_iio_set_timestamp_channel(&iio_channels[i], i);
+	iio_channels[i] = IIO_CHAN_SOFT_TIMESTAMP(i);
 	iiodev->channels = iio_channels;
 	return iiodev;
 }

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 4/9] iio: adc: at91_adc: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/at91_adc.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/adc/at91_adc.c b/drivers/iio/adc/at91_adc.c
index 6e1930f7c65d..f610ad729bf3 100644
--- a/drivers/iio/adc/at91_adc.c
+++ b/drivers/iio/adc/at91_adc.c
@@ -481,7 +481,7 @@ static irqreturn_t at91_adc_9x5_interrupt(int irq, void *private)
 static int at91_adc_channel_init(struct iio_dev *idev)
 {
 	struct at91_adc_state *st = iio_priv(idev);
-	struct iio_chan_spec *chan_array, *timestamp;
+	struct iio_chan_spec *chan_array;
 	int bit, idx = 0;
 	unsigned long rsvd_mask = 0;
 
@@ -519,14 +519,8 @@ static int at91_adc_channel_init(struct iio_dev *idev)
 		chan->info_mask_separate = BIT(IIO_CHAN_INFO_RAW);
 		idx++;
 	}
-	timestamp = chan_array + idx;
-
-	timestamp->type = IIO_TIMESTAMP;
-	timestamp->channel = -1;
-	timestamp->scan_index = idx;
-	timestamp->scan_type.sign = 's';
-	timestamp->scan_type.realbits = 64;
-	timestamp->scan_type.storagebits = 64;
+
+	chan_array[idx] = IIO_CHAN_SOFT_TIMESTAMP(idx);
 
 	idev->channels = chan_array;
 	return idev->num_channels;

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 6/9] iio: adc: stm32-adc: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/stm32-adc.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
index 46106200bb86..5c5170b19b56 100644
--- a/drivers/iio/adc/stm32-adc.c
+++ b/drivers/iio/adc/stm32-adc.c
@@ -2443,15 +2443,7 @@ static int stm32_adc_chan_fw_init(struct iio_dev *indio_dev, bool timestamping)
 	scan_index = ret;
 
 	if (timestamping) {
-		struct iio_chan_spec *timestamp = &channels[scan_index];
-
-		timestamp->type = IIO_TIMESTAMP;
-		timestamp->channel = -1;
-		timestamp->scan_index = scan_index;
-		timestamp->scan_type.sign = 's';
-		timestamp->scan_type.realbits = 64;
-		timestamp->scan_type.storagebits = 64;
-
+		channels[scan_index] = IIO_CHAN_SOFT_TIMESTAMP(scan_index);
 		scan_index++;
 	}
 

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 5/9] iio: adc: cc10001_adc: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/cc10001_adc.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/iio/adc/cc10001_adc.c b/drivers/iio/adc/cc10001_adc.c
index 2c51b90b7101..d42b747325aa 100644
--- a/drivers/iio/adc/cc10001_adc.c
+++ b/drivers/iio/adc/cc10001_adc.c
@@ -262,7 +262,7 @@ static const struct iio_info cc10001_adc_info = {
 static int cc10001_adc_channel_init(struct iio_dev *indio_dev,
 				    unsigned long channel_map)
 {
-	struct iio_chan_spec *chan_array, *timestamp;
+	struct iio_chan_spec *chan_array;
 	unsigned int bit, idx = 0;
 
 	indio_dev->num_channels = bitmap_weight(&channel_map,
@@ -289,13 +289,7 @@ static int cc10001_adc_channel_init(struct iio_dev *indio_dev,
 		idx++;
 	}
 
-	timestamp = &chan_array[idx];
-	timestamp->type = IIO_TIMESTAMP;
-	timestamp->channel = -1;
-	timestamp->scan_index = idx;
-	timestamp->scan_type.sign = 's';
-	timestamp->scan_type.realbits = 64;
-	timestamp->scan_type.storagebits = 64;
+	chan_array[idx] = IIO_CHAN_SOFT_TIMESTAMP(idx);
 
 	indio_dev->channels = chan_array;
 

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 8/9] iio: light: cros_ec_light_prox: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Also drop obvious comment while we're at it.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/light/cros_ec_light_prox.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/iio/light/cros_ec_light_prox.c b/drivers/iio/light/cros_ec_light_prox.c
index 815806ceb5c8..d09dea9c0782 100644
--- a/drivers/iio/light/cros_ec_light_prox.c
+++ b/drivers/iio/light/cros_ec_light_prox.c
@@ -223,14 +223,8 @@ static int cros_ec_light_prox_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	/* Timestamp */
 	channel++;
-	channel->type = IIO_TIMESTAMP;
-	channel->channel = -1;
-	channel->scan_index = 1;
-	channel->scan_type.sign = 's';
-	channel->scan_type.realbits = 64;
-	channel->scan_type.storagebits = 64;
+	*channel = IIO_CHAN_SOFT_TIMESTAMP(1);
 
 	indio_dev->channels = state->channels;
 

-- 
2.43.0



^ permalink raw reply related

* [PATCH v2 7/9] iio: common: cros_ec_sensors: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:38 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, David Lechner
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Also drop obvious comment while we're at it.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/common/cros_ec_sensors/cros_ec_activity.c | 8 +-------
 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c  | 8 +-------
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c b/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c
index 6e38d115b6fe..6762685e6876 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_activity.c
@@ -279,13 +279,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
 		channel++;
 	}
 
-	/* Timestamp */
-	channel->scan_index = index;
-	channel->type = IIO_TIMESTAMP;
-	channel->channel = -1;
-	channel->scan_type.sign = 's';
-	channel->scan_type.realbits = 64;
-	channel->scan_type.storagebits = 64;
+	*channel = IIO_CHAN_SOFT_TIMESTAMP(index);
 
 	indio_dev->channels = st->channels;
 	indio_dev->num_channels = index + 1;
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
index f34e2bbba2d1..651632ccfe0d 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c
@@ -279,13 +279,7 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
 		}
 	}
 
-	/* Timestamp */
-	channel->type = IIO_TIMESTAMP;
-	channel->channel = -1;
-	channel->scan_index = CROS_EC_SENSOR_MAX_AXIS;
-	channel->scan_type.sign = 's';
-	channel->scan_type.realbits = 64;
-	channel->scan_type.storagebits = 64;
+	*channel = IIO_CHAN_SOFT_TIMESTAMP(CROS_EC_SENSOR_MAX_AXIS);
 
 	indio_dev->channels = state->channels;
 	indio_dev->num_channels = CROS_EC_SENSORS_MAX_CHANNELS;

-- 
2.43.0



^ permalink raw reply related

* Re: [PATCH v2] clk: imx: Add audio PLL debugfs for K-divider control
From: Peng Fan @ 2026-05-25  1:44 UTC (permalink / raw)
  To: Jacky Bai
  Cc: Abel Vesa, Peng Fan, Michael Turquette, Stephen Boyd,
	Brian Masney, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, linux-clk, imx, linux-arm-kernel
In-Reply-To: <20260519-imx8m_pll_debugfs-v2-1-20e1d88526b0@nxp.com>

On Tue, May 19, 2026 at 05:19:18PM +0800, Jacky Bai wrote:
>Add debugfs support for runtime tuning of the audio PLL K divider,
>which enables fine-grained frequency adjustments for audio PLL.
>This is used for:
>  - Audio clock calibration and testing
>  - Debugging audio synchronization issues
>
>Two debug interfaces are exported to userspace:
>  - delta_k: It is used to adjust the K divider in PLL based on small
>    steps
>  - pll_parameter: It is used for get PLL's current M-divider,
>    P-divider, S-divider & K-divider setting in PLL register
>
>Signed-off-by: Jacky Bai <ping.bai@nxp.com>
>---
>Changes in v2:
>- remove the examples from commit log.
>- refine the comments blocks
>- add delta_k read back support
>- resolve the comments from Sashiko AI
>- add prefix to audio_pll_debug_init API
>- Link to v1: https://lore.kernel.org/r/20260512-imx8m_pll_debugfs-v1-1-e1e44b21be90@nxp.com
>---
> drivers/clk/imx/clk-imx8mm.c  |   6 +++
> drivers/clk/imx/clk-pll14xx.c | 107 ++++++++++++++++++++++++++++++++++++++++++
> drivers/clk/imx/clk.h         |   1 +
> 3 files changed, 114 insertions(+)
>
>diff --git a/drivers/clk/imx/clk-imx8mm.c b/drivers/clk/imx/clk-imx8mm.c
>index 319af4deec01c188524807d39dff92bbd08f3601..f080a4dcead359f9494b289ebd277ef2dfdf72cd 100644
>--- a/drivers/clk/imx/clk-imx8mm.c
>+++ b/drivers/clk/imx/clk-imx8mm.c
>@@ -298,6 +298,7 @@ static struct clk_hw **hws;
> 
> static int imx8mm_clocks_probe(struct platform_device *pdev)
> {
>+	struct clk_hw *audio_pll_hws[2];
> 	struct device *dev = &pdev->dev;
> 	struct device_node *np = dev->of_node;
> 	void __iomem *base;
>@@ -610,6 +611,11 @@ static int imx8mm_clocks_probe(struct platform_device *pdev)
> 
> 	imx_register_uart_clocks();
> 
>+	/* Add debug interface for audio PLLs */
>+	audio_pll_hws[0] = hws[IMX8MM_AUDIO_PLL1];
>+	audio_pll_hws[1] = hws[IMX8MM_AUDIO_PLL2];
>+	imx_audio_pll_debug_init(audio_pll_hws, ARRAY_SIZE(audio_pll_hws));
>+
> 	return 0;
> 
> unregister_hws:
>diff --git a/drivers/clk/imx/clk-pll14xx.c b/drivers/clk/imx/clk-pll14xx.c
>index 39600ee22be3066683b562aa6f2a8b750d19c4cc..b00529cb196a22ad0444b1efdbc3b53d0e11c20b 100644
>--- a/drivers/clk/imx/clk-pll14xx.c
>+++ b/drivers/clk/imx/clk-pll14xx.c
>@@ -8,11 +8,13 @@
> #include <linux/bitfield.h>
> #include <linux/bits.h>
> #include <linux/clk-provider.h>
>+#include <linux/debugfs.h>
> #include <linux/err.h>
> #include <linux/export.h>
> #include <linux/io.h>
> #include <linux/iopoll.h>
> #include <linux/slab.h>
>+#include <linux/spinlock.h>
> #include <linux/jiffies.h>
> 
> #include "clk.h"
>@@ -40,6 +42,8 @@ struct clk_pll14xx {
> 	enum imx_pll14xx_type		type;
> 	const struct imx_pll14xx_rate_table *rate_table;
> 	int rate_count;
>+	s16 delta_k;
>+	spinlock_t lock;
> };
> 
> #define to_clk_pll14xx(_hw) container_of(_hw, struct clk_pll14xx, hw)
>@@ -361,6 +365,7 @@ static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate,
> {
> 	struct clk_pll14xx *pll = to_clk_pll14xx(hw);
> 	struct imx_pll14xx_rate_table rate;
>+	unsigned long flags;
> 	u32 gnrl_ctl, div_ctl0;
> 	int ret;
> 
>@@ -374,9 +379,13 @@ static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate,
> 		div_ctl0 |= FIELD_PREP(SDIV_MASK, rate.sdiv);
> 		writel_relaxed(div_ctl0, pll->base + DIV_CTL0);
> 
>+		spin_lock_irqsave(&pll->lock, flags);

Should this lock also protect the setting to DIV_CTL0?

>+
> 		writel_relaxed(FIELD_PREP(KDIV_MASK, rate.kdiv),
> 			       pll->base + DIV_CTL1);
> 
>+		spin_unlock_irqrestore(&pll->lock, flags);
>+
> 		return 0;
> 	}
> 
>@@ -394,8 +403,12 @@ static int clk_pll1443x_set_rate(struct clk_hw *hw, unsigned long drate,
> 		   FIELD_PREP(SDIV_MASK, rate.sdiv);
> 	writel_relaxed(div_ctl0, pll->base + DIV_CTL0);
> 
>+	spin_lock_irqsave(&pll->lock, flags);

Ditto.

>+
> 	writel_relaxed(FIELD_PREP(KDIV_MASK, rate.kdiv), pll->base + DIV_CTL1);
> 
>+	spin_unlock_irqrestore(&pll->lock, flags);
>+
> 	/*
> 	 * According to SPEC, t3 - t2 need to be greater than
> 	 * 1us and 1/FREF, respectively.
>@@ -508,6 +521,8 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name,
> 	if (!pll)
> 		return ERR_PTR(-ENOMEM);
> 
>+	spin_lock_init(&pll->lock);
>+
> 	init.name = name;
> 	init.flags = pll_clk->flags;
> 	init.parent_names = &parent_name;
>@@ -551,3 +566,95 @@ struct clk_hw *imx_dev_clk_hw_pll14xx(struct device *dev, const char *name,
> 	return hw;
> }
> EXPORT_SYMBOL_GPL(imx_dev_clk_hw_pll14xx);
>+
>+/*
>+ * Debugfs interface for Audio PLL runtime monitoring and control
>+ *
>+ * This interface allows dynamic adjustment of the Audio PLL
>+ * K-divider for precise frequency tuning, particularly useful
>+ * for audio applications.
>+ *
>+ * examples for the usage of the two interfaces:
>+ *   1): Get the current PLL setting of dividers
>+ *     cat /sys/kernel/debug/audio_pll_monitor/audio_pll1/pll_parameter
>+ *
>+ *   2): Adjust the K-divider by a small delta_k
>+ *     echo 1 > /sys/kernel/debug/audio_pll_monitor/audio_pll1/delta_k;
>+ */
>+#ifdef CONFIG_DEBUG_FS
>+static int pll_delta_k_get(void *data, u64 *val)
>+{
>+	struct clk_pll14xx *pll = to_clk_pll14xx(data);
>+	*val = pll->delta_k;
>+	return 0;
>+}
>+
>+static int pll_delta_k_set(void *data, u64 val)
>+{
>+	struct clk_pll14xx *pll = to_clk_pll14xx(data);
>+	unsigned long flags;
>+	u32 div_ctl1;
>+	s16 kdiv, delta_k;
>+
>+	delta_k = (s16)clamp_t(long, val, KDIV_MIN, KDIV_MAX);
>+	pll->delta_k = delta_k;
>+
>+	spin_lock_irqsave(&pll->lock, flags);
>+
>+	div_ctl1 = readl_relaxed(pll->base + DIV_CTL1);
>+	kdiv = (s16)FIELD_GET(KDIV_MASK, div_ctl1);
>+	kdiv = (s16)clamp_t(s32, (s32)kdiv + delta_k, KDIV_MIN, KDIV_MAX);
>+	writel_relaxed(FIELD_PREP(KDIV_MASK, kdiv), pll->base + DIV_CTL1);
>+
>+	spin_unlock_irqrestore(&pll->lock, flags);
>+
>+	return 0;
>+}
>+DEFINE_DEBUGFS_ATTRIBUTE_SIGNED(delta_k_fops, pll_delta_k_get, pll_delta_k_set, "%lld\n");
>+
>+static int pll_setting_show(struct seq_file *s, void *data)
>+{
>+	struct clk_pll14xx *pll = to_clk_pll14xx(s->private);
>+	u32 div_ctl0, div_ctl1;
>+	u32 mdiv, pdiv, sdiv, kdiv;
>+
>+	div_ctl0 = readl_relaxed(pll->base + DIV_CTL0);
>+	div_ctl1 = readl_relaxed(pll->base + DIV_CTL1);

sashiko-bot brings a valid concern, you may need to protect the read operation.

[1]https://lore.kernel.org/all/20260519095044.996B7C2BCB3@smtp.kernel.org/


Regards
Peng

>+
>+	mdiv = FIELD_GET(MDIV_MASK, div_ctl0);
>+	pdiv = FIELD_GET(PDIV_MASK, div_ctl0);
>+	sdiv = FIELD_GET(SDIV_MASK, div_ctl0);
>+	kdiv = FIELD_GET(KDIV_MASK, div_ctl1);
>+
>+	seq_printf(s, "Mdiv: 0x%x; Pdiv: 0x%x; Sdiv: 0x%x; Kdiv: 0x%x\n",
>+		   mdiv, pdiv, sdiv, kdiv);
>+
>+	return 0;
>+}
>+DEFINE_SHOW_ATTRIBUTE(pll_setting);
>+
>+void imx_audio_pll_debug_init(struct clk_hw *hws[], unsigned int num_plls)
>+{
>+	struct dentry *rootdir, *audio_pll_dir;
>+	const char *pll_name;
>+	int i;
>+
>+	rootdir = debugfs_create_dir("audio_pll_monitor", NULL);
>+
>+	for (i = 0; i < num_plls; i++) {
>+		if (!IS_ERR_OR_NULL(hws[i])) {
>+			pll_name = clk_hw_get_name(hws[i]);
>+			audio_pll_dir = debugfs_create_dir(pll_name, rootdir);
>+			debugfs_create_file_unsafe("delta_k", 0600, audio_pll_dir,
>+					hws[i], &delta_k_fops);
>+			debugfs_create_file("pll_parameter", 0444, audio_pll_dir,
>+					hws[i], &pll_setting_fops);
>+		}
>+	}
>+}
>+#else /* !CONFIG_DEBUG_FS */
>+void imx_audio_pll_debug_init(struct clk_hw *hws[], unsigned int num_plls)
>+{
>+}
>+#endif /* CONFIG_DEBUG_FS */
>+EXPORT_SYMBOL_GPL(imx_audio_pll_debug_init);
>diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
>index aa5202f284f3d1b7c1b4bf65e2329831832b43a5..16e0bafa0c9b99cb4eee37a216e0a274d27f11fc 100644
>--- a/drivers/clk/imx/clk.h
>+++ b/drivers/clk/imx/clk.h
>@@ -487,4 +487,5 @@ struct clk_hw *imx_clk_gpr_mux(const char *name, const char *compatible,
> 			       u32 reg, const char **parent_names,
> 			       u8 num_parents, const u32 *mux_table, u32 mask);
> 
>+void imx_audio_pll_debug_init(struct clk_hw **hws, unsigned int num_plls);
> #endif
>
>---
>base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
>change-id: 20260421-imx8m_pll_debugfs-246d0fbbb617
>
>Best regards,
>-- 
>Jacky Bai <ping.bai@nxp.com>
>


^ permalink raw reply

* Re: [PATCH] mmc: dw_mmc-rockchip: Add missing private data for very old controllers
From: Shawn Lin @ 2026-05-25  1:44 UTC (permalink / raw)
  To: Heiko Stuebner, ulfh, jh80.chung
  Cc: shawn.lin, linux-mmc, linux-arm-kernel, linux-rockchip,
	linux-kernel, stable
In-Reply-To: <20260522184307.2979579-1-heiko@sntech.de>

在 2026/05/23 星期六 2:43, Heiko Stuebner 写道:
> The really old controllers (rk2928, rk3066, rk3188) do not support UHS
> speeds at all, and thus never handled phase data.
> 
> For that reason it never had a parse_dt callback and no driver private
> data at all.
> 
> Commit ff6f0286c896 ("mmc: dw_mmc-rockchip: Add memory clock auto-gating
> support") makes the private data sort of mandatory, because the init
> function checks whether phases are configured internally or through the
> clock controller.
> 
> This results in the old SoCs then experiencing NULL-pointer dereferences
> when they try to access that private-data struct.
> 
> While we could have if (priv) conditionals in all places, it's way less
> cluttery to just give the old types their private-data struct.

Thanks for fixing this.

Acked-by: Shawn Lin <shawn.lin@rock-chips.com>

> 
> Fixes: ff6f0286c896 ("mmc: dw_mmc-rockchip: Add memory clock auto-gating support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
> ---
>   drivers/mmc/host/dw_mmc-rockchip.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/mmc/host/dw_mmc-rockchip.c b/drivers/mmc/host/dw_mmc-rockchip.c
> index c6eece4ec3fd..75c82ff20f17 100644
> --- a/drivers/mmc/host/dw_mmc-rockchip.c
> +++ b/drivers/mmc/host/dw_mmc-rockchip.c
> @@ -441,6 +441,22 @@ static int dw_mci_common_parse_dt(struct dw_mci *host)
>   	return 0;
>   }
>   
> +static int dw_mci_rk2928_parse_dt(struct dw_mci *host)
> +{
> +	struct dw_mci_rockchip_priv_data *priv;
> +	int err;
> +
> +	err = dw_mci_common_parse_dt(host);
> +	if (err)
> +		return err;
> +
> +	priv = host->priv;
> +
> +	priv->internal_phase = false;
> +
> +	return 0;
> +}
> +
>   static int dw_mci_rk3288_parse_dt(struct dw_mci *host)
>   {
>   	struct dw_mci_rockchip_priv_data *priv;
> @@ -514,6 +530,7 @@ static int dw_mci_rockchip_init(struct dw_mci *host)
>   
>   static const struct dw_mci_drv_data rk2928_drv_data = {
>   	.init			= dw_mci_rockchip_init,
> +	.parse_dt		= dw_mci_rk2928_parse_dt,
>   };
>   
>   static const struct dw_mci_drv_data rk3288_drv_data = {



^ permalink raw reply

* [PATCH] iio: pressure: cros_ec_baro: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:46 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: David Lechner, linux-iio, linux-kernel, linux-arm-kernel,
	linux-stm32, chrome-platform, Andy Shevchenko
In-Reply-To: <20260524-iio-timestamp-cleanup-v2-0-c37c9408b7f7@baylibre.com>

Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
manually filling in the struct iio_chan_spec fields. This makes the code
less verbose and mistake-prone.

Also drop obvious comment while we're at it.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/pressure/cros_ec_baro.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/iio/pressure/cros_ec_baro.c b/drivers/iio/pressure/cros_ec_baro.c
index c6b950c596c1..6cbde48d5be3 100644
--- a/drivers/iio/pressure/cros_ec_baro.c
+++ b/drivers/iio/pressure/cros_ec_baro.c
@@ -170,14 +170,8 @@ static int cros_ec_baro_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	/* Timestamp */
 	channel++;
-	channel->type = IIO_TIMESTAMP;
-	channel->channel = -1;
-	channel->scan_index = 1;
-	channel->scan_type.sign = 's';
-	channel->scan_type.realbits = 64;
-	channel->scan_type.storagebits = 64;
+	*channel = IIO_CHAN_SOFT_TIMESTAMP(1);
 
 	indio_dev->channels = state->channels;
 	indio_dev->num_channels = CROS_EC_BARO_MAX_CHANNELS;
-- 
2.43.0



^ permalink raw reply related

* Re: [PATCH] iio: pressure: cros_ec_baro: simplify timestamp channel definition
From: David Lechner @ 2026-05-25  1:49 UTC (permalink / raw)
  To: Jyoti Bhayana, Jonathan Cameron, Nuno Sá, Andy Shevchenko,
	Nicolas Ferre, Alexandre Belloni, Claudiu Beznea, Maxime Coquelin,
	Alexandre Torgue, Benson Leung, Guenter Roeck
  Cc: linux-iio, linux-kernel, linux-arm-kernel, linux-stm32,
	chrome-platform, Andy Shevchenko
In-Reply-To: <20260525014654.2399354-1-dlechner@baylibre.com>

On 5/24/26 8:46 PM, David Lechner wrote:
> Use IIO_CHAN_SOFT_TIMESTAMP() to define the timestamp channel instead of
> manually filling in the struct iio_chan_spec fields. This makes the code
> less verbose and mistake-prone.
> 
FYI, there was a server error when doing b4 send, so this last patch
didn't get sent with the rest. I missed the [PATCH v2 9/9] when editing
it manually to send again.



^ permalink raw reply

* Re: [PATCH 3/5] arm64: dts: freescale: imx95-toradex-smarc: move CM7 node to SoC DTSI
From: Peng Fan @ 2026-05-25  2:15 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
	Peng Fan, Fabio Estevam, Pengutronix Kernel Team,
	linux-remoteproc, devicetree, imx, linux-arm-kernel, linux-kernel
In-Reply-To: <20260522111849.783-4-laurentiumihalcea111@gmail.com>

On Fri, May 22, 2026 at 04:18:47AM -0700, Laurentiu Mihalcea wrote:
>From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
>The CM7 remoteproc configuration is common to multiple MX95-based
>platforms (e.g. MX95-19x19-EVK, MX95-15x15-FRDM, SMARC-IMX95, etc.).
>Therefore, move the node to the MX95 SoC DTSI. While at it, split the mbox
>channels using <>.
>
>Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>---
> .../boot/dts/freescale/imx95-toradex-smarc.dtsi    | 14 ++++++--------
> arch/arm64/boot/dts/freescale/imx95.dtsi           |  7 +++++++
> 2 files changed, 13 insertions(+), 8 deletions(-)
>
>diff --git a/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi b/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi
>index 7d760470201f..c94a63a3bf8f 100644
>--- a/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi
>+++ b/arch/arm64/boot/dts/freescale/imx95-toradex-smarc.dtsi
>@@ -145,14 +145,6 @@ reg_wifi_en: regulator-wifi-en {
> 		startup-delay-us = <2000>;
> 	};
> 
>-	remoteproc-cm7 {
>-		compatible = "fsl,imx95-cm7";
>-		mboxes = <&mu7 0 1 &mu7 1 1 &mu7 3 1>;
>-		mbox-names = "tx", "rx", "rxdb";
>-		memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
>-				<&vdev1vring0>, <&vdev1vring1>, <&rsc_table>, <&m7_reserved>;
>-	};
>-
> 	reserved-memory {
> 		#address-cells = <2>;
> 		#size-cells = <2>;
>@@ -204,6 +196,12 @@ vdevbuffer: vdevbuffer@88020000 {
> 	};
> };
> 
>+&cm7 {
>+	memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>,
>+			<&vdev1vring0>, <&vdev1vring1>, <&rsc_table>, <&m7_reserved>;
>+	status = "okay";
>+};
>+
> /* SMARC GBE0 */
> &enetc_port0 {
> 	pinctrl-names = "default";
>diff --git a/arch/arm64/boot/dts/freescale/imx95.dtsi b/arch/arm64/boot/dts/freescale/imx95.dtsi
>index 3e35c956a4d7..f8760ac067fa 100644
>--- a/arch/arm64/boot/dts/freescale/imx95.dtsi
>+++ b/arch/arm64/boot/dts/freescale/imx95.dtsi
>@@ -272,6 +272,13 @@ opp-1000000000 {
> 		};
> 	};
> 
>+	cm7: remoteproc-cm7 {
>+		compatible = "fsl,imx95-cm7";
>+		mboxes = <&mu7 0 1>, <&mu7 1 1>, <&mu7 3 1>;
>+		mbox-names = "tx", "rx", "rxdb";

Please not put mboxes and mbox-names in dtsi. Some demos may not
require them and boards may use different MUs.

Regards
Peng

>+		status = "disabled";
>+	};
>+
> 	clk_ext1: clock-ext1 {
> 		compatible = "fixed-clock";
> 		#clock-cells = <0>;
>-- 
>2.43.0
>


^ permalink raw reply

* Re: [PATCH 2/5] remoteproc: imx_rpoc: fix carveout name parsing
From: Peng Fan @ 2026-05-25  2:13 UTC (permalink / raw)
  To: Laurentiu Mihalcea
  Cc: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
	Peng Fan, Fabio Estevam, Pengutronix Kernel Team,
	linux-remoteproc, devicetree, imx, linux-arm-kernel, linux-kernel
In-Reply-To: <20260522111849.783-3-laurentiumihalcea111@gmail.com>

On Fri, May 22, 2026 at 04:18:46AM -0700, Laurentiu Mihalcea wrote:
>From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>
>The imx remoteproc driver assumes that the names of the reserved memory
>regions reflect their usage (e.g. "vdevbuffer", "vdev0vring0", etc.). This
>conflicts with the devicetree specification's recommendation, which states
>that the names of the devicetree nodes should be generic.
>
>Therefore, instead of relying on the node names, use the names passed via
>the "memory-region-names" property if present. Otherwise, keep the old
>behavior.
>
>The definition of imx_rproc_rmem_to_resource() is added to a common place
>as imx_dsp_rproc.c can also use it given that it suffers from the same
>aforementioned problem.
>
>Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>---
> drivers/remoteproc/imx_rproc.c |  7 +++++--
> drivers/remoteproc/imx_rproc.h | 19 +++++++++++++++++++
> 2 files changed, 24 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
>index 7f54322244ac..1ee1c658dcc1 100644
>--- a/drivers/remoteproc/imx_rproc.c
>+++ b/drivers/remoteproc/imx_rproc.c
>@@ -672,7 +672,7 @@ static int imx_rproc_prepare(struct rproc *rproc)
> 		int err;
> 		struct resource res;
> 
>-		err = of_reserved_mem_region_to_resource(np, i++, &res);
>+		err = imx_rproc_rmem_to_resource(np, i++, &res);
> 		if (err)
> 			break;
> 
>@@ -850,11 +850,14 @@ static int imx_rproc_addr_init(struct imx_rproc *priv,
> 	if (nph <= 0)
> 		return 0;
> 
>+	if (!of_property_present(np, "memory-region-names"))
>+		dev_warn(dev, "using node names for carveouts should be avoided\n");

Please check 'memory-regions && !memory-region-names', some demos may not
need to use memory regions.

Regards
Peng

>+
> 	/* remap optional addresses */
> 	for (a = 0; a < nph; a++) {
> 		struct resource res;
> 
>-		err = of_reserved_mem_region_to_resource(np, a, &res);
>+		err = imx_rproc_rmem_to_resource(np, a, &res);
> 		if (err) {
> 			dev_err(dev, "unable to resolve memory region\n");
> 			return err;
>diff --git a/drivers/remoteproc/imx_rproc.h b/drivers/remoteproc/imx_rproc.h
>index 0d7d48352a10..58e9daa41afe 100644
>--- a/drivers/remoteproc/imx_rproc.h
>+++ b/drivers/remoteproc/imx_rproc.h
>@@ -45,4 +45,23 @@ struct imx_rproc_dcfg {
> 	u32				reset_vector_mask;
> };
> 
>+static inline int imx_rproc_rmem_to_resource(struct device_node *np,
>+					     int index,
>+					     struct resource *res)
>+{
>+	int ret;
>+
>+	ret = of_reserved_mem_region_to_resource(np, index, res);
>+	if (ret)
>+		return ret;
>+
>+	/* "memory-region-names" is optional */
>+	ret = of_property_read_string_index(np, "memory-region-names",
>+					    index, &res->name);
>+	if (ret == -EINVAL)
>+		return 0;
>+
>+	return ret;
>+}
>+
> #endif /* _IMX_RPROC_H */
>-- 
>2.43.0
>


^ permalink raw reply

* [PATCH v1] ARM: socfpga: Fix OF node refcount leak in SMP setup
From: Yuho Choi @ 2026-05-25  2:31 UTC (permalink / raw)
  To: Dinh Nguyen, Russell King; +Cc: linux-arm-kernel, linux-kernel, Yuho Choi

socfpga_smp_prepare_cpus() looks up the Cortex-A9 SCU node with
of_find_compatible_node(), which returns a node reference that must be
released with of_node_put().

The function maps the SCU registers and then returns without dropping
that reference, leaking the node on both the success path and the
of_iomap() failure path.

Drop the reference once the mapping attempt is complete. The returned
MMIO mapping does not depend on keeping the device node reference held.

Fixes: 122694a0c712 ("ARM: socfpga: use of_iomap to map the SCU")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 arch/arm/mach-socfpga/platsmp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 201191cf68f3..349e6c54518e 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -78,6 +78,7 @@ static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
 	}
 
 	socfpga_scu_base_addr = of_iomap(np, 0);
+	of_node_put(np);
 	if (!socfpga_scu_base_addr)
 		return;
 	scu_enable(socfpga_scu_base_addr);
-- 
2.43.0



^ permalink raw reply related

* [PATCH v1] ARM: socfpga: Fix OF node refcount leak in SMP setup
From: Yuho Choi @ 2026-05-25  2:47 UTC (permalink / raw)
  To: Dinh Nguyen, Russell King; +Cc: linux-arm-kernel, linux-kernel, Yuho Choi

socfpga_smp_prepare_cpus() looks up the Cortex-A9 SCU node with
of_find_compatible_node(), which returns a node reference that must be
released with of_node_put().

The function maps the SCU registers and then returns without dropping
that reference, leaking the node on both the success path and the
of_iomap() failure path.

Drop the reference once the mapping attempt is complete. The returned
MMIO mapping does not depend on keeping the device node reference held.

Fixes: 122694a0c712 ("ARM: socfpga: use of_iomap to map the SCU")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 arch/arm/mach-socfpga/platsmp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 201191cf68f3..349e6c54518e 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -78,6 +78,7 @@ static void __init socfpga_smp_prepare_cpus(unsigned int max_cpus)
 	}
 
 	socfpga_scu_base_addr = of_iomap(np, 0);
+	of_node_put(np);
 	if (!socfpga_scu_base_addr)
 		return;
 	scu_enable(socfpga_scu_base_addr);
-- 
2.43.0



^ permalink raw reply related

* [PATCH v5] i2c: imx: mark I2C adapter when hardware is powered down
From: Carlos Song (OSS) @ 2026-05-25  3:04 UTC (permalink / raw)
  To: o.rempel, kernel, andi.shyti, s.hauer, festevam, carlos.song,
	haibo.chen
  Cc: linux-i2c, imx, linux-arm-kernel, linux-kernel, stable

From: Carlos Song <carlos.song@nxp.com>

On some i.MX platforms, certain I2C client drivers keep a periodic
workqueue which continues to trigger I2C transfers.

During system suspend/resume, there exists a time window between:
  - suspend_noirq and the system entering suspend
  - the system starting to resume and resume_noirq

In this window, the I2C controller resources such as clock and pinctrl
may already be disabled or not yet restored.

If a workqueue triggers an I2C transfer in this period, the driver
attempts to access I2C registers while the hardware resources are
unavailable, which may lead to system hang.

Mark the I2C adapter as suspended during noirq suspend and block new
transfers until resume, ensuring that I2C transfers are only issued
when hardware resources are available.

Fixes: 358025ac091e ("i2c: imx: make controller available until system suspend_noirq() and from resume_noirq()")
Cc: stable@vger.kernel.org
Signed-off-by: Carlos Song <carlos.song@nxp.com>
---
Change for v5:
  - Remake commit log including the issue detail from Mukesh's
    suggestion.
Change for v4:
  - Restore hrtimer when pm_runtime_force_suspend failed when slave mode
    enabled.
Change for v3:
  - Add hrtimer_cancel in i2c_imx_suspend_noirq to cancel slave_timer for
    safe suspend in i2c slave mode.
Change for v2:
  - Call i2c_mark_adapter_suspended() before pm_runtime_force_suspend()
    to prevent potential deadlock if a transfer is active during suspend.
  - Roll back with i2c_mark_adapter_resumed() if pm_runtime_force_suspend()
    fails.
---
 drivers/i2c/busses/i2c-imx.c | 45 ++++++++++++++++++++++++++++++++++--
 1 file changed, 43 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 28313d0fad37..73317ddd5f02 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -1922,6 +1922,47 @@ static int i2c_imx_runtime_resume(struct device *dev)
 	return 0;
 }
 
+static int __maybe_unused i2c_imx_suspend_noirq(struct device *dev)
+{
+	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
+	int ret;
+
+	i2c_mark_adapter_suspended(&i2c_imx->adapter);
+
+	/*
+	 * Cancel the slave timer before powering down to prevent
+	 * i2c_imx_slave_timeout() from accessing hardware registers
+	 * while the clock is disabled.
+	 */
+	hrtimer_cancel(&i2c_imx->slave_timer);
+
+	ret = pm_runtime_force_suspend(dev);
+	if (ret) {
+		i2c_mark_adapter_resumed(&i2c_imx->adapter);
+		if (i2c_imx->slave) {
+			hrtimer_forward_now(&i2c_imx->slave_timer, I2C_IMX_CHECK_DELAY);
+			hrtimer_restart(&i2c_imx->slave_timer);
+		}
+		return ret;
+	}
+
+	return 0;
+}
+
+static int __maybe_unused i2c_imx_resume_noirq(struct device *dev)
+{
+	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
+	int ret;
+
+	ret = pm_runtime_force_resume(dev);
+	if (ret)
+		return ret;
+
+	i2c_mark_adapter_resumed(&i2c_imx->adapter);
+
+	return 0;
+}
+
 static int i2c_imx_suspend(struct device *dev)
 {
 	/*
@@ -1955,8 +1996,8 @@ static int i2c_imx_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops i2c_imx_pm_ops = {
-	NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-				  pm_runtime_force_resume)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(i2c_imx_suspend_noirq,
+				  i2c_imx_resume_noirq)
 	SYSTEM_SLEEP_PM_OPS(i2c_imx_suspend, i2c_imx_resume)
 	RUNTIME_PM_OPS(i2c_imx_runtime_suspend, i2c_imx_runtime_resume, NULL)
 };
-- 
2.43.0



^ permalink raw reply related

* [PATCH v3] i2c: imx-lpi2c: mark I2C adapter when hardware is powered down
From: Carlos Song (OSS) @ 2026-05-25  3:14 UTC (permalink / raw)
  To: aisheng.dong, andi.shyti, Frank.Li, s.hauer, kernel, festevam,
	carlos.song
  Cc: linux-i2c, imx, linux-arm-kernel, linux-kernel, stable

From: Carlos Song <carlos.song@nxp.com>

On some i.MX platforms, certain I2C client drivers keep a periodic
workqueue which continues to trigger I2C transfers.

During system suspend/resume, there exists a time window between:
  - suspend_noirq and the system entering suspend
  - the system starting to resume and resume_noirq

In this window, the I2C controller resources such as clock and pinctrl
may already be disabled or not yet restored.

If a workqueue triggers an I2C transfer in this period, the driver
attempts to access I2C registers while the hardware resources are
unavailable, which may lead to system hang.

Mark the I2C adapter as suspended during noirq suspend and block new
transfers until resume, ensuring that I2C transfers are only issued
when hardware resources are available.

Fixes: 1ee867e465c1 ("i2c: imx-lpi2c: add target mode support")
Cc: stable@vger.kernel.org
Signed-off-by: Carlos Song <carlos.song@nxp.com>
---
Change for v3:
  - Remake commit log including the issue detail.
Change for v2:
  - Call i2c_mark_adapter_suspended() before pm_runtime_force_suspend()
    to prevent potential deadlock if a transfer is active during suspend.
  - Roll back with i2c_mark_adapter_resumed() if pm_runtime_force_suspend()
    fails.
---
 drivers/i2c/busses/i2c-imx-lpi2c.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index 7adbeae9cb35..4929f85ab485 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -1668,7 +1668,18 @@ static int __maybe_unused lpi2c_runtime_resume(struct device *dev)
 
 static int __maybe_unused lpi2c_suspend_noirq(struct device *dev)
 {
-	return pm_runtime_force_suspend(dev);
+	struct lpi2c_imx_struct *lpi2c_imx = dev_get_drvdata(dev);
+	int ret;
+
+	i2c_mark_adapter_suspended(&lpi2c_imx->adapter);
+
+	ret = pm_runtime_force_suspend(dev);
+	if (ret) {
+		i2c_mark_adapter_resumed(&lpi2c_imx->adapter);
+		return ret;
+	}
+
+	return 0;
 }
 
 static int __maybe_unused lpi2c_resume_noirq(struct device *dev)
@@ -1688,6 +1699,8 @@ static int __maybe_unused lpi2c_resume_noirq(struct device *dev)
 	if (lpi2c_imx->target)
 		lpi2c_imx_target_init(lpi2c_imx);
 
+	i2c_mark_adapter_resumed(&lpi2c_imx->adapter);
+
 	return 0;
 }
 
-- 
2.43.0



^ permalink raw reply related

* [PATCH v1] ARM: highbank: Fix OF node refcount leaks
From: Yuho Choi @ 2026-05-25  3:13 UTC (permalink / raw)
  To: Andre Przywara, Russell King; +Cc: linux-arm-kernel, linux-kernel, Yuho Choi

highbank_init_irq() checks for a Cortex-A9 node with
of_find_compatible_node(), but uses the returned node only as a boolean
and drops the pointer without releasing the reference.

highbank_init() has the same issue for the Calxeda system registers
node after mapping it with of_iomap(). of_iomap() does not consume the
device node reference.

Release both node references after the corresponding use.

Fixes: 7a2848d369b2 ("ARM: highbank: abstract out SCU usage")
Fixes: 26cae166cff9 ("ARM: highbank: remove custom .init_time hook")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 arch/arm/mach-highbank/highbank.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index 47335c7dadf8..430f1ca125d3 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -50,10 +50,15 @@ static void highbank_l2c310_write_sec(unsigned long val, unsigned reg)
 
 static void __init highbank_init_irq(void)
 {
+	struct device_node *np;
+
 	irqchip_init();
 
-	if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9"))
+	np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9");
+	if (np) {
+		of_node_put(np);
 		highbank_scu_map_io();
+	}
 }
 
 static void highbank_power_off(void)
@@ -141,6 +146,7 @@ static void __init highbank_init(void)
 	/* Map system registers */
 	np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
 	sregs_base = of_iomap(np, 0);
+	of_node_put(np);
 	WARN_ON(!sregs_base);
 
 	register_platform_power_off(highbank_power_off);
-- 
2.43.0



^ permalink raw reply related

* Re: [PATCH 13/16] media: sun6i-isp: Add dummy params link_validate implementation
From: arash golgol @ 2026-05-25  3:25 UTC (permalink / raw)
  To: Paul Kocialkowski
  Cc: linux-media, linux-arm-kernel, linux-sunxi, linux-kernel,
	linux-staging, Mauro Carvalho Chehab, Chen-Yu Tsai,
	Jernej Skrabec, Samuel Holland, Greg Kroah-Hartman,
	Laurent Pinchart, Nicolas Dufresne
In-Reply-To: <20260518102451.417971-14-paulk@sys-base.io>

Hi Paul,

On Mon, May 18, 2026 at 2:01 PM Paul Kocialkowski <paulk@sys-base.io> wrote:
>
> There isn't anything configurable about the params video device link,
> but the v4l2 core complains that no op is provided so implement a dummy
> one to make it happy.
>
> Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
> ---
>  .../media/sunxi/sun6i-isp/sun6i_isp_params.c     | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> index 77c2d06c0436..b7ef33fa2b13 100644
> --- a/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> +++ b/drivers/staging/media/sunxi/sun6i-isp/sun6i_isp_params.c
> @@ -450,6 +450,18 @@ static const struct v4l2_file_operations sun6i_isp_params_fops = {
>         .poll           = vb2_fop_poll,
>  };
>
> +/* Media Entity */
> +
> +static int sun6i_isp_params_link_validate(struct media_link *link)
> +{
> +       /* Nothing to validate here. */
> +       return 0;
> +}
> +
> +static const struct media_entity_operations sun6i_isp_params_entity_ops = {
> +       .link_validate  = sun6i_isp_params_link_validate,
> +};
> +
>  /* Params */
>
>  int sun6i_isp_params_setup(struct sun6i_isp_device *isp_dev)
> @@ -470,6 +482,10 @@ int sun6i_isp_params_setup(struct sun6i_isp_device *isp_dev)
>         INIT_LIST_HEAD(&state->queue);
>         spin_lock_init(&state->lock);
>
> +       /* Media Entity */
> +
> +       video_dev->entity.ops = &sun6i_isp_params_entity_ops;
> +
>         /* Media Pads */
>
>         pad->flags = MEDIA_PAD_FL_SOURCE | MEDIA_PAD_FL_MUST_CONNECT;
> --
> 2.54.0
>

Tested on a LicheePi Zero Dock (V3s) with the following pipeline:

ov5647 -> sun6i-mipi-csi2 -> sun6i-csi-bridge -> sun6i-isp-proc ->
sun6i-isp-capture

I verified that streaming through the ISP pipeline works correctly
after this change and that the previous .link_validate() warning for
'sun6i-isp-params' device is no longer triggered.

Tested-by: Arash Golgol <arash.golgol@gmail.com>

-- 
Regards,
Arash Golgol


^ permalink raw reply

* [PATCH v1] ARM: npcm: Fix OF node refcount leaks in SMP setup
From: Yuho Choi @ 2026-05-25  3:38 UTC (permalink / raw)
  To: Andrew Jeffery, Avi Fishman, Tomer Maimon, Tali Perry
  Cc: Patrick Venture, Nancy Yuen, Benjamin Fair, Russell King, openbmc,
	linux-arm-kernel, linux-kernel, Yuho Choi

npcm7xx_smp_boot_secondary() and npcm7xx_smp_prepare_cpus() look up
the GCR and SCU nodes with of_find_compatible_node(). The returned
nodes are used for of_iomap(), but the node references are never
released.

of_iomap() does not consume the device node reference, and iounmap()
only releases the MMIO mapping. Drop each node reference after the
corresponding mapping attempt.

Fixes: 7bffa14c9aed ("arm: npcm: add basic support for Nuvoton BMCs")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 arch/arm/mach-npcm/platsmp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-npcm/platsmp.c b/arch/arm/mach-npcm/platsmp.c
index 41891d3aa124..4c1fc9983746 100644
--- a/arch/arm/mach-npcm/platsmp.c
+++ b/arch/arm/mach-npcm/platsmp.c
@@ -32,6 +32,7 @@ static int npcm7xx_smp_boot_secondary(unsigned int cpu,
 		goto out;
 	}
 	gcr_base = of_iomap(gcr_np, 0);
+	of_node_put(gcr_np);
 	if (!gcr_base) {
 		pr_err("could not iomap gcr");
 		ret = -ENOMEM;
@@ -60,6 +61,7 @@ static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus)
 		return;
 	}
 	scu_base = of_iomap(scu_np, 0);
+	of_node_put(scu_np);
 	if (!scu_base) {
 		pr_err("could not iomap scu");
 		return;
-- 
2.43.0



^ permalink raw reply related

* [PATCH v1] ARM: imx31: Fix IIM mapping leak in revision check
From: Yuho Choi @ 2026-05-25  4:01 UTC (permalink / raw)
  To: Frank Li, Sascha Hauer
  Cc: Russell King, Pengutronix Kernel Team, Fabio Estevam,
	linux-arm-kernel, imx, linux-kernel, Yuho Choi

mx31_read_cpu_rev() maps the IIM registers with of_iomap() to read the
silicon revision, but returns without unmapping the MMIO mapping.

Keep the normalized revision value in a local variable and route the
return path through iounmap() after the revision register has been read.

Fixes: 3172225d45bd ("ARM: imx31: Retrieve the IIM base address from devicetree")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
---
 arch/arm/mach-imx/cpu-imx31.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/cpu-imx31.c b/arch/arm/mach-imx/cpu-imx31.c
index 35c544924e50..e81ef9e36a1f 100644
--- a/arch/arm/mach-imx/cpu-imx31.c
+++ b/arch/arm/mach-imx/cpu-imx31.c
@@ -36,6 +36,7 @@ static int mx31_read_cpu_rev(void)
 	void __iomem *iim_base;
 	struct device_node *np;
 	u32 i, srev;
+	int rev = IMX_CHIP_REVISION_UNKNOWN;
 
 	np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim");
 	iim_base = of_iomap(np, 0);
@@ -48,13 +49,17 @@ static int mx31_read_cpu_rev(void)
 
 	for (i = 0; i < ARRAY_SIZE(mx31_cpu_type); i++)
 		if (srev == mx31_cpu_type[i].srev) {
+			rev = mx31_cpu_type[i].rev;
 			imx_print_silicon_rev(mx31_cpu_type[i].name,
 						mx31_cpu_type[i].rev);
-			return mx31_cpu_type[i].rev;
+			goto out;
 		}
 
 	imx_print_silicon_rev("i.MX31", IMX_CHIP_REVISION_UNKNOWN);
-	return IMX_CHIP_REVISION_UNKNOWN;
+
+out:
+	iounmap(iim_base);
+	return rev;
 }
 
 int mx31_revision(void)
-- 
2.43.0



^ permalink raw reply related

* [PATCH 0/7] firmware: imx: ele: misc fixes
From: Peng Fan (OSS) @ 2026-05-25  5:39 UTC (permalink / raw)
  To: Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Frieder Schrempf, Pankaj Gupta
  Cc: imx, linux-arm-kernel, linux-kernel, Peng Fan

Misc fixes when reading the ele driver, including check condition, size
mismatch and etc. More information could be found in each patch commit
log.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
Peng Fan (7):
      firmware: imx: ele: Correct check condition in se_if_rx_callback
      firmware: imx: ele: Correct ele_fw_authenticate API
      firmware: imx: ele: Bypass memcpy when ele_get_info() fails
      firmware: imx: ele: simplify SoC device registration
      firmware: imx: ele: Correct check_hdr_exception_for_sz
      firmware: imx: ele: Use dev_err for error report
      firmware: imx: ele: Fix debug dump size handling

 drivers/firmware/imx/ele_base_msg.c | 15 +++++++++++----
 drivers/firmware/imx/ele_common.c   |  4 ++--
 drivers/firmware/imx/se_ctrl.c      | 15 ++++-----------
 3 files changed, 17 insertions(+), 17 deletions(-)
---
base-commit: c1ecb239fa3456529a32255359fc78b69eb9d847
change-id: 20260525-ele-v1-e1da1ffc882e

Best regards,
-- 
Peng Fan <peng.fan@nxp.com>



^ permalink raw reply

* [PATCH 2/7] firmware: imx: ele: Correct ele_fw_authenticate API
From: Peng Fan (OSS) @ 2026-05-25  5:39 UTC (permalink / raw)
  To: Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Frieder Schrempf, Pankaj Gupta
  Cc: imx, linux-arm-kernel, linux-kernel, Peng Fan
In-Reply-To: <20260525-ele-v1-v1-0-a9570c4bffc9@nxp.com>

From: Peng Fan <peng.fan@nxp.com>

The command format is as:
0(32bits): Header
1(32bits): Address of the container header
2(32bits): Reserved for future
3(32bits): Actual address of the container header

Correct the data field to only use lower 32bits. If upper 32bits are
not zero, fail the command.

Fixes: 106ffe5d78ad8 ("firmware: imx: add driver for NXP EdgeLock Enclave")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/imx/ele_base_msg.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/imx/ele_base_msg.c b/drivers/firmware/imx/ele_base_msg.c
index 23f68076b85ce3ac0293bb98e39310e20834f7db..f6346f15450963b9dd8d2df7d3e6b2ce6b4602ce 100644
--- a/drivers/firmware/imx/ele_base_msg.c
+++ b/drivers/firmware/imx/ele_base_msg.c
@@ -208,6 +208,11 @@ int ele_fw_authenticate(struct se_if_priv *priv, phys_addr_t contnr_addr,
 	if (!priv)
 		return -EINVAL;
 
+	if (upper_32_bits(contnr_addr) || upper_32_bits(img_addr)) {
+		dev_err(priv->dev, "Wrong address: %pap %pap\n", &contnr_addr, &img_addr);
+		return -EINVAL;
+	}
+
 	struct se_api_msg *tx_msg __free(kfree)	=
 		kzalloc(ELE_FW_AUTH_REQ_SZ, GFP_KERNEL);
 	if (!tx_msg)
@@ -224,8 +229,8 @@ int ele_fw_authenticate(struct se_if_priv *priv, phys_addr_t contnr_addr,
 		return ret;
 
 	tx_msg->data[0] = lower_32_bits(contnr_addr);
-	tx_msg->data[1] = upper_32_bits(contnr_addr);
-	tx_msg->data[2] = img_addr;
+	tx_msg->data[1] = 0;
+	tx_msg->data[2] = lower_32_bits(img_addr);
 
 	ret = ele_msg_send_rcv(priv->priv_dev_ctx, tx_msg, ELE_FW_AUTH_REQ_SZ, rx_msg,
 			       ELE_FW_AUTH_RSP_MSG_SZ);

-- 
2.37.1



^ permalink raw reply related

* [PATCH 1/7] firmware: imx: ele: Correct check condition in se_if_rx_callback
From: Peng Fan (OSS) @ 2026-05-25  5:39 UTC (permalink / raw)
  To: Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	Frieder Schrempf, Pankaj Gupta
  Cc: imx, linux-arm-kernel, linux-kernel, Peng Fan
In-Reply-To: <20260525-ele-v1-v1-0-a9570c4bffc9@nxp.com>

From: Peng Fan <peng.fan@nxp.com>

Reverse logic should be used when checking whether response is correct.
The logic should be when size not match and API is not listed in
exception list, return failure.

Fixes: 106ffe5d78ad8 ("firmware: imx: add driver for NXP EdgeLock Enclave")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/firmware/imx/ele_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/imx/ele_common.c b/drivers/firmware/imx/ele_common.c
index e5117a1f19959ec8dcfb313040121e20be0e92be..8daf32eded43c62daf56540b63e292bf0c6c9845 100644
--- a/drivers/firmware/imx/ele_common.c
+++ b/drivers/firmware/imx/ele_common.c
@@ -219,7 +219,7 @@ void se_if_rx_callback(struct mbox_client *mbox_cl, void *msg)
 			se_clbk_hdl->dev_ctx->devname, *(u32 *)header);
 
 		if (rx_msg_sz != se_clbk_hdl->rx_msg_sz &&
-		    check_hdr_exception_for_sz(priv, header)) {
+		    !check_hdr_exception_for_sz(priv, header)) {
 			dev_err(dev,
 				"%s: Rsp to CMD: hdr(0x%x) with different sz(%d != %d).\n",
 				se_clbk_hdl->dev_ctx->devname, *(u32 *)header,

-- 
2.37.1



^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox