Re: [PATCH] software node: recursively unregister child swnodes

2020-06-05 Thread Jordan Hand
On 6/5/20 12:54 AM, Greg Kroah-Hartman wrote: Right now, the way the driver model and sysfs/kobjects work is that all objects must be removed in child-first order. The problem of your change where you want to try to remove the devices in parent-first order is that you do not really know if yo

Re: [PATCH] software node: recursively unregister child swnodes

2020-06-05 Thread Greg Kroah-Hartman
On Thu, Jun 04, 2020 at 01:57:01PM -0700, Jordan Hand wrote: > On 6/4/20 1:15 PM, Greg Kroah-Hartman wrote: > > On Thu, Jun 04, 2020 at 12:36:23PM -0700, jorh...@linux.microsoft.com wrote: > > > From: Jordan Hand > > > > > > If a child swnode is unregistered after it's parent, it can lead to > >

Re: [PATCH] software node: recursively unregister child swnodes

2020-06-04 Thread Jordan Hand
On 6/4/20 1:57 PM, Jordan Hand wrote: On 6/4/20 1:15 PM, Greg Kroah-Hartman wrote: On Thu, Jun 04, 2020 at 12:36:23PM -0700, jorh...@linux.microsoft.com That said, I suppose just ordering the nodes so that children come before parents would also be fine. My thinking was just that accepting a

Re: [PATCH] software node: recursively unregister child swnodes

2020-06-04 Thread Jordan Hand
On 6/4/20 1:15 PM, Greg Kroah-Hartman wrote: On Thu, Jun 04, 2020 at 12:36:23PM -0700, jorh...@linux.microsoft.com wrote: From: Jordan Hand If a child swnode is unregistered after it's parent, it can lead to undefined behavior. Crashing the system is not really "undefined" :) Fair point :)

Re: [PATCH] software node: recursively unregister child swnodes

2020-06-04 Thread Greg Kroah-Hartman
On Thu, Jun 04, 2020 at 12:36:23PM -0700, jorh...@linux.microsoft.com wrote: > From: Jordan Hand > > If a child swnode is unregistered after it's parent, it can lead to > undefined behavior. Crashing the system is not really "undefined" :) > When a swnode is unregistered, recursively free it's

[PATCH] software node: recursively unregister child swnodes

2020-06-04 Thread jorhand
From: Jordan Hand If a child swnode is unregistered after it's parent, it can lead to undefined behavior. When a swnode is unregistered, recursively free it's children to avoid this condition. Signed-off-by: Jordan Hand --- drivers/base/swnode.c | 13 - 1 file changed, 8 insertion