Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH 00/59] dma: Convert to platform remove callback returning void
@ 2023-09-19 13:31 Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Olivier Dautricourt, Stefan Roese, dmaengine, kernel,
	Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, Ludovic Desroches, Tudor Ambarus,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, Rob Herring, Lars-Peter Clausen,
	Paul Cercueil, linux-mips, Eugeniy Paltsev, Viresh Kumar,
	Andy Shevchenko, Li Yang, Zhang Wei, linuxppc-dev, Shawn Guo,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, Sean Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	ye xingchen, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Sinan Kaya, Green Wan, Kees Cook, Gustavo A. R. Silva, Biju Das,
	Geert Uytterhoeven, Lad Prabhakar, Pavel Machek, Hien Huynh,
	Yangtao Li, Peter Ujfalusi, Jernej Skrabec, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Patrice Chotard, Chen-Yu Tsai,
	Samuel Holland, linux-sunxi, Laxman Dewangan, Jon Hunter,
	Thierry Reding, linux-tegra, Lizhi Hou, Brian Xu,
	Raj Kumar Rampelli, Michal Simek, Radhey Shyam Pandey,
	Peter Korsgaard, Liu Shixin, Laurent Pinchart, Harini Katakam,
	Swati Agarwal

Hello,

this series convert nearly all platform drivers below drivers/dma to use
.remove_new(). The motivation is to get rid of an integer return code
that is (mostly) ignored by the platform driver core and error prone on
the driver side.

See commit 5c5a7680e67b ("platform: Provide a remove callback that
returns no value") for an extended explanation and the eventual goal.

There are 4 drivers I didn't convert in this series:

	drivers/dma/milbeaut-hdmac.c
	drivers/dma/milbeaut-xdmac.c
	drivers/dma/uniphier-mdmac.c
	drivers/dma/uniphier-xdmac.c

These all might return early in .remove() if dmaengine_terminate_sync()
fails. I only looked deeper into the first one, and this shows exactly
the error that is easy to make with .remove() returning an int: When
returning early from .remove(), some cleanup (here:
dma_async_device_unregister()) is skipped. So the dma device stays
known, but the device is still unregistered and the devm allocated stuff
(here e.g. *mdev) is freed. So it can probably easily happen, that
something tries to use the dma device and this will likely result in an
oops.

I don't know enough about the dma framework to address this properly,
maybe someone else knows what to do?

There are no interdependencies between the patches. As there are still
quite a few drivers to convert, I'm happy about every patch that makes
it in. So even if there is a merge conflict with one patch until you
apply or I picked a wrong subject prefix, please apply the remainder of
this series anyhow.

Best regards
Uwe


Uwe Kleine-König (59):
  dma: altera-msgdma: Convert to platform remove callback returning void
  dma: apple-admac: Convert to platform remove callback returning void
  dma: at_hdmac: Convert to platform remove callback returning void
  dma: at_xdmac: Convert to platform remove callback returning void
  dma: bcm-sba-raid: Convert to platform remove callback returning void
  dma: bcm2835-dma: Convert to platform remove callback returning void
  dma: bestcomm: bestcomm: Convert to platform remove callback returning
    void
  dma: dma-axi-dmac: Convert to platform remove callback returning void
  dma: dma-jz4780: Convert to platform remove callback returning void
  dma: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove
    callback returning void
  dma: dw: platform: Convert to platform remove callback returning void
  dma: fsl-edma-main: Convert to platform remove callback returning void
  dma: fsl-qdma: Convert to platform remove callback returning void
  dma: fsl_raid: Convert to platform remove callback returning void
  dma: fsldma: Convert to platform remove callback returning void
  dma: idma64: Convert to platform remove callback returning void
  dma: img-mdc-dma: Convert to platform remove callback returning void
  dma: imx-dma: Convert to platform remove callback returning void
  dma: imx-sdma: Convert to platform remove callback returning void
  dma: k3dma: Convert to platform remove callback returning void
  dma: mcf-edma-main: Convert to platform remove callback returning void
  dma: mediatek: mtk-cqdma: Convert to platform remove callback
    returning void
  dma: mediatek: mtk-hsdma: Convert to platform remove callback
    returning void
  dma: mediatek: mtk-uart-apdma: Convert to platform remove callback
    returning void
  dma: mmp_pdma: Convert to platform remove callback returning void
  dma: mmp_tdma: Convert to platform remove callback returning void
  dma: moxart-dma: Convert to platform remove callback returning void
  dma: mpc512x_dma: Convert to platform remove callback returning void
  dma: mv_xor_v2: Convert to platform remove callback returning void
  dma: nbpfaxi: Convert to platform remove callback returning void
  dma: owl-dma: Convert to platform remove callback returning void
  dma: ppc4xx: adma: Convert to platform remove callback returning void
  dma: pxa_dma: Convert to platform remove callback returning void
  dma: qcom: bam_dma: Convert to platform remove callback returning void
  dma: qcom: hidma: Convert to platform remove callback returning void
  dma: qcom: qcom_adm: Convert to platform remove callback returning
    void
  dma: sa11x0-dma: Convert to platform remove callback returning void
  dma: sf-pdma: sf-pdma: Convert to platform remove callback returning
    void
  dma: sh: rcar-dmac: Convert to platform remove callback returning void
  dma: sh: rz-dmac: Convert to platform remove callback returning void
  dma: sh: shdmac: Convert to platform remove callback returning void
  dma: sh: usb-dmac: Convert to platform remove callback returning void
  dma: sprd-dma: Convert to platform remove callback returning void
  dma: st_fdma: Convert to platform remove callback returning void
  dma: sun4i-dma: Convert to platform remove callback returning void
  dma: sun6i-dma: Convert to platform remove callback returning void
  dma: tegra186-gpc-dma: Convert to platform remove callback returning
    void
  dma: tegra20-apb-dma: Convert to platform remove callback returning
    void
  dma: tegra210-adma: Convert to platform remove callback returning void
  dma: ti: cppi41: Convert to platform remove callback returning void
  dma: ti: edma: Convert to platform remove callback returning void
  dma: ti: omap-dma: Convert to platform remove callback returning void
  dma: timb_dma: Convert to platform remove callback returning void
  dma: txx9dmac: Convert to platform remove callback returning void
  dma: xgene-dma: Convert to platform remove callback returning void
  dma: xilinx: xdma: Convert to platform remove callback returning void
  dma: xilinx: xilinx_dma: Convert to platform remove callback returning
    void
  dma: xilinx: xilinx_dpdma: Convert to platform remove callback
    returning void
  dma: xilinx: zynqmp_dma: Convert to platform remove callback returning
    void

 drivers/dma/altera-msgdma.c                    |  6 ++----
 drivers/dma/apple-admac.c                      |  6 ++----
 drivers/dma/at_hdmac.c                         |  6 ++----
 drivers/dma/at_xdmac.c                         |  6 ++----
 drivers/dma/bcm-sba-raid.c                     |  6 ++----
 drivers/dma/bcm2835-dma.c                      |  6 ++----
 drivers/dma/bestcomm/bestcomm.c                |  6 ++----
 drivers/dma/dma-axi-dmac.c                     |  6 ++----
 drivers/dma/dma-jz4780.c                       |  6 ++----
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c |  6 ++----
 drivers/dma/dw/platform.c                      |  6 ++----
 drivers/dma/fsl-edma-main.c                    |  6 ++----
 drivers/dma/fsl-qdma.c                         |  5 ++---
 drivers/dma/fsl_raid.c                         |  6 ++----
 drivers/dma/fsldma.c                           |  6 ++----
 drivers/dma/idma64.c                           |  6 ++----
 drivers/dma/img-mdc-dma.c                      |  6 ++----
 drivers/dma/imx-dma.c                          |  6 ++----
 drivers/dma/imx-sdma.c                         |  5 ++---
 drivers/dma/k3dma.c                            |  5 ++---
 drivers/dma/mcf-edma-main.c                    |  6 ++----
 drivers/dma/mediatek/mtk-cqdma.c               |  6 ++----
 drivers/dma/mediatek/mtk-hsdma.c               |  6 ++----
 drivers/dma/mediatek/mtk-uart-apdma.c          |  6 ++----
 drivers/dma/mmp_pdma.c                         |  5 ++---
 drivers/dma/mmp_tdma.c                         |  6 ++----
 drivers/dma/moxart-dma.c                       |  6 ++----
 drivers/dma/mpc512x_dma.c                      |  6 ++----
 drivers/dma/mv_xor_v2.c                        |  6 ++----
 drivers/dma/nbpfaxi.c                          |  6 ++----
 drivers/dma/owl-dma.c                          |  6 ++----
 drivers/dma/ppc4xx/adma.c                      |  5 ++---
 drivers/dma/pxa_dma.c                          |  5 ++---
 drivers/dma/qcom/bam_dma.c                     |  6 ++----
 drivers/dma/qcom/hidma.c                       |  6 ++----
 drivers/dma/qcom/qcom_adm.c                    |  6 ++----
 drivers/dma/sa11x0-dma.c                       |  6 ++----
 drivers/dma/sf-pdma/sf-pdma.c                  |  6 ++----
 drivers/dma/sh/rcar-dmac.c                     |  6 ++----
 drivers/dma/sh/rz-dmac.c                       |  6 ++----
 drivers/dma/sh/shdmac.c                        |  6 ++----
 drivers/dma/sh/usb-dmac.c                      |  6 ++----
 drivers/dma/sprd-dma.c                         |  5 ++---
 drivers/dma/st_fdma.c                          |  6 ++----
 drivers/dma/sun4i-dma.c                        |  6 ++----
 drivers/dma/sun6i-dma.c                        |  6 ++----
 drivers/dma/tegra186-gpc-dma.c                 |  6 ++----
 drivers/dma/tegra20-apb-dma.c                  |  6 ++----
 drivers/dma/tegra210-adma.c                    |  6 ++----
 drivers/dma/ti/cppi41.c                        |  5 ++---
 drivers/dma/ti/edma.c                          |  6 ++----
 drivers/dma/ti/omap-dma.c                      |  6 ++----
 drivers/dma/timb_dma.c                         |  5 ++---
 drivers/dma/txx9dmac.c                         | 10 ++++------
 drivers/dma/xgene-dma.c                        |  6 ++----
 drivers/dma/xilinx/xdma.c                      |  6 ++----
 drivers/dma/xilinx/xilinx_dma.c                |  6 ++----
 drivers/dma/xilinx/xilinx_dpdma.c              |  6 ++----
 drivers/dma/xilinx/zynqmp_dma.c                |  6 ++----
 59 files changed, 120 insertions(+), 229 deletions(-)


base-commit: 29e400e3ea486bf942b214769fc9778098114113
-- 
2.40.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 21:02   ` Konrad Dybcio
  2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	dmaengine, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/dma/qcom/bam_dma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c
index 4c3eb972039d..c4f8d17d0c68 100644
--- a/drivers/dma/qcom/bam_dma.c
+++ b/drivers/dma/qcom/bam_dma.c
@@ -1386,7 +1386,7 @@ static int bam_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int bam_dma_remove(struct platform_device *pdev)
+static void bam_dma_remove(struct platform_device *pdev)
 {
 	struct bam_device *bdev = platform_get_drvdata(pdev);
 	u32 i;
@@ -1416,8 +1416,6 @@ static int bam_dma_remove(struct platform_device *pdev)
 	tasklet_kill(&bdev->task);
 
 	clk_disable_unprepare(bdev->bamclk);
-
-	return 0;
 }
 
 static int __maybe_unused bam_dma_runtime_suspend(struct device *dev)
@@ -1475,7 +1473,7 @@ static const struct dev_pm_ops bam_dma_pm_ops = {
 
 static struct platform_driver bam_dma_driver = {
 	.probe = bam_dma_probe,
-	.remove = bam_dma_remove,
+	.remove_new = bam_dma_remove,
 	.driver = {
 		.name = "bam-dma-engine",
 		.pm = &bam_dma_pm_ops,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 35/59] dma: qcom: hidma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 21:02   ` Konrad Dybcio
  2023-09-19 13:31 ` [PATCH 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Sinan Kaya, Andy Gross, Bjorn Andersson, Konrad Dybcio,
	linux-arm-kernel, linux-arm-msm, dmaengine, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/dma/qcom/hidma.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 834ae519c15d..f4659553945b 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -915,7 +915,7 @@ static void hidma_shutdown(struct platform_device *pdev)
 
 }
 
-static int hidma_remove(struct platform_device *pdev)
+static void hidma_remove(struct platform_device *pdev)
 {
 	struct hidma_dev *dmadev = platform_get_drvdata(pdev);
 
@@ -935,8 +935,6 @@ static int hidma_remove(struct platform_device *pdev)
 	dev_info(&pdev->dev, "HI-DMA engine removed\n");
 	pm_runtime_put_sync_suspend(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
-
-	return 0;
 }
 
 #if IS_ENABLED(CONFIG_ACPI)
@@ -960,7 +958,7 @@ MODULE_DEVICE_TABLE(of, hidma_match);
 
 static struct platform_driver hidma_driver = {
 	.probe = hidma_probe,
-	.remove = hidma_remove,
+	.remove_new = hidma_remove,
 	.shutdown = hidma_shutdown,
 	.driver = {
 		   .name = "hidma",
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
  2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
@ 2023-09-19 13:31 ` Uwe Kleine-König
  2023-09-19 21:02   ` Konrad Dybcio
  2023-09-28  7:46 ` [PATCH 00/59] dma: " Vinod Koul
  2023-09-28  7:49 ` Vinod Koul
  4 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2023-09-19 13:31 UTC (permalink / raw)
  To: Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	dmaengine, kernel

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/dma/qcom/qcom_adm.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/dma/qcom/qcom_adm.c b/drivers/dma/qcom/qcom_adm.c
index d56caf1681ff..53f4273b657c 100644
--- a/drivers/dma/qcom/qcom_adm.c
+++ b/drivers/dma/qcom/qcom_adm.c
@@ -904,7 +904,7 @@ static int adm_dma_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int adm_dma_remove(struct platform_device *pdev)
+static void adm_dma_remove(struct platform_device *pdev)
 {
 	struct adm_device *adev = platform_get_drvdata(pdev);
 	struct adm_chan *achan;
@@ -927,8 +927,6 @@ static int adm_dma_remove(struct platform_device *pdev)
 
 	clk_disable_unprepare(adev->core_clk);
 	clk_disable_unprepare(adev->iface_clk);
-
-	return 0;
 }
 
 static const struct of_device_id adm_of_match[] = {
@@ -939,7 +937,7 @@ MODULE_DEVICE_TABLE(of, adm_of_match);
 
 static struct platform_driver adm_dma_driver = {
 	.probe = adm_dma_probe,
-	.remove = adm_dma_remove,
+	.remove_new = adm_dma_remove,
 	.driver = {
 		.name = "adm-dma-engine",
 		.of_match_table = adm_of_match,
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
@ 2023-09-19 21:02   ` Konrad Dybcio
  0 siblings, 0 replies; 9+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, dmaengine, kernel



On 9/19/23 15:31, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() is renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 35/59] dma: qcom: hidma: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
@ 2023-09-19 21:02   ` Konrad Dybcio
  0 siblings, 0 replies; 9+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Sinan Kaya, Andy Gross, Bjorn Andersson, linux-arm-kernel,
	linux-arm-msm, dmaengine, kernel



On 9/19/23 15:31, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() is renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void
  2023-09-19 13:31 ` [PATCH 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
@ 2023-09-19 21:02   ` Konrad Dybcio
  0 siblings, 0 replies; 9+ messages in thread
From: Konrad Dybcio @ 2023-09-19 21:02 UTC (permalink / raw)
  To: Uwe Kleine-König, Vinod Koul
  Cc: Andy Gross, Bjorn Andersson, linux-arm-msm, dmaengine, kernel



On 9/19/23 15:31, Uwe Kleine-König wrote:
> The .remove() callback for a platform driver returns an int which makes
> many driver authors wrongly assume it's possible to do error handling by
> returning an error code. However the value returned is ignored (apart
> from emitting a warning) and this typically results in resource leaks.
> To improve here there is a quest to make the remove callback return
> void. In the first step of this quest all drivers are converted to
> .remove_new() which already returns void. Eventually after all drivers
> are converted, .remove_new() is renamed to .remove().
> 
> Trivially convert this driver from always returning zero in the remove
> callback to the void returning variant.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 00/59] dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (2 preceding siblings ...)
  2023-09-19 13:31 ` [PATCH 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
@ 2023-09-28  7:46 ` Vinod Koul
  2023-09-28  7:49 ` Vinod Koul
  4 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2023-09-28  7:46 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Olivier Dautricourt, Stefan Roese, dmaengine, kernel,
	Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, Ludovic Desroches, Tudor Ambarus,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, Rob Herring, Lars-Peter Clausen,
	Paul Cercueil, linux-mips, Eugeniy Paltsev, Viresh Kumar,
	Andy Shevchenko, Li Yang, Zhang Wei, linuxppc-dev, Shawn Guo,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, Sean Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	ye xingchen, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Sinan Kaya, Green Wan, Kees Cook, Gustavo A. R. Silva, Biju Das,
	Geert Uytterhoeven, Lad Prabhakar, Pavel Machek, Hien Huynh,
	Yangtao Li, Peter Ujfalusi, Jernej Skrabec, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Patrice Chotard, Chen-Yu Tsai,
	Samuel Holland, linux-sunxi, Laxman Dewangan, Jon Hunter,
	Thierry Reding, linux-tegra, Lizhi Hou, Brian Xu,
	Raj Kumar Rampelli, Michal Simek, Radhey Shyam Pandey,
	Peter Korsgaard, Liu Shixin, Laurent Pinchart, Harini Katakam,
	Swati Agarwal


On Tue, 19 Sep 2023 15:31:08 +0200, Uwe Kleine-König wrote:
> this series convert nearly all platform drivers below drivers/dma to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> [...]

Applied, thanks!

[01/59] dma: altera-msgdma: Convert to platform remove callback returning void
        commit: 8876762f285fff08b1aefeba52c7157a2c9beec1
[02/59] dma: apple-admac: Convert to platform remove callback returning void
        commit: e7d5aa30c8a19e6d9c4ec19d3b9e501df22e1d1a
[03/59] dma: at_hdmac: Convert to platform remove callback returning void
        commit: ae3f38e495b42494414cbace3b3bd3cb6dc10506
[04/59] dma: at_xdmac: Convert to platform remove callback returning void
        commit: b13af3c41bad5f4e45a73d6978f31ad48ffc2dee
[05/59] dma: bcm-sba-raid: Convert to platform remove callback returning void
        commit: 017df796a3635edee5169a0700634da6dac92f6a
[06/59] dma: bcm2835-dma: Convert to platform remove callback returning void
        commit: 8f63a2da288454e9228f6b438b86627f6ceae36b
[07/59] dma: bestcomm: bestcomm: Convert to platform remove callback returning void
        commit: 7689bca111997e0d7a12cf6457fc26a52b8c800f
[08/59] dma: dma-axi-dmac: Convert to platform remove callback returning void
        commit: b5f095a70117629c3abb49bcb07dfa954d275e99
[09/59] dma: dma-jz4780: Convert to platform remove callback returning void
        commit: a8c85540bee12d492904a430c0c1105a4b7b101c
[10/59] dma: dw-axi-dmac: dw-axi-dmac-platform: Convert to platform remove callback returning void
        commit: c689a2fd2a3f2a0a9e775c59c0f02ea64677c254
[11/59] dma: dw: platform: Convert to platform remove callback returning void
        commit: 67572bfe2e35c232c3497b3fc8babbfe62600ce0
[12/59] dma: fsl-edma-main: Convert to platform remove callback returning void
        commit: fa13c3ef3f45bca5a1474755dac57bfaf28ef61b
[13/59] dma: fsl-qdma: Convert to platform remove callback returning void
        commit: fe3d44cdaea41173e50833440db84982e2a8d2a7
[14/59] dma: fsl_raid: Convert to platform remove callback returning void
        commit: 37b24b50c5f8ad9037fbe81f1ee43f5e16fb5334
[15/59] dma: fsldma: Convert to platform remove callback returning void
        commit: d69f80110da5d0e665d7f2872bf2185fe7f14409
[16/59] dma: idma64: Convert to platform remove callback returning void
        commit: e8da277fbb8701308cfd2337afb13d34cc233349
[17/59] dma: img-mdc-dma: Convert to platform remove callback returning void
        commit: 6e1b4a907e860071d957baee688a30a0bff102ef
[18/59] dma: imx-dma: Convert to platform remove callback returning void
        commit: 14c49dd0c34e457d71494b04290c27d7a14584d7
[19/59] dma: imx-sdma: Convert to platform remove callback returning void
        commit: 06e4f653fafdeec7b13958b771226efa1cdf76d2
[20/59] dma: k3dma: Convert to platform remove callback returning void
        commit: 3faf902cb808163e9e65bf568c235a272215aed2
[21/59] dma: mcf-edma-main: Convert to platform remove callback returning void
        commit: 48236cb8314238917788f73353290dd1afb9a7c6
[22/59] dma: mediatek: mtk-cqdma: Convert to platform remove callback returning void
        commit: bdeb61f5180efc920cf55b966a2a30bc2336d6d4
[23/59] dma: mediatek: mtk-hsdma: Convert to platform remove callback returning void
        commit: 97283173effa6e53ea698726ea5d07f7ca06e5cf
[24/59] dma: mediatek: mtk-uart-apdma: Convert to platform remove callback returning void
        commit: 4db30945a001ac97b5044db2aa2990b8e7df9452
[25/59] dma: mmp_pdma: Convert to platform remove callback returning void
        commit: c0f0d93fc1da36de564da9b3f0462b5bdc4b1948
[26/59] dma: mmp_tdma: Convert to platform remove callback returning void
        commit: f543b251500a0de589bc4c97da45b88410bf7c56
[27/59] dma: moxart-dma: Convert to platform remove callback returning void
        commit: 1a65831fa037457114ca75ea262d87fbde3158f0
[28/59] dma: mpc512x_dma: Convert to platform remove callback returning void
        commit: 80d0159bbe80d8de6f64c0a8554b4066c66eb378
[29/59] dma: mv_xor_v2: Convert to platform remove callback returning void
        commit: 733dbb8d62f33448c0d7470ba06ce39bdd790ddd
[30/59] dma: nbpfaxi: Convert to platform remove callback returning void
        commit: 44d5338c4a5d7f3f1ef07d502b9db22a29a8756a
[31/59] dma: owl-dma: Convert to platform remove callback returning void
        commit: 1260486a347567c33e0118626bb8778e342e6080
[32/59] dma: ppc4xx: adma: Convert to platform remove callback returning void
        commit: 5f8f212fb416dc3600046955fb008732a512fa5c
[33/59] dma: pxa_dma: Convert to platform remove callback returning void
        commit: 44ea88715d37dc31145b7712b5474808258bab5f
[34/59] dma: qcom: bam_dma: Convert to platform remove callback returning void
        commit: 8d0f1ca5e4037f671cee43a4a582c0f8c6e8e31d
[35/59] dma: qcom: hidma: Convert to platform remove callback returning void
        commit: af9bc3c26b08714eb2309dcbf9a74a6c7af6327f
[36/59] dma: qcom: qcom_adm: Convert to platform remove callback returning void
        commit: 1a6d1c87542d6bb178db5bc2befc9abf99447684
[37/59] dma: sa11x0-dma: Convert to platform remove callback returning void
        commit: d6798037fa1c01e6b9486cc1fbe1b5a272dde477
[38/59] dma: sf-pdma: sf-pdma: Convert to platform remove callback returning void
        commit: 3d97deeb3b3077b3a6f9636f3ea312fef7f54059
[39/59] dma: sh: rcar-dmac: Convert to platform remove callback returning void
        commit: 8ca342994ab8abda069c4b918aab5fa6b8c1614f
[40/59] dma: sh: rz-dmac: Convert to platform remove callback returning void
        commit: bd4205f52310a158c78171d3a5f68c7301a532fd
[41/59] dma: sh: shdmac: Convert to platform remove callback returning void
        commit: 384ba9a683d3ba9f2f598b4c5fbf6f79a9213e94
[42/59] dma: sh: usb-dmac: Convert to platform remove callback returning void
        commit: 9f2812a7fe47c422a367ef95e418dd63fced7238
[43/59] dma: sprd-dma: Convert to platform remove callback returning void
        commit: 8d82eb85a74246afb9b4bc69abf6e79014b06d4f
[44/59] dma: st_fdma: Convert to platform remove callback returning void
        commit: 9c52ffa09f580c49df1cc0b1998d7ea8fdf2c0b4
[45/59] dma: sun4i-dma: Convert to platform remove callback returning void
        commit: 2db76471c8f45837efafdd7d57633aa9f194d787
[46/59] dma: sun6i-dma: Convert to platform remove callback returning void
        commit: 7d6ef7550a4577ae943194421dea73f3df084265
[47/59] dma: tegra186-gpc-dma: Convert to platform remove callback returning void
        commit: d669b198efac1ea97fa39d6f8be59aefe5f39171
[48/59] dma: tegra20-apb-dma: Convert to platform remove callback returning void
        commit: afd1ac2e1b9b39040bb5eedd94b2b152020994e0
[49/59] dma: tegra210-adma: Convert to platform remove callback returning void
        commit: 1a3fa3e369bf54bef0021a8c840567622f52354f
[50/59] dma: ti: cppi41: Convert to platform remove callback returning void
        commit: 36a7e98c36a598c2865daf748a7d9d889a34aaf3
[51/59] dma: ti: edma: Convert to platform remove callback returning void
        commit: 68bcaf5c4e03ada2696b4fbd03ee775781945034
[52/59] dma: ti: omap-dma: Convert to platform remove callback returning void
        commit: 5ea68dc1cee00e5ecf174f2a3ef13d63520971cb
[53/59] dma: timb_dma: Convert to platform remove callback returning void
        commit: 4f339d6efa6a74a16f77fd9a06adf01d9df84734
[54/59] dma: txx9dmac: Convert to platform remove callback returning void
        commit: a3b4af719e571bd899b7952626c2b4d8ec7c0c77
[55/59] dma: xgene-dma: Convert to platform remove callback returning void
        commit: 2c9d879fae9ab1be3d4926ebea5e85305998cf93
[56/59] dma: xilinx: xdma: Convert to platform remove callback returning void
        commit: 78369eb5dc8881d78f163434ee2788a800b89219
[57/59] dma: xilinx: xilinx_dma: Convert to platform remove callback returning void
        commit: cc99582d46b428ba4c2cb7ecd05df4569b02d1f4
[58/59] dma: xilinx: xilinx_dpdma: Convert to platform remove callback returning void
        commit: c962eca73c5cce72936a8b3bd23a24b29852ea97
[59/59] dma: xilinx: zynqmp_dma: Convert to platform remove callback returning void
        commit: b1c50ac25425385b576dd58b7b38c1c5963dde85

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 00/59] dma: Convert to platform remove callback returning void
  2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
                   ` (3 preceding siblings ...)
  2023-09-28  7:46 ` [PATCH 00/59] dma: " Vinod Koul
@ 2023-09-28  7:49 ` Vinod Koul
  4 siblings, 0 replies; 9+ messages in thread
From: Vinod Koul @ 2023-09-28  7:49 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Olivier Dautricourt, Stefan Roese, dmaengine, kernel,
	Hector Martin, Sven Peter, Alyssa Rosenzweig, asahi,
	linux-arm-kernel, Ludovic Desroches, Tudor Ambarus,
	Florian Fainelli, Broadcom internal kernel review list, Ray Jui,
	Scott Branden, linux-rpi-kernel, Rob Herring, Lars-Peter Clausen,
	Paul Cercueil, linux-mips, Eugeniy Paltsev, Viresh Kumar,
	Andy Shevchenko, Li Yang, Zhang Wei, linuxppc-dev, Shawn Guo,
	Sascha Hauer, Fabio Estevam, NXP Linux Team, Sean Wang,
	Matthias Brugger, AngeloGioacchino Del Regno, linux-mediatek,
	Andreas Färber, Manivannan Sadhasivam, linux-actions,
	ye xingchen, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
	Andy Gross, Bjorn Andersson, Konrad Dybcio, linux-arm-msm,
	Sinan Kaya, Green Wan, Kees Cook, Gustavo A. R. Silva, Biju Das,
	Geert Uytterhoeven, Lad Prabhakar, Pavel Machek, Hien Huynh,
	Yangtao Li, Peter Ujfalusi, Jernej Skrabec, Orson Zhai,
	Baolin Wang, Chunyan Zhang, Patrice Chotard, Chen-Yu Tsai,
	Samuel Holland, linux-sunxi, Laxman Dewangan, Jon Hunter,
	Thierry Reding, linux-tegra, Lizhi Hou, Brian Xu,
	Raj Kumar Rampelli, Michal Simek, Radhey Shyam Pandey,
	Peter Korsgaard, Liu Shixin, Laurent Pinchart, Harini Katakam,
	Swati Agarwal

On 19-09-23, 15:31, Uwe Kleine-König wrote:
> Hello,
> 
> this series convert nearly all platform drivers below drivers/dma to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.

I have applied this, with change of subsystem to dmaengine: xxx
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> There are 4 drivers I didn't convert in this series:
> 
> 	drivers/dma/milbeaut-hdmac.c
> 	drivers/dma/milbeaut-xdmac.c
> 	drivers/dma/uniphier-mdmac.c
> 	drivers/dma/uniphier-xdmac.c
> 
> These all might return early in .remove() if dmaengine_terminate_sync()
> fails. I only looked deeper into the first one, and this shows exactly
> the error that is easy to make with .remove() returning an int: When
> returning early from .remove(), some cleanup (here:
> dma_async_device_unregister()) is skipped. So the dma device stays
> known, but the device is still unregistered and the devm allocated stuff
> (here e.g. *mdev) is freed. So it can probably easily happen, that
> something tries to use the dma device and this will likely result in an
> oops.

We should convert these too, thanks for your work for the conversion

-- 
~Vinod

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-09-28  7:49 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-19 13:31 [PATCH 00/59] dma: Convert to platform remove callback returning void Uwe Kleine-König
2023-09-19 13:31 ` [PATCH 34/59] dma: qcom: bam_dma: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
2023-09-19 13:31 ` [PATCH 35/59] dma: qcom: hidma: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
2023-09-19 13:31 ` [PATCH 36/59] dma: qcom: qcom_adm: " Uwe Kleine-König
2023-09-19 21:02   ` Konrad Dybcio
2023-09-28  7:46 ` [PATCH 00/59] dma: " Vinod Koul
2023-09-28  7:49 ` Vinod Koul

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