* [PATCH] dmaengine: lgm: Move DT parsing after initialization
@ 2023-01-05 3:05 Peter Harliman Liem
2023-01-18 10:02 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Peter Harliman Liem @ 2023-01-05 3:05 UTC (permalink / raw)
To: vkoul, mallikarjunax.reddy; +Cc: dmaengine, linux-lgm-soc, Peter Harliman Liem
ldma_cfg_init() will parse DT to retrieve certain configs.
However, that is called before ldma_dma_init_vXX(), which
will make some initialization to channel configs. It will
thus incorrectly overwrite certain configs that are declared
in DT.
To fix that, we move DT parsing after initialization.
Function name is renamed to better represent what it does.
Fixes: 32d31c79a1a4 ("dmaengine: Add Intel LGM SoC DMA support.")
Signed-off-by: Peter Harliman Liem <pliem@maxlinear.com>
---
drivers/dma/lgm/lgm-dma.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/dma/lgm/lgm-dma.c b/drivers/dma/lgm/lgm-dma.c
index 9b9184f964be..1709d159af7e 100644
--- a/drivers/dma/lgm/lgm-dma.c
+++ b/drivers/dma/lgm/lgm-dma.c
@@ -914,7 +914,7 @@ static void ldma_dev_init(struct ldma_dev *d)
}
}
-static int ldma_cfg_init(struct ldma_dev *d)
+static int ldma_parse_dt(struct ldma_dev *d)
{
struct fwnode_handle *fwnode = dev_fwnode(d->dev);
struct ldma_port *p;
@@ -1661,10 +1661,6 @@ static int intel_ldma_probe(struct platform_device *pdev)
p->ldev = d;
}
- ret = ldma_cfg_init(d);
- if (ret)
- return ret;
-
dma_dev->dev = &pdev->dev;
ch_mask = (unsigned long)d->channels_mask;
@@ -1675,6 +1671,10 @@ static int intel_ldma_probe(struct platform_device *pdev)
ldma_dma_init_v3X(j, d);
}
+ ret = ldma_parse_dt(d);
+ if (ret)
+ return ret;
+
dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources;
dma_dev->device_free_chan_resources = ldma_free_chan_resources;
dma_dev->device_terminate_all = ldma_terminate_all;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] dmaengine: lgm: Move DT parsing after initialization
2023-01-05 3:05 [PATCH] dmaengine: lgm: Move DT parsing after initialization Peter Harliman Liem
@ 2023-01-18 10:02 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2023-01-18 10:02 UTC (permalink / raw)
To: Peter Harliman Liem; +Cc: mallikarjunax.reddy, dmaengine, linux-lgm-soc
On 05-01-23, 11:05, Peter Harliman Liem wrote:
> ldma_cfg_init() will parse DT to retrieve certain configs.
> However, that is called before ldma_dma_init_vXX(), which
> will make some initialization to channel configs. It will
> thus incorrectly overwrite certain configs that are declared
> in DT.
>
> To fix that, we move DT parsing after initialization.
> Function name is renamed to better represent what it does.
Applied, thanks
--
~Vinod
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-18 10:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 3:05 [PATCH] dmaengine: lgm: Move DT parsing after initialization Peter Harliman Liem
2023-01-18 10:02 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox