All of lore.kernel.org
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: "Gopalakrishnan, Aravind" <Aravind.Gopalakrishnan@amd.com>,
	"rjw@sisk.pl" <rjw@sisk.pl>
Cc: Andre Przywara <andre@andrep.de>,
	"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andreas <linuxuser330250@gmx.net>
Subject: Re: [PATCH] drivers/cpufreq: Warn user when powernow-k8 tries to fall back to acpi-cpufreq and it is unavailable.
Date: Thu, 17 Jan 2013 12:54:37 +0100	[thread overview]
Message-ID: <20130117115436.GA3853@pd.tnic> (raw)
In-Reply-To: <4923C2DE085EEB4FAB1D375DD09D0BA6100CF170@sausexdag04.amd.com>

On Fri, Jan 11, 2013 at 07:03:35PM +0000, Gopalakrishnan, Aravind wrote:
> So, I had tried out the case when acpi-cpufreq was compiled into the
> kernel and looked at the return values from request_module(); it
> returns a positive value (255) both when acpi-cpufreq was compiled-in
> and when not compiled-in. (Please do let me know if I am missing
> something here...) (This was the case Andreas had mentioned in the bug
> report too)
>
> It was due to this that I had decided to just check the CONFIG option
> and print out a warning to the user.

Well, when both are built-in, I get -2 from request_module which is most
probably the retval of modprobe with a missing module (I delved deep
into the do_execve bowels but didn't go deep enough).

So, handoff to acpi-cpufreq still has some issues. When both are
built-in, the module_init functions turn into normal initcalls and
in that case, they're executed in link order and it can happen that
powernowk8_init() runs before acpi_cpufreq_init().

In that case, we get -2 (-ENOENT, see above) and even though there's an
error, acpi-cpufreq gets loaded so the error is bogus:

[    2.225413] powernow-k8: This CPU is now supported by acpi-cpufreq, loading it.
[    2.227266] powernow-k8: Error(-2) loading acpi-cpufreq, make sure you have it enabled, else you won't have any Pstates support on this CPU!
[    2.227868] acpi-cpufreq: overriding BIOS provided _PSD data

I still need to think hard about this case and how to fix it.

In the meantime, here's fix for Andreas' issue (as a reply to this
message). Rafael, the patch is trivial, you might want to send it now
and for stable.

Thanks.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

  reply	other threads:[~2013-01-17 11:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-10  1:09 [PATCH] drivers/cpufreq: Warn user when powernow-k8 tries to fall back to acpi-cpufreq and it is unavailable Aravind Gopalakrishnan
2013-01-10  1:09 ` Aravind Gopalakrishnan
2013-01-11 14:49 ` Borislav Petkov
2013-01-11 16:50   ` Borislav Petkov
2013-01-11 17:39     ` Gopalakrishnan, Aravind
2013-01-11 17:39       ` Gopalakrishnan, Aravind
2013-01-11 19:03     ` Gopalakrishnan, Aravind
2013-01-11 19:03       ` Gopalakrishnan, Aravind
2013-01-17 11:54       ` Borislav Petkov [this message]
2013-01-17 11:58         ` [PATCH] powernow-k8: Add a kconfig dependency on acpi-cpufreq Borislav Petkov
2013-01-17 12:53           ` Rafael J. Wysocki
2013-01-17 14:17             ` Borislav Petkov
2013-01-17 22:10               ` Rafael J. Wysocki
2013-01-17 22:12                 ` Borislav Petkov
2013-01-18 16:23         ` [PATCH] drivers/cpufreq: Warn user when powernow-k8 tries to fall back to acpi-cpufreq and it is unavailable Matthew Garrett
2013-01-18 17:07           ` Borislav Petkov
2013-01-18 19:00             ` Borislav Petkov
2013-01-18 19:00               ` Borislav Petkov
2013-01-18 19:06               ` Matthew Garrett
2013-01-18 19:36                 ` Borislav Petkov
2013-01-18 19:38                   ` Matthew Garrett
2013-01-18 19:58                     ` Borislav Petkov

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=20130117115436.GA3853@pd.tnic \
    --to=bp@alien8.de \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=andre@andrep.de \
    --cc=cpufreq@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxuser330250@gmx.net \
    --cc=rjw@sisk.pl \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.