[RFC PATCH v3 1/2] PCI: Let pci_mmap_page_range() extra resource pointer

2016-05-10 Thread Yinghai Lu
This one is preparing patch for next one: PCI: Let pci_mmap_page_range() take resource addr We need to pass extra resource pointer to avoid searching that again for powerpc and microblaze prot set operation. Signed-off-by: Yinghai Lu --- arch/arm/include/asm/pci.h |2

[RFC PATCH v3 2/2] PCI: Let pci_mmap_page_range() take resource address

2016-05-10 Thread Yinghai Lu
_resource and remove __pci_mmap_make_offset -v3: pass resource pointer with pci_mmap_page_range() Signed-off-by: Yinghai Lu --- arch/microblaze/pci/pci-common.c | 78 ++ arch/powerpc/kernel/pci-common.c | 78 ++

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 3:23 PM, Kees Cook wrote: >> The exact reason to have assigning in functions. >> >> pgt_data address could be changed during kernel relocation. >> so can not assigned during compiling time. > > Ah-ha, that explains why I had to keep it on the stack.

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 3:23 PM, Kees Cook wrote: >> The exact reason to have assigning in functions. >> >> pgt_data address could be changed during kernel relocation. >> so can not assigned during compiling time. > > Ah-ha, that explains why I had to keep it on the stack. Thanks for the >

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 3:23 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Mon, May 9, 2016 at 3:01 PM, Yinghai Lu <ying...@kernel.org> wrote: >> Still should be assigned once, and should be done in >> prepare_level4(). --- by may need different name for that ? >

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 3:23 PM, Yinghai Lu wrote: > On Mon, May 9, 2016 at 3:01 PM, Yinghai Lu wrote: >> Still should be assigned once, and should be done in >> prepare_level4(). --- by may need different name for that ? >> >> The exact reason to have assigning i

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 3:01 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Mon, May 9, 2016 at 1:22 PM, Kees Cook <keesc...@chromium.org> wrote: >> As it turns out, mapping_info DOES need to be initialized every >> time. Without this, page tables were not being correc

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 3:01 PM, Yinghai Lu wrote: > On Mon, May 9, 2016 at 1:22 PM, Kees Cook wrote: >> As it turns out, mapping_info DOES need to be initialized every >> time. Without this, page tables were not being corrected updated, which >> could cause reboots when a ph

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 1:22 PM, Kees Cook wrote: > As it turns out, mapping_info DOES need to be initialized every > time. Without this, page tables were not being corrected updated, which > could cause reboots when a physical address beyond 2G was chosen. > >

Re: [PATCH v7 1/9] x86/KASLR: Initialize mapping_info every time

2016-05-09 Thread Yinghai Lu
On Mon, May 9, 2016 at 1:22 PM, Kees Cook wrote: > As it turns out, mapping_info DOES need to be initialized every > time. Without this, page tables were not being corrected updated, which > could cause reboots when a physical address beyond 2G was chosen. > > Signed-off-by: Kees Cook > --- >

[tip:x86/boot] x86/boot: Split out kernel_ident_mapping_init()

2016-05-07 Thread tip-bot for Yinghai Lu
Commit-ID: cf4fb15b3110df070fe9829a1ef38fef8316fb90 Gitweb: http://git.kernel.org/tip/cf4fb15b3110df070fe9829a1ef38fef8316fb90 Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Fri, 6 May 2016 15:01:34 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Sat, 7 May 2

[tip:x86/boot] x86/boot: Split out kernel_ident_mapping_init()

2016-05-07 Thread tip-bot for Yinghai Lu
Commit-ID: cf4fb15b3110df070fe9829a1ef38fef8316fb90 Gitweb: http://git.kernel.org/tip/cf4fb15b3110df070fe9829a1ef38fef8316fb90 Author: Yinghai Lu AuthorDate: Fri, 6 May 2016 15:01:34 -0700 Committer: Ingo Molnar CommitDate: Sat, 7 May 2016 07:38:39 +0200 x86/boot: Split out

[tip:x86/boot] x86/KASLR: Consolidate mem_avoid[] entries

2016-05-06 Thread tip-bot for Yinghai Lu
Commit-ID: 9dc1969c24eff8b7d7a9a565d1047b624921ba06 Gitweb: http://git.kernel.org/tip/9dc1969c24eff8b7d7a9a565d1047b624921ba06 Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Thu, 5 May 2016 15:13:47 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 6 May 2

[tip:x86/boot] x86/KASLR: Consolidate mem_avoid[] entries

2016-05-06 Thread tip-bot for Yinghai Lu
Commit-ID: 9dc1969c24eff8b7d7a9a565d1047b624921ba06 Gitweb: http://git.kernel.org/tip/9dc1969c24eff8b7d7a9a565d1047b624921ba06 Author: Yinghai Lu AuthorDate: Thu, 5 May 2016 15:13:47 -0700 Committer: Ingo Molnar CommitDate: Fri, 6 May 2016 09:00:59 +0200 x86/KASLR: Consolidate

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-05 Thread Yinghai Lu
On Thu, May 5, 2016 at 5:56 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Thu, May 5, 2016 at 3:02 PM, Benjamin Herrenschmidt > <b...@kernel.crashing.org> wrote: >> On Thu, 2016-05-05 at 08:53 -0700, Yinghai Lu wrote: >>> For powerpc io port, we still need e

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-05 Thread Yinghai Lu
On Thu, May 5, 2016 at 5:56 PM, Yinghai Lu wrote: > On Thu, May 5, 2016 at 3:02 PM, Benjamin Herrenschmidt > wrote: >> On Thu, 2016-05-05 at 08:53 -0700, Yinghai Lu wrote: >>> For powerpc io port, we still need extra offset from resource address >>> to final address

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-05 Thread Yinghai Lu
On Thu, May 5, 2016 at 3:02 PM, Benjamin Herrenschmidt <b...@kernel.crashing.org> wrote: > On Thu, 2016-05-05 at 08:53 -0700, Yinghai Lu wrote: >> For powerpc io port, we still need extra offset from resource address >> to final address. >> >

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-05 Thread Yinghai Lu
On Thu, May 5, 2016 at 3:02 PM, Benjamin Herrenschmidt wrote: > On Thu, 2016-05-05 at 08:53 -0700, Yinghai Lu wrote: >> For powerpc io port, we still need extra offset from resource address >> to final address. >> >> resource_size_t offset = >>

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-05 Thread Yinghai Lu
On Wed, May 4, 2016 at 5:25 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Wed, May 4, 2016 at 11:46 AM, Yinghai Lu <ying...@kernel.org> wrote: >> On Wed, May 4, 2016 at 8:17 AM, Bjorn Helgaas <helg...@kernel.org> wrote: >>> My goal is to make pci_mmap_res

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-05 Thread Yinghai Lu
On Wed, May 4, 2016 at 5:25 PM, Yinghai Lu wrote: > On Wed, May 4, 2016 at 11:46 AM, Yinghai Lu wrote: >> On Wed, May 4, 2016 at 8:17 AM, Bjorn Helgaas wrote: >>> My goal is to make pci_mmap_resource() and proc_bus_pci_mmap() look >>> very similar, e.g., &

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-04 Thread Yinghai Lu
On Wed, May 4, 2016 at 11:46 AM, Yinghai Lu <ying...@kernel.org> wrote: > On Wed, May 4, 2016 at 8:17 AM, Bjorn Helgaas <helg...@kernel.org> wrote: >> My goal is to make pci_mmap_resource() and proc_bus_pci_mmap() look >> very similar, e.g., >> >> /* locat

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-04 Thread Yinghai Lu
On Wed, May 4, 2016 at 11:46 AM, Yinghai Lu wrote: > On Wed, May 4, 2016 at 8:17 AM, Bjorn Helgaas wrote: >> My goal is to make pci_mmap_resource() and proc_bus_pci_mmap() look >> very similar, e.g., >> >> /* locate resource */ >> pci_user_to

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-04 Thread Yinghai Lu
On Wed, May 4, 2016 at 8:17 AM, Bjorn Helgaas wrote: > > What mess do you mean? The fact that you could only use > pcibios_bus_to_resource() for MEM, and something else for IO? Even > if we could only use pcibios_bus_to_resource() for MEM, that sounds > like an improvement,

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-04 Thread Yinghai Lu
On Wed, May 4, 2016 at 8:17 AM, Bjorn Helgaas wrote: > > What mess do you mean? The fact that you could only use > pcibios_bus_to_resource() for MEM, and something else for IO? Even > if we could only use pcibios_bus_to_resource() for MEM, that sounds > like an improvement, not a mess. I means

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-03 Thread Yinghai Lu
On Tue, May 3, 2016 at 10:08 PM, Yinghai Lu <ying...@kernel.org> wrote: > On Tue, May 3, 2016 at 6:25 PM, Bjorn Helgaas <helg...@kernel.org> wrote: >> I did not propose changing any user-visible ABI. To recap what I did >> propose: > > I want to avoid introduce

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-03 Thread Yinghai Lu
On Tue, May 3, 2016 at 10:08 PM, Yinghai Lu wrote: > On Tue, May 3, 2016 at 6:25 PM, Bjorn Helgaas wrote: >> I did not propose changing any user-visible ABI. To recap what I did >> propose: > > I want to avoid introduce one strange pci_user_to_resource. > >> >

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-03 Thread Yinghai Lu
till use BAR value and only touch pci_mmap_fits() ? like i suggested before, and it does not conflict with the patchset. Subject: [PATCH] PCI: Fix pci_mmap_fits() with proc interface Passed value is user address, so need to compare it with user addr that is converted from dev resource. Signed-o

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-03 Thread Yinghai Lu
nly touch pci_mmap_fits() ? like i suggested before, and it does not conflict with the patchset. Subject: [PATCH] PCI: Fix pci_mmap_fits() with proc interface Passed value is user address, so need to compare it with user addr that is converted from dev resource. Signed-off-by: Yinghai Lu --- d

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-03 Thread Yinghai Lu
On Fri, Apr 29, 2016 at 12:19 AM, Yinghai Lu <ying...@kernel.org> wrote: > On Thu, Apr 28, 2016 at 6:56 AM, Bjorn Helgaas <helg...@kernel.org> wrote: >> >> 1) The sysfs path uses offsets between 0 and BAR size. This path >> should work identically

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-05-03 Thread Yinghai Lu
On Fri, Apr 29, 2016 at 12:19 AM, Yinghai Lu wrote: > On Thu, Apr 28, 2016 at 6:56 AM, Bjorn Helgaas wrote: >> >> 1) The sysfs path uses offsets between 0 and BAR size. This path >> should work identically on all arches. "User" addresses are not >&g

[tip:x86/boot] x86/boot: Correctly bounds-check relocations

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 4abf061bf87bbd856c8d60199b2fba8b8f9b9fd6 Gitweb: http://git.kernel.org/tip/4abf061bf87bbd856c8d60199b2fba8b8f9b9fd6 Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Thu, 28 Apr 2016 17:09:08 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 29 Ap

[tip:x86/boot] x86/boot: Correctly bounds-check relocations

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 4abf061bf87bbd856c8d60199b2fba8b8f9b9fd6 Gitweb: http://git.kernel.org/tip/4abf061bf87bbd856c8d60199b2fba8b8f9b9fd6 Author: Yinghai Lu AuthorDate: Thu, 28 Apr 2016 17:09:08 -0700 Committer: Ingo Molnar CommitDate: Fri, 29 Apr 2016 11:03:30 +0200 x86/boot: Correctly bounds

[tip:x86/boot] x86/KASLR: Clean up unused code from old 'run_size' and rename it to 'kernel_total_size'

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 4d2d542482205d3df1a0852751f5b004cc6390cc Gitweb: http://git.kernel.org/tip/4d2d542482205d3df1a0852751f5b004cc6390cc Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Thu, 28 Apr 2016 17:09:07 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 29 Ap

[tip:x86/boot] x86/boot: Calculate decompression size during boot not build

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: d607251ba9acc0b5faeaa08818f60d041dd19472 Gitweb: http://git.kernel.org/tip/d607251ba9acc0b5faeaa08818f60d041dd19472 Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Thu, 28 Apr 2016 17:09:05 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 29 Ap

[tip:x86/boot] x86/boot: Fix "run_size" calculation

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 67b6662559f7f77bcbd3ac67d09aaac11785f3c1 Gitweb: http://git.kernel.org/tip/67b6662559f7f77bcbd3ac67d09aaac11785f3c1 Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Thu, 28 Apr 2016 17:09:06 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 29 Ap

[tip:x86/boot] x86/KASLR: Clean up unused code from old 'run_size' and rename it to 'kernel_total_size'

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 4d2d542482205d3df1a0852751f5b004cc6390cc Gitweb: http://git.kernel.org/tip/4d2d542482205d3df1a0852751f5b004cc6390cc Author: Yinghai Lu AuthorDate: Thu, 28 Apr 2016 17:09:07 -0700 Committer: Ingo Molnar CommitDate: Fri, 29 Apr 2016 11:03:30 +0200 x86/KASLR: Clean up unused

[tip:x86/boot] x86/boot: Calculate decompression size during boot not build

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: d607251ba9acc0b5faeaa08818f60d041dd19472 Gitweb: http://git.kernel.org/tip/d607251ba9acc0b5faeaa08818f60d041dd19472 Author: Yinghai Lu AuthorDate: Thu, 28 Apr 2016 17:09:05 -0700 Committer: Ingo Molnar CommitDate: Fri, 29 Apr 2016 11:03:29 +0200 x86/boot: Calculate

[tip:x86/boot] x86/boot: Fix "run_size" calculation

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 67b6662559f7f77bcbd3ac67d09aaac11785f3c1 Gitweb: http://git.kernel.org/tip/67b6662559f7f77bcbd3ac67d09aaac11785f3c1 Author: Yinghai Lu AuthorDate: Thu, 28 Apr 2016 17:09:06 -0700 Committer: Ingo Molnar CommitDate: Fri, 29 Apr 2016 11:03:30 +0200 x86/boot: Fix "run

[tip:x86/boot] x86/boot: Move compressed kernel to the end of the decompression buffer

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda Gitweb: http://git.kernel.org/tip/974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Thu, 28 Apr 2016 17:09:04 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Fri, 29 Ap

[tip:x86/boot] x86/boot: Move compressed kernel to the end of the decompression buffer

2016-04-29 Thread tip-bot for Yinghai Lu
Commit-ID: 974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda Gitweb: http://git.kernel.org/tip/974f221c84b05b1dc2f5ea50dc16d2a9d1e95eda Author: Yinghai Lu AuthorDate: Thu, 28 Apr 2016 17:09:04 -0700 Committer: Ingo Molnar CommitDate: Fri, 29 Apr 2016 11:03:29 +0200 x86/boot: Move compressed

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-04-29 Thread Yinghai Lu
On Thu, Apr 28, 2016 at 6:56 AM, Bjorn Helgaas <helg...@kernel.org> wrote: > On Wed, Apr 27, 2016 at 09:55:45PM -0700, Yinghai Lu wrote: >> On Fri, Apr 22, 2016 at 1:49 PM, Bjorn Helgaas <helg...@kernel.org> wrote: >> > [+cc Ben, Michael] >> > I'm kind of con

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-04-29 Thread Yinghai Lu
On Thu, Apr 28, 2016 at 6:56 AM, Bjorn Helgaas wrote: > On Wed, Apr 27, 2016 at 09:55:45PM -0700, Yinghai Lu wrote: >> On Fri, Apr 22, 2016 at 1:49 PM, Bjorn Helgaas wrote: >> > [+cc Ben, Michael] >> > I'm kind of confused here. There are two ways to mmap PCI BARs: &

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-04-27 Thread Yinghai Lu
On Fri, Apr 22, 2016 at 1:49 PM, Bjorn Helgaas wrote: > [+cc Ben, Michael] > I'm kind of confused here. There are two ways to mmap PCI BARs: > > /proc/bus/pci/00/02.0 (proc_bus_pci_mmap()): > all BARs in one file; MEM/IO determined by ioctl() > mmap offset is a CPU

Re: [PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-04-27 Thread Yinghai Lu
On Fri, Apr 22, 2016 at 1:49 PM, Bjorn Helgaas wrote: > [+cc Ben, Michael] > I'm kind of confused here. There are two ways to mmap PCI BARs: > > /proc/bus/pci/00/02.0 (proc_bus_pci_mmap()): > all BARs in one file; MEM/IO determined by ioctl() > mmap offset is a CPU physical address in

[tip:x86/boot] x86/KASLR: Remove unneeded boot_params argument

2016-04-19 Thread tip-bot for Yinghai Lu
Commit-ID: 206f25a8319b312b9983953a308b0e38e1943c1c Gitweb: http://git.kernel.org/tip/206f25a8319b312b9983953a308b0e38e1943c1c Author: Yinghai Lu <ying...@kernel.org> AuthorDate: Mon, 18 Apr 2016 09:42:11 -0700 Committer: Ingo Molnar <mi...@kernel.org> CommitDate: Tue, 19 Ap

[tip:x86/boot] x86/KASLR: Remove unneeded boot_params argument

2016-04-19 Thread tip-bot for Yinghai Lu
Commit-ID: 206f25a8319b312b9983953a308b0e38e1943c1c Gitweb: http://git.kernel.org/tip/206f25a8319b312b9983953a308b0e38e1943c1c Author: Yinghai Lu AuthorDate: Mon, 18 Apr 2016 09:42:11 -0700 Committer: Ingo Molnar CommitDate: Tue, 19 Apr 2016 10:30:50 +0200 x86/KASLR: Remove unneeded

Re: [PATCH v11 00/60] PCI: Resource allocation cleanup for v4.7

2016-04-08 Thread Yinghai Lu
pci_mmap_resource() alpha/PCI: Only check iomem_is_exclusive() for IORESOURCE_MEM, not IORESOURCE_IO Yinghai Lu (58): PCI: Add pci_find_bus_resource() sparc/PCI: Use correct offset for bus address to resource sparc/PCI: Reserve legacy mmio after PCI mmio sparc/PCI: Add IORESOURCE

Re: [PATCH v11 00/60] PCI: Resource allocation cleanup for v4.7

2016-04-08 Thread Yinghai Lu
alpha/PCI: Only check iomem_is_exclusive() for IORESOURCE_MEM, not IORESOURCE_IO Yinghai Lu (58): PCI: Add pci_find_bus_resource() sparc/PCI: Use correct offset for bus address to resource sparc/PCI: Reserve legacy mmio after PCI mmio sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing spa

Re: [PATCH v11 44/60] PCI: Add alt_size ressource allocation support

2016-04-07 Thread Yinghai Lu
On Thu, Apr 7, 2016 at 5:56 PM, Linus Torvalds wrote: > I'm not excited about the whole "alternate aligment". > > Maybe the kernel should just accept the smaller alignment. If the > minimum alignment we use is bigger than necessary, then we're just > wrong about it,

Re: [PATCH v11 44/60] PCI: Add alt_size ressource allocation support

2016-04-07 Thread Yinghai Lu
On Thu, Apr 7, 2016 at 5:56 PM, Linus Torvalds wrote: > I'm not excited about the whole "alternate aligment". > > Maybe the kernel should just accept the smaller alignment. If the > minimum alignment we use is bigger than necessary, then we're just > wrong about it, and perhaps we should just use

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

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

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

2016-04-07 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 v11 05/60] sparc/PCI: Reserve legacy mmio after PCI mmio

2016-04-07 Thread Yinghai Lu
pcibios_bus_to_resource() -v6: use pci_find_bus_resource() Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- arch/sparc/kernel/pci.c| 1 + arch/sparc/kernel/pci_common.c | 59 ++ arch/

[PATCH v11 05/60] sparc/PCI: Reserve legacy mmio after PCI mmio

2016-04-07 Thread Yinghai Lu
pcibios_bus_to_resource() -v6: use pci_find_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

[PATCH v11 44/60] PCI: Add alt_size ressource allocation support

2016-04-07 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 v11 44/60] PCI: Add alt_size ressource allocation support

2016-04-07 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 6c58b4a..f3e9873

[PATCH v11 14/60] PCI: Add has_mem64 for struct host_bridge

2016-04-07 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 v11 14/60] PCI: Add has_mem64 for struct host_bridge

2016-04-07 Thread Yinghai Lu
mmio64 and pref mmio32 under bridge pref bar. Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz --- drivers/pci/probe.c | 7 +++ include/linux/pci.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 48e6f29..6b079f4 100644 --- a/drivers/pci

[PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-04-07 Thread Yinghai Lu
-v6: use pci_find_bus_resource(). Signed-off-by: Yinghai Lu <ying...@kernel.org> Tested-by: Khalid Aziz <khalid.a...@oracle.com> --- arch/sparc/kernel/pci.c| 54 -- arch/sparc/kernel/pci_common.c | 32 ++--- arch/sparc/kernel/pci_impl.

[PATCH v11 03/60] PCI: Add pci_find_bus_resource()

2016-04-07 Thread Yinghai Lu
Add pci_find_bus_resource() to return bus resource for input resource. In some case, we may only have bus instead of dev. It is same as pci_find_parent_resource, but take bus as input. Signed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/pci.c

[PATCH v11 04/60] sparc/PCI: Use correct offset for bus address to resource

2016-04-07 Thread Yinghai Lu
-v6: use pci_find_bus_resource(). Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz --- arch/sparc/kernel/pci.c| 54 -- arch/sparc/kernel/pci_common.c | 32 ++--- arch/sparc/kernel/pci_impl.h | 4 3 files changed, 54 insertions(+), 36

[PATCH v11 03/60] PCI: Add pci_find_bus_resource()

2016-04-07 Thread Yinghai Lu
Add pci_find_bus_resource() to return bus resource for input resource. In some case, we may only have bus instead of dev. It is same as pci_find_parent_resource, but take bus as input. Signed-off-by: Yinghai Lu --- drivers/pci/pci.c | 27 --- include/linux/pci.h | 2

[PATCH v11 53/60] PCI: Kill macro checking for bus io port sizing

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

[PATCH v11 01/60] PCI: Fix iomem_is_exclusive() checking in pci_mmap_resource()

2016-04-07 Thread Yinghai Lu
ut the bus address doesn't match it). Call iomem_is_exclusive() with "res->start", which is always a CPU physical address, not the result of pci_resource_to_user(). Fixes: e8de1481fd71 ("resource: allow MMIO exclusivity for device drivers") Suggested-by: Yinghai Lu <ying...@ker

[PATCH v11 01/60] PCI: Fix iomem_is_exclusive() checking in pci_mmap_resource()

2016-04-07 Thread Yinghai Lu
. Call iomem_is_exclusive() with "res->start", which is always a CPU physical address, not the result of pci_resource_to_user(). Fixes: e8de1481fd71 ("resource: allow MMIO exclusivity for device drivers") Suggested-by: Yinghai Lu Signed-off-by: Bjorn Helgaas CC: A

[PATCH v11 53/60] PCI: Kill macro checking for bus io port sizing

2016-04-07 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 v11 30/60] PCI: Reorder resources list for required/optional resources

2016-04-07 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 f

[PATCH v11 30/60] PCI: Reorder resources list for required/optional resources

2016-04-07 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 f6b7b8f..aed62cc 100644

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

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

[PATCH v11 06/60] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

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

[PATCH v11 08/60] PCI: Kill wrong quirk about M7101

2016-04-07 Thread Yinghai Lu
them. Link: http://kodu.ut.ee/~mroos/dm/dm.v240 Link: http://kodu.ut.ee/~mroos/dm/dm.sb100 Reported-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> Cc: Linus

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

2016-04-07 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 v11 06/60] sparc/PCI: Add IORESOURCE_MEM_64 for 64-bit resource in OF parsing

2016-04-07 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 deletion

[PATCH v11 08/60] PCI: Kill wrong quirk about M7101

2016-04-07 Thread Yinghai Lu
them. Link: http://kodu.ut.ee/~mroos/dm/dm.v240 Link: http://kodu.ut.ee/~mroos/dm/dm.sb100 Reported-by: Meelis Roos Cc: Meelis Roos Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz Cc: Linus Torvalds --- drivers/pci/quirks.c | 18 -- 1 file changed, 18 deletions(-) diff

[PATCH v11 27/60] PCI: Optimize bus min_align/size calculation during sizing

2016-04-07 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 v11 24/60] PCI: Cleanup res_to_dev_res() printout

2016-04-07 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 4674e6b..dd33234

[PATCH v11 27/60] PCI: Optimize bus min_align/size calculation during sizing

2016-04-07 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 v11 24/60] PCI: Cleanup res_to_dev_res() printout

2016-04-07 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 4674e6b..dd33234 100644 --- a/drivers/pci/setup

[PATCH v11 19/60] PCI: Set resource to FIXED for LSI devices

2016-04-07 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 -

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

2016-04-07 Thread Yinghai Lu
ed-off-by: Yinghai Lu <ying...@kernel.org> --- drivers/pci/setup-bus.c | 82 ++--- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 3051bb7..12fd6d9 100644 --- a/drivers/pci/setup

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

2016-04-07 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 d3a39b7..46

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

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

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

2016-04-07 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 d3a39b7..4674e6b 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

[PATCH v11 19/60] PCI: Set resource to FIXED for LSI devices

2016-04-07 Thread Yinghai Lu
=92351 Signed-off-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 90e6e3e..0ac4229 100644

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

2016-04-07 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. -v2: add missing UNSET for _alt retore to required path. Suggested-by: Bjorn Helgaas <bhelg...@google.com> Signed-off-by: Yinghai Lu

[PATCH v11 20/60] PCI: Separate realloc list checking after allocation

2016-04-07 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 from BUG_ON to WARN_ON according to Rafael. Signed-off-by: Yinghai Lu <ying...@kernel.org> Cc: &qu

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

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

[PATCH v11 34/60] PCI: Add debug printout during releasing partial assigned resources

2016-04-07 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 v11 00/60] PCI: Resource allocation cleanup for v4.7

2016-04-07 Thread Yinghai Lu
. Thanks Yinghai Bjorn Helgaas (2): PCI: Fix iomem_is_exclusive() checking in pci_mmap_resource() alpha/PCI: Only check iomem_is_exclusive() for IORESOURCE_MEM, not IORESOURCE_IO Yinghai Lu (58): PCI: Add pci_find_bus_resource() sparc/PCI: Use correct offset for bus address to resource

[PATCH v11 31/60] PCI: Remove duplicated code for resource sorting

2016-04-07 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 v11 12/60] PCI: Check pref compatible bit for mem64 resource of PCIe device

2016-04-07 Thread Yinghai Lu
://lkml.kernel.org/r/cae9fiqu1gjy1lyrxs+ma5lcteee4xmtjrg0axj9k_tsu+m9...@mail.gmail.com Reported-by: David Ahern Tested-by: David Ahern Link: https://bugzilla.kernel.org/show_bug.cgi?id=81431 Tested-by: TJ Signed-off-by: Yinghai Lu Tested-by: Khalid Aziz --- arch/sparc/kernel/pci.c| 2 +

[PATCH v11 34/60] PCI: Add debug printout during releasing partial assigned resources

2016-04-07 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 v11 00/60] PCI: Resource allocation cleanup for v4.7

2016-04-07 Thread Yinghai Lu
. Thanks Yinghai Bjorn Helgaas (2): PCI: Fix iomem_is_exclusive() checking in pci_mmap_resource() alpha/PCI: Only check iomem_is_exclusive() for IORESOURCE_MEM, not IORESOURCE_IO Yinghai Lu (58): PCI: Add pci_find_bus_resource() sparc/PCI: Use correct offset for bus address to resource

[PATCH v11 31/60] PCI: Remove duplicated code for resource sorting

2016-04-07 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 v11 59/60] PCI: Don't set flags to 0 when assign resource fail

2016-04-07 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. -v2: add missing UNSET for _alt retore to required path. Suggested-by: Bjorn Helgaas Signed-off-by: Yinghai Lu --- drivers/pci/bus.c

[PATCH v11 20/60] PCI: Separate realloc list checking after allocation

2016-04-07 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 from BUG_ON to WARN_ON according to Rafael. Signed-off-by: Yinghai Lu Cc: "Rafael J. Wysocki" Cc:

[PATCH v11 33/60] PCI: Treat ROM resource as optional during realloc

2016-04-07 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 9cd0411..f9e6a00 100644 --- a/drive

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

2016-04-07 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 v11 45/60] PCI: Add support for more than two alt_size entries under same bridge

2016-04-07 Thread Yinghai Lu
-by: Yinghai Lu --- drivers/pci/setup-bus.c | 56 +++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index f3e9873..88557b9 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup

[PATCH v11 33/60] PCI: Treat ROM resource as optional during realloc

2016-04-07 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 9cd0411..f9e6a00 100644 --- a/drivers/pci/setup-bus.c +++ b

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