Received: by 10.213.65.68 with SMTP id h4csp345594imn; Wed, 28 Mar 2018 04:52:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/Cs7sYnq1K5WI5thnz73sB+AkLfJO4AD3SR4+AKzAMWoqAHapr7V1pRSTsCcq9buHWjosE X-Received: by 2002:a17:902:5853:: with SMTP id f19-v6mr3429243plj.7.1522237968240; Wed, 28 Mar 2018 04:52:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522237968; cv=none; d=google.com; s=arc-20160816; b=CmwrkHFxXpp5CjWTE41OAVMDQVTpCfCEtlvE+VW4s8P6ff/KJoNo8AaK6L13m8dxEL oRsPob3FkdnHiJPXuHzG2zfnTmM7ZiFcfkfrIH+jDKN5+L/qkVwPqU4MuOxFzjAUv9Ts dYWTKvacmR9YmryOAaSpk4iw0EFe7LInG3SkJehYwkOxsWbvEDWlQRLq391JJlgaCJSj sCIAMpBoXaQtXlT8h9RBjaLyQvCCnDKOr+Wl26+Qf57FGB2jJfdgtcIAkj7q+3be2TJB h5i9jCzlNSwybPl2hk+0MH3NHl3AVN/PqxZGOEdEzcoiSD6Sm/d7L7aRi/Mt7YCwkwX+ rUsw== 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=V4/DZKHQvnKx6GfSzQA0uZ6V/hYDHuLf+QBEeMiTO9o=; b=ktwVcV5xltS62pFevUuE/dvCYRLW8Al2PllMFFN5T2aEAXsaY5KkvmrHfdSlaqs6sy yYXgLZ0IiF9Q8DRvxjehJrvobMD8RzkYHoWpA7QTuot1Pz7tlnK9qVZs11HT98e6i+lG NNUGhj72hnruKxOMZwO+4tNbWvUPni8+nRMXk5qNHsS23wJGcVJzf0crViQLk9XseMIP JWEovleLw3wsEM4PkR0+eooUMlFnrRDNIPQkZ2sk5dkxrQ2K6anmxdf4HSMPX5NmO+MC 5/8YO30JGqcCWQSlpSggWmiaE5/Et+PHfam7Wkz4Vhxf6EiPNFW1XCssUOmEUT+90Y1r 3qfQ== 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 r10si2360010pgt.517.2018.03.28.04.52.34; Wed, 28 Mar 2018 04:52:48 -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 S1752981AbeC1LvF (ORCPT + 99 others); Wed, 28 Mar 2018 07:51:05 -0400 Received: from bastet.se.axis.com ([195.60.68.11]:53974 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752932AbeC1LvD (ORCPT ); Wed, 28 Mar 2018 07:51:03 -0400 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id 9FA5D1806E; Wed, 28 Mar 2018 13:51:02 +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 aoZwvJlGFfyZ; Wed, 28 Mar 2018 13:51:00 +0200 (CEST) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id A552C1842F; Wed, 28 Mar 2018 13:51:00 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9265A1E072; Wed, 28 Mar 2018 13:51:00 +0200 (CEST) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 863C81E06C; Wed, 28 Mar 2018 13:51:00 +0200 (CEST) Received: from seth.se.axis.com (unknown [10.0.2.172]) by boulder03.se.axis.com (Postfix) with ESMTP; Wed, 28 Mar 2018 13:51:00 +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 7947020D7; Wed, 28 Mar 2018 13:51:00 +0200 (CEST) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 7575140197; Wed, 28 Mar 2018 13:51:00 +0200 (CEST) From: Niklas Cassel To: kishon@ti.com, cyrille.pitchen@free-electrons.com, Alan Douglas , Bjorn Helgaas Cc: Niklas Cassel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 07/12] PCI: cadence: Set PCI_BASE_ADDRESS_MEM_TYPE_64 if a 64-bit BAR was set-up Date: Wed, 28 Mar 2018 13:50:12 +0200 Message-Id: <20180328115018.31921-8-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 cdns_pcie_ep_set_bar() does some round-up of the BAR size, which means that a 64-bit BAR can be set-up, even when the flag PCI_BASE_ADDRESS_MEM_TYPE_64 isn't set. If a 64-bit BAR was set-up, set the flag PCI_BASE_ADDRESS_MEM_TYPE_64, so that the calling function can know what BAR width that was actually set-up. I'm not sure why cdns_pcie_ep_set_bar() doesn't obey the flag PCI_BASE_ADDRESS_MEM_TYPE_64, but I leave this for the MAINTAINER to fix, since there might be a reason why this flag is ignored. Signed-off-by: Niklas Cassel --- drivers/pci/cadence/pcie-cadence-ep.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pci/cadence/pcie-cadence-ep.c b/drivers/pci/cadence/pcie-cadence-ep.c index cef36cd6b710..2905e098678c 100644 --- a/drivers/pci/cadence/pcie-cadence-ep.c +++ b/drivers/pci/cadence/pcie-cadence-ep.c @@ -106,6 +106,9 @@ static int cdns_pcie_ep_set_bar(struct pci_epc *epc, u8 fn, if (is_64bits && (bar & 1)) return -EINVAL; + if (is_64bits && !(flags & PCI_BASE_ADDRESS_MEM_TYPE_64)) + epf_bar->flags |= PCI_BASE_ADDRESS_MEM_TYPE_64; + if (is_64bits && is_prefetch) ctrl = CDNS_PCIE_LM_BAR_CFG_CTRL_PREFETCH_MEM_64BITS; else if (is_prefetch) -- 2.14.2