Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp858237imj; Fri, 15 Feb 2019 07:59:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IbtBeqHaWJ8mnbJJEH3vdB1Z/GxviMP04Zyyo9Dv//EC8m9YmF+HPx7NMyjfIKJ+P1CFual X-Received: by 2002:a63:c04b:: with SMTP id z11mr5937760pgi.135.1550246356897; Fri, 15 Feb 2019 07:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550246356; cv=none; d=google.com; s=arc-20160816; b=GwQVydVlVlah8UK8Lm6wb9Jjifo2kzYcqOKtbByByVU7PW/9q8B/wc5b9G+XlZUN3z O9vP/ybNSLr8h27XnJg5BZHoSmTdpoqecxFBP/77c54xprePtQShTF4XEb86HOIkfts9 Mvf6m5g3DPET5PLeFw5UVyKHb7jScz+fdMBwOOguG0wgwty/kbvrtECRHw1lyYkX8+NG 1TI78klqxYVzptrG0pRM+x/F/PdRaQheo0ECdJjQz5+NnSl86voDkXmVbJMNMraUS9Nv CGI+EQZo3ODTLfeAhq6mitKdR1Vc190sfJ4OTAWa5CYXsDT00Yb7h1cuXQe++UwvHOYs Ziyg== 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; bh=h9dhWfws00FGaZJnavQr1sfXJoZfp6EucNSB4XtOg+A=; b=Pj2wRCjh/gMRR7t6qCBeOVt8TFEmtik7vDe2rFA3x/xb8I641urhX09Kuhd66AZErX xkJd10N69TmxFs7h8xDMx9KpsqTeRvZv2vTaMO98Klo7tZpDR8ZEotZe4ZNTgF6HSqEe JnhojT5xiP/7HwkAZCyyM1LLEvX79NEQ+BpTh0Pc0uFAa3akCAl8s+/lbt/G3Nv8BqwD r6y2nvOTLIetLWQAcfU1Xcx9/vc/U6oLytEojaTyy7ZNVwK6GtucMfSQu2tzzI3Z0sBm 67fYW+6DD0QZdjPSKosMYPiC3zeAZbq2fPSTmycEpG0wJlPzyFhRTEb9RoY93fKcHaoz R7SA== 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 t4si5268525pgv.168.2019.02.15.07.59.01; Fri, 15 Feb 2019 07:59:16 -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 S1732072AbfBOJwf (ORCPT + 99 others); Fri, 15 Feb 2019 04:52:35 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:57220 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726308AbfBOJwe (ORCPT ); Fri, 15 Feb 2019 04:52:34 -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 092C6A78; Fri, 15 Feb 2019 01:52:34 -0800 (PST) Received: from e107981-ln.cambridge.arm.com (e107981-ln.cambridge.arm.com [10.1.197.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E24223F557; Fri, 15 Feb 2019 01:52:31 -0800 (PST) Date: Fri, 15 Feb 2019 09:52:21 +0000 From: Lorenzo Pieralisi To: Kishon Vijay Abraham I Cc: Gustavo Pimentel , Alan Douglas , Shawn Lin , Heiko Stuebner , Bjorn Helgaas , Jingoo Han , linux-omap@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 08/15] PCI: endpoint: Fix pci_epf_alloc_space to set correct MEM TYPE flags Message-ID: <20190215095214.GA24988@e107981-ln.cambridge.arm.com> References: <20190114111513.21618-1-kishon@ti.com> <20190114111513.21618-9-kishon@ti.com> <20190211173723.GA31035@e107981-ln.cambridge.arm.com> <20190214162928.GA32523@e107981-ln.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 15, 2019 at 11:49:12AM +0530, Kishon Vijay Abraham I wrote: > Hi Lorenzo, > > On 14/02/19 9:59 PM, Lorenzo Pieralisi wrote: > > On Wed, Feb 13, 2019 at 07:17:14PM +0530, Kishon Vijay Abraham I wrote: > >> Hi Lorenzo, > >> > >> On 11/02/19 11:07 PM, Lorenzo Pieralisi wrote: > >>> On Mon, Jan 14, 2019 at 04:45:06PM +0530, Kishon Vijay Abraham I wrote: > >>>> pci_epf_alloc_space() sets the MEM TYPE flags to indicate a 32-bit > >>>> Base Address Register irrespective of the size. Fix it here to indicate > >>>> 64-bit BAR if the size is > 2GB. > >>>> > >>>> Signed-off-by: Kishon Vijay Abraham I > >>>> --- > >>>> drivers/pci/endpoint/pci-epf-core.c | 4 +++- > >>>> 1 file changed, 3 insertions(+), 1 deletion(-) > >>> > >>> This looks like a fix and should me marked as such. Does it work > >>> as as standalone patch if it gets backported ? > >> > >> Yeah, it should work. But the current users doesn't allocate > 2GB and some > >> EPC drivers configure their registers based on size. So nothing is broken > >> without this patch as such. > > > > I suspect you mean 4GB (here and the commit log), right ? I am checking > > the commit logs, aiming at merging the patches. > > A 32bit BAR register can support a 'size' of only up to 2GB. Though it > can hold a memory address of up to 4GB. > > This is also mentioned in the PCI Local Bus Specification. "A 32-bit > register can be implemented to support a single memory size that is a > power of 2 from 16 bytes to 2 GB" Very true - sorry for the noise. Lorenz,o