Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

arm_mpam: Quirk CMN-650's CSU NRDY behaviour

CMN-650 is afflicted with an erratum where the CSU NRDY bit never clears.
This tells us the monitor never finishes scanning the cache. The erratum
document says to wait the maximum time, then ignore the field.

Add a flag to indicate whether this is the final attempt to read the
counter, and when this quirk is applied, ignore the NRDY field.

This means accesses to this counter will always retry, even if the counter
was previously programmed to the same values.

The counter value is not expected to be stable, it drifts up and down with
each allocation and eviction. The CSU register provides the value for a
point in time.

Tested-by: Punit Agrawal <punit.agrawal@oss.qualcomm.com>
Tested-by: Gavin Shan <gshan@redhat.com>
Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
Tested-by: Jesse Chick <jessechick@os.amperecomputing.com>
Reviewed-by: Zeng Heng <zengheng4@huawei.com>
Reviewed-by: Gavin Shan <gshan@redhat.com>
Co-developed-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: Ben Horgan <ben.horgan@arm.com>
Signed-off-by: James Morse <james.morse@arm.com>

+21
+3
Documentation/arch/arm64/silicon-errata.rst
··· 214 214 +----------------+-----------------+-----------------+-----------------------------+ 215 215 | ARM | SI L1 | #4311569 | ARM64_ERRATUM_4311569 | 216 216 +----------------+-----------------+-----------------+-----------------------------+ 217 + | ARM | CMN-650 | #3642720 | N/A | 218 + +----------------+-----------------+-----------------+-----------------------------+ 219 + +----------------+-----------------+-----------------+-----------------------------+ 217 220 | Broadcom | Brahma-B53 | N/A | ARM64_ERRATUM_845719 | 218 221 +----------------+-----------------+-----------------+-----------------------------+ 219 222 | Broadcom | Brahma-B53 | N/A | ARM64_ERRATUM_843419 |
+12
drivers/resctrl/mpam_devices.c
··· 691 691 .iidr_mask = MPAM_IIDR_MATCH_ONE, 692 692 .workaround = T241_MBW_COUNTER_SCALE_64, 693 693 }, 694 + { 695 + /* ARM CMN-650 CSU erratum 3642720 */ 696 + .iidr = MPAM_IIDR_ARM_CMN_650, 697 + .iidr_mask = MPAM_IIDR_MATCH_ONE, 698 + .workaround = IGNORE_CSU_NRDY, 699 + }, 694 700 { NULL } /* Sentinel */ 695 701 }; 696 702 ··· 1009 1003 enum mpam_device_features type; 1010 1004 u64 *val; 1011 1005 int err; 1006 + bool waited_timeout; 1012 1007 }; 1013 1008 1014 1009 static bool mpam_ris_has_mbwu_long_counter(struct mpam_msc_ris *ris) ··· 1256 1249 if (mpam_has_feature(mpam_feat_msmon_csu_hw_nrdy, rprops)) 1257 1250 nrdy = now & MSMON___NRDY; 1258 1251 now = FIELD_GET(MSMON___VALUE, now); 1252 + 1253 + if (mpam_has_quirk(IGNORE_CSU_NRDY, msc) && m->waited_timeout) 1254 + nrdy = false; 1255 + 1259 1256 break; 1260 1257 case mpam_feat_msmon_mbwu_31counter: 1261 1258 case mpam_feat_msmon_mbwu_44counter: ··· 1397 1386 .ctx = ctx, 1398 1387 .type = type, 1399 1388 .val = val, 1389 + .waited_timeout = true, 1400 1390 }; 1401 1391 *val = 0; 1402 1392
+6
drivers/resctrl/mpam_internal.h
··· 226 226 T241_SCRUB_SHADOW_REGS, 227 227 T241_FORCE_MBW_MIN_TO_ONE, 228 228 T241_MBW_COUNTER_SCALE_64, 229 + IGNORE_CSU_NRDY, 229 230 MPAM_QUIRK_LAST 230 231 }; 231 232 ··· 251 250 FIELD_PREP_CONST(MPAMF_IIDR_VARIANT, 0) | \ 252 251 FIELD_PREP_CONST(MPAMF_IIDR_REVISION, 0) | \ 253 252 FIELD_PREP_CONST(MPAMF_IIDR_IMPLEMENTER, 0x36b)) 253 + 254 + #define MPAM_IIDR_ARM_CMN_650 (FIELD_PREP_CONST(MPAMF_IIDR_PRODUCTID, 0) | \ 255 + FIELD_PREP_CONST(MPAMF_IIDR_VARIANT, 0) | \ 256 + FIELD_PREP_CONST(MPAMF_IIDR_REVISION, 0) | \ 257 + FIELD_PREP_CONST(MPAMF_IIDR_IMPLEMENTER, 0x43b)) 254 258 255 259 /* The values for MSMON_CFG_MBWU_FLT.RWBW */ 256 260 enum mon_filter_options {