|
119 | 119 | /* The DTC node is where the magic happens */
|
120 | 120 | #define CMN_DT_DTC_CTL 0x0a00
|
121 | 121 | #define CMN_DT_DTC_CTL_DT_EN BIT(0)
|
| 122 | +#define CMN_DT_DTC_CTL_CG_DISABLE BIT(10) |
122 | 123 |
|
123 | 124 | /* DTC counters are paired in 64-bit registers on a 16-byte stride. Yuck */
|
124 | 125 | #define _CMN_DT_CNT_REG(n) ((((n) / 2) * 4 + (n) % 2) * 4)
|
@@ -1546,9 +1547,12 @@ static void arm_cmn_event_start(struct perf_event *event, int flags)
|
1546 | 1547 | int i;
|
1547 | 1548 |
|
1548 | 1549 | if (type == CMN_TYPE_DTC) {
|
1549 |
| - i = hw->dtc_idx[0]; |
1550 |
| - writeq_relaxed(CMN_CC_INIT, cmn->dtc[i].base + CMN_DT_PMCCNTR); |
1551 |
| - cmn->dtc[i].cc_active = true; |
| 1550 | + struct arm_cmn_dtc *dtc = cmn->dtc + hw->dtc_idx[0]; |
| 1551 | + |
| 1552 | + writel_relaxed(CMN_DT_DTC_CTL_DT_EN | CMN_DT_DTC_CTL_CG_DISABLE, |
| 1553 | + dtc->base + CMN_DT_DTC_CTL); |
| 1554 | + writeq_relaxed(CMN_CC_INIT, dtc->base + CMN_DT_PMCCNTR); |
| 1555 | + dtc->cc_active = true; |
1552 | 1556 | } else if (type == CMN_TYPE_WP) {
|
1553 | 1557 | u64 val = CMN_EVENT_WP_VAL(event);
|
1554 | 1558 | u64 mask = CMN_EVENT_WP_MASK(event);
|
@@ -1577,8 +1581,10 @@ static void arm_cmn_event_stop(struct perf_event *event, int flags)
|
1577 | 1581 | int i;
|
1578 | 1582 |
|
1579 | 1583 | if (type == CMN_TYPE_DTC) {
|
1580 |
| - i = hw->dtc_idx[0]; |
1581 |
| - cmn->dtc[i].cc_active = false; |
| 1584 | + struct arm_cmn_dtc *dtc = cmn->dtc + hw->dtc_idx[0]; |
| 1585 | + |
| 1586 | + dtc->cc_active = false; |
| 1587 | + writel_relaxed(CMN_DT_DTC_CTL_DT_EN, dtc->base + CMN_DT_DTC_CTL); |
1582 | 1588 | } else if (type == CMN_TYPE_WP) {
|
1583 | 1589 | for_each_hw_dn(hw, dn, i) {
|
1584 | 1590 | void __iomem *base = dn->pmu_base + CMN_DTM_OFFSET(hw->dtm_offset);
|
|
0 commit comments