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

From: Michael Ellerman
Date: Mon Jun 26 2017 - 08:27:09 EST


Madhavan Srinivasan <maddy@xxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxxxxx>
> ---
> 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