[PATCH v4 24/52] PCI: Better support for two alt_size

2015-08-20 Thread Yinghai Lu
Need to put aligned with max align before not aligned, to get smaller alt_size. For example: alt align/size: 8M/9M, 4M/8M before this patch we have 8M/20M. After this patch we will have 8M/17M. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 80

[PATCH v4 28/52] PCI: Don't add too much io port for hotplug bridge with old size

2015-08-20 Thread Yinghai Lu
using size to compare with min_size at first. That is not right, we should have 0x2000. We should check size+size1 with min_size for io port, just add size1 to size and and don't pass extra size1 into calculate_iosize() directly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 8 --

[PATCH v4 49/52] PCI: Set resource to FIXED for LSI devices

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

[PATCH v4 46/52] PCI: Don't release sibling bridge resources during hotplug

2015-08-20 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 060977c..0c85c0a 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

[PATCH v4 26/52] PCI: Don't add too much optional size for hotplug bridge io

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

[PATCH v4 14/52] PCI: Add __add_to_list()

2015-08-20 Thread Yinghai Lu
Add new __add_to_list() to to take alt_size, alt_align for alt_size support. and simplify add_to_list() not to take add/alt input. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 51 ++--- 1 file changed, 31 insertions(+), 20 deletions

[PATCH v4 40/52] sparc/PCI: Add mem64 resource parsing for root bus

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

[PATCH v4 11/52] PCI: Add debug printout during releasing partial assigned resources

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

[PATCH v4 50/52] PCI, x86: Add pci=assign_pref_bars to reallocate pref BARs

2015-08-20 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 v4 33/52] resources: Split out __allocate_resource()

2015-08-20 Thread Yinghai Lu
It will not hold lock, so we could use it in other functions that hold the resource lock already. -v2: according to Linus, using "bool lock" as parameter aka "conditionally take lock" is *wrong*. Signed-off-by: Yinghai Lu Acked-by: Linus Torvalds --- ke

[PATCH v4 37/52] PCI: Add has_mem64 for struct host_bridge

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

[PATCH v4 30/52] PCI: Allow bridge optional only io port resource required size to be 0

2015-08-20 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 v4 31/52] PCI: Unify skip_ioresource_align()

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

[PATCH v4 35/52] PCI: Check pref compatible bit for mem64 resource of PCIe device

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

[PATCH v4 51/52] PCI: Introduce resource_disabled()

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

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

2015-08-20 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 v4 41/52] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-08-20 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 v4 48/52] PCI: Claim fixed resource during remove/rescan path

2015-08-20 Thread Yinghai Lu
citly. Signed-off-by: Yinghai Lu --- drivers/pci/quirks.c | 17 + 1 file changed, 17 insertions(+) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index e9fd0e9..9efa983 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -324,6 +324,23 @@ static void quirk_s

[PATCH v4 42/52] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2015-08-20 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 v4 34/52] resources: Make allocate_resource() return best fit resource

2015-08-20 Thread Yinghai Lu
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 insertions(+), 13 deletions(-) diff --git a/kernel/resource.c

[PATCH v4 17/52] PCI: Separate out save_resources()/restore_resources()

2015-08-20 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 v4 12/52] PCI: Simplify res reference using in __assign_resources_sorted()

2015-08-20 Thread Yinghai Lu
Use res instead of dev_res->res. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index a3d48ef..9d7adab 100644 --- a/drivers/pci/se

[PATCH v4 13/52] PCI, acpiphp: Add missing realloc list checking after resource allocation

2015-08-20 Thread Yinghai Lu
We check the realloc list, as list must be empty after allocation. Add missing one acpiphp driver. Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-a...@vger.kernel.org --- drivers/pci/hotplug/acpiphp_glue.c | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v4 02/52] PCI: Reuse res_to_dev_res() in reassign_resources_sorted()

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

Re: [PATCH v3 33/51] resources: Make allocate_resource return just fit resource

2015-08-19 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 9:21 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:51PM -0700, Yinghai Lu wrote: >> Find all suitable empty slots and pick one just fit, so we could save >> the big slot for needed ones later when we have several pcie switches >> and some

Re: [PATCH v3 32/51] resources: Split out __allocate_resource()

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 9:14 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:50PM -0700, Yinghai Lu wrote: >> It will not hold lock, so we could use it in other functions that >> hold the resource lock already. > > What's the benefit of this patch? Does it f

Re: [PATCH v3 28/51] PCI: Unifiy calculate_size for io port and mmio

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 9:13 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:46PM -0700, Yinghai Lu wrote: >> We should check size+size1 with min_size for io port. >> For example, when hotplug bridge has two children bridges, >> every child bridge will need 0x1

Re: [PATCH v3 27/51] PCI: Move ISA ioport align out of calculate_iosize

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 9:11 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:45PM -0700, Yinghai Lu wrote: >> So we could unify calculate_iosize and calculate_memsize later. > > Please make this a complete sentence, not just a continuation of the > summary line. > &g

Re: [PATCH v3 25/51] PCI: Fix size calculation with old_size on rescan path

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 9:09 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:43PM -0700, Yinghai Lu wrote: >> On booting path, we don't pass realloc at first, and treat all optional just >> as must, in some case we can smaller size/align with optional than must onl

Re: [PATCH v3 22/51] PCI: Add alt_size allocation support

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 5:03 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:40PM -0700, Yinghai Lu wrote: >> On system with several pcie switches, BIOS allocate very tight resources >> to the bridge bar, and it is not aligned to min_align as kernel allocation >> co

Re: [PATCH v3 20/51] PCI: Skip must+optional if there is no optional addon

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 4:56 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:38PM -0700, Yinghai Lu wrote: >> If the bridge does not support hotplug or no child with sriov support >> we could get out early and don't try must+optional allocation. > > You menti

Re: [PATCH v3 13/51] PCI: Separate realloc list checking after allocation

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 4:54 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:31PM -0700, Yinghai Lu wrote: >> We check the realloc list, as list must be empty after allocation. >> >> Separate the realloc list checking to another function. >> >> Add c

Re: [PATCH v3 09/51] PCI: Rename pdev_sort_resources to pdev_check_resources

2015-08-18 Thread Yinghai Lu
On Tue, Aug 18, 2015 at 2:36 PM, Yinghai Lu wrote: > On Mon, Aug 17, 2015 at 4:53 PM, Bjorn Helgaas wrote: >> On Mon, Jul 27, 2015 at 04:29:27PM -0700, Yinghai Lu wrote: >>> We don't do sorting in those functions anymore, so change "sort" to "check"

Re: [PATCH v3 09/51] PCI: Rename pdev_sort_resources to pdev_check_resources

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 4:53 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:27PM -0700, Yinghai Lu wrote: >> We don't do sorting in those functions anymore, so change "sort" to "check" >> instead. > > What *do* we do in those function

Re: [PATCH v3 01/51] PCI: Cleanup res_to_dev_res() printout for addon resources

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 3:50 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:19PM -0700, Yinghai Lu wrote: >> Now get_res_add_size and get_res_add_align all have same printout >> from res_to_dev_res(), and it is confusing. >> >> Move out debug messages p

Re: [PATCH v3 07/51] PCI: Reorder resources list for must/optional resources

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 4:52 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:25PM -0700, Yinghai Lu wrote: >> After we update size and alignment for must+optional resource, we >> reorder them with new alignment, but this is only for STARTALIGN. >> >> For SIZ

Re: [PATCH v3 04/51] PCI: Optimize bus align/size calculation during sizing

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 4:49 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:22PM -0700, Yinghai Lu wrote: >> Current code try to get align as small as possible and use that to >> align final size. But it does not handle resource that size is bigger >> than align i

Re: [PATCH v3 03/51] PCI: Use correct align for optional only resources during sorting

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 4:00 PM, Bjorn Helgaas wrote: > On Mon, Jul 27, 2015 at 04:29:21PM -0700, Yinghai Lu wrote: >> During sorting before assign, we only put resource with non-zero align >> in the sorted list, so for optional resources that must size is 0 and only >> have

Re: [PATCH v3 00/51] PCI: Resource allocation cleanup for v4.3

2015-08-18 Thread Yinghai Lu
On Mon, Aug 17, 2015 at 3:48 PM, Bjorn Helgaas wrote: > Overall comments: > > Thanks for paying attention to your subject lines. They are > capitalized and punctuated quite consistently. > > The one-line subject is a summary. The body of the changelog is not a > continuation of it. The body sho

[PATCH v2] lib/decompressors: Use real out buf size for gunzip with kernel

2015-08-13 Thread Yinghai Lu
buf[]/flush() for initramfs 3. fill()/flush() for initrd. This bug only affect kernel preboot path that use outbuf[]. Add __decompress and take real out_buf_len for gunzip instead of guessing wrong buf size. -v2: fix unused warning on sh/arm/m32r from Fengguang. Signed-off-by: Yinghai Lu Fi

[PATCH] lib/decompressors: Use real out buf size for gunzip with kernel

2015-08-13 Thread Yinghai Lu
buf[]/flush() for initramfs 3. fill()/flush() for initrd. This bug only affect kernel preboot path that use outbuf[]. Add __decompress and take real out_buf_len for gunzip instead of guessing wrong buf size. Signed-off-by: Yinghai Lu Fixes: 1431574a1c4 (lib/decompressors: fix "no limit

Re: [PATCH v3] PCI: Only enable IO window if supported

2015-08-06 Thread Yinghai Lu
parent bus, and later during sizing and assigning, check that bus flags and skip those resources. [bhelgaas: reverse sense of new pci_bus_flags_t value] [yinghai: only check root bus io port, and use flag on sizing and assigning] Signed-off-by: Guenter Roeck Signed-off-by: Yinghai Lu Cc: Bjorn He

Re: [PATCH v3] PCI: Only enable IO window if supported

2015-08-06 Thread Yinghai Lu
On Thu, Aug 6, 2015 at 9:18 AM, Guenter Roeck wrote: > On 08/06/2015 08:58 AM, Yinghai Lu wrote: > Ok, I admit that I am lost. Earlier it seemed that you were concerned about > this case, where no io window is available or a bus doesn't support io, > but a non-transparent ch

Re: [PATCH v3] PCI: Only enable IO window if supported

2015-08-06 Thread Yinghai Lu
On Wed, Aug 5, 2015 at 9:50 PM, Guenter Roeck wrote: > If I understand you correctly, we might need to change the code > in pci_read_bridge_io() as follows. > > From > > if (!(child->bus_flags & PCI_BUS_FLAGS_SUPPORTS_IO)) > return; > > to something like > > if (!(c

Re: [PATCH v3] PCI: Only enable IO window if supported

2015-08-05 Thread Yinghai Lu
On Wed, Aug 5, 2015 at 7:22 PM, Guenter Roeck wrote: > On 08/05/2015 06:38 PM, Yinghai Lu wrote: >> >> On Wed, Aug 5, 2015 at 6:14 PM, Yinghai Lu wrote: >>> >>> >>> It only can avoid warning with bridge, and still have warning on >>> devices u

Re: [PATCH v3] PCI: Only enable IO window if supported

2015-08-05 Thread Yinghai Lu
On Wed, Aug 5, 2015 at 6:14 PM, Yinghai Lu wrote: > > It only can avoid warning with bridge, and still have warning on > devices under the bridge. > > also would have problem on transparent bridges, like > > BRIDGE_A B

Re: [PATCH v3] PCI: Only enable IO window if supported

2015-08-05 Thread Yinghai Lu
On Thu, Jul 30, 2015 at 7:15 PM, Guenter Roeck wrote: > The PCI subsystem always assumes that I/O is supported on PCIe bridges > and tries to assign an I/O window to each child bus even if that is not > the case. > > This may result in messages such as: > > pcieport :02:00.0: res[7]=[io 0x1

[PATCH] x86: Kill E820_RESERVED_KERN

2015-07-28 Thread Yinghai Lu
: "Lee, Chun-Yi" Tested-by: "Lee, Chun-Yi" Reported-by: "Tian, Ye" Tested-by: "Tian, Ye" Cc: "Lee, Chun-Yi" Cc: Chen Yu Signed-off-by: Yinghai Lu Cc: Richard L Maliszewski Cc: Gang Wei Cc: Shane Wang Cc: tboot-de...@lists.sourceforge.net Cc:

Re: [PATCH v2] Do not reserve crashkernel high memory if crashkernel low memory reserving failed

2015-07-27 Thread Yinghai Lu
On Mon, Jul 27, 2015 at 5:52 PM, Baoquan He wrote: > On 07/22/15 at 04:47pm, Yinghai Lu wrote: > > Sorry for late reply. This problem is reported by customers. They usulay > don't like to make these things public. While for those systems with > good hard iommu support, i

[PATCH v3 01/51] PCI: Cleanup res_to_dev_res() printout for addon resources

2015-07-27 Thread Yinghai Lu
Now get_res_add_size and get_res_add_align all have same printout from res_to_dev_res(), and it is confusing. Move out debug messages printout from res_to_dev_res(), and later we will reuse res_to_dev_res() in other functions. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 34

[PATCH v3 04/51] PCI: Optimize bus align/size calculation during sizing

2015-07-27 Thread Yinghai Lu
/min_size: 0010/02b0 So align will be 1M instead of 4M. 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

[PATCH v3 02/51] PCI: Reuse res_to_dev_res in reassign_resources_sorted

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

[PATCH v3 00/51] PCI: Resource allocation cleanup for v4.3

2015-07-27 Thread Yinghai Lu
resource on last try: only with bridge resources - remove/rescan path checking with old_size. Yinghai Lu (51): PCI: Cleanup res_to_dev_res() printout for addon resources PCI: Reuse res_to_dev_res in reassign_resources_sorted PCI: Use correct align for optional only resources during sorting

[PATCH v3 09/51] PCI: Rename pdev_sort_resources to pdev_check_resources

2015-07-27 Thread Yinghai Lu
We don't do sorting in those functions anymore, so change "sort" to "check" instead. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus

[PATCH v3 08/51] PCI: Remove duplicated code for resource sorting

2015-07-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, so choose to keep __sort_resources, and remove related code in pdev_sort_resources. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 22

[PATCH v3 12/51] PCI: Simplify res reference using in __assign_resourcs_sorted

2015-07-27 Thread Yinghai Lu
Use res instead of dev_res->res. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 6dff258..06664db 100644 --- a/drivers/pci/se

[PATCH v3 18/51] PCI: Move comment to pci_need_to_release()

2015-07-27 Thread Yinghai Lu
Move comment from caller to callee, as we will have one new caller for alt_size support later. 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/setup

[PATCH v3 24/51] PCI: Better support for two alt_size

2015-07-27 Thread Yinghai Lu
Need to put aligned with max align before not aligned. For example: alt align/size: 8M/9M, 4M/8M before this patch we have 8M/20M. After this patch we will have 8M/17M. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 80 +++-- 1 file changed

[PATCH v3 25/51] PCI: Fix size calculation with old_size on rescan path

2015-07-27 Thread Yinghai Lu
ned-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 8999ead..2679ccc 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1146,9 +1146,9

[PATCH v3 31/51] PCI: Kill macro checking for bus io port sizing

2015-07-27 Thread Yinghai Lu
Use new generic version skip_isa_ioresource_align() instead. 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 index d4610a8..f8f89cd 100644 --- a/drivers

[PATCH v3 27/51] PCI: Move ISA ioport align out of calculate_iosize

2015-07-27 Thread Yinghai Lu
So we could unify calculate_iosize and calculate_memsize later. when one bridge have several children devices, and every devices have several io port resources and resource size < 0x400. We need to check size, and add extra size to make sure bit8/9 to be zero. Signed-off-by: Yinghai

[PATCH v3 26/51] PCI: Don't add too much optional size for hotplug bridge io

2015-07-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 addressing io port. It will compare must+optional with min_sum_size to get smaller optional size. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 26

[PATCH v3 32/51] resources: Split out __allocate_resource()

2015-07-27 Thread Yinghai Lu
It will not hold lock, so we could use it in other functions that hold the resource lock already. -v2: according to Linus, using "bool lock" as parameter aka "conditionally take lock" is *wrong*. Signed-off-by: Yinghai Lu Acked-by: Linus Torvalds --- ke

[PATCH v3 35/51] PCI: Only treat non-pef mmio64 as pref if all bridges has MEM_64

2015-07-27 Thread Yinghai Lu
re we check them for child device resources. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 78b0c36..c6c9d56 100644 --- a/drivers/pci/setup-bus.c

[PATCH v3 28/51] PCI: Unifiy calculate_size for io port and mmio

2015-07-27 Thread Yinghai Lu
because we are using size to compare with min_size. That is not right, we should use 0x2000 instead. After this change, calculate_memsize and calculate_iosize is the same. Change them to calculate_size. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 27 ++- 1

[PATCH v3 37/51] PCI: Only treat non-pef mmio64 as pref if host-bridge has_mem64

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

[PATCH v3 40/51] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in of parsing

2015-07-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 --- 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 v3 45/51] PCI: Don't release sibiling bridge resources during hotplug

2015-07-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 83e3201..63a5d4cf 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c

[PATCH v3 06/51] PCI: Don't add too much optional size for hotplug bridge mmio

2015-07-27 Thread Yinghai Lu
size should be 2M. This patch change to comparing must+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-bus.c b/drivers

[PATCH v3 07/51] PCI: Reorder resources list for must/optional resources

2015-07-27 Thread Yinghai Lu
the sorting back after we restore resource to must only when must+optional fail to allocate for all. So move out the reordering code from the loop to separated function, and call it two times accordingly. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 62

[PATCH v3 47/51] PCI: Claim fixed resource during remove/rescan path

2015-07-27 Thread Yinghai Lu
at is intentional for us to get new resources for rescan. We do have example to use rescan to make device get resource allocated. 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

[PATCH v3 33/51] resources: Make allocate_resource return just fit resource

2015-07-27 Thread Yinghai Lu
Find all suitable empty slots and pick one just fit, so we could save the big slot for needed ones later when we have several pcie switches and some bridges get assigned bios and we need to assign others in kernel. Signed-off-by: Yinghai Lu --- kernel/resource.c | 81

[PATCH v3 21/51] PCI: Move saved required resource list out of must+optional assigning

2015-07-27 Thread Yinghai Lu
We will need to share that saved list for alt_size support. 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/drivers/pci/setup-bus.c index 64ef516..1c0b4c5 100644

[PATCH v3 13/51] PCI: Separate realloc list checking after allocation

2015-07-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. Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-a...@vger.kernel.org --- drivers/p

[PATCH v3 11/51] PCI: Add debug printout during releasing partial assigned resources

2015-07-27 Thread Yinghai Lu
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 file c

[PATCH v3 14/51] PCI: Add __add_to_list()

2015-07-27 Thread Yinghai Lu
to take alt_size, alt_align. preparation patch for alt_size support. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 51 ++--- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c

[PATCH v3 16/51] PCI: Check if resource is allocated before pci_assign

2015-07-27 Thread Yinghai Lu
Skip allocated resource in the list, as pci_assign_resource() only can handle not assigned resource. And we could have assigned resource already in the list before alt_size trying. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v3 20/51] PCI: Skip must+optional if there is no optional addon

2015-07-27 Thread Yinghai Lu
If the bridge does not support hotplug or no child with sriov support we could get out early and don't try must+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 --- drivers/pci/setup-bus.c

[PATCH v3 38/51] PCI: Restore pref mmio allocation logic for hostbridge without mmio64

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

[PATCH v3 34/51] PCI: Check pref compatible bit for mem64 resource of pcie device

2015-07-27 Thread Yinghai Lu
.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 Cc: #3.19 --- drivers/pci/pci.c | 3 ++- drivers/pci/pci.h | 2 ++ dri

[PATCH v3 49/51] PCI, x86: Add pci=assign_pref_bars to re-allocate pref bars

2015-07-27 Thread Yinghai Lu
So could reallocate pref mmio64 above 4G later. Signed-off-by: Yinghai Lu --- arch/x86/include/asm/pci_x86.h | 1 + arch/x86/pci/common.c | 3 +++ arch/x86/pci/i386.c| 56 ++ 3 files changed, 39 insertions(+), 21 deletions(-) diff

[PATCH v3 43/51] PCI: Treat optional as must in first try for bridge rescan

2015-07-27 Thread Yinghai Lu
t and optonal separatedly) will be kept for next try. 2. last try: a: try to allocate must+optional to see if all get allocated. b: try to allocate must then expand to optional. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 19 ++- 1 file changed, 14 insertions(

[PATCH v3 50/51] PCI: Introduce resource_disabled()

2015-07-27 Thread Yinghai Lu
-xtensa.org Cc: io...@lists.linux-foundation.org Cc: linux...@vger.kernel.org Signed-off-by: Yinghai Lu --- arch/alpha/kernel/pci.c | 2 +- arch/ia64/pci/pci.c | 4 ++-- arch/microblaze/pci/pci-common.c | 15 --- arch/mn10300/unit

[PATCH v3 48/51] PCI: Set resource to FIXED for lsi devices

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

[PATCH v3 19/51] PCI: Separate must+optional assigning to another function

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

[PATCH v3 15/51] PCI: Cache window alignment value

2015-07-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 v3 51/51] PCI: Don't set flags to 0 when assign resource fail

2015-07-27 Thread Yinghai Lu
make flags take IORESOURCE_UNSET | IORESOURCE_DISABLED instead. Signed-off-by: Yinghai Lu --- drivers/pci/bus.c | 2 +- drivers/pci/setup-bus.c | 45 +++-- drivers/pci/setup-res.c | 3 ++- 3 files changed, 26 insertions(+), 24 deletions(-) diff

[PATCH v3 44/51] PCI: Get new realloc size for bridge for last try

2015-07-27 Thread Yinghai Lu
ear the old resource size for last try or third and later try. -v3: change reset_bridge_resource_size to static according to Fengguang. 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 ch

[PATCH v3 46/51] PCI: Don't release fixed resource for realloc

2015-07-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 v3 17/51] PCI: Separate out save_resources/restore_resource

2015-07-27 Thread Yinghai Lu
will reuse it in alt_size support. Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 49 ++--- 1 file changed, 30 insertions(+), 19 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 1622ad2..2e3d00b 100644 --- a

[PATCH v3 05/51] PCI: Optimize bus align/size calculation for optional during sizing

2015-07-27 Thread Yinghai Lu
===END so must align/size: 0x40/0x240, and new must+optional align/size: 0x10/0x2b0, and it is better than old must+optional align/size: 0x80/0x300 Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Reported-by: TJ Signed-off-by: Yinghai Lu

[PATCH v3 22/51] PCI: Add alt_size allocation support

2015-07-27 Thread Yinghai Lu
alt_size works. Later 62:00.0 get correct resource allocated too. Link: https://bugzilla.kernel.org/show_bug.cgi?id=100451 Reported-by: Yijing Wang Tested-by: Yijing Wang Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 203 +--- 1 file changed, 191

[PATCH v3 36/51] PCI: Add has_mem64 for host_bridge

2015-07-27 Thread Yinghai Lu
e pref bar. Signed-off-by: Yinghai Lu --- drivers/pci/probe.c | 9 + include/linux/pci.h | 1 + 2 files changed, 10 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 010d8d9..14bdbca 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c @@ -2051,6 +2051,15

[PATCH v3 42/51] of/PCI: Add IORESOURCE_MEM_64 for 64-bit resource

2015-07-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 --- 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 8bfda6a..073125f 100644 --- a

[PATCH v3 30/51] PCI: Unify skip_ioresource_align()

2015-07-27 Thread Yinghai Lu
...@vger.kernel.org Signed-off-by: Yinghai Lu --- arch/microblaze/pci/pci-common.c | 8 arch/powerpc/kernel/pci-common.c | 11 +-- arch/x86/include/asm/pci_x86.h | 1 - arch/x86/pci/common.c| 4 ++-- arch/x86/pci/i386.c | 12 ++-- drivers/pci/setup

[PATCH v3 39/51] sparc/PCI: Add mem64 resource parsing for root bus

2015-07-27 Thread Yinghai Lu
arc/PCI: Clip bridge windows to fit in upstream windows") Link: http://lkml.kernel.org/r/cae9fiqu1gjy1lyrxs+ma5lcteee4xmtjrg0axj9k_tsu+m9...@mail.gmail.com Reported-by: David Ahern Tested-by: David Ahern Signed-off-by: Yinghai Lu Cc: #3.19 --- arch/sparc/kernel/pci.c| 7 +

[PATCH v3 41/51] powerpc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in of parsing

2015-07-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 v3 29/51] PCI: Allow optional only io resource must size to be 0

2015-07-27 Thread Yinghai Lu
: Yinghai Lu --- drivers/pci/setup-bus.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index aeed716..3a94617 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c @@ -1242,8 +1242,9 @@ static void

[PATCH v3 23/51] PCI: Add support for more than two alt_size under same bridge

2015-07-27 Thread Yinghai Lu
/size: 4M/20M. So at last, we use 8M/17M as parent bridge alt_align/alt_size. Link: https://bugzilla.kernel.org/show_bug.cgi?id=100451 Reported-by: Yijing Wang Tested-by: Yijing Wang Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 56 +++-- 1

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

2015-07-27 Thread Yinghai Lu
://bugzilla.kernel.org/show_bug.cgi?id=81431 Reported-by: TJ Signed-off-by: Yinghai Lu --- drivers/pci/setup-bus.c | 50 ++--- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 247d8fe

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