[PATCH v8 41/61] PCI: Separate required+optional assigning to another function

2015-10-27 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 v8 56/61] PCI, x86: Allocate from high in available window for MMIO

2015-10-27 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 v8 40/61] PCI: Move comment to pci_need_to_release()

2015-10-27 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 v8 09/61] powerpc/PCI: Keep resource idx order with bridge register number

2015-10-27 Thread Yinghai Lu
Same as sparc version. Make resource with consistent sequence like other arch or directly from pci_read_bridge_bases(), even non-pref mmio is missing, or out of ordering in firmware reporting. So hold i = 1 for non pref mmio, and i = 2 for pref mmio. Signed-off-by: Yinghai Lu --- arch/powerpc

[PATCH v8 16/61] PCI: Restore pref MMIO allocation logic for host bridge without mmio64

2015-10-27 Thread Yinghai Lu
all. 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 Tested-by: Khalid Aziz --- drivers/pci/bus.c | 4 +++- drivers/pci/setup-bus.c | 13 + drivers/pci/setup-re

[PATCH v8 12/61] PCI: Check pref compatible bit for mem64 resource of PCIe device

2015-10-27 Thread Yinghai Lu
://lkml.kernel.org/r/cae9fiqu1gjy1lyrxs+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 Tested-by: Khalid Aziz --- drivers/pci/pci.c | 10 ++---

[PATCH v8 54/61] resources: Split out __allocate_resource()

2015-10-27 Thread Yinghai Lu
nally 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 v8 60/61] PCI: Don't set flags to 0 when assign resource fail

2015-10-27 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 v8 61/61] PCI: Only try to assign io port only for root bus that support it

2015-10-27 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 v8 22/61] PCI: Get new realloc size for bridge for last try

2015-10-27 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 v8 59/61] PCI: Introduce resource_disabled()

2015-10-27 Thread Yinghai Lu
...@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 Acked

[PATCH v8 10/61] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-10-27 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 v8 38/61] PCI: Check if resource is allocated before trying to assign one

2015-10-27 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 v8 28/61] PCI: Optimize bus align/size calculation for optional during sizing

2015-10-27 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 v8 25/61] PCI: Reuse res_to_dev_res() in reassign_resources_sorted()

2015-10-27 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 v8 45/61] PCI: Add support for more than two alt_size entries under same bridge

2015-10-27 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 dea0344..7e7663a 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

[PATCH v8 14/61] PCI: Add has_mem64 for struct host_bridge

2015-10-27 Thread Yinghai Lu
mmio64 and pref mmio32 under bridge pref bar. Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz --- 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

[PATCH v8 02/61] PCI: Add pci_find_root_bus_resource()

2015-10-27 Thread Yinghai Lu
or not. Convert old pci_find_parent_resource() to pci_find_bus_resource(), and reuse it in pci_find_root_bus_resource(). So we avoid changing pcibios_bus_to_resource(). Signed-off-by: Yinghai Lu --- drivers/pci/pci.c | 36 +--- include/linux/pci.h | 2 ++ 2

[PATCH v8 09/61] powerpc/PCI: Keep resource idx order with bridge register number

2015-10-27 Thread Yinghai Lu
Same as sparc version. Make resource with consistent sequence like other arch or directly from pci_read_bridge_bases(), even non-pref mmio is missing, or out of ordering in firmware reporting. So hold i = 1 for non pref mmio, and i = 2 for pref mmio. Signed-off-by: Yinghai Lu <y

[PATCH v8 40/61] PCI: Move comment to pci_need_to_release()

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 27 +++ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/pci

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

2015-10-27 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 <bhelg...@google.com> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/bus.c | 2

[PATCH v8 12/61] PCI: Check pref compatible bit for mem64 resource of PCIe device

2015-10-27 Thread Yinghai Lu
://lkml.kernel.org/r/cae9fiqu1gjy1lyrxs+ma5lcteee4xmtjrg0axj9k_tsu+m9...@mail.gmail.com Reported-by: David Ahern <david.ah...@oracle.com> Tested-by: David Ahern <david.ah...@oracle.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Tested-by: TJ <li...@iam.tj> Signed-off-by:

[PATCH v8 16/61] PCI: Restore pref MMIO allocation logic for host bridge without mmio64

2015-10-27 Thread Yinghai Lu
all. 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 <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- drivers/pci/bus.c | 4 +++- drivers/

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

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

[PATCH v8 54/61] resources: Split out __allocate_resource()

2015-10-27 Thread Yinghai Lu
nally take lock" is *wrong*. Signed-off-by: Yinghai Lu <ying...@kernel.org> Acked-by: Linus Torvalds <torva...@linux-foundation.org> --- kernel/resource.c | 70 +++ 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/kerne

[PATCH v8 02/61] PCI: Add pci_find_root_bus_resource()

2015-10-27 Thread Yinghai Lu
or not. Convert old pci_find_parent_resource() to pci_find_bus_resource(), and reuse it in pci_find_root_bus_resource(). So we avoid changing pcibios_bus_to_resource(). Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/pci.c | 36 +--- include

[PATCH v8 14/61] PCI: Add has_mem64 for struct host_bridge

2015-10-27 Thread Yinghai Lu
mmio64 and pref mmio32 under bridge pref bar. Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- 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/p

[PATCH v8 45/61] PCI: Add support for more than two alt_size entries under same bridge

2015-10-27 Thread Yinghai Lu
Tested-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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-b

[PATCH v8 38/61] PCI: Check if resource is allocated before trying to assign one

2015-10-27 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 <y

[PATCH v8 28/61] PCI: Optimize bus align/size calculation for optional during sizing

2015-10-27 Thread Yinghai Lu
ed-off-by: Yinghai Lu <ying...@kernel.org> drivers/pci/setup-bus.c | 82 +--- 1 file changed, 51 insertions(+), 31 deletions(-) --- drivers/pci/setup-bus.c | 82 ++--- 1 file changed, 51 insertions(+),

[PATCH v8 25/61] PCI: Reuse res_to_dev_res() in reassign_resources_sorted()

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff

[PATCH v8 22/61] PCI: Get new realloc size for bridge for last try

2015-10-27 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 <li...@iam.tj> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/setup-bus.c | 23 +-- 1 file changed, 21 insertion

[PATCH v8 59/61] PCI: Introduce resource_disabled()

2015-10-27 Thread Yinghai Lu
...@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 <y

[PATCH v8 10/61] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-10-27 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu <ying...@kernel.org> Cc: Benjamin Herrenschmidt <b...@kernel.crashing.org> Cc: Paul Mackerras <pau...@samba.org> Cc: Michael Ellerman <m...@ellerman.id.au> Cc: Gavin Shan <gws...@linux.vnet.ibm.com> Cc: Yijing Wang <

[PATCH v8 52/61] PCI: Unify skip_ioresource_align()

2015-10-27 Thread Yinghai Lu
Ellerman <m...@ellerman.id.au> Cc: Arnd Bergmann <a...@arndb.de> Cc: linuxppc-...@lists.ozlabs.org Cc: linux-a...@vger.kernel.org Signed-off-by: Yinghai Lu <ying...@kernel.org> Reviewed-by: Thomas Gleixner <t...@linutronix.de> Acked-by: Michael Ellerman <m...@ellerman.id.au

[PATCH v8 41/61] PCI: Separate required+optional assigning to another function

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 47 +++ 1 file chang

[PATCH v8 56/61] PCI, x86: Allocate from high in available window for MMIO

2015-10-27 Thread Yinghai Lu
range like 0xb000 to 0b:04.0 and 0f:00.0 Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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/ar

[PATCH v8 19/61] PCI: Set resource to FIXED for LSI devices

2015-10-27 Thread Yinghai Lu
zilla: https://bugzilla.kernel.org/show_bug.cgi?id=92351 Signed-off-by: Yinghai Lu <ying...@kernel.org> 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/p

[PATCH v8 13/61] PCI: Only treat non-pref mmio64 as pref if all bridges have MEM_64

2015-10-27 Thread Yinghai Lu
check them for child device resources. -v2: check all bus resources instead of just res[15]. Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- drivers/pci/setup-bus.c | 31 +-- 1 file changed, 29 insertions(+),

[PATCH v8 36/61] PCI: Add __add_to_list()

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.

[PATCH v8 46/61] PCI: Fix size calculation with old_size on rescan path

2015-10-27 Thread Yinghai Lu
add_align as must align. After the patch, rescan works properly. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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

[PATCH v8 51/61] PCI: Allow bridge optional only io port resource required size to be 0

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/d

[PATCH v8 42/61] PCI: Skip required+optional if there is no optional

2015-10-27 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: Yinghai Lu

[PATCH v8 48/61] PCI: Move ISA io port align out of calculate_iosize()

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 39 +++ 1 file changed, 27 i

[PATCH v8 35/61] PCI: Simplify res reference using in __assign_resources_sorted()

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-)

[PATCH v8 24/61] PCI: Cleanup res_to_dev_res() printout

2015-10-27 Thread Yinghai Lu
: change to %#llx according to Bjorn. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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

[PATCH v8 47/61] PCI: Don't add too much optional size for hotplug bridge io

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.

[PATCH v8 49/61] PCI: Don't add too much io port for hotplug bridge with old size

2015-10-27 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 <ying...@kernel.org> --- drivers/pci

[PATCH v8 55/61] resources: Make allocate_resource() return best fit resource

2015-10-27 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 <ying...@kernel.org> --- kernel/resource.c | 81 ++--

[PATCH v8 34/61] PCI: Add debug printout during releasing partial assigned resources

2015-10-27 Thread Yinghai Lu
that 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 <ying...@kernel.org> --- drivers/pci/

[PATCH v8 39/61] PCI: Separate out save_resources()/restore_resources()

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 49 ++--- 1 file chang

[PATCH v8 50/61] PCI: Unify calculate_size() for io port and MMIO

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

[PATCH v8 53/61] PCI: Kill macro checking for bus io port sizing

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 17 +++-- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/pci/setup-b

[PATCH v8 17/61] PCI: Don't release fixed resource for realloc

2015-10-27 Thread Yinghai Lu
1 Signed-off-by: Yinghai Lu <ying...@kernel.org> Cc: sta...@vger.kernel.org --- drivers/pci/setup-bus.c | 6 -- include/linux/ioport.h | 2 +- kernel/resource.c | 28 ++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/drivers/pci/setup-b

[PATCH v8 58/61] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs

2015-10-27 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 <ying...@kernel.

[PATCH v8 27/61] PCI: Optimize bus min_align/size calculation during sizing

2015-10-27 Thread Yinghai Lu
ces. Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Reported-by: TJ <li...@iam.tj> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/setup-bus.c | 195 ++-- 1 file changed, 157 insertions(+), 38 deletions(-) diff --gi

[PATCH v8 18/61] PCI: Claim fixed resource during remove/rescan path

2015-10-27 Thread Yinghai Lu
. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/quirks.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index af75580..1d85f37 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -323,6 +323,23 @@

[PATCH v8 29/61] PCI: Don't add too much optional size for hotplug bridge MMIO

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff

[PATCH v8 26/61] PCI: Use correct align for optional only resources during sorting

2015-10-27 Thread Yinghai Lu
-by: TJ <li...@iam.tj> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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 e075495..ab

[PATCH v8 30/61] PCI: Reorder resources list for required/optional resources

2015-10-27 Thread Yinghai Lu
, and call it two times accordingly. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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 5

[PATCH v8 31/61] PCI: Remove duplicated code for resource sorting

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.

[PATCH v8 44/61] PCI: Add alt_size ressource allocation support

2015-10-27 Thread Yinghai Lu
Reported-by: Yijing Wang <wangyij...@huawei.com> Tested-by: Yijing Wang <wangyij...@huawei.com> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/setup-bus.c | 203 +--- 1 file changed, 191 insertions(+), 12 deletions(-) di

[PATCH v8 37/61] PCI: Cache window alignment value during bus sizing

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff

[PATCH v8 20/61] PCI: Separate realloc list checking after allocation

2015-10-27 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 <ying...@kernel.org> Cc: "Rafael J.

[PATCH v8 43/61] PCI: Move saved required resource list out of required+optional assigning

2015-10-27 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 <ying...@kernel.org> --- drivers/pci/setup-bus.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/d

[PATCH v8 33/61] PCI: Treat ROM resource as optional during realloc

2015-10-27 Thread Yinghai Lu
in expand path. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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/drive

[PATCH v8 01/61] sparc/PCI: Add mem64 resource parsing for root bus

2015-10-27 Thread Yinghai Lu
m9...@mail.gmail.com Reported-by: David Ahern <david.ah...@oracle.com> Tested-by: David Ahern <david.ah...@oracle.com> Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> arch/sparc/kernel/pci.c|7 ++- arch/sparc/kernel

[PATCH v8 04/61] sparc/PCI: Reserve legacy mmio after PCI mmio

2015-10-27 Thread Yinghai Lu
pcibios_bus_to_resource() and pci_find_root_bus_resource() Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- arch/sparc/kernel/pci.c| 1 + arch/sparc/kernel/pci_common.c | 59 ++ arch/sparc/kernel/pci_i

[PATCH v8 11/61] OF/PCI: Add IORESOURCE_MEM_64 for 64-bit resource

2015-10-27 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu <ying...@kernel.org> Cc: Grant Likely <grant.lik...@linaro.org> Cc: Rob Herring <robh...@kernel.org> Cc: devicet...@vger.kernel.org Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- drivers/of/address.c | 4 +++- 1 fi

[PATCH v8 08/61] PCI: Ignore BAR for ALi M1533 PCI-ISA bridge

2015-10-27 Thread Yinghai Lu
0x10-0x2f, according to lspci. So those BAR do not work as regular BAR, just clean flags, and ignore them all the way include claim and sizing and alloc etc. Reported-by: Meelis Roos <mr...@linux.ee> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/quirks.c | 15 +++

[PATCH v8 05/61] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-10-27 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=96241 Signed-off-by: Yinghai Lu <ying...@kernel.org> Cc: "David S. Miller" <da...@davemloft.net> Cc: sparcli...@vger.kernel.org Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- arch/sparc/kernel/of_device_32.c | 5 +++-- arch/sparc/kernel/of_de

[PATCH v8 06/61] sparc/PCI: Keep resource idx order with bridge register number

2015-10-27 Thread Yinghai Lu
es(), even non-pref mmio is missing, or out of ordering in firmware reporting. So hold i = 1 for non pref mmio, and i = 2 for pref mmio. Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- arch/sparc/kernel/pci.c | 8 +++- 1 file chang

[PATCH v8 03/61] sparc/PCI: Use correct bus address to resource offset

2015-10-27 Thread Yinghai Lu
: put back mem64_offset, as we found T4 has mem_offset != mem64_offset check overlapping between mem64_space and mem_space. -v5: use pcibios_bus_to_region() requested by Bjorn. use pci_find_root_bus_resource(). Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <kha

[PATCH v8 32/61] PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare()

2015-10-27 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 <ying...@kernel.org> --- d

[PATCH v8 23/61] PCI: Don't release sibling bridge resources during hotplug

2015-10-27 Thread Yinghai Lu
. Reported-by: Andreas Noever <andreas.noe...@gmail.com> Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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 278cb6d..10

[PATCH v8 21/61] PCI: Treat optional as required in first try for bridge rescan

2015-10-27 Thread Yinghai Lu
(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 <ying...@kernel.org> --- drivers/pci/setup-bus.

[PATCH v8 07/61] PCI: Kill wrong quirk about M7101

2015-10-27 Thread Yinghai Lu
-by: Meelis Roos <mr...@linux.ee> Cc: Meelis Roos <mr...@linux.ee> Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- drivers/pci/quirks.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/pci/quirks.c b/dr

[PATCH v8 57/61] PCI: Add debug print out for min_align and alt_size

2015-10-27 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 <ying...@kernel.

[PATCH v8 00/61] PCI: Resource allocation cleanup for v4.4

2015-10-27 Thread Yinghai Lu
flags handling after pci_find_root_bus_resource(). - add patch for quirk that ignore BAR for M1533 PCI-ISA bridge. Yinghai Lu (61): sparc/PCI: Add mem64 resource parsing for root bus PCI: Add pci_find_root_bus_resource() sparc/PCI: Use correct bus address to resource offset sparc/PCI

[PATCH v8 15/61] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64

2015-10-27 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 <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-22 Thread Yinghai Lu
On Thu, Oct 22, 2015 at 12:56 PM, Yinghai Lu wrote: > On Wed, Oct 21, 2015 at 6:15 PM, Yinghai Lu wrote: > looks like i mix the use root bus resource with parent bus resource ... > so that still have problem. Now will two version for patch2 and patch3 that will be used to replace

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-22 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 6:15 PM, Yinghai Lu wrote: > On Wed, Oct 21, 2015 at 3:59 PM, Yinghai Lu wrote: >> On Wed, Oct 21, 2015 at 3:32 PM, Yinghai Lu wrote: >>> On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas wrote: >>>> Lots of other architectures have both m

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-22 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 6:15 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Wed, Oct 21, 2015 at 3:59 PM, Yinghai Lu <ying...@kernel.org> wrote: >> On Wed, Oct 21, 2015 at 3:32 PM, Yinghai Lu <ying...@kernel.org> wrote: >>> On Wed, Oct 21, 2015 at 11:50 A

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-22 Thread Yinghai Lu
On Thu, Oct 22, 2015 at 12:56 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Wed, Oct 21, 2015 at 6:15 PM, Yinghai Lu <ying...@kernel.org> wrote: > looks like i mix the use root bus resource with parent bus resource ... > so that still have problem. Now will two version

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 3:59 PM, Yinghai Lu wrote: > On Wed, Oct 21, 2015 at 3:32 PM, Yinghai Lu wrote: >> On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas wrote: >>> Lots of other architectures have both mem32 and mem64 apertures. You >>> haven't explained what's un

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 3:32 PM, Yinghai Lu wrote: > On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas wrote: >> Lots of other architectures have both mem32 and mem64 apertures. You >> haven't explained what's unique about sparc yet. Does >> pci_find_parent_resourc

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas wrote: > Lots of other architectures have both mem32 and mem64 apertures. You > haven't explained what's unique about sparc yet. Does > pci_find_parent_resource() not work on sparc? If not, is that because the > resource tree looks different on

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 7:35 PM, Bjorn Helgaas wrote: > On Tue, Oct 20, 2015 at 03:30:44PM -0700, Yinghai Lu wrote: > I doubt I would agree with a change like this, but maybe, if you can > explain what's unique about the sparc architecture that would require > a change like this. Th

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 7:35 PM, Bjorn Helgaas <helg...@kernel.org> wrote: > On Tue, Oct 20, 2015 at 03:30:44PM -0700, Yinghai Lu wrote: > I doubt I would agree with a change like this, but maybe, if you can > explain what's unique about the sparc architecture that would require

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas wrote: > Lots of other architectures have both mem32 and mem64 apertures. You > haven't explained what's unique about sparc yet. Does > pci_find_parent_resource() not work on sparc? If not, is that because the > resource tree

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 3:32 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas <helg...@kernel.org> wrote: >> Lots of other architectures have both mem32 and mem64 apertures. You >> haven't explained what's un

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-21 Thread Yinghai Lu
On Wed, Oct 21, 2015 at 3:59 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Wed, Oct 21, 2015 at 3:32 PM, Yinghai Lu <ying...@kernel.org> wrote: >> On Wed, Oct 21, 2015 at 11:50 AM, Bjorn Helgaas <helg...@kernel.org> wrote: >>> Lots of other architectures have

Re: [PATCH v7 02/60] sparc/PCI: Use correct bus address to resource offset

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 5:03 PM, Yinghai Lu wrote: >> The failing T4 booted up with updated patches. >> > > Thanks, will post updated patch2 and patches3 and patch 4 with > pcibios_bus_to_resource as Bjorn requested. Please double test attached three patches that should

Re: [PATCH v7 02/60] sparc/PCI: Use correct bus address to resource offset

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 4:51 PM, Khalid Aziz wrote: > On 10/20/2015 02:34 PM, Yinghai Lu wrote: >> >> On Tue, Oct 20, 2015 at 1:07 PM, Khalid Aziz >> wrote: >>>> >>>> I don't want to argue about pci_resource_to_user() right now, so I >>>>

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 3:16 PM, Yinghai Lu wrote: > On Tue, Oct 20, 2015 at 2:57 PM, Bjorn Helgaas wrote: >> On Thu, Oct 08, 2015 at 02:38:22PM -0700, Yinghai Lu wrote: >>> We register regions for legacy and iommu and all have open code. >>> >>> Unify th

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 2:57 PM, Bjorn Helgaas wrote: > On Thu, Oct 08, 2015 at 02:38:22PM -0700, Yinghai Lu wrote: >> We register regions for legacy and iommu and all have open code. >> >> Unify them to pci_register_region() and call it accordingly. >> &

Re: [PATCH v7 02/60] sparc/PCI: Use correct bus address to resource offset

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 1:07 PM, Khalid Aziz wrote: >> I don't want to argue about pci_resource_to_user() right now, so I >> guess you can just panic if the mem64 offset is different from the >> mem32 offset. But you should at least add a comment about why you're >> doing that. Otherwise it

Re: [PATCH v7 02/60] sparc/PCI: Use correct bus address to resource offset

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 1:07 PM, Khalid Aziz wrote: >> I don't want to argue about pci_resource_to_user() right now, so I >> guess you can just panic if the mem64 offset is different from the >> mem32 offset. But you should at least add a comment about why you're >> doing

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 3:16 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Tue, Oct 20, 2015 at 2:57 PM, Bjorn Helgaas <helg...@kernel.org> wrote: >> On Thu, Oct 08, 2015 at 02:38:22PM -0700, Yinghai Lu wrote: >>> We register regions for legacy and iommu and all

Re: [PATCH v7 03/60] sparc/PCI: Unify pci_register_region()

2015-10-20 Thread Yinghai Lu
On Tue, Oct 20, 2015 at 2:57 PM, Bjorn Helgaas <helg...@kernel.org> wrote: > On Thu, Oct 08, 2015 at 02:38:22PM -0700, Yinghai Lu wrote: >> We register regions for legacy and iommu and all have open code. >> >> Unify them to pci_register_region() and call it accordingl

<    4   5   6   7   8   9   10   11   12   13   >