remarkable-linux/drivers/char/tpm
Jason Gunthorpe 4e26195f24 tpm: Provide strong locking for device removal
Add a read/write semaphore around the ops function pointers so
ops can be set to null when the driver un-registers.

Previously the tpm core expected module locking to be enough to
ensure that tpm_unregister could not be called during certain times,
however that hasn't been sufficient for a long time.

Introduce a read/write semaphore around 'ops' so the core can set
it to null when unregistering. This provides a strong fence around
the driver callbacks, guaranteeing to the driver that no callbacks
are running or will run again.

For now the ops_lock is placed very high in the call stack, it could
be pushed down and made more granular in future if necessary.

Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Reviewed-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2016-06-25 17:26:35 +03:00
..
st33zp24 tpm/st33zp24/spi: Change xxx_request_resources header 2016-06-25 17:26:35 +03:00
Kconfig tpm: Update KConfig text to include TPM2.0 FIFO chips 2015-03-18 22:43:07 +01:00
Makefile tpm/tpm_i2c_stm_st33: Split tpm_i2c_tpm_st33 in 2 layers (core + phy) 2015-03-18 22:43:06 +01:00
tpm-chip.c tpm: Provide strong locking for device removal 2016-06-25 17:26:35 +03:00
tpm-dev.c tpm: Provide strong locking for device removal 2016-06-25 17:26:35 +03:00
tpm-interface.c tpm: Provide strong locking for device removal 2016-06-25 17:26:35 +03:00
tpm-sysfs.c tpm: Provide strong locking for device removal 2016-06-25 17:26:35 +03:00
tpm.h tpm: Provide strong locking for device removal 2016-06-25 17:26:35 +03:00
tpm2-cmd.c tpm: Get rid of chip->pdev 2016-06-25 17:26:35 +03:00
tpm_acpi.c ACPI: Clean up acpi_os_map/unmap_memory() to eliminate __iomem. 2014-05-27 18:13:08 +02:00
tpm_atmel.c tpm: Get rid of chip->pdev 2016-06-25 17:26:35 +03:00
tpm_atmel.h
tpm_crb.c tpm_crb: tpm2_shutdown() must be called before tpm_chip_unregister() 2016-02-20 09:59:33 +02:00
tpm_eventlog.c tpm: Get rid of devname 2016-06-25 17:26:35 +03:00
tpm_eventlog.h tpm: Get rid of devname 2016-06-25 17:26:35 +03:00
tpm_i2c_atmel.c tpm: Get rid of chip->pdev 2016-06-25 17:26:35 +03:00
tpm_i2c_infineon.c tpm: Get rid of chip->pdev 2016-06-25 17:26:35 +03:00
tpm_i2c_nuvoton.c tpm: Get rid of devname 2016-06-25 17:26:35 +03:00
tpm_ibmvtpm.c tpm_ibmvtpm: properly handle interrupted packet receptions 2015-12-20 15:27:12 +02:00
tpm_ibmvtpm.h tpm_ibmvtpm: properly handle interrupted packet receptions 2015-12-20 15:27:12 +02:00
tpm_infineon.c tpm: Get rid of chip->pdev 2016-06-25 17:26:35 +03:00
tpm_nsc.c tpm: Get rid of chip->pdev 2016-06-25 17:26:35 +03:00
tpm_of.c TPM: Avoid reference to potentially freed memory 2015-11-09 17:52:55 +02:00
tpm_ppi.c tpm: move the PPI attributes to character device directory. 2015-10-19 01:01:20 +02:00
tpm_tis.c tpm: Get rid of devname 2016-06-25 17:26:35 +03:00
xen-tpmfront.c xenbus_client: Extend interface to support multi-page ring 2015-04-15 10:56:47 +01:00