From: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
To: "Corey Hickey" <bugfood-ml@fatooh.org>,
platform-driver-x86@vger.kernel.org,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v2] platform/x86/amd/pmc: Detect when STB is not available
Date: Mon, 28 Oct 2024 09:25:23 +0530 [thread overview]
Message-ID: <cc52d127-794e-439c-be6d-e6e7bc6fad61@amd.com> (raw)
In-Reply-To: <20241027023428.419116-1-bugfood-ml@fatooh.org>
On 10/27/2024 08:04, Corey Hickey wrote:
> From: Corey Hickey <bugfood-c@fatooh.org>
>
> Loading the amd_pmc module as:
>
> amd_pmc enable_stb=1
>
> ...can result in the following messages in the kernel ring buffer:
>
> amd_pmc AMDI0009:00: SMU cmd failed. err: 0xff
> ioremap on RAM at 0x0000000000000000 - 0x0000000000ffffff
> WARNING: CPU: 10 PID: 2151 at arch/x86/mm/ioremap.c:217 __ioremap_caller+0x2cd/0x340
>
> Additional debug shows that this happens when the calls to obtain
> S2D_PHYS_ADDR_LOW and S2D_PHYS_ADDR_HIGH return 0.
>
> According to Shyam Sundar S K <Shyam-sundar.S-k@amd.com>, this condition
> indicates that the STB is not available.
No need to put my name in the commit message.
You may simply the commit message to something like this:
Further debugging reveals that this occurs when the requests for
S2D_PHYS_ADDR_LOW and S2D_PHYS_ADDR_HIGH return a value of 0,
indicating that the STB is inaccessible. To prevent the ioremap
warning and provide clarity to the user, handle the invalid address
and display an error message.
With this addressed
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Thanks,
Shyam
>
> In order to avoid the ioremap warning, and to help the user understand
> the situation, catch the invalid address and print an error.
>
> Link: https://lore.kernel.org/platform-driver-x86/c588ff5d-3e04-4549-9a86-284b9b4419ba@amd.com
> Fixes: 3d7d407dfb05 ("platform/x86: amd-pmc: Add support for AMD Spill to DRAM STB feature")
> Signed-off-by: Corey Hickey <bugfood-c@fatooh.org>
> ---
> drivers/platform/x86/amd/pmc/pmc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/platform/x86/amd/pmc/pmc.c b/drivers/platform/x86/amd/pmc/pmc.c
> index bbb8edb62e00..5669f94c3d06 100644
> --- a/drivers/platform/x86/amd/pmc/pmc.c
> +++ b/drivers/platform/x86/amd/pmc/pmc.c
> @@ -998,6 +998,11 @@ static int amd_pmc_s2d_init(struct amd_pmc_dev *dev)
> amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true);
> amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true);
>
> + if (!phys_addr_hi && !phys_addr_low) {
> + dev_err(dev->dev, "STB is not enabled on the system; disable enable_stb or contact system vendor\n");
> + return -EINVAL;
> + }
> +
> stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low);
>
> /* Clear msg_port for other SMU operation */
next prev parent reply other threads:[~2024-10-28 3:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-25 5:11 [PATCH] platform/x86/amd/pmc: Detect when STB is not available Corey Hickey
2024-10-25 14:55 ` Ilpo Järvinen
2024-10-27 2:34 ` Corey Hickey
2024-10-27 2:34 ` [PATCH v2] " Corey Hickey
2024-10-28 3:55 ` Shyam Sundar S K [this message]
2024-10-28 18:03 ` Corey Hickey
2024-10-28 18:02 ` [PATCH v3] " Corey Hickey
2024-10-29 12:17 ` Ilpo Järvinen
2024-11-04 10:21 ` Hans de Goede
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=cc52d127-794e-439c-be6d-e6e7bc6fad61@amd.com \
--to=shyam-sundar.s-k@amd.com \
--cc=bugfood-ml@fatooh.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=platform-driver-x86@vger.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