Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp1015458img; Thu, 28 Feb 2019 11:32:03 -0800 (PST) X-Google-Smtp-Source: APXvYqx46B454/e0RbFjo8LA3fceZMU4tVsyq5OqUndIdixOhBpc1YflriLp1ZIBY+Gj/l9ZHKaP X-Received: by 2002:a63:5207:: with SMTP id g7mr756837pgb.253.1551382323749; Thu, 28 Feb 2019 11:32:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551382323; cv=none; d=google.com; s=arc-20160816; b=mjoJLIVvXyvUAFhm1CkpwdDGXAWwr7QkYihBzRjhPu+7xzqGI40yZ6u8UcNpqjiB+j hlYZqJmZLUHAnJMmCRfWnTqOHAD17h5z7m+SwKdv5obN3RjkbwdfMTnu3rcHB94YjXeP TMB81v7dJrFppC8XvWzDVEHhqhU9ivgViVfCYmZRvfPm98vYg4X3JmsMdRUKGkw9zS6h R26s1A2vYgelozhI/Umar9ZsL5OastL7U2AfTOlvIVc9s6QtTF64dmX3ZLoDlAPcYi2Z jXvU02Rppdlfu52CqXVwaZoPze74/P/K5ho5tWYNZFKcw8DwxuMlEAVJwjHdz5S7BWO5 rZXQ== 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=0KjEWSRIsl/20j1gIfryGjsVLenRrkRM4H5w4RdUSd0=; b=LnfUVdADbBLgARFtT8fZ6gDN3ruoYX1Ti5+TySHA6SE+tLefQ6+ytS9WLidkMOs5AS WOEmSGCppmRreCZkbdcmE4jt3rHNpEugsJAcy+xAYReytlLviBlKnqyAkaxq+8dHME6E xlejdLbi8JGAg7r3zbFOqatYNvLNIbckg77HnEOeaCbiMm1osuP5u6OFupPDyZkpuXuP sr/u0hlBhAJwXbEa53QGVDlpxAdR7y25VGQXaPNztBhdnutUECji4wAte+Mg+C+2r86R YbIcbhFLzVMYKf+b9lyzSc59xp0jWZfDnZNG1YJiPbH/EubpwE+peFuE1jf4AW/XIpuV vvpw== 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 l71si16850154pgd.529.2019.02.28.11.31.33; Thu, 28 Feb 2019 11:32:03 -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 S1731905AbfB1QNL (ORCPT + 99 others); Thu, 28 Feb 2019 11:13:11 -0500 Received: from foss.arm.com ([217.140.101.70]:51118 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726403AbfB1QNK (ORCPT ); Thu, 28 Feb 2019 11:13:10 -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 2FF41A78; Thu, 28 Feb 2019 08:13:10 -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 62F143F720; Thu, 28 Feb 2019 08:13:08 -0800 (PST) Date: Thu, 28 Feb 2019 16:13:03 +0000 From: Lorenzo Pieralisi To: Srinath Mannam Cc: Bjorn Helgaas , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Abhishek Shah , Ray Jui Subject: Re: [PATCH v3 2/2] PCI: iproc: Add outbound configuration for 32-bit I/O region Message-ID: <20190228161303.GA23441@e107981-ln.cambridge.arm.com> References: <1550680435-9706-1-git-send-email-srinath.mannam@broadcom.com> <1550680435-9706-3-git-send-email-srinath.mannam@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1550680435-9706-3-git-send-email-srinath.mannam@broadcom.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 Wed, Feb 20, 2019 at 10:03:55PM +0530, Srinath Mannam wrote: > In the present driver outbound window configuration is done to map above > 32-bit address I/O regions with corresponding PCI memory range given in > ranges DT property. > > This patch add outbound window configuration to map below 32-bit I/O range > with corresponding PCI memory, which helps to access I/O region in IA32 I think you mean ARM 32-bit here, not IA32. > and one to one mapping of I/O region to PCI memory. > > Ex: > 1. ranges DT property given for current driver is, > ranges = <0x83000000 0x0 0x40000000 0x4 0x00000000 0 0x40000000>; > I/O region address is 0x400000000 > 2. ranges DT property can be given after this patch, > ranges = <0x83000000 0x0 0x42000000 0x0 0x42000000 0 0x2000000>; > I/O region address is 0x42000000 > > Signed-off-by: Srinath Mannam > Signed-off-by: Abhishek Shah > Signed-off-by: Ray Jui > Reviewed-by: Scott Branden > Reviewed-by: Vikram Prakash I asked you before, please point me at mailing list discussions where these review tags were given, v1 was already carrying them but that's not how the process works, they have to be given on mailing lists. Lorenzo > --- > drivers/pci/controller/pcie-iproc.c | 21 +++++++++++++++++++-- > 1 file changed, 19 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c > index b882255..080f142 100644 > --- a/drivers/pci/controller/pcie-iproc.c > +++ b/drivers/pci/controller/pcie-iproc.c > @@ -955,8 +955,25 @@ static int iproc_pcie_setup_ob(struct iproc_pcie *pcie, u64 axi_addr, > resource_size_t window_size = > ob_map->window_sizes[size_idx] * SZ_1M; > > - if (size < window_size) > - continue; > + /* > + * Keep iterating until we reach the last window and > + * with the minimal window size at index zero. In this > + * case, we take a compromise by mapping it using the > + * minimum window size that can be supported > + */ > + if (size < window_size) { > + if (size_idx > 0 || window_idx > 0) > + continue; > + > + /* > + * For the corner case of reaching the minimal > + * window size that can be supported on the > + * last window > + */ > + axi_addr = ALIGN_DOWN(axi_addr, window_size); > + pci_addr = ALIGN_DOWN(pci_addr, window_size); > + size = window_size; > + } > > if (!IS_ALIGNED(axi_addr, window_size) || > !IS_ALIGNED(pci_addr, window_size)) { > -- > 2.7.4 >