[PATCH v4] usb: gadget: f_mass_storage: stop thread in bind failure case

2015-07-22 Thread Sanjay Singh Rawat
After the worker thread is launched, bind function is doing further configuration. In case of failure stop the thread. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- history: v3: - handled Michal's comment; used existing function to change state and exit thread. - tested

[PATCH v2 3/4] usb: gadget: move common storage gadget structure to header file

2015-06-08 Thread Sanjay Singh Rawat
struct fsg_common is used in multiple files, moving it to header file from the source file. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 70 drivers/usb/gadget/function/f_mass_storage.h | 68

[PATCH v2 2/4] usb: gadget: mass-storage: defer storage thread wakeup

2015-06-08 Thread Sanjay Singh Rawat
As the configuration is not complete at the time of thread creation, defering the thread wakeup till the end. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 5 +++-- drivers/usb/gadget/legacy/acm_ms.c | 3 +++ drivers/usb/gadget

[PATCH v2 0/4] usb: gadget: mass-storage: handle thread in error case

2015-06-08 Thread Sanjay Singh Rawat
(needed by patch-4) : moved fsg_common structure to header file, as code is dereferencing common-thread_task. Sanjay Singh Rawat (4): usb: gadget: f_mass_storage: stop thread in bind failure case usb: gadget: mass-storage: defer storage thread wakeup usb: gadget: move common storage gadget

[PATCH v2 1/4] usb: gadget: f_mass_storage: stop thread in bind failure case

2015-06-08 Thread Sanjay Singh Rawat
After the worker thread is launched, bind function is doing further configuration. In case of failure stop the thread. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH v2 4/4] usb: gadget: stop mass storage thread in failure case

2015-06-08 Thread Sanjay Singh Rawat
We are launching the mass-storage thread during the function configuration phase, in case of failure adding function to stop the thread. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/legacy/acm_ms.c | 2 ++ drivers/usb/gadget/legacy/mass_storage.c | 1

[PATCH V3 0/2] usb: gadget: mass-storage: handle thread in error case

2015-06-08 Thread Sanjay Singh Rawat
: freeing file-storage thread in configuration error case. - added patch-3 (needed by patch-4) : moved fsg_common structure to header file, as code is dereferencing common-thread_task. Sanjay Singh Rawat (2): usb: gadget: f_mass_storage: stop thread in bind failure case usb

[PATCH V3 1/2] usb: gadget: f_mass_storage: stop thread in bind failure case

2015-06-08 Thread Sanjay Singh Rawat
After the worker thread is launched, bind function is doing further configuration. In case of failure stop the thread. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com Acked-by: Michal Nazarewicz min...@mina86.com --- drivers/usb/gadget/function/f_mass_storage.c | 7 +-- 1 file changed, 5

[PATCH V3 2/2] usb: gadget: mass-storage: defer storage thread wakeup

2015-06-08 Thread Sanjay Singh Rawat
As the configuration is not complete at the time of thread creation, defering the file-storage thread wakeup till the end. Also stop the thread in case of failure during configuration. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 75

Re: [PATCH 2/2] usb: gadget: f_mass_storage: defer storage thread wakeup

2015-06-07 Thread Sanjay Singh Rawat
On 6/6/2015 3:22 PM, Michal Nazarewicz wrote: On Fri, Jun 05 2015, Sanjay Singh Rawat wrote: As the bind configuration is not complete during thread creation, defering the thread wake to end of bind. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function

[PATCH 0/2] handle thread in error case

2015-06-05 Thread Sanjay Singh Rawat
This patch set handles storage thread in error case. Sanjay Singh Rawat (2): usb: gadget: f_mass_storage: stop thread in bind failure case usb: gadget: f_mass_storage: defer storage thread wakeup drivers/usb/gadget/function/f_mass_storage.c | 12 1 file changed, 8 insertions

[PATCH 2/2] usb: gadget: f_mass_storage: defer storage thread wakeup

2015-06-05 Thread Sanjay Singh Rawat
As the bind configuration is not complete during thread creation, defering the thread wake to end of bind. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb

[PATCH 1/2] usb: gadget: f_mass_storage: stop thread in bind failure case

2015-06-05 Thread Sanjay Singh Rawat
After the worker thread is launched, bind function is doing further configuration. In case of failure stop the thread. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git

[PATCH] usb: gadget: f_mass_storage: stop thread in bind failure case

2015-06-04 Thread Sanjay Singh Rawat
After the worker thread is launched, bind function is doing further configuration. Stop the thread in case of failure. Also use kthread_run to encapsulate thread creation and launch. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 11

[PATCH] usb: gadget: f_mass_storage: restore address range on exit

2014-12-05 Thread Sanjay Singh Rawat
At the start of the thread we are changing the address limit, restoring it to the default while exiting. Signed-off-by: Sanjay Singh Rawat snjs...@gmail.com --- drivers/usb/gadget/function/f_mass_storage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/function