* [PATCH 0/2] iaa_crypto bugfix and maintainer change
@ 2024-09-27 18:45 Zanussi, Tom
2024-09-27 18:46 ` [PATCH 1/2] crypto: iaa - Remove potential infinite loop in check_completion() Zanussi, Tom
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Zanussi, Tom @ 2024-09-27 18:45 UTC (permalink / raw)
To: herbert; +Cc: davem, linux-crypto, linux-kernel, Accardi, Kristen C, zanussi
Hi Herbert,
The first patch here fixes a bug seen on some systems with broken IAA
hardware; it doesn't fix the hardware issue itself but exposes an
issue with trusting the hardware to either send a completion or
trigger a timeout - if neither happens, it shouldn't spin endlessly.
The second patch hands over iaa_crypto maintainership, since I'll be
retiring from Intel and won't have access to IAA hardware myself.
Thanks,
Tom
Tom Zanussi (2):
crypto: iaa - Remove potential infinite loop in check_completion()
MAINTAINERS: Make Kristen Accardi the IAA crypto driver maintainer
MAINTAINERS | 2 +-
drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 ++++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
--
2.38.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] crypto: iaa - Remove potential infinite loop in check_completion()
2024-09-27 18:45 [PATCH 0/2] iaa_crypto bugfix and maintainer change Zanussi, Tom
@ 2024-09-27 18:46 ` Zanussi, Tom
2024-09-27 18:47 ` [PATCH 2/2] MAINTAINERS: Make Kristen Accardi the IAA crypto driver maintainer Zanussi, Tom
2024-10-05 5:38 ` [PATCH 0/2] iaa_crypto bugfix and maintainer change Herbert Xu
2 siblings, 0 replies; 4+ messages in thread
From: Zanussi, Tom @ 2024-09-27 18:46 UTC (permalink / raw)
To: herbert; +Cc: davem, linux-crypto, linux-kernel, Accardi, Kristen C, zanussi
For iaa_crypto operations, it's assumed that if an operation doesn't
make progress, the IAA watchdog timer will kick in and set the
completion status bit to failure and the reason to completion timeout.
Some systems may have broken hardware that doesn't even do that, which
can result in an infinite status-checking loop. Add a check for that
in the loop, and disable the driver if it occurs.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/crypto/intel/iaa/iaa_crypto_main.c b/drivers/crypto/intel/iaa/iaa_crypto_main.c
index 237f87000070..8fced88d3d06 100644
--- a/drivers/crypto/intel/iaa/iaa_crypto_main.c
+++ b/drivers/crypto/intel/iaa/iaa_crypto_main.c
@@ -945,12 +945,22 @@ static inline int check_completion(struct device *dev,
bool only_once)
{
char *op_str = compress ? "compress" : "decompress";
+ int status_checks = 0;
int ret = 0;
while (!comp->status) {
if (only_once)
return -EAGAIN;
cpu_relax();
+ if (status_checks++ >= IAA_COMPLETION_TIMEOUT) {
+ /* Something is wrong with the hw, disable it. */
+ dev_err(dev, "%s completion timed out - "
+ "assuming broken hw, iaa_crypto now DISABLED\n",
+ op_str);
+ iaa_crypto_enabled = false;
+ ret = -ETIMEDOUT;
+ goto out;
+ }
}
if (comp->status != IAX_COMP_SUCCESS) {
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] MAINTAINERS: Make Kristen Accardi the IAA crypto driver maintainer
2024-09-27 18:45 [PATCH 0/2] iaa_crypto bugfix and maintainer change Zanussi, Tom
2024-09-27 18:46 ` [PATCH 1/2] crypto: iaa - Remove potential infinite loop in check_completion() Zanussi, Tom
@ 2024-09-27 18:47 ` Zanussi, Tom
2024-10-05 5:38 ` [PATCH 0/2] iaa_crypto bugfix and maintainer change Herbert Xu
2 siblings, 0 replies; 4+ messages in thread
From: Zanussi, Tom @ 2024-09-27 18:47 UTC (permalink / raw)
To: herbert; +Cc: davem, linux-crypto, linux-kernel, Accardi, Kristen C, zanussi
Since I'll be retiring from Intel and will no longer have access to
hardware, Kristen Accardi will be taking over as the iaa_crypto
maintainer.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index a0b4c1210e92..b89c21ff2bc8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11300,7 +11300,7 @@ Q: https://patchwork.kernel.org/project/linux-dmaengine/list/
F: drivers/dma/ioat*
INTEL IAA CRYPTO DRIVER
-M: Tom Zanussi <tom.zanussi@linux.intel.com>
+M: Kristen Accardi <kristen.c.accardi@intel.com>
L: linux-crypto@vger.kernel.org
S: Supported
F: Documentation/driver-api/crypto/iaa/iaa-crypto.rst
--
2.38.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] iaa_crypto bugfix and maintainer change
2024-09-27 18:45 [PATCH 0/2] iaa_crypto bugfix and maintainer change Zanussi, Tom
2024-09-27 18:46 ` [PATCH 1/2] crypto: iaa - Remove potential infinite loop in check_completion() Zanussi, Tom
2024-09-27 18:47 ` [PATCH 2/2] MAINTAINERS: Make Kristen Accardi the IAA crypto driver maintainer Zanussi, Tom
@ 2024-10-05 5:38 ` Herbert Xu
2 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2024-10-05 5:38 UTC (permalink / raw)
To: Zanussi, Tom
Cc: davem, linux-crypto, linux-kernel, Accardi, Kristen C, zanussi
On Fri, Sep 27, 2024 at 01:45:42PM -0500, Zanussi, Tom wrote:
> Hi Herbert,
>
> The first patch here fixes a bug seen on some systems with broken IAA
> hardware; it doesn't fix the hardware issue itself but exposes an
> issue with trusting the hardware to either send a completion or
> trigger a timeout - if neither happens, it shouldn't spin endlessly.
>
> The second patch hands over iaa_crypto maintainership, since I'll be
> retiring from Intel and won't have access to IAA hardware myself.
>
> Thanks,
>
> Tom
>
> Tom Zanussi (2):
> crypto: iaa - Remove potential infinite loop in check_completion()
> MAINTAINERS: Make Kristen Accardi the IAA crypto driver maintainer
>
> MAINTAINERS | 2 +-
> drivers/crypto/intel/iaa/iaa_crypto_main.c | 10 ++++++++++
> 2 files changed, 11 insertions(+), 1 deletion(-)
>
> --
> 2.38.1
All applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-10-05 5:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 18:45 [PATCH 0/2] iaa_crypto bugfix and maintainer change Zanussi, Tom
2024-09-27 18:46 ` [PATCH 1/2] crypto: iaa - Remove potential infinite loop in check_completion() Zanussi, Tom
2024-09-27 18:47 ` [PATCH 2/2] MAINTAINERS: Make Kristen Accardi the IAA crypto driver maintainer Zanussi, Tom
2024-10-05 5:38 ` [PATCH 0/2] iaa_crypto bugfix and maintainer change Herbert Xu
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).