[PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-28 Thread Ajay Kaher
ng has been added in init_usb_class() and destroy_usb_class(). As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class() because usb_class can never be NULL there. Signed-off-by: Ajay Kaher <ajay.ka...@samsung.com> Acked-by: Alan Stern <st...@rowland.harvard.e

FW: Re: [PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-21 Thread Ajay Kaher
register_dev->init_usb_class > > To solve this, mutex locking has been added in init_usb_class() and > destroy_usb_class(). > > As pointed by Alan, removed "if (usb_class)" test from destroy_usb_class() > because usb_class can never be NULL there. Signed-off-by: Ajay Ka

Re: [PATCH v4] USB: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-17 Thread Ajay Kaher
emoved "if (usb_class)" test from destroy_usb_class() because usb_class can never be NULL there. Signed-off-by: Ajay Kaher <ajay.ka...@samsung.com> Acked-by: Alan Stern <st...@rowland.harvard.edu> --- drivers/usb/core/file.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(

Re: Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-09 Thread Ajay Kaher
From febeb10887d5026a489658fd9e911656e76038ac Mon Sep 17 00:00:00 2001 From: Ajay Kaher <ajay.ka...@samsung.com> Date: Thu, 9 Mar 2017 16:07:54 +0530 Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultan

Re: Subject: [PATCH v4] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-06 Thread Ajay Kaher
      > On Fri, 3 Mar 2017, Ajay Kaher wrote: >  > > > usb_class->kref is not accessible outside the file.c > > > as usb_class is _static_ inside the file.c and > > > pointer of usb_class->kref is not passed anywhere. > > >  > > > Hence 

FW: FW: RE: Re: FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-03 Thread Ajay Kaher
> On Thr, 2 Mar 2017, Ajay Kaher wrote: >> On Wed, 1 Mar 2017, Alan Stern wrote: >>> On Wed, 1 Mar 2017, Ajay Kaher wrote: >>>> On Mon, 22 Feb 2017, Ajay Kaher wrote: >>>>  >>>>>  >>>>>> Alan, as per my understanding I

FW: RE: Re: FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-02 Thread Ajay Kaher
> On Wed, 1 Mar 2017, Alan Stern wrote: >> On Wed, 1 Mar 2017, Ajay Kaher wrote: >>> On Mon, 22 Feb 2017, Ajay Kaher wrote: >>>  >>>>  >>>>> Alan, as per my understanding I have shifted the lock from >>>>> release_usb_class() 

FW: RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-03-01 Thread Ajay Kaher
> On Mon, 22 Feb 2017, Ajay Kaher wrote: >  >> On Mon, 20 Feb 2017, Ajay Kaher wrote: >>  >>> Alan, as per my understanding I have shifted the lock from >>> release_usb_class() to destroy_usb_class() in patch v3.  >>> If it is not right, please expl

RE: Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-22 Thread Ajay Kaher
On Tue, 21 Feb 2017, Alan Stern wrote:    > On Mon, 20 Feb 2017, Ajay Kaher wrote:   >> Alan, as per my understanding I have shifted the lock from >> release_usb_class() to destroy_usb_class() in patch v3.  >> If it is not right, please explain in detail which race condi

Re: Subject: [PATCH v3] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-20 Thread Ajay Kaher
  On Thu, 16 Feb 2017, Alan Stern wrote:  > On Thu, 16 Feb 2017, Ajay Kaher wrote: >  >> > On Thu, 14 Feb 2017, Alan Stern wrote: >> >  >> > I think Ajay's argument is correct and a patch is needed.  But this >> > patch misses the race betw

RE: RE: Re: Re: Re: Subject: [PATCH v2] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-16 Thread Ajay Kaher
ng init_usb_class_mutex lock  >>requires. >> Don't you think so? >>  >> >>>> And because of the following code path race condition happens: >> >>>> probe->usb_register_dev->init_usb_class >> >>> >> >

RE: Re: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-02-01 Thread Ajay Kaher
ode has been around? What changed? > >> Tested with these changes, and problem has been solved. > >What changes? Tested with my patch (i.e. locking with init_usb_class_mutex). thanks, ajay kaher   - Original Message - Sender : gre...@linuxfoundation.org <gre.

RE: Re: Subject: [PATCH v1] USB:Core: BugFix: Proper handling of Race Condition when two USB class drivers try to call init_usb_class simultaneously

2017-01-30 Thread Ajay Kaher
  At boot time, probe function of multiple connected devices (proprietary devices) execute simultaneously. And because of the following code path race condition happens: probe->usb_register_dev->init_usb_class Tested with these changes, and problem has been solved. thanks, ajay