[PATCH 2/2] ppc/EEH: fix crash when adding a device in a slot with DDW

2012-12-28 Thread Thadeu Lima de Souza Cascardo
The DDW code uses a eeh_dev struct from the pci_dev. However, this is not set until eeh_add_device_late is called. Since pci_bus_add_devices is called before eeh_add_device_late, the PCI devices are added to the bus, making drivers' probe hooks to be called. These will call set_dma_mask, which wil

[PATCH 1/2] EEH/OF: checking for CONFIG_EEH is not needed

2012-12-28 Thread Thadeu Lima de Souza Cascardo
The functions used are already defined as empty inline functions for the case where EEH is disabled. Signed-off-by: Thadeu Lima de Souza Cascardo --- arch/powerpc/kernel/of_platform.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/of_platform.c b

[PATCH 2/2] ppc/iommu: use find_first_bit to look up entries in the iommu table

2012-12-28 Thread Thadeu Lima de Souza Cascardo
Signed-off-by: Thadeu Lima de Souza Cascardo --- arch/powerpc/kernel/iommu.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 6d48ff8..91e2b99 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/

[PATCH 1/2] ppc/iommu: prevent false TCE leak message

2012-12-28 Thread Thadeu Lima de Souza Cascardo
When a device DMA window includes the address 0, it's reserved in the TCE bitmap to avoid returning that address to drivers. When the device is removed, the bitmap is checked for any mappings not removed by the driver, indicating a possible DMA mapping leak. Since the reserved address is not clear

Re: [PATCH] ppc/iommu: prevent false TCE leak message

2012-12-28 Thread Thadeu Lima de Souza Cascardo
On Fri, Dec 28, 2012 at 01:21:35PM +0800, Gavin Shan wrote: > On Thu, Dec 27, 2012 at 02:28:06PM -0200, Thadeu Lima de Souza Cascardo wrote: > >When a device DMA window includes the address 0, it's reserved in the > >TCE bitmap to avoid returning that address to drivers. > > > >When the device is r

Re: [PATCH] ppc/EEH: fix crash when adding a device in a slot with DDW

2012-12-28 Thread Thadeu Lima de Souza Cascardo
On Fri, Dec 28, 2012 at 01:18:24PM +0800, Gavin Shan wrote: > On Thu, Dec 27, 2012 at 02:34:00PM -0200, Thadeu Lima de Souza Cascardo wrote: > >The DDW code uses a eeh_dev struct from the pci_dev. However, this is > >not set until eeh_add_device_late is called. > > > >Since pci_bus_add_devices is c