Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1702461pxb; Thu, 16 Sep 2021 13:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXV50+OE7peCMZ9/sCgmRMFg/2w27raX2RZY2m8sEwXWc8pXvLqE99W4tHbh469l7DkLD7 X-Received: by 2002:a17:907:75d9:: with SMTP id jl25mr8343730ejc.4.1631823844976; Thu, 16 Sep 2021 13:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631823844; cv=none; d=google.com; s=arc-20160816; b=U+iGsE+vDiwIpMEokoXxPIdAJ3ArTkJ8ovXWzhcoTnm1KMrAI5WF4Z7qwtOaZwL9ZZ FiuFOk6/FHOvY/L3I2HUpj4b62M2/Gl+L0z1uazOB7YCRf8IzDT6jxz3+1ShATvAHCeo skDX1LUeXFhM+l+kRuqDQm3U4RO1FAdBSqyick3tWsBRl94/47bm4n9xJ0aHyx5nT3vq QBtugyT1k+gGFne6iGfhwhG/GonyY+i1oosuFg+40gNJ3ige0ONs44jxPmHp9/6tkITO vhT0R67L1xu30jpGibAzZKlG999cMroVKhi5/9h1KYi+u6d7zd7LYsSAZb/tOSceYXUO bv6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oelwPNBBqRFflCnMEJYPcKX8BoRJPfXTJQcevjGCWnU=; b=UAniQTclNXNXotEXiM7UH39vMvFHKSCcxsq+50sDHjAN5BkfKzKF5bHCvHNAWGeTeR ZFfxSI0Vp6gJjM4mHjHgUKSlb1T7lQt3ZdUkNIbpC1dW5dCKOKoBjNwfOjdyi0OzmFAf UYFMR5YYfSYkmy24YckUjW/3rF/32xC+c6kdbOPIMbOGjC7qxDpUdI3Zofk6YpFh2w7p X66gczdYvwdVmTxkOMO7b/Twm6WrJyO3O6hIbOtQbXb/fr9n3u2Vqu7HH8qeZgxx6Lz5 fbL9gi/WLX1//5o+QbF9ztwv7GvOgH/TrZfvVJYgxMNfVIrt0hMCgqmhDmLBmq7ATCge b74g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vKJOY49O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si4126464edq.460.2021.09.16.13.23.35; Thu, 16 Sep 2021 13:24:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vKJOY49O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236785AbhIPQZD (ORCPT + 99 others); Thu, 16 Sep 2021 12:25:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:54616 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240723AbhIPQRG (ORCPT ); Thu, 16 Sep 2021 12:17:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A4AE461284; Thu, 16 Sep 2021 16:11:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808719; bh=YziwLkAfydv1tS8/Dicy+PmFihYoCdapStHJ1MXiFp8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vKJOY49Oja7BB7RnNQYxkhLBC/GW8NZX5aXspUTyAo77EcgcHIEpYfMyWKLBdQUPk slfkUFAow8taYBaOJYfOaj0uE8Giqsa5Hcqlk/v8eC4WSDZfxJEJNuBizhlrW0310k zaZxRuqF/Aeu8NJBN4FR1f+HySZOWAr9j9hhrMd0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Douglas Anderson , Rajendra Nayak , Srinivas Kandagatla , Sasha Levin Subject: [PATCH 5.10 196/306] nvmem: qfprom: Fix up qfprom_disable_fuse_blowing() ordering Date: Thu, 16 Sep 2021 17:59:01 +0200 Message-Id: <20210916155800.747879475@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajendra Nayak [ Upstream commit 11c4b3e264d68ba6dcd52d12dbcfd3f564f2f137 ] qfprom_disable_fuse_blowing() disables a bunch of resources, and then does a few register writes in the 'conf' address space. It works perhaps because the resources are needed only for the 'raw' register space writes, and that the 'conf' space allows read/writes regardless. However that makes the code look confusing, so just move the register writes before turning off the resources in the function. Reviewed-by: Douglas Anderson Signed-off-by: Rajendra Nayak Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210806085947.22682-3-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/nvmem/qfprom.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index 955b8b8c8238..8ef772ccfb36 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -104,6 +104,9 @@ static void qfprom_disable_fuse_blowing(const struct qfprom_priv *priv, { int ret; + writel(old->timer_val, priv->qfpconf + QFPROM_BLOW_TIMER_OFFSET); + writel(old->accel_val, priv->qfpconf + QFPROM_ACCEL_OFFSET); + /* * This may be a shared rail and may be able to run at a lower rate * when we're not blowing fuses. At the moment, the regulator framework @@ -124,9 +127,6 @@ static void qfprom_disable_fuse_blowing(const struct qfprom_priv *priv, "Failed to set clock rate for disable (ignoring)\n"); clk_disable_unprepare(priv->secclk); - - writel(old->timer_val, priv->qfpconf + QFPROM_BLOW_TIMER_OFFSET); - writel(old->accel_val, priv->qfpconf + QFPROM_ACCEL_OFFSET); } /** -- 2.30.2