linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Knut Petersen" <Knut_Petersen@t-online.de>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Paul McKenney" <paulmck@linux.vnet.ibm.com>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Greg KH" <greg@kroah.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"Linux PM list" <linux-pm@vger.kernel.org>
Subject: Re: [BUG 3.12.rc4] Oops: unable to handle kernel paging request during shutdown
Date: Fri, 25 Oct 2013 15:24:00 +0530	[thread overview]
Message-ID: <CAKohpoma68h0mh2kqQYR5ohf=nKMtu8A7y0+9hnCE+fRRpm+Cw@mail.gmail.com> (raw)
In-Reply-To: <1483174.NsuFf8aJk6@vostro.rjw.lan>

On 25 October 2013 15:21, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> On Friday, October 25, 2013 11:28:02 AM Rafael J. Wysocki wrote:
>> On Friday, October 25, 2013 10:02:22 AM Linus Torvalds wrote:

>> > This particular cpufreq issue may be triggered by the fact that
>> > acpi-cpufreq isn't actually in use (pstate is). Or it might be some
>> > generic cpufreq/sysfs bug. Rafael, Greg, ideas?
>>
>> I *think* that this indeed is related to acpi-cpufreq being unused.  That said,
>> we've been fixing sysfs-related bugs in cpufreq recently and we may have
>> overlooked something.

I agree.. Recently I have tested few other cpufreq drivers for module
insert/removal along with governors insertion/removal... So that part must
be okay..

> Well, if the ACPI cpufreq driver is not registered, the exit function of the
> module shouldn't try to unregister it, so I have the appended patch (untested)
> to fix that particular thing.
>
> Rafael
>
>
> ---
>  drivers/cpufreq/acpi-cpufreq.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
>
> Index: linux-pm/drivers/cpufreq/acpi-cpufreq.c
> ===================================================================
> --- linux-pm.orig/drivers/cpufreq/acpi-cpufreq.c
> +++ linux-pm/drivers/cpufreq/acpi-cpufreq.c
> @@ -982,6 +982,8 @@ static void __exit acpi_cpufreq_boost_ex
>         }
>  }
>
> +static bool driver_registered;
> +
>  static int __init acpi_cpufreq_init(void)
>  {
>         int ret;
> @@ -1021,10 +1023,12 @@ static int __init acpi_cpufreq_init(void
>  #endif
>
>         ret = cpufreq_register_driver(&acpi_cpufreq_driver);
> -       if (ret)
> +       if (ret) {
>                 free_acpi_perf_data();
> -       else
> +       } else {
>                 acpi_cpufreq_boost_init();
> +               driver_registered = true;
> +       }
>
>         return ret;
>  }
> @@ -1032,6 +1036,8 @@ static int __init acpi_cpufreq_init(void
>  static void __exit acpi_cpufreq_exit(void)
>  {
>         pr_debug("acpi_cpufreq_exit\n");
> +       if (!driver_registered)
> +               return;
>
>         acpi_cpufreq_boost_exit();

Looks like the right solution here. But this kind of issues look to
be somewhat generic, doesn't they? And probably most of the
drivers would be struggling with such issues.. They are working
because we normally have something like this in core unregister
parts:

int cpufreq_unregister_driver(struct cpufreq_driver *driver)
{
...
        if (!cpufreq_driver || (driver != cpufreq_driver))
                return -EINVAL;
....

So, even in this case if we could actually check return value of
cpufreq_unregister_driver() and then do the other stuff, then we
wouldn't require this extra variable..

But the problem is the order in which things happen. Would this
be a big problem if we do unregister first and then
acpi_cpufreq_boost_exit(), based on what unregister returned?

  reply	other threads:[~2013-10-25  9:54 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <525BD08C.2080101@t-online.de>
2013-10-14 17:53 ` [BUG 3.12.rc4] Oops: unable to handle kernel paging request during shutdown Linus Torvalds
2013-10-14 21:28   ` Paul E. McKenney
2013-10-14 21:51     ` Frederic Weisbecker
2013-10-14 22:31       ` Knut Petersen
2013-10-14 22:43         ` Frederic Weisbecker
2013-10-15  6:40       ` Ingo Molnar
2013-10-15  7:53         ` Knut Petersen
2013-10-17 14:25         ` Frederic Weisbecker
2013-10-18  6:30           ` Ingo Molnar
2013-10-14 21:52     ` Knut Petersen
2013-10-14 23:16       ` Paul E. McKenney
2013-10-15  0:59         ` Paul E. McKenney
2013-10-15  8:06           ` Knut Petersen
2013-10-25  8:38   ` Linus Torvalds
2013-10-25  9:02     ` Linus Torvalds
2013-10-25  9:08       ` Paul E. McKenney
2013-10-25  9:17         ` Greg Kroah-Hartman
2013-10-25  9:13       ` Greg Kroah-Hartman
2013-10-25  9:28       ` Rafael J. Wysocki
2013-10-25  9:51         ` Rafael J. Wysocki
2013-10-25  9:54           ` Viresh Kumar [this message]
2013-10-25 10:10           ` Rafael J. Wysocki
2013-10-25 10:00             ` Viresh Kumar
2013-10-25 10:07             ` Linus Torvalds
2013-10-25 11:10               ` Rafael J. Wysocki
2013-10-25 13:49                 ` Viresh Kumar
2013-10-25 14:21                   ` Rafael J. Wysocki
2013-10-28 15:02       ` Knut Petersen
2013-10-25 10:23     ` Thomas Gleixner
2013-10-25 10:48       ` Linus Torvalds
2013-10-26 11:43         ` Ingo Molnar
2013-10-28 14:50           ` Knut Petersen
2013-10-28 15:01             ` Ingo Molnar
2013-10-28 15:16               ` Ingo Molnar
2013-10-28 15:45                 ` Knut Petersen
2013-10-27 20:20         ` Linus Torvalds
2013-10-27 20:39           ` Linus Torvalds
2013-10-27 21:13             ` Linus Torvalds
2013-10-27 21:24               ` Greg Kroah-Hartman
2013-10-28 17:23                 ` Bjorn Helgaas
2013-10-28 17:30                   ` Veaceslav Falico
2013-10-28 17:35                     ` Bjorn Helgaas
2013-10-28 17:39                       ` Veaceslav Falico
2013-10-28 18:52                   ` Greg Kroah-Hartman
2013-10-30 18:04             ` Pablo Neira Ayuso

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='CAKohpoma68h0mh2kqQYR5ohf=nKMtu8A7y0+9hnCE+fRRpm+Cw@mail.gmail.com' \
    --to=viresh.kumar@linaro.org \
    --cc=Knut_Petersen@t-online.de \
    --cc=cpufreq@vger.kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=greg@kroah.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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;
as well as URLs for NNTP newsgroup(s).