FreeBSD Bugzilla – Attachment 190344 Details for
Bug 225688
ppc64: Unable to read timebase
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Get the timebase from the proper OF field.
0001-PPC64-Get-the-timebase-from-the-proper-OF-field.patch (text/plain), 1.76 KB, created by
Breno Leitao
on 2018-02-05 16:42:26 UTC
(
hide
)
Description:
Get the timebase from the proper OF field.
Filename:
MIME Type:
Creator:
Breno Leitao
Created:
2018-02-05 16:42:26 UTC
Size:
1.76 KB
patch
obsolete
>From 0cbd7215a35c75fd10052d06bc04e8aa0dd762ff Mon Sep 17 00:00:00 2001 >From: Breno Leitao <breno.leitao@gmail.com> >Date: Mon, 5 Feb 2018 17:30:21 +0100 >Subject: [PATCH] PPC64: Get the timebase from the proper OF field > >After revision rS328534('PPC64: use hwref instead of cpuid'), FreeBSD on >powerpc64 virtual machine panics since it is unable to read the >timebase, showing the following error: > > get-property for timebase-frequency on zero phandle > > panic: Unable to determine timebase frequency! > >With the change above, cpuref->cr_hwref does not contain the phandle >anymore, thus, it never reads the proper CPU entry in OF. > >This change follow what is being done for PowerNV. > >diff --git a/sys/powerpc/pseries/platform_chrp.c b/sys/powerpc/pseries/platform_chrp.c >index 8e57a874d1e..1b498a406de 100644 >--- a/sys/powerpc/pseries/platform_chrp.c >+++ b/sys/powerpc/pseries/platform_chrp.c >@@ -285,12 +285,29 @@ chrp_real_maxaddr(platform_t plat) > static u_long > chrp_timebase_freq(platform_t plat, struct cpuref *cpuref) > { >- phandle_t phandle; >+ char buf[8]; >+ phandle_t cpu, dev, root; >+ int res; > int32_t ticks = -1; > >- phandle = cpuref->cr_hwref; >+ root = OF_peer(0); >+ dev = OF_child(root); >+ while (dev != 0) { >+ res = OF_getprop(dev, "name", buf, sizeof(buf)); >+ if (res > 0 && strcmp(buf, "cpus") == 0) >+ break; >+ dev = OF_peer(dev); >+ } >+ >+ for (cpu = OF_child(dev); cpu != 0; cpu = OF_peer(cpu)) { >+ res = OF_getprop(cpu, "device_type", buf, sizeof(buf)); >+ if (res > 0 && strcmp(buf, "cpu") == 0) >+ break; >+ } >+ if (cpu == 0) >+ return (512000000); > >- OF_getencprop(phandle, "timebase-frequency", &ticks, sizeof(ticks)); >+ OF_getencprop(cpu, "timebase-frequency", &ticks, sizeof(ticks)); > > if (ticks <= 0) > panic("Unable to determine timebase frequency!"); >-- >2.15.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 225688
: 190344