Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp450574pxb; Thu, 9 Sep 2021 04:53:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzghD5pD1Jpn/jhI3s2rRXDzNQ2jNoHiuSJoxyNIIQrmRogCmPahuxQKabjyIf6z26EgA2b X-Received: by 2002:a05:6402:313c:: with SMTP id dd28mr2733729edb.179.1631188424344; Thu, 09 Sep 2021 04:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631188424; cv=none; d=google.com; s=arc-20160816; b=u9oZvWa3Te7pYVOa84EaEX8Omz9gTJI52CQM9MwVOeSFkcTMXylE+Rl8Vd04Wsdf4i Rq/vxLqyOTHu6HDuzJea2ACVj0oJ1StGDVRUUliss0jaFCMsOJDtkXh9hR32BLY1bvor 4lF5lnZhQiDZEJVxVbW4RhsNiPgo3xGcZZ33v2/4qcryB7WiAQCp7hQA9Ab5qMwKijJG vo3e5VDUvXBOZo/OzbM+nWzF6d7meAWxNU6odX7XLDSWBRnE8jZXER6Aaj2Ku5syPvlf T71e8axmV4+fvJcej/taG6JH2T/6K5yYaqfYEojZv2mpUHEiDhmvJbFbR6sJDCgrLj2z vTJw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jGvaYijMD0H4tpxJUcbvK8IS9k8JwW/qTvkC+v20BWI=; b=CZhsLK+bdCtSI5wJBfnVqU74jkPSWgRkTHXAZhEEZgQSvzQZ+0j7YXUwQt9bfwHvYm 4+Tqctf6EChYrZNqTIgJgq02BK07SQ2CGvRZxXBz3Y6nC4QjtMHYHqcuEcC711GtwcPU S7volLYkqPR2iEBrrgFbqZDGVIixFF9E/NjOVsD1C33s+tD7r5C5Wqd1XdR/OUuYB9GM El2hZH6ue+nmPtHW9cyc1ehgSeLfvuwCgFdSoPifp10jRU6sTx9Ogh/KCZcbxCd9/mHV LgGEaAC0UPGvTCBIUAY4+6usUMdcg2DRPtn9Hfs7En0nDOgYG8uWNnwgdlfqLe92UFZ+ jUbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jFgF8vkW; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs11si1548838ejb.438.2021.09.09.04.53.20; Thu, 09 Sep 2021 04:53:44 -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=@kernel.org header.s=k20201202 header.b=jFgF8vkW; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237771AbhIILwq (ORCPT + 99 others); Thu, 9 Sep 2021 07:52:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:54526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236591AbhIILuX (ORCPT ); Thu, 9 Sep 2021 07:50:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C47761350; Thu, 9 Sep 2021 11:43:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631187828; bh=MA9Q8cU7Z78EOKO/dTu2ryzIHA7RNsG+Nr8gEJp1LHI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFgF8vkWvl98B/sdo/42NTaZkNl8s837907Ncjg4Fkx6X/cJEb5WANWDUrS16LU1c myjiIuyx1MEvGjbZEdUiD4dqCvVARHKg616KLqBzHmfN3xibpMwMH1U9L8LDmzqmcw mnvPTkjdXP5CDTgIwV+jA/OKK794Oplnkip17c2obHAYW41VJSTqdYjSjYc8SS37CE l3ifdDJOqP8HSEpK+x6EudmCSXHxCgz9BWd5SZAxS5gVBfm21VuOjF8zKqYFb8yN3M 5uzaVyepurqHEHPGxHuUR9zlSeY1RG8El+GOHepWGu+hVarsN6/xT6YikX1mAtPdR6 F/TWwmBh3wSvQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Rajendra Nayak , Douglas Anderson , Srinivas Kandagatla , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 5.14 125/252] nvmem: qfprom: Fix up qfprom_disable_fuse_blowing() ordering Date: Thu, 9 Sep 2021 07:38:59 -0400 Message-Id: <20210909114106.141462-125-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909114106.141462-1-sashal@kernel.org> References: <20210909114106.141462-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 81fbad5e939d..b0ca4c626466 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -139,6 +139,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 @@ -159,9 +162,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