Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Yijing Wang
On 2014/11/5 11:52, Greg KH wrote: > On Tue, Nov 04, 2014 at 10:29:43PM -0500, Tejun Heo wrote: >> Hello, >> >> On Wed, Nov 05, 2014 at 11:27:39AM +0800, Yijing Wang wrote: >>> Keep the parent directory looks good to me, we could only add >>> kobject_get(&parent) >>> after the parent dir be creat

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Greg KH
On Tue, Nov 04, 2014 at 10:29:43PM -0500, Tejun Heo wrote: > Hello, > > On Wed, Nov 05, 2014 at 11:27:39AM +0800, Yijing Wang wrote: > > Keep the parent directory looks good to me, we could only add > > kobject_get(&parent) > > after the parent dir be created. > > > > > > /* or

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Tejun Heo
Hello, On Wed, Nov 05, 2014 at 11:27:39AM +0800, Yijing Wang wrote: > Keep the parent directory looks good to me, we could only add > kobject_get(&parent) > after the parent dir be created. > > > /* or create a new class-directory at the parent device */ > k = c

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Yijing Wang
On 2014/11/5 11:13, Tejun Heo wrote: > Hello, > > On Wed, Nov 05, 2014 at 10:01:39AM +0800, Yijing Wang wrote: >>> So, yeah, this looks like a correct approach; however, do we even need >>> to clear the glue directories? >> >> Yes. In our platform, the glue directories >> /sys/devices/virtual/blo

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Tejun Heo
Hello, On Wed, Nov 05, 2014 at 10:01:39AM +0800, Yijing Wang wrote: > > So, yeah, this looks like a correct approach; however, do we even need > > to clear the glue directories? > > Yes. In our platform, the glue directories > /sys/devices/virtual/block will be removed once the last child > devi

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Yijing Wang
On 2014/11/5 3:15, Tejun Heo wrote: > Hello, > > Sorry about the delay. Thank you for your review and comments. > > On Wed, Oct 22, 2014 at 04:07:44PM +0800, Weng Meiling wrote: >> diff --git a/drivers/base/core.c b/drivers/base/core.c >> index 28b808c..645eacf 100644 >> --- a/drivers/base/core

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-11-04 Thread Tejun Heo
Hello, Sorry about the delay. On Wed, Oct 22, 2014 at 04:07:44PM +0800, Weng Meiling wrote: > diff --git a/drivers/base/core.c b/drivers/base/core.c > index 28b808c..645eacf 100644 > --- a/drivers/base/core.c > +++ b/drivers/base/core.c > @@ -724,12 +724,12 @@ class_dir_create_and_add(struct clas

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-10-22 Thread Weng Meiling
On 2014/10/16 17:13, Greg KH wrote: > On Thu, Oct 16, 2014 at 03:23:53PM +0800, Weng Meiling wrote: >> On 2014/10/16 15:07, Frans Klaver wrote: >>> On Thu, Oct 16, 2014 at 3:56 AM, Weng Meiling >>> wrote: Would you please give me some of your views on this issue? Any suggestion is

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-10-16 Thread Greg KH
On Thu, Oct 16, 2014 at 03:23:53PM +0800, Weng Meiling wrote: > On 2014/10/16 15:07, Frans Klaver wrote: > > On Thu, Oct 16, 2014 at 3:56 AM, Weng Meiling > > wrote: > >> > >> Would you please give me some of your views on this issue? Any suggestion > >> is appreciative. > > > > It'll come. Be p

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-10-16 Thread Weng Meiling
On 2014/10/16 15:07, Frans Klaver wrote: > On Thu, Oct 16, 2014 at 3:56 AM, Weng Meiling > wrote: >> >> Would you please give me some of your views on this issue? Any suggestion is >> appreciative. > > It'll come. Be patient. > > . > yeah, maybe I'm too impatient :). But this is important for

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-10-16 Thread Frans Klaver
On Thu, Oct 16, 2014 at 3:56 AM, Weng Meiling wrote: > > Would you please give me some of your views on this issue? Any suggestion is > appreciative. It'll come. Be patient. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kern

Re: Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-10-15 Thread Weng Meiling
Hi, Would you please give me some of your views on this issue? Any suggestion is appreciative. Thanks! Weng Meiling On 2014/10/15 14:42, Weng Meiling wrote: > When the last child kobject was deleted, it's parent kobject will be deleted, > when removing the parent kobject if the parent kobject'

Subject: [PATCH] kobject: fix the race between kobject_del and get_device_parent

2014-10-14 Thread Weng Meiling
When the last child kobject was deleted, it's parent kobject will be deleted, when removing the parent kobject if the parent kobject's sd has been set NULL and still not been removed from it's kset's list, at the same time another one trigger an device adding event, the function get_parent_device()