All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: "Limonciello, Mario" <Mario.Limonciello@amd.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	"open list:AMD PSTATE DRIVER" <linux-pm@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 0/3] Improve usability for amd-pstate
Date: Wed, 30 Mar 2022 17:54:59 +0800	[thread overview]
Message-ID: <YkQo81jOIcC1t0tr@amd.com> (raw)
In-Reply-To: <DM4PR12MB5168F84795F4467B048B6AC3E21E9@DM4PR12MB5168.namprd12.prod.outlook.com>

On Wed, Mar 30, 2022 at 04:47:02AM +0800, Limonciello, Mario wrote:
> [AMD Official Use Only]
> 
> 
> 
> > -----Original Message-----
> > From: Huang, Ray <Ray.Huang@amd.com>
> > Sent: Tuesday, March 29, 2022 01:03
> > To: Limonciello, Mario <Mario.Limonciello@amd.com>
> > Cc: Rafael J . Wysocki <rafael@kernel.org>; Viresh Kumar
> > <viresh.kumar@linaro.org>; open list:AMD PSTATE DRIVER <linux-
> > pm@vger.kernel.org>; open list <linux-kernel@vger.kernel.org>
> > Subject: Re: [PATCH v2 0/3] Improve usability for amd-pstate
> > 
> > On Tue, Mar 29, 2022 at 09:59:44AM +0800, Limonciello, Mario wrote:
> > > There has recently been some news coverage about `amd-pstate` being in
> > > 5.17, but this news also mentioned that it's a bit difficult to use.
> > >
> > > You need to either block init calls, or compile the module into the kernel
> > > to force it to take precedence over acpi-cpufreq.
> > >
> > > This series aims to improve the usability of amd-pstate so that distros
> > > can compile as a module, but users can still use it (relatively) easily.
> > >
> > > A new module parameter is included that will force amd-pstate to take
> > > precedence and a module table to let it load automatically on such systems.
> > >
> > > With the patches in this series a user can make a file
> > > /etc/modprobe.d/amd-pstate.conf:
> > >
> > > options amd-pstate replace=1
> > >
> > > Then upon the next reboot amd-pstate should load automatically even if
> > > acpi-cpufreq was included on the system.
> > >
> > > Mario Limonciello (3):
> > >   cpufreq: Export acpu_cpufreq_exit for other drivers to call
> > >   cpufreq: amd-pstate: Allow replacing acpi-cpufreq when loaded
> > >   cpufreq: amd-pstate: Add a module device table
> > >
> > >  drivers/cpufreq/acpi-cpufreq.c |  3 ++-
> > >  drivers/cpufreq/amd-pstate.c   | 30 +++++++++++++++++++++++++++---
> > >  2 files changed, 29 insertions(+), 4 deletions(-)
> > >
> > 
> > Mario, just applied your patch set in my platform, but it get the page fault
> > panic below:
> > 
> > [    4.195078] BUG: unable to handle page fault for address: ffffffff8aa2db87
> > [    4.196838] #PF: supervisor instruction fetch in kernel mode
> > [    4.197035] #PF: error_code(0x0011) - permissions violation
> > [    4.197035] PGD 1f980e067 P4D 1f980e067 PUD 1f980f063 PMD 100800063
> > PTE 80000001fa42d163
> > [    4.197035] Oops: 0011 [#1] PREEMPT SMP NOPTI
> > [    4.197035] CPU: 2 PID: 464 Comm: systemd-udevd Not tainted 5.17.0-
> > custom+ #1
> > [    4.197035] Hardware name: AMD Artic/Artic-CZN, BIOS WA21407N
> > 04/06/2021
> > [    4.197035] RIP: 0010:acpi_cpufreq_exit+0x0/0x46
> > [    4.197035] Code: 7f 00 00 a0 56 95 d2 4f 7f 00 00 80 f9 e7 d1 4f 7f 00 00 00 40
> > 90 d2 4f 7f 00 00 10 36 93 d2 4f 7f 00 00 10 a4 87 d2 4f 7f 00 <00> d0 b6 57 d2 4f
> > 7f 00 00 40 bf 1b d2 4f 7f 00 00 00 a4 85 d2 4f
> > [    4.197035] RSP: 0018:ffffaee0c156fc78 EFLAGS: 00010246
> > [    4.197035] RAX: 0000000000000000 RBX: 0000000000000000 RCX:
> > 0000000000000040
> > [    4.197035] RDX: 0000000000000000 RSI: ffffffffc04ee5c5 RDI:
> > ffffffff8a706100
> > [    4.197035] RBP: ffffaee0c156fc88 R08: 0000000000000000 R09:
> > 0000000000000000
> > [    4.197035] R10: 0000000000000000 R11: 0000000000000001 R12:
> > 00000000ffffffed
> > [    4.197035] R13: ffff9286ceead7e0 R14: ffffaee0c156fd90 R15:
> > ffffffffc04f0740
> > [    4.197035] FS:  00007fe0ab0c3880(0000) GS:ffff9289ee280000(0000)
> > knlGS:0000000000000000
> > [    4.197035] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [    4.197035] CR2: ffffffff8aa2db87 CR3: 0000000105a40000 CR4:
> > 0000000000750ee0
> > [    4.197035] PKRU: 55555554
> > [    4.197035] Call Trace:
> > [    4.197035]  <TASK>
> > [    4.197035]  ? amd_pstate_init+0x7d/0x1000 [amd_pstate]
> > [    4.197035]  ? 0xffffffffc0477000
> > [    4.197035]  do_one_initcall+0x48/0x200
> > [    4.197035]  ? __x64_sys_delete_module+0x251/0x260
> > [    4.197035]  ? kmem_cache_alloc_trace+0x34c/0x450
> > [    4.197035]  do_init_module+0x52/0x240
> > [    4.197035]  load_module+0x2471/0x2790
> > [    4.197035]  __do_sys_finit_module+0xc5/0x130
> > [    4.197035]  ? __do_sys_finit_module+0xc5/0x130
> > [    4.197035]  __x64_sys_finit_module+0x1a/0x20
> > [    4.197035]  do_syscall_64+0x3b/0xc0
> > [    4.197035]  entry_SYSCALL_64_after_hwframe+0x44/0xae
> > [    4.197035] RIP: 0033:0x7fe0ab64589d
> 
> Presumably you didn't have acpi-cpufreq compiled in or loaded at this time
> right?  I think I'll need to use IS_REACHABLE().

In fact, I have compiled and loaded acpi-cpufreq at first, otherwise, we
cannot get "acpi-cpufreq" driver instance with
cpufreq_get_current_driver().

Thanks,
Ray

      reply	other threads:[~2022-03-30  9:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29  1:59 [PATCH v2 0/3] Improve usability for amd-pstate Mario Limonciello
2022-03-29  1:59 ` [PATCH v2 1/3] cpufreq: Export acpu_cpufreq_exit for other drivers to call Mario Limonciello
2022-03-29  5:47   ` Huang Rui
2022-03-29  6:22   ` kernel test robot
2022-03-29  6:32   ` kernel test robot
2022-03-29  1:59 ` [PATCH v2 2/3] cpufreq: amd-pstate: Allow replacing acpi-cpufreq when loaded Mario Limonciello
2022-03-29  5:56   ` Huang Rui
2022-03-29  1:59 ` [PATCH v2 3/3] cpufreq: amd-pstate: Add a module device table Mario Limonciello
2022-03-29  5:56   ` Huang Rui
2022-03-29  6:02 ` [PATCH v2 0/3] Improve usability for amd-pstate Huang Rui
2022-03-29 20:47   ` Limonciello, Mario
2022-03-30  9:54     ` Huang Rui [this message]

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=YkQo81jOIcC1t0tr@amd.com \
    --to=ray.huang@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.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 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.