Received: by 10.223.176.5 with SMTP id f5csp1860550wra; Thu, 8 Feb 2018 04:48:56 -0800 (PST) X-Google-Smtp-Source: AH8x2245yqXYMJUzpvqZlHXw8mv7GQ2q18ALUER9/p0thPl5Pa/70Gn8Omrm/jr4Ifwu+6JCigCm X-Received: by 10.99.110.200 with SMTP id j191mr465897pgc.348.1518094136788; Thu, 08 Feb 2018 04:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518094136; cv=none; d=google.com; s=arc-20160816; b=HwhHYG1PwzOaS4MAdqz1/dOyxwGhywJb5WTXD4PfaFtUnCRRafFWYCNUZtqHVAbRp5 N8/HtJHkC2t+QUddOMXpEh0Ytn1JywQycEptSek7FpwL46aXhc8S3TniO+qIzRqI+9JA Ye5Ts9Rp+Nf3AGwX9ZBji8iMk2u4j60ObLNNXDhaon9LDcvAU0xHoXzqoLD/8sbGMmbW g93shseBu2IuZi8g/9C30ObVwXh5OuBjQFs0mVIwYCYOQG/me7zPTLy80Tr/k5H2pJ6H UGSwNDtei3NokPsCOZcbYfx29dRWPJZvdrgcX1fxylqjZVJQUzcsC+5HEcUvlhF74EHQ z+zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=4eYNv3zsuDmv5q8xHHIASoVYB6HR333JwiawkEge5aU=; b=05OV8pky5g7dZfvX1/CF2Co0UbtxkpNG8wiRNecBj6J+V0PTa3BW/5iWQZ5BMT7zOR NOuMK4iI9jREmNeLveRld39yW7P8BUjjOE4DexjTKrnAKArVAxcQiUdEUGxUF2hS3cAI pApRMtffWfRa0qZyMk6MzNC8t2vcHrcqKzBzxaWZXDiqzZWoksNLyq83nn9MnKlqFwPs zy2NrzJugVtV3oWBfHYluYxB/b7z5OumMm2MyhE19t+20VMK0pQtKpVbCQYFiszMjwDZ K6SXuhFYpZEeaBc/hkEufn2i64XWAS0APshhJDO3XNq/5nnUd9kEYoQV6wPNdpWFmVKR mBoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Fb7bzsK0; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a14-v6si2755260plm.719.2018.02.08.04.48.42; Thu, 08 Feb 2018 04:48:56 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Fb7bzsK0; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166AbeBHMr5 (ORCPT + 99 others); Thu, 8 Feb 2018 07:47:57 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:49866 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750806AbeBHMrz (ORCPT ); Thu, 8 Feb 2018 07:47:55 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w18ClbwH029965; Thu, 8 Feb 2018 06:47:37 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1518094057; bh=uTSbQJJmudfRBQsGW2Ihpa4AD3Tvw5RdY7Cqg+9yP2Q=; h=Subject:To:References:CC:From:Date:In-Reply-To; b=Fb7bzsK0nXl9PqFzx6iTy58zSqsKSwi4nRGZFa9w1sjuCOfzRj1BZMbS9R/6sCqWM laKm+ZrVrlLT/cYVgMmFVoCJuVH1TU/Vpv6ClfgbOn6DOfRKoCZyhNN5OYat3dzAXr 8XUTqUTdjp9iPqY6nKDER2+s5S9Tux86t2bMt9w0= Received: from DLEE114.ent.ti.com (dlee114.ent.ti.com [157.170.170.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18Clato008677; Thu, 8 Feb 2018 06:47:36 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Thu, 8 Feb 2018 06:47:36 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Thu, 8 Feb 2018 06:47:36 -0600 Received: from [172.24.190.233] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w18ClX9G019652; Thu, 8 Feb 2018 06:47:33 -0600 Subject: Re: [PATCH v2 1/3] PCI: endpoint: Handle 64-bit BARs properly To: Niklas Cassel , Lorenzo Pieralisi , Bjorn Helgaas , Sekhar Nori , Cyrille Pitchen , Niklas Cassel , Shawn Lin , John Keeping References: <20180208123346.20784-1-niklas.cassel@axis.com> <20180208123346.20784-2-niklas.cassel@axis.com> CC: , From: Kishon Vijay Abraham I Message-ID: Date: Thu, 8 Feb 2018 18:17:32 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20180208123346.20784-2-niklas.cassel@axis.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thursday 08 February 2018 06:03 PM, Niklas Cassel wrote: > 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, Not related to $patch. But I have a query on when PCI_BASE_ADDRESS_MEM_TYPE_64 should be set. Whether if the size is > 4G or if the address can be mapped anywhere in the 64-bit PCIe address space or both? Thanks Kishon > 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 800da09d9005..eef85820f59e 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; >