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 070A0EB64DD for ; Fri, 21 Jul 2023 06:08:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229599AbjGUGIN (ORCPT ); Fri, 21 Jul 2023 02:08:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjGUGHp (ORCPT ); Fri, 21 Jul 2023 02:07:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE6F619B3 for ; Thu, 20 Jul 2023 23:07:44 -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 729FC61083 for ; Fri, 21 Jul 2023 06:07:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C5D1C433C8; Fri, 21 Jul 2023 06:07:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689919663; bh=kQ8GPEcdNATDkTGbyZVi+rOe4zMxaiwq6wtuwpaAO+s=; h=Subject:To:Cc:From:Date:From; b=wkbUWqwxZrD7+FMvfbCqGJmCRxK65H2AjQgAZz+VEtMW+Ft97SAU3VGdmV9lpitsI aMxyMkkdug0bzOW/Ob/jfQddLos1uXm8+ooI4FFyCE61lpTducxo/WmUfioUlw69I3 qiWhw6EzktPMHBE8IbwqdsOWchIhgV944chS5e5k= Subject: FAILED: patch "[PATCH] hwrng: imx-rngc - fix the timeout for init and self check" failed to apply to 5.4-stable tree To: martin@kaiser.cx, herbert@gondor.apana.org.au Cc: From: Date: Fri, 21 Jul 2023 08:07:41 +0200 Message-ID: <2023072141-showbiz-repulsive-22ee@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 5.4-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-5.4.y git checkout FETCH_HEAD git cherry-pick -x d744ae7477190967a3ddc289e2cd4ae59e8b1237 # git commit -s git send-email --to '' --in-reply-to '2023072141-showbiz-repulsive-22ee@gregkh' --subject-prefix 'PATCH 5.4.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;