Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1732508 > unrolled thread
| Started by | Nicolin Chen <nicoleotsuka@gmail.com> |
|---|---|
| First post | 2017-09-14 20:50 +0200 |
| Last post | 2017-09-21 19:20 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions Nicolin Chen <nicoleotsuka@gmail.com> - 2017-09-14 20:50 +0200
Re: [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions Fabio Estevam <festevam@gmail.com> - 2017-09-14 21:50 +0200
Re: [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions Nicolin Chen <nicoleotsuka@gmail.com> - 2017-09-14 23:50 +0200
Re: [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions Vinod Koul <vinod.koul@intel.com> - 2017-09-21 19:20 +0200
| From | Nicolin Chen <nicoleotsuka@gmail.com> |
|---|---|
| Date | 2017-09-14 20:50 +0200 |
| Subject | [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions |
| Message-ID | <upHn4-e8-11@gated-at.bofh.it> |
The driver already supports DMA_DEV_TO_DEV in sdma_config(), DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in sdma_prep_slave_sg(). So this patch adds them to the lists. Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> --- drivers/dma/imx-sdma.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index a67ec1b..2184881 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -178,6 +178,14 @@ #define SDMA_WATERMARK_LEVEL_HWE BIT(29) #define SDMA_WATERMARK_LEVEL_CONT BIT(31) +#define SDMA_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES)) + +#define SDMA_DMA_DIRECTIONS (BIT(DMA_DEV_TO_MEM) | \ + BIT(DMA_MEM_TO_DEV) | \ + BIT(DMA_DEV_TO_DEV)) + /* * Mode/Count of data node descriptors - IPCv2 */ @@ -1851,9 +1859,9 @@ static int sdma_probe(struct platform_device *pdev) sdma->dma_device.device_prep_dma_cyclic = sdma_prep_dma_cyclic; sdma->dma_device.device_config = sdma_config; sdma->dma_device.device_terminate_all = sdma_disable_channel_with_delay; - sdma->dma_device.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); - sdma->dma_device.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); - sdma->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); + sdma->dma_device.src_addr_widths = SDMA_DMA_BUSWIDTHS; + sdma->dma_device.dst_addr_widths = SDMA_DMA_BUSWIDTHS; + sdma->dma_device.directions = SDMA_DMA_DIRECTIONS; sdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; sdma->dma_device.device_issue_pending = sdma_issue_pending; sdma->dma_device.dev->dma_parms = &sdma->dma_parms; -- 2.1.4
[toc] | [next] | [standalone]
| From | Fabio Estevam <festevam@gmail.com> |
|---|---|
| Date | 2017-09-14 21:50 +0200 |
| Message-ID | <upIj8-Np-13@gated-at.bofh.it> |
| In reply to | #1732508 |
Hi Nicolin, On Thu, Sep 14, 2017 at 3:46 PM, Nicolin Chen <nicoleotsuka@gmail.com> wrote: > The driver already supports DMA_DEV_TO_DEV in sdma_config(), > DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in > sdma_prep_slave_sg(). So this patch adds them to the lists. > > Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> Patch looks good. Just curious: what is the specific usecase that triggered this change? Thanks
[toc] | [prev] | [next] | [standalone]
| From | Nicolin Chen <nicoleotsuka@gmail.com> |
|---|---|
| Date | 2017-09-14 23:50 +0200 |
| Subject | Re: [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions |
| Message-ID | <upKbh-1XT-19@gated-at.bofh.it> |
| In reply to | #1732543 |
On Thu, Sep 14, 2017 at 04:43:08PM -0300, Fabio Estevam wrote: > Hi Nicolin, > > On Thu, Sep 14, 2017 at 3:46 PM, Nicolin Chen <nicoleotsuka@gmail.com> wrote: > > The driver already supports DMA_DEV_TO_DEV in sdma_config(), > > DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in > > sdma_prep_slave_sg(). So this patch adds them to the lists. > > > > Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com> > > Patch looks good. > > Just curious: what is the specific usecase that triggered this change? Any audio test case. The ASoC generic dmaengine gets the DMA cap (4_BYTES only) and apply it to hw->formats in ASoC core. SSI + WM8962 could have S8_LE, S16_LE and S24_LE formats but it turns out that it only has S24_LE now because of this. I haven't seen any side effect by DMA_DEV_TO_DEV yet but it could potentially break ASRC once a similar constrain based on the "directions" is applied.
[toc] | [prev] | [next] | [standalone]
| From | Vinod Koul <vinod.koul@intel.com> |
|---|---|
| Date | 2017-09-21 19:20 +0200 |
| Subject | Re: [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions |
| Message-ID | <usdiQ-3Se-79@gated-at.bofh.it> |
| In reply to | #1732508 |
On Thu, Sep 14, 2017 at 11:46:43AM -0700, Nicolin Chen wrote: > The driver already supports DMA_DEV_TO_DEV in sdma_config(), > DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in > sdma_prep_slave_sg(). So this patch adds them to the lists. Applied, thanks -- ~Vinod
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web