* [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck
@ 2024-10-10 8:42 Youwan Wang
2024-10-14 13:56 ` Will Deacon
2024-10-17 6:39 ` Yicong Yang
0 siblings, 2 replies; 3+ messages in thread
From: Youwan Wang @ 2024-10-10 8:42 UTC (permalink / raw)
To: jonathan.cameron
Cc: yangyicong, will, mark.rutland, linux-arm-kernel, linux-kernel,
Youwan Wang
The CPU of the device I am using is kunpeng 920,
which can start normally with version 5.4 kernel.
However, when installing version 6.6 kernel, the
kernel gets stuck when loading the "hisi_dddrc_pmu"
driver. I went to debug and found that it gets stuck
when "readl (ddrc_pmu ->base+DDRC_VERSION)". I suspect
that the hardware does not support it. My modification is:
for the "HISI0233" device, according to the implementation
of version 5.4 kernel, the identity is not obtained from
the register. For "identifier" sysfs, identifier: 0
Signed-off-by: Youwan Wang <youwan@nfschina.com>
---
drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
index b804e3738113..3cecad46b01f 100644
--- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
+++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
@@ -321,6 +321,9 @@ static int hisi_ddrc_pmu_init_data(struct platform_device *pdev,
return PTR_ERR(ddrc_pmu->base);
}
+ if (strstr(pdev->name, "HISI0233"))
+ return 0;
+
ddrc_pmu->identifier = readl(ddrc_pmu->base + DDRC_VERSION);
if (ddrc_pmu->identifier >= HISI_PMU_V2) {
if (device_property_read_u32(&pdev->dev, "hisilicon,sub-id",
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck
2024-10-10 8:42 [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck Youwan Wang
@ 2024-10-14 13:56 ` Will Deacon
2024-10-17 6:39 ` Yicong Yang
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2024-10-14 13:56 UTC (permalink / raw)
To: Youwan Wang
Cc: jonathan.cameron, yangyicong, mark.rutland, linux-arm-kernel,
linux-kernel
On Thu, Oct 10, 2024 at 04:42:17PM +0800, Youwan Wang wrote:
> The CPU of the device I am using is kunpeng 920,
> which can start normally with version 5.4 kernel.
> However, when installing version 6.6 kernel, the
> kernel gets stuck when loading the "hisi_dddrc_pmu"
> driver. I went to debug and found that it gets stuck
> when "readl (ddrc_pmu ->base+DDRC_VERSION)". I suspect
> that the hardware does not support it. My modification is:
> for the "HISI0233" device, according to the implementation
> of version 5.4 kernel, the identity is not obtained from
> the register. For "identifier" sysfs, identifier: 0
>
> Signed-off-by: Youwan Wang <youwan@nfschina.com>
> ---
> drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
> index b804e3738113..3cecad46b01f 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
> +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
> @@ -321,6 +321,9 @@ static int hisi_ddrc_pmu_init_data(struct platform_device *pdev,
> return PTR_ERR(ddrc_pmu->base);
> }
>
> + if (strstr(pdev->name, "HISI0233"))
> + return 0;
If your firmware is advertising devices that don't exist, then you should
fix that rather than adding a hack to the driver.
Will
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck
2024-10-10 8:42 [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck Youwan Wang
2024-10-14 13:56 ` Will Deacon
@ 2024-10-17 6:39 ` Yicong Yang
1 sibling, 0 replies; 3+ messages in thread
From: Yicong Yang @ 2024-10-17 6:39 UTC (permalink / raw)
To: Youwan Wang
Cc: jonathan.cameron, yangyicong, will, mark.rutland,
linux-arm-kernel, linux-kernel
On 2024/10/10 16:42, Youwan Wang wrote:
> The CPU of the device I am using is kunpeng 920,
> which can start normally with version 5.4 kernel.
> However, when installing version 6.6 kernel, the
> kernel gets stuck when loading the "hisi_dddrc_pmu"
> driver. I went to debug and found that it gets stuck
> when "readl (ddrc_pmu ->base+DDRC_VERSION)". I suspect
what does "stuck" mean here? do you see some hardware errors
or similiar? If so this should be an unexpected device and
your patch still doesn't address the issue, since you only make
the probe work but the device's still inaccessible so it
shouldn't be appeared in the system.
as Will mentions, this is probably a firmware issue. please
try to update to the latest firmware.
Thanks.
> that the hardware does not support it. My modification is:
> for the "HISI0233" device, according to the implementation
> of version 5.4 kernel, the identity is not obtained from
> the register. For "identifier" sysfs, identifier: 0
>
> Signed-off-by: Youwan Wang <youwan@nfschina.com>
> ---
> drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
> index b804e3738113..3cecad46b01f 100644
> --- a/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
> +++ b/drivers/perf/hisilicon/hisi_uncore_ddrc_pmu.c
> @@ -321,6 +321,9 @@ static int hisi_ddrc_pmu_init_data(struct platform_device *pdev,
> return PTR_ERR(ddrc_pmu->base);
> }
>
> + if (strstr(pdev->name, "HISI0233"))
> + return 0;
> +
> ddrc_pmu->identifier = readl(ddrc_pmu->base + DDRC_VERSION);
> if (ddrc_pmu->identifier >= HISI_PMU_V2) {
> if (device_property_read_u32(&pdev->dev, "hisilicon,sub-id",
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-17 6:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-10 8:42 [PATCH] drivers/perf: hisi: Fix readl DDRC_VERSION stuck Youwan Wang
2024-10-14 13:56 ` Will Deacon
2024-10-17 6:39 ` Yicong Yang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®