Received: by 10.213.65.68 with SMTP id h4csp346079imn; Wed, 28 Mar 2018 04:53:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49je4CoSYf6aGzvUVSUVkONp567MABJApCesyY1YqZhTwnB/hgh024wCWVuBsyPevFvh6ol X-Received: by 10.99.55.68 with SMTP id g4mr2293468pgn.283.1522238003823; Wed, 28 Mar 2018 04:53:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522238003; cv=none; d=google.com; s=arc-20160816; b=N8y6CH/S40jV5WMc2YilcugbqCgXDiShuiXShHAPEItncoD82iQbOaP1WI7Hjuvf5d yDH3ghkG9KEb/j2X+IbnNpqQg+aZACzH7p+nKXmm3RfqykL2D6V6CA2fi6E5osIRreXq 18g01CqWEUS94ItvuyIf33/p22M81TGO1517GBBmYyKVOMeFmRzANULh7qcNcwifucL4 yBV+j80um0LmguyWPqbEDSrY4Q0aOZAmPG8tzplfHaR5Ek1UjT8KBqEhzwQ0AtUHtxql qNP3xWwDG7Cy9Cnoi3lFHovketljkPoJ8IH9j5YZ4BP1a8T3iyuB2IcWSl86CVIkcnEI TyBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=cl5RkAZz2ACBNTUC2nI4vgldEB+mEPWhQyNMX9MlHy4=; b=nODb4ZNJmr7t5AkxDgLDFGU0jsqRY59jsnDr6PiiGbRg8t1Jm+k6Ip4XzH4pkgR0pF DEDWd+ebQHRZeFjAP+FlgZhcZOUZ8QfyhdEddJ7/+43v9902cdBkUTbc9VPELSChPeXZ XrANQvmIShGXrGf86j3COKqcSJWAiQjFPm9NzX2xuolRcCfzUK8Tcob6ZOgk9HLAYDUt cHiT+1LonF86auxy/EXI63ttgFbQXsGM+60m27G2yXGAnsr/9OpSLhWiZ/C+Q6Qv9awY A7PQMz7yzfVQDcnO2Zo/Iv59d4SFFw5/L/UFkAtUNLU5xD/WwK5s/CQpwNFuLRo7gMSm jjtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p4-v6si3691354plr.424.2018.03.28.04.53.09; Wed, 28 Mar 2018 04:53:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753050AbeC1Lv1 (ORCPT + 99 others); Wed, 28 Mar 2018 07:51:27 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:54035 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753029AbeC1LvZ (ORCPT ); Wed, 28 Mar 2018 07:51:25 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id E78201832D; Wed, 28 Mar 2018 13:51:23 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bastet.se.axis.com Received: from bastet.se.axis.com ([IPv6:::ffff:127.0.0.1]) by localhost (bastet.se.axis.com [::ffff:127.0.0.1]) (amavisd-new, port 10024) with LMTP id nIgnv9fYzds9; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) Received: from boulder02.se.axis.com (boulder02.se.axis.com [10.0.8.16]) by bastet.se.axis.com (Postfix) with ESMTPS id A6D6D1846A; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) Received: from boulder02.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 969721A077; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) Received: from boulder02.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B8161A06D; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) Received: from seth.se.axis.com (unknown [10.0.2.172]) by boulder02.se.axis.com (Postfix) with ESMTP; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) Received: from lnxartpec1.se.axis.com (lnxartpec1.se.axis.com [10.88.4.10]) by seth.se.axis.com (Postfix) with ESMTP id 7EDDA20D7; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 7A9B940197; Wed, 28 Mar 2018 13:51:22 +0200 (CEST) From: Niklas Cassel To: kishon@ti.com, cyrille.pitchen@free-electrons.com, Jingoo Han , Joao Pinto , Lorenzo Pieralisi , Bjorn Helgaas Cc: Niklas Cassel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 11/12] PCI: designware-ep: Make dw_pcie_ep_reset_bar() handle 64-bit BARs properly Date: Wed, 28 Mar 2018 13:50:16 +0200 Message-Id: <20180328115018.31921-12-niklas.cassel@axis.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180328115018.31921-1-niklas.cassel@axis.com> References: <20180328115018.31921-1-niklas.cassel@axis.com> X-TM-AS-GCONF: 00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since a 64-bit BAR consists of a BAR pair, we need to write to both BARs in the BAR pair to clear the BAR properly. Signed-off-by: Niklas Cassel --- drivers/pci/dwc/pcie-designware-ep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/pci/dwc/pcie-designware-ep.c b/drivers/pci/dwc/pcie-designware-ep.c index cc4d8381c1dc..4d304e3ccf24 100644 --- a/drivers/pci/dwc/pcie-designware-ep.c +++ b/drivers/pci/dwc/pcie-designware-ep.c @@ -28,6 +28,10 @@ static void __dw_pcie_ep_reset_bar(struct dw_pcie *pci, enum pci_barno bar, dw_pcie_dbi_ro_wr_en(pci); dw_pcie_writel_dbi2(pci, reg, 0x0); dw_pcie_writel_dbi(pci, reg, 0x0); + if (flags & PCI_BASE_ADDRESS_MEM_TYPE_64) { + dw_pcie_writel_dbi2(pci, reg + 4, 0x0); + dw_pcie_writel_dbi(pci, reg + 4, 0x0); + } dw_pcie_dbi_ro_wr_dis(pci); } -- 2.14.2