Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp371829iob; Tue, 3 May 2022 20:38:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8VGQN3qN4Hc6bMd3emXWuaWINB5KLDPa7AKlvd/7vxKJoiDgMiswMC02RsmlHhgjF++Jy X-Received: by 2002:a17:907:97cc:b0:6df:83bc:314c with SMTP id js12-20020a17090797cc00b006df83bc314cmr18480376ejc.587.1651635496228; Tue, 03 May 2022 20:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651635496; cv=none; d=google.com; s=arc-20160816; b=TdeUzNx6vL7prZWZRYd3YWeNvkLPp3GUt3a1K/NzmcmE8bmvCWkaTcOl5So8s6gqxg V5OYA1uOFnBAPCLgbSNJ+LcXef6MfBQ2ssvYQBtobqf5vggtmYvMppSQjnk+i0JWlR0Y DWd4yM7RBvVc/3gD4ywGL0fN2kacA5ODieEKPckfPhlltcd0ENLDfnQw10x2eboNoYjW ZHyXVgOiPw9oNcq1U2cyUXVYoeft62nKw3NG3s52TFjpELJi0rBJRfd+u9/3tczx86yR NmTBUSa8vgklus3qcFAxK0d7ev/jKFMWE3/7m0Cn9bXzIA/IRXs+JCRw+8Di4/JnLMVb Uxxw== 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:dkim-filter; bh=9PcRuQEaH+jvkJWJj0pj6vOsFD3ddTPPKALUi/ORWCk=; b=g5vlhl03KTlDut5x7ZznN2go0o7lcGui+x5BuPuU5GBfmnMLTI0UxtTrY1ItcejP3o xbbXy6UdgEWFoqQHaLp2PMN0L9WEG7QdrzeMfJSOvYGoZL9OJdyhBA/16k6pR2W2wj9T mUwIeEFE+s2DfCeXXgDmHLucyjMsJX98ZGKRU4I4jvk7Uwg+vt2aTJxOZ8lhCn1FqopQ nLjsivpN2hAvl+5APotWHWcurB/37uhYarT3cGsHIu/gPTO3Zj5meAlSnZbsairSMbLC jYtW02zn6Y56byjBoNKWReG/67tAUXTGkYKimkTtmy99DFqw8lK9RoX1XeKuSlhsz9RG bs7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baikalelectronics.ru header.s=mail header.b=alkGb13G; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k25-20020a05640212d900b00425c55eb110si14246004edx.245.2022.05.03.20.37.50; Tue, 03 May 2022 20:38:16 -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=@baikalelectronics.ru header.s=mail header.b=alkGb13G; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242919AbiECV1t (ORCPT + 99 others); Tue, 3 May 2022 17:27:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242878AbiECV1W (ORCPT ); Tue, 3 May 2022 17:27:22 -0400 Received: from mail.baikalelectronics.ru (mail.baikalelectronics.com [87.245.175.226]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1BB5141627; Tue, 3 May 2022 14:23:34 -0700 (PDT) Received: from mail.baikalelectronics.ru (unknown [192.168.51.25]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 5F12416D8; Wed, 4 May 2022 00:24:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.baikalelectronics.ru 5F12416D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baikalelectronics.ru; s=mail; t=1651613048; bh=9PcRuQEaH+jvkJWJj0pj6vOsFD3ddTPPKALUi/ORWCk=; h=From:To:CC:Subject:Date:In-Reply-To:References:From; b=alkGb13GFTu62m73PN6DWszLWlNGDaXOPk54J5Ka0fmp7wsrivcGQXar1aoSRZkkG zQ23EHvEUdZLKLy3WuditcWWHtici0t/JpaZ3DnON0IUrQQVIo6yH9njrRcgz/CUij WP6NpC05FnIrF3a/+CdT4Yvfad09vElMxueqggDM= Received: from localhost (192.168.53.207) by mail (192.168.51.25) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 4 May 2022 00:23:34 +0300 From: Serge Semin To: Jingoo Han , Gustavo Pimentel , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= CC: Serge Semin , Serge Semin , Alexey Malahov , Pavel Parkhomenko , Frank Li , Manivannan Sadhasivam , , Subject: [PATCH v2 09/13] PCI: dwc: Convert Link-up status method to using dw_pcie_readl_dbi() Date: Wed, 4 May 2022 00:22:56 +0300 Message-ID: <20220503212300.30105-10-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20220503212300.30105-1-Sergey.Semin@baikalelectronics.ru> References: <20220503212300.30105-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 While the rest of the generic DWC PCIe code is using the dedicated IO-mem accessors, the dw_pcie_link_up() method for some unobvious reason directly calls readl() to get PortLogic.DEBUG1 register content. Since the way the dbi-bus is accessed can be platform-specific let's replace the direct dbi memory space read procedure with the readl-wrapper invocation. Thus we'll have a slightly more generic dw_pcie_link_up() method. Signed-off-by: Serge Semin Reviewed-by: Manivannan Sadhasivam --- drivers/pci/controller/dwc/pcie-designware.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index e3d2c11e6998..6e81264fdfb4 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -548,7 +548,7 @@ int dw_pcie_link_up(struct dw_pcie *pci) if (pci->ops && pci->ops->link_up) return pci->ops->link_up(pci); - val = readl(pci->dbi_base + PCIE_PORT_DEBUG1); + val = dw_pcie_readl_dbi(pci, PCIE_PORT_DEBUG1); return ((val & PCIE_PORT_DEBUG1_LINK_UP) && (!(val & PCIE_PORT_DEBUG1_LINK_IN_TRAINING))); } -- 2.35.1