Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Jul 2022 18:09:25 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 633cab8aa4a2 - stable/13 - hwpmc: Remove always zero pc_resync field.
Message-ID:  <202207041809.264I9Pip064456@gitrepo.freebsd.org>

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

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

commit 633cab8aa4a24c4187e9996efa1bb680bf531ace
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-06-01 15:05:50 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-07-04 17:48:09 +0000

    hwpmc: Remove always zero pc_resync field.
    
    MFC after:      1 month
    
    (cherry picked from commit 5acb4c862b5b22c0556545a0e3a8dc2300238aca)
---
 sys/dev/hwpmc/hwpmc_uncore.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/sys/dev/hwpmc/hwpmc_uncore.c b/sys/dev/hwpmc/hwpmc_uncore.c
index a5e3d9bb2f8a..d0b310d740bc 100644
--- a/sys/dev/hwpmc/hwpmc_uncore.c
+++ b/sys/dev/hwpmc/hwpmc_uncore.c
@@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$");
 static enum pmc_cputype	uncore_cputype;
 
 struct uncore_cpu {
-	volatile uint32_t	pc_resync;
 	volatile uint32_t	pc_ucfctrl;	/* Fixed function control. */
 	volatile uint64_t	pc_globalctrl;	/* Global control register. */
 	struct pmc_hw		pc_uncorepmcs[];
@@ -338,11 +337,8 @@ ucf_start_pmc(int cpu, int ri)
 
 	wrmsr(UCF_CTRL, ucfc->pc_ucfctrl);
 
-	do {
-		ucfc->pc_resync = 0;
-		ucfc->pc_globalctrl |= (1ULL << (ri + SELECTOFF(uncore_cputype)));
-		wrmsr(UC_GLOBAL_CTRL, ucfc->pc_globalctrl);
-	} while (ucfc->pc_resync != 0);
+	ucfc->pc_globalctrl |= (1ULL << (ri + SELECTOFF(uncore_cputype)));
+	wrmsr(UC_GLOBAL_CTRL, ucfc->pc_globalctrl);
 
 	PMCDBG4(MDP,STA,1,"ucfctrl=%x(%x) globalctrl=%jx(%jx)",
 	    ucfc->pc_ucfctrl, (uint32_t) rdmsr(UCF_CTRL),
@@ -373,11 +369,8 @@ ucf_stop_pmc(int cpu, int ri)
 	PMCDBG1(MDP,STO,1,"ucf-stop ucfctrl=%x", ucfc->pc_ucfctrl);
 	wrmsr(UCF_CTRL, ucfc->pc_ucfctrl);
 
-	do {
-		ucfc->pc_resync = 0;
-		ucfc->pc_globalctrl &= ~(1ULL << (ri + SELECTOFF(uncore_cputype)));
-		wrmsr(UC_GLOBAL_CTRL, ucfc->pc_globalctrl);
-	} while (ucfc->pc_resync != 0);
+	ucfc->pc_globalctrl &= ~(1ULL << (ri + SELECTOFF(uncore_cputype)));
+	wrmsr(UC_GLOBAL_CTRL, ucfc->pc_globalctrl);
 
 	PMCDBG4(MDP,STO,1,"ucfctrl=%x(%x) globalctrl=%jx(%jx)",
 	    ucfc->pc_ucfctrl, (uint32_t) rdmsr(UCF_CTRL),
@@ -708,11 +701,8 @@ ucp_start_pmc(int cpu, int ri)
 	}
 	wrmsr(SELECTSEL(uncore_cputype) + ri, evsel);
 
-	do {
-		cc->pc_resync = 0;
-		cc->pc_globalctrl |= (1ULL << ri);
-		wrmsr(UC_GLOBAL_CTRL, cc->pc_globalctrl);
-	} while (cc->pc_resync != 0);
+	cc->pc_globalctrl |= (1ULL << ri);
+	wrmsr(UC_GLOBAL_CTRL, cc->pc_globalctrl);
 
 	return (0);
 }
@@ -740,11 +730,8 @@ ucp_stop_pmc(int cpu, int ri)
 	/* stop hw. */
 	wrmsr(SELECTSEL(uncore_cputype) + ri, 0);
 
-	do {
-		cc->pc_resync = 0;
-		cc->pc_globalctrl &= ~(1ULL << ri);
-		wrmsr(UC_GLOBAL_CTRL, cc->pc_globalctrl);
-	} while (cc->pc_resync != 0);
+	cc->pc_globalctrl &= ~(1ULL << ri);
+	wrmsr(UC_GLOBAL_CTRL, cc->pc_globalctrl);
 
 	return (0);
 }



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