mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Niklas Schnelle <schnelle@linux.ibm.com>
To: Arnd Bergmann <arnd@kernel.org>, Peter Huewe <peterhuewe@gmx.de>,
	Jarkko Sakkinen <jarkko@kernel.org>
Cc: linux-integrity@vger.kernel.org,
	Heiko Carstens <hca@linux.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] char: tpm: handle HAS_IOPORT dependencies
Date: Fri, 05 Apr 2024 11:23:34 +0200	[thread overview]
Message-ID: <4d08af651b95744dc6cfa0c2624c596d21d83d09.camel@linux.ibm.com> (raw)
In-Reply-To: <9d9fa267-067e-421b-9a39-aa178b913298@app.fastmail.com>

On Thu, 2024-04-04 at 17:56 +0200, Arnd Bergmann wrote:
> On Thu, Apr 4, 2024, at 17:41, Niklas Schnelle wrote:
> > 
> > Good find! I do see the same #ifdef in v5 but maybe something else
> > changed. I think this was also hidden during both my local test builds
> > and kernel test robot because of the PNP -> ACPI || ISA dependency
> > which I think implies HAS_IOPORT. So unless I'm missing something we
> > can't currently get here with HAS_IOPORT=n. Maybe that changed?
> 
> Rihgt, I just found that as well, so the TCG_INFINEON driver
> won't ever be enabled without CONFIG_HAS_IOPORT after all.
> 
> > I'm now thinking maybe keeping TPM_INF_IO_PORT is the cleaner choice.
> > It saves us 4 lines of #ifdeffery at the cost of one sometimes "unused"
> > define.
> 
> Agreed. I tried it out for reference, but it does get quite ugly,
> see below. Alternatively, we could just add a 'depends on HAS_IOPORT'
> to this driver after all. Even if it can be used on MMIO, it might
> never actually be built without PIO.

Oh yeah thats an even bigger change than I thought if we want to remove
the TPM_INF_IO_PORT define for HAS_IOPORT=n. It's also still bit of an
arbitrary point to stop since we could just as well argue that struct
tpm_inf_dev::iotype then also shouldn't be there. I think one could
handle this still with a bit of regrouping but not sure if it is worth
it.

I just confirmed that keeping the define it also compiles but I do
wonder if it's not even cleaner to just add an explicit HAS_IOPORT
dependency and no new #ifdefs in the code. I'm willing to send a patch
for any of these solutions though.

> 
> diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig
> index 418c9ed59ffd..852bb9344788 100644
> --- a/drivers/char/tpm/Kconfig
> +++ b/drivers/char/tpm/Kconfig
> @@ -157,7 +157,7 @@ config TCG_ATMEL
>  
>  config TCG_INFINEON
>  	tristate "Infineon Technologies TPM Interface"
> -	depends on PNP
> +	depends on PNP || COMPILE_TEST
>  	help
>  	  If you have a TPM security chip from Infineon Technologies
>  	  (either SLD 9630 TT 1.1 or SLB 9635 TT 1.2) say Yes and it
> diff --git a/drivers/char/tpm/tpm_infineon.c b/drivers/char/tpm/tpm_infineon.c
> index 99c6e565ec8d..768ca65960d8 100644
> --- a/drivers/char/tpm/tpm_infineon.c
---8<---

  reply	other threads:[~2024-04-05  9:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 10:58 [PATCH 0/1] char: tpm: Handle " Niklas Schnelle
2024-04-04 10:58 ` [PATCH 1/1] char: tpm: handle " Niklas Schnelle
2024-04-04 11:17   ` Arnd Bergmann
2024-04-04 15:22     ` Jarkko Sakkinen
2024-04-04 15:41     ` Niklas Schnelle
2024-04-04 15:56       ` Arnd Bergmann
2024-04-05  9:23         ` Niklas Schnelle [this message]
2024-04-05 21:02           ` Arnd Bergmann
2024-04-04 15:19   ` Jarkko Sakkinen

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=4d08af651b95744dc6cfa0c2624c596d21d83d09.camel@linux.ibm.com \
    --to=schnelle@linux.ibm.com \
    --cc=arnd@kernel.org \
    --cc=hca@linux.ibm.com \
    --cc=jarkko@kernel.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterhuewe@gmx.de \
    /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®