[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200515123422.GZ185537@smile.fi.intel.com>
Date: Fri, 15 May 2020 15:34:22 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Mark Brown <broonie@...nel.org>,
Serge Semin <fancer.lancer@...il.com>,
Georgy Vlasov <Georgy.Vlasov@...kalelectronics.ru>,
Ramil Zaripov <Ramil.Zaripov@...kalelectronics.ru>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Paul Burton <paulburton@...nel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Allison Randal <allison@...utok.net>,
Gareth Williams <gareth.williams.jx@...esas.com>,
Arnd Bergmann <arnd@...db.de>,
Rob Herring <robh+dt@...nel.org>, linux-mips@...r.kernel.org,
devicetree@...r.kernel.org,
Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@...el.com>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
"wuxu.wu" <wuxu.wu@...wei.com>, Clement Leger <cleger@...ray.eu>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
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
Powered by blists - more mailing lists