* [PATCH v3 0/2] dmaengine: bcm2835-dma: Fix OF DMA controller lifetime
[not found] <20261129-bcm2835-dma-of-dma-free-v3-0-cdb1c9a32b55.ref@yahoo.pl>
@ 2026-11-29 20:01 ` tomasz.unger
2026-11-29 20:01 ` [PATCH v3 1/2] dmaengine: bcm2835-dma: Add missing of_dma_controller_free() tomasz.unger
2026-11-29 20:01 ` [PATCH v3 2/2] dmaengine: bcm2835-dma: Convert to managed resources tomasz.unger
0 siblings, 2 replies; 5+ messages in thread
From: tomasz.unger @ 2026-11-29 20:01 UTC (permalink / raw)
To: Vinod Koul, Florian Fainelli
Cc: Tomasz Unger, Frank Li, Broadcom internal kernel review list,
Ray Jui, Scott Branden, dmaengine, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, stable
From: Tomasz Unger <tomasz.unger@yahoo.pl>
Patch 1 is the minimal fix from v1: free the OF DMA controller in
remove and on the probe error path. It is unchanged and meant for
stable.
Patch 2 converts the driver to devres as suggested by Frank Li in the
v1 review. The OF controller is now registered last, after the DMA
device, and freed first, which also closes the window in probe where
a channel could be requested from a device that was not registered
yet. It uses devm_of_dma_controller_register(), so it is not meant
for stable.
Verified on a Raspberry Pi 4 Model B: unbinding vc4 and the DMA
controller and binding vc4 again oopses without the series. With
patch 1 alone and with the whole series, binding vc4 is deferred while
the controller is unbound, and HDMI audio gets its DMA channels back
once it is bound again. The remove path and a forced probe failure
were also run under KASAN in QEMU raspi4b, again with patch 1 alone
and with the whole series: slab-use-after-free in find_candidate()
without the series, no report with it.
An AI coding assistant (Claude) helped find the bug and draft the fixes.
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
Changes in v3:
- Drop the Assisted-by tags (Frank Li)
- Patch 2: shorten the commit message and use dev_err_probe() (Frank Li)
- Patch 1 code unchanged
- Link to v2: https://patch.msgid.link/20261119-bcm2835-dma-of-dma-free-v2-0-ebde4846d206@yahoo.pl
Changes in v2:
- Add patch 2: devres conversion (Frank Li)
- Patch 1 unchanged
- Link to v1: https://patch.msgid.link/20261115-bcm2835-dma-of-dma-free-v1-1-d539234bfec5@yahoo.pl
---
Tomasz Unger (2):
dmaengine: bcm2835-dma: Add missing of_dma_controller_free()
dmaengine: bcm2835-dma: Convert to managed resources
drivers/dma/bcm2835-dma.c | 77 ++++++++++++++++++++++-------------------------
1 file changed, 36 insertions(+), 41 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261115-bcm2835-dma-of-dma-free-ef85776c0914
Best regards,
--
Tomasz Unger <tomasz.unger@yahoo.pl>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v3 1/2] dmaengine: bcm2835-dma: Add missing of_dma_controller_free()
2026-11-29 20:01 ` [PATCH v3 0/2] dmaengine: bcm2835-dma: Fix OF DMA controller lifetime tomasz.unger
@ 2026-11-29 20:01 ` tomasz.unger
2026-12-01 20:22 ` Frank Li
2026-11-29 20:01 ` [PATCH v3 2/2] dmaengine: bcm2835-dma: Convert to managed resources tomasz.unger
1 sibling, 1 reply; 5+ messages in thread
From: tomasz.unger @ 2026-11-29 20:01 UTC (permalink / raw)
To: Vinod Koul, Florian Fainelli
Cc: Tomasz Unger, Frank Li, Broadcom internal kernel review list,
Ray Jui, Scott Branden, dmaengine, linux-rpi-kernel,
linux-arm-kernel, linux-kernel, stable
From: Tomasz Unger <tomasz.unger@yahoo.pl>
bcm2835_dma_probe() registers the controller with
of_dma_controller_register(), but of_dma_controller_free() is never
called, neither when dma_async_device_register() fails nor in
bcm2835_dma_remove().
The entry stays on the global of_dma_list and keeps a pointer to the
driver data, which is devm-allocated and freed when the device is
unbound. The next DMA channel request for this node is passed to
bcm2835_dma_xlate() with the freed structure and, depending on what
that memory holds by then, either fails or crashes. As the stale entry
is found first, this still happens after the controller has been bound
again.
On a Raspberry Pi 4 Model B, unbinding vc4 and the DMA controller and
then binding vc4 again results in:
Unable to handle kernel NULL pointer dereference at virtual address
0000000000000018
Call trace:
find_candidate+0x64/0x210 (P)
dma_get_any_slave_channel+0x64/0xd0
bcm2835_dma_xlate+0x24/0x48
of_dma_request_slave_channel+0x178/0x2a8
dma_request_chan+0x20c/0x380
snd_dmaengine_pcm_register+0xa4/0x2a0 [snd_soc_core]
devm_snd_dmaengine_pcm_register+0x60/0xc0 [snd_soc_core]
vc4_hdmi_bind+0x4d4/0x8e8 [vc4]
Free the controller on the probe error path and in remove. In remove,
do it before unregistering the DMA device, so that no channel can be
requested through the node while the device is going away.
Fixes: 96286b576690 ("dmaengine: Add support for BCM2835")
Cc: stable@vger.kernel.org
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/dma/bcm2835-dma.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index 06d830d36882..cf29d897450e 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -1011,13 +1011,15 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
if (rc) {
dev_err(&pdev->dev,
"Failed to register slave DMA engine device: %d\n", rc);
- goto err_no_dma;
+ goto err_of_dma;
}
dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n");
return 0;
+err_of_dma:
+ of_dma_controller_free(pdev->dev.of_node);
err_no_dma:
bcm2835_dma_free(od);
return rc;
@@ -1027,6 +1029,7 @@ static void bcm2835_dma_remove(struct platform_device *pdev)
{
struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
+ of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&od->ddev);
bcm2835_dma_free(od);
}
--
2.56.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 2/2] dmaengine: bcm2835-dma: Convert to managed resources
2026-11-29 20:01 ` [PATCH v3 0/2] dmaengine: bcm2835-dma: Fix OF DMA controller lifetime tomasz.unger
2026-11-29 20:01 ` [PATCH v3 1/2] dmaengine: bcm2835-dma: Add missing of_dma_controller_free() tomasz.unger
@ 2026-11-29 20:01 ` tomasz.unger
2026-12-01 20:26 ` Frank Li
1 sibling, 1 reply; 5+ messages in thread
From: tomasz.unger @ 2026-11-29 20:01 UTC (permalink / raw)
To: Vinod Koul, Florian Fainelli
Cc: Tomasz Unger, Frank Li, Broadcom internal kernel review list,
Ray Jui, Scott Branden, dmaengine, linux-rpi-kernel,
linux-arm-kernel, linux-kernel
From: Tomasz Unger <tomasz.unger@yahoo.pl>
bcm2835_dma_probe() registers the OF DMA controller before the DMA
device, so a client can request a channel from a device that is not
registered yet.
Convert the driver to managed resources and register the OF controller
last, so that devres frees it first. This removes bcm2835_dma_remove()
and the error labels. Use dev_err_probe() for the error messages in
probe.
Suggested-by: Frank Li <Frank.Li@kernel.org>
Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
---
drivers/dma/bcm2835-dma.c | 80 +++++++++++++++++++++--------------------------
1 file changed, 36 insertions(+), 44 deletions(-)
diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
index cf29d897450e..b3870c444a14 100644
--- a/drivers/dma/bcm2835-dma.c
+++ b/drivers/dma/bcm2835-dma.c
@@ -822,8 +822,9 @@ static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id,
return 0;
}
-static void bcm2835_dma_free(struct bcm2835_dmadev *od)
+static void bcm2835_dma_free(void *data)
{
+ struct bcm2835_dmadev *od = data;
struct bcm2835_chan *c, *next;
list_for_each_entry_safe(c, next, &od->ddev.channels,
@@ -831,6 +832,11 @@ static void bcm2835_dma_free(struct bcm2835_dmadev *od)
list_del(&c->vc.chan.device_node);
tasklet_kill(&c->vc.task);
}
+}
+
+static void bcm2835_dma_unmap_zero_page(void *data)
+{
+ struct bcm2835_dmadev *od = data;
dma_unmap_page_attrs(od->ddev.dev, od->zero_page, PAGE_SIZE,
DMA_TO_DEVICE, DMA_ATTR_SKIP_CPU_SYNC);
@@ -894,10 +900,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
- if (rc) {
- dev_err(&pdev->dev, "Unable to set DMA mask\n");
- return rc;
- }
+ if (rc)
+ return dev_err_probe(&pdev->dev, rc,
+ "Unable to set DMA mask\n");
od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
if (!od)
@@ -939,19 +944,21 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
od->zero_page = dma_map_page_attrs(od->ddev.dev, ZERO_PAGE(0), 0,
PAGE_SIZE, DMA_TO_DEVICE,
DMA_ATTR_SKIP_CPU_SYNC);
- if (dma_mapping_error(od->ddev.dev, od->zero_page)) {
- dev_err(&pdev->dev, "Failed to map zero page\n");
- return -ENOMEM;
- }
+ if (dma_mapping_error(od->ddev.dev, od->zero_page))
+ return dev_err_probe(&pdev->dev, -ENOMEM,
+ "Failed to map zero page\n");
+
+ rc = devm_add_action_or_reset(&pdev->dev, bcm2835_dma_unmap_zero_page,
+ od);
+ if (rc)
+ return rc;
/* Request DMA channel mask from device tree */
if (of_property_read_u32(pdev->dev.of_node,
"brcm,dma-channel-mask",
- &chans_available)) {
- dev_err(&pdev->dev, "Failed to get channel mask\n");
- rc = -EINVAL;
- goto err_no_dma;
- }
+ &chans_available))
+ return dev_err_probe(&pdev->dev, -EINVAL,
+ "Failed to get channel mask\n");
/* get irqs for each channel that we support */
for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) {
@@ -994,49 +1001,34 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
/* initialize the channel */
rc = bcm2835_dma_chan_init(od, i, irq[i], irq_flags);
if (rc)
- goto err_no_dma;
+ return rc;
}
dev_dbg(&pdev->dev, "Initialized %i DMA channels\n", i);
- /* Device-tree DMA controller registration */
- rc = of_dma_controller_register(pdev->dev.of_node,
- bcm2835_dma_xlate, od);
- if (rc) {
- dev_err(&pdev->dev, "Failed to register DMA controller\n");
- goto err_no_dma;
- }
+ rc = devm_add_action_or_reset(&pdev->dev, bcm2835_dma_free, od);
+ if (rc)
+ return rc;
- rc = dma_async_device_register(&od->ddev);
- if (rc) {
- dev_err(&pdev->dev,
- "Failed to register slave DMA engine device: %d\n", rc);
- goto err_of_dma;
- }
+ rc = dmaenginem_async_device_register(&od->ddev);
+ if (rc)
+ return dev_err_probe(&pdev->dev, rc,
+ "Failed to register slave DMA engine device\n");
+
+ /* Device-tree DMA controller registration */
+ rc = devm_of_dma_controller_register(&pdev->dev, pdev->dev.of_node,
+ bcm2835_dma_xlate, od);
+ if (rc)
+ return dev_err_probe(&pdev->dev, rc,
+ "Failed to register DMA controller\n");
dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n");
return 0;
-
-err_of_dma:
- of_dma_controller_free(pdev->dev.of_node);
-err_no_dma:
- bcm2835_dma_free(od);
- return rc;
-}
-
-static void bcm2835_dma_remove(struct platform_device *pdev)
-{
- struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
-
- of_dma_controller_free(pdev->dev.of_node);
- dma_async_device_unregister(&od->ddev);
- bcm2835_dma_free(od);
}
static struct platform_driver bcm2835_dma_driver = {
.probe = bcm2835_dma_probe,
- .remove = bcm2835_dma_remove,
.driver = {
.name = "bcm2835-dma",
.of_match_table = of_match_ptr(bcm2835_dma_of_match),
--
2.56.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] dmaengine: bcm2835-dma: Add missing of_dma_controller_free()
2026-11-29 20:01 ` [PATCH v3 1/2] dmaengine: bcm2835-dma: Add missing of_dma_controller_free() tomasz.unger
@ 2026-12-01 20:22 ` Frank Li
0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-12-01 20:22 UTC (permalink / raw)
To: tomasz.unger
Cc: Vinod Koul, Florian Fainelli, Frank Li,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
dmaengine, linux-rpi-kernel, linux-arm-kernel, linux-kernel,
stable
On Sun, Nov 29, 2026 at 09:01:40PM +0100, tomasz.unger@yahoo.pl wrote:
> From: Tomasz Unger <tomasz.unger@yahoo.pl>
>
> bcm2835_dma_probe() registers the controller with
> of_dma_controller_register(), but of_dma_controller_free() is never
> called, neither when dma_async_device_register() fails nor in
> bcm2835_dma_remove().
>
> The entry stays on the global of_dma_list and keeps a pointer to the
> driver data, which is devm-allocated and freed when the device is
> unbound. The next DMA channel request for this node is passed to
> bcm2835_dma_xlate() with the freed structure and, depending on what
> that memory holds by then, either fails or crashes. As the stale entry
> is found first, this still happens after the controller has been bound
> again.
>
> On a Raspberry Pi 4 Model B, unbinding vc4 and the DMA controller and
> then binding vc4 again results in:
>
> Unable to handle kernel NULL pointer dereference at virtual address
> 0000000000000018
> Call trace:
> find_candidate+0x64/0x210 (P)
> dma_get_any_slave_channel+0x64/0xd0
> bcm2835_dma_xlate+0x24/0x48
> of_dma_request_slave_channel+0x178/0x2a8
> dma_request_chan+0x20c/0x380
> snd_dmaengine_pcm_register+0xa4/0x2a0 [snd_soc_core]
> devm_snd_dmaengine_pcm_register+0x60/0xc0 [snd_soc_core]
> vc4_hdmi_bind+0x4d4/0x8e8 [vc4]
>
> Free the controller on the probe error path and in remove. In remove,
> do it before unregistering the DMA device, so that no channel can be
> requested through the node while the device is going away.
>
> Fixes: 96286b576690 ("dmaengine: Add support for BCM2835")
> Cc: stable@vger.kernel.org
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/bcm2835-dma.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> index 06d830d36882..cf29d897450e 100644
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -1011,13 +1011,15 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
> if (rc) {
> dev_err(&pdev->dev,
> "Failed to register slave DMA engine device: %d\n", rc);
> - goto err_no_dma;
> + goto err_of_dma;
> }
>
> dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n");
>
> return 0;
>
> +err_of_dma:
> + of_dma_controller_free(pdev->dev.of_node);
> err_no_dma:
> bcm2835_dma_free(od);
> return rc;
> @@ -1027,6 +1029,7 @@ static void bcm2835_dma_remove(struct platform_device *pdev)
> {
> struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
>
> + of_dma_controller_free(pdev->dev.of_node);
> dma_async_device_unregister(&od->ddev);
> bcm2835_dma_free(od);
> }
>
> --
> 2.56.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 2/2] dmaengine: bcm2835-dma: Convert to managed resources
2026-11-29 20:01 ` [PATCH v3 2/2] dmaengine: bcm2835-dma: Convert to managed resources tomasz.unger
@ 2026-12-01 20:26 ` Frank Li
0 siblings, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-12-01 20:26 UTC (permalink / raw)
To: tomasz.unger
Cc: Vinod Koul, Florian Fainelli, Frank Li,
Broadcom internal kernel review list, Ray Jui, Scott Branden,
dmaengine, linux-rpi-kernel, linux-arm-kernel, linux-kernel
On Sun, Nov 29, 2026 at 09:01:45PM +0100, tomasz.unger@yahoo.pl wrote:
> From: Tomasz Unger <tomasz.unger@yahoo.pl>
>
> bcm2835_dma_probe() registers the OF DMA controller before the DMA
> device, so a client can request a channel from a device that is not
> registered yet.
>
> Convert the driver to managed resources and register the OF controller
> last, so that devres frees it first. This removes bcm2835_dma_remove()
> and the error labels. Use dev_err_probe() for the error messages in
> probe.
>
> Suggested-by: Frank Li <Frank.Li@kernel.org>
> Signed-off-by: Tomasz Unger <tomasz.unger@yahoo.pl>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/bcm2835-dma.c | 80 +++++++++++++++++++++--------------------------
> 1 file changed, 36 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> index cf29d897450e..b3870c444a14 100644
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -822,8 +822,9 @@ static int bcm2835_dma_chan_init(struct bcm2835_dmadev *d, int chan_id,
> return 0;
> }
>
> -static void bcm2835_dma_free(struct bcm2835_dmadev *od)
> +static void bcm2835_dma_free(void *data)
> {
> + struct bcm2835_dmadev *od = data;
> struct bcm2835_chan *c, *next;
>
> list_for_each_entry_safe(c, next, &od->ddev.channels,
> @@ -831,6 +832,11 @@ static void bcm2835_dma_free(struct bcm2835_dmadev *od)
> list_del(&c->vc.chan.device_node);
> tasklet_kill(&c->vc.task);
> }
> +}
> +
> +static void bcm2835_dma_unmap_zero_page(void *data)
> +{
> + struct bcm2835_dmadev *od = data;
>
> dma_unmap_page_attrs(od->ddev.dev, od->zero_page, PAGE_SIZE,
> DMA_TO_DEVICE, DMA_ATTR_SKIP_CPU_SYNC);
> @@ -894,10 +900,9 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
> pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
>
> rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
> - if (rc) {
> - dev_err(&pdev->dev, "Unable to set DMA mask\n");
> - return rc;
> - }
> + if (rc)
> + return dev_err_probe(&pdev->dev, rc,
> + "Unable to set DMA mask\n");
>
> od = devm_kzalloc(&pdev->dev, sizeof(*od), GFP_KERNEL);
> if (!od)
> @@ -939,19 +944,21 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
> od->zero_page = dma_map_page_attrs(od->ddev.dev, ZERO_PAGE(0), 0,
> PAGE_SIZE, DMA_TO_DEVICE,
> DMA_ATTR_SKIP_CPU_SYNC);
> - if (dma_mapping_error(od->ddev.dev, od->zero_page)) {
> - dev_err(&pdev->dev, "Failed to map zero page\n");
> - return -ENOMEM;
> - }
> + if (dma_mapping_error(od->ddev.dev, od->zero_page))
> + return dev_err_probe(&pdev->dev, -ENOMEM,
> + "Failed to map zero page\n");
> +
> + rc = devm_add_action_or_reset(&pdev->dev, bcm2835_dma_unmap_zero_page,
> + od);
> + if (rc)
> + return rc;
>
> /* Request DMA channel mask from device tree */
> if (of_property_read_u32(pdev->dev.of_node,
> "brcm,dma-channel-mask",
> - &chans_available)) {
> - dev_err(&pdev->dev, "Failed to get channel mask\n");
> - rc = -EINVAL;
> - goto err_no_dma;
> - }
> + &chans_available))
> + return dev_err_probe(&pdev->dev, -EINVAL,
> + "Failed to get channel mask\n");
>
> /* get irqs for each channel that we support */
> for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) {
> @@ -994,49 +1001,34 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
> /* initialize the channel */
> rc = bcm2835_dma_chan_init(od, i, irq[i], irq_flags);
> if (rc)
> - goto err_no_dma;
> + return rc;
> }
>
> dev_dbg(&pdev->dev, "Initialized %i DMA channels\n", i);
>
> - /* Device-tree DMA controller registration */
> - rc = of_dma_controller_register(pdev->dev.of_node,
> - bcm2835_dma_xlate, od);
> - if (rc) {
> - dev_err(&pdev->dev, "Failed to register DMA controller\n");
> - goto err_no_dma;
> - }
> + rc = devm_add_action_or_reset(&pdev->dev, bcm2835_dma_free, od);
> + if (rc)
> + return rc;
>
> - rc = dma_async_device_register(&od->ddev);
> - if (rc) {
> - dev_err(&pdev->dev,
> - "Failed to register slave DMA engine device: %d\n", rc);
> - goto err_of_dma;
> - }
> + rc = dmaenginem_async_device_register(&od->ddev);
> + if (rc)
> + return dev_err_probe(&pdev->dev, rc,
> + "Failed to register slave DMA engine device\n");
> +
> + /* Device-tree DMA controller registration */
> + rc = devm_of_dma_controller_register(&pdev->dev, pdev->dev.of_node,
> + bcm2835_dma_xlate, od);
> + if (rc)
> + return dev_err_probe(&pdev->dev, rc,
> + "Failed to register DMA controller\n");
>
> dev_dbg(&pdev->dev, "Load BCM2835 DMA engine driver\n");
>
> return 0;
> -
> -err_of_dma:
> - of_dma_controller_free(pdev->dev.of_node);
> -err_no_dma:
> - bcm2835_dma_free(od);
> - return rc;
> -}
> -
> -static void bcm2835_dma_remove(struct platform_device *pdev)
> -{
> - struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
> -
> - of_dma_controller_free(pdev->dev.of_node);
> - dma_async_device_unregister(&od->ddev);
> - bcm2835_dma_free(od);
> }
>
> static struct platform_driver bcm2835_dma_driver = {
> .probe = bcm2835_dma_probe,
> - .remove = bcm2835_dma_remove,
> .driver = {
> .name = "bcm2835-dma",
> .of_match_table = of_match_ptr(bcm2835_dma_of_match),
>
> --
> 2.56.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-12-01 20:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20261129-bcm2835-dma-of-dma-free-v3-0-cdb1c9a32b55.ref@yahoo.pl>
2026-11-29 20:01 ` [PATCH v3 0/2] dmaengine: bcm2835-dma: Fix OF DMA controller lifetime tomasz.unger
2026-11-29 20:01 ` [PATCH v3 1/2] dmaengine: bcm2835-dma: Add missing of_dma_controller_free() tomasz.unger
2026-12-01 20:22 ` Frank Li
2026-11-29 20:01 ` [PATCH v3 2/2] dmaengine: bcm2835-dma: Convert to managed resources tomasz.unger
2026-12-01 20:26 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox