* [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
@ 2025-09-17 17:09 Nathan Chancellor
2025-09-18 1:50 ` Qunqin Zhao
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Nathan Chancellor @ 2025-09-17 17:09 UTC (permalink / raw)
To: Lee Jones, Qunqin Zhao, Yinggang Gu, Huacai Chen
Cc: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
linux-kernel, Nathan Chancellor
Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
in the .send callback"), as the former change was developed against a
tree without the latter change. This results in a build error:
drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int, long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
48 | .send = tpm_loongson_send,
| ^~~~~~~~~~~~~~~~~
drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
| ^~~~~~~~~~~~~~~~~
Add the expected bufsiz parameter to tpm_loongson_send() to resolve the
error.
Fixes: 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
This is in Lee's ib-mfd-char-crypto-6.18 [1] so he will need to take it
but I have CC'd the TPM folks as an FYI.
[1]: https://lore.kernel.org/20250902124205.GL2163762@google.com/
---
drivers/char/tpm/tpm_loongson.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_loongson.c b/drivers/char/tpm/tpm_loongson.c
index a4ec23639911..9e50250763d1 100644
--- a/drivers/char/tpm/tpm_loongson.c
+++ b/drivers/char/tpm/tpm_loongson.c
@@ -28,7 +28,7 @@ static int tpm_loongson_recv(struct tpm_chip *chip, u8 *buf, size_t count)
return cmd_ret->data_len;
}
-static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
+static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t count)
{
struct loongson_se_engine *tpm_engine = dev_get_drvdata(&chip->dev);
struct tpm_loongson_cmd *cmd = tpm_engine->command;
---
base-commit: 74fddd5fbab879a7d039d9fb49af923927a64811
change-id: 20250917-tpm-loongson-add-bufsiz-e43f60016cca
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
2025-09-17 17:09 [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send() Nathan Chancellor
@ 2025-09-18 1:50 ` Qunqin Zhao
2025-09-18 15:56 ` Jarkko Sakkinen
2025-09-25 11:46 ` (subset) " Lee Jones
2 siblings, 0 replies; 6+ messages in thread
From: Qunqin Zhao @ 2025-09-18 1:50 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Lee Jones, Yinggang Gu, Huacai Chen, Peter Huewe, Jarkko Sakkinen,
Jason Gunthorpe, linux-integrity, linux-kernel
在 2025/9/18 上午1:09, Nathan Chancellor 写道:
> Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
> semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
> in the .send callback"), as the former change was developed against a
> tree without the latter change. This results in a build error:
>
> drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int, long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
> 48 | .send = tpm_loongson_send,
> | ^~~~~~~~~~~~~~~~~
> drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
> drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
> 31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> | ^~~~~~~~~~~~~~~~~
>
> Add the expected bufsiz parameter to tpm_loongson_send() to resolve the
> error.
This means a lot. Thanks
Best regards,
Qunqin.
>
> Fixes: 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> This is in Lee's ib-mfd-char-crypto-6.18 [1] so he will need to take it
> but I have CC'd the TPM folks as an FYI.
>
> [1]: https://lore.kernel.org/20250902124205.GL2163762@google.com/
> ---
> drivers/char/tpm/tpm_loongson.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/tpm_loongson.c b/drivers/char/tpm/tpm_loongson.c
> index a4ec23639911..9e50250763d1 100644
> --- a/drivers/char/tpm/tpm_loongson.c
> +++ b/drivers/char/tpm/tpm_loongson.c
> @@ -28,7 +28,7 @@ static int tpm_loongson_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> return cmd_ret->data_len;
> }
>
> -static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t count)
> {
> struct loongson_se_engine *tpm_engine = dev_get_drvdata(&chip->dev);
> struct tpm_loongson_cmd *cmd = tpm_engine->command;
>
> ---
> base-commit: 74fddd5fbab879a7d039d9fb49af923927a64811
> change-id: 20250917-tpm-loongson-add-bufsiz-e43f60016cca
>
> Best regards,
> --
> Nathan Chancellor <nathan@kernel.org>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
2025-09-17 17:09 [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send() Nathan Chancellor
2025-09-18 1:50 ` Qunqin Zhao
@ 2025-09-18 15:56 ` Jarkko Sakkinen
2025-09-18 15:57 ` Jarkko Sakkinen
2025-09-25 11:46 ` (subset) " Lee Jones
2 siblings, 1 reply; 6+ messages in thread
From: Jarkko Sakkinen @ 2025-09-18 15:56 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Lee Jones, Qunqin Zhao, Yinggang Gu, Huacai Chen, Peter Huewe,
Jason Gunthorpe, linux-integrity, linux-kernel
On Wed, Sep 17, 2025 at 10:09:00AM -0700, Nathan Chancellor wrote:
> Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
> semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
> in the .send callback"), as the former change was developed against a
> tree without the latter change. This results in a build error:
>
> drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int, long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
> 48 | .send = tpm_loongson_send,
> | ^~~~~~~~~~~~~~~~~
> drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
> drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
> 31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> | ^~~~~~~~~~~~~~~~~
>
> Add the expected bufsiz parameter to tpm_loongson_send() to resolve the
> error.
>
> Fixes: 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> This is in Lee's ib-mfd-char-crypto-6.18 [1] so he will need to take it
> but I have CC'd the TPM folks as an FYI.
>
> [1]: https://lore.kernel.org/20250902124205.GL2163762@google.com/
> ---
> drivers/char/tpm/tpm_loongson.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/tpm_loongson.c b/drivers/char/tpm/tpm_loongson.c
> index a4ec23639911..9e50250763d1 100644
> --- a/drivers/char/tpm/tpm_loongson.c
> +++ b/drivers/char/tpm/tpm_loongson.c
> @@ -28,7 +28,7 @@ static int tpm_loongson_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> return cmd_ret->data_len;
> }
>
> -static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> +static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t count)
> {
> struct loongson_se_engine *tpm_engine = dev_get_drvdata(&chip->dev);
> struct tpm_loongson_cmd *cmd = tpm_engine->command;
>
> ---
> base-commit: 74fddd5fbab879a7d039d9fb49af923927a64811
> change-id: 20250917-tpm-loongson-add-bufsiz-e43f60016cca
>
> Best regards,
> --
> Nathan Chancellor <nathan@kernel.org>
>
Thank you I applied and it's still in time for first 6.18 PR.
BR, Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
2025-09-18 15:56 ` Jarkko Sakkinen
@ 2025-09-18 15:57 ` Jarkko Sakkinen
0 siblings, 0 replies; 6+ messages in thread
From: Jarkko Sakkinen @ 2025-09-18 15:57 UTC (permalink / raw)
To: Nathan Chancellor
Cc: Lee Jones, Qunqin Zhao, Yinggang Gu, Huacai Chen, Peter Huewe,
Jason Gunthorpe, linux-integrity, linux-kernel
On Thu, Sep 18, 2025 at 06:56:23PM +0300, Jarkko Sakkinen wrote:
> On Wed, Sep 17, 2025 at 10:09:00AM -0700, Nathan Chancellor wrote:
> > Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
> > semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
> > in the .send callback"), as the former change was developed against a
> > tree without the latter change. This results in a build error:
> >
> > drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int, long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
> > 48 | .send = tpm_loongson_send,
> > | ^~~~~~~~~~~~~~~~~
> > drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
> > drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
> > 31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> > | ^~~~~~~~~~~~~~~~~
> >
> > Add the expected bufsiz parameter to tpm_loongson_send() to resolve the
> > error.
> >
> > Fixes: 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > ---
> > This is in Lee's ib-mfd-char-crypto-6.18 [1] so he will need to take it
> > but I have CC'd the TPM folks as an FYI.
> >
> > [1]: https://lore.kernel.org/20250902124205.GL2163762@google.com/
> > ---
> > drivers/char/tpm/tpm_loongson.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/char/tpm/tpm_loongson.c b/drivers/char/tpm/tpm_loongson.c
> > index a4ec23639911..9e50250763d1 100644
> > --- a/drivers/char/tpm/tpm_loongson.c
> > +++ b/drivers/char/tpm/tpm_loongson.c
> > @@ -28,7 +28,7 @@ static int tpm_loongson_recv(struct tpm_chip *chip, u8 *buf, size_t count)
> > return cmd_ret->data_len;
> > }
> >
> > -static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> > +static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t bufsiz, size_t count)
> > {
> > struct loongson_se_engine *tpm_engine = dev_get_drvdata(&chip->dev);
> > struct tpm_loongson_cmd *cmd = tpm_engine->command;
> >
> > ---
> > base-commit: 74fddd5fbab879a7d039d9fb49af923927a64811
> > change-id: 20250917-tpm-loongson-add-bufsiz-e43f60016cca
> >
> > Best regards,
> > --
> > Nathan Chancellor <nathan@kernel.org>
> >
>
> Thank you I applied and it's still in time for first 6.18 PR.
Oops, sorry this is also better to be cycled through looongson tree
instead of mine, anyhow:
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
BR, Jarkko
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
2025-09-17 17:09 [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send() Nathan Chancellor
2025-09-18 1:50 ` Qunqin Zhao
2025-09-18 15:56 ` Jarkko Sakkinen
@ 2025-09-25 11:46 ` Lee Jones
2025-09-25 11:47 ` Lee Jones
2 siblings, 1 reply; 6+ messages in thread
From: Lee Jones @ 2025-09-25 11:46 UTC (permalink / raw)
To: Lee Jones, Qunqin Zhao, Yinggang Gu, Huacai Chen,
Nathan Chancellor
Cc: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
linux-kernel
On Wed, 17 Sep 2025 10:09:00 -0700, Nathan Chancellor wrote:
> Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
> semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
> in the .send callback"), as the former change was developed against a
> tree without the latter change. This results in a build error:
>
> drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int, long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
> 48 | .send = tpm_loongson_send,
> | ^~~~~~~~~~~~~~~~~
> drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
> drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
> 31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> | ^~~~~~~~~~~~~~~~~
>
> [...]
Applied, thanks!
[1/1] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
commit: 39377467669197b02479798f49e3f19344155dc9
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: (subset) [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
2025-09-25 11:46 ` (subset) " Lee Jones
@ 2025-09-25 11:47 ` Lee Jones
0 siblings, 0 replies; 6+ messages in thread
From: Lee Jones @ 2025-09-25 11:47 UTC (permalink / raw)
To: Qunqin Zhao, Yinggang Gu, Huacai Chen, Nathan Chancellor
Cc: Peter Huewe, Jarkko Sakkinen, Jason Gunthorpe, linux-integrity,
linux-kernel
On Thu, 25 Sep 2025, Lee Jones wrote:
> On Wed, 17 Sep 2025 10:09:00 -0700, Nathan Chancellor wrote:
> > Commit 5c83b07df9c5 ("tpm: Add a driver for Loongson TPM device") has a
> > semantic conflict with commit 07d8004d6fb9 ("tpm: add bufsiz parameter
> > in the .send callback"), as the former change was developed against a
> > tree without the latter change. This results in a build error:
> >
> > drivers/char/tpm/tpm_loongson.c:48:17: error: initialization of 'int (*)(struct tpm_chip *, u8 *, size_t, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int, long unsigned int)'} from incompatible pointer type 'int (*)(struct tpm_chip *, u8 *, size_t)' {aka 'int (*)(struct tpm_chip *, unsigned char *, long unsigned int)'} [-Wincompatible-pointer-types]
> > 48 | .send = tpm_loongson_send,
> > | ^~~~~~~~~~~~~~~~~
> > drivers/char/tpm/tpm_loongson.c:48:17: note: (near initialization for 'tpm_loongson_ops.send')
> > drivers/char/tpm/tpm_loongson.c:31:12: note: 'tpm_loongson_send' declared here
> > 31 | static int tpm_loongson_send(struct tpm_chip *chip, u8 *buf, size_t count)
> > | ^~~~~~~~~~~~~~~~~
> >
> > [...]
>
> Applied, thanks!
>
> [1/1] tpm: loongson: Add bufsiz parameter to tpm_loongson_send()
> commit: 39377467669197b02479798f49e3f19344155dc9
Send for testing.
Will follow-up on the PR once complete.
--
Lee Jones [李琼斯]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-09-25 11:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-17 17:09 [PATCH] tpm: loongson: Add bufsiz parameter to tpm_loongson_send() Nathan Chancellor
2025-09-18 1:50 ` Qunqin Zhao
2025-09-18 15:56 ` Jarkko Sakkinen
2025-09-18 15:57 ` Jarkko Sakkinen
2025-09-25 11:46 ` (subset) " Lee Jones
2025-09-25 11:47 ` Lee Jones
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).