Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation, bisected

2014-08-01 Thread Borislav Petkov
On Sat, Aug 02, 2014 at 12:14:10AM +0200, Jörg Rödel wrote: > My guess is that the firmware takes back the device after the OS > released it and now the legacy emulation tries to do DMA with it. But > since there is an IOMMU the physical addresses it tries to DMA to is > not mapped and it generated

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation, bisected

2014-08-01 Thread Jörg Rödel
On Fri, Aug 01, 2014 at 06:11:08PM +0200, Borislav Petkov wrote: > [ 89.040795] pcieport :00:04.0: System wakeup enabled by ACPI > [ 89.061697] AMD-Vi: Event logged [IO_PAGE_FAULT device=01:00.0 > domain=0x0014 address=0x20001000 flags=0x] > [ 89.071871] ACPI: Preparing to en

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation, bisected

2014-08-01 Thread Borislav Petkov
On Fri, Aug 01, 2014 at 04:39:22PM +0200, Borislav Petkov wrote: > I could try to disable the IOMMU and see whether it still triggers. > That could tell us something. Ok, let me summarize what I've been able to observe so far: * https://lkml.kernel.org/r/1406766807-5745-1-git-send-email-jiang...

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation, bisected

2014-08-01 Thread Borislav Petkov
On Fri, Aug 01, 2014 at 08:27:23PM +0800, Jiang Liu wrote: > The above commit may cause failure of suspend/hiberrnation. > The reason is: > 1) With recent changers, we dynamically allocate irq number for IOAPIC >pins. > 2) The allocated irq will be released when suspending/hibernating. >

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation, bisected

2014-08-01 Thread Jiang Liu
On 2014/8/1 18:56, Borislav Petkov wrote: > Ok, > > so I went and looked at tip and which branches could be the usual > suspects. And whaddya know, tip/x86/apic was the first to pick and it > contained the culprit: > > 6a38fa0e3c94 ("x86, irq, ACPI: Release IOAPIC pin when PCI device is > disab

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation, bisected

2014-08-01 Thread Borislav Petkov
Ok, so I went and looked at tip and which branches could be the usual suspects. And whaddya know, tip/x86/apic was the first to pick and it contained the culprit: 6a38fa0e3c94 ("x86, irq, ACPI: Release IOAPIC pin when PCI device is disabled") It seems like my machine doesn't like releasing the I

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Borislav Petkov
On Fri, Aug 01, 2014 at 12:36:59AM +0800, Jiang Liu wrote: > 1) There's a race window between device_shutdown() and > syscore_shutdown(). USB device may be returned to BIOS > during device_shutdown() and IOMMU units are disabled > during syscore_shutdown(). > 2) Printing debug messages enlarges the

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Jiang Liu
On 2014/7/31 18:39, Borislav Petkov wrote: > On Thu, Jul 31, 2014 at 08:33:26AM +0800, Jiang Liu wrote: >> Sorry for the incovenience, something is wrong when synchronizing >> the patch. I have found that "pm" should be "power" when building and >> testing this patch on my test machine. And I hav

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Borislav Petkov
Hi, On Thu, Jul 31, 2014 at 10:41:36PM +0800, Jiang Liu wrote: > Really appreciate your help. There are two issues left > according to the log messages. first of all: A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-postin

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Jiang Liu
Hi Borislav, Really appreciate your help. There are two issues left according to the log messages. The first issue is " WARNING: CPU: 2 PID: 3786 at fs/proc/generic.c:521 remove_proc_entry+0x19c/0x1b0()". It's caused by an issue in usb driver and a patch is ready to fix this issue,

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-31 Thread Borislav Petkov
On Thu, Jul 31, 2014 at 08:33:26AM +0800, Jiang Liu wrote: > Sorry for the incovenience, something is wrong when synchronizing > the patch. I have found that "pm" should be "power" when building and > testing this patch on my test machine. And I have also fixed it on > my development machine, but f

[PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-30 Thread Jiang Liu
Function pci_disable_device() may be called for PCI devices during suspend/hibernation, which in turn may release IRQ assigned for PCI interrupt. Later when pci_enable_device() is called during resume, a different IRQ may be assigned and thus break the driver. So keep IRQ assignment for PCI devices

Re: [PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-30 Thread Borislav Petkov
On Wed, Jul 30, 2014 at 05:37:13PM +0800, Jiang Liu wrote: > Function pci_disable_device() may be called for PCI devices during > suspend/hibernation, which in turn may release IRQ assigned to PCI > interrupt. Later when pci_enable_device() is called during resume, > a different IRQ may be assigned

[PATCH] x86, irq: Keep IRQ assignment for PCI devices during suspend/hibernation

2014-07-30 Thread Jiang Liu
Function pci_disable_device() may be called for PCI devices during suspend/hibernation, which in turn may release IRQ assigned to PCI interrupt. Later when pci_enable_device() is called during resume, a different IRQ may be assigned and thus break the driver. So keep IRQ assignment for PCI devices