linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tpm_tis_spi: Add missing SPI ID
@ 2021-09-23 18:15 Mark Brown
  2021-09-23 20:06 ` Jarkko Sakkinen
  2021-09-23 23:12 ` Javier Martinez Canillas
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Brown @ 2021-09-23 18:15 UTC (permalink / raw)
  To: Alexander Wellbrock, Javier Martinez Canillas, Peter Robinson,
	Jarkko Sakkinen
  Cc: linux-integrity, Mark Brown

In commit c46ed2281bbe ("tpm_tis_spi: add missing SPI device ID entries")
we added SPI IDs for all the DT aliases to handle the fact that we always
use SPI modaliases to load modules even when probed via DT however this
added an alias for the non-idiomatic tpm_tis-spi compatible as tpm_tis_spi
which doesn't actually match. Add an extra ID for tpm_tis-spi rather than
just fix the existing one since what's currently there is going to be
better for anyone actually using SPI IDs to instantiate.

Fixes: c46ed2281bbe ("tpm_tis_spi: add missing SPI device ID entries")
Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/char/tpm/tpm_tis_spi_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
index 54584b4b00d1..aaa59a00eeae 100644
--- a/drivers/char/tpm/tpm_tis_spi_main.c
+++ b/drivers/char/tpm/tpm_tis_spi_main.c
@@ -267,6 +267,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
 	{ "st33htpm-spi", (unsigned long)tpm_tis_spi_probe },
 	{ "slb9670", (unsigned long)tpm_tis_spi_probe },
 	{ "tpm_tis_spi", (unsigned long)tpm_tis_spi_probe },
+	{ "tpm_tis-spi", (unsigned long)tpm_tis_spi_probe },
 	{ "cr50", (unsigned long)cr50_spi_probe },
 	{}
 };
-- 
2.20.1


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

* Re: [PATCH] tpm_tis_spi: Add missing SPI ID
  2021-09-23 18:15 [PATCH] tpm_tis_spi: Add missing SPI ID Mark Brown
@ 2021-09-23 20:06 ` Jarkko Sakkinen
  2021-09-23 23:12 ` Javier Martinez Canillas
  1 sibling, 0 replies; 3+ messages in thread
From: Jarkko Sakkinen @ 2021-09-23 20:06 UTC (permalink / raw)
  To: Mark Brown, Alexander Wellbrock, Javier Martinez Canillas,
	Peter Robinson
  Cc: linux-integrity

On Thu, 2021-09-23 at 19:15 +0100, Mark Brown wrote:
> In commit c46ed2281bbe ("tpm_tis_spi: add missing SPI device ID entries")
> we added SPI IDs for all the DT aliases to handle the fact that we always
> use SPI modaliases to load modules even when probed via DT however this
> added an alias for the non-idiomatic tpm_tis-spi compatible as tpm_tis_spi
> which doesn't actually match. Add an extra ID for tpm_tis-spi rather than
> just fix the existing one since what's currently there is going to be
> better for anyone actually using SPI IDs to instantiate.
> 
> Fixes: c46ed2281bbe ("tpm_tis_spi: add missing SPI device ID entries")
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  drivers/char/tpm/tpm_tis_spi_main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/char/tpm/tpm_tis_spi_main.c b/drivers/char/tpm/tpm_tis_spi_main.c
> index 54584b4b00d1..aaa59a00eeae 100644
> --- a/drivers/char/tpm/tpm_tis_spi_main.c
> +++ b/drivers/char/tpm/tpm_tis_spi_main.c
> @@ -267,6 +267,7 @@ static const struct spi_device_id tpm_tis_spi_id[] = {
>  	{ "st33htpm-spi", (unsigned long)tpm_tis_spi_probe },
>  	{ "slb9670", (unsigned long)tpm_tis_spi_probe },
>  	{ "tpm_tis_spi", (unsigned long)tpm_tis_spi_probe },
> +	{ "tpm_tis-spi", (unsigned long)tpm_tis_spi_probe },
>  	{ "cr50", (unsigned long)cr50_spi_probe },
>  	{}
>  };



Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

I'll apply this.

/Jarkko


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

* Re: [PATCH] tpm_tis_spi: Add missing SPI ID
  2021-09-23 18:15 [PATCH] tpm_tis_spi: Add missing SPI ID Mark Brown
  2021-09-23 20:06 ` Jarkko Sakkinen
@ 2021-09-23 23:12 ` Javier Martinez Canillas
  1 sibling, 0 replies; 3+ messages in thread
From: Javier Martinez Canillas @ 2021-09-23 23:12 UTC (permalink / raw)
  To: Mark Brown, Alexander Wellbrock, Peter Robinson, Jarkko Sakkinen
  Cc: linux-integrity

Hello Mark,

I agree with your patch but the commit message is not completely accurate.

On 9/23/21 8:15 PM, Mark Brown wrote:
> In commit c46ed2281bbe ("tpm_tis_spi: add missing SPI device ID entries")
> we added SPI IDs for all the DT aliases to handle the fact that we always
> use SPI modaliases to load modules even when probed via DT however this
> added an alias for the non-idiomatic tpm_tis-spi compatible as tpm_tis_spi

The "tpm_tis_spi" entry was not introduced by the mentioned commit but it
has been in the driver since commit 0edbfea537d ("tpm/tpm_tis_spi: Add
support for spi phy").

What was missed in commit c46ed2281bbe was that the entries in the OF and
SPI tables didn't match and were different. So maybe the following instead:

"... however the mentioned commit missed that the SPI and OF device ID
entries did not match and were different and so DT nodes with compatible
"tcg,tpm_tis-spi" will not match".

> which doesn't actually match. Add an extra ID for tpm_tis-spi rather than
> just fix the existing one since what's currently there is going to be
> better for anyone actually using SPI IDs to instantiate.
> 
> Fixes: c46ed2281bbe ("tpm_tis_spi: add missing SPI device ID entries")
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")

Oh, I missed that the SPI core was modified to report OF modalias uevents
at some point. Yes, that won't work unless all the SPI drivers are fixed.

Anyway, for the change itself:

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

Best regards,
-- 
Javier Martinez Canillas
Linux Engineering
Red Hat


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

end of thread, other threads:[~2021-09-23 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 18:15 [PATCH] tpm_tis_spi: Add missing SPI ID Mark Brown
2021-09-23 20:06 ` Jarkko Sakkinen
2021-09-23 23:12 ` Javier Martinez Canillas

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).