Subject: port-hpcmips/20091: TX39 always keeps bad time after reboot or resume.
To: None <gnats-bugs@gnats.netbsd.org>
From: None <masaki@koma.nu>
List: netbsd-bugs
Date: 01/27/2003 23:09:50
>Number:         20091
>Category:       port-hpcmips
>Synopsis:       TX39 always keeps bad time after reboot or resume.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-hpcmips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 27 23:10:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Konuma Masaki
>Release:        NetBSD 1.6L
>Organization:
>Environment:
NetBSD boojum 1.6L NetBSD 1.6L (AJ2) #22: Thu Jan 23 21:15:50 JST 2003     masaki@boojum:/a/netbsd/current/src/sys/arch/hpcmips/compile/AJ2 hpcmips
>Description:
The RTC of TX39 always keeps bad time after reboot or resume.

>How-To-Repeat:
set date and time by date(1).
reboot.
display date and time by date(1).

set date and time by date(1).
suspend/resume by the power button.
display date and time by date(1).


>Fix:
RCS file: /cvs/cvsroot/src/sys/arch/hpcmips/tx/tx39clock.c,v
retrieving revision 1.13
diff -u -r1.13 tx39clock.c
--- tx/tx39clock.c	2002/10/02 05:26:50	1.13
+++ tx/tx39clock.c	2003/01/19 14:18:31
@@ -284,6 +284,8 @@
 		    (int)sec));
 
 		sc->sc_enabled = 1;
+		clock_secs_to_ymdhms(base, &dt);
+		sc->sc_epoch = dt;
 		base += sec;
 	} else {
 		dt.dt_year = sc->sc_year;
@@ -316,6 +318,8 @@
 
 	if (sc->sc_enabled) {
 		sc->sc_epoch = *dt;
+		__tx39timer_rtcreset(sc->sc_tc);
+		tx39clock_alarm_refill(sc->sc_tc);
 	}
 }

>Release-Note:
>Audit-Trail:
>Unformatted: