Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp844661ybh; Wed, 22 Jul 2020 15:02:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Pcy4ZyHCKh5uFTC/ehrdaUtqHPJdgAuhavPo+IfF8UBzSpduM9UETwEPxKK58Wf9A3oA X-Received: by 2002:a17:906:8d5:: with SMTP id o21mr1618204eje.155.1595455376057; Wed, 22 Jul 2020 15:02:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595455376; cv=none; d=google.com; s=arc-20160816; b=d4tWIn7xHDQFtXfrS7rzlbv7T5xMfliOngA7FRTuaoP4G9cB9kywnBc1+icjvnsp9G At+x1G5FEtCJ3bNlDF7rvWV+IcHu4b9jFq0NUJ0VGB/Ah5zbpIA51lSzE5l9q7NDfAkG 5qHR34mO7NaPOh9FTnFxO1rUkM79GeDny9yH6myw/saw3pqjz+vcjAzZQfSst81AIs4s Kag89vDSUB/CmEcbBM5VcUrfQXpJnlhSxkgWpGrPleCf4YvPpViA/d9y7BGvpXZp0PfA BQmRa2z0isvxcLdO6dL1rIa5TJ34pxr/ERQxA1h0m4xKurFi8KjUBGUgf5qRgoqFcpCk 7YHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=kf4G9OecuatMPdQAajjbtHZg6Z4TN34pDB2QVj3Jfws=; b=lRH793zo43DExExCDu1v1jOffnhHTTUEspXPDR2IRHXBx3l4R+UOCq9Jcb7vY7CDFN ZzVk9qdAX435+ca4Rc8LEpQnoI+HmwX2TLFsELn9+a1SPio+PHi6NgvtJUcAozmR8o7Q T18YihHDGDf6K2RrY3DPD3DKjMHiZWZp36a0C/GrnfcP9ZyMsSuNQ5GOYvrfz2o2cDN7 yXZstnD+0VdyYaO6RjgpwtSrtent4xm2uE94VO669EahxeOV6XtGHTL2erJ0cJsZW9+j EZbQZVwktJ8ENdhwLA42ZBrD91qCzjbnP6bqwsR1Reb/UYg7y9/yUnnqj4BLK/idxb71 JOmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GPVhp3NG; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn25si721887edb.68.2020.07.22.15.02.33; Wed, 22 Jul 2020 15:02:56 -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=@chromium.org header.s=google header.b=GPVhp3NG; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729843AbgGVWBZ (ORCPT + 99 others); Wed, 22 Jul 2020 18:01:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37558 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728198AbgGVWBY (ORCPT ); Wed, 22 Jul 2020 18:01:24 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81D2FC0619E1 for ; Wed, 22 Jul 2020 15:01:24 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id d7so1634809plq.13 for ; Wed, 22 Jul 2020 15:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kf4G9OecuatMPdQAajjbtHZg6Z4TN34pDB2QVj3Jfws=; b=GPVhp3NGJ19wf1ctURm4g+w3dBSbio1bGMroejrll7ayIS2Q6mitp1XXu92TJA2Jgj IN1hNbxl8IeAKe2gdCvYw4pNo6F0E/bMfhMfz7kJzxFdImVkqUM4CCuKZ32g7HBylXO5 NgOlYSDD0SRuMJy60oyVH0BTPnJ0vphFIOFoM= 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:mime-version :content-transfer-encoding; bh=kf4G9OecuatMPdQAajjbtHZg6Z4TN34pDB2QVj3Jfws=; b=LWnZCO4wr3s7S9N9LRTiWgDDKi0hPsRiYQ/tGhjuIKYnT07C6z5v5mpR70i4QkI5HT 5mXZUOiSG16EAgwo+z0ob1uqs8P/AVJA2BV4fV/KPjW0lauKcod0lgWfS4VD/lLCS4im s5QpQ1rhC0L7GCEDhP6NmZOwcmfbki+0DZ6osKNVqcZJvs60HCJawdpKUi40LpXYEQCq y0lQwwrg22Bs3m/riHm5lRxGRG/c1g8UJLNs/OWnmOFHU+KND/ksNCMfNNq4qgLEV34z wux/TVR6UkH/PnZlbV+94iV+Auzb3/DOgT/CR86GCNGDWm8cRiBjjj0npgO/Dd3IRLiC 9b0w== X-Gm-Message-State: AOAM533HRNKOSMCasMFvptsZemMMItbvHnGv/UqyUlNm+B+CZ450IPsf dCpggiK9Asuto5DItfYYrkoFzQ== X-Received: by 2002:a17:902:bd47:: with SMTP id b7mr1342798plx.144.1595455283992; Wed, 22 Jul 2020 15:01:23 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id g7sm562035pfh.210.2020.07.22.15.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 15:01:23 -0700 (PDT) From: Douglas Anderson To: Andy Gross , Bjorn Andersson Cc: linux-arm-msm@vger.kernel.org, swboyd@chromium.org, Rajendra Nayak , Akash Asthana , Sai Prakash Ranjan , Wolfram Sang , msavaliy@codeaurora.org, Douglas Anderson , Greg Kroah-Hartman , Matthias Kaehlcke , linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom-geni-se: Don't use relaxed writes when writing commands Date: Wed, 22 Jul 2020 15:01:20 -0700 Message-Id: <20200722150113.1.Ia50ab5cb8a6d3a73d302e6bdc25542d48ffd27f4@changeid> X-Mailer: git-send-email 2.28.0.rc0.142.g3c755180ce-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Writing the command is the final step in kicking off a transfer. Let's use writel() to ensure that any other memory accesses are done before the command kicks off. It's expected that this is mostly relevant if we're in DMA mode but since it doesn't appear to regress performance in a measurable way [1] even in PIO mode and it's easier to reason about then let's just always use it. NOTE: this patch came about due to code inspection. No actual problems were observed that this patch fixes. [1] Tested by timing "flashrom -p ec" on a Chromebook which stresses GENI SPI a lot. Suggested-by: Stephen Boyd Signed-off-by: Douglas Anderson --- include/linux/qcom-geni-se.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/qcom-geni-se.h b/include/linux/qcom-geni-se.h index dd464943f717..f50c73be1428 100644 --- a/include/linux/qcom-geni-se.h +++ b/include/linux/qcom-geni-se.h @@ -262,7 +262,7 @@ static inline void geni_se_setup_m_cmd(struct geni_se *se, u32 cmd, u32 params) u32 m_cmd; m_cmd = (cmd << M_OPCODE_SHFT) | (params & M_PARAMS_MSK); - writel_relaxed(m_cmd, se->base + SE_GENI_M_CMD0); + writel(m_cmd, se->base + SE_GENI_M_CMD0); } /** @@ -282,7 +282,7 @@ static inline void geni_se_setup_s_cmd(struct geni_se *se, u32 cmd, u32 params) s_cmd &= ~(S_OPCODE_MSK | S_PARAMS_MSK); s_cmd |= (cmd << S_OPCODE_SHFT); s_cmd |= (params & S_PARAMS_MSK); - writel_relaxed(s_cmd, se->base + SE_GENI_S_CMD0); + writel(s_cmd, se->base + SE_GENI_S_CMD0); } /** -- 2.28.0.rc0.142.g3c755180ce-goog