linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] spi: release lock on error path in spi_pump_messages()
@ 2012-03-10  8:57 Dan Carpenter
       [not found] ` <20120310085729.GB4647-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2012-03-10  8:57 UTC (permalink / raw)
  To: Grant Likely
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

We should release the lock here and enable IRQs before returning.

Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 5ae1e84..ab1bdce 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -535,6 +535,7 @@ static void spi_pump_messages(struct kthread_work *work)
 			if (ret) {
 				dev_err(&master->dev,
 					"failed to unprepare transfer hardware\n");
+				spin_unlock_irqrestore(&master->queue_lock, flags);
 				return;
 			}
 		}

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

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

* Re: [patch] spi: release lock on error path in spi_pump_messages()
       [not found] ` <20120310085729.GB4647-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
@ 2012-03-10  9:38   ` walter harms
       [not found]     ` <4F5B2113.3060103-fPG8STNUNVg@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: walter harms @ 2012-03-10  9:38 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA



Am 10.03.2012 09:57, schrieb Dan Carpenter:
> We should release the lock here and enable IRQs before returning.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> index 5ae1e84..ab1bdce 100644
> --- a/drivers/spi/spi.c
> +++ b/drivers/spi/spi.c
> @@ -535,6 +535,7 @@ static void spi_pump_messages(struct kthread_work *work)
>  			if (ret) {
>  				dev_err(&master->dev,
>  					"failed to unprepare transfer hardware\n");
> +				spin_unlock_irqrestore(&master->queue_lock, flags);
>  				return;
>  			}
>  		}


hi Dan,
do you want to protect dev_err() by a spn_lock ?

re,
 wh

> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

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

* Re: [patch] spi: release lock on error path in spi_pump_messages()
       [not found]     ` <4F5B2113.3060103-fPG8STNUNVg@public.gmane.org>
@ 2012-03-11  2:43       ` Grant Likely
  2012-03-11  6:20         ` Dan Carpenter
  0 siblings, 1 reply; 5+ messages in thread
From: Grant Likely @ 2012-03-11  2:43 UTC (permalink / raw)
  To: wharms-fPG8STNUNVg, Dan Carpenter
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

On Sat, 10 Mar 2012 10:38:27 +0100, walter harms <wharms-fPG8STNUNVg@public.gmane.org> wrote:
> 
> 
> Am 10.03.2012 09:57, schrieb Dan Carpenter:
> > We should release the lock here and enable IRQs before returning.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> > 
> > diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
> > index 5ae1e84..ab1bdce 100644
> > --- a/drivers/spi/spi.c
> > +++ b/drivers/spi/spi.c
> > @@ -535,6 +535,7 @@ static void spi_pump_messages(struct kthread_work *work)
> >  			if (ret) {
> >  				dev_err(&master->dev,
> >  					"failed to unprepare transfer hardware\n");
> > +				spin_unlock_irqrestore(&master->queue_lock, flags);
> >  				return;
> >  			}
> >  		}
> 
> 
> hi Dan,
> do you want to protect dev_err() by a spn_lock ?

Applied, after moving unlock above the dev_err.

g.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

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

* Re: [patch] spi: release lock on error path in spi_pump_messages()
  2012-03-11  2:43       ` Grant Likely
@ 2012-03-11  6:20         ` Dan Carpenter
  2012-03-11 13:02           ` Grant Likely
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2012-03-11  6:20 UTC (permalink / raw)
  To: Grant Likely; +Cc: wharms, spi-devel-general, linux-kernel, kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On Sat, Mar 10, 2012 at 07:43:07PM -0700, Grant Likely wrote:
> On Sat, 10 Mar 2012 10:38:27 +0100, walter harms <wharms@bfs.de> wrote:
> > hi Dan,
> > do you want to protect dev_err() by a spn_lock ?
> 
> Applied, after moving unlock above the dev_err.
> 

Thanks.

I was going to resend this with Walter's change btw.  I wasn't going
to ignore his review comments.

Anyway, thanks again Grant and Walter.

regards,
dan carpenter


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [patch] spi: release lock on error path in spi_pump_messages()
  2012-03-11  6:20         ` Dan Carpenter
@ 2012-03-11 13:02           ` Grant Likely
  0 siblings, 0 replies; 5+ messages in thread
From: Grant Likely @ 2012-03-11 13:02 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, wharms-fPG8STNUNVg

On Sun, 11 Mar 2012 09:20:59 +0300, Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:
> On Sat, Mar 10, 2012 at 07:43:07PM -0700, Grant Likely wrote:
> > On Sat, 10 Mar 2012 10:38:27 +0100, walter harms <wharms-fPG8STNUNVg@public.gmane.org> wrote:
> > > hi Dan,
> > > do you want to protect dev_err() by a spn_lock ?
> > 
> > Applied, after moving unlock above the dev_err.
> > 
> 
> Thanks.
> 
> I was going to resend this with Walter's change btw.  I wasn't going
> to ignore his review comments.

I assumed you would.  It was just simpler for me to pick it up with the
trivial change.

g.


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/

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

end of thread, other threads:[~2012-03-11 13:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-10  8:57 [patch] spi: release lock on error path in spi_pump_messages() Dan Carpenter
     [not found] ` <20120310085729.GB4647-mgFCXtclrQlZLf2FXnZxJA@public.gmane.org>
2012-03-10  9:38   ` walter harms
     [not found]     ` <4F5B2113.3060103-fPG8STNUNVg@public.gmane.org>
2012-03-11  2:43       ` Grant Likely
2012-03-11  6:20         ` Dan Carpenter
2012-03-11 13:02           ` 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).