Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp290753pxt; Fri, 6 Aug 2021 02:02:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEsu4D2fP6c1uFiPTN5Ihc9moax/RhnCtWVakmqFvY/BO23Y+rUM4zwKqsDpuMGrl9eb+o X-Received: by 2002:a6b:c906:: with SMTP id z6mr225525iof.7.1628240546155; Fri, 06 Aug 2021 02:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628240546; cv=none; d=google.com; s=arc-20160816; b=qmnyR/v5PeXS7uHushP4qxktnV0FFNQ0jSdIS0s7JtEWsW8XbYaRm3LOOpkpWxFBwh sfLN+5XC6UN8yJUuWWKDkdh5Rr55wZR/17tik0pbD3pYhl9N0uYHpE1DrfpAWHy/nNdk tqWAmjk6ZPhCZeXT42RDMQQ65aAYap+kDpY67QQid330dT0QQRQI/nljyd+lzNaR6qwn SfWxBNeYwht3jGi4N7QvvIBCP2Vg2sBOJ3vmcF2oJgUvZDBjlzuFPhZQTGnbg4pMawQ8 KI7OkbXM+PzjwHQR+YVMokfuiY6VxZatobi6lnY/71bCPq38AkrkNj/qUir+fYej+jKn /FHg== 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=u9oU6Dgh95pI7zAxpQ3mxDGSm81TQBT2TWjy1uK1gD8=; b=sWIFCsrZRPRzqpKWb/8bYPpGDqHrGDfLLGuz5cud5L4HsTJhS7GgalyvhUG83YZ2Tm 42ikELbJr8cBOpMtjgtC6PW+bRrlWCwko+7u8CbDoCk01rEiE44T3RtLhvKo9X1rrAeh XH9ntb1HhXaEjzY4qvJL18nK+o2yQClG8ZaP8Atrxgg3jTQxFhaa/2Pnl79bru7PET56 E8aHqHy2SwBzSF1BprLgaQh5zNbUrzPGlZW75J/9zU7oDPASSwiBhrIfkPe1PLvUCmVW xcVMOO0ylwNizhRNIMRbJ9ztHjBQD8l3ATTzp7neRdXmJWo938LZKXZ4arPz0QqX2eZG oZeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HPVQnz8/"; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si8508487ilg.44.2021.08.06.02.02.15; Fri, 06 Aug 2021 02:02:26 -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=@linaro.org header.s=google header.b="HPVQnz8/"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244057AbhHFJAO (ORCPT + 99 others); Fri, 6 Aug 2021 05:00:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38612 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244001AbhHFJAJ (ORCPT ); Fri, 6 Aug 2021 05:00:09 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5EFAC061799 for ; Fri, 6 Aug 2021 01:59:53 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id b13so10138138wrs.3 for ; Fri, 06 Aug 2021 01:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=u9oU6Dgh95pI7zAxpQ3mxDGSm81TQBT2TWjy1uK1gD8=; b=HPVQnz8/mFLVvNG0M7mL9vGIa62/sTwoRRWGsJ0xBxiVfuBAN+Elr1UNU+7DfGMajc WyV2DHrBXnlGkHbX46G3sPCN5477yevOC+V7o6VtdhaxjuFov+2XUqLVM8GKb3BGbyN2 oFibhZYjNxAyoR2dhiY8R/Bi4nxqGZeeH6d8hiOSfAhh75SJmmt+dHmTNOvkGl67YlnH OrN6bbvsGEI6hgLYvwioDjOp/Q+2N1qLLkP29/fgDGm/xAv0Fj1WySVvgKCZc9CQuagx mKR2OsBjZ7Fnn69ttRTZaCWFOYdlWJ6K3iv1hIu+EEUM4zIJKIuS9v+4d81qetg1gm0y udnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=u9oU6Dgh95pI7zAxpQ3mxDGSm81TQBT2TWjy1uK1gD8=; b=kjQk2AHKa/xL5cq8jDwHJg0zE6g/hX5xWRs98EtEF6RthgyGiIoecB75631ngJ42/y Ys/ZENyrIxTzQZNwcHIJ8G601ncFjpDcCu3osYvwX4RMxZNTUX1+mXVCfIKs4RtB6Eu9 ljG2/fvHCf9N91IblQXUlhwDilny7ATaQM/yN/a0JF//3mb4CLXkLN2DiXube54MoNl9 SXj2+/lYxz/2HwLcxHJvwTq0+izdtkrq0hdnBCFYY3X0WbTfYCRP7kASxSWNx/o0meU/ +RfV7qYgPlCvc4G2tcWZHmeJu7/gm0VbYxDtTKK1gM71At6PhrHojORjB9Z2lBrLYYnC Ka8g== X-Gm-Message-State: AOAM530m7z2DlzRb0UhBEr4hPpDDIHP5aZd6ijOUW/egR9vQcHyG0jAW BuEWbLxRoEqaI4N3dp15PBGEfw== X-Received: by 2002:a5d:4a85:: with SMTP id o5mr9443594wrq.67.1628240392421; Fri, 06 Aug 2021 01:59:52 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id x18sm8506144wrw.19.2021.08.06.01.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 01:59:51 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Rajendra Nayak , Douglas Anderson , Srinivas Kandagatla Subject: [PATCH 2/4] nvmem: qfprom: Fix up qfprom_disable_fuse_blowing() ordering Date: Fri, 6 Aug 2021 09:59:45 +0100 Message-Id: <20210806085947.22682-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210806085947.22682-1-srinivas.kandagatla@linaro.org> References: <20210806085947.22682-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rajendra Nayak 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. Signed-off-by: Rajendra Nayak Reviewed-by: Douglas Anderson Signed-off-by: Srinivas Kandagatla --- 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.21.0