All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Dirk Gouders <dirk@gouders.net>
Cc: Lukasz Majczak <lma@semihalf.com>,
	Guenter Roeck <linux@roeck-us.net>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Tj <ml.linux@elloe.vision>, Peter Huewe <peterhuewe@gmx.de>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org,
	Radoslaw Biernacki <rad@semihalf.com>,
	Marcin Wojtas <mw@semihalf.com>, Alex Levin <levinale@google.com>
Subject: Re: [PATCH v2] tpm_tis: Add missing tpm_request/relinquish_locality calls
Date: Tue, 2 Feb 2021 18:29:19 +0200	[thread overview]
Message-ID: <YBl933XkQimq5elb@kernel.org> (raw)
In-Reply-To: <ghwnvtwifq.fsf@gouders.net>

On Sun, Jan 31, 2021 at 10:43:05AM +0100, Dirk Gouders wrote:
> Jarkko Sakkinen <jarkko@kernel.org> writes:
> 
> > On Thu, 2021-01-28 at 14:07 +0100, Lukasz Majczak wrote:
> >> There is a missing call to tpm_request_locality before the call to
> >> the tpm_get_timeouts() and tpm_tis_probe_irq_single(). As the current
> >> approach might work for tpm2, it fails for tpm1.x - in that case
> >> call to tpm_get_timeouts() or tpm_tis_probe_irq_single()
> >> without locality fails and in turn causes tpm_tis_core_init() to fail.
> >> Tested on Samsung Chromebook Pro (Caroline).
> >> 
> >> Signed-off-by: Lukasz Majczak <lma@semihalf.com>
> >
> > Is it possible that you test against linux-next and see if any
> > problems still arise? I've applied the locality fixes from James.
> 
> I tested current linux-next and the warning still appears,
> unfortunately.
> 
> I then incrementally applied further patches from James' series [1] and
> after "[PATCH v2 4/5] tpm_tis: fix IRQ probing" the warning has gone:
> 
> # dmesg | grep tpm
> [    7.220410] tpm_tis STM0125:00: 2.0 TPM (device-id 0x0, rev-id 78)
> [    7.322564] Modules linked in: iwlmvm(+) btusb btrtl btbcm btintel mac80211 amdgpu(+) iwlwifi drm_ttm_helper tpm_crb sdhci_pci ttm cqhci gpu_sched sdhci ccp cfg80211 rng_core tpm_tis tpm_tis_core tpm thinkpad_acpi(+) wmi nvram pinctrl_amd
> 
> You might notice there is another warning but that is rtc related and I
> still have to find out if that is something I should report.

1/5 and 2/5 are on the other hand unconditionally "right things" to
do. In your case the resulting state will anyway just result a polling
driver and the kernel state remains stable.

WARN_ONCE() is clearly an overkill, as kernel does not have inconsistent
state. Using WARN_ONCE() was a mistake.

I sent this fix: https://lore.kernel.org/linux-integrity/3936843b-c0da-dd8c-8aa9-90aa3b49d525@linux.ibm.com/T/#t

It will turn WARN_ONCE() to pr_warn_once() and also add the status code
to klog entry. It's sufficient in this case. For 3/5-5/5 we need more
time.

/Jarkko

  parent reply	other threads:[~2021-02-02 16:32 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-23  1:42 [PATCH] tpm_tis: Add missing start/stop_tpm_chip calls Lukasz Majczak
2021-01-25 17:12 ` Jarkko Sakkinen
2021-01-25 17:18 ` Guenter Roeck
2021-01-26 15:46   ` Łukasz Majczak
2021-01-26 16:46     ` James Bottomley
2021-01-26 18:55       ` Tj (Elloe Linux)
2021-01-28  5:58       ` Jarkko Sakkinen
2021-01-29 22:59     ` Jarkko Sakkinen
2021-01-29 23:00       ` Jarkko Sakkinen
2021-01-30 23:49       ` Guenter Roeck
2021-01-31  0:41         ` James Bottomley
2021-01-31  3:36           ` Guenter Roeck
2021-01-31  4:18             ` James Bottomley
2021-02-02 16:17           ` Jarkko Sakkinen
2021-02-02 15:33         ` Jarkko Sakkinen
2021-01-29 22:49   ` Jarkko Sakkinen
2021-01-29 23:32     ` Guenter Roeck
2021-01-28 13:07 ` [PATCH v2] tpm_tis: Add missing tpm_request/relinquish_locality calls Lukasz Majczak
2021-01-28 17:37   ` Guenter Roeck
2021-01-30 20:40   ` Jarkko Sakkinen
2021-01-30 20:47     ` Jarkko Sakkinen
     [not found]     ` <ghwnvtwifq.fsf@gouders.net>
2021-02-02 16:29       ` Jarkko Sakkinen [this message]
2021-02-02 15:51   ` [PATCH v3] " Lukasz Majczak
2021-02-02 16:29     ` Guenter Roeck
2021-02-02 22:35       ` Jarkko Sakkinen
2021-02-02 18:47     ` Dirk Gouders
2021-02-03 11:46       ` Dirk Gouders
2021-02-03 13:43         ` Lukasz Majczak
2021-02-03 23:24           ` Jarkko Sakkinen
2021-02-02 19:57     ` [PATCH v4] " Lukasz Majczak
2021-02-02 21:49       ` Jarkko Sakkinen
2021-02-02 21:49     ` [PATCH v3] " Jarkko Sakkinen
2021-02-03  0:05       ` Jarkko Sakkinen
2021-02-03  0:07         ` 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=YBl933XkQimq5elb@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=dirk@gouders.net \
    --cc=jgg@ziepe.ca \
    --cc=levinale@google.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lma@semihalf.com \
    --cc=ml.linux@elloe.vision \
    --cc=mw@semihalf.com \
    --cc=peterhuewe@gmx.de \
    --cc=rad@semihalf.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.