Message ID | 20160121001120.GA2784@yogzotot |
---|---|
State | Superseded |
Delegated to: | David Miller |
Headers | show |
On Thu, Jan 21, 2016 at 3:11 AM, Anatoly Pugachev <matorola@gmail.com> wrote: > Next, compiled with gpt-patch, and applied another patch from oracle linux on > sparc silo.src.rpm package > (http://yum.oracle.com/repo/linux_sparc64/latest//silo-1.4.14-4.0.18.el6.src.rpm), > called silo-1.4.14-timer-timeout.patch > > diff --git a/second/timer.c b/second/timer.c > index 7f03996..b559f93 100644 > --- a/second/timer.c > +++ b/second/timer.c > @@ -145,7 +145,7 @@ static inline int sun4u_init_timer () > prom_getstring(node, "device_type", node_str, sizeof(node_str)); > if (!strcmp(node_str, "cpu")) { > foundcpu = 1; > - clock_frequency = prom_getintdefault(node, "clock-frequency", 0) / 100; > + clock_frequency = (unsigned int) prom_getintdefault(node, "clock-frequency", 0) / 100; > } > } > if (notimer) { > @@ -155,7 +155,7 @@ static inline int sun4u_init_timer () > } > } > if (!foundcpu || !clock_frequency) > - clock_frequency = prom_getint(prom_root_node, "clock-frequency") / 100; > + clock_frequency = (unsigned int) prom_getint(prom_root_node, "clock-frequency") / 100; > if (notimer && !sun4v_cpu) { > sun4u_notimer = 1; > __asm__ __volatile__ ("\t" found an owner of this patch in silo.spec changelog, quote: * Fri Aug 30 2013 Nikita Gerasimov <nikita.gerasimov@oracle.com> 1.4.14-4.0.14 - silo.conf timeout property does not work due to overflow. Basically the CPU is so fast now that it overslows the signed 32bit value. I guess at some point it'll be even faster and we'll have to promte prom_getintdefault() to returning an unsigned double int. So we need to make Nikita Gerasimov <nikita.gerasimov@oracle.com> as Signed-off-by as well. Thanks. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Anatoly Pugachev <matorola@gmail.com> Date: Thu, 21 Jan 2016 15:52:29 +0300 > On Thu, Jan 21, 2016 at 3:11 AM, Anatoly Pugachev <matorola@gmail.com> wrote: >> Next, compiled with gpt-patch, and applied another patch from oracle linux on >> sparc silo.src.rpm package >> (http://yum.oracle.com/repo/linux_sparc64/latest//silo-1.4.14-4.0.18.el6.src.rpm), >> called silo-1.4.14-timer-timeout.patch >> >> diff --git a/second/timer.c b/second/timer.c >> index 7f03996..b559f93 100644 >> --- a/second/timer.c >> +++ b/second/timer.c >> @@ -145,7 +145,7 @@ static inline int sun4u_init_timer () >> prom_getstring(node, "device_type", node_str, sizeof(node_str)); >> if (!strcmp(node_str, "cpu")) { >> foundcpu = 1; >> - clock_frequency = prom_getintdefault(node, "clock-frequency", 0) / 100; >> + clock_frequency = (unsigned int) prom_getintdefault(node, "clock-frequency", 0) / 100; >> } >> } >> if (notimer) { >> @@ -155,7 +155,7 @@ static inline int sun4u_init_timer () >> } >> } >> if (!foundcpu || !clock_frequency) >> - clock_frequency = prom_getint(prom_root_node, "clock-frequency") / 100; >> + clock_frequency = (unsigned int) prom_getint(prom_root_node, "clock-frequency") / 100; >> if (notimer && !sun4v_cpu) { >> sun4u_notimer = 1; >> __asm__ __volatile__ ("\t" > > found an owner of this patch in silo.spec changelog, quote: > > * Fri Aug 30 2013 Nikita Gerasimov <nikita.gerasimov@oracle.com> 1.4.14-4.0.14 > - silo.conf timeout property does not work due to overflow. Basically > the CPU is so fast now that it overslows the signed 32bit value. > I guess at some point it'll be even faster and we'll have to promte > prom_getintdefault() to returning an unsigned double int. > > So we need to make Nikita Gerasimov <nikita.gerasimov@oracle.com> as > Signed-off-by as well. And maybe we can ask them how to get access to this amazing "unsigned double int" type. I'd like to start using it too. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/silo.h b/include/silo.h index 94d6e31..135b79e 100644 --- a/include/silo.h +++ b/include/silo.h @@ -46,6 +46,7 @@ typedef struct { } sun_partition; #define SUN_LABEL_MAGIC 0xDABE +#define GPT_LABEL_MAGIC 0x0000 struct silo_inode { unsigned int inolen; diff --git a/second/fs/iom.c b/second/fs/iom.c index 28dd4b2..c25e41c 100644 --- a/second/fs/iom.c +++ b/second/fs/iom.c @@ -37,8 +37,8 @@ static int read_sun_partition (int partno) silo_fatal("Cannot read partition"); return 0; } - if (sdl.magic != SUN_LABEL_MAGIC) - silo_fatal("Wrong disklabel magic"); + if ((sdl.magic != SUN_LABEL_MAGIC) && (sdl.magic != GPT_LABEL_MAGIC)) + printf("Wrong disklabel magic [0x%X]\n", (unsigned int) sdl.magic); for (csum = 0, ush = ((unsigned short *) ((&sdl) + 1)) - 1; ush >= (unsigned short *) &sdl;) csum ^= *ush--; if (csum) diff --git a/second/timer.c b/second/timer.c index 7f03996..b559f93 100644 --- a/second/timer.c +++ b/second/timer.c @@ -145,7 +145,7 @@ static inline int sun4u_init_timer () prom_getstring(node, "device_type", node_str, sizeof(node_str)); if (!strcmp(node_str, "cpu")) { foundcpu = 1; - clock_frequency = prom_getintdefault(node, "clock-frequency", 0) / 100; + clock_frequency = (unsigned int) prom_getintdefault(node, "clock-frequency", 0) / 100; } } if (notimer) { @@ -155,7 +155,7 @@ static inline int sun4u_init_timer () } } if (!foundcpu || !clock_frequency) - clock_frequency = prom_getint(prom_root_node, "clock-frequency") / 100; + clock_frequency = (unsigned int) prom_getint(prom_root_node, "clock-frequency") / 100; if (notimer && !sun4v_cpu) { sun4u_notimer = 1; __asm__ __volatile__ ("\t"