diff options
author | Jiri Kosina <jkosina@suse.cz> | 2012-02-29 04:29:23 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-03-05 08:06:59 -0500 |
commit | 4e70daaf05a181b6968e29e72e9f1c16a183e92c (patch) | |
tree | 34001ce04cbc2476eab137483cdb42e084ac44cf /drivers/char/tpm/tpm_tis.c | |
parent | c3363c912ba743e6f981ba58c744e413fc41f943 (diff) |
tpm_tis: fix tis_lock with respect to RCU
cleanup_tis() -> tpm_remove_hardware() -> syncrhonize_rcu() is being
called in an atomic context (tis_lock spinlock held), which is not
allowed. Convert tis_lock to mutex.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Tested-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Acked-by: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Diffstat (limited to 'drivers/char/tpm/tpm_tis.c')
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index a1748621111b..70fac9abb0e2 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -76,7 +76,7 @@ enum tis_defaults { | |||
76 | #define TPM_RID(l) (0x0F04 | ((l) << 12)) | 76 | #define TPM_RID(l) (0x0F04 | ((l) << 12)) |
77 | 77 | ||
78 | static LIST_HEAD(tis_chips); | 78 | static LIST_HEAD(tis_chips); |
79 | static DEFINE_SPINLOCK(tis_lock); | 79 | static DEFINE_MUTEX(tis_lock); |
80 | 80 | ||
81 | #if defined(CONFIG_PNP) && defined(CONFIG_ACPI) | 81 | #if defined(CONFIG_PNP) && defined(CONFIG_ACPI) |
82 | static int is_itpm(struct pnp_dev *dev) | 82 | static int is_itpm(struct pnp_dev *dev) |
@@ -689,9 +689,9 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
689 | } | 689 | } |
690 | 690 | ||
691 | INIT_LIST_HEAD(&chip->vendor.list); | 691 | INIT_LIST_HEAD(&chip->vendor.list); |
692 | spin_lock(&tis_lock); | 692 | mutex_lock(&tis_lock); |
693 | list_add(&chip->vendor.list, &tis_chips); | 693 | list_add(&chip->vendor.list, &tis_chips); |
694 | spin_unlock(&tis_lock); | 694 | mutex_unlock(&tis_lock); |
695 | 695 | ||
696 | 696 | ||
697 | return 0; | 697 | return 0; |
@@ -855,7 +855,7 @@ static void __exit cleanup_tis(void) | |||
855 | { | 855 | { |
856 | struct tpm_vendor_specific *i, *j; | 856 | struct tpm_vendor_specific *i, *j; |
857 | struct tpm_chip *chip; | 857 | struct tpm_chip *chip; |
858 | spin_lock(&tis_lock); | 858 | mutex_lock(&tis_lock); |
859 | list_for_each_entry_safe(i, j, &tis_chips, list) { | 859 | list_for_each_entry_safe(i, j, &tis_chips, list) { |
860 | chip = to_tpm_chip(i); | 860 | chip = to_tpm_chip(i); |
861 | tpm_remove_hardware(chip->dev); | 861 | tpm_remove_hardware(chip->dev); |
@@ -871,7 +871,7 @@ static void __exit cleanup_tis(void) | |||
871 | iounmap(i->iobase); | 871 | iounmap(i->iobase); |
872 | list_del(&i->list); | 872 | list_del(&i->list); |
873 | } | 873 | } |
874 | spin_unlock(&tis_lock); | 874 | mutex_unlock(&tis_lock); |
875 | #ifdef CONFIG_PNP | 875 | #ifdef CONFIG_PNP |
876 | if (!force) { | 876 | if (!force) { |
877 | pnp_unregister_driver(&tis_pnp_driver); | 877 | pnp_unregister_driver(&tis_pnp_driver); |