[PATCH] powerpc/sysfs: Expose MMCR2 spr in sysfs

Michael Ellerman mpe at ellerman.id.au
Mon Jun 26 22:26:39 AEST 2017


Madhavan Srinivasan <maddy at linux.vnet.ibm.com> writes:

> Monitor Mode Control Register 2 (MMCR2) is a 64-bit
> register that contains 9-bit control fields for
> controlling the operation of PMC1 - PMC6. Patch
> to expose the MMCR2 spr in sysfs.
>
> Signed-off-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>
> ---
>  arch/powerpc/kernel/sysfs.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
> index 4437c70c7c2b..587eb3a7b5da 100644
> --- a/arch/powerpc/kernel/sysfs.c
> +++ b/arch/powerpc/kernel/sysfs.c
> @@ -482,6 +482,7 @@ SYSFS_PMCSETUP(pmc7, SPRN_PMC7);
>  SYSFS_PMCSETUP(pmc8, SPRN_PMC8);
>  
>  SYSFS_PMCSETUP(mmcra, SPRN_MMCRA);
> +SYSFS_PMCSETUP(mmcr2, SPRN_MMCR2);

We already have it under an #ifdef:

#ifdef HAS_PPC_PMC_G4
SYSFS_PMCSETUP(mmcr2, SPRN_MMCR2);
#endif


Can you reuse that somehow, or rework the #ifdefs.

cheers


More information about the Linuxppc-dev mailing list