From: Pavel Machek <pavel@denx.de>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org, patches@lists.linux.dev,
linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, linux@roeck-us.net, shuah@kernel.org,
patches@kernelci.org, lkft-triage@lists.linaro.org,
pavel@denx.de, jonathanh@nvidia.com, f.fainelli@gmail.com,
sudipm.mukherjee@gmail.com, srw@sladewatkins.net, rwarsow@gmx.de,
l.sanfilippo@kunbus.com, jarkko@kernel.org
Subject: Wrong/strange TPM patches was Re: [PATCH 6.1 000/119] 6.1.31-rc1 review
Date: Tue, 30 May 2023 12:46:49 +0200 [thread overview]
Message-ID: <ZHXUGdFMIcB5HL8s@duo.ucw.cz> (raw)
In-Reply-To: <20230528190835.386670951@linuxfoundation.org>
[-- Attachment #1: Type: text/plain, Size: 1927 bytes --]
Hi!
> This is the start of the stable review cycle for the 6.1.31 release.
> There are 119 patches in this series, all will be posted as a response
> to this one. If anyone has any issues with these being applied, please
> let me know.
> Lino Sanfilippo <l.sanfilippo@kunbus.com>
> tpm, tpm_tis: Avoid cache incoherency in test for interrupts
Description on this one is wrong/confused. There's no cache problem in
the code. Plus test_bit and friend already use bit number, so
- bool itpm = priv->flags & TPM_TIS_ITPM_WORKAROUND;
+ bool itpm = test_bit(TPM_TIS_ITPM_WORKAROUND, &priv->flags);
@@ -87,6 +87,7 @@ enum tpm_tis_flags {
TPM_TIS_ITPM_WORKAROUND = BIT(0),
TPM_TIS_INVALID_STATUS = BIT(1),
TPM_TIS_DEFAULT_CANCELLATION = BIT(2),
+ TPM_TIS_IRQ_TESTED = BIT(3),
};
this enum needs to go from BIT() to raw numbers.
You can just do return tpm_pm_resume();
> Jarkko Sakkinen <jarkko@kernel.org>
> tpm: Prevent hwrng from activating during resume
@@ -429,6 +431,14 @@ int tpm_pm_resume(struct device *dev)
if (chip == NULL)
return -ENODEV;
+ chip->flags &= ~TPM_CHIP_FLAG_SUSPENDED;
+
+ /*
+ * Guarantee that SUSPENDED is written last, so that hwrng does not
+ * activate before the chip has been fully resumed.
+ */
+ wmb();
+
return 0;
}
EXPORT_SYMBOL_GPL(tpm_pm_resume);
This code is confused. First, either you don't need memory barriers
here, or you need real locking. Second, if you want to guarantee flags
are written last, you need to put the barrier before the
assignment. (But ... get rid of that confusion, first).
Best regards,
Pavel
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2023-05-30 10:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-28 19:10 Greg Kroah-Hartman
2023-05-28 19:10 ` [PATCH 6.1 018/119] platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain Greg Kroah-Hartman
2023-05-29 5:11 ` [PATCH 6.1 000/119] 6.1.31-rc1 review Bagas Sanjaya
2023-05-29 10:09 ` ogasawara takeshi
2023-05-29 12:03 ` Conor Dooley
2023-05-29 13:12 ` Markus Reichelt
2023-05-29 13:28 ` Naresh Kamboju
2023-05-29 16:07 ` Guenter Roeck
2023-05-29 21:49 ` Ron Economos
2023-05-30 9:19 ` Jon Hunter
2023-05-30 10:46 ` Pavel Machek [this message]
2023-05-30 11:50 ` Wrong/strange TPM patches was " Linus Torvalds
2023-05-30 13:02 ` Greg Kroah-Hartman
2023-05-30 13:58 ` Lino Sanfilippo
2023-05-30 11:52 ` Chris Paterson
2023-05-30 17:02 ` Allen Pais
2023-05-30 19:29 ` Florian Fainelli
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=ZHXUGdFMIcB5HL8s@duo.ucw.cz \
--to=pavel@denx.de \
--cc=akpm@linux-foundation.org \
--cc=f.fainelli@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jarkko@kernel.org \
--cc=jonathanh@nvidia.com \
--cc=l.sanfilippo@kunbus.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=lkft-triage@lists.linaro.org \
--cc=patches@kernelci.org \
--cc=patches@lists.linux.dev \
--cc=rwarsow@gmx.de \
--cc=shuah@kernel.org \
--cc=srw@sladewatkins.net \
--cc=stable@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
--cc=torvalds@linux-foundation.org \
/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®