linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/10] PCI: Double removing fix and allocate 64bit mmio pref
@ 2013-11-26  1:28 Yinghai Lu
  2013-11-26  1:28 ` [PATCH v2 01/10] PCI: Use device_release_driver in pci_stop_root_bus Yinghai Lu
                   ` (9 more replies)
  0 siblings, 10 replies; 71+ messages in thread
From: Yinghai Lu @ 2013-11-26  1:28 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Rafael J. Wysocki, Gu Zheng, Guo Chao, linux-pci, linux-kernel,
	Yinghai Lu

First 4 are for Gu Zheng <guz.fnst@cn.fujitsu.com> to help double pci
device removing via sysfs.

Second 6 are about mmio 64 allocation that could help Guo Chao <yan@linux.vnet.ibm.com> on powerpc mmio allocation.
It will try to assign 64 bit resource above 4g at first.

Could be found:
        git://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-yinghai.git for-pci-3.14

And it is based on current pci/for-linus.

-v2: update after patch that move device_del down to pci_destroy_dev.
     add "Try best to allocate pref mmio 64bit above 4G"

Yinghai Lu (10):
  PCI: Use device_release_driver in pci_stop_root_bus
  PCI: Move back pci_proc_attach_devices calling
  PCI: Move resources and bus_list releasing to pci_release_dev
  PCI: Destroy pci dev only once
  PCI: pcibus address to resource converting take bus directly
  PCI: Add pcibios_bus_addr_to_res()
  PCI: Try to allocate mem64 above 4G at first
  PCI: Try best to allocate pref mmio 64bit above 4g
  PCI: Sort pci root bus resources list
  intel-gtt: Read 64bit for gmar_bus_addr

 arch/x86/include/asm/pci.h   |   1 -
 drivers/char/agp/intel-gtt.c |  14 +++--
 drivers/pci/bus.c            |  58 +++++++++++++++----
 drivers/pci/host-bridge.c    |  48 +++++++++++-----
 drivers/pci/pci.h            |   2 +
 drivers/pci/probe.c          |  23 ++++++--
 drivers/pci/remove.c         |  31 +++-------
 drivers/pci/setup-bus.c      | 133 ++++++++++++++++++++++++++++---------------
 drivers/pci/setup-res.c      |  14 ++++-
 include/linux/pci.h          |  10 ++--
 10 files changed, 228 insertions(+), 106 deletions(-)

-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 71+ messages in thread
* Re: [PATCH v2 09/10] PCI: Sort pci root bus resources list
@ 2013-11-26  7:00 Steven Newbury
  2013-11-26 18:04 ` Bjorn Helgaas
  0 siblings, 1 reply; 71+ messages in thread
From: Steven Newbury @ 2013-11-26  7:00 UTC (permalink / raw)
  To: Bjorn Helgaas, Yinghai Lu; +Cc: linux-kernel, linux-pci


> On Mon, Nov 25, 2013 at 6:28 PM, Yinghai Lu <yinghai@kernel.org> wrote:
> > Some x86 systems expose above 4G 64bit mmio in _CRS as non-pref mmio range.
> > [   49.415281] PCI host bridge to bus 0000:00
> > [   49.419921] pci_bus 0000:00: root bus resource [bus 00-1e]
> > [   49.426107] pci_bus 0000:00: root bus resource [io  0x0000-0x0cf7]
> > [   49.433041] pci_bus 0000:00: root bus resource [io  0x1000-0x5fff]
> > [   49.440010] pci_bus 0000:00: root bus resource [mem 0x000a0000-0x000bffff]
> > [   49.447768] pci_bus 0000:00: root bus resource [mem 0xfed8c000-0xfedfffff]
> > [   49.455532] pci_bus 0000:00: root bus resource [mem 0x90000000-0x9fffbfff]
> > [   49.463259] pci_bus 0000:00: root bus resource [mem 0x380000000000-0x381fffffffff]
> >
> > During assign unassigned 64bit mmio resource, it will go through
> > every non-pref mmio for root bus in pci_bus_alloc_resource().
> > As the loop is with pci_bus_for_each_resource(), and could have chance
> > to use under 4G mmio range instead of above 4G mmio range if the requested
> > range is not big enough, even it could handle above 4G 64bit pref mmio.
> >
> > For root bus, we can order list from high to low in pci_add_resource_offset(),
> > during creating root bus, it will still keep the same order in final bus
> > resource list.
> >         pci_acpi_scan_root
> >                 ==> add_resources
> >                         ==> pci_add_resource_offset: # Add to temp resources
> >                 ==> pci_create_root_bus
> >                         ==> pci_bus_add_resource # add to final bus resources.
> >
> > After that, we can make sure 64bit pref mmio for pci bridges will be allocated
> > higest of mmio non-pref, and in this case it is above 4G instead of under 4G.
> 
> Sorry I'm so slow; I'd like to know what problem this solves, too.
> I'm trying to help people at distros figure out whether they will need
> to backport this change.

This series was originally instigated during my attempt to get a PCI
Radeon 5450 graphics card with a 32-bit PLX bridge working in a
(hot-plugable) docking station on a system which had insufficient free
resources below 4G.  The biggest PCI address space user in my case was
the integrated i965 graphics, which I wanted to also be working for my
use case.  Allowing the IGP to be mapped above 4G freed enough resources
to make my system work, and it's now been running this way for the last
couple of years. (I've been rebasing the series in my local kernel.)

I'm pretty sure there are other cases, particularly where hotplug is
required where maximising free PCI address space <4G is extremely
useful; and it's to my mind a generally a good principle to allocate
resources such that limited resources (large aligned ranges) are
preserved for allocations which *require* them.  Is this really any
different than ZONE_DMA?


^ permalink raw reply	[flat|nested] 71+ messages in thread

end of thread, other threads:[~2014-01-15 18:02 UTC | newest]

Thread overview: 71+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-26  1:28 [PATCH v2 00/10] PCI: Double removing fix and allocate 64bit mmio pref Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 01/10] PCI: Use device_release_driver in pci_stop_root_bus Yinghai Lu
2013-11-27  1:09   ` Rafael J. Wysocki
2013-11-26  1:28 ` [PATCH v2 02/10] PCI: Move back pci_proc_attach_devices calling Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 03/10] PCI: Move resources and bus_list releasing to pci_release_dev Yinghai Lu
2013-11-27  1:15   ` Rafael J. Wysocki
2013-11-27  2:15     ` Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 04/10] PCI: Destroy pci dev only once Yinghai Lu
2013-11-26  3:38   ` Bjorn Helgaas
2013-11-26 19:34     ` Yinghai Lu
2013-11-26 20:13       ` Yinghai Lu
2013-11-27  1:24         ` Rafael J. Wysocki
2013-11-27  2:26           ` Yinghai Lu
2013-11-29 23:38             ` Rafael J. Wysocki
2013-11-29 23:45               ` Rafael J. Wysocki
2013-11-30  0:31                 ` Rafael J. Wysocki
2013-11-30 21:37                   ` Rafael J. Wysocki
2013-11-30 22:27                     ` Yinghai Lu
2013-12-01  1:24                       ` Rafael J. Wysocki
2013-12-02  1:29                         ` Rafael J. Wysocki
2013-12-02 14:49                           ` Rafael J. Wysocki
2013-12-05 22:40                             ` Bjorn Helgaas
2013-12-06  1:21                               ` Rafael J. Wysocki
2013-12-06  6:29                                 ` Yinghai Lu
2014-01-10 14:20                                 ` [PATCH 0/9] PCI: Eliminate race conditions between hotplug and sysfs rescan/remove (Was: Re: [PATCH v2 04/10] PCI: Destroy pci dev only once) Rafael J. Wysocki
2014-01-10 14:22                                   ` [PATCH 1/9] PCI: Global rescan-remove lock Rafael J. Wysocki
2014-01-10 14:23                                   ` [PATCH 2/9] ACPI / PCI: Use global PCI rescan-remove locking in PCI root hotplug Rafael J. Wysocki
2014-01-10 14:24                                   ` [PATCH 3/9] ACPI / hotplug / PCI: Use global PCI rescan-remove locking Rafael J. Wysocki
2014-01-10 14:25                                   ` [PATCH 4/9] PCMCIA / cardbus: " Rafael J. Wysocki
2014-01-10 14:26                                   ` [PATCH 5/9] PCI / hotplug: " Rafael J. Wysocki
2014-01-10 14:27                                   ` [PATCH 6/9] platform / x86: " Rafael J. Wysocki
2014-01-10 14:27                                   ` [PATCH 7/9] MPT / PCI: Use pci_stop_and_remove_bus_device_locked() Rafael J. Wysocki
2014-01-10 14:28                                   ` [PATCH 8/9] powerpc / eeh_driver: Use global PCI rescan-remove locking Rafael J. Wysocki
2014-01-15 13:36                                     ` [Update][PATCH " Rafael J. Wysocki
2014-01-15 17:38                                       ` Bjorn Helgaas
2014-01-10 14:29                                   ` [PATCH 9/9] Xen / PCI: " Rafael J. Wysocki
2014-01-15 18:02                                   ` [PATCH 0/9] PCI: Eliminate race conditions between hotplug and sysfs rescan/remove (Was: Re: [PATCH v2 04/10] PCI: Destroy pci dev only once) Bjorn Helgaas
2013-12-06  6:52                             ` [PATCH v2 04/10] PCI: Destroy pci dev only once Yinghai Lu
2013-12-07  1:27                               ` Rafael J. Wysocki
2013-12-08  3:31                                 ` Yinghai Lu
2013-12-08  3:50                                   ` Greg Kroah-Hartman
2013-12-09 15:24                                     ` Ethan Zhao
2013-12-09 19:08                                       ` Greg Kroah-Hartman
2013-12-10  7:43                                         ` Ethan Zhao
2014-01-13  1:03                                 ` [PATCH] PCI / remove: Check parent kobject in pci_destroy_dev() (was: Re: [PATCH v2 04/10] PCI: Destroy pci dev only once) Rafael J. Wysocki
2013-11-27  1:17       ` [PATCH v2 04/10] PCI: Destroy pci dev only once Rafael J. Wysocki
2013-11-26  1:28 ` [PATCH v2 05/10] PCI: pcibus address to resource converting take bus directly Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 06/10] PCI: Add pcibios_bus_addr_to_res() Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 07/10] PCI: Try to allocate mem64 above 4G at first Yinghai Lu
2013-11-26  4:15   ` Bjorn Helgaas
2013-11-26 20:14     ` Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 08/10] PCI: Try best to allocate pref mmio 64bit above 4g Yinghai Lu
2013-11-26  4:17   ` Bjorn Helgaas
2013-11-26  6:59     ` Guo Chao
2013-11-26 17:53       ` Bjorn Helgaas
2013-11-26 22:00         ` Yinghai Lu
2013-11-26 22:01           ` Bjorn Helgaas
2013-11-27  0:33             ` Yinghai Lu
2013-11-26  1:28 ` [PATCH v2 09/10] PCI: Sort pci root bus resources list Yinghai Lu
2013-11-26  4:18   ` Bjorn Helgaas
2013-11-26  1:28 ` [PATCH v2 10/10] intel-gtt: Read 64bit for gmar_bus_addr Yinghai Lu
2013-11-26  3:46   ` Bjorn Helgaas
2013-11-26 19:35     ` Yinghai Lu
2013-12-11 18:48       ` Bjorn Helgaas
2013-12-11 19:58         ` Yinghai Lu
2013-12-21  0:27   ` Bjorn Helgaas
2013-12-21  1:19     ` Yinghai Lu
2013-12-21 18:50       ` Bjorn Helgaas
2013-12-23 22:33         ` Bjorn Helgaas
  -- strict thread matches above, loose matches on Subject: below --
2013-11-26  7:00 [PATCH v2 09/10] PCI: Sort pci root bus resources list Steven Newbury
2013-11-26 18:04 ` Bjorn Helgaas

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).