Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 694ce18e authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'stable/for-linus-fixes-3.3-rc3' of...

Merge tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen



Two fixes for VCPU offlining; One to fix the string format exposed
by the xen-pci[front|back] to conform to the one used in majority of
PCI drivers; Two fixes to make the code more resilient to invalid
configurations.

Signed-off-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>

* tag 'stable/for-linus-fixes-3.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xenbus_dev: add missing error check to watch handling
  xen/pci[front|back]: Use %d instead of %1x for displaying PCI devfn.
  xen pvhvm: do not remap pirqs onto evtchns if !xen_have_vector_callback
  xen/smp: Fix CPU online/offline bug triggering a BUG: scheduling while atomic.
  xen/bootup: During bootup suppress XENBUS: Unable to read cpu state
parents 13d26193 a43a5ccd
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -374,7 +374,7 @@ int __init pci_xen_init(void)


int __init pci_xen_hvm_init(void)
int __init pci_xen_hvm_init(void)
{
{
	if (!xen_feature(XENFEAT_hvm_pirqs))
	if (!xen_have_vector_callback || !xen_feature(XENFEAT_hvm_pirqs))
		return 0;
		return 0;


#ifdef CONFIG_ACPI
#ifdef CONFIG_ACPI
+7 −0
Original line number Original line Diff line number Diff line
@@ -409,6 +409,13 @@ static void __cpuinit xen_play_dead(void) /* used only with HOTPLUG_CPU */
	play_dead_common();
	play_dead_common();
	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
	HYPERVISOR_vcpu_op(VCPUOP_down, smp_processor_id(), NULL);
	cpu_bringup();
	cpu_bringup();
	/*
	 * Balance out the preempt calls - as we are running in cpu_idle
	 * loop which has been called at bootup from cpu_bringup_and_idle.
	 * The cpucpu_bringup_and_idle called cpu_bringup which made a
	 * preempt_disable() So this preempt_enable will balance it out.
	 */
	preempt_enable();
}
}


#else /* !CONFIG_HOTPLUG_CPU */
#else /* !CONFIG_HOTPLUG_CPU */
+5 −5
Original line number Original line Diff line number Diff line
@@ -189,7 +189,7 @@ static int pcifront_bus_read(struct pci_bus *bus, unsigned int devfn,


	if (verbose_request)
	if (verbose_request)
		dev_info(&pdev->xdev->dev,
		dev_info(&pdev->xdev->dev,
			 "read dev=%04x:%02x:%02x.%01x - offset %x size %d\n",
			 "read dev=%04x:%02x:%02x.%d - offset %x size %d\n",
			 pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
			 pci_domain_nr(bus), bus->number, PCI_SLOT(devfn),
			 PCI_FUNC(devfn), where, size);
			 PCI_FUNC(devfn), where, size);


@@ -228,7 +228,7 @@ static int pcifront_bus_write(struct pci_bus *bus, unsigned int devfn,


	if (verbose_request)
	if (verbose_request)
		dev_info(&pdev->xdev->dev,
		dev_info(&pdev->xdev->dev,
			 "write dev=%04x:%02x:%02x.%01x - "
			 "write dev=%04x:%02x:%02x.%d - "
			 "offset %x size %d val %x\n",
			 "offset %x size %d val %x\n",
			 pci_domain_nr(bus), bus->number,
			 pci_domain_nr(bus), bus->number,
			 PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
			 PCI_SLOT(devfn), PCI_FUNC(devfn), where, size, val);
@@ -432,7 +432,7 @@ static int __devinit pcifront_scan_bus(struct pcifront_device *pdev,
		d = pci_scan_single_device(b, devfn);
		d = pci_scan_single_device(b, devfn);
		if (d)
		if (d)
			dev_info(&pdev->xdev->dev, "New device on "
			dev_info(&pdev->xdev->dev, "New device on "
				 "%04x:%02x:%02x.%02x found.\n", domain, bus,
				 "%04x:%02x:%02x.%d found.\n", domain, bus,
				 PCI_SLOT(devfn), PCI_FUNC(devfn));
				 PCI_SLOT(devfn), PCI_FUNC(devfn));
	}
	}


@@ -1041,7 +1041,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
		pci_dev = pci_get_slot(pci_bus, PCI_DEVFN(slot, func));
		pci_dev = pci_get_slot(pci_bus, PCI_DEVFN(slot, func));
		if (!pci_dev) {
		if (!pci_dev) {
			dev_dbg(&pdev->xdev->dev,
			dev_dbg(&pdev->xdev->dev,
				"Cannot get PCI device %04x:%02x:%02x.%02x\n",
				"Cannot get PCI device %04x:%02x:%02x.%d\n",
				domain, bus, slot, func);
				domain, bus, slot, func);
			continue;
			continue;
		}
		}
@@ -1049,7 +1049,7 @@ static int pcifront_detach_devices(struct pcifront_device *pdev)
		pci_dev_put(pci_dev);
		pci_dev_put(pci_dev);


		dev_dbg(&pdev->xdev->dev,
		dev_dbg(&pdev->xdev->dev,
			"PCI device %04x:%02x:%02x.%02x removed.\n",
			"PCI device %04x:%02x:%02x.%d removed.\n",
			domain, bus, slot, func);
			domain, bus, slot, func);
	}
	}


+2 −1
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@ static int vcpu_online(unsigned int cpu)
	sprintf(dir, "cpu/%u", cpu);
	sprintf(dir, "cpu/%u", cpu);
	err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
	err = xenbus_scanf(XBT_NIL, dir, "availability", "%s", state);
	if (err != 1) {
	if (err != 1) {
		if (!xen_initial_domain())
			printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
			printk(KERN_ERR "XENBUS: Unable to read cpu state\n");
		return err;
		return err;
	}
	}
+4 −4
Original line number Original line Diff line number Diff line
@@ -884,7 +884,7 @@ static inline int str_to_quirk(const char *buf, int *domain, int *bus, int
	int err;
	int err;


	err =
	err =
	    sscanf(buf, " %04x:%02x:%02x.%1x-%08x:%1x:%08x", domain, bus, slot,
	    sscanf(buf, " %04x:%02x:%02x.%d-%08x:%1x:%08x", domain, bus, slot,
		   func, reg, size, mask);
		   func, reg, size, mask);
	if (err == 7)
	if (err == 7)
		return 0;
		return 0;
@@ -904,7 +904,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func)
	pci_dev_id->bus = bus;
	pci_dev_id->bus = bus;
	pci_dev_id->devfn = PCI_DEVFN(slot, func);
	pci_dev_id->devfn = PCI_DEVFN(slot, func);


	pr_debug(DRV_NAME ": wants to seize %04x:%02x:%02x.%01x\n",
	pr_debug(DRV_NAME ": wants to seize %04x:%02x:%02x.%d\n",
		 domain, bus, slot, func);
		 domain, bus, slot, func);


	spin_lock_irqsave(&device_ids_lock, flags);
	spin_lock_irqsave(&device_ids_lock, flags);
@@ -934,7 +934,7 @@ static int pcistub_device_id_remove(int domain, int bus, int slot, int func)


			err = 0;
			err = 0;


			pr_debug(DRV_NAME ": removed %04x:%02x:%02x.%01x from "
			pr_debug(DRV_NAME ": removed %04x:%02x:%02x.%d from "
				 "seize list\n", domain, bus, slot, func);
				 "seize list\n", domain, bus, slot, func);
		}
		}
	}
	}
@@ -1029,7 +1029,7 @@ static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf)
			break;
			break;


		count += scnprintf(buf + count, PAGE_SIZE - count,
		count += scnprintf(buf + count, PAGE_SIZE - count,
				   "%04x:%02x:%02x.%01x\n",
				   "%04x:%02x:%02x.%d\n",
				   pci_dev_id->domain, pci_dev_id->bus,
				   pci_dev_id->domain, pci_dev_id->bus,
				   PCI_SLOT(pci_dev_id->devfn),
				   PCI_SLOT(pci_dev_id->devfn),
				   PCI_FUNC(pci_dev_id->devfn));
				   PCI_FUNC(pci_dev_id->devfn));
Loading