* [PATCH v3] char: tpm: move to use request_irq by IRQF_NO_AUTOEN flag
@ 2021-05-19 6:49 Tian Tao
2021-05-20 16:33 ` Jarkko Sakkinen
0 siblings, 1 reply; 3+ messages in thread
From: Tian Tao @ 2021-05-19 6:49 UTC (permalink / raw)
To: peterhuewe, jarkko; +Cc: linux-integrity, Tian Tao
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable because of requesting.
Link: https://lore.kernel.org/patchwork/patch/1388765/
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
v2: add the Link.
v3: put sob last.
---
drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
index f19c227..44dde2f 100644
--- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
+++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
@@ -706,14 +706,14 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client,
if (client->irq > 0) {
rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
- IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+ IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
+ IRQF_NO_AUTOEN,
dev->driver->name, chip);
if (rc < 0) {
dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
return rc;
}
- disable_irq(client->irq);
priv->irq = client->irq;
} else {
dev_warn(dev, "No IRQ, will use %ums delay for TPM ready\n",
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] char: tpm: move to use request_irq by IRQF_NO_AUTOEN flag
2021-05-19 6:49 [PATCH v3] char: tpm: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
@ 2021-05-20 16:33 ` Jarkko Sakkinen
2021-05-21 0:52 ` tiantao (H)
0 siblings, 1 reply; 3+ messages in thread
From: Jarkko Sakkinen @ 2021-05-20 16:33 UTC (permalink / raw)
To: Tian Tao; +Cc: peterhuewe, linux-integrity
On Wed, May 19, 2021 at 02:49:59PM +0800, Tian Tao wrote:
> disable_irq() after request_irq() still has a time gap in which
> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
> disable IRQ auto-enable because of requesting.
>
> Link: https://lore.kernel.org/patchwork/patch/1388765/
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
> v2: add the Link.
> v3: put sob last.
> ---
> drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> index f19c227..44dde2f 100644
> --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
> +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
> @@ -706,14 +706,14 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client,
>
> if (client->irq > 0) {
> rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
> - IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
> + IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
> + IRQF_NO_AUTOEN,
> dev->driver->name, chip);
> if (rc < 0) {
> dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
> return rc;
> }
>
> - disable_irq(client->irq);
> priv->irq = client->irq;
> } else {
> dev_warn(dev, "No IRQ, will use %ums delay for TPM ready\n",
> --
> 2.7.4
>
>
How does this differ from
https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/commit/?id=da2f0c7b46171175ab54da248752b1139c42fee4
?
/Jarkko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] char: tpm: move to use request_irq by IRQF_NO_AUTOEN flag
2021-05-20 16:33 ` Jarkko Sakkinen
@ 2021-05-21 0:52 ` tiantao (H)
0 siblings, 0 replies; 3+ messages in thread
From: tiantao (H) @ 2021-05-21 0:52 UTC (permalink / raw)
To: Jarkko Sakkinen, Tian Tao; +Cc: peterhuewe, linux-integrity
在 2021/5/21 0:33, Jarkko Sakkinen 写道:
> On Wed, May 19, 2021 at 02:49:59PM +0800, Tian Tao wrote:
>> disable_irq() after request_irq() still has a time gap in which
>> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
>> disable IRQ auto-enable because of requesting.
>>
>> Link: https://lore.kernel.org/patchwork/patch/1388765/
>> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
>> ---
>> v2: add the Link.
>> v3: put sob last.
>> ---
>> drivers/char/tpm/tpm_tis_i2c_cr50.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm_tis_i2c_cr50.c b/drivers/char/tpm/tpm_tis_i2c_cr50.c
>> index f19c227..44dde2f 100644
>> --- a/drivers/char/tpm/tpm_tis_i2c_cr50.c
>> +++ b/drivers/char/tpm/tpm_tis_i2c_cr50.c
>> @@ -706,14 +706,14 @@ static int tpm_cr50_i2c_probe(struct i2c_client *client,
>>
>> if (client->irq > 0) {
>> rc = devm_request_irq(dev, client->irq, tpm_cr50_i2c_int_handler,
>> - IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
>> + IRQF_TRIGGER_FALLING | IRQF_ONESHOT |
>> + IRQF_NO_AUTOEN,
>> dev->driver->name, chip);
>> if (rc < 0) {
>> dev_err(dev, "Failed to probe IRQ %d\n", client->irq);
>> return rc;
>> }
>>
>> - disable_irq(client->irq);
>> priv->irq = client->irq;
>> } else {
>> dev_warn(dev, "No IRQ, will use %ums delay for TPM ready\n",
>> --
>> 2.7.4
>>
>>
> How does this differ from
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git/commit/?id=da2f0c7b46171175ab54da248752b1139c42fee4
> ?
There is no difference, except that this patch was not merged into 5.12,
so it was resent once in 5.13
> /Jarkko
> .
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-21 0:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-19 6:49 [PATCH v3] char: tpm: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
2021-05-20 16:33 ` Jarkko Sakkinen
2021-05-21 0:52 ` tiantao (H)
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).