[PATCH v7 53/60] resources: Split out __allocate_resource()

2015-10-08 Thread Yinghai Lu
y take lock" is *wrong*. Signed-off-by: Yinghai Lu Acked-by: Linus Torvalds --- kernel/resource.c | 70 +++ 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 6927298..62321b0 100644 ---

[PATCH v7 55/60] PCI, x86: Allocate from high in available window for MMIO

2015-10-08 Thread Yinghai Lu
range like 0xb000 to 0b:04.0 and 0f:00.0 Signed-off-by: Yinghai Lu --- arch/x86/pci/i386.c | 20 drivers/pci/setup-bus.c | 11 ++- include/linux/pci.h | 3 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/x86/pci/i386.c b/arch/x86

[PATCH v7 32/60] PCI: Treat ROM resource as optional during realloc

2015-10-08 Thread Yinghai Lu
expand path. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 74ad4ce..d2d38bc 100644 --- a/drivers/pci/setup-bus.c +++ b

[PATCH v7 18/60] PCI: Set resource to FIXED for LSI devices

2015-10-08 Thread Yinghai Lu
: Yinghai Lu Cc: sta...@vger.kernel.org --- drivers/pci/pci.h | 1 + drivers/pci/quirks.c| 20 drivers/pci/setup-bus.c | 4 3 files changed, 25 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 6ad0f05..39d2c50 100644 --- a/drivers/pci

[PATCH v7 10/60] OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resource

2015-10-08 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu Cc: Grant Likely Cc: Rob Herring Cc: devicet...@vger.kernel.org --- drivers/of/address.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index 384574c..3399602 100644 --- a

[PATCH v7 16/60] PCI: Don't release fixed resource for realloc

2015-10-08 Thread Yinghai Lu
We should not release bridge resource if there is fixed resources under it, otherwise the children firmware would stop working. Reported-by: Paul Johnson Suggested-by: Bjorn Helgaas Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=92351 Signed-off-by: Yinghai Lu Cc: sta...@vger.kernel.org

[PATCH v7 17/60] PCI: Claim fixed resource during remove/rescan path

2015-10-08 Thread Yinghai Lu
citly. Signed-off-by: Yinghai Lu --- drivers/pci/quirks.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 55bb661..e7e86d3 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -323,6 +323,23 @@ static void quirk_s

[PATCH v7 14/60] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64

2015-10-08 Thread Yinghai Lu
If host bridge does not have mmio64 above 4G, We don't need to treat device non-pref mmio64 as as pref mmio64. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c

[PATCH v7 41/60] PCI: Skip required+optional if there is no optional

2015-10-08 Thread Yinghai Lu
If the bridge does not support hotplug and has no child with sriov support, We will not have optional resources. We could get out early and don't try required+optional allocation. Also in the loop that update res with optional add info, skip resource that add_size is 0. Signed-off-by: Yingh

[PATCH v7 52/60] PCI: Kill macro checking for bus io port sizing

2015-10-08 Thread Yinghai Lu
We can use new generic version skip_isa_ioresource_align() instead of macro, and then kill the marco. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c

[PATCH v7 43/60] PCI: Add alt_size ressource allocation support

2015-10-08 Thread Yinghai Lu
Reported-by: Yijing Wang Tested-by: Yijing Wang Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 203 +--- 1 file changed, 191 insertions(+), 12 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index ede619c..dea0344

[PATCH v7 19/60] PCI: Separate realloc list checking after allocation

2015-10-08 Thread Yinghai Lu
We check the realloc list, as list must be empty after allocation. Separate the realloc list checking to another function. Add checking that is missed in acpiphp driver. -v2: change to WARN_ON according to Rafael. Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Len Brown C

[PATCH v7 60/60] PCI: Only try to assign io port only for root bus that support it

2015-10-08 Thread Yinghai Lu
supports I/O, and later during sizing and assigning, check that flags and skip those resources. Signed-off-by: Yinghai Lu --- drivers/pci/probe.c | 6 ++ drivers/pci/setup-bus.c | 9 + include/linux/pci.h | 1 + 3 files changed, 16 insertions(+) diff --git a/drivers/pci

[PATCH v7 34/60] PCI: Simplify res reference using in __assign_resources_sorted()

2015-10-08 Thread Yinghai Lu
There are couples of dev_res->res reference, to make code more readable use res instead of dev_res->res directly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pci/setup

[PATCH v7 54/60] resources: Make allocate_resource() return best fit resource

2015-10-08 Thread Yinghai Lu
: updated after __allocate_resource change, and add field in constraint instead of passing it directly. -v3: Use best fit instead of just fit according to Bjorn. Signed-off-by: Yinghai Lu --- kernel/resource.c | 81 ++- 1 file changed, 68

[PATCH v7 09/60] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-10-08 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Gavin Shan Cc: Yijing Wang Cc: Anton Blanchard Cc: linuxppc-...@lists.ozlabs.org --- arch/powerpc/kernel/pci_of_scan.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH v7 45/60] PCI: Fix size calculation with old_size on rescan path

2015-10-08 Thread Yinghai Lu
se smaller add_align as must align. After the patch, rescan works properly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 7e7663a..00a39be 100644 --- a/d

[PATCH v7 23/60] PCI: Cleanup res_to_dev_res() printout

2015-10-08 Thread Yinghai Lu
: change to %#llx according to Bjorn. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 10270e4..f905c81 100644 --- a/drivers/pci/setup

[PATCH v7 33/60] PCI: Add debug printout during releasing partial assigned resources

2015-10-08 Thread Yinghai Lu
happens, we only print out "assigned" info, that is confusing as it looks like same range is assigned to two peer resources at the same time. Add printout for releasing so we have whole picture in debug messages. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 14 +++--- 1 fi

[PATCH v7 59/60] PCI: Don't set flags to 0 when assign resource fail

2015-10-08 Thread Yinghai Lu
We want to keep resource flags instead of clearing it after resource allocation fails. Make flags take IORESOURCE_UNSET | IORESOURCE_DISABLED instead. Suggested-by: Bjorn Helgaas Signed-off-by: Yinghai Lu --- drivers/pci/bus.c | 2 +- drivers/pci/setup-bus.c | 45

[PATCH v7 13/60] PCI: Add has_mem64 for struct host_bridge

2015-10-08 Thread Yinghai Lu
keep pref mmio64 and pref mmio32 under bridge pref bar. Signed-off-by: Yinghai Lu --- drivers/pci/probe.c | 7 +++ include/linux/pci.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 2c69441..edc8d08 100644 --- a/drivers/pci/probe.c +++ b/d

[PATCH v7 04/60] sparc/PCI: Reserve legacy mmio after PCI mmio

2015-10-08 Thread Yinghai Lu
0c000-0x20010]: no compatible bridge window The bridge 00:02.0 resource does not get reserved as Video RAM take the position early, and following children all failed. Move down Video RAM area reservation after pci mmio get reserved, so we leave pci driver to use those regions. Sign

Re: 4.3-rc3 BAR allocation problems on multiple machines

2015-10-07 Thread Yinghai Lu
On Wed, Oct 7, 2015 at 2:25 AM, Meelis Roos wrote: > amd64 machine: > > http://kodu.ut.ee/~mroos/dm/dm.x2100 [0.156360] bus: [bus 00-05] on node 0 link 0 [0.156362] bus: 00 [io 0x-0x] [0.156364] bus: 00 [mem 0x000a-0x000b] [0.156365] bus: 00 [mem 0xfe03-0x

Re: 4.3-rc3 BAR allocation problems on multiple machines

2015-10-07 Thread Yinghai Lu
; of them - on many sparc64 machines and some on x86. > > In another thread for "Resource allocation cleanup for v4.4", Yinghai Lu > asked for full dmesg to solve another similar case. So to help > understanding this one, here are the dmesgs of my machines: > > sparc64 mac

Re: [PATCH v4 0/5] PCI: Add support for PCI Enhanced Allocation "BARs"

2015-10-02 Thread Yinghai Lu
On Fri, Oct 2, 2015 at 3:37 PM, David Daney wrote: > From: David Daney > > PCI Enhanced Allocation is a new method of allocating MMIO & IO > resources for PCI devices & bridges. It can be used instead > of the traditional PCI method of using BARs. > > EA entries are hardware-initialized to a fixe

Re: [PATCH v4 3/5] PCI: Handle IORESOURCE_PCI_FIXED when sizing and assigning resources.

2015-10-02 Thread Yinghai Lu
On Fri, Oct 2, 2015 at 4:38 PM, David Daney wrote: > On 10/02/2015 04:14 PM, Yinghai Lu wrote: >> >> https://patchwork.kernel.org/patch/7304371/ >> [v6,06/53] PCI: Claim fixed resource during remove/rescan path > > > This one is interesting, but I don't think i

Re: [PATCH v6 01/53] sparc/PCI: Add mem64 resource parsing for root bus

2015-10-02 Thread Yinghai Lu
On Fri, Oct 2, 2015 at 4:05 PM, Khalid Aziz wrote: > On 10/02/2015 04:05 PM, Yinghai Lu wrote: > I still see lots of "no compatible > bridge window" messages but overlapping address ranges are no longer > reserved Please send boot log to me, I'd like to fix t

Re: [PATCH v4 3/5] PCI: Handle IORESOURCE_PCI_FIXED when sizing and assigning resources.

2015-10-02 Thread Yinghai Lu
On Fri, Oct 2, 2015 at 3:37 PM, David Daney wrote: > From: David Daney > > The new Enhanced Allocation (EA) capability support creates resources > with the IORESOURCE_PCI_FIXED set. This creates a couple of problems: > > 1) Since these resources cannot be relocated or resized, their >alignme

Re: [PATCH v6 01/53] sparc/PCI: Add mem64 resource parsing for root bus

2015-10-02 Thread Yinghai Lu
On Fri, Oct 2, 2015 at 1:00 PM, Khalid Aziz wrote: > On Wed, 2015-09-30 at 22:52 -0700, Yinghai Lu wrote: >> Found "no compatible bridge window" warning in boot log from T5-8. >> >> pci :00:01.0: can't claim BAR 15 [mem 0x1-0x4afff pref]: no &g

[PATCH v6 20/53] PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare()

2015-09-30 Thread Yinghai Lu
pdev_sort_resources() etc was checking devices resources and putting resources that need to assign to one list in sorted order. Now we don't do sorting in those functions anymore, so change to pdev_assign_resources_prepare() instead. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c

[PATCH v6 49/53] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64

2015-09-30 Thread Yinghai Lu
If host bridge does not have mmio64 above 4G, We don't need to treat device non-pref mmio64 as as pref mmio64. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c

[PATCH v6 34/53] PCI: Fix size calculation with old_size on rescan path

2015-09-30 Thread Yinghai Lu
se smaller add_align as must align. After the patch, rescan works properly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index ba5635a..b6bfa1f 100644 --- a/d

[PATCH v6 51/53] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs

2015-09-30 Thread Yinghai Lu
Now some BIOS tend to allocate pref MMIO under non-pref MMIO, or allocate 64bit pref MMIO under 4G. Add pci=assign_pref_bars to clear and allocate resource to pref BARS. So could reallocate pref mmio64 above 4G and pref under bridges pref BARs. Signed-off-by: Yinghai Lu --- arch/x86/include

[PATCH v6 26/53] PCI: Check if resource is allocated before trying to assign one

2015-09-30 Thread Yinghai Lu
In following alt_size support, we will call pci_assign_resource() several times on one resource list, and some resources could have been assigned already. Skip allocated resource in the list, as pci_assign_resource() only can handle not assigned resource. Signed-off-by: Yinghai Lu --- drivers

[PATCH v6 44/53] PCI, x86: Allocate from high in available window for MMIO

2015-09-30 Thread Yinghai Lu
range like 0xb000 to 0b:04.0 and 0f:00.0 Signed-off-by: Yinghai Lu --- arch/x86/pci/i386.c | 20 drivers/pci/setup-bus.c | 11 ++- include/linux/pci.h | 3 +++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/arch/x86/pci/i386.c b/arch/x86

[PATCH v6 52/53] PCI: Introduce resource_disabled()

2015-09-30 Thread Yinghai Lu
nux-i...@vger.kernel.org Cc: linux-am33-l...@redhat.com Cc: linuxppc-...@lists.ozlabs.org Cc: linux-s...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: linux-xte...@linux-xtensa.org Cc: io...@lists.linux-foundation.org Cc: linux...@vger.kernel.org Signed-off-by: Yinghai Lu ---

[PATCH v6 24/53] PCI: Add __add_to_list()

2015-09-30 Thread Yinghai Lu
For alt_size support, we will add more entries to realloc list. Add new __add_to_list() to take alt_size, alt_align. And simplify add_to_list() not to take add/alt input. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 51 ++--- 1 file

[PATCH v6 12/53] PCI: Cleanup res_to_dev_res() printout

2015-09-30 Thread Yinghai Lu
: change to %#llx according to Bjorn. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 34 -- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 6b6a4ed..2256ce6 100644 --- a/drivers/pci/setup

[PATCH v6 00/53] PCI: Resource allocation cleanup for v4.4

2015-09-30 Thread Yinghai Lu
location near end of avialable window v6: - reorder patches according to Bjorn. Yinghai Lu (53): sparc/PCI: Add mem64 resource parsing for root bus sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF p

[PATCH v6 01/53] sparc/PCI: Add mem64 resource parsing for root bus

2015-09-30 Thread Yinghai Lu
start as offset. -v3: add IORESOURCE_MEM_64 flag Fixes: commit d63e2e1f3df9 ("sparc/PCI: Clip bridge windows to fit in upstream windows") Link: http://lkml.kernel.org/r/cae9fiqu1gjy1lyrxs+ma5lcteee4xmtjrg0axj9k_tsu+m9...@mail.gmail.com Reported-by: David Ahern Tested-by: David Ahern

[PATCH v6 17/53] PCI: Don't add too much optional size for hotplug bridge MMIO

2015-09-30 Thread Yinghai Lu
, and total size should be 2M. This patch change to comparing required+optional with min_sum_size to get smaller optional size. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/pci/setup

[PATCH v6 27/53] PCI: Separate out save_resources()/restore_resources()

2015-09-30 Thread Yinghai Lu
We need to save/restore resources several times for alt_size support, separate the save_resources()/resources() to save some lines later. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 49 ++--- 1 file changed, 30 insertions(+), 19 deletions

[PATCH v6 38/53] PCI: Unify calculate_size() for io port and MMIO

2015-09-30 Thread Yinghai Lu
Now calculate_memsize() and calculate_iosize() is the same. Change them to calculate_size(). Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c

[PATCH v6 41/53] PCI: Kill macro checking for bus io port sizing

2015-09-30 Thread Yinghai Lu
We can use new generic version skip_isa_ioresource_align() instead of macro, and then kill the marco. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c

[PATCH v6 16/53] PCI: Optimize bus align/size calculation for optional during sizing

2015-09-30 Thread Yinghai Lu
: 0x10/0x2b0, and it is much better than original required+optional align/size: 0x80/0x300 and even have smaller min_align than required. -v2: remove not used size1 in calculate_memsize Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Reported-by: TJ Signed-off-by: Yinghai Lu

[PATCH v6 30/53] PCI: Skip required+optional if there is no optional

2015-09-30 Thread Yinghai Lu
If the bridge does not support hotplug and has no child with sriov support, We will not have optional resources. We could get out early and don't try required+optional allocation. Also in the loop that update res with optional add info, skip resource that add_size is 0. Signed-off-by: Yingh

[PATCH v6 47/53] PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64

2015-09-30 Thread Yinghai Lu
re we check them for child device resources. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 86900ac..3b27c8c 100644 --- a/drivers/pci/setup-bus.c

[PATCH v6 21/53] PCI: Treat ROM resource as optional during realloc

2015-09-30 Thread Yinghai Lu
expand path. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 0a89d06..554d019 100644 --- a/drivers/pci/setup-bus.c +++ b

[PATCH v6 25/53] PCI: Cache window alignment value during bus sizing

2015-09-30 Thread Yinghai Lu
There are several calling to window_alignment(), and we will have more for alt_size support, cache the value instead of keeping on getting it. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/setup

[PATCH v6 18/53] PCI: Reorder resources list for required/optional resources

2015-09-30 Thread Yinghai Lu
, and call it two times accordingly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 62 + 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 6fda7ad..92677c5 100644 --- a

[PATCH v6 33/53] PCI: Add support for more than two alt_size entries under same bridge

2015-09-30 Thread Yinghai Lu
-by: Yinghai Lu --- drivers/pci/setup-bus.c | 56 +++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index f19b098..ba5635a 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

[PATCH v6 39/53] PCI: Allow bridge optional only io port resource required size to be 0

2015-09-30 Thread Yinghai Lu
device, size will not be 0. when the bridge supports hotplug, min_size will not be 0. So they will still honor the old size as required size. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/setup-bus.c b

[PATCH v6 37/53] PCI: Don't add too much io port for hotplug bridge with old size

2015-09-30 Thread Yinghai Lu
are using size to compare with min_size at first. That is not right, we should have 0x2000. We can check size+size1 with min_size for io port, and just add size1 to size without passing extra size1 into calculate_iosize(). Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 8 1

[PATCH v6 42/53] resources: Split out __allocate_resource()

2015-09-30 Thread Yinghai Lu
y take lock" is *wrong*. Signed-off-by: Yinghai Lu Acked-by: Linus Torvalds --- kernel/resource.c | 70 +++ 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/kernel/resource.c b/kernel/resource.c index 6927298..62321b0 100644 ---

[PATCH v6 35/53] PCI: Don't add too much optional size for hotplug bridge io

2015-09-30 Thread Yinghai Lu
Same as patch for MMIO (PCI: Don't add too much optional size for hotplug bridge MMIO), and this one is for io port. It will compare required+optional with min_sum_size to get smaller optional size. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 26 -- 1

[PATCH v6 48/53] PCI: Add has_mem64 for struct host_bridge

2015-09-30 Thread Yinghai Lu
keep pref mmio64 and pref mmio32 under bridge pref bar. Signed-off-by: Yinghai Lu --- drivers/pci/probe.c | 9 + include/linux/pci.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 9eb9e30..31998ea 100644 --- a/drivers/pci/probe.c +++ b/d

[PATCH v6 50/53] PCI: Restore pref MMIO allocation logic for host bridge without mmio64

2015-09-30 Thread Yinghai Lu
ll. The patch restore to old logic: when host bridge does not have has_mem64, put children pref mmio64 and pref mmio32 all under bridges pref bars. Signed-off-by: Yinghai Lu --- drivers/pci/bus.c | 4 +++- drivers/pci/setup-bus.c | 13 + drivers/pci/setup-res.c | 9 ++---

[PATCH v6 45/53] PCI: Add debug print out for min_align and alt_size

2015-09-30 Thread Yinghai Lu
Put all print out for all children align/size and result align/size together. We can print out device name at same time with min_align/alt_size calculation. So we can shut off debug print out from get_res_add_size() and get_res_add_align(). Signed-off-by: Yinghai Lu --- drivers/pci/setup

[PATCH v6 46/53] PCI: Check pref compatible bit for mem64 resource of PCIe device

2015-09-30 Thread Yinghai Lu
+ma5lcteee4xmtjrg0axj9k_tsu+m9...@mail.gmail.com Reported-by: David Ahern Tested-by: David Ahern Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Tested-by: TJ Signed-off-by: Yinghai Lu --- drivers/pci/pci.c | 3 ++- drivers/pci/pci.h | 2 ++ drivers/pci/probe.c | 33

[PATCH v6 53/53] PCI: Don't set flags to 0 when assign resource fail

2015-09-30 Thread Yinghai Lu
We want to keep resource flags instead of clearing it after resource allocation fails. Make flags take IORESOURCE_UNSET | IORESOURCE_DISABLED instead. Suggested-by: Bjorn Helgaas Signed-off-by: Yinghai Lu --- drivers/pci/bus.c | 2 +- drivers/pci/setup-bus.c | 45

[PATCH v6 43/53] resources: Make allocate_resource() return best fit resource

2015-09-30 Thread Yinghai Lu
: updated after __allocate_resource change, and add field in constraint instead of passing it directly. -v3: Use best fit instead of just fit according to Bjorn. Signed-off-by: Yinghai Lu --- kernel/resource.c | 81 ++- 1 file changed, 68

[PATCH v6 40/53] PCI: Unify skip_ioresource_align()

2015-09-30 Thread Yinghai Lu
-...@lists.ozlabs.org Cc: linux-a...@vger.kernel.org Signed-off-by: Yinghai Lu --- arch/microblaze/pci/pci-common.c | 8 arch/powerpc/kernel/pci-common.c | 11 +-- arch/x86/include/asm/pci_x86.h | 1 - arch/x86/pci/common.c| 4 ++-- arch/x86/pci/i386.c | 12

[PATCH v6 10/53] PCI: Get new realloc size for bridge for last try

2015-09-30 Thread Yinghai Lu
urce. Clear the old resource size for last try or third and later try. Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Tested-by: TJ Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/drive

[PATCH v6 23/53] PCI: Simplify res reference using in __assign_resources_sorted()

2015-09-30 Thread Yinghai Lu
There are couples of dev_res->res reference, to make code more readable use res instead of dev_res->res directly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pci/setup

[PATCH v6 32/53] PCI: Add alt_size ressource allocation support

2015-09-30 Thread Yinghai Lu
Reported-by: Yijing Wang Tested-by: Yijing Wang Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 203 +--- 1 file changed, 191 insertions(+), 12 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 29b2495..f19b098

[PATCH v6 11/53] PCI: Don't release sibling bridge resources during hotplug

2015-09-30 Thread Yinghai Lu
. Reported-by: Andreas Noever Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 8477cf5..6b6a4ed 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

[PATCH v6 09/53] PCI: Treat optional as required in first try for bridge rescan

2015-09-30 Thread Yinghai Lu
info (include must and optonal separatedly) will be kept for next try. 2. last try: a: try to allocate required+optional to see if all get allocated. b: try to allocate required then expand to optional. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 19 ++- 1

[PATCH v6 15/53] PCI: Optimize bus min_align/size calculation during sizing

2015-09-30 Thread Yinghai Lu
ces. Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Reported-by: TJ Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 195 ++-- 1 file changed, 157 insertions(+), 38 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bu

[PATCH v6 05/53] PCI: Don't release fixed resource for realloc

2015-09-30 Thread Yinghai Lu
We should not release bridge resource if there is fixed resources under it, otherwise the children firmware would stop working. Reported-by: Paul Johnson Suggested-by: Bjorn Helgaas Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=92351 Signed-off-by: Yinghai Lu Cc: sta...@vger.kernel.org

[PATCH v6 04/53] OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resource

2015-09-30 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu Cc: Grant Likely Cc: Rob Herring Cc: devicet...@vger.kernel.org --- drivers/of/address.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/of/address.c b/drivers/of/address.c index 384574c..3399602 100644 --- a

[PATCH v6 02/53] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-09-30 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org --- arch/sparc/kernel/of_device_32.c | 5 +++-- arch/sparc/kernel/of_device_64.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/sparc/kernel/of_dev

[PATCH v6 36/53] PCI: Move ISA io port align out of calculate_iosize()

2015-09-30 Thread Yinghai Lu
< 0x400. We need to check size, and add extra size to make sure bit8/9 to be zero. Also need to apply same checking for optional size path. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) d

[PATCH v6 31/53] PCI: Move saved required resource list out of required+optional assigning

2015-09-30 Thread Yinghai Lu
We will need to share saved required list for alt_size support, so move it out from required+optional assigning. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/drivers/pci/setup-bus.c b

[PATCH v6 19/53] PCI: Remove duplicated code for resource sorting

2015-09-30 Thread Yinghai Lu
Now sort_resources() and pdev_sort_resources() all have sorting code. As we are going to call sort_resources() several places later for alt_size support, so choose to remove related code in pdev_sort_resources(). Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 22

[PATCH v6 13/53] PCI: Reuse res_to_dev_res() in reassign_resources_sorted()

2015-09-30 Thread Yinghai Lu
Now res_to_dev_res() does not print out debug message anymore, so we can reuse it in reassign_resource_sorted() without confusing printout. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pci/setup

[PATCH v6 14/53] PCI: Use correct align for optional only resources during sorting

2015-09-30 Thread Yinghai Lu
: TJ Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 49 ++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index a62cbd2..79bc2cb 100644 --- a/drivers/pci/setup-bus.c +++ b

[PATCH v6 22/53] PCI: Add debug printout during releasing partial assigned resources

2015-09-30 Thread Yinghai Lu
happens, we only print out "assigned" info, that is confusing as it looks like same range is assigned to two peer resources at the same time. Add printout for releasing so we have whole picture in debug messages. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 14 +++--- 1 fi

[PATCH v6 07/53] PCI: Set resource to FIXED for LSI devices

2015-09-30 Thread Yinghai Lu
: Yinghai Lu Cc: sta...@vger.kernel.org --- drivers/pci/pci.h | 1 + drivers/pci/quirks.c| 20 drivers/pci/setup-bus.c | 4 3 files changed, 25 insertions(+) diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 24ba9dc..c04c9f1 100644 --- a/drivers/pci

[PATCH v6 28/53] PCI: Move comment to pci_need_to_release()

2015-09-30 Thread Yinghai Lu
Move comment from caller to pci_need_to_release(), as we will have one new caller for alt_size support. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci

[PATCH v6 08/53] PCI: Separate realloc list checking after allocation

2015-09-30 Thread Yinghai Lu
We check the realloc list, as list must be empty after allocation. Separate the realloc list checking to another function. Add checking that is missed in acpiphp driver. -v2: change to WARN_ON addording to Rafael. Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Len Brown C

[PATCH v6 29/53] PCI: Separate required+optional assigning to another function

2015-09-30 Thread Yinghai Lu
__assign_resources_sorted() is getting too big if we put alt_size support into it. Split out required+optional assigning code to another function. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 47 +++ 1 file changed, 27 insertions(+), 20

[PATCH v6 06/53] PCI: Claim fixed resource during remove/rescan path

2015-09-30 Thread Yinghai Lu
citly. Signed-off-by: Yinghai Lu --- drivers/pci/quirks.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 6a30252..c1d9a78 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -323,6 +323,23 @@ static void quirk_s

[PATCH v6 03/53] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-09-30 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Gavin Shan Cc: Yijing Wang Cc: Anton Blanchard Cc: linuxppc-...@lists.ozlabs.org --- arch/powerpc/kernel/pci_of_scan.c | 4 +++- 1 file changed, 3 insertions(+), 1

Re: PCIe bus (re-)numbering

2015-09-29 Thread Yinghai Lu
On Tue, Sep 29, 2015 at 7:04 AM, Ruud wrote: > > (for illustration, lspci -tv from a 3.2 kernel, hand edited as the > original picture has already discovered the subordinate busses) > +-02.0-[04-17]00.0-[05-17]--+-04.0-[06-16]00.0-[07-16]--- > |

Re: [RFC] PCI: Unassigned Expansion ROM BARs

2015-09-25 Thread Yinghai Lu
On Fri, Sep 25, 2015 at 9:18 AM, Alex Williamson wrote: >> > > Or do we want to keep a white list to say which device should have >> > > ROM bar as mush have, and other is optional to have ? >> > >> > Subject: [RFC PATCH] PCI: Add pci_dev_need_rom_bar() >> > >> > Only set that for >> > 1. if BIOS/

Re: [RFC] PCI: Unassigned Expansion ROM BARs

2015-09-24 Thread Yinghai Lu
On Thu, Sep 24, 2015 at 12:01 PM, Yinghai Lu wrote: > Or do we want to keep a white list to say which device should have > ROM bar as mush have, and other is optional to have ? Subject: [RFC PATCH] PCI: Add pci_dev_need_rom_bar() Only set that for 1. if BIOS/firmware already set ROM

Re: [RFC] PCI: Unassigned Expansion ROM BARs

2015-09-24 Thread Yinghai Lu
On Thu, Sep 24, 2015 at 10:06 AM, Myron Stowe wrote: > On Wed, Sep 23, 2015 at 9:21 PM, Yinghai Lu wrote: >> On Wed, Sep 23, 2015 at 7:47 PM, Myron Stowe wrote: >>> >>> The kernel expects device Expansion ROM BARs to be programmed with valid >>> values - ev

Re: [RFC] PCI: Unassigned Expansion ROM BARs

2015-09-23 Thread Yinghai Lu
On Wed, Sep 23, 2015 at 7:47 PM, Myron Stowe wrote: > > The kernel expects device Expansion ROM BARs to be programmed with valid > values - even if the respective Expansion ROM's Enable bit is 0 (i.e. the > device’s expansion ROM address space is disabled). This seems to be the > main contention

Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"

2015-09-23 Thread Yinghai Lu
On Wed, Sep 23, 2015 at 4:51 PM, Sean O. Stalley wrote: > IORESOURCE_PCI_FIXED is set in pci_ea_set_flags(): > > +static unsigned long pci_ea_set_flags(struct pci_dev *dev, u8 prop) > +{ > + unsigned long flags = IORESOURCE_PCI_FIXED; > + > + > > Which

Re: [PATCH v2 0/2] PCI: Add support for PCI Enhanced Allocation "BARs"

2015-09-23 Thread Yinghai Lu
On Wed, Sep 23, 2015 at 3:27 PM, Sean O. Stalley wrote: > PCI Enhanced Allocation is a new method of allocating MMIO & IO > resources for PCI devices & bridges. It can be used instead > of the traditional PCI method of using BARs. > > EA entries are hardware-initialized to a fixed address. > Unlik

Re: PCIe bus (re-)numbering

2015-09-21 Thread Yinghai Lu
On Mon, Sep 21, 2015 at 7:06 AM, Ruud wrote: > 2015-09-21 9:49 GMT+02:00 Ruud : > Test result based upon > > http://git.kernel.org/pub/scm/linux/kernel/git/yinghai/linux-yinghai.git > 7e3fad2 (for-pci-v4.3-rc1) > > Unfortunately your script hangs the system, I modified it for my > situation (only

Re: PCIe bus (re-)numbering

2015-09-21 Thread Yinghai Lu
On Mon, Sep 21, 2015 at 12:49 AM, Ruud wrote: > Sorry for the rookie question: which version do you mean by "current > upstream", the current main trunk rc?. current linus tree like v4.2 or v4.3-rc1 etc -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a me

Re: PCIe bus (re-)numbering

2015-09-20 Thread Yinghai Lu
On Sun, Sep 20, 2015 at 2:17 AM, Ruud wrote: > > The current procedure I follow is to boot with two PCIe switches in the host. > (one at the root complex level, intel based, one level above PLX > based, and the whole tree in the chassis). > > - I turn off the chassis (as it conflicts with the BIOS

Re: PCIe bus (re-)numbering

2015-09-19 Thread Yinghai Lu
On Sat, Sep 19, 2015 at 1:20 AM, Ruud wrote: > Hello all, > > Not a patch, not a complaint: a start of a discussion on PCIe bus > renumbering and bus numbering in general.. > > > The current algorithm seems to allocate 8 extra busnumbers at the > hotplug switch, but clearly 8 is not sufficient for

Re: [PATCH v5 00/53] PCI: Resource allocation cleanup for v4.4

2015-09-17 Thread Yinghai Lu
On Thu, Sep 17, 2015 at 7:55 AM, Bjorn Helgaas wrote: > > I assume the following patches are related to the sparc64/mem64 thing. > Could they be split out and posted separately? We should be able to > fix that issue even without all the other patches. > >> sparc/PCI: Add mem64 resource parsing

[PATCH v5 17/53] PCI: Separate out save_resources()/restore_resources()

2015-09-16 Thread Yinghai Lu
We need to save/restore resources several times for alt_size support, separate the save_resources()/resources() to save some lines later. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 49 ++--- 1 file changed, 30 insertions(+), 19 deletions

[PATCH v5 14/53] PCI: Add __add_to_list()

2015-09-16 Thread Yinghai Lu
For alt_size support, we will add more entries to realloc list. Add new __add_to_list() to take alt_size, alt_align. And simplify add_to_list() not to take add/alt input. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 51 ++--- 1 file

[PATCH v5 12/53] PCI: Simplify res reference using in __assign_resources_sorted()

2015-09-16 Thread Yinghai Lu
There are couples of dev_res->res reference, to make code more readable use res instead of dev_res->res directly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pci/setup

[PATCH v5 51/53] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs

2015-09-16 Thread Yinghai Lu
Now some BIOS tend to allocate pref MMIO under non-pref MMIO, or allocate 64bit pref MMIO under 4G. Add pci=assign_pref_bars to clear and allocate resource to pref BARS. So could reallocate pref mmio64 above 4G and pref under bridges pref BARs. Signed-off-by: Yinghai Lu --- arch/x86/include

[PATCH v5 10/53] PCI: Treat ROM resource as optional during realloc

2015-09-16 Thread Yinghai Lu
expand path. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 37 - 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 1fd0b8d..eca319e 100644 --- a/drivers/pci/setup-bus.c +++ b

<    1   2   3   4   5   6   7   8   9   10   >