linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH 3/3] PCI: tegra: Stop setting pcibios_min_mem
Date: Tue, 26 Jul 2016 14:59:54 -0500	[thread overview]
Message-ID: <20160726195954.GA15037@localhost> (raw)
In-Reply-To: <20160726095415.GD2433@ulmo.ba.sec>

On Tue, Jul 26, 2016 at 11:54:15AM +0200, Thierry Reding wrote:
> On Mon, Jul 25, 2016 at 04:28:50PM -0500, Bjorn Helgaas wrote:
> > On Thu, Jun 30, 2016 at 03:14:30PM +0200, Thierry Reding wrote:
> > > From: Thierry Reding <treding@nvidia.com>
> > > 
> > > In practice this value will never be used and it hinders portability of
> > > the driver, so remove it.
> > > 
> > > Signed-off-by: Thierry Reding <treding@nvidia.com>
> > > ---
> > >  drivers/pci/host/pci-tegra.c | 2 --
> > >  1 file changed, 2 deletions(-)
> > > 
> > > diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
> > > index f04b062e8c67..bbf77a49517d 100644
> > > --- a/drivers/pci/host/pci-tegra.c
> > > +++ b/drivers/pci/host/pci-tegra.c
> > > @@ -2249,8 +2249,6 @@ static int tegra_pcie_probe(struct platform_device *pdev)
> > >  	if (err < 0)
> > >  		return err;
> > >  
> > > -	pcibios_min_mem = 0;
> > 
> > unsigned long pcibios_min_mem = 0x01000000;   # arch/arm/mm/iomap.c
> > #define PCIBIOS_MIN_MEM pcibios_min_mem       # arch/arm/include/asm/pci.h
> > 
> > PCIBIOS_MIN_MEM is used in __pci_assign_resource().
> > 
> > It looks to me like we still use pcibios_min_mem; am I missing something?
> 
> The problem is that pcibios_min_mem is only defined on 32-bit ARM, so
> we'd need to conditionalize (with a preprocessor macro) the usage.
> However it turns out that it's not necessary because PCIBIOS_MIN_MEM
> only serves as a lower bound during resource assignment.
> 
> pci_bus_alloc_resource() will eventually end up assigning from one of
> the regions defined in device tree and the lowest we'll ever start any
> of the memory regions is 0x12000000 (Tegra124).
> 
> So instead of conditionalizing I've simply dropped the assignment
> because the default works fine for Tegra.

Oh, I see, yep, that makes sense now.  I merged this with the
following changelog:

    PCI: tegra: Stop setting pcibios_min_mem
    
    pcibios_min_mem only exists on 32-bit ARM, so using it in pci-tegra.c
    prevents the driver from being used on other arches.
    
    In __pci_assign_resource(), we clip the available area based on
    PCIBIOS_MIN_MEM.  On 32-bit ARM, this is pcibios_min_mem, with a default
    value of 0x01000000.  For Tegra, we discover the space available for PCI
    resource allocation from the device tree, and the lowest address that will
    ever be available is 0x12000000 (on Tegra124).
    
    The Tegra windows are always higher than the default pcibios_min_mem, so
    the __pci_assign_resource() has no effect, so there's no need to adjust
    pcibios_min_mem here.

Bjorn

      reply	other threads:[~2016-07-26 19:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-30 13:14 [PATCH 1/3] PCI: tegra: Make register definitions consistent Thierry Reding
2016-06-30 13:14 ` [PATCH 2/3] PCI: tegra: Use pci_remap_iospace() Thierry Reding
2016-06-30 13:14 ` [PATCH 3/3] PCI: tegra: Stop setting pcibios_min_mem Thierry Reding
2016-07-25 21:28   ` Bjorn Helgaas
2016-07-26  9:54     ` Thierry Reding
2016-07-26 19:59       ` Bjorn Helgaas [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160726195954.GA15037@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).