提交 8e8b180a 编写于 作者: L Linus Torvalds

Merge tag 'stable/for-linus-3.9-rc1-tag' of...

Merge tag 'stable/for-linus-3.9-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen

Pull Xen bug-fixes from Konrad Rzeszutek Wilk:
 - Update the Xen ACPI memory and CPU hotplug locking mechanism.
 - Fix PAT issues wherein various applications would not start
 - Fix handling of multiple MSI as AHCI now does it.
 - Fix ARM compile failures.

* tag 'stable/for-linus-3.9-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xenbus: fix compile failure on ARM with Xen enabled
  xen/pci: We don't do multiple MSI's.
  xen/pat: Disable PAT using pat_enabled value.
  xen/acpi: xen cpu hotplug minor updates
  xen/acpi: xen memory hotplug minor updates
...@@ -162,6 +162,9 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -162,6 +162,9 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
struct msi_desc *msidesc; struct msi_desc *msidesc;
int *v; int *v;
if (type == PCI_CAP_ID_MSI && nvec > 1)
return 1;
v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL); v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL);
if (!v) if (!v)
return -ENOMEM; return -ENOMEM;
...@@ -220,6 +223,9 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -220,6 +223,9 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
struct msi_desc *msidesc; struct msi_desc *msidesc;
struct msi_msg msg; struct msi_msg msg;
if (type == PCI_CAP_ID_MSI && nvec > 1)
return 1;
list_for_each_entry(msidesc, &dev->msi_list, list) { list_for_each_entry(msidesc, &dev->msi_list, list) {
__read_msi_msg(msidesc, &msg); __read_msi_msg(msidesc, &msg);
pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) | pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) |
...@@ -263,6 +269,9 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -263,6 +269,9 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
int ret = 0; int ret = 0;
struct msi_desc *msidesc; struct msi_desc *msidesc;
if (type == PCI_CAP_ID_MSI && nvec > 1)
return 1;
list_for_each_entry(msidesc, &dev->msi_list, list) { list_for_each_entry(msidesc, &dev->msi_list, list) {
struct physdev_map_pirq map_irq; struct physdev_map_pirq map_irq;
domid_t domid; domid_t domid;
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
#include <asm/hypervisor.h> #include <asm/hypervisor.h>
#include <asm/mwait.h> #include <asm/mwait.h>
#include <asm/pci_x86.h> #include <asm/pci_x86.h>
#include <asm/pat.h>
#ifdef CONFIG_ACPI #ifdef CONFIG_ACPI
#include <linux/acpi.h> #include <linux/acpi.h>
...@@ -1417,7 +1418,14 @@ asmlinkage void __init xen_start_kernel(void) ...@@ -1417,7 +1418,14 @@ asmlinkage void __init xen_start_kernel(void)
*/ */
acpi_numa = -1; acpi_numa = -1;
#endif #endif
#ifdef CONFIG_X86_PAT
/*
* For right now disable the PAT. We should remove this once
* git commit 8eaffa67b43e99ae581622c5133e20b0f48bcef1
* (xen/pat: Disable PAT support for now) is reverted.
*/
pat_enabled = 0;
#endif
/* Don't do the full vcpu_info placement stuff until we have a /* Don't do the full vcpu_info placement stuff until we have a
possible map and a non-dummy shared_info. */ possible map and a non-dummy shared_info. */
per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
......
...@@ -239,24 +239,6 @@ static acpi_status xen_acpi_cpu_hotadd(struct acpi_processor *pr) ...@@ -239,24 +239,6 @@ static acpi_status xen_acpi_cpu_hotadd(struct acpi_processor *pr)
return AE_OK; return AE_OK;
} }
static
int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device)
{
acpi_handle phandle;
struct acpi_device *pdev;
if (acpi_get_parent(handle, &phandle))
return -ENODEV;
if (acpi_bus_get_device(phandle, &pdev))
return -ENODEV;
if (acpi_bus_scan(handle))
return -ENODEV;
return 0;
}
static int acpi_processor_device_remove(struct acpi_device *device) static int acpi_processor_device_remove(struct acpi_device *device)
{ {
pr_debug(PREFIX "Xen does not support CPU hotremove\n"); pr_debug(PREFIX "Xen does not support CPU hotremove\n");
...@@ -272,6 +254,8 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, ...@@ -272,6 +254,8 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */
int result; int result;
acpi_scan_lock_acquire();
switch (event) { switch (event) {
case ACPI_NOTIFY_BUS_CHECK: case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK: case ACPI_NOTIFY_DEVICE_CHECK:
...@@ -286,12 +270,16 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, ...@@ -286,12 +270,16 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
if (!acpi_bus_get_device(handle, &device)) if (!acpi_bus_get_device(handle, &device))
break; break;
result = acpi_processor_device_add(handle, &device); result = acpi_bus_scan(handle);
if (result) { if (result) {
pr_err(PREFIX "Unable to add the device\n"); pr_err(PREFIX "Unable to add the device\n");
break; break;
} }
result = acpi_bus_get_device(handle, &device);
if (result) {
pr_err(PREFIX "Missing device object\n");
break;
}
ost_code = ACPI_OST_SC_SUCCESS; ost_code = ACPI_OST_SC_SUCCESS;
break; break;
...@@ -321,11 +309,13 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, ...@@ -321,11 +309,13 @@ static void acpi_processor_hotplug_notify(acpi_handle handle,
"Unsupported event [0x%x]\n", event)); "Unsupported event [0x%x]\n", event));
/* non-hotplug event; possibly handled by other handler */ /* non-hotplug event; possibly handled by other handler */
return; goto out;
} }
(void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL);
return;
out:
acpi_scan_lock_release();
} }
static acpi_status is_processor_device(acpi_handle handle) static acpi_status is_processor_device(acpi_handle handle)
......
...@@ -158,31 +158,17 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) ...@@ -158,31 +158,17 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device)
return 0; return 0;
} }
static int static int acpi_memory_get_device(acpi_handle handle,
acpi_memory_get_device(acpi_handle handle, struct acpi_memory_device **mem_device)
struct acpi_memory_device **mem_device)
{ {
acpi_status status;
acpi_handle phandle;
struct acpi_device *device = NULL; struct acpi_device *device = NULL;
struct acpi_device *pdevice = NULL; int result = 0;
int result;
if (!acpi_bus_get_device(handle, &device) && device) acpi_scan_lock_acquire();
goto end;
status = acpi_get_parent(handle, &phandle); acpi_bus_get_device(handle, &device);
if (ACPI_FAILURE(status)) { if (device)
pr_warn(PREFIX "Cannot find acpi parent\n"); goto end;
return -EINVAL;
}
/* Get the parent device */
result = acpi_bus_get_device(phandle, &pdevice);
if (result) {
pr_warn(PREFIX "Cannot get acpi bus device\n");
return -EINVAL;
}
/* /*
* Now add the notified device. This creates the acpi_device * Now add the notified device. This creates the acpi_device
...@@ -190,18 +176,28 @@ acpi_memory_get_device(acpi_handle handle, ...@@ -190,18 +176,28 @@ acpi_memory_get_device(acpi_handle handle,
*/ */
result = acpi_bus_scan(handle); result = acpi_bus_scan(handle);
if (result) { if (result) {
pr_warn(PREFIX "Cannot add acpi bus\n"); pr_warn(PREFIX "ACPI namespace scan failed\n");
return -EINVAL; result = -EINVAL;
goto out;
}
result = acpi_bus_get_device(handle, &device);
if (result) {
pr_warn(PREFIX "Missing device object\n");
result = -EINVAL;
goto out;
} }
end: end:
*mem_device = acpi_driver_data(device); *mem_device = acpi_driver_data(device);
if (!(*mem_device)) { if (!(*mem_device)) {
pr_err(PREFIX "Driver data not found\n"); pr_err(PREFIX "driver data not found\n");
return -ENODEV; result = -ENODEV;
goto out;
} }
return 0; out:
acpi_scan_lock_release();
return result;
} }
static int acpi_memory_check_device(struct acpi_memory_device *mem_device) static int acpi_memory_check_device(struct acpi_memory_device *mem_device)
...@@ -259,12 +255,15 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -259,12 +255,15 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"\nReceived EJECT REQUEST notification for device\n")); "\nReceived EJECT REQUEST notification for device\n"));
acpi_scan_lock_acquire();
if (acpi_bus_get_device(handle, &device)) { if (acpi_bus_get_device(handle, &device)) {
acpi_scan_lock_release();
pr_err(PREFIX "Device doesn't exist\n"); pr_err(PREFIX "Device doesn't exist\n");
break; break;
} }
mem_device = acpi_driver_data(device); mem_device = acpi_driver_data(device);
if (!mem_device) { if (!mem_device) {
acpi_scan_lock_release();
pr_err(PREFIX "Driver Data is NULL\n"); pr_err(PREFIX "Driver Data is NULL\n");
break; break;
} }
...@@ -274,6 +273,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) ...@@ -274,6 +273,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data)
* acpi_bus_remove if Xen support hotremove in the future * acpi_bus_remove if Xen support hotremove in the future
*/ */
acpi_memory_disable_device(mem_device); acpi_memory_disable_device(mem_device);
acpi_scan_lock_release();
break; break;
default: default:
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
* IN THE SOFTWARE. * IN THE SOFTWARE.
*/ */
#include <linux/mm.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册