From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AA11EB64DC for ; Fri, 21 Jul 2023 06:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229487AbjGUGIM (ORCPT ); Fri, 21 Jul 2023 02:08:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjGUGH5 (ORCPT ); Fri, 21 Jul 2023 02:07:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A51F81BF7 for ; Thu, 20 Jul 2023 23:07:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3D1496112C for ; Fri, 21 Jul 2023 06:07:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 220A5C433C9; Fri, 21 Jul 2023 06:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689919675; bh=0xXxYoVMIPSm4PRQpop3kShkRMp6sm48oAZRRqdLw/4=; h=Subject:To:Cc:From:Date:From; b=TrlmeNccNC+6/Oeh7SguScsksGKdqtN6rLkl29ZiSFOmWwfpl0BFgtXXyv6/dBalw lFvAm5XgTR/GaqXqgVU65um18FdyZJd0NTSvqzGG5eRfrTXu7XnsLuPsGt3DlnMAhV 6TufAc74v8jNyOi3ktLNURs0+DkuiAJmWvGX9vfo= Subject: FAILED: patch "[PATCH] hwrng: imx-rngc - fix the timeout for init and self check" failed to apply to 4.14-stable tree To: martin@kaiser.cx, herbert@gondor.apana.org.au Cc: From: Date: Fri, 21 Jul 2023 08:07:42 +0200 Message-ID: <2023072142-childless-postbox-af6e@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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 . 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 # git commit -s git send-email --to '' --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 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. Cc: stable@vger.kernel.org Fixes: 1d5449445bd0 ("hwrng: mx-rngc - add a driver for Freescale RNGC") Signed-off-by: Martin Kaiser Signed-off-by: Herbert Xu diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c index 1a6a5dd0a5a1..e5a9dee615c8 100644 --- a/drivers/char/hw_random/imx-rngc.c +++ b/drivers/char/hw_random/imx-rngc.c @@ -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;