Re: [PATCH v2] tpm: Add explicit chip->ops locking for sysfs attributes.

From: Jason Gunthorpe
Date: Thu Nov 16 2017 - 19:21:19 EST


On Thu, Nov 16, 2017 at 01:40:54PM -0800, Guenter Roeck wrote:
> Add explicit chip->ops locking for all sysfs attributes.
> This lets us support those attributes on tpm2 devices.
>
> Signed-off-by: Guenter Roeck <linux@xxxxxxxxxxxx>
> v2: It makes sense to actually compile the code.
>
> drivers/char/tpm/tpm-chip.c | 4 --
> drivers/char/tpm/tpm-sysfs.c | 127 ++++++++++++++++++++++++++++++++-----------
> 2 files changed, 94 insertions(+), 37 deletions(-)

I haven't exhaustively checked this, but as the originator of the
comment, this looks broadly like the right approach to me.

Cheers,
Jason