[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1742035.QldI8RN9SY@aspire.rjw.lan>
Date: Wed, 18 Oct 2017 12:04:18 +0200
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Jeffy Chen <jeffy.chen@...k-chips.com>
Cc: linux-kernel@...r.kernel.org, dmitry.torokhov@...il.com,
heiko@...ech.de, briannorris@...omium.org, dianders@...omium.org,
tfiga@...omium.org, broonie@...nel.org, seanpaul@...omium.org,
thierry.reding@...il.com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH] driver core: Make sure device detached from driver before deleting it
On Wednesday, October 18, 2017 7:49:26 AM CEST Jeffy Chen wrote:
> There are cases we call device_del() without detaching it from the
> driver(e.g. spi core del children devices).
But device_del() itself detaches the device from its driver.
> Signed-off-by: Jeffy Chen <jeffy.chen@...k-chips.com>
> ---
>
> drivers/base/core.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index 12ebd055724c..717efc3020af 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1951,6 +1951,8 @@ void device_del(struct device *dev)
> struct kobject *glue_dir = NULL;
> struct class_interface *class_intf;
>
> + device_release_driver(dev);
> +
> /* Notify clients of device removal. This call must come
> * before dpm_sysfs_remove().
> */
>
But device_del() calls bus_remove_device() which in turn calls
device_release_driver(), so this looks like an ordering issue to me.
What *exactly* is not working? Or rather, what symptoms do you see?
Thanks,
Rafael
Powered by blists - more mailing lists