Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Apr 2021 04:18:07 GMT
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: cf8bf3edf8ee - stable/13 - powerpc/aim: Update timebase directly on resume instead of through platform
Message-ID:  <202104200418.13K4I7UG015909@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bdragon:

URL: https://cgit.FreeBSD.org/src/commit/?id=cf8bf3edf8ee41bcd21336e197a6195d4d455ea9

commit cf8bf3edf8ee41bcd21336e197a6195d4d455ea9
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2021-03-31 16:54:27 +0000
Commit:     Brandon Bergren <bdragon@FreeBSD.org>
CommitDate: 2021-04-20 04:13:56 +0000

    powerpc/aim: Update timebase directly on resume instead of through platform
    
    This only works on single-CPU G4 systems, and more work is needed for
    dual-CPU systems.  That said, platform sleep does not work, and this is
    currently only used for PMU-based CPU speed change.
    
    The elimination of the platform_smp_timebase_sync() call is so that the
    timebase sync rendezvous can be enhanced to perform better
    synchronization, which requires a full rendezvous.  This would be
    impossible to do on this single-threaded run.
    
    (cherry picked from commit 921716186f121a2f6a27178cb302415f37412a79)
---
 sys/powerpc/aim/aim_machdep.c | 3 ++-
 sys/powerpc/aim/mp_cpudep.c   | 3 ---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/sys/powerpc/aim/aim_machdep.c b/sys/powerpc/aim/aim_machdep.c
index b09089069c28..784207e9a70d 100644
--- a/sys/powerpc/aim/aim_machdep.c
+++ b/sys/powerpc/aim/aim_machdep.c
@@ -768,7 +768,8 @@ mpc745x_sleep()
 		while (1)
 			mtmsr(msr);
 	}
-	platform_smp_timebase_sync(timebase, 0);
+	/* XXX: The mttb() means this *only* works on single-CPU systems. */
+	mttb(timebase);
 	PCPU_SET(curthread, curthread);
 	PCPU_SET(curpcb, curthread->td_pcb);
 	pmap_activate(curthread);
diff --git a/sys/powerpc/aim/mp_cpudep.c b/sys/powerpc/aim/mp_cpudep.c
index b5931786f8f7..33aae520c4b2 100644
--- a/sys/powerpc/aim/mp_cpudep.c
+++ b/sys/powerpc/aim/mp_cpudep.c
@@ -311,9 +311,6 @@ cpudep_ap_setup()
 
 	vers = mfpvr() >> 16;
 
-	/* The following is needed for restoring from sleep. */
-	platform_smp_timebase_sync(0, 1);
-
 	switch(vers) {
 	case IBM970:
 	case IBM970FX:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104200418.13K4I7UG015909>