public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alessandro Zummo <a.zummo@towertech.it>
To: Sasha Levin <sasha.levin@oracle.com>
Cc: Tejun Heo <tj@kernel.org>, Greg KH <greg@kroah.com>,
	rtc-linux@googlegroups.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: kernfs/rtc: circular dependency between kernfs and ops_lock
Date: Tue, 25 Mar 2014 23:39:36 +0100	[thread overview]
Message-ID: <20140325233936.655a798e@linux.lan.towertech.it> (raw)
In-Reply-To: <5331FA9E.20506@oracle.com>

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


  reply	other threads:[~2014-03-25 22:39 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 17:51 kernfs/rtc: circular dependency between kernfs and ops_lock Sasha Levin
2014-02-22 20:52 ` Tejun Heo
2014-02-24 11:04   ` Alessandro Zummo
2014-03-25 21:52     ` Sasha Levin
2014-03-25 22:39       ` Alessandro Zummo [this message]
2014-03-26  0:19         ` Sasha Levin
2014-03-30  0:28           ` Sasha Levin
2014-03-30 16:04             ` Sasha Levin
2014-03-31  9:46               ` Alessandro Zummo
2014-03-31  9:52                 ` Lars-Peter Clausen
2014-03-31 10:43                   ` Alessandro Zummo
2014-03-31 11:07                     ` Lars-Peter Clausen
2014-03-31 12:03                       ` Alessandro Zummo
2014-03-31 12:19                         ` Lars-Peter Clausen
2014-04-02 22:51                           ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140325233936.655a798e@linux.lan.towertech.it \
    --to=a.zummo@towertech.it \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sasha.levin@oracle.com \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox