linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm: Revert "tpm: fix invalid locking in NONBLOCKING mode"
@ 2020-05-26 18:32 Mario Limonciello
  2020-05-26 19:14 ` James Bottomley
  0 siblings, 1 reply; 20+ messages in thread
From: Mario Limonciello @ 2020-05-26 18:32 UTC (permalink / raw)
  To: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe
  Cc: Arnd Bergmann, Greg Kroah-Hartman, linux-integrity, linux-kernel,
	Mario Limonciello, Jeffrin Jose T, Alex Guzman

This reverts commit d23d12484307b40eea549b8a858f5fffad913897.

This commit has caused regressions for the XPS 9560 containing
a Nuvoton TPM.

As mentioned by the reporter all TPM2 commands are failing with:
  ERROR:tcti:src/tss2-tcti/tcti-device.c:290:tcti_device_receive()
  Failed to read response from fd 3, got errno 1: Operation not permitted

The reporter bisected this issue back to this commit which was
backported to stable as commit 4d6ebc4.

Cc: Jeffrin Jose T <jeffrin@rajagiritech.edu.in>
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206275
Fixes: d23d124 ("tpm: fix invalid locking in NONBLOCKING mode")
Reported-by: Alex Guzman <alex@guzman.io>
Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/char/tpm/tpm-dev-common.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c
index 87f449340202..bc9d7c7ddc01 100644
--- a/drivers/char/tpm/tpm-dev-common.c
+++ b/drivers/char/tpm/tpm-dev-common.c
@@ -61,12 +61,6 @@ static void tpm_dev_async_work(struct work_struct *work)
 
 	mutex_lock(&priv->buffer_mutex);
 	priv->command_enqueued = false;
-	ret = tpm_try_get_ops(priv->chip);
-	if (ret) {
-		priv->response_length = ret;
-		goto out;
-	}
-
 	ret = tpm_dev_transmit(priv->chip, priv->space, priv->data_buffer,
 			       sizeof(priv->data_buffer));
 	tpm_put_ops(priv->chip);
@@ -74,7 +68,6 @@ static void tpm_dev_async_work(struct work_struct *work)
 		priv->response_length = ret;
 		mod_timer(&priv->user_read_timer, jiffies + (120 * HZ));
 	}
-out:
 	mutex_unlock(&priv->buffer_mutex);
 	wake_up_interruptible(&priv->async_wait);
 }
@@ -211,7 +204,6 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf,
 	if (file->f_flags & O_NONBLOCK) {
 		priv->command_enqueued = true;
 		queue_work(tpm_dev_wq, &priv->async_work);
-		tpm_put_ops(priv->chip);
 		mutex_unlock(&priv->buffer_mutex);
 		return size;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-05-28  6:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 18:32 [PATCH] tpm: Revert "tpm: fix invalid locking in NONBLOCKING mode" Mario Limonciello
2020-05-26 19:14 ` James Bottomley
2020-05-26 19:23   ` Mario.Limonciello
2020-05-26 19:38     ` James Bottomley
2020-05-26 22:19       ` Alex Guzman
2020-05-26 23:06         ` James Bottomley
2020-05-26 23:31           ` Alex Guzman
2020-05-27  0:18             ` James Bottomley
2020-05-27 20:09       ` Jarkko Sakkinen
2020-05-27 20:18         ` Mario.Limonciello
2020-05-28  0:43           ` Jarkko Sakkinen
2020-05-28  0:59             ` Mario.Limonciello
2020-05-28  6:53               ` Jarkko Sakkinen
2020-05-26 19:39   ` Tadeusz Struk
2020-05-26 20:00     ` James Bottomley
2020-05-26 21:33       ` Tadeusz Struk
2020-05-26 22:34         ` Alex Guzman
2020-05-28  0:30     ` Jarkko Sakkinen
2020-05-28  4:40       ` Tadeusz Struk
2020-05-28  6:55         ` Jarkko Sakkinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).