* [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start
@ 2015-03-20 11:42 Sudeep Holla
2015-03-20 14:20 ` Laurent Pinchart
0 siblings, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2015-03-20 11:42 UTC (permalink / raw)
To: Felipe Balbi, linux-usb
Cc: Sudeep Holla, Dan Carpenter, linux-kernel, Laurent Pinchart
Commit a124820de5fd ("usb: isp1760: fix possible deadlock in
isp1760_udc_irq") replaced spin_{un,}lock with spin_{un,}lock_irq{save,restore}.
However it missed an error path resulting in the smatch warning as below:
drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn: inconsistent returns 'irqsave:flags'.
Locked on: line 1207
Unlocked on: line 1199
This patch fixes the spin unlock in the error path in isp1760_udc_start
thereby removing the smatch warning mentioned above.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/usb/isp1760/isp1760-udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Hi Laurent, Felipe,
I am extremely sorry for missing this in my original patch.
Thanks to Dan Carpenter for reporting this.
Regards,
Sudeep
diff --git a/drivers/usb/isp1760/isp1760-udc.c b/drivers/usb/isp1760/isp1760-udc.c
index fbfbd59aae64..b7094eee0bdd 100644
--- a/drivers/usb/isp1760/isp1760-udc.c
+++ b/drivers/usb/isp1760/isp1760-udc.c
@@ -1203,7 +1203,7 @@ static int isp1760_udc_start(struct usb_gadget *gadget,
if (udc->driver) {
dev_err(udc->isp->dev, "UDC already has a gadget driver\n");
- spin_unlock(&udc->lock);
+ spin_unlock_irqrestore(&udc->lock, flags);
return -EBUSY;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start
2015-03-20 11:42 [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start Sudeep Holla
@ 2015-03-20 14:20 ` Laurent Pinchart
2015-03-20 14:27 ` Sudeep Holla
0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2015-03-20 14:20 UTC (permalink / raw)
To: Sudeep Holla; +Cc: Felipe Balbi, linux-usb, Dan Carpenter, linux-kernel
Hi Sudeep,
Thank you for the patch.
On Friday 20 March 2015 11:42:17 Sudeep Holla wrote:
> Commit a124820de5fd ("usb: isp1760: fix possible deadlock in
> isp1760_udc_irq") replaced spin_{un,}lock with
> spin_{un,}lock_irq{save,restore}. However it missed an error path resulting
> in the smatch warning as below:
>
> drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn:
> inconsistent returns 'irqsave:flags'. Locked on: line 1207
> Unlocked on: line 1199
>
> This patch fixes the spin unlock in the error path in isp1760_udc_start
> thereby removing the smatch warning mentioned above.
>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/usb/isp1760/isp1760-udc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Hi Laurent, Felipe,
>
> I am extremely sorry for missing this in my original patch.
I hope you will be ashamed for the 7 generations to come for this totally
unacceptable low quality standard.
Just kidding of course, to err is human :-) Thank you for fixing it.
> Thanks to Dan Carpenter for reporting this.
>
> Regards,
> Sudeep
>
> diff --git a/drivers/usb/isp1760/isp1760-udc.c
> b/drivers/usb/isp1760/isp1760-udc.c index fbfbd59aae64..b7094eee0bdd 100644
> --- a/drivers/usb/isp1760/isp1760-udc.c
> +++ b/drivers/usb/isp1760/isp1760-udc.c
> @@ -1203,7 +1203,7 @@ static int isp1760_udc_start(struct usb_gadget
> *gadget,
>
> if (udc->driver) {
> dev_err(udc->isp->dev, "UDC already has a gadget driver\n");
> - spin_unlock(&udc->lock);
> + spin_unlock_irqrestore(&udc->lock, flags);
> return -EBUSY;
> }
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start
2015-03-20 14:20 ` Laurent Pinchart
@ 2015-03-20 14:27 ` Sudeep Holla
2015-03-24 16:37 ` Felipe Balbi
0 siblings, 1 reply; 5+ messages in thread
From: Sudeep Holla @ 2015-03-20 14:27 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Sudeep Holla, Felipe Balbi, linux-usb@vger.kernel.org,
Dan Carpenter, linux-kernel@vger.kernel.org
Hi Laurent,
On 20/03/15 14:20, Laurent Pinchart wrote:
> Hi Sudeep,
>
> Thank you for the patch.
>
> On Friday 20 March 2015 11:42:17 Sudeep Holla wrote:
>> Commit a124820de5fd ("usb: isp1760: fix possible deadlock in
>> isp1760_udc_irq") replaced spin_{un,}lock with
>> spin_{un,}lock_irq{save,restore}. However it missed an error path resulting
>> in the smatch warning as below:
>>
>> drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn:
>> inconsistent returns 'irqsave:flags'. Locked on: line 1207
>> Unlocked on: line 1199
>>
>> This patch fixes the spin unlock in the error path in isp1760_udc_start
>> thereby removing the smatch warning mentioned above.
>>
>> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
>> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> Cc: Felipe Balbi <balbi@ti.com>
>> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
Thanks
>> ---
>> drivers/usb/isp1760/isp1760-udc.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> Hi Laurent, Felipe,
>>
>> I am extremely sorry for missing this in my original patch.
>
> I hope you will be ashamed for the 7 generations to come for this totally
> unacceptable low quality standard.
>
Yes ;)
Regards,
Sudeep
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start
2015-03-20 14:27 ` Sudeep Holla
@ 2015-03-24 16:37 ` Felipe Balbi
2015-03-24 16:38 ` Felipe Balbi
0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2015-03-24 16:37 UTC (permalink / raw)
To: Sudeep Holla
Cc: Laurent Pinchart, Felipe Balbi, linux-usb@vger.kernel.org,
Dan Carpenter, linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2165 bytes --]
On Fri, Mar 20, 2015 at 02:27:40PM +0000, Sudeep Holla wrote:
> Hi Laurent,
>
> On 20/03/15 14:20, Laurent Pinchart wrote:
> >Hi Sudeep,
> >
> >Thank you for the patch.
> >
> >On Friday 20 March 2015 11:42:17 Sudeep Holla wrote:
> >>Commit a124820de5fd ("usb: isp1760: fix possible deadlock in
> >>isp1760_udc_irq") replaced spin_{un,}lock with
> >>spin_{un,}lock_irq{save,restore}. However it missed an error path resulting
> >>in the smatch warning as below:
> >>
> >>drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn:
> >>inconsistent returns 'irqsave:flags'. Locked on: line 1207
> >>Unlocked on: line 1199
> >>
> >>This patch fixes the spin unlock in the error path in isp1760_udc_start
> >>thereby removing the smatch warning mentioned above.
> >>
> >>Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> >>Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >>Cc: Felipe Balbi <balbi@ti.com>
> >>Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> >
> >Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
>
> Thanks
>
> >>---
> >> drivers/usb/isp1760/isp1760-udc.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >>Hi Laurent, Felipe,
> >>
> >>I am extremely sorry for missing this in my original patch.
> >
> >I hope you will be ashamed for the 7 generations to come for this totally
> >unacceptable low quality standard.
> >
>
> Yes ;)
shameful indeed, doesn't build ;-)
drivers/usb/isp1760/isp1760-udc.c:1205:52: error: undefined identifier 'flags'
drivers/usb/isp1760/isp1760-udc.c: In function ‘isp1760_udc_start’:
drivers/usb/isp1760/isp1760-udc.c:1205:38: error: ‘flags’ undeclared (first use in this function)
spin_unlock_irqrestore(&udc->lock, flags);
^
drivers/usb/isp1760/isp1760-udc.c:1205:38: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [drivers/usb/isp1760/isp1760-udc.o] Error 1
make[1]: *** [drivers/usb/isp1760] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [drivers/usb/] Error 2
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start
2015-03-24 16:37 ` Felipe Balbi
@ 2015-03-24 16:38 ` Felipe Balbi
0 siblings, 0 replies; 5+ messages in thread
From: Felipe Balbi @ 2015-03-24 16:38 UTC (permalink / raw)
To: Felipe Balbi
Cc: Sudeep Holla, Laurent Pinchart, linux-usb@vger.kernel.org,
Dan Carpenter, linux-kernel@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2393 bytes --]
On Tue, Mar 24, 2015 at 11:37:43AM -0500, Felipe Balbi wrote:
> On Fri, Mar 20, 2015 at 02:27:40PM +0000, Sudeep Holla wrote:
> > Hi Laurent,
> >
> > On 20/03/15 14:20, Laurent Pinchart wrote:
> > >Hi Sudeep,
> > >
> > >Thank you for the patch.
> > >
> > >On Friday 20 March 2015 11:42:17 Sudeep Holla wrote:
> > >>Commit a124820de5fd ("usb: isp1760: fix possible deadlock in
> > >>isp1760_udc_irq") replaced spin_{un,}lock with
> > >>spin_{un,}lock_irq{save,restore}. However it missed an error path resulting
> > >>in the smatch warning as below:
> > >>
> > >>drivers/usb/isp1760/isp1760-udc.c:1230 isp1760_udc_start() warn:
> > >>inconsistent returns 'irqsave:flags'. Locked on: line 1207
> > >>Unlocked on: line 1199
> > >>
> > >>This patch fixes the spin unlock in the error path in isp1760_udc_start
> > >>thereby removing the smatch warning mentioned above.
> > >>
> > >>Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> > >>Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >>Cc: Felipe Balbi <balbi@ti.com>
> > >>Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> > >
> > >Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > >
> >
> > Thanks
> >
> > >>---
> > >> drivers/usb/isp1760/isp1760-udc.c | 2 +-
> > >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >>Hi Laurent, Felipe,
> > >>
> > >>I am extremely sorry for missing this in my original patch.
> > >
> > >I hope you will be ashamed for the 7 generations to come for this totally
> > >unacceptable low quality standard.
> > >
> >
> > Yes ;)
>
> shameful indeed, doesn't build ;-)
>
> drivers/usb/isp1760/isp1760-udc.c:1205:52: error: undefined identifier 'flags'
> drivers/usb/isp1760/isp1760-udc.c: In function ‘isp1760_udc_start’:
> drivers/usb/isp1760/isp1760-udc.c:1205:38: error: ‘flags’ undeclared (first use in this function)
> spin_unlock_irqrestore(&udc->lock, flags);
> ^
> drivers/usb/isp1760/isp1760-udc.c:1205:38: note: each undeclared identifier is reported only once for each function it appears in
> make[2]: *** [drivers/usb/isp1760/isp1760-udc.o] Error 1
> make[1]: *** [drivers/usb/isp1760] Error 2
> make[1]: *** Waiting for unfinished jobs....
> make: *** [drivers/usb/] Error 2
oh, nevermind, it depends on a previous fix :-)
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-24 16:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-20 11:42 [PATCH] usb: isp1760: fix spin unlock in the error path of isp1760_udc_start Sudeep Holla
2015-03-20 14:20 ` Laurent Pinchart
2015-03-20 14:27 ` Sudeep Holla
2015-03-24 16:37 ` Felipe Balbi
2015-03-24 16:38 ` Felipe Balbi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox