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

Changed files
+57 -49
arch
x86
pci
xen
drivers
+9
arch/x86/pci/xen.c
··· 162 162 struct msi_desc *msidesc; 163 163 int *v; 164 164 165 + if (type == PCI_CAP_ID_MSI && nvec > 1) 166 + return 1; 167 + 165 168 v = kzalloc(sizeof(int) * max(1, nvec), GFP_KERNEL); 166 169 if (!v) 167 170 return -ENOMEM; ··· 223 220 struct msi_desc *msidesc; 224 221 struct msi_msg msg; 225 222 223 + if (type == PCI_CAP_ID_MSI && nvec > 1) 224 + return 1; 225 + 226 226 list_for_each_entry(msidesc, &dev->msi_list, list) { 227 227 __read_msi_msg(msidesc, &msg); 228 228 pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) | ··· 268 262 { 269 263 int ret = 0; 270 264 struct msi_desc *msidesc; 265 + 266 + if (type == PCI_CAP_ID_MSI && nvec > 1) 267 + return 1; 271 268 272 269 list_for_each_entry(msidesc, &dev->msi_list, list) { 273 270 struct physdev_map_pirq map_irq;
+9 -1
arch/x86/xen/enlighten.c
··· 67 67 #include <asm/hypervisor.h> 68 68 #include <asm/mwait.h> 69 69 #include <asm/pci_x86.h> 70 + #include <asm/pat.h> 70 71 71 72 #ifdef CONFIG_ACPI 72 73 #include <linux/acpi.h> ··· 1418 1417 */ 1419 1418 acpi_numa = -1; 1420 1419 #endif 1421 - 1420 + #ifdef CONFIG_X86_PAT 1421 + /* 1422 + * For right now disable the PAT. We should remove this once 1423 + * git commit 8eaffa67b43e99ae581622c5133e20b0f48bcef1 1424 + * (xen/pat: Disable PAT support for now) is reverted. 1425 + */ 1426 + pat_enabled = 0; 1427 + #endif 1422 1428 /* Don't do the full vcpu_info placement stuff until we have a 1423 1429 possible map and a non-dummy shared_info. */ 1424 1430 per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];
+12 -22
drivers/xen/xen-acpi-cpuhotplug.c
··· 239 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 242 static int acpi_processor_device_remove(struct acpi_device *device) 261 243 { 262 244 pr_debug(PREFIX "Xen does not support CPU hotremove\n"); ··· 254 272 u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; /* default */ 255 273 int result; 256 274 275 + acpi_scan_lock_acquire(); 276 + 257 277 switch (event) { 258 278 case ACPI_NOTIFY_BUS_CHECK: 259 279 case ACPI_NOTIFY_DEVICE_CHECK: ··· 270 286 if (!acpi_bus_get_device(handle, &device)) 271 287 break; 272 288 273 - result = acpi_processor_device_add(handle, &device); 289 + result = acpi_bus_scan(handle); 274 290 if (result) { 275 291 pr_err(PREFIX "Unable to add the device\n"); 276 292 break; 277 293 } 278 - 294 + result = acpi_bus_get_device(handle, &device); 295 + if (result) { 296 + pr_err(PREFIX "Missing device object\n"); 297 + break; 298 + } 279 299 ost_code = ACPI_OST_SC_SUCCESS; 280 300 break; 281 301 ··· 309 321 "Unsupported event [0x%x]\n", event)); 310 322 311 323 /* non-hotplug event; possibly handled by other handler */ 312 - return; 324 + goto out; 313 325 } 314 326 315 327 (void) acpi_evaluate_hotplug_ost(handle, event, ost_code, NULL); 316 - return; 328 + 329 + out: 330 + acpi_scan_lock_release(); 317 331 } 318 332 319 333 static acpi_status is_processor_device(acpi_handle handle)
+26 -26
drivers/xen/xen-acpi-memhotplug.c
··· 158 158 return 0; 159 159 } 160 160 161 - static int 162 - acpi_memory_get_device(acpi_handle handle, 163 - struct acpi_memory_device **mem_device) 161 + static int acpi_memory_get_device(acpi_handle handle, 162 + struct acpi_memory_device **mem_device) 164 163 { 165 - acpi_status status; 166 - acpi_handle phandle; 167 164 struct acpi_device *device = NULL; 168 - struct acpi_device *pdevice = NULL; 169 - int result; 165 + int result = 0; 170 166 171 - if (!acpi_bus_get_device(handle, &device) && device) 167 + acpi_scan_lock_acquire(); 168 + 169 + acpi_bus_get_device(handle, &device); 170 + if (device) 172 171 goto end; 173 - 174 - status = acpi_get_parent(handle, &phandle); 175 - if (ACPI_FAILURE(status)) { 176 - pr_warn(PREFIX "Cannot find acpi parent\n"); 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 174 * Now add the notified device. This creates the acpi_device ··· 176 190 */ 177 191 result = acpi_bus_scan(handle); 178 192 if (result) { 179 - pr_warn(PREFIX "Cannot add acpi bus\n"); 180 - return -EINVAL; 193 + pr_warn(PREFIX "ACPI namespace scan failed\n"); 194 + result = -EINVAL; 195 + goto out; 196 + } 197 + result = acpi_bus_get_device(handle, &device); 198 + if (result) { 199 + pr_warn(PREFIX "Missing device object\n"); 200 + result = -EINVAL; 201 + goto out; 181 202 } 182 203 183 204 end: 184 205 *mem_device = acpi_driver_data(device); 185 206 if (!(*mem_device)) { 186 - pr_err(PREFIX "Driver data not found\n"); 187 - return -ENODEV; 207 + pr_err(PREFIX "driver data not found\n"); 208 + result = -ENODEV; 209 + goto out; 188 210 } 189 211 190 - return 0; 212 + out: 213 + acpi_scan_lock_release(); 214 + return result; 191 215 } 192 216 193 217 static int acpi_memory_check_device(struct acpi_memory_device *mem_device) ··· 255 259 ACPI_DEBUG_PRINT((ACPI_DB_INFO, 256 260 "\nReceived EJECT REQUEST notification for device\n")); 257 261 262 + acpi_scan_lock_acquire(); 258 263 if (acpi_bus_get_device(handle, &device)) { 264 + acpi_scan_lock_release(); 259 265 pr_err(PREFIX "Device doesn't exist\n"); 260 266 break; 261 267 } 262 268 mem_device = acpi_driver_data(device); 263 269 if (!mem_device) { 270 + acpi_scan_lock_release(); 264 271 pr_err(PREFIX "Driver Data is NULL\n"); 265 272 break; 266 273 } ··· 273 274 * acpi_bus_remove if Xen support hotremove in the future 274 275 */ 275 276 acpi_memory_disable_device(mem_device); 277 + acpi_scan_lock_release(); 276 278 break; 277 279 278 280 default:
+1
drivers/xen/xenbus/xenbus_client.c
··· 30 30 * IN THE SOFTWARE. 31 31 */ 32 32 33 + #include <linux/mm.h> 33 34 #include <linux/slab.h> 34 35 #include <linux/types.h> 35 36 #include <linux/spinlock.h>