On Mon, Oct 31, 2016 at 12:00:40PM +0100, Lukas Wunner wrote: > On Fri, Oct 28, 2016 at 06:58:17PM -0400, Keith Busch wrote: > > There is no need to disable MSIx interrupts or write message data on a > > device that isn't present. This patch checks the device removed state > > prior to executing device shutdown operations so that tear down on > > removed devices completes quicker. > > > > Signed-off-by: Keith Busch <keith.busch@xxxxxxxxx> > > Cc: Lukas Wunner <lukas@xxxxxxxxx> > > --- > > drivers/pci/msi.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c > > index bfdd074..9249ec1 100644 > > --- a/drivers/pci/msi.c > > +++ b/drivers/pci/msi.c > > @@ -317,7 +317,7 @@ void __pci_write_msi_msg(struct msi_desc *entry, struct msi_msg *msg) > > { > > struct pci_dev *dev = msi_desc_to_pci_dev(entry); > > > > - if (dev->current_state != PCI_D0) { > > + if (dev->current_state != PCI_D0 || dev->is_removed) { > > /* Don't touch the hardware now */ > > } else if (entry->msi_attrib.is_msix) { > > void __iomem *base = pci_msix_desc_addr(entry); > > Hm, I don't see __pci_write_msi_msg() being called anywhere on device > removal. Am I missing something? Rest of the patch LGTM. Prior to calling pci_disable_msix as part of typical driver unbinding, the driver needs to call free_irq for every registerded action. That will get to this __pci_write_msi_msg when it tries to mask the vector. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html