mbox series

[0/9] spi: Use dma_request_chan() directly for channel request

Message ID 20191113094256.1108-1-peter.ujfalusi@ti.com
Headers show
Series spi: Use dma_request_chan() directly for channel request | expand

Message

Peter Ujfalusi Nov. 13, 2019, 9:42 a.m. UTC
Hi,

I'm going through the tree to remove dma_request_slave_channel_reason() as it
is just:
#define dma_request_slave_channel_reason(dev, name) \
	dma_request_chan(dev, name)

Regards,
Peter
---
Peter Ujfalusi (9):
  spi: at91-usart: Use dma_request_chan() directly for channel request
  spi: atmel: Use dma_request_chan() directly for channel request
  spi: fsl-lpspi: Use dma_request_chan() directly for channel request
  spi: imx: Use dma_request_chan() directly for channel request
  spi: pl022: Use dma_request_chan() directly for channel request
  spi: qup: Use dma_request_chan() directly for channel request
  spi: s3c64xx: Use dma_request_chan() directly for channel request
  spi: tegra114: Use dma_request_chan() directly for channel request
  spi: tegra20-slink: Use dma_request_chan() directly for channel
    request

 drivers/spi/spi-at91-usart.c    | 4 ++--
 drivers/spi/spi-atmel.c         | 2 +-
 drivers/spi/spi-fsl-lpspi.c     | 4 ++--
 drivers/spi/spi-imx.c           | 4 ++--
 drivers/spi/spi-pl022.c         | 4 ++--
 drivers/spi/spi-qup.c           | 4 ++--
 drivers/spi/spi-s3c64xx.c       | 6 ++----
 drivers/spi/spi-tegra114.c      | 3 +--
 drivers/spi/spi-tegra20-slink.c | 3 +--
 9 files changed, 15 insertions(+), 19 deletions(-)

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

Comments

Nicolas Ferre Nov. 13, 2019, 2:18 p.m. UTC | #1
On 13/11/2019 at 10:42, Peter Ujfalusi wrote:
> 

> dma_request_slave_channel_reason() is:

> #define dma_request_slave_channel_reason(dev, name) \

> 	dma_request_chan(dev, name)

> 

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>


I'm not sure we need one patch per driver. If series taken:
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>


> ---

>   drivers/spi/spi-atmel.c | 2 +-

>   1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c

> index 9e84a93083bc..56f0ca361deb 100644

> --- a/drivers/spi/spi-atmel.c

> +++ b/drivers/spi/spi-atmel.c

> @@ -511,7 +511,7 @@ static int atmel_spi_configure_dma(struct spi_master *master,

>   	dma_cap_zero(mask);

>   	dma_cap_set(DMA_SLAVE, mask);

>   

> -	master->dma_tx = dma_request_slave_channel_reason(dev, "tx");

> +	master->dma_tx = dma_request_chan(dev, "tx");

>   	if (IS_ERR(master->dma_tx)) {

>   		err = PTR_ERR(master->dma_tx);

>   		if (err == -EPROBE_DEFER) {

> 



-- 
Nicolas Ferre
Nicolas Ferre Nov. 13, 2019, 2:18 p.m. UTC | #2
On 13/11/2019 at 10:42, Peter Ujfalusi wrote:
> External E-Mail

> 

> 

> dma_request_slave_channel_reason() is:

> #define dma_request_slave_channel_reason(dev, name) \

> 	dma_request_chan(dev, name)

> 

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>


Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>


> ---

>   drivers/spi/spi-at91-usart.c | 4 ++--

>   1 file changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c

> index a40bb2ef89dc..88033422a42a 100644

> --- a/drivers/spi/spi-at91-usart.c

> +++ b/drivers/spi/spi-at91-usart.c

> @@ -132,7 +132,7 @@ static int at91_usart_spi_configure_dma(struct spi_controller *ctlr,

>   	dma_cap_zero(mask);

>   	dma_cap_set(DMA_SLAVE, mask);

>   

> -	ctlr->dma_tx = dma_request_slave_channel_reason(dev, "tx");

> +	ctlr->dma_tx = dma_request_chan(dev, "tx");

>   	if (IS_ERR_OR_NULL(ctlr->dma_tx)) {

>   		if (IS_ERR(ctlr->dma_tx)) {

>   			err = PTR_ERR(ctlr->dma_tx);

> @@ -145,7 +145,7 @@ static int at91_usart_spi_configure_dma(struct spi_controller *ctlr,

>   		goto at91_usart_spi_error_clear;

>   	}

>   

> -	ctlr->dma_rx = dma_request_slave_channel_reason(dev, "rx");

> +	ctlr->dma_rx = dma_request_chan(dev, "rx");

>   	if (IS_ERR_OR_NULL(ctlr->dma_rx)) {

>   		if (IS_ERR(ctlr->dma_rx)) {

>   			err = PTR_ERR(ctlr->dma_rx);

> 



-- 
Nicolas Ferre
Vinod Koul Nov. 14, 2019, 4:35 a.m. UTC | #3
On 13-11-19, 11:42, Peter Ujfalusi wrote:
> Hi,

> 

> I'm going through the tree to remove dma_request_slave_channel_reason() as it

> is just:

> #define dma_request_slave_channel_reason(dev, name) \

> 	dma_request_chan(dev, name)


Reviewed-by: Vinod Koul <vkoul@kernel.org>


-- 
~Vinod
Krzysztof Kozlowski Nov. 14, 2019, 6:27 a.m. UTC | #4
On Wed, 13 Nov 2019 at 17:42, Peter Ujfalusi <peter.ujfalusi@ti.com> wrote:
>

> dma_request_slave_channel_reason() is:

> #define dma_request_slave_channel_reason(dev, name) \

>         dma_request_chan(dev, name)

>

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> ---

>  drivers/spi/spi-s3c64xx.c | 6 ++----

>  1 file changed, 2 insertions(+), 4 deletions(-)


Acked-by: Krzysztof Kozlowski <krzk@kernel.org>


Best regards,
Krzysztof
Jon Hunter Nov. 14, 2019, 7:06 a.m. UTC | #5
On 13/11/2019 09:42, Peter Ujfalusi wrote:
> dma_request_slave_channel_reason() is:

> #define dma_request_slave_channel_reason(dev, name) \

> 	dma_request_chan(dev, name)

> 

> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> ---

>  drivers/spi/spi-tegra114.c | 3 +--

>  1 file changed, 1 insertion(+), 2 deletions(-)

> 

> diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c

> index e6a450d9b4f0..fc40ab146c86 100644

> --- a/drivers/spi/spi-tegra114.c

> +++ b/drivers/spi/spi-tegra114.c

> @@ -666,8 +666,7 @@ static int tegra_spi_init_dma_param(struct tegra_spi_data *tspi,

>  	dma_addr_t dma_phys;

>  	int ret;

>  

> -	dma_chan = dma_request_slave_channel_reason(tspi->dev,

> -					dma_to_memory ? "rx" : "tx");

> +	dma_chan = dma_request_chan(tspi->dev, dma_to_memory ? "rx" : "tx");

>  	if (IS_ERR(dma_chan)) {

>  		ret = PTR_ERR(dma_chan);

>  		if (ret != -EPROBE_DEFER)

> 


Acked-by: Jon Hunter <jonathanh@nvidia.com>


Cheers!
Jon

-- 
nvpublic
Peter Ujfalusi Nov. 14, 2019, 8:09 a.m. UTC | #6
On 14/11/2019 1.40, Andi Shyti wrote:
> Hi Peter,

> 

>>  	if (!is_polling(sdd)) {

>>  		/* Acquire DMA channels */

>> -		sdd->rx_dma.ch = dma_request_slave_channel_reason(&pdev->dev,

>> -								  "rx");

>> +		sdd->rx_dma.ch = dma_request_chan(&pdev->dev, "rx");

> 

> I have a little concern here. We have two funcions

> 'dma_request_chan' and  'dma_request_channel' don't we end up

> making some confusion here?

> 

> Wouldn't it make more sense renaming 'dma_request_chan' to

> 'dma_request_slave_channel_reason'?


The dma_request_channel() should go away. It was the old API before we
got the dma_slave_map for non DT (and non ACPI) platforms so we can get
rid of the filter function exports from DMA drivers to clients all over
the place.

I know there are users where they provide dummy filter function.

At the end the main API to request slave DMA channel should be
dma_request_chan()
For non slave channels (not HW triggered) we have dma_request_chan_by_mask()

Imoh the dma_request_slave_channel_compat() should also go away with time.

> 

> Thanks,

> Andi

> 

> _______________________________________________

> linux-arm-kernel mailing list

> linux-arm-kernel@lists.infradead.org

> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

> 


- Péter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki