Received: by 10.223.185.116 with SMTP id b49csp4860756wrg; Tue, 27 Feb 2018 04:01:46 -0800 (PST) X-Google-Smtp-Source: AH8x2268fEV/X+cynBdXuDEsfpea/1Hc6pceTryOrj9MxpLeJQiYnYmfppGM1ywEo8XbL+EMb7uG X-Received: by 10.99.103.195 with SMTP id b186mr11108606pgc.446.1519732906636; Tue, 27 Feb 2018 04:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519732906; cv=none; d=google.com; s=arc-20160816; b=tdsTlNO4t9twQD5rXZYorbnAPF6Z2YWbeoq1ULljl8Emi2BIL0kjvzRTWB21hJNcnM 36re8GkfFCkh5aQ+2u4nChw7YsCJz/ENSoTRz6g85cbgIenf/LKQaD2OvOxyQ4N2m1n7 6tsrN/ay51LzCEVmNMDL3yVEaoYEAmURwesDP3ax9kbk+15X3ncBs7Xv/XRkLypLzllP RnMu0/fJDuM0zXta/p13iTR49oMrP5Va13L/tfZwRLoohTzoieltJ79ymOk9EJtB6SQy 22gNW/sCac8WnO/wkX9gP4j6TgE/1LILoT43w6BmRyAI3l+u1AqniDiMsGHlATPYUwwR PFug== 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=Ojna8Lski948tLR87iAwot2Yxz97pXjfeoEROAVkaFs=; b=W4LwU9470g8xic1OmWe5Ont9kuU8z8WrVPhciYQ8mGNHsEUYGzHCJsW841f5rp4cKD uYbjmV4nTavw+R+XYNEuolRK4+4tXgc/WV0IEhleOH9ywY+BOEfd4mtW9wlI4UewVI+j eFpydKMF6KEJ+gDvzP6nHlq5YeLEKcPiWjEcx6oQLh2FFgml1RdpUrD6ff/a28kIPVUB YoaqpNkyen3plTjGrXgQ4HuzK8XLLGgRmiKbsPR6Ic4kYQqjLYQuMsSIY0ZH0D3WdOnP QT3VfmdKgAyx5QiQxGKxRcbWMz9XnBET6w7lfV4zILYjeNOcfnT+fs6c5YQURgZC71nQ tUrw== 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 j61-v6si8476377plb.395.2018.02.27.04.01.32; Tue, 27 Feb 2018 04:01:46 -0800 (PST) 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 S1753149AbeB0MAE (ORCPT + 99 others); Tue, 27 Feb 2018 07:00:04 -0500 Received: from bastet.se.axis.com ([195.60.68.11]:58825 "EHLO bastet.se.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbeB0L7T (ORCPT ); Tue, 27 Feb 2018 06:59:19 -0500 Received: from localhost (localhost [127.0.0.1]) by bastet.se.axis.com (Postfix) with ESMTP id D7F76184C4; Tue, 27 Feb 2018 12:59:17 +0100 (CET) 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 mhM33UqV9cFd; Tue, 27 Feb 2018 12:59:17 +0100 (CET) Received: from boulder03.se.axis.com (boulder03.se.axis.com [10.0.8.17]) by bastet.se.axis.com (Postfix) with ESMTPS id 9144E184D8; Tue, 27 Feb 2018 12:59:15 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 652981E074; Tue, 27 Feb 2018 12:59:15 +0100 (CET) Received: from boulder03.se.axis.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 58C271E070; Tue, 27 Feb 2018 12:59:15 +0100 (CET) Received: from seth.se.axis.com (unknown [10.0.2.172]) by boulder03.se.axis.com (Postfix) with ESMTP; Tue, 27 Feb 2018 12:59:15 +0100 (CET) Received: from lnxartpec1.se.axis.com (lnxartpec1.se.axis.com [10.88.4.10]) by seth.se.axis.com (Postfix) with ESMTP id 4B4F9803; Tue, 27 Feb 2018 12:59:15 +0100 (CET) Received: by lnxartpec1.se.axis.com (Postfix, from userid 20283) id 46F25401A5; Tue, 27 Feb 2018 12:59:15 +0100 (CET) From: Niklas Cassel To: kishon@ti.com, Lorenzo Pieralisi , Bjorn Helgaas , Sekhar Nori , Shawn Lin , Cyrille Pitchen , Niklas Cassel , John Keeping Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] PCI: endpoint: Handle 64-bit BARs properly Date: Tue, 27 Feb 2018 12:59:05 +0100 Message-Id: <20180227115908.14593-2-niklas.cassel@axis.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180227115908.14593-1-niklas.cassel@axis.com> References: <20180227115908.14593-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 A 64-bit BAR uses the succeeding BAR for the upper bits, therefore we cannot call pci_epc_set_bar() on a BAR that follows a 64-bit BAR. If pci_epc_set_bar() is called with flag PCI_BASE_ADDRESS_MEM_TYPE_64, it has to be up to the controller driver to write both BAR[x] and BAR[x+1] (and BAR_mask[x] and BAR_mask[x+1]). Signed-off-by: Niklas Cassel --- drivers/pci/endpoint/functions/pci-epf-test.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c index 64d8a17f8094..ecbf6a7750dc 100644 --- a/drivers/pci/endpoint/functions/pci-epf-test.c +++ b/drivers/pci/endpoint/functions/pci-epf-test.c @@ -382,6 +382,8 @@ static int pci_epf_test_set_bar(struct pci_epf *epf) if (bar == test_reg_bar) return ret; } + if (flags & PCI_BASE_ADDRESS_MEM_TYPE_64) + bar++; } return 0; -- 2.14.2