Received: by 10.223.185.116 with SMTP id b49csp3444115wrg; Tue, 13 Feb 2018 02:30:35 -0800 (PST) X-Google-Smtp-Source: AH8x227AWh4qqvR+gQJrN8NoJTmYST8LSmlDoz1tpuEYYl9oFNou//wgM3d52oN++9uDammuYvFb X-Received: by 10.101.96.42 with SMTP id p10mr630880pgu.364.1518517835294; Tue, 13 Feb 2018 02:30:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518517835; cv=none; d=google.com; s=arc-20160816; b=P/Sa69HApwIsL4NZcihBSvgMnrXHRjSiy0Dsa25TPBc0rJfVxh9ltJ7jGs8PQGNOJ4 D6tEt8EdeOruD4PBIQTXH+/ngIuDXeNBfvZzix1pWnd42S2LkOGVZwe6k+yEDtzQjGoh r7GAWDDuovEL/8l8KxNaT8DCfNVMJs6znPGNjizDFu989SfDr/J+aeJ4syzecZ1H6fmD rvTIx03264zT9YizNiZRXZQcScVbLPeEHm0os80ALucgSWGMXqHs99RWKMtjWri+yKVG XkSXNmr6GCeKNozKBZlSkWVJdE8298qmpfnJnyXKJyHpH40CvCNil8i5ifv2ioq+wdCp +23g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=LE0c1w+XdEqiO6UsHAIVp/DTo3Fa1NEh2xu9fDuHEYY=; b=HhdXapzuIWJsgHCl6LlAY4X0NPNch0QQbZVXxNkY60ZCaRC1lCYLfUS2qWUl4XxNw+ Pjmw0xJ9//DcozqUOjymB4PCmiZkC4dSl7CDQVyq/bW97oWN75Ctv+Y/YyiU8hlyh9ZM GHKsa6gQg1bGVc44RISJ1iVUP/xDu9sr91v4LFsy+2tp/sIUpvqU5BV2lWdKwKglPDb/ d3/Pr5FTNvjcYfAjgWYK1a1tXZ9u8qzQowk6fMQx6xcTJZTzCl62DqkQd+9t4EH7kOzS q6YWw6I4IuVbKHDZ+Ipu2vBVadtPxFBQox4sjRQOjoM3WsIa6DCcrpmeMYkbg1HexPdq qEPQ== 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 w12-v6si7246031pld.162.2018.02.13.02.30.20; Tue, 13 Feb 2018 02:30:35 -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 S934034AbeBMK3D (ORCPT + 99 others); Tue, 13 Feb 2018 05:29:03 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55070 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933995AbeBMK3B (ORCPT ); Tue, 13 Feb 2018 05:29:01 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8776480D; Tue, 13 Feb 2018 02:29:00 -0800 (PST) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.207.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 984833F53D; Tue, 13 Feb 2018 02:28:58 -0800 (PST) Date: Tue, 13 Feb 2018 10:28:53 +0000 From: Lorenzo Pieralisi To: Kishon Vijay Abraham I Cc: Bjorn Helgaas , Niklas Cassel , Bjorn Helgaas , Sekhar Nori , Cyrille Pitchen , Niklas Cassel , Shawn Lin , John Keeping , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/3] PCI: endpoint: Handle 64-bit BARs properly Message-ID: <20180213102853.GA8981@e107981-ln.cambridge.arm.com> References: <20180208123346.20784-1-niklas.cassel@axis.com> <20180208123346.20784-2-niklas.cassel@axis.com> <20180208215735.GD98765@bhelgaas-glaptop.roam.corp.google.com> <5e54c525-1b78-bef3-7f83-82eb872837da@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5e54c525-1b78-bef3-7f83-82eb872837da@ti.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 09, 2018 at 06:14:49PM +0530, Kishon Vijay Abraham I wrote: > Hi Bjorn, > > On Friday 09 February 2018 03:27 AM, Bjorn Helgaas wrote: > > On Thu, Feb 08, 2018 at 06:17:32PM +0530, Kishon Vijay Abraham I wrote: > >> 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? > > > > In general, PCI_BASE_ADDRESS_MEM_TYPE_64 should be set if the BAR is > > 64 bits wide. IORESOURCE_MEM_64 is similar. > > okay, if the HW support 64bit BAR, 64 bit flag should be set and not based on > size or anything else? Yes, I completely agree with Bjorn. Actually it would be a good idea to make the struct pci_epf->bar member array an array of struct resources to simplify its handling. Thanks, Lorenzo