···287287 * @dev: device to which the chip is associated.288288 *289289 * Issues a TPM2_Shutdown command prior to loss of power, as required by the290290- * TPM 2.0 spec.291291- * Then, calls bus- and device- specific shutdown code.290290+ * TPM 2.0 spec. Then, calls bus- and device- specific shutdown code.292291 *293293- * XXX: This codepath relies on the fact that sysfs is not enabled for294294- * TPM2: sysfs uses an implicit lock on chip->ops, so this could race if TPM2295295- * has sysfs support enabled before TPM sysfs's implicit locking is fixed.292292+ * Return: always 0 (i.e. success)296293 */297294static int tpm_class_shutdown(struct device *dev)298295{
-7
drivers/char/tpm/tpm-sysfs.c
···329329330330void tpm_sysfs_add_device(struct tpm_chip *chip)331331{332332- /* XXX: If you wish to remove this restriction, you must first update333333- * tpm_sysfs to explicitly lock chip->ops.334334- */335332 if (chip->flags & TPM_CHIP_FLAG_TPM2)336333 return;337334338338- /* The sysfs routines rely on an implicit tpm_try_get_ops, device_del339339- * is called before ops is null'd and the sysfs core synchronizes this340340- * removal so that no callbacks are running or can run again341341- */342335 WARN_ON(chip->groups_cnt != 0);343336 chip->groups[chip->groups_cnt++] = &tpm_dev_group;344337}