diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-03 17:22:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-03-03 17:22:53 -0500 |
commit | 8e8b180a5f1b237345f6e2d960bcceb8b6bc3793 (patch) | |
tree | 9f10c874b0d13cc4929ff2b68c65ae2d48d4fb9d | |
parent | 56a79b7b021bf1b08334e63c2c14b280e2dbf47a (diff) | |
parent | 45e27161c62216c163880d7aed751cb55a65c8e9 (diff) |
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
-rw-r--r-- | arch/x86/pci/xen.c | 9 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c | 10 | ||||
-rw-r--r-- | drivers/xen/xen-acpi-cpuhotplug.c | 34 | ||||
-rw-r--r-- | drivers/xen/xen-acpi-memhotplug.c | 52 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_client.c | 1 |
5 files changed, 57 insertions, 49 deletions
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index 56ab74989cf1..94e76620460f 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
@@ -162,6 +162,9 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
162 | struct msi_desc *msidesc; | 162 | struct msi_desc *msidesc; |
163 | int *v; | 163 | int *v; |
164 | 164 | ||
165 | if (type == PCI_CAP_ID_MSI && nvec > 1) | ||
166 | return 1; | ||
167 | |||
165 | v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL); | 168 | v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL); |
166 | if (!v) | 169 | if (!v) |
167 | return -ENOMEM; | 170 | return -ENOMEM; |
@@ -220,6 +223,9 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
220 | struct msi_desc *msidesc; | 223 | struct msi_desc *msidesc; |
221 | struct msi_msg msg; | 224 | struct msi_msg msg; |
222 | 225 | ||
226 | if (type == PCI_CAP_ID_MSI && nvec > 1) | ||
227 | return 1; | ||
228 | |||
223 | list_for_each_entry(msidesc, &dev->msi_list, list) { | 229 | list_for_each_entry(msidesc, &dev->msi_list, list) { |
224 | __read_msi_msg(msidesc, &msg); | 230 | __read_msi_msg(msidesc, &msg); |
225 | pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) | | 231 | 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 | int ret = 0; | 269 | int ret = 0; |
264 | struct msi_desc *msidesc; | 270 | struct msi_desc *msidesc; |
265 | 271 | ||
272 | if (type == PCI_CAP_ID_MSI && nvec > 1) | ||
273 | return 1; | ||
274 | |||
266 | list_for_each_entry(msidesc, &dev->msi_list, list) { | 275 | list_for_each_entry(msidesc, &dev->msi_list, list) { |
267 | struct physdev_map_pirq map_irq; | 276 | struct physdev_map_pirq map_irq; |
268 | domid_t domid; | 277 | domid_t domid; |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 39928d16be3b..c8e1c7b95c3b 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -67,6 +67,7 @@ | |||
67 | #include <asm/hypervisor.h> | 67 | #include <asm/hypervisor.h> |
68 | #include <asm/mwait.h> | 68 | #include <asm/mwait.h> |
69 | #include <asm/pci_x86.h> | 69 | #include <asm/pci_x86.h> |
70 | #include <asm/pat.h> | ||
70 | 71 | ||
71 | #ifdef CONFIG_ACPI | 72 | #ifdef CONFIG_ACPI |
72 | #include <linux/acpi.h> | 73 | #include <linux/acpi.h> |
@@ -1417,7 +1418,14 @@ asmlinkage void __init xen_start_kernel(void) | |||
1417 | */ | 1418 | */ |
1418 | acpi_numa = -1; | 1419 | acpi_numa = -1; |
1419 | #endif | 1420 | #endif |
1420 | 1421 | #ifdef CONFIG_X86_PAT | |
1422 | /* | ||
1423 | * For right now disable the PAT. We should remove this once | ||
1424 | * git commit 8eaffa67b43e99ae581622c5133e20b0f48bcef1 | ||
1425 | * (xen/pat: Disable PAT support for now) is reverted. | ||
1426 | */ | ||
1427 | pat_enabled = 0; | ||
1428 | #endif | ||
1421 | /* Don't do the full vcpu_info placement stuff until we have a | 1429 | /* Don't do the full vcpu_info placement stuff until we have a |
1422 | possible map and a non-dummy shared_info. */ | 1430 | possible map and a non-dummy shared_info. */ |
1423 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; | 1431 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; |
diff --git a/drivers/xen/xen-acpi-cpuhotplug.c b/drivers/xen/xen-acpi-cpuhotplug.c index 757827966e34..18c742bec91b 100644 --- a/drivers/xen/xen-acpi-cpuhotplug.c +++ b/drivers/xen/xen-acpi-cpuhotplug.c | |||
@@ -239,24 +239,6 @@ static acpi_status xen_acpi_cpu_hotadd(struct acpi_processor *pr) | |||
239 | return AE_OK; | 239 | return AE_OK; |
240 | } | 240 | } |
241 | 241 | ||
242 | static | ||
243 | int acpi_processor_device_add(acpi_handle handle, struct acpi_device **device) | ||
244 | { | ||
245 | acpi_handle phandle; | ||
246 | struct acpi_device *pdev; | ||
247 | |||
248 | if (acpi_get_parent(handle, &phandle)) | ||
249 | return -ENODEV; | ||
250 | |||
251 | if (acpi_bus_get_device(phandle, &pdev)) | ||
252 | return -ENODEV; | ||
253 | |||
254 | if (acpi_bus_scan(handle)) | ||
255 | return -ENODEV; | ||
256 | |||
257 | return 0; | ||
258 | } | ||
259 | |||
260 | static int acpi_processor_device_remove(struct acpi_device *device) | 242 | static int acpi_processor_device_remove(struct acpi_device *device) |
261 | { | 243 | { |
262 | pr_debug(PREFIX "Xen does not support CPU hotremove\n"); | 244 | pr_debug(PREFIX "Xen does not support CPU hotremove\n"); |
@@ -272,6 +254,8 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
272 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ | 254 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ |
273 | int result; | 255 | int result; |
274 | 256 | ||
257 | acpi_scan_lock_acquire(); | ||
258 | |||
275 | switch (event) { | 259 | switch (event) { |
276 | case ACPI_NOTIFY_BUS_CHECK: | 260 | case ACPI_NOTIFY_BUS_CHECK: |
277 | case ACPI_NOTIFY_DEVICE_CHECK: | 261 | case ACPI_NOTIFY_DEVICE_CHECK: |
@@ -286,12 +270,16 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
286 | if (!acpi_bus_get_device(handle, &device)) | 270 | if (!acpi_bus_get_device(handle, &device)) |
287 | break; | 271 | break; |
288 | 272 | ||
289 | result = acpi_processor_device_add(handle, &device); | 273 | result = acpi_bus_scan(handle); |
290 | if (result) { | 274 | if (result) { |
291 | pr_err(PREFIX "Unable to add the device\n"); | 275 | pr_err(PREFIX "Unable to add the device\n"); |
292 | break; | 276 | break; |
293 | } | 277 | } |
294 | 278 | result = acpi_bus_get_device(handle, &device); | |
279 | if (result) { | ||
280 | pr_err(PREFIX "Missing device object\n"); | ||
281 | break; | ||
282 | } | ||
295 | ost_code = ACPI_OST_SC_SUCCESS; | 283 | ost_code = ACPI_OST_SC_SUCCESS; |
296 | break; | 284 | break; |
297 | 285 | ||
@@ -321,11 +309,13 @@ static void acpi_processor_hotplug_notify(acpi_handle handle, | |||
321 | "Unsupported event [0x%x]\n", event)); | 309 | "Unsupported event [0x%x]\n", event)); |
322 | 310 | ||
323 | /* non-hotplug event; possibly handled by other handler */ | 311 | /* non-hotplug event; possibly handled by other handler */ |
324 | return; | 312 | goto out; |
325 | } | 313 | } |
326 | 314 | ||
327 | (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); | 315 | (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); |
328 | return; | 316 | |
317 | out: | ||
318 | acpi_scan_lock_release(); | ||
329 | } | 319 | } |
330 | 320 | ||
331 | static acpi_status is_processor_device(acpi_handle handle) | 321 | static acpi_status is_processor_device(acpi_handle handle) |
diff --git a/drivers/xen/xen-acpi-memhotplug.c b/drivers/xen/xen-acpi-memhotplug.c index 853b12dba5bb..faef5b396051 100644 --- a/drivers/xen/xen-acpi-memhotplug.c +++ b/drivers/xen/xen-acpi-memhotplug.c | |||
@@ -158,31 +158,17 @@ acpi_memory_get_device_resources(struct acpi_memory_device *mem_device) | |||
158 | return 0; | 158 | return 0; |
159 | } | 159 | } |
160 | 160 | ||
161 | static int | 161 | static int acpi_memory_get_device(acpi_handle handle, |
162 | acpi_memory_get_device(acpi_handle handle, | 162 | struct acpi_memory_device **mem_device) |
163 | struct acpi_memory_device **mem_device) | ||
164 | { | 163 | { |
165 | acpi_status status; | ||
166 | acpi_handle phandle; | ||
167 | struct acpi_device *device = NULL; | 164 | struct acpi_device *device = NULL; |
168 | struct acpi_device *pdevice = NULL; | 165 | int result = 0; |
169 | int result; | ||
170 | 166 | ||
171 | if (!acpi_bus_get_device(handle, &device) && device) | 167 | acpi_scan_lock_acquire(); |
172 | goto end; | ||
173 | 168 | ||
174 | status = acpi_get_parent(handle, &phandle); | 169 | acpi_bus_get_device(handle, &device); |
175 | if (ACPI_FAILURE(status)) { | 170 | if (device) |
176 | pr_warn(PREFIX "Cannot find acpi parent\n"); | 171 | goto end; |
177 | return -EINVAL; | ||
178 | } | ||
179 | |||
180 | /* Get the parent device */ | ||
181 | result = acpi_bus_get_device(phandle, &pdevice); | ||
182 | if (result) { | ||
183 | pr_warn(PREFIX "Cannot get acpi bus device\n"); | ||
184 | return -EINVAL; | ||
185 | } | ||
186 | 172 | ||
187 | /* | 173 | /* |
188 | * Now add the notified device. This creates the acpi_device | 174 | * Now add the notified device. This creates the acpi_device |
@@ -190,18 +176,28 @@ acpi_memory_get_device(acpi_handle handle, | |||
190 | */ | 176 | */ |
191 | result = acpi_bus_scan(handle); | 177 | result = acpi_bus_scan(handle); |
192 | if (result) { | 178 | if (result) { |
193 | pr_warn(PREFIX "Cannot add acpi bus\n"); | 179 | pr_warn(PREFIX "ACPI namespace scan failed\n"); |
194 | return -EINVAL; | 180 | result = -EINVAL; |
181 | goto out; | ||
182 | } | ||
183 | result = acpi_bus_get_device(handle, &device); | ||
184 | if (result) { | ||
185 | pr_warn(PREFIX "Missing device object\n"); | ||
186 | result = -EINVAL; | ||
187 | goto out; | ||
195 | } | 188 | } |
196 | 189 | ||
197 | end: | 190 | end: |
198 | *mem_device = acpi_driver_data(device); | 191 | *mem_device = acpi_driver_data(device); |
199 | if (!(*mem_device)) { | 192 | if (!(*mem_device)) { |
200 | pr_err(PREFIX "Driver data not found\n"); | 193 | pr_err(PREFIX "driver data not found\n"); |
201 | return -ENODEV; | 194 | result = -ENODEV; |
195 | goto out; | ||
202 | } | 196 | } |
203 | 197 | ||
204 | return 0; | 198 | out: |
199 | acpi_scan_lock_release(); | ||
200 | return result; | ||
205 | } | 201 | } |
206 | 202 | ||
207 | static int acpi_memory_check_device(struct acpi_memory_device *mem_device) | 203 | 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 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, | 255 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, |
260 | "\nReceived EJECT REQUEST notification for device\n")); | 256 | "\nReceived EJECT REQUEST notification for device\n")); |
261 | 257 | ||
258 | acpi_scan_lock_acquire(); | ||
262 | if (acpi_bus_get_device(handle, &device)) { | 259 | if (acpi_bus_get_device(handle, &device)) { |
260 | acpi_scan_lock_release(); | ||
263 | pr_err(PREFIX "Device doesn't exist\n"); | 261 | pr_err(PREFIX "Device doesn't exist\n"); |
264 | break; | 262 | break; |
265 | } | 263 | } |
266 | mem_device = acpi_driver_data(device); | 264 | mem_device = acpi_driver_data(device); |
267 | if (!mem_device) { | 265 | if (!mem_device) { |
266 | acpi_scan_lock_release(); | ||
268 | pr_err(PREFIX "Driver Data is NULL\n"); | 267 | pr_err(PREFIX "Driver Data is NULL\n"); |
269 | break; | 268 | break; |
270 | } | 269 | } |
@@ -274,6 +273,7 @@ static void acpi_memory_device_notify(acpi_handle handle, u32 event, void *data) | |||
274 | * acpi_bus_remove if Xen support hotremove in the future | 273 | * acpi_bus_remove if Xen support hotremove in the future |
275 | */ | 274 | */ |
276 | acpi_memory_disable_device(mem_device); | 275 | acpi_memory_disable_device(mem_device); |
276 | acpi_scan_lock_release(); | ||
277 | break; | 277 | break; |
278 | 278 | ||
279 | default: | 279 | default: |
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index bcf3ba4a6ec1..61786be9138b 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c | |||
@@ -30,6 +30,7 @@ | |||
30 | * IN THE SOFTWARE. | 30 | * IN THE SOFTWARE. |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include <linux/mm.h> | ||
33 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
34 | #include <linux/types.h> | 35 | #include <linux/types.h> |
35 | #include <linux/spinlock.h> | 36 | #include <linux/spinlock.h> |