Skip to contentSkip to conversation

FAILED: patch "[PATCH] hwrng: imx-rngc - fix the timeout for init and self check" failed to apply to 4.14-stable tree

PATCH New [email protected] 2 participants 2 messages Jul 21, 2023

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-4.14.y
git checkout FETCH_HEAD
git cherry-pick -x d744ae7477190967a3ddc289e2cd4ae59e8b1237
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2023072142-childless-postbox-af6e@gregkh' --subject-prefix 'PATCH 4.14.y' HEAD^..

Possible dependencies:

d744ae747719 ("hwrng: imx-rngc - fix the timeout for init and self check") f086fd1e4344 ("hwrng: imx-rngc - simplify interrupt mask/unmask") 3acd9ea9331c ("hwrng: imx-rngc - use automatic seeding") 47a1f8e8b363 ("hwrng: imx-rngc - fix an error path")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From d744ae7477190967a3ddc289e2cd4ae59e8b1237 Mon Sep 17 00:00:00 2001
From: Martin Kaiser <[email protected]>
Date: Thu, 15 Jun 2023 15:49:59 +0100
Subject: [PATCH] hwrng: imx-rngc - fix the timeout for init and self check

Fix the timeout that is used for the initialisation and for the self test. wait_for_completion_timeout expects a timeout in jiffies, but RNGC_TIMEOUT is in milliseconds. Call msecs_to_jiffies to do the conversion.

Fixes 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC")
drivers/char/hw_random/imx-rngc.c +2 -4
index 1a6a5dd0a5a1..e5a9dee615c8 100644
@@ -110,7 +110,7 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
 	cmd = readl(rngc->base + RNGC_COMMAND);
 	writel(cmd | RNGC_CMD_SELF_TEST, rngc->base + RNGC_COMMAND);
 
-	ret = wait_for_completion_timeout(&rngc->rng_op_done, RNGC_TIMEOUT);
+	ret = wait_for_completion_timeout(&rngc->rng_op_done, msecs_to_jiffies(RNGC_TIMEOUT));
 	imx_rngc_irq_mask_clear(rngc);
 	if (!ret)
 		return -ETIMEDOUT;
@@ -182,9 +182,7 @@ static int imx_rngc_init(struct hwrng *rng)
 		cmd = readl(rngc->base + RNGC_COMMAND);
 		writel(cmd | RNGC_CMD_SEED, rngc->base + RNGC_COMMAND);
 
-		ret = wait_for_completion_timeout(&rngc->rng_op_done,
-				RNGC_TIMEOUT);
-
+		ret = wait_for_completion_timeout(&rngc->rng_op_done, msecs_to_jiffies(RNGC_TIMEOUT));
 		if (!ret) {
 			ret = -ETIMEDOUT;
 			goto err;
#1 lore raw

PATCH 1/1 hwrng: imx-rngc - fix the timeout for init and self check

Fix the timeout that is used for the initialisation and for the self test. wait_for_completion_timeout expects a timeout in jiffies, but RNGC_TIMEOUT is in milliseconds. Call msecs_to_jiffies to do the conversion.

Fixes 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC")
(cherry picked from commit d744ae7477190967a3ddc289e2cd4ae59e8b1237)
---
 drivers/char/hw_random/imx-rngc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/char/hw_random/imx-rngc.c +2 -4
index 48194d1a6076..5a31887867d6 100644
@@ -104,7 +104,7 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
 	cmd = readl(rngc->base + RNGC_COMMAND);
 	writel(cmd | RNGC_CMD_SELF_TEST, rngc->base + RNGC_COMMAND);
 
-	ret = wait_for_completion_timeout(&rngc->rng_op_done, RNGC_TIMEOUT);
+	ret = wait_for_completion_timeout(&rngc->rng_op_done, msecs_to_jiffies(RNGC_TIMEOUT));
 	if (!ret) {
 		imx_rngc_irq_mask_clear(rngc);
 		return -ETIMEDOUT;
@@ -187,9 +187,7 @@ static int imx_rngc_init(struct hwrng *rng)
 		cmd = readl(rngc->base + RNGC_COMMAND);
 		writel(cmd | RNGC_CMD_SEED, rngc->base + RNGC_COMMAND);
 
-		ret = wait_for_completion_timeout(&rngc->rng_op_done,
-				RNGC_TIMEOUT);
-
+		ret = wait_for_completion_timeout(&rngc->rng_op_done, msecs_to_jiffies(RNGC_TIMEOUT));
 		if (!ret) {
 			imx_rngc_irq_mask_clear(rngc);
 			return -ETIMEDOUT;
Signature · 1 line
2.30.2