Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-16 Thread Michael S. Tsirkin
On Thu, Mar 12, 2015 at 01:21:22PM +0800, Fam Zheng wrote: > If the device doesn't support shutdown, disabling interrupts may cause > trouble. For example, virtio-scsi-pci doesn't implement shutdown, and > after we disable MSI-X, futher notifications from device will be > delivered to IRQ, which is

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-13 Thread Paolo Bonzini
On 13/03/2015 00:21, Fam Zheng wrote: >> I think the bug here is also that virtio-pci >> is not defining a .shutdown callback. It should define one and call >> free_irq (for INTX) and pci_disable_msix. > > It's not enough. The device has to know we disabled msix, otherwise it will > send us IRQ

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Fam Zheng
On Thu, 03/12 22:13, Alex Williamson wrote: > On Thu, 2015-03-12 at 23:09 -0400, Bandan Das wrote: > > Ccing Alex, he can probably confirm if my understanding is indeed correct. > > > > Fam Zheng writes: > > > > > On Thu, 03/12 19:56, Bandan Das wrote: > > >> Hi Fam, > > >> > > >> Fam Zheng wr

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Alex Williamson
On Thu, 2015-03-12 at 23:09 -0400, Bandan Das wrote: > Ccing Alex, he can probably confirm if my understanding is indeed correct. > > Fam Zheng writes: > > > On Thu, 03/12 19:56, Bandan Das wrote: > >> Hi Fam, > >> > >> Fam Zheng writes: > >> > >> > If the device doesn't support shutdown, dis

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Bandan Das
Fam Zheng writes: > On Thu, 03/12 23:09, Bandan Das wrote: >> Ccing Alex, he can probably confirm if my understanding is indeed correct. >> >> Fam Zheng writes: >> >> > On Thu, 03/12 19:56, Bandan Das wrote: >> >> Hi Fam, >> >> >> >> Fam Zheng writes: >> >> >> >> > If the device doesn't sup

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Fam Zheng
On Thu, 03/12 23:09, Bandan Das wrote: > Ccing Alex, he can probably confirm if my understanding is indeed correct. > > Fam Zheng writes: > > > On Thu, 03/12 19:56, Bandan Das wrote: > >> Hi Fam, > >> > >> Fam Zheng writes: > >> > >> > If the device doesn't support shutdown, disabling interru

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Bandan Das
Ccing Alex, he can probably confirm if my understanding is indeed correct. Fam Zheng writes: > On Thu, 03/12 19:56, Bandan Das wrote: >> Hi Fam, >> >> Fam Zheng writes: >> >> > If the device doesn't support shutdown, disabling interrupts may cause >> > trouble. For example, virtio-scsi-pci do

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Fam Zheng
On Thu, 03/12 19:56, Bandan Das wrote: > Hi Fam, > > Fam Zheng writes: > > > If the device doesn't support shutdown, disabling interrupts may cause > > trouble. For example, virtio-scsi-pci doesn't implement shutdown, and > > after we disable MSI-X, futher notifications from device will be > > d

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Bandan Das
Hi Fam, Fam Zheng writes: > If the device doesn't support shutdown, disabling interrupts may cause > trouble. For example, virtio-scsi-pci doesn't implement shutdown, and > after we disable MSI-X, futher notifications from device will be > delivered to IRQ, which is unexpected. This IRQ will not

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Fam Zheng
On Thu, 03/12 17:21, Paolo Bonzini wrote: > On 12/03/2015 06:21, Fam Zheng wrote: > > If the device doesn't support shutdown, disabling interrupts may cause > > trouble. For example, virtio-scsi-pci doesn't implement shutdown, and > > after we disable MSI-X, futher notifications from device will be

Re: [RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-12 Thread Paolo Bonzini
On 12/03/2015 06:21, Fam Zheng wrote: > If the device doesn't support shutdown, disabling interrupts may cause > trouble. For example, virtio-scsi-pci doesn't implement shutdown, and > after we disable MSI-X, futher notifications from device will be > delivered to IRQ, which is unexpected. This I

[RFC PATCH] PCI: Disable MSI/MSI-X only if device is shutdown

2015-03-11 Thread Fam Zheng
If the device doesn't support shutdown, disabling interrupts may cause trouble. For example, virtio-scsi-pci doesn't implement shutdown, and after we disable MSI-X, futher notifications from device will be delivered to IRQ, which is unexpected. This IRQ will not be cleared, and may prevent us from