Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6533259rwd; Mon, 19 Jun 2023 08:32:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Ea9zmr02OVbE/On2VbBgU7VEb5033a12K6yYXVOqhaLQiXH7gjTNlkY1lj8Q7iW2yNPKu X-Received: by 2002:a17:902:900c:b0:1b1:76c2:296a with SMTP id a12-20020a170902900c00b001b176c2296amr4577611plp.60.1687188756151; Mon, 19 Jun 2023 08:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687188756; cv=none; d=google.com; s=arc-20160816; b=l1u+nljt46JTngk/+YEfNToQKPeLaoPEr5gGHYlWOcLXrSpEz+kcy8AxVMbjDKE9mf n/jI2aloZ0dxnymwItVKUF3AsoPN6wbdJVNYyexyTe+/wX4Y+fQZ+34rOTVlBMsBk6cX 7zBWHAnvtT1TqZJ7l0O0/TSTmhaPU0aQPvMoSAH/TfMWSkkpgITzCkdpzeDxK4NJ2HV2 S39cPsGwt7etvgQhwB62HZaUERLCJKfs0cmqhPAOhl+lUaujyh3mdI9yCZ6HOfSB8gu4 FZfxGxi1lL1P02ofwwUqfDMszX+Ed4CnVNttQG/UKZmx6pQsJBM0w/uoCth7pHspgX0b cARQ== 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=KnYTPbLQMWkMCSqucReygW86UFXzEWRo6n6RYpHSl6Q=; b=MBQrClbwnciUCjLRZ+U8+evPrbN3UY7SFrDW7a9XW+hTC9cV3lumemqNtfwn+Z6B9j j4btkBr201CjXI4JjNq8Eu5HcQQYKTB/bhiCUbNVBQ0HMCeRa+k+mTPetVAmVBnJMstP rTKJWRbzgAmQO/zsDt1qHCTPS0WN6qgf13M0jJH6gMx3USvzfXebNgiDQwTyIqZT5TUB arV00DaXjn+ukxWMxMO9V7OB4hpoEUsjmnoTSePOU0QECN+vJ6Pm31U3rwPQT36dDVru FiPE5VHhQELZF/oXr/hQc1s5uy6rCePZN4YUQ3gBo9r8N9Oo5fdFwCeF0N66nu0SREX+ qDFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yWd0G0ny; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020a170902761400b001b3bf909420si54357pll.54.2023.06.19.08.32.00; Mon, 19 Jun 2023 08:32:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yWd0G0ny; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230319AbjFSPFe (ORCPT + 99 others); Mon, 19 Jun 2023 11:05:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230155AbjFSPFL (ORCPT ); Mon, 19 Jun 2023 11:05:11 -0400 Received: from mail-oi1-x233.google.com (mail-oi1-x233.google.com [IPv6:2607:f8b0:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCB2F19AD for ; Mon, 19 Jun 2023 08:04:29 -0700 (PDT) Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-394c7ba4cb5so2402769b6e.1 for ; Mon, 19 Jun 2023 08:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687187069; x=1689779069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KnYTPbLQMWkMCSqucReygW86UFXzEWRo6n6RYpHSl6Q=; b=yWd0G0ny+PmbdNeLBRGorz5mIOaQFrNwDntf5+renDW0fy412pD6JDBOdc+4S/CceP kgVH8/2BcsQ8og92IG+bF11zWQSMcmkiWcwY9TDDT6VtzQ/tVwq2o01g/xJzkd0tyTLj PEz+1SUZ1H39Pta0aAOe96LpDclPfkJM2qZM+DFUua25auQVZkvnW7ZirZ9KZKTxwG7R +0t6SYE0udQkuIfMiCQglLqqgrjobH76m7GmBeXSN6jyOjmE27uBV1gQlc8Y8YY8ak4L 7sWx9wuUjS0HkLELy60r0spaD+h0mlyJ3pGbS3R062GkeSwQUeiFfmXI9XpuJXjjkx+U zKvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687187069; x=1689779069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KnYTPbLQMWkMCSqucReygW86UFXzEWRo6n6RYpHSl6Q=; b=X0T8RkH2IFbrsVHPpXcJIiA8hXrBOQ1Tn05Hk4VPbyc9+XdbWXSA5EuUV4cVcdLaaG Pb+NIRqFVIKtyNNq9ElP9UZxBvA216efhzIfm512uL0O+4l5BzHlkUa1rnHrUguGdKCq Fj1wny29jkHdpr/4fg/LqKOhqN8jeV6P5d0of7Aecp/WRUuw3ZRsOQAmttKUKqP84OFU t34WGjpzdDAFU93GigEu4loo9WnL4c9nMG9IVeBfR+OlC9shz51vvJeMzdsCrWGAkY9O 3L+Pz58apjGdhM5yZqoQONHbjJNkMSW7BXjefZRtjIPoEghccCNcVa0L2knmlgFv7ML3 L/mw== X-Gm-Message-State: AC+VfDx3bvtCTNAopRczvGcAyZ+nB8VVIJtXagiInU4QQrf1p62Dm5Vm JaYrFuE9Eb8OUgigXiqxFJBp X-Received: by 2002:a05:6808:1455:b0:39a:a880:50dc with SMTP id x21-20020a056808145500b0039aa88050dcmr14860675oiv.52.1687187069106; Mon, 19 Jun 2023 08:04:29 -0700 (PDT) Received: from localhost.localdomain ([117.217.183.37]) by smtp.gmail.com with ESMTPSA id 10-20020a17090a19ca00b0025efaf7a0d3sm2765480pjj.14.2023.06.19.08.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 08:04:28 -0700 (PDT) From: Manivannan Sadhasivam To: lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com Cc: robh@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, steev@kali.org, quic_srichara@quicinc.com, Manivannan Sadhasivam , Dmitry Baryshkov Subject: [PATCH v4 3/9] PCI: qcom: Disable write access to read only registers for IP v2.9.0 Date: Mon, 19 Jun 2023 20:34:02 +0530 Message-Id: <20230619150408.8468-4-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230619150408.8468-1-manivannan.sadhasivam@linaro.org> References: <20230619150408.8468-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the post init sequence of v2.9.0, write access to read only registers are not disabled after updating the registers. Fix it by disabling the access after register update. While at it, let's also add a newline after existing dw_pcie_dbi_ro_wr_en() guard function to align with rest of the driver. Fixes: 0cf7c2efe8ac ("PCI: qcom: Add IPQ60xx support") Reviewed-by: Dmitry Baryshkov Signed-off-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-qcom.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 01795ee7ce45..391a45d1e70a 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -1136,6 +1136,7 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) writel(0, pcie->parf + PARF_Q2A_FLUSH); dw_pcie_dbi_ro_wr_en(pci); + writel(PCIE_CAP_SLOT_VAL, pci->dbi_base + offset + PCI_EXP_SLTCAP); val = readl(pci->dbi_base + offset + PCI_EXP_LNKCAP); @@ -1145,6 +1146,8 @@ static int qcom_pcie_post_init_2_9_0(struct qcom_pcie *pcie) writel(PCI_EXP_DEVCTL2_COMP_TMOUT_DIS, pci->dbi_base + offset + PCI_EXP_DEVCTL2); + dw_pcie_dbi_ro_wr_dis(pci); + for (i = 0; i < 256; i++) writel(0, pcie->parf + PARF_BDF_TO_SID_TABLE_N + (4 * i)); -- 2.25.1