Messages in this thread Patch in this message |  | | Date | Tue, 25 Mar 2014 23:39:36 +0100 | From | Alessandro Zummo <> | Subject | Re: kernfs/rtc: circular dependency between kernfs and ops_lock |
| |
On Tue, 25 Mar 2014 17:52:30 -0400 Sasha Levin <sasha.levin@oracle.com> wrote:
> > > > Pretty interesting indeed. One option would be to remove > > the sys files before acquiring the lock. But I wonder > > if this could lead to other issues. > > > > Ping? Seems this thing got lost.
What if we move
rtc_sysfs_del_device(rtc);
before acquiring the lock?
diff --git a/drivers/rtc/class.c b/drivers/rtc/class.c index 589351e..a0c19a3 100644 --- a/drivers/rtc/class.c +++ b/drivers/rtc/class.c @@ -261,11 +261,13 @@ EXPORT_SYMBOL_GPL(rtc_device_register); void rtc_device_unregister(struct rtc_device *rtc) { if (get_device(&rtc->dev) != NULL) { + + rtc_sysfs_del_device(rtc); + mutex_lock(&rtc->ops_lock); /* remove innards of this RTC, then disable it, before * letting any rtc_class_open() users access it again */ - rtc_sysfs_del_device(rtc); rtc_dev_del_device(rtc); rtc_proc_del_device(rtc); device_unregister(&rtc->dev);
--
Best regards,
Alessandro Zummo, Tower Technologies - Torino, Italy
http://www.towertech.it
|  |