From: Dirk Gouders <dirk@gouders.net>
To: Peter Huewe <peterhuewe@gmx.de>,
Jarkko Sakkinen <jarkko@kernel.org>,
Jason Gunthorpe <jgg@ziepe.ca>
Cc: Dirk Gouders <dirk@gouders.net>,
James Bottomley <James.Bottomley@HansenPartnership.com>,
linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/1] tpm_tis: handle -EPROBE_DEFER in tpm_tis_plat_probe()
Date: Fri, 5 Feb 2021 21:20:22 +0100 [thread overview]
Message-ID: <20210205202022.4515-2-dirk@gouders.net> (raw)
In-Reply-To: <20210205202022.4515-1-dirk@gouders.net>
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>
---
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
next prev parent reply other threads:[~2021-02-05 20:30 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 ` Dirk Gouders [this message]
2021-02-08 0:41 ` [PATCH 1/1] " 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=20210205202022.4515-2-dirk@gouders.net \
--to=dirk@gouders.net \
--cc=James.Bottomley@HansenPartnership.com \
--cc=jarkko@kernel.org \
--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).