Skip to content

Make ETM register accesses consistent with sysreg.h

James Clark linux-arm-kernel lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 22 repliesIn review
  2. v215 patches 10 repliesSuperseded
  3. v115 patches 6 repliesSuperseded

Changes in v3 from the cover letter

* Implement Mike's suggestion of not having _SHIFT and using the existing FIELD_GET and FIELD_PREP methods.
* Dropped the change to add the new REG_VAL macro because of the above.
* FIELD_PREP could be used in some trivial cases, but in some cases the shift is still required but can be calculated with __bf_shf
* Improved the commit messages.
* The change is still binary equivalent, but requires an extra step mentioned at the end of this cover letter.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15coresight: etm4x: Cleanup TRCIDR0 register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x.h+21 -281 reply
2/15coresight: etm4x: Cleanup TRCIDR2 register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x.h+7 -31 reply
3/15coresight: etm4x: Cleanup TRCIDR3 register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x.h+20 -301 reply
4/15coresight: etm4x: Cleanup TRCIDR4 register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x.h+14 -61 reply
5/15coresight: etm4x: Cleanup TRCIDR5 register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x.h+13 -121 reply
6/15coresight: etm4x: Cleanup TRCCONFIGR register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+44 -301 reply
7/15coresight: etm4x: Cleanup TRCEVENTCTL1R register accessesdrivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+23 -101 reply
8/15coresight: etm4x: Cleanup TRCSTALLCTLR register accessesdrivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+10 -61 reply
9/15coresight: etm4x: Cleanup TRCVICTLR register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+31 -373 replies
10/15coresight: etm3x: Cleanup ETMTECR1 register accessesdrivers/hwtracing/coresight/coresight-etm3x-core.c drivers/hwtracing/coresight/coresight-etm3x-sysfs.c+2 -21 reply
11/15coresight: etm4x: Cleanup TRCACATRn register accessesdrivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+31 -251 reply
12/15coresight: etm4x: Cleanup TRCSSCCRn and TRCSSCSRn register accessesdrivers/hwtracing/coresight/coresight-etm4x-core.c drivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+8 -41 reply
13/15coresight: etm4x: Cleanup TRCSSPCICRn register accessesdrivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+3 -11 reply
14/15coresight: etm4x: Cleanup TRCBBCTLR register accessesdrivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+5 -21 reply
15/15coresight: etm4x: Cleanup TRCRSCTLRn register accessesdrivers/hwtracing/coresight/coresight-etm4x-sysfs.c drivers/hwtracing/coresight/coresight-etm4x.h+12 -22 replies

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

PatchMike Leach
1/15R-b
2/15R-b
3/15R-b
4/15R-b
5/15R-b
6/15R-b
7/15R-b
8/15R-b
9/15R-b
10/15R-b
11/15R-b
12/15R-b
13/15R-b
14/15R-b
15/15R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 00/15] Make ETM register accesses consistent with sysreg.h

Changes since v2:
* Implement Mike's suggestion of not having _SHIFT and using the existing FIELD_GET and FIELD_PREP methods.
* Dropped the change to add the new REG_VAL macro because of the above.
* FIELD_PREP could be used in some trivial cases, but in some cases the shift is still required but can be calculated with __bf_shf
* Improved the commit messages.
* The change is still binary equivalent, but requires an extra step mentioned at the end of this cover letter.

Applies to coresight/next 3619ee28488
Also available at https://gitlab.arm.com/linux-arm/linux-jc/-/tree/james-cs-register-refactor-v3

To check for binary equivalence follow the same steps in the cover letter of v2, but apply the following change to coresight-priv.h. This is because the existing version of the macros wrap the expression in a new scope {} that flips something in the compiler:

  #undef FIELD_GET
  #define FIELD_GET(_mask, _reg) (((_reg) & (_mask)) >> __bf_shf(_mask))
  #undef FIELD_PREP
  #define FIELD_PREP(_mask, _val) (((_val) << __bf_shf(_mask)) & (_mask))

Thanks
James

James Clark (15):
coresight: etm4x: Cleanup TRCIDR0 register accesses
coresight: etm4x: Cleanup TRCIDR2 register accesses
coresight: etm4x: Cleanup TRCIDR3 register accesses
coresight: etm4x: Cleanup TRCIDR4 register accesses
coresight: etm4x: Cleanup TRCIDR5 register accesses
coresight: etm4x: Cleanup TRCCONFIGR register accesses
coresight: etm4x: Cleanup TRCEVENTCTL1R register accesses
coresight: etm4x: Cleanup TRCSTALLCTLR register accesses
coresight: etm4x: Cleanup TRCVICTLR register accesses
coresight: etm3x: Cleanup ETMTECR1 register accesses
coresight: etm4x: Cleanup TRCACATRn register accesses
coresight: etm4x: Cleanup TRCSSCCRn and TRCSSCSRn register accesses
coresight: etm4x: Cleanup TRCSSPCICRn register accesses
coresight: etm4x: Cleanup TRCBBCTLR register accesses
coresight: etm4x: Cleanup TRCRSCTLRn register accesses

 .../coresight/coresight-etm3x-core.c          |   2 +-
 .../coresight/coresight-etm3x-sysfs.c         |   2 +-
 .../coresight/coresight-etm4x-core.c          | 136 +++++--------
 .../coresight/coresight-etm4x-sysfs.c         | 180 +++++++++---------
 drivers/hwtracing/coresight/coresight-etm4x.h | 122 ++++++++++--
 5 files changed, 244 insertions(+), 198 deletions(-)
Signature · 1 line
2.28.0