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

2015-10-01 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 v6 52/53] PCI: Introduce resource_disabled()

2015-10-01 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 v6 34/53] PCI: Fix size calculation with old_size on rescan path

2015-10-01 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 ba5635a..b6bfa1f

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

2015-10-01 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> --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drive

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

2015-10-01 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 v6 51/53] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs

2015-10-01 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 v6 46/53] PCI: Check pref compatible bit for mem64 resource of PCIe device

2015-10-01 Thread Yinghai Lu
4xmtjrg0axj9k_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: Yinghai Lu <ying...@kernel.org> --- drivers

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

2015-10-01 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 v6 43/53] resources: Make allocate_resource() return best fit resource

2015-10-01 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 v6 40/53] PCI: Unify skip_ioresource_align()

2015-10-01 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> --- arch/microblaze/pci/pci-common.c | 8 arch/powerpc/kernel/pci-common.c | 11 +--

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

2015-10-01 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 v6 48/53] PCI: Add has_mem64 for struct host_bridge

2015-10-01 Thread Yinghai Lu
mmio64 and pref mmio32 under bridge pref bar. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- 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/drive

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

2015-10-01 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> --- drivers/pci/bus.c | 4 +++- drivers/pci/setup-bus.c | 13 + drivers/pci/setup-r

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

2015-10-01 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 v6 37/53] PCI: Don't add too much io port for hotplug bridge with old size

2015-10-01 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 v6 42/53] resources: Split out __allocate_resource()

2015-10-01 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 v6 12/53] PCI: Cleanup res_to_dev_res() printout

2015-10-01 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 6b6a4ed..2256ce6

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

2015-10-01 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 v6 26/53] PCI: Check if resource is allocated before trying to assign one

2015-10-01 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 v6 23/53] PCI: Simplify res reference using in __assign_resources_sorted()

2015-10-01 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 v6 10/53] PCI: Get new realloc size for bridge for last try

2015-10-01 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 v6 32/53] PCI: Add alt_size ressource allocation support

2015-10-01 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 v6 18/53] PCI: Reorder resources list for required/optional resources

2015-10-01 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 6

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

2015-10-01 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 v6 21/53] PCI: Treat ROM resource as optional during realloc

2015-10-01 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 0a89d06..554d019 100644 --- a/drive

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

2015-10-01 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 v6 39/53] PCI: Allow bridge optional only io port resource required size to be 0

2015-10-01 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 v6 01/53] sparc/PCI: Add mem64 resource parsing for root bus

2015-10-01 Thread Yinghai Lu
gt; Tested-by: David Ahern <david.ah...@oracle.com> Signed-off-by: Yinghai Lu <ying...@kernel.org> arch/sparc/kernel/pci.c|7 ++- arch/sparc/kernel/pci_common.c | 15 +-- arch/sparc/kernel/pci_impl.h |1 + 3 files changed, 20 insertions(+), 3 del

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

2015-10-01 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 v6 00/53] PCI: Resource allocation cleanup for v4.4

2015-10-01 Thread Yinghai Lu
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 parsing OF/PCI: Add

[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
(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 file

[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

[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
-by: 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
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 --- 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
-by: 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

[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
. 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_s3_64M

[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

[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 <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 v6 09/53] PCI: Treat optional as required in first try for bridge rescan

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

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

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

2015-09-30 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 a62cbd2..79

[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 <ying...@kernel.org> Cc: "David S. Miller" <da...@davemloft.net> 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(+)

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

2015-09-30 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 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 <ying...@kernel.org> Cc: Grant Likely <grant.lik...@linaro.org> Cc: Rob Herring <robh...@kernel.org> Cc: devicet...@vger.kernel.org --- drivers/of/address.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) di

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

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

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

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

2015-09-30 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 6a30252..c1d9a78 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -323,6 +323,23 @@

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

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

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

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

2015-09-30 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 8477cf5..6b

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: 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

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

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-24 Thread Yinghai Lu
On Thu, Sep 24, 2015 at 10:06 AM, Myron Stowe <myron.st...@gmail.com> wrote: > On Wed, Sep 23, 2015 at 9:21 PM, Yinghai Lu <ying...@kernel.org> wrote: >> On Wed, Sep 23, 2015 at 7:47 PM, Myron Stowe <myron.st...@gmail.com> wrote: >>> >>>

Re: [RFC] PCI: Unassigned Expansion ROM BARs

2015-09-24 Thread Yinghai Lu
On Thu, Sep 24, 2015 at 12:01 PM, Yinghai Lu <ying...@kernel.org> 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 B

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; > + > + > >

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

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

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; >

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

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

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

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

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

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

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

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

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

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

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

[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
in 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

[PATCH v5 01/53] PCI: Cleanup res_to_dev_res() printout

2015-09-16 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 508cc56..6d0815e 100644 --- a/drivers/pci/setup

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

2015-09-16 Thread Yinghai Lu
- add one debug patch - add one patch that get resource allocation near end of avialable window Yinghai Lu (53): PCI: Cleanup res_to_dev_res() printout PCI: Reuse res_to_dev_res() in reassign_resources_sorted() PCI: Use correct align for optional only resources during sorting PCI: Optimize

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

2015-09-16 Thread Yinghai Lu
-by: 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 f816472..aea35b6 100644 --- a/drivers/pci/setup-bus.c +++ b

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

2015-09-16 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 v5 04/53] PCI: Optimize bus min_align/size calculation during sizing

2015-09-16 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

<    7   8   9   10   11   12   13   14   15   16   >