mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qunqin Zhao <zhaoqunqin@loongson.cn>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: lee@kernel.org, herbert@gondor.apana.org.au, jarkko@kernel.org,
	linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
	davem@davemloft.net, linux-crypto@vger.kernel.org,
	peterhuewe@gmx.de, jgg@ziepe.ca, linux-integrity@vger.kernel.org,
	Yinggang Gu <guyinggang@loongson.cn>,
	Huacai Chen <chenhuacai@loongson.cn>
Subject: Re: [PATCH v10 4/5] tpm: Add a driver for Loongson TPM device
Date: Wed, 28 May 2025 16:42:05 +0800	[thread overview]
Message-ID: <afaeb91a-afb4-428a-2c17-3ea5f098da22@loongson.cn> (raw)
In-Reply-To: <7ifsmhpubkedbiivcnfrxlrhriti5ksb4lbgrdwhwfxtp5ledc@z2jf6sz4vdgd>


在 2025/5/28 下午3:57, Stefano Garzarella 写道:
>> +    chip = tpmm_chip_alloc(dev, &tpm_loongson_ops);
>> +    if (IS_ERR(chip))
>> +        return PTR_ERR(chip);
>> +    chip->flags = TPM_CHIP_FLAG_TPM2 | TPM_CHIP_FLAG_IRQ;
>
> Why setting TPM_CHIP_FLAG_IRQ?

When tpm_engine completes  TPM_CC* command,

the hardware will indeed trigger an interrupt to the kernel.

>
> IIUC this driver is similar to ftpm and svsm where the send is 
> synchronous so having .status, .cancel, etc. set to 0 should be enough 
> to call .recv() just after send() in tpm_try_transmit(). See commit 
> 980a573621ea ("tpm: Make chip->{status,cancel,req_canceled} opt")
The send callback would wait until the TPM_CC* command complete. We 
don't need a poll.

Thanks,

Qunqin.

>
> BTW, I think I should touch also this driver in the next version of my 
> series that I'll send after the merge window:
> https://lore.kernel.org/linux-integrity/20250514134630.137621-1-sgarzare@redhat.com/ 
>
>
> The rest LGTM!
>
> Thanks,
> Stefano


  reply	other threads:[~2025-05-28  8:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-28  6:59 [PATCH v10 0/5] Add Loongson Security Engine chip driver Qunqin Zhao
2025-05-28  6:59 ` [PATCH v10 1/5] mfd: Add support for Loongson Security Engine chip controller Qunqin Zhao
2025-05-28  6:59 ` [PATCH v10 2/5] crypto: loongson - add Loongson RNG driver support Qunqin Zhao
2025-06-11  9:23   ` Herbert Xu
2025-06-17  9:49     ` Qunqin Zhao
2025-05-28  6:59 ` [PATCH v10 3/5] MAINTAINERS: Add entry for Loongson crypto driver Qunqin Zhao
2025-05-28  6:59 ` [PATCH v10 4/5] tpm: Add a driver for Loongson TPM device Qunqin Zhao
2025-05-28  7:57   ` Stefano Garzarella
2025-05-28  8:42     ` Qunqin Zhao [this message]
2025-05-28  9:00       ` Stefano Garzarella
2025-05-28  9:24         ` Qunqin Zhao
2025-05-28  9:34           ` Qunqin Zhao
2025-05-28  9:53             ` Stefano Garzarella
2025-05-29  2:16               ` Qunqin Zhao
2025-05-28  9:36           ` Stefano Garzarella
2025-05-28  7:17 ` [PATCH v10 0/5] Add Loongson Security Engine chip driver Huacai Chen
2025-05-28  7:42   ` Yanteng Si
2025-05-28  8:05   ` Qunqin Zhao
2025-05-28  8:17     ` Huacai Chen
2025-05-28  9:14       ` Yanteng Si
2025-05-28 10:25         ` Huacai Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afaeb91a-afb4-428a-2c17-3ea5f098da22@loongson.cn \
    --to=zhaoqunqin@loongson.cn \
    --cc=chenhuacai@loongson.cn \
    --cc=davem@davemloft.net \
    --cc=guyinggang@loongson.cn \
    --cc=herbert@gondor.apana.org.au \
    --cc=jarkko@kernel.org \
    --cc=jgg@ziepe.ca \
    --cc=lee@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=peterhuewe@gmx.de \
    --cc=sgarzare@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®