| Date | Fri, 15 May 2020 15:34:22 +0300 | From | Andy Shevchenko <> | Subject | Re: [PATCH v2 06/19] spi: dw: Discard static DW DMA slave structures |
| |
On Fri, May 15, 2020 at 01:47:45PM +0300, Serge Semin wrote: > Having them declared is redundant since each struct dw_dma_chan has > the same structure embedded and the structure from the passed dma_chan > private pointer will be copied there as a result of the next calls > chain: > dma_request_channel() -> find_candidate() -> dma_chan_get() -> > device_alloc_chan_resources() = dwc_alloc_chan_resources() -> > dw_dma_filter(). > So just remove the static dw_dma_chan structures and use a locally > declared data instance with dst_id/src_id set to the same values as > the static copies used to have.
...
> -static struct dw_dma_slave mid_dma_tx = { .dst_id = 1 }; > -static struct dw_dma_slave mid_dma_rx = { .src_id = 0 };
> + struct dw_dma_slave slave = {0};
I really would like to leave them separated and as in the original form, i.e.
struct dw_dma_slave tx = { .dst_id = 1 }; struct dw_dma_slave rx = { .src_id = 0 };
those src and dst IDs are put in that form on purpose...
> + /* 1. Init rx channel (.src_id = 0, .dst_id = 0) */
...this comment adds a bit of confusion. (Needs more time to parse and understand what IDs are in use)
> + slave.dma_dev = &dma_dev->dev; > + dws->rxchan = dma_request_channel(mask, mid_spi_dma_chan_filter, &slave);
> + /* 2. Init tx channel (.src_id = 0, .dst_id = 1) */
Ditto.
P.S. Just a recommendation for the future: in all your patches try to be less invasive where it's possible.
-- With Best Regards, Andy Shevchenko
|