Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* [PATCH v1 04/13] ASoC: uda1380: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 sound/soc/codecs/uda1380.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 4f8fdd574585..c179d865b938 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -766,10 +766,8 @@ static int uda1380_i2c_probe(struct i2c_client *i2c)
 			return ret;
 	}
 
-	uda1380->reg_cache = devm_kmemdup(&i2c->dev,
-					uda1380_reg,
-					ARRAY_SIZE(uda1380_reg) * sizeof(u16),
-					GFP_KERNEL);
+	uda1380->reg_cache = devm_kmemdup_array(&i2c->dev, uda1380_reg, ARRAY_SIZE(uda1380_reg),
+						sizeof(uda1380_reg[0]), GFP_KERNEL);
 	if (!uda1380->reg_cache)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 05/13] ASoC: meson: axg-tdm-interface: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 sound/soc/meson/axg-tdm-interface.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sound/soc/meson/axg-tdm-interface.c b/sound/soc/meson/axg-tdm-interface.c
index 09103eef2a97..421b5d719fb3 100644
--- a/sound/soc/meson/axg-tdm-interface.c
+++ b/sound/soc/meson/axg-tdm-interface.c
@@ -529,7 +529,6 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct snd_soc_dai_driver *dai_drv;
 	struct axg_tdm_iface *iface;
-	int i;
 
 	iface = devm_kzalloc(dev, sizeof(*iface), GFP_KERNEL);
 	if (!iface)
@@ -541,15 +540,11 @@ static int axg_tdm_iface_probe(struct platform_device *pdev)
 	 * We'll change the number of channel provided by DAI stream, so dpcm
 	 * channel merge can be done properly
 	 */
-	dai_drv = devm_kcalloc(dev, ARRAY_SIZE(axg_tdm_iface_dai_drv),
-			       sizeof(*dai_drv), GFP_KERNEL);
+	dai_drv = devm_kmemdup_array(dev, axg_tdm_iface_dai_drv, ARRAY_SIZE(axg_tdm_iface_dai_drv),
+				     sizeof(axg_tdm_iface_dai_drv[0]), GFP_KERNEL);
 	if (!dai_drv)
 		return -ENOMEM;
 
-	for (i = 0; i < ARRAY_SIZE(axg_tdm_iface_dai_drv); i++)
-		memcpy(&dai_drv[i], &axg_tdm_iface_dai_drv[i],
-		       sizeof(*dai_drv));
-
 	/* Bit clock provided on the pad */
 	iface->sclk = devm_clk_get(dev, "sclk");
 	if (IS_ERR(iface->sclk))
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 06/13] ASoC: uniphier: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 sound/soc/uniphier/aio-cpu.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/sound/soc/uniphier/aio-cpu.c b/sound/soc/uniphier/aio-cpu.c
index 470f129166a4..3224c11a527f 100644
--- a/sound/soc/uniphier/aio-cpu.c
+++ b/sound/soc/uniphier/aio-cpu.c
@@ -762,14 +762,10 @@ int uniphier_aio_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	chip->num_plls = chip->chip_spec->num_plls;
-	chip->plls = devm_kcalloc(dev,
-				  chip->num_plls,
-				  sizeof(struct uniphier_aio_pll),
-				  GFP_KERNEL);
+	chip->plls = devm_kmemdup_array(dev, chip->chip_spec->plls, chip->num_plls,
+					sizeof(*chip->chip_spec->plls), GFP_KERNEL);
 	if (!chip->plls)
 		return -ENOMEM;
-	memcpy(chip->plls, chip->chip_spec->plls,
-	       sizeof(struct uniphier_aio_pll) * chip->num_plls);
 
 	for (i = 0; i < chip->num_aios; i++) {
 		struct uniphier_aio *aio = &chip->aios[i];
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup() and devm_kmemdup_array() which are
more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/video/fbdev/pxafb.c | 21 ++++++++-------------
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index 4aa84853e31a..21fba33918c6 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2239,26 +2239,21 @@ static int pxafb_probe(struct platform_device *dev)
 
 	ret = -ENOMEM;
 	pdata = dev_get_platdata(&dev->dev);
-	inf = devm_kmalloc(&dev->dev, sizeof(*inf), GFP_KERNEL);
-	if (!inf)
-		goto failed;
-
 	if (pdata) {
-		*inf = *pdata;
-		inf->modes =
-			devm_kmalloc_array(&dev->dev, pdata->num_modes,
-					   sizeof(inf->modes[0]), GFP_KERNEL);
+		inf = devm_kmemdup(&dev->dev, pdata, sizeof(*pdata), GFP_KERNEL);
+		if (!inf)
+			goto failed;
+
+		inf->modes = devm_kmemdup_array(&dev->dev, pdata->modes, pdata->num_modes,
+						sizeof(*pdata->modes), GFP_KERNEL);
 		if (!inf->modes)
 			goto failed;
-		for (i = 0; i < inf->num_modes; i++)
-			inf->modes[i] = pdata->modes[i];
 	} else {
 		inf = of_pxafb_of_mach_info(&dev->dev);
+		if (IS_ERR_OR_NULL(inf))
+			goto failed;
 	}
 
-	if (IS_ERR_OR_NULL(inf))
-		goto failed;
-
 	ret = pxafb_parse_options(&dev->dev, g_options, inf);
 	if (ret < 0)
 		goto failed;
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 08/13] power: supply: sc27xx: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/power/supply/sc27xx_fuel_gauge.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
index f36edc2ba708..573838ca8ed8 100644
--- a/drivers/power/supply/sc27xx_fuel_gauge.c
+++ b/drivers/power/supply/sc27xx_fuel_gauge.c
@@ -1014,9 +1014,8 @@ static int sc27xx_fgu_hw_init(struct sc27xx_fgu_data *data)
 	if (!table)
 		return -EINVAL;
 
-	data->cap_table = devm_kmemdup(data->dev, table,
-				       data->table_len * sizeof(*table),
-				       GFP_KERNEL);
+	data->cap_table = devm_kmemdup_array(data->dev, table, data->table_len,
+					     sizeof(*table), GFP_KERNEL);
 	if (!data->cap_table) {
 		power_supply_put_battery_info(data->battery, info);
 		return -ENOMEM;
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 09/13] regulator: devres: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/regulator/devres.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/regulator/devres.c b/drivers/regulator/devres.c
index 36164aec30e8..ab238579879c 100644
--- a/drivers/regulator/devres.c
+++ b/drivers/regulator/devres.c
@@ -332,9 +332,8 @@ int devm_regulator_bulk_get_const(struct device *dev, int num_consumers,
 				  const struct regulator_bulk_data *in_consumers,
 				  struct regulator_bulk_data **out_consumers)
 {
-	*out_consumers = devm_kmemdup(dev, in_consumers,
-				      num_consumers * sizeof(*in_consumers),
-				      GFP_KERNEL);
+	*out_consumers = devm_kmemdup_array(dev, in_consumers, num_consumers,
+					    sizeof(*in_consumers), GFP_KERNEL);
 	if (*out_consumers == NULL)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 10/13] regulator: cros-ec: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/regulator/cros-ec-regulator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/cros-ec-regulator.c b/drivers/regulator/cros-ec-regulator.c
index fb9643ed7a49..fb0767b33a36 100644
--- a/drivers/regulator/cros-ec-regulator.c
+++ b/drivers/regulator/cros-ec-regulator.c
@@ -138,8 +138,8 @@ static int cros_ec_regulator_init_info(struct device *dev,
 	data->num_voltages =
 		min_t(u16, ARRAY_SIZE(resp.voltages_mv), resp.num_voltages);
 	data->voltages_mV =
-		devm_kmemdup(dev, resp.voltages_mv,
-			     sizeof(u16) * data->num_voltages, GFP_KERNEL);
+		devm_kmemdup_array(dev, resp.voltages_mv, data->num_voltages,
+				   sizeof(resp.voltages_mv[0]), GFP_KERNEL);
 	if (!data->voltages_mV)
 		return -ENOMEM;
 
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 11/13] media: atmel-isi: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/media/platform/atmel/atmel-isi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/atmel/atmel-isi.c b/drivers/media/platform/atmel/atmel-isi.c
index 0d1c39347529..7d8bec46af89 100644
--- a/drivers/media/platform/atmel/atmel-isi.c
+++ b/drivers/media/platform/atmel/atmel-isi.c
@@ -1072,16 +1072,12 @@ static int isi_formats_init(struct atmel_isi *isi)
 		return -ENXIO;
 
 	isi->num_user_formats = num_fmts;
-	isi->user_formats = devm_kcalloc(isi->dev,
-					 num_fmts, sizeof(struct isi_format *),
-					 GFP_KERNEL);
+	isi->user_formats = devm_kmemdup_array(isi->dev, isi_fmts, num_fmts,
+					       sizeof(isi_fmts[0]), GFP_KERNEL);
 	if (!isi->user_formats)
 		return -ENOMEM;
 
-	memcpy(isi->user_formats, isi_fmts,
-	       num_fmts * sizeof(struct isi_format *));
 	isi->current_fmt = isi->user_formats[0];
-
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 12/13] media: stm32-dcmi: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() and while at it, make the size robust
against type changes.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/media/platform/st/stm32/stm32-dcmi.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 9b699ee2b1e0..eedc15b30edc 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -1682,18 +1682,14 @@ static int dcmi_formats_init(struct stm32_dcmi *dcmi)
 		return -ENXIO;
 
 	dcmi->num_of_sd_formats = num_fmts;
-	dcmi->sd_formats = devm_kcalloc(dcmi->dev,
-					num_fmts, sizeof(struct dcmi_format *),
-					GFP_KERNEL);
+	dcmi->sd_formats = devm_kmemdup_array(dcmi->dev, sd_fmts, num_fmts,
+					      sizeof(sd_fmts[0]), GFP_KERNEL);
 	if (!dcmi->sd_formats) {
 		dev_err(dcmi->dev, "Could not allocate memory\n");
 		return -ENOMEM;
 	}
 
-	memcpy(dcmi->sd_formats, sd_fmts,
-	       num_fmts * sizeof(struct dcmi_format *));
 	dcmi->sd_format = dcmi->sd_formats[0];
-
 	return 0;
 }
 
-- 
2.34.1


^ permalink raw reply related

* [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-21 16:53 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>

Convert to use devm_kmemdup_array() which is more robust.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
 drivers/ntb/hw/idt/ntb_hw_idt.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
index 544d8a4d2af5..dbfc53d0ef0c 100644
--- a/drivers/ntb/hw/idt/ntb_hw_idt.c
+++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
@@ -1103,16 +1103,11 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port,
 		}
 	}
 
-	/* Allocate memory for memory window descriptors */
-	ret_mws = devm_kcalloc(&ndev->ntb.pdev->dev, *mw_cnt, sizeof(*ret_mws),
-			       GFP_KERNEL);
-	if (!ret_mws)
-		return ERR_PTR(-ENOMEM);
-
 	/* Copy the info of detected memory windows */
-	memcpy(ret_mws, mws, (*mw_cnt)*sizeof(*ret_mws));
+	ret_mws = devm_kmemdup_array(&ndev->ntb.pdev->dev, mws, *mw_cnt,
+				     sizeof(mws[0]), GFP_KERNEL);
 
-	return ret_mws;
+	return ret_mws ?: ERR_PTR(-ENOMEM);
 }
 
 /*
-- 
2.34.1


^ permalink raw reply related

* Re: [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
From: Dave Jiang @ 2025-02-21 17:05 UTC (permalink / raw)
  To: Raag Jadav, perex, tiwai, broonie, lgirdwood, deller,
	andriy.shevchenko, sre, sakari.ailus, mchehab, hverkuil-cisco,
	jdmason, fancer.lancer
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel
In-Reply-To: <20250221165333.2780888-14-raag.jadav@intel.com>



On 2/21/25 9:53 AM, Raag Jadav wrote:
> Convert to use devm_kmemdup_array() which is more robust.
> 
> Signed-off-by: Raag Jadav <raag.jadav@intel.com>

I think this patch [1] from earlier today makes this change unnecessary now.

[1]: https://lore.kernel.org/ntb/20250221085748.2298463-1-arnd@kernel.org/

> ---
>  drivers/ntb/hw/idt/ntb_hw_idt.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
> index 544d8a4d2af5..dbfc53d0ef0c 100644
> --- a/drivers/ntb/hw/idt/ntb_hw_idt.c
> +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
> @@ -1103,16 +1103,11 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port,
>  		}
>  	}
>  
> -	/* Allocate memory for memory window descriptors */
> -	ret_mws = devm_kcalloc(&ndev->ntb.pdev->dev, *mw_cnt, sizeof(*ret_mws),
> -			       GFP_KERNEL);
> -	if (!ret_mws)
> -		return ERR_PTR(-ENOMEM);
> -
>  	/* Copy the info of detected memory windows */
> -	memcpy(ret_mws, mws, (*mw_cnt)*sizeof(*ret_mws));
> +	ret_mws = devm_kmemdup_array(&ndev->ntb.pdev->dev, mws, *mw_cnt,
> +				     sizeof(mws[0]), GFP_KERNEL);
>  
> -	return ret_mws;
> +	return ret_mws ?: ERR_PTR(-ENOMEM);
>  }
>  
>  /*


^ permalink raw reply

* [PATCH] fbtft: Remove access to page->index
From: Matthew Wilcox (Oracle) @ 2025-02-21 17:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Matthew Wilcox (Oracle), Thomas Zimmermann, Jeff Johnson,
	Thomas Petazzoni, dri-devel, linux-fbdev, linux-staging,
	Lorenzo Stoakes

There is no need to print out page->index as part of the debug message.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 drivers/staging/fbtft/fbtft-core.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index 4cfa494243b9..da9c64152a60 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -337,9 +337,7 @@ static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagereflis
 	list_for_each_entry(pageref, pagereflist, list) {
 		y_low = pageref->offset / info->fix.line_length;
 		y_high = (pageref->offset + PAGE_SIZE - 1) / info->fix.line_length;
-		dev_dbg(info->device,
-			"page->index=%lu y_low=%d y_high=%d\n",
-			pageref->page->index, y_low, y_high);
+		dev_dbg(info->device, "y_low=%d y_high=%d\n", y_low, y_high);
 		if (y_high > info->var.yres - 1)
 			y_high = info->var.yres - 1;
 		if (y_low < dirty_lines_start)
-- 
2.47.2


^ permalink raw reply related

* Re: [PATCH] fbtft: Remove access to page->index
From: Lorenzo Stoakes @ 2025-02-21 17:53 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Greg Kroah-Hartman, Thomas Zimmermann, Jeff Johnson,
	Thomas Petazzoni, dri-devel, linux-fbdev, linux-staging
In-Reply-To: <20250221173131.3470667-1-willy@infradead.org>

On Fri, Feb 21, 2025 at 05:31:29PM +0000, Matthew Wilcox (Oracle) wrote:
> There is no need to print out page->index as part of the debug message.
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

LGTM from my side,

Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>

> ---
>  drivers/staging/fbtft/fbtft-core.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index 4cfa494243b9..da9c64152a60 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -337,9 +337,7 @@ static void fbtft_deferred_io(struct fb_info *info, struct list_head *pagereflis
>  	list_for_each_entry(pageref, pagereflist, list) {
>  		y_low = pageref->offset / info->fix.line_length;
>  		y_high = (pageref->offset + PAGE_SIZE - 1) / info->fix.line_length;
> -		dev_dbg(info->device,
> -			"page->index=%lu y_low=%d y_high=%d\n",
> -			pageref->page->index, y_low, y_high);
> +		dev_dbg(info->device, "y_low=%d y_high=%d\n", y_low, y_high);
>  		if (y_high > info->var.yres - 1)
>  			y_high = info->var.yres - 1;
>  		if (y_low < dirty_lines_start)
> --
> 2.47.2
>

^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: mfd: Document TI LM3533 MFD
From: Rob Herring @ 2025-02-21 20:38 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Lee Jones, Krzysztof Kozlowski, Conor Dooley, Jonathan Cameron,
	Lars-Peter Clausen, Pavel Machek, Daniel Thompson, Jingoo Han,
	Helge Deller, Andy Shevchenko, Uwe Kleine-König, devicetree,
	linux-kernel, linux-iio, linux-leds, dri-devel, linux-fbdev
In-Reply-To: <20250218132702.114669-2-clamor95@gmail.com>

On Tue, Feb 18, 2025 at 03:26:59PM +0200, Svyatoslav Ryhel wrote:
> Add bindings for the LM3533 - a complete power source for
> backlight, keypad, and indicator LEDs in smartphone handsets.
> The high-voltage inductive boost converter provides the
> power for two series LED strings display backlight and keypad
> functions.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>  .../devicetree/bindings/mfd/ti,lm3533.yaml    | 231 ++++++++++++++++++
>  1 file changed, 231 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml b/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> new file mode 100644
> index 000000000000..83542f0c7bf7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> @@ -0,0 +1,231 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/ti,lm3533.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: TI LM3533 Complete Lighting Power Solution
> +
> +description: |

Use '>' rather than '|' if only formatting is paragraphs.

> +  The LM3533 is a complete power source for backlight,
> +  keypad, and indicator LEDs in smartphone handsets. The
> +  high-voltage inductive boost converter provides the
> +  power for two series LED strings display backlight and
> +  keypad functions.

Wrap lines at 80

blank line here

> +  https://www.ti.com/product/LM3533
> +
> +maintainers:
> +  - Svyatoslav Ryhel <clamor95@gmail.com>
> +
> +properties:
> +  compatible:
> +    const: ti,lm3533
> +
> +  reg:
> +    maxItems: 1
> +
> +  '#address-cells':
> +    const: 1
> +
> +  '#size-cells':
> +    const: 0
> +
> +  enable-gpios:
> +    description: GPIO to use to enable/disable the backlight (HWEN pin).
> +    maxItems: 1
> +
> +  ti,boost-ovp-microvolt:
> +    description:
> +      Boost OVP select (16V, 24V, 32V, 40V)
> +    enum: [ 16000000, 24000000, 32000000, 40000000 ]
> +    default: 16000000
> +
> +  ti,boost-freq-hz:
> +    description:
> +      Boost frequency select (500KHz or 1MHz)
> +    enum: [ 500000, 1000000 ]
> +    default: 500000
> +
> +  light-sensor@0:
> +    type: object
> +    description:
> +      Properties for an illumination sensor.
> +
> +    properties:
> +      compatible:
> +        const: ti,lm3533-als
> +
> +      reg:
> +        const: 0
> +
> +      ti,resistor-value-ohm:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: |

Don't need '|'. Elsewhere too.

> +          Internal configuration resister value when ALS is in Analog Sensor
> +          mode and PWM mode is disabled.
> +        minimum: 1575
> +        maximum: 200000
> +
> +      ti,pwm-mode:
> +        type: boolean
> +        description: |
> +          Switch for mode in which ALS is running. If this propertly is
> +          set then ALS is running in PWM mode, internal resistor value is
> +          set to high-impedance (0) and resistor-value-ohm propertly is
> +          ignored.
> +
> +    required:
> +      - compatible
> +      - reg
> +
> +    additionalProperties: false

Move this above 'properties'.

> +
> +required:
> +  - compatible
> +  - reg
> +  - '#address-cells'
> +  - '#size-cells'
> +  - enable-gpios
> +
> +patternProperties:
> +  "^backlight@[01]$":
> +    type: object
> +    description:
> +      Properties for a backlight device.
> +
> +    $ref: /schemas/leds/backlight/common.yaml#
> +
> +    properties:
> +      compatible:
> +        const: ti,lm3533-backlight
> +
> +      reg:
> +        description: |
> +          The control bank that is used to program the two current sinks. The
> +          LM3533 has two control banks (A and B) and are represented as 0 or 1
> +          in this property. The two current sinks can be controlled
> +          independently with both banks, or bank A can be configured to control
> +          both sinks with the led-sources property.
> +        minimum: 0
> +        maximum: 1
> +
> +      default-brightness: true
> +
> +      ti,max-current-microamp:
> +        description:
> +          Maximum current in µA with a 800 µA step.
> +        enum: [ 5000, 5800, 6600, 7400, 8200, 9000, 9800,
> +                10600, 11400, 12200, 13000, 13800, 14600,
> +                15400, 16200, 17000, 17800, 18600, 19400,
> +                20200, 21000, 21800, 22600, 23400, 24200,
> +                25000, 25800, 26600, 27400, 28200, 29000,
> +                29800 ]
> +        default: 5000
> +
> +      ti,pwm-config-mask:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: |
> +          Control Bank PWM Configuration Register mask that allows to configure
> +          PWM input in Zones 0-4
> +          BIT(0) - PWM Input is enabled
> +          BIT(1) - PWM Input is enabled in Zone 0
> +          BIT(2) - PWM Input is enabled in Zone 1
> +          BIT(3) - PWM Input is enabled in Zone 2
> +          BIT(4) - PWM Input is enabled in Zone 3
> +          BIT(5) - PWM Input is enabled in Zone 4
> +
> +      ti,linear-mapping-mode:
> +        description: |
> +          Enable linear mapping mode. If disabled, then it will use exponential
> +          mapping mode in which the ramp up/down appears to have a more uniform
> +          transition to the human eye.
> +        type: boolean
> +
> +      ti,hardware-controlled:
> +        description: |
> +          Each backlight has its own voltage Control Bank (A and B) and there are
> +          two HVLED sinks which by default are linked to respective Bank. Setting
> +          this property will link both sinks to a Control Bank of backlight where
> +          property is defined.
> +        type: boolean
> +
> +    required:
> +      - compatible
> +      - reg
> +
> +    additionalProperties: false
> +
> +  "^led@[0-3]$":
> +    type: object
> +    description:
> +      Properties for a led device.
> +
> +    $ref: /schemas/leds/common.yaml#
> +
> +    properties:
> +      compatible:
> +        const: ti,lm3533-leds
> +
> +      reg:
> +        description:
> +          4 led banks
> +        minimum: 0
> +        maximum: 3
> +
> +      linux,default-trigger: true
> +
> +      ti,max-current-microamp:
> +        description:
> +          Maximum current in µA with a 800 µA step.
> +        enum: [ 5000, 5800, 6600, 7400, 8200, 9000, 9800,
> +                10600, 11400, 12200, 13000, 13800, 14600,
> +                15400, 16200, 17000, 17800, 18600, 19400,
> +                20200, 21000, 21800, 22600, 23400, 24200,
> +                25000, 25800, 26600, 27400, 28200, 29000,
> +                29800 ]
> +        default: 5000
> +
> +      ti,pwm-config-mask:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description:
> +          Same descryption and function as for backlight.
> +
> +    required:
> +      - compatible
> +      - reg
> +
> +    additionalProperties: false
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        led-controller@36 {
> +            compatible = "ti,lm3533";
> +            reg = <0x36>;
> +
> +            enable-gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
> +
> +            ti,boost-ovp-microvolt = <24000000>;
> +            ti,boost-freq-hz = <500000>;
> +
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +
> +            backlight@0 {
> +                compatible = "ti,lm3533-backlight";
> +                reg = <0>;
> +
> +                ti,max-current-microamp = <23400>;
> +                default-brightness = <113>;
> +                ti,hardware-controlled;
> +            };

Please make the example complete.

> +        };
> +    };
> +...
> -- 
> 2.43.0
> 

^ permalink raw reply

* Re: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
From: kernel test robot @ 2025-02-21 21:41 UTC (permalink / raw)
  To: Raag Jadav, perex, tiwai, broonie, lgirdwood, deller,
	andriy.shevchenko, sre, sakari.ailus, mchehab, hverkuil-cisco,
	jdmason, fancer.lancer
  Cc: oe-kbuild-all, linux-sound, linux-fbdev, linux-pm, linux-media,
	ntb, linux-kernel, Raag Jadav
In-Reply-To: <20250221165333.2780888-8-raag.jadav@intel.com>

Hi Raag,

kernel test robot noticed the following build warnings:

[auto build test WARNING on b16e9f8547a328b19af59afc213ce323124d11e9]

url:    https://github.com/intel-lab-lkp/linux/commits/Raag-Jadav/ASoC-Intel-avs-use-devm_kmemdup_array/20250222-010322
base:   b16e9f8547a328b19af59afc213ce323124d11e9
patch link:    https://lore.kernel.org/r/20250221165333.2780888-8-raag.jadav%40intel.com
patch subject: [PATCH v1 07/13] fbdev: pxafb: use devm_kmemdup_array()
config: arm-randconfig-004-20250222 (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250222/202502220449.DvJuMgsL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202502220449.DvJuMgsL-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/video/fbdev/pxafb.c: In function 'pxafb_probe':
>> drivers/video/fbdev/pxafb.c:2236:13: warning: unused variable 'i' [-Wunused-variable]
    2236 |         int i, irq, ret;
         |             ^


vim +/i +2236 drivers/video/fbdev/pxafb.c

420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2231  
48c68c4f1b5424 drivers/video/pxafb.c       Greg Kroah-Hartman 2012-12-21  2232  static int pxafb_probe(struct platform_device *dev)
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2233  {
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2234  	struct pxafb_info *fbi;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2235  	struct pxafb_mach_info *inf, *pdata;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12 @2236  	int i, irq, ret;
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2237  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2238  	dev_dbg(&dev->dev, "pxafb_probe\n");
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2239  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2240  	ret = -ENOMEM;
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2241  	pdata = dev_get_platdata(&dev->dev);
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2242  	if (pdata) {
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2243  		inf = devm_kmemdup(&dev->dev, pdata, sizeof(*pdata), GFP_KERNEL);
6f6abd360603af drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-19  2244  		if (!inf)
6f6abd360603af drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-19  2245  			goto failed;
420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2246  
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2247  		inf->modes = devm_kmemdup_array(&dev->dev, pdata->modes, pdata->num_modes,
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2248  						sizeof(*pdata->modes), GFP_KERNEL);
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2249  		if (!inf->modes)
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2250  			goto failed;
b23e868d35d572 drivers/video/fbdev/pxafb.c Wang Qing          2022-03-29  2251  	} else {
b23e868d35d572 drivers/video/fbdev/pxafb.c Wang Qing          2022-03-29  2252  		inf = of_pxafb_of_mach_info(&dev->dev);
420a488278e86a drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2253  		if (IS_ERR_OR_NULL(inf))
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2254  			goto failed;
ed63c72a467651 drivers/video/fbdev/pxafb.c Raag Jadav         2025-02-21  2255  	}
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2256  
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2257  	ret = pxafb_parse_options(&dev->dev, g_options, inf);
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2258  	if (ret < 0)
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2259  		goto failed;
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2260  
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2261  	pxafb_check_options(&dev->dev, inf);
4f3e2664622d23 drivers/video/pxafb.c       Eric Miao          2008-08-16  2262  
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2263  	dev_dbg(&dev->dev, "got a %dx%dx%d LCD\n",
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2264  			inf->modes->xres,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2265  			inf->modes->yres,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2266  			inf->modes->bpp);
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2267  	if (inf->modes->xres == 0 ||
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2268  	    inf->modes->yres == 0 ||
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2269  	    inf->modes->bpp == 0) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2270  		dev_err(&dev->dev, "Invalid resolution or bit depth\n");
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2271  		ret = -EINVAL;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2272  		goto failed;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2273  	}
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2274  
f3621a60b20d67 drivers/video/fbdev/pxafb.c Robert Jarzmik     2015-12-12  2275  	fbi = pxafb_init_fbinfo(&dev->dev, inf);
a2f2058e3d295f drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2276  	if (IS_ERR(fbi)) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2277  		dev_err(&dev->dev, "Failed to initialize framebuffer device\n");
a2f2058e3d295f drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2278  		ret = PTR_ERR(fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2279  		goto failed;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2280  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2281  
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2282  	if (cpu_is_pxa3xx() && inf->acceleration_enabled)
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2283  		fbi->fb.fix.accel = FB_ACCEL_PXA3XX;
52a7a1cec88acd drivers/video/pxafb.c       Daniel Mack        2009-09-10  2284  
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2285  	fbi->backlight_power = inf->pxafb_backlight_power;
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2286  	fbi->lcd_power = inf->pxafb_lcd_power;
a5718a14a1d91b drivers/video/pxafb.c       Eric Miao          2008-11-11  2287  
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2288  	fbi->lcd_supply = devm_regulator_get_optional(&dev->dev, "lcd");
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2289  	if (IS_ERR(fbi->lcd_supply)) {
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2290  		if (PTR_ERR(fbi->lcd_supply) == -EPROBE_DEFER)
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2291  			return -EPROBE_DEFER;
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2292  
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2293  		fbi->lcd_supply = NULL;
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2294  	}
31e1391af210fd drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2295  
7610bca71ea85d drivers/video/fbdev/pxafb.c Markus Elfring     2019-09-19  2296  	fbi->mmio_base = devm_platform_ioremap_resource(dev, 0);
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2297  	if (IS_ERR(fbi->mmio_base)) {
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2298  		dev_err(&dev->dev, "failed to get I/O memory\n");
f35b1d6c21b414 drivers/video/fbdev/pxafb.c Tiezhu Yang        2020-05-25  2299  		ret = PTR_ERR(fbi->mmio_base);
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2300  		goto failed;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2301  	}
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2302  
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2303  	fbi->dma_buff_size = PAGE_ALIGN(sizeof(struct pxafb_dma_buff));
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2304  	fbi->dma_buff = dma_alloc_coherent(fbi->dev, fbi->dma_buff_size,
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2305  				&fbi->dma_buff_phys, GFP_KERNEL);
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2306  	if (fbi->dma_buff == NULL) {
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2307  		dev_err(&dev->dev, "failed to allocate memory for DMA\n");
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2308  		ret = -ENOMEM;
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2309  		goto failed;
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2310  	}
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2311  
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2312  	ret = pxafb_init_video_memory(fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2313  	if (ret) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2314  		dev_err(&dev->dev, "Failed to allocate video RAM: %d\n", ret);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2315  		ret = -ENOMEM;
77e196752bdd76 drivers/video/pxafb.c       Eric Miao          2008-12-16  2316  		goto failed_free_dma;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2317  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2318  
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2319  	irq = platform_get_irq(dev, 0);
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2320  	if (irq < 0) {
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2321  		ret = -ENODEV;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2322  		goto failed_free_mem;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2323  	}
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2324  
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2325  	ret = devm_request_irq(&dev->dev, irq, pxafb_handle_irq, 0, "LCD", fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2326  	if (ret) {
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2327  		dev_err(&dev->dev, "request_irq failed: %d\n", ret);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2328  		ret = -EBUSY;
ce4fb7b892a6d6 drivers/video/pxafb.c       eric miao          2008-04-30  2329  		goto failed_free_mem;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2330  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2331  
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2332  	ret = pxafb_smart_init(fbi);
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2333  	if (ret) {
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2334  		dev_err(&dev->dev, "failed to initialize smartpanel\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2335  		goto failed_free_mem;
3c42a449107bf7 drivers/video/pxafb.c       Eric Miao          2008-04-30  2336  	}
07df1c4fea1474 drivers/video/pxafb.c       Eric Miao          2008-12-04  2337  
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2338  	/*
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2339  	 * This makes sure that our colour bitfield
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2340  	 * descriptors are correctly initialised.
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2341  	 */
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2342  	ret = pxafb_check_var(&fbi->fb.var, &fbi->fb);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2343  	if (ret) {
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2344  		dev_err(&dev->dev, "failed to get suitable mode\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2345  		goto failed_free_mem;
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2346  	}
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2347  
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2348  	ret = pxafb_set_par(&fbi->fb);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2349  	if (ret) {
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2350  		dev_err(&dev->dev, "Failed to set parameters\n");
c8f96304ec8b49 drivers/video/fbdev/pxafb.c Daniel Mack        2018-07-24  2351  		goto failed_free_mem;
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2352  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2353  
3ae5eaec1d2d9c drivers/video/pxafb.c       Russell King       2005-11-09  2354  	platform_set_drvdata(dev, fbi);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2355  
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2356  	ret = register_framebuffer(&fbi->fb);
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2357  	if (ret < 0) {
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2358  		dev_err(&dev->dev,
b0086efba5ad49 drivers/video/pxafb.c       eric miao          2008-04-30  2359  			"Failed to register framebuffer device: %d\n", ret);
ee98476bbc565f drivers/video/pxafb.c       Jaya Kumar         2008-06-22  2360  		goto failed_free_cmap;
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2361  	}
^1da177e4c3f41 drivers/video/pxafb.c       Linus Torvalds     2005-04-16  2362  
198fc108ee4c2c drivers/video/pxafb.c       Eric Miao          2008-12-23  2363  	pxafb_overlay_init(fbi);
198fc108ee4c2c drivers/video/pxafb.c       Eric Miao          2008-12-23  2364  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: (subset) [PATCH v1 00/13] Convert to use devm_kmemdup_array()
From: Sebastian Reichel @ 2025-02-21 22:51 UTC (permalink / raw)
  To: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, jdmason, fancer.lancer, Hans Verkuil,
	Raag Jadav
  Cc: linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel
In-Reply-To: <20250221165333.2780888-1-raag.jadav@intel.com>


On Fri, 21 Feb 2025 22:23:20 +0530, Raag Jadav wrote:
> This series is the second wave of patches to add users of newly introduced
> devm_kmemdup_array() helper. Original series on [1].
> 
> This depends on changes available on immutable tag[2]. Feel free to pick
> your subsystem patches with it, or share your preferred way to route them.
> 
> [1] https://lore.kernel.org/r/20250212062513.2254767-1-raag.jadav@intel.com
> [2] https://lore.kernel.org/r/Z7cqCaME4LxTTBn6@black.fi.intel.com
> 
> [...]

Applied, thanks!

[08/13] power: supply: sc27xx: use devm_kmemdup_array()
        commit: 0c3cbeb89c49f47ce6cae9250c8ff6c8f3cdf232

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: mfd: Document TI LM3533 MFD
From: Svyatoslav Ryhel @ 2025-02-22  7:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Lee Jones, Krzysztof Kozlowski, Conor Dooley, Jonathan Cameron,
	Lars-Peter Clausen, Pavel Machek, Daniel Thompson, Jingoo Han,
	Helge Deller, Andy Shevchenko, Uwe Kleine-König, devicetree,
	linux-kernel, linux-iio, linux-leds, dri-devel, linux-fbdev
In-Reply-To: <20250221203803.GA24813-robh@kernel.org>

пт, 21 лют. 2025 р. о 22:38 Rob Herring <robh@kernel.org> пише:
>
> On Tue, Feb 18, 2025 at 03:26:59PM +0200, Svyatoslav Ryhel wrote:
> > Add bindings for the LM3533 - a complete power source for
> > backlight, keypad, and indicator LEDs in smartphone handsets.
> > The high-voltage inductive boost converter provides the
> > power for two series LED strings display backlight and keypad
> > functions.
> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > ---
> >  .../devicetree/bindings/mfd/ti,lm3533.yaml    | 231 ++++++++++++++++++
> >  1 file changed, 231 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml b/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> > new file mode 100644
> > index 000000000000..83542f0c7bf7
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> > @@ -0,0 +1,231 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/mfd/ti,lm3533.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: TI LM3533 Complete Lighting Power Solution
> > +
> > +description: |
>
> Use '>' rather than '|' if only formatting is paragraphs.
>

yaml check did not complain, fine.

> > +  The LM3533 is a complete power source for backlight,
> > +  keypad, and indicator LEDs in smartphone handsets. The
> > +  high-voltage inductive boost converter provides the
> > +  power for two series LED strings display backlight and
> > +  keypad functions.
>
> Wrap lines at 80
>

Checkpatch and yaml check do not complain, why? 80 char limit was removed, no?

> blank line here
>
> > +  https://www.ti.com/product/LM3533
> > +
> > +maintainers:
> > +  - Svyatoslav Ryhel <clamor95@gmail.com>
> > +
> > +properties:
> > +  compatible:
> > +    const: ti,lm3533
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  '#address-cells':
> > +    const: 1
> > +
> > +  '#size-cells':
> > +    const: 0
> > +
> > +  enable-gpios:
> > +    description: GPIO to use to enable/disable the backlight (HWEN pin).
> > +    maxItems: 1
> > +
> > +  ti,boost-ovp-microvolt:
> > +    description:
> > +      Boost OVP select (16V, 24V, 32V, 40V)
> > +    enum: [ 16000000, 24000000, 32000000, 40000000 ]
> > +    default: 16000000
> > +
> > +  ti,boost-freq-hz:
> > +    description:
> > +      Boost frequency select (500KHz or 1MHz)
> > +    enum: [ 500000, 1000000 ]
> > +    default: 500000
> > +
> > +  light-sensor@0:
> > +    type: object
> > +    description:
> > +      Properties for an illumination sensor.
> > +
> > +    properties:
> > +      compatible:
> > +        const: ti,lm3533-als
> > +
> > +      reg:
> > +        const: 0
> > +
> > +      ti,resistor-value-ohm:
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +        description: |
>
> Don't need '|'. Elsewhere too.
>
> > +          Internal configuration resister value when ALS is in Analog Sensor
> > +          mode and PWM mode is disabled.
> > +        minimum: 1575
> > +        maximum: 200000
> > +
> > +      ti,pwm-mode:
> > +        type: boolean
> > +        description: |
> > +          Switch for mode in which ALS is running. If this propertly is
> > +          set then ALS is running in PWM mode, internal resistor value is
> > +          set to high-impedance (0) and resistor-value-ohm propertly is
> > +          ignored.
> > +
> > +    required:
> > +      - compatible
> > +      - reg
> > +
> > +    additionalProperties: false
>
> Move this above 'properties'.
>

yaml check did not complain. additionalProperties is always set after
all properties description, no?

> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - '#address-cells'
> > +  - '#size-cells'
> > +  - enable-gpios
> > +
> > +patternProperties:
> > +  "^backlight@[01]$":
> > +    type: object
> > +    description:
> > +      Properties for a backlight device.
> > +
> > +    $ref: /schemas/leds/backlight/common.yaml#
> > +
> > +    properties:
> > +      compatible:
> > +        const: ti,lm3533-backlight
> > +
> > +      reg:
> > +        description: |
> > +          The control bank that is used to program the two current sinks. The
> > +          LM3533 has two control banks (A and B) and are represented as 0 or 1
> > +          in this property. The two current sinks can be controlled
> > +          independently with both banks, or bank A can be configured to control
> > +          both sinks with the led-sources property.
> > +        minimum: 0
> > +        maximum: 1
> > +
> > +      default-brightness: true
> > +
> > +      ti,max-current-microamp:
> > +        description:
> > +          Maximum current in 渙 with a 800 渙 step.
> > +        enum: [ 5000, 5800, 6600, 7400, 8200, 9000, 9800,
> > +                10600, 11400, 12200, 13000, 13800, 14600,
> > +                15400, 16200, 17000, 17800, 18600, 19400,
> > +                20200, 21000, 21800, 22600, 23400, 24200,
> > +                25000, 25800, 26600, 27400, 28200, 29000,
> > +                29800 ]
> > +        default: 5000
> > +
> > +      ti,pwm-config-mask:
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +        description: |
> > +          Control Bank PWM Configuration Register mask that allows to configure
> > +          PWM input in Zones 0-4
> > +          BIT(0) - PWM Input is enabled
> > +          BIT(1) - PWM Input is enabled in Zone 0
> > +          BIT(2) - PWM Input is enabled in Zone 1
> > +          BIT(3) - PWM Input is enabled in Zone 2
> > +          BIT(4) - PWM Input is enabled in Zone 3
> > +          BIT(5) - PWM Input is enabled in Zone 4
> > +
> > +      ti,linear-mapping-mode:
> > +        description: |
> > +          Enable linear mapping mode. If disabled, then it will use exponential
> > +          mapping mode in which the ramp up/down appears to have a more uniform
> > +          transition to the human eye.
> > +        type: boolean
> > +
> > +      ti,hardware-controlled:
> > +        description: |
> > +          Each backlight has its own voltage Control Bank (A and B) and there are
> > +          two HVLED sinks which by default are linked to respective Bank. Setting
> > +          this property will link both sinks to a Control Bank of backlight where
> > +          property is defined.
> > +        type: boolean
> > +
> > +    required:
> > +      - compatible
> > +      - reg
> > +
> > +    additionalProperties: false
> > +
> > +  "^led@[0-3]$":
> > +    type: object
> > +    description:
> > +      Properties for a led device.
> > +
> > +    $ref: /schemas/leds/common.yaml#
> > +
> > +    properties:
> > +      compatible:
> > +        const: ti,lm3533-leds
> > +
> > +      reg:
> > +        description:
> > +          4 led banks
> > +        minimum: 0
> > +        maximum: 3
> > +
> > +      linux,default-trigger: true
> > +
> > +      ti,max-current-microamp:
> > +        description:
> > +          Maximum current in 渙 with a 800 渙 step.
> > +        enum: [ 5000, 5800, 6600, 7400, 8200, 9000, 9800,
> > +                10600, 11400, 12200, 13000, 13800, 14600,
> > +                15400, 16200, 17000, 17800, 18600, 19400,
> > +                20200, 21000, 21800, 22600, 23400, 24200,
> > +                25000, 25800, 26600, 27400, 28200, 29000,
> > +                29800 ]
> > +        default: 5000
> > +
> > +      ti,pwm-config-mask:
> > +        $ref: /schemas/types.yaml#/definitions/uint32
> > +        description:
> > +          Same descryption and function as for backlight.
> > +
> > +    required:
> > +      - compatible
> > +      - reg
> > +
> > +    additionalProperties: false
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/gpio/gpio.h>
> > +
> > +    i2c {
> > +        #address-cells = <1>;
> > +        #size-cells = <0>;
> > +
> > +        led-controller@36 {
> > +            compatible = "ti,lm3533";
> > +            reg = <0x36>;
> > +
> > +            enable-gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
> > +
> > +            ti,boost-ovp-microvolt = <24000000>;
> > +            ti,boost-freq-hz = <500000>;
> > +
> > +            #address-cells = <1>;
> > +            #size-cells = <0>;
> > +
> > +            backlight@0 {
> > +                compatible = "ti,lm3533-backlight";
> > +                reg = <0>;
> > +
> > +                ti,max-current-microamp = <23400>;
> > +                default-brightness = <113>;
> > +                ti,hardware-controlled;
> > +            };
>
> Please make the example complete.
>
> > +        };
> > +    };
> > +...
> > --
> > 2.43.0
> >

^ permalink raw reply

* Re: [PATCH v1 13/13] ntb: idt: use devm_kmemdup_array()
From: Raag Jadav @ 2025-02-22  9:27 UTC (permalink / raw)
  To: Dave Jiang
  Cc: perex, tiwai, broonie, lgirdwood, deller, andriy.shevchenko, sre,
	sakari.ailus, mchehab, hverkuil-cisco, jdmason, fancer.lancer,
	linux-sound, linux-fbdev, linux-pm, linux-media, ntb,
	linux-kernel, arnd
In-Reply-To: <43c873e1-737a-4119-abb7-49cc51acd6a0@intel.com>

Cc: Arnd

On Fri, Feb 21, 2025 at 10:05:09AM -0700, Dave Jiang wrote:
> On 2/21/25 9:53 AM, Raag Jadav wrote:
> > Convert to use devm_kmemdup_array() which is more robust.
> > 
> > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> 
> I think this patch [1] from earlier today makes this change unnecessary now.
> 
> [1]: https://lore.kernel.org/ntb/20250221085748.2298463-1-arnd@kernel.org/

Sure, in that case we can drop this one. Thanks for noticing.

Raag

> > ---
> >  drivers/ntb/hw/idt/ntb_hw_idt.c | 11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
> > index 544d8a4d2af5..dbfc53d0ef0c 100644
> > --- a/drivers/ntb/hw/idt/ntb_hw_idt.c
> > +++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
> > @@ -1103,16 +1103,11 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port,
> >  		}
> >  	}
> >  
> > -	/* Allocate memory for memory window descriptors */
> > -	ret_mws = devm_kcalloc(&ndev->ntb.pdev->dev, *mw_cnt, sizeof(*ret_mws),
> > -			       GFP_KERNEL);
> > -	if (!ret_mws)
> > -		return ERR_PTR(-ENOMEM);
> > -
> >  	/* Copy the info of detected memory windows */
> > -	memcpy(ret_mws, mws, (*mw_cnt)*sizeof(*ret_mws));
> > +	ret_mws = devm_kmemdup_array(&ndev->ntb.pdev->dev, mws, *mw_cnt,
> > +				     sizeof(mws[0]), GFP_KERNEL);
> >  
> > -	return ret_mws;
> > +	return ret_mws ?: ERR_PTR(-ENOMEM);
> >  }
> >  
> >  /*
> 

^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: mfd: Document TI LM3533 MFD
From: Jonathan Cameron @ 2025-02-22 14:26 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Rob Herring, Lee Jones, Krzysztof Kozlowski, Conor Dooley,
	Lars-Peter Clausen, Pavel Machek, Daniel Thompson, Jingoo Han,
	Helge Deller, Andy Shevchenko, Uwe Kleine-König, devicetree,
	linux-kernel, linux-iio, linux-leds, dri-devel, linux-fbdev
In-Reply-To: <CAPVz0n2wRu3X82nrnEac+XP+Q8uQMVwBLhGUaoqOLLf-V5dZfg@mail.gmail.com>

On Sat, 22 Feb 2025 09:01:18 +0200
Svyatoslav Ryhel <clamor95@gmail.com> wrote:

> пт, 21 лют. 2025 р. о 22:38 Rob Herring <robh@kernel.org> пише:
> >
> > On Tue, Feb 18, 2025 at 03:26:59PM +0200, Svyatoslav Ryhel wrote:  
> > > Add bindings for the LM3533 - a complete power source for
> > > backlight, keypad, and indicator LEDs in smartphone handsets.
> > > The high-voltage inductive boost converter provides the
> > > power for two series LED strings display backlight and keypad
> > > functions.
> > >
> > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> > > ---
> > >  .../devicetree/bindings/mfd/ti,lm3533.yaml    | 231 ++++++++++++++++++
> > >  1 file changed, 231 insertions(+)
> > >  create mode 100644 Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> > >
> > > diff --git a/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml b/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> > > new file mode 100644
> > > index 000000000000..83542f0c7bf7
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/mfd/ti,lm3533.yaml
> > > @@ -0,0 +1,231 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > +%YAML 1.2
> > > +---
> > > +$id: http://devicetree.org/schemas/mfd/ti,lm3533.yaml#
> > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > +
> > > +title: TI LM3533 Complete Lighting Power Solution
> > > +
> > > +description: |  
> >
> > Use '>' rather than '|' if only formatting is paragraphs.
> >  
> 
> yaml check did not complain, fine.

It can't tell whether you want it formatted exactly or if paragraphs
is enough. 

> 
> > > +  The LM3533 is a complete power source for backlight,
> > > +  keypad, and indicator LEDs in smartphone handsets. The
> > > +  high-voltage inductive boost converter provides the
> > > +  power for two series LED strings display backlight and
> > > +  keypad functions.  
> >
> > Wrap lines at 80
> >  
> 
> Checkpatch and yaml check do not complain, why? 80 char limit was removed, no?

Check was to prevent over 80 chars, here you are far too short.




^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: mfd: Document TI LM3533 MFD
From: Jonathan Cameron @ 2025-02-22 14:29 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Lars-Peter Clausen, Pavel Machek, Daniel Thompson, Jingoo Han,
	Helge Deller, Andy Shevchenko, Uwe Kleine-König, devicetree,
	linux-kernel, linux-iio, linux-leds, dri-devel, linux-fbdev
In-Reply-To: <20250218132702.114669-2-clamor95@gmail.com>

On Tue, 18 Feb 2025 15:26:59 +0200
Svyatoslav Ryhel <clamor95@gmail.com> wrote:

> Add bindings for the LM3533 - a complete power source for
> backlight, keypad, and indicator LEDs in smartphone handsets.
> The high-voltage inductive boost converter provides the
> power for two series LED strings display backlight and keypad
> functions.

Wrap patch descriptions to 75 chars as describe in submitting-patches.rst

> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>

^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: mfd: Document TI LM3533 MFD
From: Svyatoslav Ryhel @ 2025-02-22 14:39 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Lars-Peter Clausen, Pavel Machek, Daniel Thompson, Jingoo Han,
	Helge Deller, Andy Shevchenko, Uwe Kleine-König, devicetree,
	linux-kernel, linux-iio, linux-leds, dri-devel, linux-fbdev
In-Reply-To: <20250222142910.4e6b706d@jic23-huawei>

сб, 22 лют. 2025 р. о 16:29 Jonathan Cameron <jic23@kernel.org> пише:
>
> On Tue, 18 Feb 2025 15:26:59 +0200
> Svyatoslav Ryhel <clamor95@gmail.com> wrote:
>
> > Add bindings for the LM3533 - a complete power source for
> > backlight, keypad, and indicator LEDs in smartphone handsets.
> > The high-voltage inductive boost converter provides the
> > power for two series LED strings display backlight and keypad
> > functions.
>
> Wrap patch descriptions to 75 chars as describe in submitting-patches.rst
>

Alright, though why then checkpatch script has max line length 100 chars?

https://github.com/torvalds/linux/commit/bdc48fa11e46f867ea4d75fa59ee87a7f48be144

> >
> > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>

^ permalink raw reply

* Re: [PATCH] fbdev: hyperv_fb: Allow graceful removal of framebuffer
From: Saurabh Singh Sengar @ 2025-02-22 17:27 UTC (permalink / raw)
  To: Michael Kelley
  Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
	decui@microsoft.com, deller@gmx.de, akpm@linux-foundation.org,
	linux-hyperv@vger.kernel.org, linux-fbdev@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	ssengar@microsoft.com
In-Reply-To: <SN6PR02MB4157813782C1D9E6D1225582D4C52@SN6PR02MB4157.namprd02.prod.outlook.com>

On Wed, Feb 19, 2025 at 05:22:36AM +0000, Michael Kelley wrote:
> From: Saurabh Sengar <ssengar@linux.microsoft.com> Sent: Saturday, February 15, 2025 1:21 AM
> > 
> > When a Hyper-V framebuffer device is unbind, hyperv_fb driver tries to
> > release the framebuffer forcefully. If this framebuffer is in use it
> > produce the following WARN and hence this framebuffer is never released.
> > 
> > [   44.111220] WARNING: CPU: 35 PID: 1882 at drivers/video/fbdev/core/fb_info.c:70 framebuffer_release+0x2c/0x40
> > < snip >
> > [   44.111289] Call Trace:
> > [   44.111290]  <TASK>
> > [   44.111291]  ? show_regs+0x6c/0x80
> > [   44.111295]  ? __warn+0x8d/0x150
> > [   44.111298]  ? framebuffer_release+0x2c/0x40
> > [   44.111300]  ? report_bug+0x182/0x1b0
> > [   44.111303]  ? handle_bug+0x6e/0xb0
> > [   44.111306]  ? exc_invalid_op+0x18/0x80
> > [   44.111308]  ? asm_exc_invalid_op+0x1b/0x20
> > [   44.111311]  ? framebuffer_release+0x2c/0x40
> > [   44.111313]  ? hvfb_remove+0x86/0xa0 [hyperv_fb]
> > [   44.111315]  vmbus_remove+0x24/0x40 [hv_vmbus]
> > [   44.111323]  device_remove+0x40/0x80
> > [   44.111325]  device_release_driver_internal+0x20b/0x270
> > [   44.111327]  ? bus_find_device+0xb3/0xf0
> > 
> > Fix this by moving the release of framebuffer to fb_ops.fb_destroy function
> > so that framebuffer framework handles it gracefully
> 
> These changes look good for solving the specific problem where
> the reference count WARN is produced. But there is another
> problem of the same type that happens when doing unbind
> of a hyperv_fb device that is in use (i.e., /dev/fb0 is open and
> mmap'ed by some user space program).
> 
> For this additional problem, there are three sub-cases,
> depending on what memory gets mmap'ed into user space.
> Two of the three sub-cases have a problem.
> 
> 1) When Hyper-V FB uses deferred I/O, the vmalloc dio memory
> is what get mapped into user space. When hyperv_fb is unbound,
> the vmalloc dio memory is freed. But the memory doesn't actually
> get freed if it is still mmap'ed into user space. The deferred I/O
> mechanism is stopped, but user space can keep writing to the
> memory even though the pixels don't get copied to the actual
> framebuffer any longer.  When the user space program terminates
> (or unmaps the memory), the memory will be freed. So this case
> is OK, though perhaps a bit dubious.
> 
> 2) When Hyper-V FB is in a Gen 1 VM, and the frame buffer size
> is <= 4 MiB, a normal kernel allocation is used for the
> memory that is mmap'ed to user space. If this memory
> is freed when hyperv_fb is unbound, bad things happen
> because the memory is still being written to via the user space
> mmap. There are multiple "BUG: Bad page state in process
> bash  pfn:106c65" errors followed by stack traces.
> 
> 3) Similarly in a Gen 1 VM, if the frame buffer size is > 4 MiB,
> CMA memory is allocated (assuming it is available). This CMA
> memory gets mapped into user space. When hyperv_fb is
> unbound, that memory is freed. But CMA complains that the
> ref count on the pages is not zero. Here's the dmesg output:
> 
> [  191.629780] ------------[ cut here ]------------
> [  191.629784] 200 pages are still in use!
> [  191.629789] WARNING: CPU: 3 PID: 1115 at mm/page_alloc.c:6757 free_contig_range+0x15e/0x170
> 
> Stack trace is: 
> 
> [  191.629847]  ? __warn+0x97/0x160
> [  191.629849]  ? free_contig_range+0x15e/0x170
> [  191.629849]  ? report_bug+0x1bb/0x1d0
> [  191.629851]  ? console_unlock+0xdd/0x1e0
> [  191.629854]  ? handle_bug+0x60/0xa0
> [  191.629857]  ? exc_invalid_op+0x1d/0x80
> [  191.629859]  ? asm_exc_invalid_op+0x1f/0x30
> [  191.629862]  ? free_contig_range+0x15e/0x170
> [  191.629862]  ? free_contig_range+0x15e/0x170
> [  191.629863]  cma_release+0xc6/0x150
> [  191.629865]  dma_free_contiguous+0x34/0x70
> [  191.629868]  dma_direct_free+0xd3/0x130
> [  191.629869]  dma_free_attrs+0x6b/0x130
> [  191.629872]  hvfb_putmem.isra.0+0x99/0xd0 [hyperv_fb]
> [  191.629874]  hvfb_remove+0x75/0x80 [hyperv_fb]
> [  191.629876]  vmbus_remove+0x28/0x40 [hv_vmbus]
> [  191.629883]  device_remove+0x43/0x70
> [  191.629886]  device_release_driver_internal+0xbd/0x140
> [  191.629888]  device_driver_detach+0x18/0x20
> [  191.629890]  unbind_store+0x8f/0xa0
> [  191.629891]  drv_attr_store+0x25/0x40
> [  191.629892]  sysfs_kf_write+0x3f/0x50
> [  191.629894]  kernfs_fop_write_iter+0x142/0x1d0
> [  191.629896]  vfs_write+0x31b/0x450
> [  191.629898]  ksys_write+0x6e/0xe0
> [  191.629899]  __x64_sys_write+0x1e/0x30
> [  191.629900]  x64_sys_call+0x16bf/0x2150
> [  191.629903]  do_syscall_64+0x4e/0x110
> [  191.629904]  entry_SYSCALL_64_after_hwframe+0x76/0x7e
> 
> For all three cases, I think the memory freeing and iounmap() operations
> can be moved to the new hvfb_destroy() function so that the memory
> is cleaned up only when there aren't any users. While these additional
> changes could be done as a separate patch, it seems to me like they are all
> part of the same underlying issue as the reference count problem, and
> could be combined into this patch.
> 
> Michael 
>

Thanks for your review.  

I had considered moving the entire `hvfb_putmem()` function to `destroy`,
but I was hesitant for two reasons:  

  1. I wasn’t aware of any scenario where this would be useful. However,
     your explanation has convinced me that it is necessary.  
  2. `hvfb_release_phymem()` relies on the `hdev` pointer, which requires
     multiple `container_of` operations to derive it from the `info` pointer.
     I was unsure if the complexity was justified, but it seems worthwhile now.  

I will move `hvfb_putmem()` to the `destroy` function in V2, and I hope this
will address all the cases you mentioned.

- Saurabh

<snip>

^ permalink raw reply

* Re: [PATCH v2 1/2] dt-bindings: mfd: Document TI LM3533 MFD
From: Jonathan Cameron @ 2025-02-22 17:27 UTC (permalink / raw)
  To: Svyatoslav Ryhel
  Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Lars-Peter Clausen, Pavel Machek, Daniel Thompson, Jingoo Han,
	Helge Deller, Andy Shevchenko, Uwe Kleine-König, devicetree,
	linux-kernel, linux-iio, linux-leds, dri-devel, linux-fbdev
In-Reply-To: <CAPVz0n0up=vkVzryYLauNCM2=hnz-o_ECm+ooXC8y=C2q+T_WQ@mail.gmail.com>

On Sat, 22 Feb 2025 16:39:31 +0200
Svyatoslav Ryhel <clamor95@gmail.com> wrote:

> сб, 22 лют. 2025 р. о 16:29 Jonathan Cameron <jic23@kernel.org> пише:
> >
> > On Tue, 18 Feb 2025 15:26:59 +0200
> > Svyatoslav Ryhel <clamor95@gmail.com> wrote:
> >  
> > > Add bindings for the LM3533 - a complete power source for
> > > backlight, keypad, and indicator LEDs in smartphone handsets.
> > > The high-voltage inductive boost converter provides the
> > > power for two series LED strings display backlight and keypad
> > > functions.  
> >
> > Wrap patch descriptions to 75 chars as describe in submitting-patches.rst
> >  
> 
> Alright, though why then checkpatch script has max line length 100 chars?
> 
> https://github.com/torvalds/linux/commit/bdc48fa11e46f867ea4d75fa59ee87a7f48be144

Because that script is intended to catch when things are very wrong not
slightly so.  It provides guidance that you should look at and consider
whether to respond to.  Checking for short wrap is trickier to do as
perhaps the formatting is intended in some cases.


Jonathan

> 
> > >
> > > Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>  


^ permalink raw reply

* [PATCH] staging: sm750fb: Replace architecture-specific defines with CONFIG_X86
From: Madhur Kumar @ 2025-02-22 19:32 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang
  Cc: gregkh, linux-fbdev, linux-staging, linux-kernel, Madhur Kumar

Replace the use of __i386__ and __x86_64__ with CONFIG_X86 to adhere to
kernel coding guideline, make the code more portable and integrates
better with the Kconfig system.

Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
---
 drivers/staging/sm750fb/ddk750_chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c
index 02860d3ec..67a2f6044 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -229,7 +229,7 @@ int ddk750_init_hw(struct initchip_param *p_init_param)
 		reg |= (VGA_CONFIGURATION_PLL | VGA_CONFIGURATION_MODE);
 		poke32(VGA_CONFIGURATION, reg);
 	} else {
-#if defined(__i386__) || defined(__x86_64__)
+#ifdef CONFIG_X86
 		/* set graphic mode via IO method */
 		outb_p(0x88, 0x3d4);
 		outb_p(0x06, 0x3d5);
-- 
2.48.1


^ permalink raw reply related

* [PATCH] [PATCH v2] staging: sm750fb: Make g_fbmode truly constant
From: Madhur Kumar @ 2025-02-22 20:15 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang
  Cc: gregkh, linux-fbdev, linux-staging, linux-kernel, Madhur Kumar,
	Dan Carpenter

Declare g_fbmode as a pointer to constant data. This ensures that both
array and its element are immutable.

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com>
---
Changes in v2:
- Added commit message
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 04c1b32a2..aa154032f 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
 static int g_hwcursor = 1;
 static int g_noaccel;
 static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
 static const char *g_def_fbmode = "1024x768-32@60";
 static char *g_settings;
 static int g_dualview;
-- 
2.48.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