Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-18 Thread Du Xing
From: Du Xing duxing2...@gmail.com In skel_read,the reader blocked in wait_for_completion before submit bulk in urb. Using processed_urb is for retaining the completion in the case that previous interruptible wait in skel_read was interrupted and complete before next skel_read. Replacing complet

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-17 Thread Oliver Neukum
On Saturday 16 March 2013 23:47:19 Du Xing wrote: > On Friday, March 15, 2013 12:53 AM, Oliver Neukum wrote: > > > The problem is that I needed to work around the counting nature of > > completions. > > If you go to a waitqueue the need is removed. Your original patch together > > with > > the c

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-16 Thread Du Xing
On Friday, March 15, 2013 12:53 AM, Oliver Neukum wrote: > The problem is that I needed to work around the counting nature of > completions. > If you go to a waitqueue the need is removed. Your original patch together > with > the change to use a wait queue would be correct. Got that. Below is

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-14 Thread Oliver Neukum
On Friday 15 March 2013 00:19:00 Du Xing wrote: > Ming Lei > Below is the Patch v2 according to your solutions.is there any > misunderstanding? The problem is that I needed to work around the counting nature of completions. If you go to a waitqueue the need is removed. Your original patch togethe

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-14 Thread Du Xing
On Thursday, March 14, 2013 06:35 PM, Ming Lei wrote: > On Thu, Mar 14, 2013 at 6:19 PM, Oliver Neukum wrote: >> On Thursday 14 March 2013 18:07:29 Ming Lei wrote: But then it makes no sense and you'd be better of with a waitqueue instead of a completion. >>> >>> Maybe we can do it in a

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-14 Thread Ming Lei
On Thu, Mar 14, 2013 at 6:19 PM, Oliver Neukum wrote: > On Thursday 14 March 2013 18:07:29 Ming Lei wrote: >> > But then it makes no sense and you'd be better of with a waitqueue >> > instead of a completion. >> >> Maybe we can do it in another patch. > > Part of the locking changes would need to

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-14 Thread Oliver Neukum
On Thursday 14 March 2013 18:07:29 Ming Lei wrote: > > But then it makes no sense and you'd be better of with a waitqueue > > instead of a completion. > > Maybe we can do it in another patch. Part of the locking changes would need to be reverted. It is less work to convert now. Regards

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-14 Thread Ming Lei
On Thu, Mar 14, 2013 at 5:04 PM, Oliver Neukum wrote: >> >> OK, got it, so how about INIT_COMPLETION(&dev->bulk_in_completion) >> in case of !ongoing_read? That means replacing 'if (!dev->processed_urb)' >> with INIT_COMPLETION(&dev->bulk_in_completion). > > It is possible, if you also change lock

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-14 Thread Oliver Neukum
On Thursday 14 March 2013 12:13:59 Ming Lei wrote: > On Wed, Mar 13, 2013 at 11:15 PM, Oliver Neukum wrote: > > On Wednesday 13 March 2013 23:02:32 Ming Lei wrote: > >> On Wed, Mar 13, 2013 at 10:55 PM, Oliver Neukum wrote: > >> > > >> > But it will be run when the next read() call is made. The q

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Ming Lei
On Wed, Mar 13, 2013 at 11:15 PM, Oliver Neukum wrote: > On Wednesday 13 March 2013 23:02:32 Ming Lei wrote: >> On Wed, Mar 13, 2013 at 10:55 PM, Oliver Neukum wrote: >> > >> > But it will be run when the next read() call is made. The question is what >> > happens >> >> When next read() is calle

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Oliver Neukum
On Wednesday 13 March 2013 23:02:32 Ming Lei wrote: > On Wed, Mar 13, 2013 at 10:55 PM, Oliver Neukum wrote: > > > > But it will be run when the next read() call is made. The question is what > > happens > > When next read() is called, looks it won't be reached if > 'ongoing_read' is set, and >

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Ming Lei
On Wed, Mar 13, 2013 at 10:55 PM, Oliver Neukum wrote: > > But it will be run when the next read() call is made. The question is what > happens When next read() is called, looks it won't be reached if 'ongoing_read' is set, and it needn't run without ongoing URBs. Thanks, -- Ming Lei -- To un

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Oliver Neukum
On Wednesday 13 March 2013 22:42:37 Ming Lei wrote: > On Wed, Mar 13, 2013 at 10:36 PM, Oliver Neukum wrote: > > On Wednesday 13 March 2013 22:22:53 Du Xing wrote: > >> From: Du Xing duxing2...@gmail.com > >> > >> In skel_read,the reader blocked in wait_for_completion before submit bulk > >> in u

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Ming Lei
On Wed, Mar 13, 2013 at 10:36 PM, Oliver Neukum wrote: > On Wednesday 13 March 2013 22:22:53 Du Xing wrote: >> From: Du Xing duxing2...@gmail.com >> >> In skel_read,the reader blocked in wait_for_completion before submit bulk in >> urb. >> Using processed_urb is totally unnecessary, remove it can

Re: [PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Oliver Neukum
On Wednesday 13 March 2013 22:22:53 Du Xing wrote: > From: Du Xing duxing2...@gmail.com > > In skel_read,the reader blocked in wait_for_completion before submit bulk in > urb. > Using processed_urb is totally unnecessary, remove it can fix the bug. The processed_urb is intended for the case that

[PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-13 Thread Du Xing
From: Du Xing duxing2...@gmail.com In skel_read,the reader blocked in wait_for_completion before submit bulk in urb. Using processed_urb is totally unnecessary, remove it can fix the bug. --- Signed-off-by: Du Xing duxing2...@gmail.com --- diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb

[PATCH] USB: usb-skeleton.c: fix blocked forever in skel_read

2013-03-03 Thread duxing2007
From: Du Xing duxing2...@gmail.com In skel_read,the reader blocked in wait_for_completion before submit bulk in urb. Using processed_urb is totally unnecessary, remove it can fix the bug. --- Signed-off-by: Du Xing duxing2...@gmail.com --- diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb