linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails
@ 2011-05-16  4:10 Viresh Kumar
  2011-05-16 11:04 ` Russell King - ARM Linux
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Viresh Kumar @ 2011-05-16  4:10 UTC (permalink / raw)
  To: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: armando.visconti-qxv4g6HH51o, shiraz.hashim-qxv4g6HH51o,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A, Viresh Kumar

If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
use dma.

Signed-off-by: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>
Acked-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/spi/amba-pl022.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
index dae886e..77f90de 100644
--- a/drivers/spi/amba-pl022.c
+++ b/drivers/spi/amba-pl022.c
@@ -1068,7 +1068,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_rx_param);
 	if (!pl022->dma_rx_channel) {
-		dev_err(&pl022->adev->dev, "no RX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
 		goto err_no_rxchan;
 	}
 
@@ -1076,13 +1076,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
 					    pl022->master_info->dma_filter,
 					    pl022->master_info->dma_tx_param);
 	if (!pl022->dma_tx_channel) {
-		dev_err(&pl022->adev->dev, "no TX DMA channel!\n");
+		dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
 		goto err_no_txchan;
 	}
 
 	pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
 	if (!pl022->dummypage) {
-		dev_err(&pl022->adev->dev, "no DMA dummypage!\n");
+		dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
 		goto err_no_dummypage;
 	}
 
@@ -1098,6 +1098,8 @@ err_no_txchan:
 	dma_release_channel(pl022->dma_rx_channel);
 	pl022->dma_rx_channel = NULL;
 err_no_rxchan:
+	dev_err(&pl022->adev->dev,
+			"Failed to work in dma mode, work without dma!\n");
 	return -ENODEV;
 }
 
@@ -2111,7 +2113,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
 	if (platform_info->enable_dma) {
 		status = pl022_dma_probe(pl022);
 		if (status != 0)
-			goto err_no_dma;
+			platform_info->enable_dma = 0;
 	}
 
 	/* Initialize and start queue */
@@ -2143,7 +2145,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
  err_init_queue:
 	destroy_queue(pl022);
 	pl022_dma_remove(pl022);
- err_no_dma:
 	free_irq(adev->irq[0], pl022);
  err_no_irq:
 	clk_put(pl022->clk);
-- 
1.7.2.2


------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails
  2011-05-16  4:10 [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails Viresh Kumar
@ 2011-05-16 11:04 ` Russell King - ARM Linux
       [not found]   ` <20110516110438.GP30539-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
       [not found] ` <052261410dd8d224fc199518e646abf80bfa7d4c.1305518921.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
  2011-05-19 19:36 ` Grant Likely
  2 siblings, 1 reply; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-05-16 11:04 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: armando.visconti, linus.walleij, shiraz.hashim, viresh.linux,
	spi-devel-general, linux-arm-kernel

On Mon, May 16, 2011 at 09:40:10AM +0530, Viresh Kumar wrote:
> If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
> mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
> use dma.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Shouldn't this go via the SPI people rather than my tree?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails
       [not found]   ` <20110516110438.GP30539-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
@ 2011-05-16 11:26     ` viresh kumar
  2011-05-16 21:26       ` Russell King - ARM Linux
  0 siblings, 1 reply; 6+ messages in thread
From: viresh kumar @ 2011-05-16 11:26 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Armando VISCONTI, linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	Shiraz HASHIM,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 05/16/2011 04:34 PM, Russell King - ARM Linux wrote:
> On Mon, May 16, 2011 at 09:40:10AM +0530, Viresh Kumar wrote:
>> > If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
>> > mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
>> > use dma.
>> > 
>> > Signed-off-by: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>
>> > Acked-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> Shouldn't this go via the SPI people rather than my tree?

This can, but i have seen amba drivers patches going through your
drivers branch, so sent to tracker. Should i get them through spi-devel??

-- 
viresh

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails
  2011-05-16 11:26     ` viresh kumar
@ 2011-05-16 21:26       ` Russell King - ARM Linux
  0 siblings, 0 replies; 6+ messages in thread
From: Russell King - ARM Linux @ 2011-05-16 21:26 UTC (permalink / raw)
  To: viresh kumar
  Cc: Armando VISCONTI, linus.walleij, Shiraz HASHIM, viresh.linux,
	spi-devel-general, linux-arm-kernel

On Mon, May 16, 2011 at 04:56:59PM +0530, viresh kumar wrote:
> On 05/16/2011 04:34 PM, Russell King - ARM Linux wrote:
> > On Mon, May 16, 2011 at 09:40:10AM +0530, Viresh Kumar wrote:
> >> > If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
> >> > mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
> >> > use dma.
> >> > 
> >> > Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
> >> > Acked-by: Linus Walleij <linus.walleij@linaro.org>
> > Shouldn't this go via the SPI people rather than my tree?
> 
> This can, but i have seen amba drivers patches going through your
> drivers branch, so sent to tracker.

Yes, because I authored quite a few primecell drivers, and I continue
to maintain those drivers.  The SPI driver is not one of those though.

> Should i get them through spi-devel??

Yes please.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails
       [not found] ` <052261410dd8d224fc199518e646abf80bfa7d4c.1305518921.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
@ 2011-05-17  4:00   ` viresh kumar
  0 siblings, 0 replies; 6+ messages in thread
From: viresh kumar @ 2011-05-17  4:00 UTC (permalink / raw)
  To: dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f,
	grant.likely-s3s/WqlpOiPyB63q8FvJNQ
  Cc: Armando VISCONTI, linus.walleij-QSEj5FYQhm4dnm+yROfE0A,
	Shiraz HASHIM,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On 05/16/2011 09:40 AM, Viresh KUMAR wrote:
> If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
> mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
> use dma.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar-qxv4g6HH51o@public.gmane.org>
> Acked-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
>  drivers/spi/amba-pl022.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 

David,

Sorry for missing you earlier in "to" list. Can you please push this
through spi-devel tree.

--
viresh

> diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
> index dae886e..77f90de 100644
> --- a/drivers/spi/amba-pl022.c
> +++ b/drivers/spi/amba-pl022.c
> @@ -1068,7 +1068,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
>  					    pl022->master_info->dma_filter,
>  					    pl022->master_info->dma_rx_param);
>  	if (!pl022->dma_rx_channel) {
> -		dev_err(&pl022->adev->dev, "no RX DMA channel!\n");
> +		dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
>  		goto err_no_rxchan;
>  	}
>  
> @@ -1076,13 +1076,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
>  					    pl022->master_info->dma_filter,
>  					    pl022->master_info->dma_tx_param);
>  	if (!pl022->dma_tx_channel) {
> -		dev_err(&pl022->adev->dev, "no TX DMA channel!\n");
> +		dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
>  		goto err_no_txchan;
>  	}
>  
>  	pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
>  	if (!pl022->dummypage) {
> -		dev_err(&pl022->adev->dev, "no DMA dummypage!\n");
> +		dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
>  		goto err_no_dummypage;
>  	}
>  
> @@ -1098,6 +1098,8 @@ err_no_txchan:
>  	dma_release_channel(pl022->dma_rx_channel);
>  	pl022->dma_rx_channel = NULL;
>  err_no_rxchan:
> +	dev_err(&pl022->adev->dev,
> +			"Failed to work in dma mode, work without dma!\n");
>  	return -ENODEV;
>  }
>  
> @@ -2111,7 +2113,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
>  	if (platform_info->enable_dma) {
>  		status = pl022_dma_probe(pl022);
>  		if (status != 0)
> -			goto err_no_dma;
> +			platform_info->enable_dma = 0;
>  	}
>  
>  	/* Initialize and start queue */
> @@ -2143,7 +2145,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
>   err_init_queue:
>  	destroy_queue(pl022);
>  	pl022_dma_remove(pl022);
> - err_no_dma:
>  	free_irq(adev->irq[0], pl022);
>   err_no_irq:
>  	clk_put(pl022->clk);


-- 
viresh

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails
  2011-05-16  4:10 [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails Viresh Kumar
  2011-05-16 11:04 ` Russell King - ARM Linux
       [not found] ` <052261410dd8d224fc199518e646abf80bfa7d4c.1305518921.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
@ 2011-05-19 19:36 ` Grant Likely
  2 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2011-05-19 19:36 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: armando.visconti, spi-devel-general, linus.walleij,
	linux-arm-kernel, shiraz.hashim

On Mon, May 16, 2011 at 09:40:10AM +0530, Viresh Kumar wrote:
> If pl022_dma_probe fails, we can try to transfer data in polling or interrupt
> mode. Also, set platform_info->enable_dma to 0, so that no other code tries to
> use dma.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>

Merged, thanks.

g.

> ---
>  drivers/spi/amba-pl022.c |   11 ++++++-----
>  1 files changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
> index dae886e..77f90de 100644
> --- a/drivers/spi/amba-pl022.c
> +++ b/drivers/spi/amba-pl022.c
> @@ -1068,7 +1068,7 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
>  					    pl022->master_info->dma_filter,
>  					    pl022->master_info->dma_rx_param);
>  	if (!pl022->dma_rx_channel) {
> -		dev_err(&pl022->adev->dev, "no RX DMA channel!\n");
> +		dev_dbg(&pl022->adev->dev, "no RX DMA channel!\n");
>  		goto err_no_rxchan;
>  	}
>  
> @@ -1076,13 +1076,13 @@ static int __init pl022_dma_probe(struct pl022 *pl022)
>  					    pl022->master_info->dma_filter,
>  					    pl022->master_info->dma_tx_param);
>  	if (!pl022->dma_tx_channel) {
> -		dev_err(&pl022->adev->dev, "no TX DMA channel!\n");
> +		dev_dbg(&pl022->adev->dev, "no TX DMA channel!\n");
>  		goto err_no_txchan;
>  	}
>  
>  	pl022->dummypage = kmalloc(PAGE_SIZE, GFP_KERNEL);
>  	if (!pl022->dummypage) {
> -		dev_err(&pl022->adev->dev, "no DMA dummypage!\n");
> +		dev_dbg(&pl022->adev->dev, "no DMA dummypage!\n");
>  		goto err_no_dummypage;
>  	}
>  
> @@ -1098,6 +1098,8 @@ err_no_txchan:
>  	dma_release_channel(pl022->dma_rx_channel);
>  	pl022->dma_rx_channel = NULL;
>  err_no_rxchan:
> +	dev_err(&pl022->adev->dev,
> +			"Failed to work in dma mode, work without dma!\n");
>  	return -ENODEV;
>  }
>  
> @@ -2111,7 +2113,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
>  	if (platform_info->enable_dma) {
>  		status = pl022_dma_probe(pl022);
>  		if (status != 0)
> -			goto err_no_dma;
> +			platform_info->enable_dma = 0;
>  	}
>  
>  	/* Initialize and start queue */
> @@ -2143,7 +2145,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
>   err_init_queue:
>  	destroy_queue(pl022);
>  	pl022_dma_remove(pl022);
> - err_no_dma:
>  	free_irq(adev->irq[0], pl022);
>   err_no_irq:
>  	clk_put(pl022->clk);
> -- 
> 1.7.2.2
> 
> 
> ------------------------------------------------------------------------------
> Achieve unprecedented app performance and reliability
> What every C/C++ and Fortran developer should know.
> Learn how Intel has extended the reach of its next-generation tools
> to help boost performance applications - inlcuding clusters.
> http://p.sf.net/sfu/intel-dev2devmay
> _______________________________________________
> spi-devel-general mailing list
> spi-devel-general@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/spi-devel-general

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-05-19 19:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16  4:10 [PATCH resend] spi/amba-pl022: work in polling or interrupt mode if pl022_dma_probe fails Viresh Kumar
2011-05-16 11:04 ` Russell King - ARM Linux
     [not found]   ` <20110516110438.GP30539-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2011-05-16 11:26     ` viresh kumar
2011-05-16 21:26       ` Russell King - ARM Linux
     [not found] ` <052261410dd8d224fc199518e646abf80bfa7d4c.1305518921.git.viresh.kumar-qxv4g6HH51o@public.gmane.org>
2011-05-17  4:00   ` viresh kumar
2011-05-19 19:36 ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).