From nobody Sun Dec 14 06:20:37 2025 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 ABF58C00140 for ; Mon, 15 Aug 2022 18:21:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240788AbiHOSVj (ORCPT ); Mon, 15 Aug 2022 14:21:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232271AbiHOSUX (ORCPT ); Mon, 15 Aug 2022 14:20:23 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21E52AE27; Mon, 15 Aug 2022 11:16:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 44FFACE125B; Mon, 15 Aug 2022 18:16:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A171C433D6; Mon, 15 Aug 2022 18:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587397; bh=90TsjMqOUNEM4+jK+tHM4C/XBOy4yWf55oPYVu5rl94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iTTAmk6fW1n3bnvoLp3QTbd56Sg7hJQwbe/Wj64PQeu2U2n+MbMzUknGvsU9qoyiX tFcP37X1GTp9zktFDdxOteC2hqHOLYt2pJTnOQP2tfs8+zE3Vt2gLHc2LVx3g4bmN1 DipenXouxP53bgosaKE5zP17lEAHAh6K7+wddqp0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Amit Kumar Mahapatra , Miquel Raynal Subject: [PATCH 5.15 073/779] mtd: rawnand: arasan: Update NAND bus clock instead of system clock Date: Mon, 15 Aug 2022 19:55:17 +0200 Message-Id: <20220815180340.420762155@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Amit Kumar Mahapatra commit 7499bfeedb47efc1ee4dc793b92c610d46e6d6a6 upstream. In current implementation the Arasan NAND driver is updating the system clock(i.e., anand->clk) in accordance to the timing modes (i.e., SDR or NVDDR). But as per the Arasan NAND controller spec the flash clock or the NAND bus clock(i.e., nfc->bus_clk), need to be updated instead. This patch keeps the system clock unchanged and updates the NAND bus clock as per the timing modes. Fixes: 197b88fecc50 ("mtd: rawnand: arasan: Add new Arasan NAND controller") CC: stable@vger.kernel.org # 5.8+ Signed-off-by: Amit Kumar Mahapatra Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220628154824.12222-2-amit.kumar-m= ahapatra@xilinx.com Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/arasan-nand-controller.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/mtd/nand/raw/arasan-nand-controller.c +++ b/drivers/mtd/nand/raw/arasan-nand-controller.c @@ -347,17 +347,17 @@ static int anfc_select_target(struct nan =20 /* Update clock frequency */ if (nfc->cur_clk !=3D anand->clk) { - clk_disable_unprepare(nfc->controller_clk); - ret =3D clk_set_rate(nfc->controller_clk, anand->clk); + clk_disable_unprepare(nfc->bus_clk); + ret =3D clk_set_rate(nfc->bus_clk, anand->clk); if (ret) { dev_err(nfc->dev, "Failed to change clock rate\n"); return ret; } =20 - ret =3D clk_prepare_enable(nfc->controller_clk); + ret =3D clk_prepare_enable(nfc->bus_clk); if (ret) { dev_err(nfc->dev, - "Failed to re-enable the controller clock\n"); + "Failed to re-enable the bus clock\n"); return ret; }