From: Jarkko Sakkinen <jarkko@kernel.org>
To: Dirk Gouders <dirk@gouders.net>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] tpm_tis: handle -EPROBE_DEFER in tpm_tis_plat_probe()
Date: Mon, 8 Feb 2021 02:41:04 +0200 [thread overview]
Message-ID: <YCCIoDc70hHIL6KK@kernel.org> (raw)
In-Reply-To: <20210205202022.4515-2-dirk@gouders.net>
On Fri, Feb 05, 2021 at 09:20:22PM +0100, Dirk Gouders wrote:
> tpm_tis does not consider -EPROBE_DEFER in tpm_tis_plat_probe().
> Instead, without notification it falls back to polling mode if
> platform_get_irq_optional() returns a negative value.
>
> This could lead to different behavior depending on wether tpm_tis was
> compiled builtin or as a module; in the latter case
> platform_get_irq_optional() often if not always returns a valid IRQ
> number on the first attempt.
>
> Harmonize builtin and module behavior by returning -EPROBE_DEFER,
> effectively putting the device on the deferred probe list for later
> probe attempts.
>
> Signed-off-by: Dirk Gouders <dirk@gouders.net>
This would be best picked to James' patch set.
> ---
> drivers/char/tpm/tpm_tis.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> index 4ed6e660273a..4cf863704aa1 100644
> --- a/drivers/char/tpm/tpm_tis.c
> +++ b/drivers/char/tpm/tpm_tis.c
> @@ -320,6 +320,9 @@ static int tpm_tis_plat_probe(struct platform_device *pdev)
>
> tpm_info.irq = platform_get_irq_optional(pdev, 0);
> if (tpm_info.irq <= 0) {
> + if (tpm_info.irq == -EPROBE_DEFER)
> + /* Enter deferred probe list and try again, later. */
> + return -EPROBE_DEFER;
> if (pdev != force_pdev)
> tpm_info.irq = -1;
> else
> --
> 2.26.2
>
>
/Jarkko
prev parent reply other threads:[~2021-02-08 0:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-05 20:20 [PATCH 0/1] tpm_tis: handle -EPROBE_DEFER in tpm_tis_plat_probe() Dirk Gouders
2021-02-05 20:20 ` [PATCH 1/1] " Dirk Gouders
2021-02-08 0:41 ` Jarkko Sakkinen [this message]
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=YCCIoDc70hHIL6KK@kernel.org \
--to=jarkko@kernel.org \
--cc=James.Bottomley@hansenpartnership.com \
--cc=dirk@gouders.net \
--cc=jgg@ziepe.ca \
--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;
as well as URLs for NNTP newsgroup(s).