[PATCH 15/16] tpm/tpm_i2c_stm_st33: Add delay before release_locality to make sure irq are cleared

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




In order to manage irq, locality must be active. As Status Ready interrupt is activated,
when going back into ready state with the cancel function, we need to add a little delay
to make sure the irq is going to be serviced before the release_locality is hit.

Signed-off-by: Christophe Ricard <christophe-h.ricard@xxxxxx>
---
 drivers/char/tpm/tpm_i2c_stm_st33.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/char/tpm/tpm_i2c_stm_st33.c b/drivers/char/tpm/tpm_i2c_stm_st33.c
index de9f12e..4c78845 100644
--- a/drivers/char/tpm/tpm_i2c_stm_st33.c
+++ b/drivers/char/tpm/tpm_i2c_stm_st33.c
@@ -509,6 +509,7 @@ static int tpm_stm_i2c_send(struct tpm_chip *chip, unsigned char *buf,
 	return len;
 out_err:
 	tpm_stm_i2c_cancel(chip);
+	usleep_range(100, 250);
 	release_locality(chip);
 	return r;
 }
@@ -557,6 +558,7 @@ static int tpm_stm_i2c_recv(struct tpm_chip *chip, unsigned char *buf,
 
 out:
 	chip->ops->cancel(chip);
+	usleep_range(100, 250);
 	release_locality(chip);
 	return size;
 }
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux