[PATCH v9 42/60] PCI: Move saved required resource list out of required+optional assigning

2015-12-10 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 v9 35/60] PCI: Add __add_to_list()

2015-12-10 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 v9 39/60] PCI: Move comment to pci_need_to_release()

2015-12-10 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 v9 28/60] PCI: Don't add too much optional size for hotplug bridge MMIO

2015-12-10 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 v9 07/60] PCI: Ignore BAR for ALi M1533 PCI-ISA bridge

2015-12-10 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 v9 09/60] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-12-10 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 v9 25/60] PCI: Use correct align for optional only resources during sorting

2015-12-10 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 6f6cf25..31

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

2015-12-10 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 v9 13/60] PCI: Add has_mem64 for struct host_bridge

2015-12-10 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 v9 36/60] PCI: Cache window alignment value during bus sizing

2015-12-10 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 v9 20/60] PCI: Treat optional as required in first try for bridge rescan

2015-12-10 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 v9 46/60] PCI: Don't add too much optional size for hotplug bridge io

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

2015-12-10 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 v9 43/60] PCI: Add alt_size ressource allocation support

2015-12-10 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 v9 31/60] PCI: Rename pdev_sort_resources() to pdev_assign_resources_prepare()

2015-12-10 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 v9 19/60] PCI: Separate realloc list checking after allocation

2015-12-10 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 v9 06/60] PCI: Kill wrong quirk about M7101

2015-12-10 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 v9 05/60] sparc/PCI: Keep resource idx order with bridge register number

2015-12-10 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 v9 26/60] PCI: Optimize bus min_align/size calculation during sizing

2015-12-10 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 v9 24/60] PCI: Reuse res_to_dev_res() in reassign_resources_sorted()

2015-12-10 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 v9 57/60] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs

2015-12-10 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 v9 54/60] resources: Make allocate_resource() return best fit resource

2015-12-10 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 v9 58/60] PCI: Introduce resource_disabled()

2015-12-10 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 v9 45/60] PCI: Fix size calculation with old_size on rescan path

2015-12-10 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 9c9d9de..c8b3ea6

[PATCH v9 15/60] PCI: Restore pref MMIO allocation logic for host bridge without mmio64

2015-12-10 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 v9 23/60] PCI: Cleanup res_to_dev_res() printout

2015-12-10 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 7f7f46c..598254a

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

2015-12-10 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 v9 47/60] PCI: Move ISA io port align out of calculate_iosize()

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

2015-12-10 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 v9 48/60] PCI: Don't add too much io port for hotplug bridge with old size

2015-12-10 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 v9 41/60] PCI: Skip required+optional if there is no optional

2015-12-10 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 v9 01/60] PCI: Add pci_find_root_bus_resource()

2015-12-10 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 v9 32/60] PCI: Treat ROM resource as optional during realloc

2015-12-10 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 194d5da..e9e67bc 100644 --- a/drive

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

2015-12-10 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 3618c06..d45455f 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -323,6 +323,23 @@

[PATCH v9 29/60] PCI: Reorder resources list for required/optional resources

2015-12-10 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 v9 14/60] PCI: Only treat non-pref mmio64 as pref if host bridge has mmio64

2015-12-10 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

[PATCH v9 40/60] PCI: Separate required+optional assigning to another function

2015-12-10 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 v9 00/60] PCI: Resource allocation cleanup for v4.5

2015-12-10 Thread Yinghai Lu
flags handling after pci_find_root_bus_resource(). - add patch for quirk that ignore BAR for M1533 PCI-ISA bridge. v9: rebased for v4.5 Yinghai Lu (60): PCI: Add pci_find_root_bus_resource() sparc/PCI: Use correct bus address to resource offset sparc/PCI: Reserve legacy mmio after PCI mmio

[PATCH v9 08/60] powerpc/PCI: Keep resource idx order with bridge register number

2015-12-10 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 v9 22/60] PCI: Don't release sibling bridge resources during hotplug

2015-12-10 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 c2e3999..7f

[PATCH v9 21/60] PCI: Get new realloc size for bridge for last try

2015-12-10 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 v9 33/60] PCI: Add debug printout during releasing partial assigned resources

2015-12-10 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/

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

2015-12-01 Thread Yinghai Lu
On Tue, Dec 1, 2015 at 1:23 PM, Khalid Aziz wrote: > The device does work with this patch. Good. > Doesn't this warning mean BAR6 > resources could not be reserved which means the device driver may not be > able to get the BAR6 resource at some point if another device grabs the > unreserved

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

2015-12-01 Thread Yinghai Lu
On Tue, Dec 1, 2015 at 1:23 PM, Khalid Aziz wrote: > The device does work with this patch. Good. > Doesn't this warning mean BAR6 > resources could not be reserved which means the device driver may not be > able to get the BAR6 resource at some point if another device

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

2015-11-23 Thread Yinghai Lu
On Mon, Nov 23, 2015 at 1:31 PM, Khalid Aziz wrote: >> Looks like only the device BAR6 is not assigned form OF? > > Any progress on this? Do you need any more information from me? Should be one warning about this device in that system. We don't need to do anything about it if the device is

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

2015-11-23 Thread Yinghai Lu
On Mon, Nov 23, 2015 at 1:31 PM, Khalid Aziz wrote: >> Looks like only the device BAR6 is not assigned form OF? > > Any progress on this? Do you need any more information from me? Should be one warning about this device in that system. We don't need to do anything about

Re: [PATCH 00/25] mpt3sas: Mergering mpt2sas & mpt3sas driver code

2015-11-12 Thread Yinghai Lu
On Wed, Nov 11, 2015 at 5:09 PM, Martin K. Petersen wrote: >> "Sreekanth" == Sreekanth Reddy writes: > > The patches in the single-module portion of the series did not compile > individually and I gave up untangling them. They were fundamentally too > intertwined and I squashed them into one

Re: [PATCH 00/25] mpt3sas: Mergering mpt2sas & mpt3sas driver code

2015-11-12 Thread Yinghai Lu
On Wed, Nov 11, 2015 at 5:09 PM, Martin K. Petersen wrote: >> "Sreekanth" == Sreekanth Reddy writes: > > The patches in the single-module portion of the series did not compile > individually and I gave up untangling them. They were

Re: Question with maxcpus= parameter.

2015-11-09 Thread Yinghai Lu
On Mon, Nov 9, 2015 at 1:09 AM, Zhenzhong Duan wrote: > I know that, what confused me is uek2(2.6.39-400.249.4.el6uek.x86_64) works > with maxcpus=, > but uek3(3.8.13-44.1.1.el6uek.x86_64) not when I don't comment out the > script. > I have ever suspected uek2 send CPU ADD event for only 4 cpus.

Re: Question with maxcpus= parameter.

2015-11-09 Thread Yinghai Lu
On Mon, Nov 9, 2015 at 1:09 AM, Zhenzhong Duan wrote: > I know that, what confused me is uek2(2.6.39-400.249.4.el6uek.x86_64) works > with maxcpus=, > but uek3(3.8.13-44.1.1.el6uek.x86_64) not when I don't comment out the > script. > I have ever suspected uek2 send CPU

Re: Question with maxcpus= parameter.

2015-11-08 Thread Yinghai Lu
On Sun, Nov 8, 2015 at 9:47 PM, Zhenzhong Duan wrote: > Tried nr_cpus=4, works. > nr_cpus and maxcpus are different. maxcpus=4 means kernel will only bring up 4 cpus, but other cpus still can be brought up online. if there are more cpu are there according acpi MADT. nr_cpus=4 that means 4 is

Re: Question with maxcpus= parameter.

2015-11-08 Thread Yinghai Lu
On Sun, Nov 8, 2015 at 9:47 PM, Zhenzhong Duan wrote: > Tried nr_cpus=4, works. > nr_cpus and maxcpus are different. maxcpus=4 means kernel will only bring up 4 cpus, but other cpus still can be brought up online. if there are more cpu are there according acpi MADT.

Re: Fwd: [PATCH] x86: Use larger chunks in mtrr_cleanup

2015-11-05 Thread Yinghai Lu
On Mon, Sep 14, 2015 at 7:46 AM, Stuart Hayes wrote: > > Booting with 'disable_mtrr_cleanup' works, but the system I am working with > isn't actually failing--it just gets ugly error messages. And the BIOS on the > system I am working with had set up the MTRRs correctly. Please post boot log

Re: Fwd: [PATCH] x86: Use larger chunks in mtrr_cleanup

2015-11-05 Thread Yinghai Lu
On Mon, Sep 14, 2015 at 7:46 AM, Stuart Hayes wrote: > > Booting with 'disable_mtrr_cleanup' works, but the system I am working with > isn't actually failing--it just gets ugly error messages. And the BIOS on the > system I am working with had set up the MTRRs

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

2015-10-30 Thread Yinghai Lu
On Fri, Oct 30, 2015 at 2:47 PM, Khalid Aziz wrote: > > I applied patches 1-8 and 11-16 to 4.3.0-rc7 to test on sparc platforms. I > am seeing a "can't claim BAR" message on a T4: > > pci :04:00.0: can't claim BAR 6 [mem 0x840-0x840]: > address conflict with :04:00.0 [mem

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

2015-10-30 Thread Yinghai Lu
On Fri, Oct 30, 2015 at 2:47 PM, Khalid Aziz wrote: > > I applied patches 1-8 and 11-16 to 4.3.0-rc7 to test on sparc platforms. I > am seeing a "can't claim BAR" message on a T4: > > pci :04:00.0: can't claim BAR 6 [mem 0x840-0x840]: > address conflict

[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 --- 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 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 --- 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 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 --- drivers/pci/setup-bus.c | 12

[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 Tested-by: David Ahern Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz arch/sparc/kernel/pci.c|7 ++- arch/sparc/kernel/pci_common.c | 17 +++-- arch/sparc/kernel/pci_impl.h |1 + 3 files changed, 22 insert

[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 Tested-by: Khalid Aziz --- arch/sparc/kernel/pci.c

[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 Signed-off-by: Yinghai Lu --- drivers/pci/quirks.c | 15 +++ 1 file changed, 15 insertions(+) diff

[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 Tested-by: Khalid Aziz --- arch/sparc/kernel/pci.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/sp

[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 Tested-by: Khalid Aziz --- arch/sparc/kernel/pci.c| 1 + arch/sparc/kernel/pci_common.c | 59 ++ arch/sparc/kernel/pci_impl.h | 1 + 3 files changed, 33 insertions(+), 28

[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 Cc: Grant Likely Cc: Rob Herring Cc: devicet...@vger.kernel.org Tested-by: Khalid Aziz --- 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

[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 Cc: "David S. Miller" Cc: sparcli...@vger.kernel.org Tested-by: Khalid Aziz --- 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/

[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 --- drivers/pci/setup-bus.c | 19 ++- 1 file

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

2015-10-27 Thread Yinghai Lu
-by: Meelis Roos Cc: Meelis Roos Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz --- drivers/pci/quirks.c | 18 -- 1 file changed, 18 deletions(-) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index b03373f..55bb661 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c

[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 Tested-by: Khalid Aziz --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci

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

2015-10-27 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 v8 18/61] PCI: Claim fixed resource during remove/rescan path

2015-10-27 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 af75580..1d85f37 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -323,6 +323,23 @@ static void quirk_s3_64M

[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 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 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 --- 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 5e1cc7e..5ea06c6 100644

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

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

[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 --- drivers/pci/setup-bus.c | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/pci/setup

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

2015-10-27 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 278cb6d..10270e4 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

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

[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 --- 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 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 --- drivers/pci/setup-bus.c | 22

[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 --- drivers/pci/setup-bus.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/pci/setup

[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 Cc: "Rafael J. Wysocki" Cc: Len Brown

[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 --- drivers/pci/setup-bus.c | 49 ++--- 1 file changed, 30 insertions(+), 19 deletions

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

2015-10-27 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 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 --- drivers/pci/setup-bus.c | 14 +++--- 1 fi

[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 --- 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 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 --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pci/setup

[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 --- drivers/pci/setup-bus.c | 39 +++ 1 file changed, 27 insertions(+), 12 deletions(-) d

[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 --- drivers/pci/setup

[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 --- kernel/resource.c | 81 ++- 1 file changed, 68

[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 --- drivers/pci/setup-bus.c | 26 -- 1 file

[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 --- drivers/pci/setup-bus.c | 8 1

[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 --- drivers/pci/setup-bus.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/setup-bus.c b

[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 --- 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/drivers/pci

[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 --- arch/x86/include

[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 Tested-by: Khalid Aziz --- drivers/pci/setup-bus.c | 31 +-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-bus.c b

[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 --- drivers/pci/setup-bus.c | 51 ++--- 1 file

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

2015-10-27 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 6ad0f05..39d2c50 100644 --- a/drivers/pci

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

2015-10-27 Thread Yinghai Lu
-...@lists.ozlabs.org Cc: linux-a...@vger.kernel.org Signed-off-by: Yinghai Lu Reviewed-by: Thomas Gleixner Acked-by: Michael Ellerman --- 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

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