NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-sgimips/53520: delay(9) is ineffective in early initialization phase sgimips kernel.



>Number:         53520
>Category:       port-sgimips
>Synopsis:       delay(9) is ineffective in early initialization phase sgimips kernel.
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-sgimips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 13 18:50:00 +0000 2018
>Originator:     Naruaki Etomi
>Release:        NetBSD/sgimips 8.99.21
>Organization:
Japan
>Environment:
NetBSD  8.99.21 NetBSD 8.99.21 (GENERIC32_IP12) #1: Sun Aug 12 14:48:19 UTC 2018  naruaki@xserve:/usr/obj.sgimips/sys/arch/sgimips/compile/GENERIC32_IP2x sgimips

>Description:
delay(9) is used in int_attach().
https://nxr.netbsd.org/xref/src/sys/arch/sgimips/dev/int.c#164

However, ci_divisor_delay is not set yet.

It?s quite meaningless.
>How-To-Repeat:

>Fix:
---------------------------------------------------------------------------------------------

diff -Naru src.orig/sys/arch/sgimips/sgimips/machdep.c src/sys/arch/sgimips/sgimips/machdep.c
--- src.orig/sys/arch/sgimips/sgimips/machdep.c 2017-11-07 03:01:06.000000000 +0000
+++ src/sys/arch/sgimips/sgimips/machdep.c      2018-08-13 18:00:07.617278991 +0000
@@ -333,6 +333,10 @@
         */
        curcpu()->ci_cpu_freq = strtoul(cpufreq, NULL, 10) * 1000000;
 
+       /* Calibrate later. */
+       curcpu()->ci_cycles_per_hz = curcpu()->ci_cpu_freq / (2 * hz);
+       curcpu()->ci_divisor_delay = curcpu()->ci_cpu_freq / (2 * 1000000);
+
        /*
         * Check machine (IPn) type.
         *
---------------------------------------------------------------------------------------------

This patch set Untrusted(ARCBIOS) clock. It's better than not doing anything.
Tested on Indy and Indigo R4000.



Home | Main Index | Thread Index | Old Index