From: Linus Torvalds Date: Tue, 25 Oct 2011 07:19:36 +0000 (+0200) Subject: Merge branches 'stable/drivers-3.2', 'stable/drivers.bugfixes-3.2' and 'stable/pci... X-Git-Tag: v3.2-rc1~192 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=04a8752485e450124f92c9b931d268b48d75650a Merge branches 'stable/drivers-3.2', 'stable/drivers.bugfixes-3.2' and 'stable/pci.fixes-3.2' of git://git./linux/kernel/git/konrad/xen * 'stable/drivers-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xenbus: don't rely on xen_initial_domain to detect local xenstore xenbus: Fix loopback event channel assuming domain 0 xen/pv-on-hvm:kexec: Fix implicit declaration of function 'xen_hvm_domain' xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel xen/pv-on-hvm kexec: update xs_wire.h:xsd_sockmsg_type from xen-unstable xen/pv-on-hvm kexec+kdump: reset PV devices in kexec or crash kernel xen/pv-on-hvm kexec: rebind virqs to existing eventchannel ports xen/pv-on-hvm kexec: prevent crash in xenwatch_thread() when stale watch events arrive * 'stable/drivers.bugfixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/pciback: Check if the device is found instead of blindly assuming so. xen/pciback: Do not dereference psdev during printk when it is NULL. xen: remove XEN_PLATFORM_PCI config option xen: XEN_PVHVM depends on PCI xen/pciback: double lock typo xen/pciback: use mutex rather than spinlock in vpci backend xen/pciback: Use mutexes when working with Xenbus state transitions. xen/pciback: miscellaneous adjustments xen/pciback: use mutex rather than spinlock in passthrough backend xen/pciback: use resource_size() * 'stable/pci.fixes-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/pci: support multi-segment systems xen-swiotlb: When doing coherent alloc/dealloc check before swizzling the MFNs. xen/pci: make bus notifier handler return sane values xen-swiotlb: fix printk and panic args xen-swiotlb: Fix wrong panic. xen-swiotlb: Retry up three times to allocate Xen-SWIOTLB xen-pcifront: Update warning comment to use 'e820_host' option. --- 04a8752485e450124f92c9b931d268b48d75650a diff --cc arch/x86/pci/xen.c index 11a9301d52d4,f567965c0620,1017c7bee388,265fa8814ccd..492ade8c978e --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c @@@@@ -152,45 -65,6 -152,43 -65,6 +152,45 @@@@@ static int acpi_register_gsi_xen(struc struct xen_pci_frontend_ops *xen_pci_frontend; EXPORT_SYMBOL_GPL(xen_pci_frontend); + +static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) + +{ + + int irq, ret, i; + + struct msi_desc *msidesc; + + int *v; + + + + v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL); + + if (!v) + + return -ENOMEM; + + + + if (type == PCI_CAP_ID_MSIX) + + ret = xen_pci_frontend_enable_msix(dev, v, nvec); + + else + + ret = xen_pci_frontend_enable_msi(dev, v); + + if (ret) + + goto error; + + i = 0; + + list_for_each_entry(msidesc, &dev->msi_list, list) { + + irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i], 0, + + (type == PCI_CAP_ID_MSIX) ? + + "pcifront-msi-x" : + + "pcifront-msi", + + DOMID_SELF); - if (irq < 0) +++ if (irq < 0) { +++ ret = irq; + + goto free; +++ } + + i++; + + } + + kfree(v); + + return 0; + + + +error: + + dev_err(&dev->dev, "Xen PCI frontend has not registered MSI/MSI-X support!\n"); + +free: + + kfree(v); + + return ret; + +} + + #define XEN_PIRQ_MSI_DATA (MSI_DATA_TRIGGER_EDGE | \ MSI_DATA_LEVEL_ASSERT | (3 << 8) | MSI_DATA_VECTOR(0)) @@@@@ -248,7 -120,68 -244,7 -120,68 +248,7 @@@@@ static int xen_hvm_setup_msi_irqs(struc error: dev_err(&dev->dev, "Xen PCI frontend has not registered MSI/MSI-X support!\n"); --- return -ENODEV; - -} - - - -/* - - * For MSI interrupts we have to use drivers/xen/event.s functions to - - * allocate an irq_desc and setup the right */ - - - - - -static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) - -{ - - int irq, ret, i; - - struct msi_desc *msidesc; - - int *v; - - - - v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL); - - if (!v) - - return -ENOMEM; - - - - if (type == PCI_CAP_ID_MSIX) - - ret = xen_pci_frontend_enable_msix(dev, v, nvec); - - else - - ret = xen_pci_frontend_enable_msi(dev, v); - - if (ret) - - goto error; - - i = 0; - - list_for_each_entry(msidesc, &dev->msi_list, list) { - - irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i], 0, - - (type == PCI_CAP_ID_MSIX) ? - - "pcifront-msi-x" : - - "pcifront-msi", - - DOMID_SELF); - - if (irq < 0) - - goto free; - - i++; - - } - - kfree(v); - - return 0; - - - -error: - - dev_err(&dev->dev, "Xen PCI frontend has not registered MSI/MSI-X support!\n"); - -free: - - kfree(v); - - return ret; - -} - - - -static void xen_teardown_msi_irqs(struct pci_dev *dev) - -{ - - struct msi_desc *msidesc; - - - - msidesc = list_entry(dev->msi_list.next, struct msi_desc, list); - - if (msidesc->msi_attrib.is_msix) - - xen_pci_frontend_disable_msix(dev); - - else - - xen_pci_frontend_disable_msi(dev); - - - - /* Free the IRQ's and the msidesc using the generic code. */ - - default_teardown_msi_irqs(dev); - -} - - - -static void xen_teardown_msi_irq(unsigned int irq) - -{ - - xen_destroy_irq(irq); +++ return irq; } #ifdef CONFIG_XEN_DOM0 diff --cc drivers/xen/events.c index 212a5c871bf4,31493e906bbd,da70f5c32eb9,30df85d8fca8..7a55b292bf39 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c @@@@@ -877,9 -902,9 -876,9 -881,9 +898,9 @@@@@ static int find_virq(unsigned int virq int bind_virq_to_irq(unsigned int virq, unsigned int cpu) { struct evtchn_bind_virq bind_virq; - -- int evtchn, irq; + ++ int evtchn, irq, ret; --- spin_lock(&irq_mapping_update_lock); +++ mutex_lock(&irq_mapping_update_lock); irq = per_cpu(virq_to_irq, cpu)[virq];