diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-09-15 04:27:31 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-09-15 04:27:31 -0400 |
| commit | 3aabae7d9dfaed60effe93662f02c19bafc18537 (patch) | |
| tree | af94cdd69add07601d9f3f5988dfc1dc255e3886 /drivers | |
| parent | 79e406d7b00ab2b261ae32a59f266fd3b7af6f29 (diff) | |
| parent | 57c072c7113f54f9512624d6c665db6184448782 (diff) | |
Merge branch 'tip/perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/core
Diffstat (limited to 'drivers')
223 files changed, 2391 insertions, 1773 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 1f67057af2a5..3ba8d1f44a73 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
| @@ -33,7 +33,6 @@ | |||
| 33 | #include <linux/pm_runtime.h> | 33 | #include <linux/pm_runtime.h> |
| 34 | #include <linux/pci.h> | 34 | #include <linux/pci.h> |
| 35 | #include <linux/pci-acpi.h> | 35 | #include <linux/pci-acpi.h> |
| 36 | #include <linux/pci-aspm.h> | ||
| 37 | #include <linux/acpi.h> | 36 | #include <linux/acpi.h> |
| 38 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
| 39 | #include <acpi/acpi_bus.h> | 38 | #include <acpi/acpi_bus.h> |
| @@ -226,22 +225,31 @@ static acpi_status acpi_pci_run_osc(acpi_handle handle, | |||
| 226 | return status; | 225 | return status; |
| 227 | } | 226 | } |
| 228 | 227 | ||
| 229 | static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, u32 flags) | 228 | static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, |
| 229 | u32 support, | ||
| 230 | u32 *control) | ||
| 230 | { | 231 | { |
| 231 | acpi_status status; | 232 | acpi_status status; |
| 232 | u32 support_set, result, capbuf[3]; | 233 | u32 result, capbuf[3]; |
| 234 | |||
| 235 | support &= OSC_PCI_SUPPORT_MASKS; | ||
| 236 | support |= root->osc_support_set; | ||
| 233 | 237 | ||
| 234 | /* do _OSC query for all possible controls */ | ||
| 235 | support_set = root->osc_support_set | (flags & OSC_PCI_SUPPORT_MASKS); | ||
| 236 | capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE; | 238 | capbuf[OSC_QUERY_TYPE] = OSC_QUERY_ENABLE; |
| 237 | capbuf[OSC_SUPPORT_TYPE] = support_set; | 239 | capbuf[OSC_SUPPORT_TYPE] = support; |
| 238 | capbuf[OSC_CONTROL_TYPE] = OSC_PCI_CONTROL_MASKS; | 240 | if (control) { |
| 241 | *control &= OSC_PCI_CONTROL_MASKS; | ||
| 242 | capbuf[OSC_CONTROL_TYPE] = *control | root->osc_control_set; | ||
| 243 | } else { | ||
| 244 | /* Run _OSC query for all possible controls. */ | ||
| 245 | capbuf[OSC_CONTROL_TYPE] = OSC_PCI_CONTROL_MASKS; | ||
| 246 | } | ||
| 239 | 247 | ||
| 240 | status = acpi_pci_run_osc(root->device->handle, capbuf, &result); | 248 | status = acpi_pci_run_osc(root->device->handle, capbuf, &result); |
| 241 | if (ACPI_SUCCESS(status)) { | 249 | if (ACPI_SUCCESS(status)) { |
| 242 | root->osc_support_set = support_set; | 250 | root->osc_support_set = support; |
| 243 | root->osc_control_qry = result; | 251 | if (control) |
| 244 | root->osc_queried = 1; | 252 | *control = result; |
| 245 | } | 253 | } |
| 246 | return status; | 254 | return status; |
| 247 | } | 255 | } |
| @@ -255,7 +263,7 @@ static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags) | |||
| 255 | if (ACPI_FAILURE(status)) | 263 | if (ACPI_FAILURE(status)) |
| 256 | return status; | 264 | return status; |
| 257 | mutex_lock(&osc_lock); | 265 | mutex_lock(&osc_lock); |
| 258 | status = acpi_pci_query_osc(root, flags); | 266 | status = acpi_pci_query_osc(root, flags, NULL); |
| 259 | mutex_unlock(&osc_lock); | 267 | mutex_unlock(&osc_lock); |
| 260 | return status; | 268 | return status; |
| 261 | } | 269 | } |
| @@ -365,55 +373,70 @@ out: | |||
| 365 | EXPORT_SYMBOL_GPL(acpi_get_pci_dev); | 373 | EXPORT_SYMBOL_GPL(acpi_get_pci_dev); |
| 366 | 374 | ||
| 367 | /** | 375 | /** |
| 368 | * acpi_pci_osc_control_set - commit requested control to Firmware | 376 | * acpi_pci_osc_control_set - Request control of PCI root _OSC features. |
| 369 | * @handle: acpi_handle for the target ACPI object | 377 | * @handle: ACPI handle of a PCI root bridge (or PCIe Root Complex). |
| 370 | * @flags: driver's requested control bits | 378 | * @mask: Mask of _OSC bits to request control of, place to store control mask. |
| 379 | * @req: Mask of _OSC bits the control of is essential to the caller. | ||
| 380 | * | ||
| 381 | * Run _OSC query for @mask and if that is successful, compare the returned | ||
| 382 | * mask of control bits with @req. If all of the @req bits are set in the | ||
| 383 | * returned mask, run _OSC request for it. | ||
| 371 | * | 384 | * |
| 372 | * Attempt to take control from Firmware on requested control bits. | 385 | * The variable at the @mask address may be modified regardless of whether or |
| 386 | * not the function returns success. On success it will contain the mask of | ||
| 387 | * _OSC bits the BIOS has granted control of, but its contents are meaningless | ||
| 388 | * on failure. | ||
| 373 | **/ | 389 | **/ |
| 374 | acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags) | 390 | acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask, u32 req) |
| 375 | { | 391 | { |
| 392 | struct acpi_pci_root *root; | ||
| 376 | acpi_status status; | 393 | acpi_status status; |
| 377 | u32 control_req, result, capbuf[3]; | 394 | u32 ctrl, capbuf[3]; |
| 378 | acpi_handle tmp; | 395 | acpi_handle tmp; |
| 379 | struct acpi_pci_root *root; | ||
| 380 | 396 | ||
| 381 | status = acpi_get_handle(handle, "_OSC", &tmp); | 397 | if (!mask) |
| 382 | if (ACPI_FAILURE(status)) | 398 | return AE_BAD_PARAMETER; |
| 383 | return status; | ||
| 384 | 399 | ||
| 385 | control_req = (flags & OSC_PCI_CONTROL_MASKS); | 400 | ctrl = *mask & OSC_PCI_CONTROL_MASKS; |
| 386 | if (!control_req) | 401 | if ((ctrl & req) != req) |
| 387 | return AE_TYPE; | 402 | return AE_TYPE; |
| 388 | 403 | ||
| 389 | root = acpi_pci_find_root(handle); | 404 | root = acpi_pci_find_root(handle); |
| 390 | if (!root) | 405 | if (!root) |
| 391 | return AE_NOT_EXIST; | 406 | return AE_NOT_EXIST; |
| 392 | 407 | ||
| 408 | status = acpi_get_handle(handle, "_OSC", &tmp); | ||
| 409 | if (ACPI_FAILURE(status)) | ||
| 410 | return status; | ||
| 411 | |||
| 393 | mutex_lock(&osc_lock); | 412 | mutex_lock(&osc_lock); |
| 413 | |||
| 414 | *mask = ctrl | root->osc_control_set; | ||
| 394 | /* No need to evaluate _OSC if the control was already granted. */ | 415 | /* No need to evaluate _OSC if the control was already granted. */ |
| 395 | if ((root->osc_control_set & control_req) == control_req) | 416 | if ((root->osc_control_set & ctrl) == ctrl) |
| 396 | goto out; | 417 | goto out; |
| 397 | 418 | ||
| 398 | /* Need to query controls first before requesting them */ | 419 | /* Need to check the available controls bits before requesting them. */ |
| 399 | if (!root->osc_queried) { | 420 | while (*mask) { |
| 400 | status = acpi_pci_query_osc(root, root->osc_support_set); | 421 | status = acpi_pci_query_osc(root, root->osc_support_set, mask); |
| 401 | if (ACPI_FAILURE(status)) | 422 | if (ACPI_FAILURE(status)) |
| 402 | goto out; | 423 | goto out; |
| 424 | if (ctrl == *mask) | ||
| 425 | break; | ||
| 426 | ctrl = *mask; | ||
| 403 | } | 427 | } |
| 404 | if ((root->osc_control_qry & control_req) != control_req) { | 428 | |
| 405 | printk(KERN_DEBUG | 429 | if ((ctrl & req) != req) { |
| 406 | "Firmware did not grant requested _OSC control\n"); | ||
| 407 | status = AE_SUPPORT; | 430 | status = AE_SUPPORT; |
| 408 | goto out; | 431 | goto out; |
| 409 | } | 432 | } |
| 410 | 433 | ||
| 411 | capbuf[OSC_QUERY_TYPE] = 0; | 434 | capbuf[OSC_QUERY_TYPE] = 0; |
| 412 | capbuf[OSC_SUPPORT_TYPE] = root->osc_support_set; | 435 | capbuf[OSC_SUPPORT_TYPE] = root->osc_support_set; |
| 413 | capbuf[OSC_CONTROL_TYPE] = root->osc_control_set | control_req; | 436 | capbuf[OSC_CONTROL_TYPE] = ctrl; |
| 414 | status = acpi_pci_run_osc(handle, capbuf, &result); | 437 | status = acpi_pci_run_osc(handle, capbuf, mask); |
| 415 | if (ACPI_SUCCESS(status)) | 438 | if (ACPI_SUCCESS(status)) |
| 416 | root->osc_control_set = result; | 439 | root->osc_control_set = *mask; |
| 417 | out: | 440 | out: |
| 418 | mutex_unlock(&osc_lock); | 441 | mutex_unlock(&osc_lock); |
| 419 | return status; | 442 | return status; |
| @@ -544,14 +567,6 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
| 544 | if (flags != base_flags) | 567 | if (flags != base_flags) |
| 545 | acpi_pci_osc_support(root, flags); | 568 | acpi_pci_osc_support(root, flags); |
| 546 | 569 | ||
| 547 | status = acpi_pci_osc_control_set(root->device->handle, | ||
| 548 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 549 | |||
| 550 | if (ACPI_FAILURE(status)) { | ||
| 551 | printk(KERN_INFO "Unable to assume PCIe control: Disabling ASPM\n"); | ||
| 552 | pcie_no_aspm(); | ||
| 553 | } | ||
| 554 | |||
| 555 | pci_acpi_add_bus_pm_notifier(device, root->bus); | 570 | pci_acpi_add_bus_pm_notifier(device, root->bus); |
| 556 | if (device->wakeup.flags.run_wake) | 571 | if (device->wakeup.flags.run_wake) |
| 557 | device_set_run_wake(root->bus->bridge, true); | 572 | device_set_run_wake(root->bus->bridge, true); |
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index 65e3e2708371..11ec911016c6 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
| @@ -828,6 +828,7 @@ config PATA_SAMSUNG_CF | |||
| 828 | config PATA_WINBOND_VLB | 828 | config PATA_WINBOND_VLB |
| 829 | tristate "Winbond W83759A VLB PATA support (Experimental)" | 829 | tristate "Winbond W83759A VLB PATA support (Experimental)" |
| 830 | depends on ISA && EXPERIMENTAL | 830 | depends on ISA && EXPERIMENTAL |
| 831 | select PATA_LEGACY | ||
| 831 | help | 832 | help |
| 832 | Support for the Winbond W83759A controller on Vesa Local Bus | 833 | Support for the Winbond W83759A controller on Vesa Local Bus |
| 833 | systems. | 834 | systems. |
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile index 158eaa961b1e..d5df04a395ca 100644 --- a/drivers/ata/Makefile +++ b/drivers/ata/Makefile | |||
| @@ -89,7 +89,6 @@ obj-$(CONFIG_PATA_QDI) += pata_qdi.o | |||
| 89 | obj-$(CONFIG_PATA_RB532) += pata_rb532_cf.o | 89 | obj-$(CONFIG_PATA_RB532) += pata_rb532_cf.o |
| 90 | obj-$(CONFIG_PATA_RZ1000) += pata_rz1000.o | 90 | obj-$(CONFIG_PATA_RZ1000) += pata_rz1000.o |
| 91 | obj-$(CONFIG_PATA_SAMSUNG_CF) += pata_samsung_cf.o | 91 | obj-$(CONFIG_PATA_SAMSUNG_CF) += pata_samsung_cf.o |
| 92 | obj-$(CONFIG_PATA_WINBOND_VLB) += pata_winbond.o | ||
| 93 | 92 | ||
| 94 | obj-$(CONFIG_PATA_PXA) += pata_pxa.o | 93 | obj-$(CONFIG_PATA_PXA) += pata_pxa.o |
| 95 | 94 | ||
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index fe75d8befc3a..ff1c945fba98 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
| @@ -60,6 +60,7 @@ enum board_ids { | |||
| 60 | board_ahci, | 60 | board_ahci, |
| 61 | board_ahci_ign_iferr, | 61 | board_ahci_ign_iferr, |
| 62 | board_ahci_nosntf, | 62 | board_ahci_nosntf, |
| 63 | board_ahci_yes_fbs, | ||
| 63 | 64 | ||
| 64 | /* board IDs for specific chipsets in alphabetical order */ | 65 | /* board IDs for specific chipsets in alphabetical order */ |
| 65 | board_ahci_mcp65, | 66 | board_ahci_mcp65, |
| @@ -132,6 +133,14 @@ static const struct ata_port_info ahci_port_info[] = { | |||
| 132 | .udma_mask = ATA_UDMA6, | 133 | .udma_mask = ATA_UDMA6, |
| 133 | .port_ops = &ahci_ops, | 134 | .port_ops = &ahci_ops, |
| 134 | }, | 135 | }, |
| 136 | [board_ahci_yes_fbs] = | ||
| 137 | { | ||
| 138 | AHCI_HFLAGS (AHCI_HFLAG_YES_FBS), | ||
| 139 | .flags = AHCI_FLAG_COMMON, | ||
| 140 | .pio_mask = ATA_PIO4, | ||
| 141 | .udma_mask = ATA_UDMA6, | ||
| 142 | .port_ops = &ahci_ops, | ||
| 143 | }, | ||
| 135 | /* by chipsets */ | 144 | /* by chipsets */ |
| 136 | [board_ahci_mcp65] = | 145 | [board_ahci_mcp65] = |
| 137 | { | 146 | { |
| @@ -244,6 +253,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 244 | { PCI_VDEVICE(INTEL, 0x1c05), board_ahci }, /* CPT RAID */ | 253 | { PCI_VDEVICE(INTEL, 0x1c05), board_ahci }, /* CPT RAID */ |
| 245 | { PCI_VDEVICE(INTEL, 0x1c06), board_ahci }, /* CPT RAID */ | 254 | { PCI_VDEVICE(INTEL, 0x1c06), board_ahci }, /* CPT RAID */ |
| 246 | { PCI_VDEVICE(INTEL, 0x1c07), board_ahci }, /* CPT RAID */ | 255 | { PCI_VDEVICE(INTEL, 0x1c07), board_ahci }, /* CPT RAID */ |
| 256 | { PCI_VDEVICE(INTEL, 0x1d02), board_ahci }, /* PBG AHCI */ | ||
| 257 | { PCI_VDEVICE(INTEL, 0x1d04), board_ahci }, /* PBG RAID */ | ||
| 258 | { PCI_VDEVICE(INTEL, 0x1d06), board_ahci }, /* PBG RAID */ | ||
| 247 | 259 | ||
| 248 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 260 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
| 249 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 261 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| @@ -362,6 +374,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
| 362 | /* Marvell */ | 374 | /* Marvell */ |
| 363 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ | 375 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ |
| 364 | { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ | 376 | { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ |
| 377 | { PCI_DEVICE(0x1b4b, 0x9123), | ||
| 378 | .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ | ||
| 365 | 379 | ||
| 366 | /* Promise */ | 380 | /* Promise */ |
| 367 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ | 381 | { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ |
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 7113c5724471..474427b6f99f 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
| @@ -209,6 +209,7 @@ enum { | |||
| 209 | link offline */ | 209 | link offline */ |
| 210 | AHCI_HFLAG_NO_SNTF = (1 << 12), /* no sntf */ | 210 | AHCI_HFLAG_NO_SNTF = (1 << 12), /* no sntf */ |
| 211 | AHCI_HFLAG_NO_FPDMA_AA = (1 << 13), /* no FPDMA AA */ | 211 | AHCI_HFLAG_NO_FPDMA_AA = (1 << 13), /* no FPDMA AA */ |
| 212 | AHCI_HFLAG_YES_FBS = (1 << 14), /* force FBS cap on */ | ||
| 212 | 213 | ||
| 213 | /* ap->flags bits */ | 214 | /* ap->flags bits */ |
| 214 | 215 | ||
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 3971bc0a4838..d712675d0a96 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
| @@ -302,6 +302,10 @@ static const struct pci_device_id piix_pci_tbl[] = { | |||
| 302 | { 0x8086, 0x1c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | 302 | { 0x8086, 0x1c08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
| 303 | /* SATA Controller IDE (CPT) */ | 303 | /* SATA Controller IDE (CPT) */ |
| 304 | { 0x8086, 0x1c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | 304 | { 0x8086, 0x1c09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
| 305 | /* SATA Controller IDE (PBG) */ | ||
| 306 | { 0x8086, 0x1d00, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, | ||
| 307 | /* SATA Controller IDE (PBG) */ | ||
| 308 | { 0x8086, 0x1d08, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | ||
| 305 | { } /* terminate list */ | 309 | { } /* terminate list */ |
| 306 | }; | 310 | }; |
| 307 | 311 | ||
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 81e772a94d59..68dc6785472f 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
| @@ -430,6 +430,12 @@ void ahci_save_initial_config(struct device *dev, | |||
| 430 | cap &= ~HOST_CAP_SNTF; | 430 | cap &= ~HOST_CAP_SNTF; |
| 431 | } | 431 | } |
| 432 | 432 | ||
| 433 | if (!(cap & HOST_CAP_FBS) && (hpriv->flags & AHCI_HFLAG_YES_FBS)) { | ||
| 434 | dev_printk(KERN_INFO, dev, | ||
| 435 | "controller can do FBS, turning on CAP_FBS\n"); | ||
| 436 | cap |= HOST_CAP_FBS; | ||
| 437 | } | ||
| 438 | |||
| 433 | if (force_port_map && port_map != force_port_map) { | 439 | if (force_port_map && port_map != force_port_map) { |
| 434 | dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n", | 440 | dev_printk(KERN_INFO, dev, "forcing port_map 0x%x -> 0x%x\n", |
| 435 | port_map, force_port_map); | 441 | port_map, force_port_map); |
| @@ -1320,7 +1326,7 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class, | |||
| 1320 | /* issue the first D2H Register FIS */ | 1326 | /* issue the first D2H Register FIS */ |
| 1321 | msecs = 0; | 1327 | msecs = 0; |
| 1322 | now = jiffies; | 1328 | now = jiffies; |
| 1323 | if (time_after(now, deadline)) | 1329 | if (time_after(deadline, now)) |
| 1324 | msecs = jiffies_to_msecs(deadline - now); | 1330 | msecs = jiffies_to_msecs(deadline - now); |
| 1325 | 1331 | ||
| 1326 | tf.ctl |= ATA_SRST; | 1332 | tf.ctl |= ATA_SRST; |
| @@ -2036,9 +2042,15 @@ static int ahci_port_start(struct ata_port *ap) | |||
| 2036 | u32 cmd = readl(port_mmio + PORT_CMD); | 2042 | u32 cmd = readl(port_mmio + PORT_CMD); |
| 2037 | if (cmd & PORT_CMD_FBSCP) | 2043 | if (cmd & PORT_CMD_FBSCP) |
| 2038 | pp->fbs_supported = true; | 2044 | pp->fbs_supported = true; |
| 2039 | else | 2045 | else if (hpriv->flags & AHCI_HFLAG_YES_FBS) { |
| 2046 | dev_printk(KERN_INFO, dev, | ||
| 2047 | "port %d can do FBS, forcing FBSCP\n", | ||
| 2048 | ap->port_no); | ||
| 2049 | pp->fbs_supported = true; | ||
| 2050 | } else | ||
| 2040 | dev_printk(KERN_WARNING, dev, | 2051 | dev_printk(KERN_WARNING, dev, |
| 2041 | "The port is not capable of FBS\n"); | 2052 | "port %d is not capable of FBS\n", |
| 2053 | ap->port_no); | ||
| 2042 | } | 2054 | } |
| 2043 | 2055 | ||
| 2044 | if (pp->fbs_supported) { | 2056 | if (pp->fbs_supported) { |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 7ef7c4f216fa..932eaee50245 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -5111,15 +5111,18 @@ void ata_qc_issue(struct ata_queued_cmd *qc) | |||
| 5111 | qc->flags |= ATA_QCFLAG_ACTIVE; | 5111 | qc->flags |= ATA_QCFLAG_ACTIVE; |
| 5112 | ap->qc_active |= 1 << qc->tag; | 5112 | ap->qc_active |= 1 << qc->tag; |
| 5113 | 5113 | ||
| 5114 | /* We guarantee to LLDs that they will have at least one | 5114 | /* |
| 5115 | * We guarantee to LLDs that they will have at least one | ||
| 5115 | * non-zero sg if the command is a data command. | 5116 | * non-zero sg if the command is a data command. |
| 5116 | */ | 5117 | */ |
| 5117 | BUG_ON(ata_is_data(prot) && (!qc->sg || !qc->n_elem || !qc->nbytes)); | 5118 | if (WARN_ON_ONCE(ata_is_data(prot) && |
| 5119 | (!qc->sg || !qc->n_elem || !qc->nbytes))) | ||
| 5120 | goto sys_err; | ||
| 5118 | 5121 | ||
| 5119 | if (ata_is_dma(prot) || (ata_is_pio(prot) && | 5122 | if (ata_is_dma(prot) || (ata_is_pio(prot) && |
| 5120 | (ap->flags & ATA_FLAG_PIO_DMA))) | 5123 | (ap->flags & ATA_FLAG_PIO_DMA))) |
| 5121 | if (ata_sg_setup(qc)) | 5124 | if (ata_sg_setup(qc)) |
| 5122 | goto sg_err; | 5125 | goto sys_err; |
| 5123 | 5126 | ||
| 5124 | /* if device is sleeping, schedule reset and abort the link */ | 5127 | /* if device is sleeping, schedule reset and abort the link */ |
| 5125 | if (unlikely(qc->dev->flags & ATA_DFLAG_SLEEPING)) { | 5128 | if (unlikely(qc->dev->flags & ATA_DFLAG_SLEEPING)) { |
| @@ -5136,7 +5139,7 @@ void ata_qc_issue(struct ata_queued_cmd *qc) | |||
| 5136 | goto err; | 5139 | goto err; |
| 5137 | return; | 5140 | return; |
| 5138 | 5141 | ||
| 5139 | sg_err: | 5142 | sys_err: |
| 5140 | qc->err_mask |= AC_ERR_SYSTEM; | 5143 | qc->err_mask |= AC_ERR_SYSTEM; |
| 5141 | err: | 5144 | err: |
| 5142 | ata_qc_complete(qc); | 5145 | ata_qc_complete(qc); |
| @@ -5415,6 +5418,7 @@ static int ata_host_request_pm(struct ata_host *host, pm_message_t mesg, | |||
| 5415 | */ | 5418 | */ |
| 5416 | int ata_host_suspend(struct ata_host *host, pm_message_t mesg) | 5419 | int ata_host_suspend(struct ata_host *host, pm_message_t mesg) |
| 5417 | { | 5420 | { |
| 5421 | unsigned int ehi_flags = ATA_EHI_QUIET; | ||
| 5418 | int rc; | 5422 | int rc; |
| 5419 | 5423 | ||
| 5420 | /* | 5424 | /* |
| @@ -5423,7 +5427,18 @@ int ata_host_suspend(struct ata_host *host, pm_message_t mesg) | |||
| 5423 | */ | 5427 | */ |
| 5424 | ata_lpm_enable(host); | 5428 | ata_lpm_enable(host); |
| 5425 | 5429 | ||
| 5426 | rc = ata_host_request_pm(host, mesg, 0, ATA_EHI_QUIET, 1); | 5430 | /* |
| 5431 | * On some hardware, device fails to respond after spun down | ||
| 5432 | * for suspend. As the device won't be used before being | ||
| 5433 | * resumed, we don't need to touch the device. Ask EH to skip | ||
| 5434 | * the usual stuff and proceed directly to suspend. | ||
| 5435 | * | ||
| 5436 | * http://thread.gmane.org/gmane.linux.ide/46764 | ||
| 5437 | */ | ||
| 5438 | if (mesg.event == PM_EVENT_SUSPEND) | ||
| 5439 | ehi_flags |= ATA_EHI_NO_AUTOPSY | ATA_EHI_NO_RECOVERY; | ||
| 5440 | |||
| 5441 | rc = ata_host_request_pm(host, mesg, 0, ehi_flags, 1); | ||
| 5427 | if (rc == 0) | 5442 | if (rc == 0) |
| 5428 | host->dev->power.power_state = mesg; | 5443 | host->dev->power.power_state = mesg; |
| 5429 | return rc; | 5444 | return rc; |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c9ae299b8342..e48302eae55f 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
| @@ -3235,6 +3235,10 @@ static int ata_eh_skip_recovery(struct ata_link *link) | |||
| 3235 | if (link->flags & ATA_LFLAG_DISABLED) | 3235 | if (link->flags & ATA_LFLAG_DISABLED) |
| 3236 | return 1; | 3236 | return 1; |
| 3237 | 3237 | ||
| 3238 | /* skip if explicitly requested */ | ||
| 3239 | if (ehc->i.flags & ATA_EHI_NO_RECOVERY) | ||
| 3240 | return 1; | ||
| 3241 | |||
| 3238 | /* thaw frozen port and recover failed devices */ | 3242 | /* thaw frozen port and recover failed devices */ |
| 3239 | if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link)) | 3243 | if ((ap->pflags & ATA_PFLAG_FROZEN) || ata_link_nr_enabled(link)) |
| 3240 | return 0; | 3244 | return 0; |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 674c1436491f..e30c537cce32 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
| @@ -418,6 +418,7 @@ void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | |||
| 418 | if (ioaddr->ctl_addr) | 418 | if (ioaddr->ctl_addr) |
| 419 | iowrite8(tf->ctl, ioaddr->ctl_addr); | 419 | iowrite8(tf->ctl, ioaddr->ctl_addr); |
| 420 | ap->last_ctl = tf->ctl; | 420 | ap->last_ctl = tf->ctl; |
| 421 | ata_wait_idle(ap); | ||
| 421 | } | 422 | } |
| 422 | 423 | ||
| 423 | if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) { | 424 | if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) { |
| @@ -453,6 +454,8 @@ void ata_sff_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | |||
| 453 | iowrite8(tf->device, ioaddr->device_addr); | 454 | iowrite8(tf->device, ioaddr->device_addr); |
| 454 | VPRINTK("device 0x%X\n", tf->device); | 455 | VPRINTK("device 0x%X\n", tf->device); |
| 455 | } | 456 | } |
| 457 | |||
| 458 | ata_wait_idle(ap); | ||
| 456 | } | 459 | } |
| 457 | EXPORT_SYMBOL_GPL(ata_sff_tf_load); | 460 | EXPORT_SYMBOL_GPL(ata_sff_tf_load); |
| 458 | 461 | ||
| @@ -1042,7 +1045,8 @@ static void ata_hsm_qc_complete(struct ata_queued_cmd *qc, int in_wq) | |||
| 1042 | int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, | 1045 | int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, |
| 1043 | u8 status, int in_wq) | 1046 | u8 status, int in_wq) |
| 1044 | { | 1047 | { |
| 1045 | struct ata_eh_info *ehi = &ap->link.eh_info; | 1048 | struct ata_link *link = qc->dev->link; |
| 1049 | struct ata_eh_info *ehi = &link->eh_info; | ||
| 1046 | unsigned long flags = 0; | 1050 | unsigned long flags = 0; |
| 1047 | int poll_next; | 1051 | int poll_next; |
| 1048 | 1052 | ||
| @@ -1298,8 +1302,14 @@ fsm_start: | |||
| 1298 | } | 1302 | } |
| 1299 | EXPORT_SYMBOL_GPL(ata_sff_hsm_move); | 1303 | EXPORT_SYMBOL_GPL(ata_sff_hsm_move); |
| 1300 | 1304 | ||
| 1301 | void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay) | 1305 | void ata_sff_queue_pio_task(struct ata_link *link, unsigned long delay) |
| 1302 | { | 1306 | { |
| 1307 | struct ata_port *ap = link->ap; | ||
| 1308 | |||
| 1309 | WARN_ON((ap->sff_pio_task_link != NULL) && | ||
| 1310 | (ap->sff_pio_task_link != link)); | ||
| 1311 | ap->sff_pio_task_link = link; | ||
| 1312 | |||
| 1303 | /* may fail if ata_sff_flush_pio_task() in progress */ | 1313 | /* may fail if ata_sff_flush_pio_task() in progress */ |
| 1304 | queue_delayed_work(ata_sff_wq, &ap->sff_pio_task, | 1314 | queue_delayed_work(ata_sff_wq, &ap->sff_pio_task, |
| 1305 | msecs_to_jiffies(delay)); | 1315 | msecs_to_jiffies(delay)); |
| @@ -1321,14 +1331,18 @@ static void ata_sff_pio_task(struct work_struct *work) | |||
| 1321 | { | 1331 | { |
| 1322 | struct ata_port *ap = | 1332 | struct ata_port *ap = |
| 1323 | container_of(work, struct ata_port, sff_pio_task.work); | 1333 | container_of(work, struct ata_port, sff_pio_task.work); |
| 1334 | struct ata_link *link = ap->sff_pio_task_link; | ||
| 1324 | struct ata_queued_cmd *qc; | 1335 | struct ata_queued_cmd *qc; |
| 1325 | u8 status; | 1336 | u8 status; |
| 1326 | int poll_next; | 1337 | int poll_next; |
| 1327 | 1338 | ||
| 1339 | BUG_ON(ap->sff_pio_task_link == NULL); | ||
| 1328 | /* qc can be NULL if timeout occurred */ | 1340 | /* qc can be NULL if timeout occurred */ |
| 1329 | qc = ata_qc_from_tag(ap, ap->link.active_tag); | 1341 | qc = ata_qc_from_tag(ap, link->active_tag); |
| 1330 | if (!qc) | 1342 | if (!qc) { |
| 1343 | ap->sff_pio_task_link = NULL; | ||
| 1331 | return; | 1344 | return; |
| 1345 | } | ||
| 1332 | 1346 | ||
| 1333 | fsm_start: | 1347 | fsm_start: |
| 1334 | WARN_ON_ONCE(ap->hsm_task_state == HSM_ST_IDLE); | 1348 | WARN_ON_ONCE(ap->hsm_task_state == HSM_ST_IDLE); |
| @@ -1345,11 +1359,16 @@ fsm_start: | |||
| 1345 | msleep(2); | 1359 | msleep(2); |
| 1346 | status = ata_sff_busy_wait(ap, ATA_BUSY, 10); | 1360 | status = ata_sff_busy_wait(ap, ATA_BUSY, 10); |
| 1347 | if (status & ATA_BUSY) { | 1361 | if (status & ATA_BUSY) { |
| 1348 | ata_sff_queue_pio_task(ap, ATA_SHORT_PAUSE); | 1362 | ata_sff_queue_pio_task(link, ATA_SHORT_PAUSE); |
| 1349 | return; | 1363 | return; |
| 1350 | } | 1364 | } |
| 1351 | } | 1365 | } |
| 1352 | 1366 | ||
| 1367 | /* | ||
| 1368 | * hsm_move() may trigger another command to be processed. | ||
| 1369 | * clean the link beforehand. | ||
| 1370 | */ | ||
| 1371 | ap->sff_pio_task_link = NULL; | ||
| 1353 | /* move the HSM */ | 1372 | /* move the HSM */ |
| 1354 | poll_next = ata_sff_hsm_move(ap, qc, status, 1); | 1373 | poll_next = ata_sff_hsm_move(ap, qc, status, 1); |
| 1355 | 1374 | ||
| @@ -1376,6 +1395,7 @@ fsm_start: | |||
| 1376 | unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) | 1395 | unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) |
| 1377 | { | 1396 | { |
| 1378 | struct ata_port *ap = qc->ap; | 1397 | struct ata_port *ap = qc->ap; |
| 1398 | struct ata_link *link = qc->dev->link; | ||
| 1379 | 1399 | ||
| 1380 | /* Use polling pio if the LLD doesn't handle | 1400 | /* Use polling pio if the LLD doesn't handle |
| 1381 | * interrupt driven pio and atapi CDB interrupt. | 1401 | * interrupt driven pio and atapi CDB interrupt. |
| @@ -1396,7 +1416,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) | |||
| 1396 | ap->hsm_task_state = HSM_ST_LAST; | 1416 | ap->hsm_task_state = HSM_ST_LAST; |
| 1397 | 1417 | ||
| 1398 | if (qc->tf.flags & ATA_TFLAG_POLLING) | 1418 | if (qc->tf.flags & ATA_TFLAG_POLLING) |
| 1399 | ata_sff_queue_pio_task(ap, 0); | 1419 | ata_sff_queue_pio_task(link, 0); |
| 1400 | 1420 | ||
| 1401 | break; | 1421 | break; |
| 1402 | 1422 | ||
| @@ -1409,7 +1429,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) | |||
| 1409 | if (qc->tf.flags & ATA_TFLAG_WRITE) { | 1429 | if (qc->tf.flags & ATA_TFLAG_WRITE) { |
| 1410 | /* PIO data out protocol */ | 1430 | /* PIO data out protocol */ |
| 1411 | ap->hsm_task_state = HSM_ST_FIRST; | 1431 | ap->hsm_task_state = HSM_ST_FIRST; |
| 1412 | ata_sff_queue_pio_task(ap, 0); | 1432 | ata_sff_queue_pio_task(link, 0); |
| 1413 | 1433 | ||
| 1414 | /* always send first data block using the | 1434 | /* always send first data block using the |
| 1415 | * ata_sff_pio_task() codepath. | 1435 | * ata_sff_pio_task() codepath. |
| @@ -1419,7 +1439,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) | |||
| 1419 | ap->hsm_task_state = HSM_ST; | 1439 | ap->hsm_task_state = HSM_ST; |
| 1420 | 1440 | ||
| 1421 | if (qc->tf.flags & ATA_TFLAG_POLLING) | 1441 | if (qc->tf.flags & ATA_TFLAG_POLLING) |
| 1422 | ata_sff_queue_pio_task(ap, 0); | 1442 | ata_sff_queue_pio_task(link, 0); |
| 1423 | 1443 | ||
| 1424 | /* if polling, ata_sff_pio_task() handles the | 1444 | /* if polling, ata_sff_pio_task() handles the |
| 1425 | * rest. otherwise, interrupt handler takes | 1445 | * rest. otherwise, interrupt handler takes |
| @@ -1441,7 +1461,7 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) | |||
| 1441 | /* send cdb by polling if no cdb interrupt */ | 1461 | /* send cdb by polling if no cdb interrupt */ |
| 1442 | if ((!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) || | 1462 | if ((!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) || |
| 1443 | (qc->tf.flags & ATA_TFLAG_POLLING)) | 1463 | (qc->tf.flags & ATA_TFLAG_POLLING)) |
| 1444 | ata_sff_queue_pio_task(ap, 0); | 1464 | ata_sff_queue_pio_task(link, 0); |
| 1445 | break; | 1465 | break; |
| 1446 | 1466 | ||
| 1447 | default: | 1467 | default: |
| @@ -2734,10 +2754,7 @@ EXPORT_SYMBOL_GPL(ata_bmdma_dumb_qc_prep); | |||
| 2734 | unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc) | 2754 | unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc) |
| 2735 | { | 2755 | { |
| 2736 | struct ata_port *ap = qc->ap; | 2756 | struct ata_port *ap = qc->ap; |
| 2737 | 2757 | struct ata_link *link = qc->dev->link; | |
| 2738 | /* see ata_dma_blacklisted() */ | ||
| 2739 | BUG_ON((ap->flags & ATA_FLAG_PIO_POLLING) && | ||
| 2740 | qc->tf.protocol == ATAPI_PROT_DMA); | ||
| 2741 | 2758 | ||
| 2742 | /* defer PIO handling to sff_qc_issue */ | 2759 | /* defer PIO handling to sff_qc_issue */ |
| 2743 | if (!ata_is_dma(qc->tf.protocol)) | 2760 | if (!ata_is_dma(qc->tf.protocol)) |
| @@ -2766,7 +2783,7 @@ unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc) | |||
| 2766 | 2783 | ||
| 2767 | /* send cdb by polling if no cdb interrupt */ | 2784 | /* send cdb by polling if no cdb interrupt */ |
| 2768 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) | 2785 | if (!(qc->dev->flags & ATA_DFLAG_CDB_INTR)) |
| 2769 | ata_sff_queue_pio_task(ap, 0); | 2786 | ata_sff_queue_pio_task(link, 0); |
| 2770 | break; | 2787 | break; |
| 2771 | 2788 | ||
| 2772 | default: | 2789 | default: |
diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c index ba43f0f8c880..2215632e4b31 100644 --- a/drivers/ata/pata_artop.c +++ b/drivers/ata/pata_artop.c | |||
| @@ -74,7 +74,8 @@ static int artop6260_pre_reset(struct ata_link *link, unsigned long deadline) | |||
| 74 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); | 74 | struct pci_dev *pdev = to_pci_dev(ap->host->dev); |
| 75 | 75 | ||
| 76 | /* Odd numbered device ids are the units with enable bits (the -R cards) */ | 76 | /* Odd numbered device ids are the units with enable bits (the -R cards) */ |
| 77 | if (pdev->device % 1 && !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) | 77 | if ((pdev->device & 1) && |
| 78 | !pci_test_config_bits(pdev, &artop_enable_bits[ap->port_no])) | ||
| 78 | return -ENOENT; | 79 | return -ENOENT; |
| 79 | 80 | ||
| 80 | return ata_sff_prereset(link, deadline); | 81 | return ata_sff_prereset(link, deadline); |
diff --git a/drivers/ata/pata_cmd64x.c b/drivers/ata/pata_cmd64x.c index 9f5da1c7454b..905ff76d3cbb 100644 --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c | |||
| @@ -121,14 +121,8 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m | |||
| 121 | 121 | ||
| 122 | if (pair) { | 122 | if (pair) { |
| 123 | struct ata_timing tp; | 123 | struct ata_timing tp; |
| 124 | |||
| 125 | ata_timing_compute(pair, pair->pio_mode, &tp, T, 0); | 124 | ata_timing_compute(pair, pair->pio_mode, &tp, T, 0); |
| 126 | ata_timing_merge(&t, &tp, &t, ATA_TIMING_SETUP); | 125 | ata_timing_merge(&t, &tp, &t, ATA_TIMING_SETUP); |
| 127 | if (pair->dma_mode) { | ||
| 128 | ata_timing_compute(pair, pair->dma_mode, | ||
| 129 | &tp, T, 0); | ||
| 130 | ata_timing_merge(&tp, &t, &t, ATA_TIMING_SETUP); | ||
| 131 | } | ||
| 132 | } | 126 | } |
| 133 | } | 127 | } |
| 134 | 128 | ||
diff --git a/drivers/ata/pata_legacy.c b/drivers/ata/pata_legacy.c index 9df1ff7e1eaa..eaf194138f21 100644 --- a/drivers/ata/pata_legacy.c +++ b/drivers/ata/pata_legacy.c | |||
| @@ -44,6 +44,9 @@ | |||
| 44 | * Specific support is included for the ht6560a/ht6560b/opti82c611a/ | 44 | * Specific support is included for the ht6560a/ht6560b/opti82c611a/ |
| 45 | * opti82c465mv/promise 20230c/20630/qdi65x0/winbond83759A | 45 | * opti82c465mv/promise 20230c/20630/qdi65x0/winbond83759A |
| 46 | * | 46 | * |
| 47 | * Support for the Winbond 83759A when operating in advanced mode. | ||
| 48 | * Multichip mode is not currently supported. | ||
| 49 | * | ||
| 47 | * Use the autospeed and pio_mask options with: | 50 | * Use the autospeed and pio_mask options with: |
| 48 | * Appian ADI/2 aka CLPD7220 or AIC25VL01. | 51 | * Appian ADI/2 aka CLPD7220 or AIC25VL01. |
| 49 | * Use the jumpers, autospeed and set pio_mask to the mode on the jumpers with | 52 | * Use the jumpers, autospeed and set pio_mask to the mode on the jumpers with |
| @@ -135,12 +138,18 @@ static int ht6560b; /* HT 6560A on primary 1, second 2, both 3 */ | |||
| 135 | static int opti82c611a; /* Opti82c611A on primary 1, sec 2, both 3 */ | 138 | static int opti82c611a; /* Opti82c611A on primary 1, sec 2, both 3 */ |
| 136 | static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */ | 139 | static int opti82c46x; /* Opti 82c465MV present(pri/sec autodetect) */ |
| 137 | static int qdi; /* Set to probe QDI controllers */ | 140 | static int qdi; /* Set to probe QDI controllers */ |
| 138 | static int winbond; /* Set to probe Winbond controllers, | ||
| 139 | give I/O port if non standard */ | ||
| 140 | static int autospeed; /* Chip present which snoops speed changes */ | 141 | static int autospeed; /* Chip present which snoops speed changes */ |
| 141 | static int pio_mask = ATA_PIO4; /* PIO range for autospeed devices */ | 142 | static int pio_mask = ATA_PIO4; /* PIO range for autospeed devices */ |
| 142 | static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ | 143 | static int iordy_mask = 0xFFFFFFFF; /* Use iordy if available */ |
| 143 | 144 | ||
| 145 | #ifdef PATA_WINBOND_VLB_MODULE | ||
| 146 | static int winbond = 1; /* Set to probe Winbond controllers, | ||
| 147 | give I/O port if non standard */ | ||
| 148 | #else | ||
| 149 | static int winbond; /* Set to probe Winbond controllers, | ||
| 150 | give I/O port if non standard */ | ||
| 151 | #endif | ||
| 152 | |||
| 144 | /** | 153 | /** |
| 145 | * legacy_probe_add - Add interface to probe list | 154 | * legacy_probe_add - Add interface to probe list |
| 146 | * @port: Controller port | 155 | * @port: Controller port |
| @@ -1297,6 +1306,7 @@ MODULE_AUTHOR("Alan Cox"); | |||
| 1297 | MODULE_DESCRIPTION("low-level driver for legacy ATA"); | 1306 | MODULE_DESCRIPTION("low-level driver for legacy ATA"); |
| 1298 | MODULE_LICENSE("GPL"); | 1307 | MODULE_LICENSE("GPL"); |
| 1299 | MODULE_VERSION(DRV_VERSION); | 1308 | MODULE_VERSION(DRV_VERSION); |
| 1309 | MODULE_ALIAS("pata_winbond"); | ||
| 1300 | 1310 | ||
| 1301 | module_param(probe_all, int, 0); | 1311 | module_param(probe_all, int, 0); |
| 1302 | module_param(autospeed, int, 0); | 1312 | module_param(autospeed, int, 0); |
| @@ -1305,6 +1315,7 @@ module_param(ht6560b, int, 0); | |||
| 1305 | module_param(opti82c611a, int, 0); | 1315 | module_param(opti82c611a, int, 0); |
| 1306 | module_param(opti82c46x, int, 0); | 1316 | module_param(opti82c46x, int, 0); |
| 1307 | module_param(qdi, int, 0); | 1317 | module_param(qdi, int, 0); |
| 1318 | module_param(winbond, int, 0); | ||
| 1308 | module_param(pio_mask, int, 0); | 1319 | module_param(pio_mask, int, 0); |
| 1309 | module_param(iordy_mask, int, 0); | 1320 | module_param(iordy_mask, int, 0); |
| 1310 | 1321 | ||
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 5e659885de16..ac8d7d97e408 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
| @@ -417,6 +417,8 @@ static void via_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | |||
| 417 | tf->lbam, | 417 | tf->lbam, |
| 418 | tf->lbah); | 418 | tf->lbah); |
| 419 | } | 419 | } |
| 420 | |||
| 421 | ata_wait_idle(ap); | ||
| 420 | } | 422 | } |
| 421 | 423 | ||
| 422 | static int via_port_start(struct ata_port *ap) | 424 | static int via_port_start(struct ata_port *ap) |
diff --git a/drivers/ata/pata_winbond.c b/drivers/ata/pata_winbond.c deleted file mode 100644 index 6d8619b6f670..000000000000 --- a/drivers/ata/pata_winbond.c +++ /dev/null | |||
| @@ -1,282 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * pata_winbond.c - Winbond VLB ATA controllers | ||
| 3 | * (C) 2006 Red Hat | ||
| 4 | * | ||
| 5 | * Support for the Winbond 83759A when operating in advanced mode. | ||
| 6 | * Multichip mode is not currently supported. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <linux/kernel.h> | ||
| 10 | #include <linux/module.h> | ||
| 11 | #include <linux/init.h> | ||
| 12 | #include <linux/blkdev.h> | ||
| 13 | #include <linux/delay.h> | ||
| 14 | #include <scsi/scsi_host.h> | ||
| 15 | #include <linux/libata.h> | ||
| 16 | #include <linux/platform_device.h> | ||
| 17 | |||
| 18 | #define DRV_NAME "pata_winbond" | ||
| 19 | #define DRV_VERSION "0.0.3" | ||
| 20 | |||
| 21 | #define NR_HOST 4 /* Two winbond controllers, two channels each */ | ||
| 22 | |||
| 23 | struct winbond_data { | ||
| 24 | unsigned long config; | ||
| 25 | struct platform_device *platform_dev; | ||
| 26 | }; | ||
| 27 | |||
| 28 | static struct ata_host *winbond_host[NR_HOST]; | ||
| 29 | static struct winbond_data winbond_data[NR_HOST]; | ||
| 30 | static int nr_winbond_host; | ||
| 31 | |||
| 32 | #ifdef MODULE | ||
| 33 | static int probe_winbond = 1; | ||
| 34 | #else | ||
| 35 | static int probe_winbond; | ||
| 36 | #endif | ||
| 37 | |||
| 38 | static DEFINE_SPINLOCK(winbond_lock); | ||
| 39 | |||
| 40 | static void winbond_writecfg(unsigned long port, u8 reg, u8 val) | ||
| 41 | { | ||
| 42 | unsigned long flags; | ||
| 43 | spin_lock_irqsave(&winbond_lock, flags); | ||
| 44 | outb(reg, port + 0x01); | ||
| 45 | outb(val, port + 0x02); | ||
| 46 | spin_unlock_irqrestore(&winbond_lock, flags); | ||
| 47 | } | ||
| 48 | |||
| 49 | static u8 winbond_readcfg(unsigned long port, u8 reg) | ||
| 50 | { | ||
| 51 | u8 val; | ||
| 52 | |||
| 53 | unsigned long flags; | ||
| 54 | spin_lock_irqsave(&winbond_lock, flags); | ||
| 55 | outb(reg, port + 0x01); | ||
| 56 | val = inb(port + 0x02); | ||
| 57 | spin_unlock_irqrestore(&winbond_lock, flags); | ||
| 58 | |||
| 59 | return val; | ||
| 60 | } | ||
| 61 | |||
| 62 | static void winbond_set_piomode(struct ata_port *ap, struct ata_device *adev) | ||
| 63 | { | ||
| 64 | struct ata_timing t; | ||
| 65 | struct winbond_data *winbond = ap->host->private_data; | ||
| 66 | int active, recovery; | ||
| 67 | u8 reg; | ||
| 68 | int timing = 0x88 + (ap->port_no * 4) + (adev->devno * 2); | ||
| 69 | |||
| 70 | reg = winbond_readcfg(winbond->config, 0x81); | ||
| 71 | |||
| 72 | /* Get the timing data in cycles */ | ||
| 73 | if (reg & 0x40) /* Fast VLB bus, assume 50MHz */ | ||
| 74 | ata_timing_compute(adev, adev->pio_mode, &t, 20000, 1000); | ||
| 75 | else | ||
| 76 | ata_timing_compute(adev, adev->pio_mode, &t, 30303, 1000); | ||
| 77 | |||
| 78 | active = (clamp_val(t.active, 3, 17) - 1) & 0x0F; | ||
| 79 | recovery = (clamp_val(t.recover, 1, 15) + 1) & 0x0F; | ||
| 80 | timing = (active << 4) | recovery; | ||
| 81 | winbond_writecfg(winbond->config, timing, reg); | ||
| 82 | |||
| 83 | /* Load the setup timing */ | ||
| 84 | |||
| 85 | reg = 0x35; | ||
| 86 | if (adev->class != ATA_DEV_ATA) | ||
| 87 | reg |= 0x08; /* FIFO off */ | ||
| 88 | if (!ata_pio_need_iordy(adev)) | ||
| 89 | reg |= 0x02; /* IORDY off */ | ||
| 90 | reg |= (clamp_val(t.setup, 0, 3) << 6); | ||
| 91 | winbond_writecfg(winbond->config, timing + 1, reg); | ||
| 92 | } | ||
| 93 | |||
| 94 | |||
| 95 | static unsigned int winbond_data_xfer(struct ata_device *dev, | ||
| 96 | unsigned char *buf, unsigned int buflen, int rw) | ||
| 97 | { | ||
| 98 | struct ata_port *ap = dev->link->ap; | ||
| 99 | int slop = buflen & 3; | ||
| 100 | |||
| 101 | if (ata_id_has_dword_io(dev->id)) { | ||
| 102 | if (rw == READ) | ||
| 103 | ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); | ||
| 104 | else | ||
| 105 | iowrite32_rep(ap->ioaddr.data_addr, buf, buflen >> 2); | ||
| 106 | |||
| 107 | if (unlikely(slop)) { | ||
| 108 | __le32 pad; | ||
| 109 | if (rw == READ) { | ||
| 110 | pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr)); | ||
| 111 | memcpy(buf + buflen - slop, &pad, slop); | ||
| 112 | } else { | ||
| 113 | memcpy(&pad, buf + buflen - slop, slop); | ||
| 114 | iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr); | ||
| 115 | } | ||
| 116 | buflen += 4 - slop; | ||
| 117 | } | ||
| 118 | } else | ||
| 119 | buflen = ata_sff_data_xfer(dev, buf, buflen, rw); | ||
| 120 | |||
| 121 | return buflen; | ||
| 122 | } | ||
| 123 | |||
| 124 | static struct scsi_host_template winbond_sht = { | ||
| 125 | ATA_PIO_SHT(DRV_NAME), | ||
| 126 | }; | ||
| 127 | |||
| 128 | static struct ata_port_operations winbond_port_ops = { | ||
| 129 | .inherits = &ata_sff_port_ops, | ||
| 130 | .sff_data_xfer = winbond_data_xfer, | ||
| 131 | .cable_detect = ata_cable_40wire, | ||
| 132 | .set_piomode = winbond_set_piomode, | ||
| 133 | }; | ||
| 134 | |||
| 135 | /** | ||
| 136 | * winbond_init_one - attach a winbond interface | ||
| 137 | * @type: Type to display | ||
| 138 | * @io: I/O port start | ||
| 139 | * @irq: interrupt line | ||
| 140 | * @fast: True if on a > 33Mhz VLB | ||
| 141 | * | ||
| 142 | * Register a VLB bus IDE interface. Such interfaces are PIO and we | ||
| 143 | * assume do not support IRQ sharing. | ||
| 144 | */ | ||
| 145 | |||
| 146 | static __init int winbond_init_one(unsigned long port) | ||
| 147 | { | ||
| 148 | struct platform_device *pdev; | ||
| 149 | u8 reg; | ||
| 150 | int i, rc; | ||
| 151 | |||
| 152 | reg = winbond_readcfg(port, 0x81); | ||
| 153 | reg |= 0x80; /* jumpered mode off */ | ||
| 154 | winbond_writecfg(port, 0x81, reg); | ||
| 155 | reg = winbond_readcfg(port, 0x83); | ||
| 156 | reg |= 0xF0; /* local control */ | ||
| 157 | winbond_writecfg(port, 0x83, reg); | ||
| 158 | reg = winbond_readcfg(port, 0x85); | ||
| 159 | reg |= 0xF0; /* programmable timing */ | ||
| 160 | winbond_writecfg(port, 0x85, reg); | ||
| 161 | |||
| 162 | reg = winbond_readcfg(port, 0x81); | ||
| 163 | |||
| 164 | if (!(reg & 0x03)) /* Disabled */ | ||
| 165 | return -ENODEV; | ||
| 166 | |||
| 167 | for (i = 0; i < 2 ; i ++) { | ||
| 168 | unsigned long cmd_port = 0x1F0 - (0x80 * i); | ||
| 169 | unsigned long ctl_port = cmd_port + 0x206; | ||
| 170 | struct ata_host *host; | ||
| 171 | struct ata_port *ap; | ||
| 172 | void __iomem *cmd_addr, *ctl_addr; | ||
| 173 | |||
| 174 | if (!(reg & (1 << i))) | ||
| 175 | continue; | ||
| 176 | |||
| 177 | pdev = platform_device_register_simple(DRV_NAME, nr_winbond_host, NULL, 0); | ||
| 178 | if (IS_ERR(pdev)) | ||
| 179 | return PTR_ERR(pdev); | ||
| 180 | |||
| 181 | rc = -ENOMEM; | ||
| 182 | host = ata_host_alloc(&pdev->dev, 1); | ||
| 183 | if (!host) | ||
| 184 | goto err_unregister; | ||
| 185 | ap = host->ports[0]; | ||
| 186 | |||
| 187 | rc = -ENOMEM; | ||
| 188 | cmd_addr = devm_ioport_map(&pdev->dev, cmd_port, 8); | ||
| 189 | ctl_addr = devm_ioport_map(&pdev->dev, ctl_port, 1); | ||
| 190 | if (!cmd_addr || !ctl_addr) | ||
| 191 | goto err_unregister; | ||
| 192 | |||
| 193 | ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx", cmd_port, ctl_port); | ||
| 194 | |||
| 195 | ap->ops = &winbond_port_ops; | ||
| 196 | ap->pio_mask = ATA_PIO4; | ||
| 197 | ap->flags |= ATA_FLAG_SLAVE_POSS; | ||
| 198 | ap->ioaddr.cmd_addr = cmd_addr; | ||
| 199 | ap->ioaddr.altstatus_addr = ctl_addr; | ||
| 200 | ap->ioaddr.ctl_addr = ctl_addr; | ||
| 201 | ata_sff_std_ports(&ap->ioaddr); | ||
| 202 | |||
| 203 | /* hook in a private data structure per channel */ | ||
| 204 | host->private_data = &winbond_data[nr_winbond_host]; | ||
| 205 | winbond_data[nr_winbond_host].config = port; | ||
| 206 | winbond_data[nr_winbond_host].platform_dev = pdev; | ||
| 207 | |||
| 208 | /* activate */ | ||
| 209 | rc = ata_host_activate(host, 14 + i, ata_sff_interrupt, 0, | ||
| 210 | &winbond_sht); | ||
| 211 | if (rc) | ||
| 212 | goto err_unregister; | ||
| 213 | |||
| 214 | winbond_host[nr_winbond_host++] = dev_get_drvdata(&pdev->dev); | ||
| 215 | } | ||
| 216 | |||
| 217 | return 0; | ||
| 218 | |||
| 219 | err_unregister: | ||
| 220 | platform_device_unregister(pdev); | ||
| 221 | return rc; | ||
| 222 | } | ||
| 223 | |||
| 224 | /** | ||
| 225 | * winbond_init - attach winbond interfaces | ||
| 226 | * | ||
| 227 | * Attach winbond IDE interfaces by scanning the ports it may occupy. | ||
| 228 | */ | ||
| 229 | |||
| 230 | static __init int winbond_init(void) | ||
| 231 | { | ||
| 232 | static const unsigned long config[2] = { 0x130, 0x1B0 }; | ||
| 233 | |||
| 234 | int ct = 0; | ||
| 235 | int i; | ||
| 236 | |||
| 237 | if (probe_winbond == 0) | ||
| 238 | return -ENODEV; | ||
| 239 | |||
| 240 | /* | ||
| 241 | * Check both base addresses | ||
| 242 | */ | ||
| 243 | |||
| 244 | for (i = 0; i < 2; i++) { | ||
| 245 | if (probe_winbond & (1<<i)) { | ||
| 246 | int ret = 0; | ||
| 247 | unsigned long port = config[i]; | ||
| 248 | |||
| 249 | if (request_region(port, 2, "pata_winbond")) { | ||
| 250 | ret = winbond_init_one(port); | ||
| 251 | if (ret <= 0) | ||
| 252 | release_region(port, 2); | ||
| 253 | else ct+= ret; | ||
| 254 | } | ||
| 255 | } | ||
| 256 | } | ||
| 257 | if (ct != 0) | ||
| 258 | return 0; | ||
| 259 | return -ENODEV; | ||
| 260 | } | ||
| 261 | |||
| 262 | static __exit void winbond_exit(void) | ||
| 263 | { | ||
| 264 | int i; | ||
| 265 | |||
| 266 | for (i = 0; i < nr_winbond_host; i++) { | ||
| 267 | ata_host_detach(winbond_host[i]); | ||
| 268 | release_region(winbond_data[i].config, 2); | ||
| 269 | platform_device_unregister(winbond_data[i].platform_dev); | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 273 | MODULE_AUTHOR("Alan Cox"); | ||
| 274 | MODULE_DESCRIPTION("low-level driver for Winbond VL ATA"); | ||
| 275 | MODULE_LICENSE("GPL"); | ||
| 276 | MODULE_VERSION(DRV_VERSION); | ||
| 277 | |||
| 278 | module_init(winbond_init); | ||
| 279 | module_exit(winbond_exit); | ||
| 280 | |||
| 281 | module_param(probe_winbond, int, 0); | ||
| 282 | |||
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 2673a3d14806..6cf57c5c2b5f 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c | |||
| @@ -1459,7 +1459,7 @@ static void sata_dwc_qc_prep_by_tag(struct ata_queued_cmd *qc, u8 tag) | |||
| 1459 | { | 1459 | { |
| 1460 | struct scatterlist *sg = qc->sg; | 1460 | struct scatterlist *sg = qc->sg; |
| 1461 | struct ata_port *ap = qc->ap; | 1461 | struct ata_port *ap = qc->ap; |
| 1462 | u32 dma_chan; | 1462 | int dma_chan; |
| 1463 | struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap); | 1463 | struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap); |
| 1464 | struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap); | 1464 | struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap); |
| 1465 | int err; | 1465 | int err; |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 9463c71dd38e..a9fd9709c262 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
| @@ -1898,19 +1898,25 @@ static void mv_bmdma_start(struct ata_queued_cmd *qc) | |||
| 1898 | * LOCKING: | 1898 | * LOCKING: |
| 1899 | * Inherited from caller. | 1899 | * Inherited from caller. |
| 1900 | */ | 1900 | */ |
| 1901 | static void mv_bmdma_stop(struct ata_queued_cmd *qc) | 1901 | static void mv_bmdma_stop_ap(struct ata_port *ap) |
| 1902 | { | 1902 | { |
| 1903 | struct ata_port *ap = qc->ap; | ||
| 1904 | void __iomem *port_mmio = mv_ap_base(ap); | 1903 | void __iomem *port_mmio = mv_ap_base(ap); |
| 1905 | u32 cmd; | 1904 | u32 cmd; |
| 1906 | 1905 | ||
| 1907 | /* clear start/stop bit */ | 1906 | /* clear start/stop bit */ |
| 1908 | cmd = readl(port_mmio + BMDMA_CMD); | 1907 | cmd = readl(port_mmio + BMDMA_CMD); |
| 1909 | cmd &= ~ATA_DMA_START; | 1908 | if (cmd & ATA_DMA_START) { |
| 1910 | writelfl(cmd, port_mmio + BMDMA_CMD); | 1909 | cmd &= ~ATA_DMA_START; |
| 1910 | writelfl(cmd, port_mmio + BMDMA_CMD); | ||
| 1911 | |||
| 1912 | /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */ | ||
| 1913 | ata_sff_dma_pause(ap); | ||
| 1914 | } | ||
| 1915 | } | ||
| 1911 | 1916 | ||
| 1912 | /* one-PIO-cycle guaranteed wait, per spec, for HDMA1:0 transition */ | 1917 | static void mv_bmdma_stop(struct ata_queued_cmd *qc) |
| 1913 | ata_sff_dma_pause(ap); | 1918 | { |
| 1919 | mv_bmdma_stop_ap(qc->ap); | ||
| 1914 | } | 1920 | } |
| 1915 | 1921 | ||
| 1916 | /** | 1922 | /** |
| @@ -1934,8 +1940,21 @@ static u8 mv_bmdma_status(struct ata_port *ap) | |||
| 1934 | reg = readl(port_mmio + BMDMA_STATUS); | 1940 | reg = readl(port_mmio + BMDMA_STATUS); |
| 1935 | if (reg & ATA_DMA_ACTIVE) | 1941 | if (reg & ATA_DMA_ACTIVE) |
| 1936 | status = ATA_DMA_ACTIVE; | 1942 | status = ATA_DMA_ACTIVE; |
| 1937 | else | 1943 | else if (reg & ATA_DMA_ERR) |
| 1938 | status = (reg & ATA_DMA_ERR) | ATA_DMA_INTR; | 1944 | status = (reg & ATA_DMA_ERR) | ATA_DMA_INTR; |
| 1945 | else { | ||
| 1946 | /* | ||
| 1947 | * Just because DMA_ACTIVE is 0 (DMA completed), | ||
| 1948 | * this does _not_ mean the device is "done". | ||
| 1949 | * So we should not yet be signalling ATA_DMA_INTR | ||
| 1950 | * in some cases. Eg. DSM/TRIM, and perhaps others. | ||
| 1951 | */ | ||
| 1952 | mv_bmdma_stop_ap(ap); | ||
| 1953 | if (ioread8(ap->ioaddr.altstatus_addr) & ATA_BUSY) | ||
| 1954 | status = 0; | ||
| 1955 | else | ||
| 1956 | status = ATA_DMA_INTR; | ||
| 1957 | } | ||
| 1939 | return status; | 1958 | return status; |
| 1940 | } | 1959 | } |
| 1941 | 1960 | ||
| @@ -1995,6 +2014,9 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) | |||
| 1995 | 2014 | ||
| 1996 | switch (tf->protocol) { | 2015 | switch (tf->protocol) { |
| 1997 | case ATA_PROT_DMA: | 2016 | case ATA_PROT_DMA: |
| 2017 | if (tf->command == ATA_CMD_DSM) | ||
| 2018 | return; | ||
| 2019 | /* fall-thru */ | ||
| 1998 | case ATA_PROT_NCQ: | 2020 | case ATA_PROT_NCQ: |
| 1999 | break; /* continue below */ | 2021 | break; /* continue below */ |
| 2000 | case ATA_PROT_PIO: | 2022 | case ATA_PROT_PIO: |
| @@ -2094,6 +2116,8 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc) | |||
| 2094 | if ((tf->protocol != ATA_PROT_DMA) && | 2116 | if ((tf->protocol != ATA_PROT_DMA) && |
| 2095 | (tf->protocol != ATA_PROT_NCQ)) | 2117 | (tf->protocol != ATA_PROT_NCQ)) |
| 2096 | return; | 2118 | return; |
| 2119 | if (tf->command == ATA_CMD_DSM) | ||
| 2120 | return; /* use bmdma for this */ | ||
| 2097 | 2121 | ||
| 2098 | /* Fill in Gen IIE command request block */ | 2122 | /* Fill in Gen IIE command request block */ |
| 2099 | if (!(tf->flags & ATA_TFLAG_WRITE)) | 2123 | if (!(tf->flags & ATA_TFLAG_WRITE)) |
| @@ -2260,7 +2284,7 @@ static unsigned int mv_qc_issue_fis(struct ata_queued_cmd *qc) | |||
| 2260 | } | 2284 | } |
| 2261 | 2285 | ||
| 2262 | if (qc->tf.flags & ATA_TFLAG_POLLING) | 2286 | if (qc->tf.flags & ATA_TFLAG_POLLING) |
| 2263 | ata_sff_queue_pio_task(ap, 0); | 2287 | ata_sff_queue_pio_task(link, 0); |
| 2264 | return 0; | 2288 | return 0; |
| 2265 | } | 2289 | } |
| 2266 | 2290 | ||
| @@ -2289,6 +2313,12 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc) | |||
| 2289 | 2313 | ||
| 2290 | switch (qc->tf.protocol) { | 2314 | switch (qc->tf.protocol) { |
| 2291 | case ATA_PROT_DMA: | 2315 | case ATA_PROT_DMA: |
| 2316 | if (qc->tf.command == ATA_CMD_DSM) { | ||
| 2317 | if (!ap->ops->bmdma_setup) /* no bmdma on GEN_I */ | ||
| 2318 | return AC_ERR_OTHER; | ||
| 2319 | break; /* use bmdma for this */ | ||
| 2320 | } | ||
| 2321 | /* fall thru */ | ||
| 2292 | case ATA_PROT_NCQ: | 2322 | case ATA_PROT_NCQ: |
| 2293 | mv_start_edma(ap, port_mmio, pp, qc->tf.protocol); | 2323 | mv_start_edma(ap, port_mmio, pp, qc->tf.protocol); |
| 2294 | pp->req_idx = (pp->req_idx + 1) & MV_MAX_Q_DEPTH_MASK; | 2324 | pp->req_idx = (pp->req_idx + 1) & MV_MAX_Q_DEPTH_MASK; |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 5419a49ff135..276d5a701dc3 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -59,6 +59,7 @@ void device_pm_init(struct device *dev) | |||
| 59 | { | 59 | { |
| 60 | dev->power.status = DPM_ON; | 60 | dev->power.status = DPM_ON; |
| 61 | init_completion(&dev->power.completion); | 61 | init_completion(&dev->power.completion); |
| 62 | complete_all(&dev->power.completion); | ||
| 62 | dev->power.wakeup_count = 0; | 63 | dev->power.wakeup_count = 0; |
| 63 | pm_runtime_init(dev); | 64 | pm_runtime_init(dev); |
| 64 | } | 65 | } |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 31064df1370a..6124c2fd2d33 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
| @@ -297,6 +297,8 @@ static void enqueue_cmd_and_start_io(ctlr_info_t *h, | |||
| 297 | spin_lock_irqsave(&h->lock, flags); | 297 | spin_lock_irqsave(&h->lock, flags); |
| 298 | addQ(&h->reqQ, c); | 298 | addQ(&h->reqQ, c); |
| 299 | h->Qdepth++; | 299 | h->Qdepth++; |
| 300 | if (h->Qdepth > h->maxQsinceinit) | ||
| 301 | h->maxQsinceinit = h->Qdepth; | ||
| 300 | start_io(h); | 302 | start_io(h); |
| 301 | spin_unlock_irqrestore(&h->lock, flags); | 303 | spin_unlock_irqrestore(&h->lock, flags); |
| 302 | } | 304 | } |
| @@ -4519,6 +4521,12 @@ static __devinit int cciss_kdump_hard_reset_controller(struct pci_dev *pdev) | |||
| 4519 | misc_fw_support = readl(&cfgtable->misc_fw_support); | 4521 | misc_fw_support = readl(&cfgtable->misc_fw_support); |
| 4520 | use_doorbell = misc_fw_support & MISC_FW_DOORBELL_RESET; | 4522 | use_doorbell = misc_fw_support & MISC_FW_DOORBELL_RESET; |
| 4521 | 4523 | ||
| 4524 | /* The doorbell reset seems to cause lockups on some Smart | ||
| 4525 | * Arrays (e.g. P410, P410i, maybe others). Until this is | ||
| 4526 | * fixed or at least isolated, avoid the doorbell reset. | ||
| 4527 | */ | ||
| 4528 | use_doorbell = 0; | ||
| 4529 | |||
| 4522 | rc = cciss_controller_hard_reset(pdev, vaddr, use_doorbell); | 4530 | rc = cciss_controller_hard_reset(pdev, vaddr, use_doorbell); |
| 4523 | if (rc) | 4531 | if (rc) |
| 4524 | goto unmap_cfgtable; | 4532 | goto unmap_cfgtable; |
| @@ -4712,6 +4720,9 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
| 4712 | h->scatter_list = kmalloc(h->max_commands * | 4720 | h->scatter_list = kmalloc(h->max_commands * |
| 4713 | sizeof(struct scatterlist *), | 4721 | sizeof(struct scatterlist *), |
| 4714 | GFP_KERNEL); | 4722 | GFP_KERNEL); |
| 4723 | if (!h->scatter_list) | ||
| 4724 | goto clean4; | ||
| 4725 | |||
| 4715 | for (k = 0; k < h->nr_cmds; k++) { | 4726 | for (k = 0; k < h->nr_cmds; k++) { |
| 4716 | h->scatter_list[k] = kmalloc(sizeof(struct scatterlist) * | 4727 | h->scatter_list[k] = kmalloc(sizeof(struct scatterlist) * |
| 4717 | h->maxsgentries, | 4728 | h->maxsgentries, |
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index f3c636d23718..91797bbbe702 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c | |||
| @@ -477,7 +477,7 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio) | |||
| 477 | pos = ((loff_t) bio->bi_sector << 9) + lo->lo_offset; | 477 | pos = ((loff_t) bio->bi_sector << 9) + lo->lo_offset; |
| 478 | 478 | ||
| 479 | if (bio_rw(bio) == WRITE) { | 479 | if (bio_rw(bio) == WRITE) { |
| 480 | bool barrier = (bio->bi_rw & REQ_HARDBARRIER); | 480 | bool barrier = !!(bio->bi_rw & REQ_HARDBARRIER); |
| 481 | struct file *file = lo->lo_backing_file; | 481 | struct file *file = lo->lo_backing_file; |
| 482 | 482 | ||
| 483 | if (barrier) { | 483 | if (barrier) { |
diff --git a/drivers/block/mg_disk.c b/drivers/block/mg_disk.c index b82c5ce5e9df..76fa3deaee84 100644 --- a/drivers/block/mg_disk.c +++ b/drivers/block/mg_disk.c | |||
| @@ -974,8 +974,7 @@ static int mg_probe(struct platform_device *plat_dev) | |||
| 974 | host->breq->queuedata = host; | 974 | host->breq->queuedata = host; |
| 975 | 975 | ||
| 976 | /* mflash is random device, thanx for the noop */ | 976 | /* mflash is random device, thanx for the noop */ |
| 977 | elevator_exit(host->breq->elevator); | 977 | err = elevator_change(host->breq, "noop"); |
| 978 | err = elevator_init(host->breq, "noop"); | ||
| 979 | if (err) { | 978 | if (err) { |
| 980 | printk(KERN_ERR "%s:%d (elevator_init) fail\n", | 979 | printk(KERN_ERR "%s:%d (elevator_init) fail\n", |
| 981 | __func__, __LINE__); | 980 | __func__, __LINE__); |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index 710af89b176d..eab58db5f91c 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | #include <asm/smp.h> | 12 | #include <asm/smp.h> |
| 13 | #include "agp.h" | 13 | #include "agp.h" |
| 14 | #include "intel-agp.h" | 14 | #include "intel-agp.h" |
| 15 | #include <linux/intel-gtt.h> | ||
| 15 | 16 | ||
| 16 | #include "intel-gtt.c" | 17 | #include "intel-gtt.c" |
| 17 | 18 | ||
| @@ -815,11 +816,19 @@ static const struct intel_driver_description { | |||
| 815 | "HD Graphics", NULL, &intel_i965_driver }, | 816 | "HD Graphics", NULL, &intel_i965_driver }, |
| 816 | { PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, | 817 | { PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB, PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG, |
| 817 | "HD Graphics", NULL, &intel_i965_driver }, | 818 | "HD Graphics", NULL, &intel_i965_driver }, |
| 818 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_IG, | 819 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT1_IG, |
| 819 | "Sandybridge", NULL, &intel_gen6_driver }, | 820 | "Sandybridge", NULL, &intel_gen6_driver }, |
| 820 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_IG, | 821 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT2_IG, |
| 821 | "Sandybridge", NULL, &intel_gen6_driver }, | 822 | "Sandybridge", NULL, &intel_gen6_driver }, |
| 822 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_D0_IG, | 823 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT2_PLUS_IG, |
| 824 | "Sandybridge", NULL, &intel_gen6_driver }, | ||
| 825 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT1_IG, | ||
| 826 | "Sandybridge", NULL, &intel_gen6_driver }, | ||
| 827 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT2_IG, | ||
| 828 | "Sandybridge", NULL, &intel_gen6_driver }, | ||
| 829 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT2_PLUS_IG, | ||
| 830 | "Sandybridge", NULL, &intel_gen6_driver }, | ||
| 831 | { PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_HB, PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_IG, | ||
| 823 | "Sandybridge", NULL, &intel_gen6_driver }, | 832 | "Sandybridge", NULL, &intel_gen6_driver }, |
| 824 | { 0, 0, NULL, NULL, NULL } | 833 | { 0, 0, NULL, NULL, NULL } |
| 825 | }; | 834 | }; |
| @@ -1044,6 +1053,7 @@ static struct pci_device_id agp_intel_pci_table[] = { | |||
| 1044 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB), | 1053 | ID(PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB), |
| 1045 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB), | 1054 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB), |
| 1046 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB), | 1055 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB), |
| 1056 | ID(PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_HB), | ||
| 1047 | { } | 1057 | { } |
| 1048 | }; | 1058 | }; |
| 1049 | 1059 | ||
diff --git a/drivers/char/agp/intel-agp.h b/drivers/char/agp/intel-agp.h index 08d47532e605..ee189c74d345 100644 --- a/drivers/char/agp/intel-agp.h +++ b/drivers/char/agp/intel-agp.h | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Common Intel AGPGART and GTT definitions. | 2 | * Common Intel AGPGART and GTT definitions. |
| 3 | */ | 3 | */ |
| 4 | #ifndef _INTEL_AGP_H | ||
| 5 | #define _INTEL_AGP_H | ||
| 4 | 6 | ||
| 5 | /* Intel registers */ | 7 | /* Intel registers */ |
| 6 | #define INTEL_APSIZE 0xb4 | 8 | #define INTEL_APSIZE 0xb4 |
| @@ -200,11 +202,16 @@ | |||
| 200 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 | 202 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB 0x0062 |
| 201 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB 0x006a | 203 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB 0x006a |
| 202 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG 0x0046 | 204 | #define PCI_DEVICE_ID_INTEL_IRONLAKE_M_IG 0x0046 |
| 203 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB 0x0100 | 205 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB 0x0100 /* Desktop */ |
| 204 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_IG 0x0102 | 206 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT1_IG 0x0102 |
| 205 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB 0x0104 | 207 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT2_IG 0x0112 |
| 206 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_IG 0x0106 | 208 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_GT2_PLUS_IG 0x0122 |
| 207 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_D0_IG 0x0126 | 209 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB 0x0104 /* Mobile */ |
| 210 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT1_IG 0x0106 | ||
| 211 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT2_IG 0x0116 | ||
| 212 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_GT2_PLUS_IG 0x0126 | ||
| 213 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_HB 0x0108 /* Server */ | ||
| 214 | #define PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_IG 0x010A | ||
| 208 | 215 | ||
| 209 | /* cover 915 and 945 variants */ | 216 | /* cover 915 and 945 variants */ |
| 210 | #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \ | 217 | #define IS_I915 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_E7221_HB || \ |
| @@ -231,7 +238,8 @@ | |||
| 231 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_HB) | 238 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_HB) |
| 232 | 239 | ||
| 233 | #define IS_SNB (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || \ | 240 | #define IS_SNB (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || \ |
| 234 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) | 241 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB || \ |
| 242 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_HB) | ||
| 235 | 243 | ||
| 236 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_EAGLELAKE_HB || \ | 244 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_EAGLELAKE_HB || \ |
| 237 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ | 245 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ |
| @@ -244,3 +252,5 @@ | |||
| 244 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB || \ | 252 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB || \ |
| 245 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB || \ | 253 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB || \ |
| 246 | IS_SNB) | 254 | IS_SNB) |
| 255 | |||
| 256 | #endif | ||
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index d22ffb811bf2..75e0a3497888 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
| @@ -49,6 +49,26 @@ static struct gatt_mask intel_i810_masks[] = | |||
| 49 | .type = INTEL_AGP_CACHED_MEMORY} | 49 | .type = INTEL_AGP_CACHED_MEMORY} |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | #define INTEL_AGP_UNCACHED_MEMORY 0 | ||
| 53 | #define INTEL_AGP_CACHED_MEMORY_LLC 1 | ||
| 54 | #define INTEL_AGP_CACHED_MEMORY_LLC_GFDT 2 | ||
| 55 | #define INTEL_AGP_CACHED_MEMORY_LLC_MLC 3 | ||
| 56 | #define INTEL_AGP_CACHED_MEMORY_LLC_MLC_GFDT 4 | ||
| 57 | |||
| 58 | static struct gatt_mask intel_gen6_masks[] = | ||
| 59 | { | ||
| 60 | {.mask = I810_PTE_VALID | GEN6_PTE_UNCACHED, | ||
| 61 | .type = INTEL_AGP_UNCACHED_MEMORY }, | ||
| 62 | {.mask = I810_PTE_VALID | GEN6_PTE_LLC, | ||
| 63 | .type = INTEL_AGP_CACHED_MEMORY_LLC }, | ||
| 64 | {.mask = I810_PTE_VALID | GEN6_PTE_LLC | GEN6_PTE_GFDT, | ||
| 65 | .type = INTEL_AGP_CACHED_MEMORY_LLC_GFDT }, | ||
| 66 | {.mask = I810_PTE_VALID | GEN6_PTE_LLC_MLC, | ||
| 67 | .type = INTEL_AGP_CACHED_MEMORY_LLC_MLC }, | ||
| 68 | {.mask = I810_PTE_VALID | GEN6_PTE_LLC_MLC | GEN6_PTE_GFDT, | ||
| 69 | .type = INTEL_AGP_CACHED_MEMORY_LLC_MLC_GFDT }, | ||
| 70 | }; | ||
| 71 | |||
| 52 | static struct _intel_private { | 72 | static struct _intel_private { |
| 53 | struct pci_dev *pcidev; /* device one */ | 73 | struct pci_dev *pcidev; /* device one */ |
| 54 | u8 __iomem *registers; | 74 | u8 __iomem *registers; |
| @@ -178,13 +198,6 @@ static void intel_agp_insert_sg_entries(struct agp_memory *mem, | |||
| 178 | off_t pg_start, int mask_type) | 198 | off_t pg_start, int mask_type) |
| 179 | { | 199 | { |
| 180 | int i, j; | 200 | int i, j; |
| 181 | u32 cache_bits = 0; | ||
| 182 | |||
| 183 | if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || | ||
| 184 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) | ||
| 185 | { | ||
| 186 | cache_bits = GEN6_PTE_LLC_MLC; | ||
| 187 | } | ||
| 188 | 201 | ||
| 189 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { | 202 | for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { |
| 190 | writel(agp_bridge->driver->mask_memory(agp_bridge, | 203 | writel(agp_bridge->driver->mask_memory(agp_bridge, |
| @@ -317,6 +330,23 @@ static int intel_i830_type_to_mask_type(struct agp_bridge_data *bridge, | |||
| 317 | return 0; | 330 | return 0; |
| 318 | } | 331 | } |
| 319 | 332 | ||
| 333 | static int intel_gen6_type_to_mask_type(struct agp_bridge_data *bridge, | ||
| 334 | int type) | ||
| 335 | { | ||
| 336 | unsigned int type_mask = type & ~AGP_USER_CACHED_MEMORY_GFDT; | ||
| 337 | unsigned int gfdt = type & AGP_USER_CACHED_MEMORY_GFDT; | ||
| 338 | |||
| 339 | if (type_mask == AGP_USER_UNCACHED_MEMORY) | ||
| 340 | return INTEL_AGP_UNCACHED_MEMORY; | ||
| 341 | else if (type_mask == AGP_USER_CACHED_MEMORY_LLC_MLC) | ||
| 342 | return gfdt ? INTEL_AGP_CACHED_MEMORY_LLC_MLC_GFDT : | ||
| 343 | INTEL_AGP_CACHED_MEMORY_LLC_MLC; | ||
| 344 | else /* set 'normal'/'cached' to LLC by default */ | ||
| 345 | return gfdt ? INTEL_AGP_CACHED_MEMORY_LLC_GFDT : | ||
| 346 | INTEL_AGP_CACHED_MEMORY_LLC; | ||
| 347 | } | ||
| 348 | |||
| 349 | |||
| 320 | static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start, | 350 | static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start, |
| 321 | int type) | 351 | int type) |
| 322 | { | 352 | { |
| @@ -588,8 +618,7 @@ static void intel_i830_init_gtt_entries(void) | |||
| 588 | gtt_entries = 0; | 618 | gtt_entries = 0; |
| 589 | break; | 619 | break; |
| 590 | } | 620 | } |
| 591 | } else if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || | 621 | } else if (IS_SNB) { |
| 592 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) { | ||
| 593 | /* | 622 | /* |
| 594 | * SandyBridge has new memory control reg at 0x50.w | 623 | * SandyBridge has new memory control reg at 0x50.w |
| 595 | */ | 624 | */ |
| @@ -1068,11 +1097,11 @@ static void intel_i9xx_setup_flush(void) | |||
| 1068 | intel_i915_setup_chipset_flush(); | 1097 | intel_i915_setup_chipset_flush(); |
| 1069 | } | 1098 | } |
| 1070 | 1099 | ||
| 1071 | if (intel_private.ifp_resource.start) { | 1100 | if (intel_private.ifp_resource.start) |
| 1072 | intel_private.i9xx_flush_page = ioremap_nocache(intel_private.ifp_resource.start, PAGE_SIZE); | 1101 | intel_private.i9xx_flush_page = ioremap_nocache(intel_private.ifp_resource.start, PAGE_SIZE); |
| 1073 | if (!intel_private.i9xx_flush_page) | 1102 | if (!intel_private.i9xx_flush_page) |
| 1074 | dev_info(&intel_private.pcidev->dev, "can't ioremap flush page - no chipset flushing"); | 1103 | dev_err(&intel_private.pcidev->dev, |
| 1075 | } | 1104 | "can't ioremap flush page - no chipset flushing\n"); |
| 1076 | } | 1105 | } |
| 1077 | 1106 | ||
| 1078 | static int intel_i9xx_configure(void) | 1107 | static int intel_i9xx_configure(void) |
| @@ -1163,7 +1192,7 @@ static int intel_i915_insert_entries(struct agp_memory *mem, off_t pg_start, | |||
| 1163 | 1192 | ||
| 1164 | mask_type = agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type); | 1193 | mask_type = agp_bridge->driver->agp_type_to_mask_type(agp_bridge, type); |
| 1165 | 1194 | ||
| 1166 | if (mask_type != 0 && mask_type != AGP_PHYS_MEMORY && | 1195 | if (!IS_SNB && mask_type != 0 && mask_type != AGP_PHYS_MEMORY && |
| 1167 | mask_type != INTEL_AGP_CACHED_MEMORY) | 1196 | mask_type != INTEL_AGP_CACHED_MEMORY) |
| 1168 | goto out_err; | 1197 | goto out_err; |
| 1169 | 1198 | ||
| @@ -1333,8 +1362,8 @@ static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge, | |||
| 1333 | static unsigned long intel_gen6_mask_memory(struct agp_bridge_data *bridge, | 1362 | static unsigned long intel_gen6_mask_memory(struct agp_bridge_data *bridge, |
| 1334 | dma_addr_t addr, int type) | 1363 | dma_addr_t addr, int type) |
| 1335 | { | 1364 | { |
| 1336 | /* Shift high bits down */ | 1365 | /* gen6 has bit11-4 for physical addr bit39-32 */ |
| 1337 | addr |= (addr >> 28) & 0xff; | 1366 | addr |= (addr >> 28) & 0xff0; |
| 1338 | 1367 | ||
| 1339 | /* Type checking must be done elsewhere */ | 1368 | /* Type checking must be done elsewhere */ |
| 1340 | return addr | bridge->driver->masks[type].mask; | 1369 | return addr | bridge->driver->masks[type].mask; |
| @@ -1359,6 +1388,7 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | |||
| 1359 | break; | 1388 | break; |
| 1360 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB: | 1389 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB: |
| 1361 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB: | 1390 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB: |
| 1391 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_S_HB: | ||
| 1362 | *gtt_offset = MB(2); | 1392 | *gtt_offset = MB(2); |
| 1363 | 1393 | ||
| 1364 | pci_read_config_word(intel_private.pcidev, SNB_GMCH_CTRL, &snb_gmch_ctl); | 1394 | pci_read_config_word(intel_private.pcidev, SNB_GMCH_CTRL, &snb_gmch_ctl); |
| @@ -1563,7 +1593,7 @@ static const struct agp_bridge_driver intel_gen6_driver = { | |||
| 1563 | .fetch_size = intel_i9xx_fetch_size, | 1593 | .fetch_size = intel_i9xx_fetch_size, |
| 1564 | .cleanup = intel_i915_cleanup, | 1594 | .cleanup = intel_i915_cleanup, |
| 1565 | .mask_memory = intel_gen6_mask_memory, | 1595 | .mask_memory = intel_gen6_mask_memory, |
| 1566 | .masks = intel_i810_masks, | 1596 | .masks = intel_gen6_masks, |
| 1567 | .agp_enable = intel_i810_agp_enable, | 1597 | .agp_enable = intel_i810_agp_enable, |
| 1568 | .cache_flush = global_cache_flush, | 1598 | .cache_flush = global_cache_flush, |
| 1569 | .create_gatt_table = intel_i965_create_gatt_table, | 1599 | .create_gatt_table = intel_i965_create_gatt_table, |
| @@ -1576,7 +1606,7 @@ static const struct agp_bridge_driver intel_gen6_driver = { | |||
| 1576 | .agp_alloc_pages = agp_generic_alloc_pages, | 1606 | .agp_alloc_pages = agp_generic_alloc_pages, |
| 1577 | .agp_destroy_page = agp_generic_destroy_page, | 1607 | .agp_destroy_page = agp_generic_destroy_page, |
| 1578 | .agp_destroy_pages = agp_generic_destroy_pages, | 1608 | .agp_destroy_pages = agp_generic_destroy_pages, |
| 1579 | .agp_type_to_mask_type = intel_i830_type_to_mask_type, | 1609 | .agp_type_to_mask_type = intel_gen6_type_to_mask_type, |
| 1580 | .chipset_flush = intel_i915_chipset_flush, | 1610 | .chipset_flush = intel_i915_chipset_flush, |
| 1581 | #ifdef USE_PCI_DMA_API | 1611 | #ifdef USE_PCI_DMA_API |
| 1582 | .agp_map_page = intel_agp_map_page, | 1612 | .agp_map_page = intel_agp_map_page, |
diff --git a/drivers/char/hangcheck-timer.c b/drivers/char/hangcheck-timer.c index e0249722d25f..f953c96efc86 100644 --- a/drivers/char/hangcheck-timer.c +++ b/drivers/char/hangcheck-timer.c | |||
| @@ -159,7 +159,7 @@ static void hangcheck_fire(unsigned long data) | |||
| 159 | if (hangcheck_dump_tasks) { | 159 | if (hangcheck_dump_tasks) { |
| 160 | printk(KERN_CRIT "Hangcheck: Task state:\n"); | 160 | printk(KERN_CRIT "Hangcheck: Task state:\n"); |
| 161 | #ifdef CONFIG_MAGIC_SYSRQ | 161 | #ifdef CONFIG_MAGIC_SYSRQ |
| 162 | handle_sysrq('t', NULL); | 162 | handle_sysrq('t'); |
| 163 | #endif /* CONFIG_MAGIC_SYSRQ */ | 163 | #endif /* CONFIG_MAGIC_SYSRQ */ |
| 164 | } | 164 | } |
| 165 | if (hangcheck_reboot) { | 165 | if (hangcheck_reboot) { |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index fa27d1676ee5..3afd62e856eb 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
| @@ -651,7 +651,7 @@ int hvc_poll(struct hvc_struct *hp) | |||
| 651 | if (sysrq_pressed) | 651 | if (sysrq_pressed) |
| 652 | continue; | 652 | continue; |
| 653 | } else if (sysrq_pressed) { | 653 | } else if (sysrq_pressed) { |
| 654 | handle_sysrq(buf[i], tty); | 654 | handle_sysrq(buf[i]); |
| 655 | sysrq_pressed = 0; | 655 | sysrq_pressed = 0; |
| 656 | continue; | 656 | continue; |
| 657 | } | 657 | } |
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index 1f4b6de65a2d..a2bc885ce60a 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c | |||
| @@ -403,7 +403,7 @@ static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len) | |||
| 403 | hp->sysrq = 1; | 403 | hp->sysrq = 1; |
| 404 | continue; | 404 | continue; |
| 405 | } else if (hp->sysrq) { | 405 | } else if (hp->sysrq) { |
| 406 | handle_sysrq(c, hp->tty); | 406 | handle_sysrq(c); |
| 407 | hp->sysrq = 0; | 407 | hp->sysrq = 0; |
| 408 | continue; | 408 | continue; |
| 409 | } | 409 | } |
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index 1acdb2509511..a3f5e381e746 100644 --- a/drivers/char/hw_random/n2-drv.c +++ b/drivers/char/hw_random/n2-drv.c | |||
| @@ -387,7 +387,7 @@ static int n2rng_init_control(struct n2rng *np) | |||
| 387 | 387 | ||
| 388 | static int n2rng_data_read(struct hwrng *rng, u32 *data) | 388 | static int n2rng_data_read(struct hwrng *rng, u32 *data) |
| 389 | { | 389 | { |
| 390 | struct n2rng *np = rng->priv; | 390 | struct n2rng *np = (struct n2rng *) rng->priv; |
| 391 | unsigned long ra = __pa(&np->test_data); | 391 | unsigned long ra = __pa(&np->test_data); |
| 392 | int len; | 392 | int len; |
| 393 | 393 | ||
diff --git a/drivers/char/sysrq.c b/drivers/char/sysrq.c index 878ac0c2cc68..ef31bb81e843 100644 --- a/drivers/char/sysrq.c +++ b/drivers/char/sysrq.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
| 20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
| 21 | #include <linux/tty.h> | ||
| 22 | #include <linux/mount.h> | 21 | #include <linux/mount.h> |
| 23 | #include <linux/kdev_t.h> | 22 | #include <linux/kdev_t.h> |
| 24 | #include <linux/major.h> | 23 | #include <linux/major.h> |
| @@ -76,7 +75,7 @@ static int __init sysrq_always_enabled_setup(char *str) | |||
| 76 | __setup("sysrq_always_enabled", sysrq_always_enabled_setup); | 75 | __setup("sysrq_always_enabled", sysrq_always_enabled_setup); |
| 77 | 76 | ||
| 78 | 77 | ||
| 79 | static void sysrq_handle_loglevel(int key, struct tty_struct *tty) | 78 | static void sysrq_handle_loglevel(int key) |
| 80 | { | 79 | { |
| 81 | int i; | 80 | int i; |
| 82 | 81 | ||
| @@ -93,7 +92,7 @@ static struct sysrq_key_op sysrq_loglevel_op = { | |||
| 93 | }; | 92 | }; |
| 94 | 93 | ||
| 95 | #ifdef CONFIG_VT | 94 | #ifdef CONFIG_VT |
| 96 | static void sysrq_handle_SAK(int key, struct tty_struct *tty) | 95 | static void sysrq_handle_SAK(int key) |
| 97 | { | 96 | { |
| 98 | struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work; | 97 | struct work_struct *SAK_work = &vc_cons[fg_console].SAK_work; |
| 99 | schedule_work(SAK_work); | 98 | schedule_work(SAK_work); |
| @@ -109,7 +108,7 @@ static struct sysrq_key_op sysrq_SAK_op = { | |||
| 109 | #endif | 108 | #endif |
| 110 | 109 | ||
| 111 | #ifdef CONFIG_VT | 110 | #ifdef CONFIG_VT |
| 112 | static void sysrq_handle_unraw(int key, struct tty_struct *tty) | 111 | static void sysrq_handle_unraw(int key) |
| 113 | { | 112 | { |
| 114 | struct kbd_struct *kbd = &kbd_table[fg_console]; | 113 | struct kbd_struct *kbd = &kbd_table[fg_console]; |
| 115 | 114 | ||
| @@ -126,7 +125,7 @@ static struct sysrq_key_op sysrq_unraw_op = { | |||
| 126 | #define sysrq_unraw_op (*(struct sysrq_key_op *)NULL) | 125 | #define sysrq_unraw_op (*(struct sysrq_key_op *)NULL) |
| 127 | #endif /* CONFIG_VT */ | 126 | #endif /* CONFIG_VT */ |
| 128 | 127 | ||
| 129 | static void sysrq_handle_crash(int key, struct tty_struct *tty) | 128 | static void sysrq_handle_crash(int key) |
| 130 | { | 129 | { |
| 131 | char *killer = NULL; | 130 | char *killer = NULL; |
| 132 | 131 | ||
| @@ -141,7 +140,7 @@ static struct sysrq_key_op sysrq_crash_op = { | |||
| 141 | .enable_mask = SYSRQ_ENABLE_DUMP, | 140 | .enable_mask = SYSRQ_ENABLE_DUMP, |
| 142 | }; | 141 | }; |
| 143 | 142 | ||
| 144 | static void sysrq_handle_reboot(int key, struct tty_struct *tty) | 143 | static void sysrq_handle_reboot(int key) |
| 145 | { | 144 | { |
| 146 | lockdep_off(); | 145 | lockdep_off(); |
| 147 | local_irq_enable(); | 146 | local_irq_enable(); |
| @@ -154,7 +153,7 @@ static struct sysrq_key_op sysrq_reboot_op = { | |||
| 154 | .enable_mask = SYSRQ_ENABLE_BOOT, | 153 | .enable_mask = SYSRQ_ENABLE_BOOT, |
| 155 | }; | 154 | }; |
| 156 | 155 | ||
| 157 | static void sysrq_handle_sync(int key, struct tty_struct *tty) | 156 | static void sysrq_handle_sync(int key) |
| 158 | { | 157 | { |
| 159 | emergency_sync(); | 158 | emergency_sync(); |
| 160 | } | 159 | } |
| @@ -165,7 +164,7 @@ static struct sysrq_key_op sysrq_sync_op = { | |||
| 165 | .enable_mask = SYSRQ_ENABLE_SYNC, | 164 | .enable_mask = SYSRQ_ENABLE_SYNC, |
| 166 | }; | 165 | }; |
| 167 | 166 | ||
| 168 | static void sysrq_handle_show_timers(int key, struct tty_struct *tty) | 167 | static void sysrq_handle_show_timers(int key) |
| 169 | { | 168 | { |
| 170 | sysrq_timer_list_show(); | 169 | sysrq_timer_list_show(); |
| 171 | } | 170 | } |
| @@ -176,7 +175,7 @@ static struct sysrq_key_op sysrq_show_timers_op = { | |||
| 176 | .action_msg = "Show clockevent devices & pending hrtimers (no others)", | 175 | .action_msg = "Show clockevent devices & pending hrtimers (no others)", |
| 177 | }; | 176 | }; |
| 178 | 177 | ||
| 179 | static void sysrq_handle_mountro(int key, struct tty_struct *tty) | 178 | static void sysrq_handle_mountro(int key) |
| 180 | { | 179 | { |
| 181 | emergency_remount(); | 180 | emergency_remount(); |
| 182 | } | 181 | } |
| @@ -188,7 +187,7 @@ static struct sysrq_key_op sysrq_mountro_op = { | |||
| 188 | }; | 187 | }; |
| 189 | 188 | ||
| 190 | #ifdef CONFIG_LOCKDEP | 189 | #ifdef CONFIG_LOCKDEP |
| 191 | static void sysrq_handle_showlocks(int key, struct tty_struct *tty) | 190 | static void sysrq_handle_showlocks(int key) |
| 192 | { | 191 | { |
| 193 | debug_show_all_locks(); | 192 | debug_show_all_locks(); |
| 194 | } | 193 | } |
| @@ -226,7 +225,7 @@ static void sysrq_showregs_othercpus(struct work_struct *dummy) | |||
| 226 | 225 | ||
| 227 | static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus); | 226 | static DECLARE_WORK(sysrq_showallcpus, sysrq_showregs_othercpus); |
| 228 | 227 | ||
| 229 | static void sysrq_handle_showallcpus(int key, struct tty_struct *tty) | 228 | static void sysrq_handle_showallcpus(int key) |
| 230 | { | 229 | { |
| 231 | /* | 230 | /* |
| 232 | * Fall back to the workqueue based printing if the | 231 | * Fall back to the workqueue based printing if the |
| @@ -252,7 +251,7 @@ static struct sysrq_key_op sysrq_showallcpus_op = { | |||
| 252 | }; | 251 | }; |
| 253 | #endif | 252 | #endif |
| 254 | 253 | ||
| 255 | static void sysrq_handle_showregs(int key, struct tty_struct *tty) | 254 | static void sysrq_handle_showregs(int key) |
| 256 | { | 255 | { |
| 257 | struct pt_regs *regs = get_irq_regs(); | 256 | struct pt_regs *regs = get_irq_regs(); |
| 258 | if (regs) | 257 | if (regs) |
| @@ -266,7 +265,7 @@ static struct sysrq_key_op sysrq_showregs_op = { | |||
| 266 | .enable_mask = SYSRQ_ENABLE_DUMP, | 265 | .enable_mask = SYSRQ_ENABLE_DUMP, |
| 267 | }; | 266 | }; |
| 268 | 267 | ||
| 269 | static void sysrq_handle_showstate(int key, struct tty_struct *tty) | 268 | static void sysrq_handle_showstate(int key) |
| 270 | { | 269 | { |
| 271 | show_state(); | 270 | show_state(); |
| 272 | } | 271 | } |
| @@ -277,7 +276,7 @@ static struct sysrq_key_op sysrq_showstate_op = { | |||
| 277 | .enable_mask = SYSRQ_ENABLE_DUMP, | 276 | .enable_mask = SYSRQ_ENABLE_DUMP, |
| 278 | }; | 277 | }; |
| 279 | 278 | ||
| 280 | static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) | 279 | static void sysrq_handle_showstate_blocked(int key) |
| 281 | { | 280 | { |
| 282 | show_state_filter(TASK_UNINTERRUPTIBLE); | 281 | show_state_filter(TASK_UNINTERRUPTIBLE); |
| 283 | } | 282 | } |
| @@ -291,7 +290,7 @@ static struct sysrq_key_op sysrq_showstate_blocked_op = { | |||
| 291 | #ifdef CONFIG_TRACING | 290 | #ifdef CONFIG_TRACING |
| 292 | #include <linux/ftrace.h> | 291 | #include <linux/ftrace.h> |
| 293 | 292 | ||
| 294 | static void sysrq_ftrace_dump(int key, struct tty_struct *tty) | 293 | static void sysrq_ftrace_dump(int key) |
| 295 | { | 294 | { |
| 296 | ftrace_dump(DUMP_ALL); | 295 | ftrace_dump(DUMP_ALL); |
| 297 | } | 296 | } |
| @@ -305,7 +304,7 @@ static struct sysrq_key_op sysrq_ftrace_dump_op = { | |||
| 305 | #define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL) | 304 | #define sysrq_ftrace_dump_op (*(struct sysrq_key_op *)NULL) |
| 306 | #endif | 305 | #endif |
| 307 | 306 | ||
| 308 | static void sysrq_handle_showmem(int key, struct tty_struct *tty) | 307 | static void sysrq_handle_showmem(int key) |
| 309 | { | 308 | { |
| 310 | show_mem(); | 309 | show_mem(); |
| 311 | } | 310 | } |
| @@ -330,7 +329,7 @@ static void send_sig_all(int sig) | |||
| 330 | } | 329 | } |
| 331 | } | 330 | } |
| 332 | 331 | ||
| 333 | static void sysrq_handle_term(int key, struct tty_struct *tty) | 332 | static void sysrq_handle_term(int key) |
| 334 | { | 333 | { |
| 335 | send_sig_all(SIGTERM); | 334 | send_sig_all(SIGTERM); |
| 336 | console_loglevel = 8; | 335 | console_loglevel = 8; |
| @@ -349,7 +348,7 @@ static void moom_callback(struct work_struct *ignored) | |||
| 349 | 348 | ||
| 350 | static DECLARE_WORK(moom_work, moom_callback); | 349 | static DECLARE_WORK(moom_work, moom_callback); |
| 351 | 350 | ||
| 352 | static void sysrq_handle_moom(int key, struct tty_struct *tty) | 351 | static void sysrq_handle_moom(int key) |
| 353 | { | 352 | { |
| 354 | schedule_work(&moom_work); | 353 | schedule_work(&moom_work); |
| 355 | } | 354 | } |
| @@ -361,7 +360,7 @@ static struct sysrq_key_op sysrq_moom_op = { | |||
| 361 | }; | 360 | }; |
| 362 | 361 | ||
| 363 | #ifdef CONFIG_BLOCK | 362 | #ifdef CONFIG_BLOCK |
| 364 | static void sysrq_handle_thaw(int key, struct tty_struct *tty) | 363 | static void sysrq_handle_thaw(int key) |
| 365 | { | 364 | { |
| 366 | emergency_thaw_all(); | 365 | emergency_thaw_all(); |
| 367 | } | 366 | } |
| @@ -373,7 +372,7 @@ static struct sysrq_key_op sysrq_thaw_op = { | |||
| 373 | }; | 372 | }; |
| 374 | #endif | 373 | #endif |
| 375 | 374 | ||
| 376 | static void sysrq_handle_kill(int key, struct tty_struct *tty) | 375 | static void sysrq_handle_kill(int key) |
| 377 | { | 376 | { |
| 378 | send_sig_all(SIGKILL); | 377 | send_sig_all(SIGKILL); |
| 379 | console_loglevel = 8; | 378 | console_loglevel = 8; |
| @@ -385,7 +384,7 @@ static struct sysrq_key_op sysrq_kill_op = { | |||
| 385 | .enable_mask = SYSRQ_ENABLE_SIGNAL, | 384 | .enable_mask = SYSRQ_ENABLE_SIGNAL, |
| 386 | }; | 385 | }; |
| 387 | 386 | ||
| 388 | static void sysrq_handle_unrt(int key, struct tty_struct *tty) | 387 | static void sysrq_handle_unrt(int key) |
| 389 | { | 388 | { |
| 390 | normalize_rt_tasks(); | 389 | normalize_rt_tasks(); |
| 391 | } | 390 | } |
| @@ -493,7 +492,7 @@ static void __sysrq_put_key_op(int key, struct sysrq_key_op *op_p) | |||
| 493 | sysrq_key_table[i] = op_p; | 492 | sysrq_key_table[i] = op_p; |
| 494 | } | 493 | } |
| 495 | 494 | ||
| 496 | void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | 495 | void __handle_sysrq(int key, bool check_mask) |
| 497 | { | 496 | { |
| 498 | struct sysrq_key_op *op_p; | 497 | struct sysrq_key_op *op_p; |
| 499 | int orig_log_level; | 498 | int orig_log_level; |
| @@ -520,7 +519,7 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | |||
| 520 | if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { | 519 | if (!check_mask || sysrq_on_mask(op_p->enable_mask)) { |
| 521 | printk("%s\n", op_p->action_msg); | 520 | printk("%s\n", op_p->action_msg); |
| 522 | console_loglevel = orig_log_level; | 521 | console_loglevel = orig_log_level; |
| 523 | op_p->handler(key, tty); | 522 | op_p->handler(key); |
| 524 | } else { | 523 | } else { |
| 525 | printk("This sysrq operation is disabled.\n"); | 524 | printk("This sysrq operation is disabled.\n"); |
| 526 | } | 525 | } |
| @@ -545,10 +544,10 @@ void __handle_sysrq(int key, struct tty_struct *tty, int check_mask) | |||
| 545 | spin_unlock_irqrestore(&sysrq_key_table_lock, flags); | 544 | spin_unlock_irqrestore(&sysrq_key_table_lock, flags); |
| 546 | } | 545 | } |
| 547 | 546 | ||
| 548 | void handle_sysrq(int key, struct tty_struct *tty) | 547 | void handle_sysrq(int key) |
| 549 | { | 548 | { |
| 550 | if (sysrq_on()) | 549 | if (sysrq_on()) |
| 551 | __handle_sysrq(key, tty, 1); | 550 | __handle_sysrq(key, true); |
| 552 | } | 551 | } |
| 553 | EXPORT_SYMBOL(handle_sysrq); | 552 | EXPORT_SYMBOL(handle_sysrq); |
| 554 | 553 | ||
| @@ -597,7 +596,7 @@ static bool sysrq_filter(struct input_handle *handle, unsigned int type, | |||
| 597 | 596 | ||
| 598 | default: | 597 | default: |
| 599 | if (sysrq_down && value && value != 2) | 598 | if (sysrq_down && value && value != 2) |
| 600 | __handle_sysrq(sysrq_xlate[code], NULL, 1); | 599 | __handle_sysrq(sysrq_xlate[code], true); |
| 601 | break; | 600 | break; |
| 602 | } | 601 | } |
| 603 | 602 | ||
| @@ -765,7 +764,7 @@ static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf, | |||
| 765 | 764 | ||
| 766 | if (get_user(c, buf)) | 765 | if (get_user(c, buf)) |
| 767 | return -EFAULT; | 766 | return -EFAULT; |
| 768 | __handle_sysrq(c, NULL, 0); | 767 | __handle_sysrq(c, false); |
| 769 | } | 768 | } |
| 770 | 769 | ||
| 771 | return count; | 770 | return count; |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 949067a0bd47..613c852ee0fe 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
| @@ -355,7 +355,7 @@ struct tty_driver *tty_find_polling_driver(char *name, int *line) | |||
| 355 | if (*stp == '\0') | 355 | if (*stp == '\0') |
| 356 | stp = NULL; | 356 | stp = NULL; |
| 357 | 357 | ||
| 358 | if (tty_line >= 0 && tty_line <= p->num && p->ops && | 358 | if (tty_line >= 0 && tty_line < p->num && p->ops && |
| 359 | p->ops->poll_init && !p->ops->poll_init(p, tty_line, stp)) { | 359 | p->ops->poll_init && !p->ops->poll_init(p, tty_line, stp)) { |
| 360 | res = tty_driver_kref_get(p); | 360 | res = tty_driver_kref_get(p); |
| 361 | *line = tty_line; | 361 | *line = tty_line; |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 50590c7f2c01..281aada7b4a1 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
| @@ -906,22 +906,16 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, | |||
| 906 | * bottom of buffer | 906 | * bottom of buffer |
| 907 | */ | 907 | */ |
| 908 | old_origin += (old_rows - new_rows) * old_row_size; | 908 | old_origin += (old_rows - new_rows) * old_row_size; |
| 909 | end = vc->vc_scr_end; | ||
| 910 | } else { | 909 | } else { |
| 911 | /* | 910 | /* |
| 912 | * Cursor is in no man's land, copy 1/2 screenful | 911 | * Cursor is in no man's land, copy 1/2 screenful |
| 913 | * from the top and bottom of cursor position | 912 | * from the top and bottom of cursor position |
| 914 | */ | 913 | */ |
| 915 | old_origin += (vc->vc_y - new_rows/2) * old_row_size; | 914 | old_origin += (vc->vc_y - new_rows/2) * old_row_size; |
| 916 | end = old_origin + (old_row_size * new_rows); | ||
| 917 | } | 915 | } |
| 918 | } else | 916 | } |
| 919 | /* | 917 | |
| 920 | * Cursor near the top, copy contents from the top of buffer | 918 | end = old_origin + old_row_size * min(old_rows, new_rows); |
| 921 | */ | ||
| 922 | end = (old_rows > new_rows) ? old_origin + | ||
| 923 | (old_row_size * new_rows) : | ||
| 924 | vc->vc_scr_end; | ||
| 925 | 919 | ||
| 926 | update_attr(vc); | 920 | update_attr(vc); |
| 927 | 921 | ||
| @@ -3075,8 +3069,7 @@ static int bind_con_driver(const struct consw *csw, int first, int last, | |||
| 3075 | 3069 | ||
| 3076 | old_was_color = vc->vc_can_do_color; | 3070 | old_was_color = vc->vc_can_do_color; |
| 3077 | vc->vc_sw->con_deinit(vc); | 3071 | vc->vc_sw->con_deinit(vc); |
| 3078 | if (!vc->vc_origin) | 3072 | vc->vc_origin = (unsigned long)vc->vc_screenbuf; |
| 3079 | vc->vc_origin = (unsigned long)vc->vc_screenbuf; | ||
| 3080 | visual_init(vc, i, 0); | 3073 | visual_init(vc, i, 0); |
| 3081 | set_origin(vc); | 3074 | set_origin(vc); |
| 3082 | update_attr(vc); | 3075 | update_attr(vc); |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 2bbeaaea46e9..38df8c19e74c 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
| @@ -533,11 +533,14 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 533 | case KIOCSOUND: | 533 | case KIOCSOUND: |
| 534 | if (!perm) | 534 | if (!perm) |
| 535 | goto eperm; | 535 | goto eperm; |
| 536 | /* FIXME: This is an old broken API but we need to keep it | 536 | /* |
| 537 | supported and somehow separate the historic advertised | 537 | * The use of PIT_TICK_RATE is historic, it used to be |
| 538 | tick rate from any real one */ | 538 | * the platform-dependent CLOCK_TICK_RATE between 2.6.12 |
| 539 | * and 2.6.36, which was a minor but unfortunate ABI | ||
| 540 | * change. | ||
| 541 | */ | ||
| 539 | if (arg) | 542 | if (arg) |
| 540 | arg = CLOCK_TICK_RATE / arg; | 543 | arg = PIT_TICK_RATE / arg; |
| 541 | kd_mksound(arg, 0); | 544 | kd_mksound(arg, 0); |
| 542 | break; | 545 | break; |
| 543 | 546 | ||
| @@ -553,11 +556,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
| 553 | */ | 556 | */ |
| 554 | ticks = HZ * ((arg >> 16) & 0xffff) / 1000; | 557 | ticks = HZ * ((arg >> 16) & 0xffff) / 1000; |
| 555 | count = ticks ? (arg & 0xffff) : 0; | 558 | count = ticks ? (arg & 0xffff) : 0; |
| 556 | /* FIXME: This is an old broken API but we need to keep it | ||
| 557 | supported and somehow separate the historic advertised | ||
| 558 | tick rate from any real one */ | ||
| 559 | if (count) | 559 | if (count) |
| 560 | count = CLOCK_TICK_RATE / count; | 560 | count = PIT_TICK_RATE / count; |
| 561 | kd_mksound(count, ticks); | 561 | kd_mksound(count, ticks); |
| 562 | break; | 562 | break; |
| 563 | } | 563 | } |
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 670239ab7511..e7d5d6b5dcf6 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
| @@ -2071,16 +2071,6 @@ static inline void __amd64_decode_bus_error(struct mem_ctl_info *mci, | |||
| 2071 | amd64_handle_ce(mci, info); | 2071 | amd64_handle_ce(mci, info); |
| 2072 | else if (ecc_type == 1) | 2072 | else if (ecc_type == 1) |
| 2073 | amd64_handle_ue(mci, info); | 2073 | amd64_handle_ue(mci, info); |
| 2074 | |||
| 2075 | /* | ||
| 2076 | * If main error is CE then overflow must be CE. If main error is UE | ||
| 2077 | * then overflow is unknown. We'll call the overflow a CE - if | ||
| 2078 | * panic_on_ue is set then we're already panic'ed and won't arrive | ||
| 2079 | * here. Else, then apparently someone doesn't think that UE's are | ||
| 2080 | * catastrophic. | ||
| 2081 | */ | ||
| 2082 | if (info->nbsh & K8_NBSH_OVERFLOW) | ||
| 2083 | edac_mc_handle_ce_no_info(mci, EDAC_MOD_STR " Error Overflow"); | ||
| 2084 | } | 2074 | } |
| 2085 | 2075 | ||
| 2086 | void amd64_decode_bus_error(int node_id, struct err_regs *regs) | 2076 | void amd64_decode_bus_error(int node_id, struct err_regs *regs) |
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index bae9351e9473..9014df6f605d 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c | |||
| @@ -365,11 +365,10 @@ static int amd_decode_mce(struct notifier_block *nb, unsigned long val, | |||
| 365 | 365 | ||
| 366 | pr_emerg("MC%d_STATUS: ", m->bank); | 366 | pr_emerg("MC%d_STATUS: ", m->bank); |
| 367 | 367 | ||
| 368 | pr_cont("%sorrected error, report: %s, MiscV: %svalid, " | 368 | pr_cont("%sorrected error, other errors lost: %s, " |
| 369 | "CPU context corrupt: %s", | 369 | "CPU context corrupt: %s", |
| 370 | ((m->status & MCI_STATUS_UC) ? "Unc" : "C"), | 370 | ((m->status & MCI_STATUS_UC) ? "Unc" : "C"), |
| 371 | ((m->status & MCI_STATUS_EN) ? "yes" : "no"), | 371 | ((m->status & MCI_STATUS_OVER) ? "yes" : "no"), |
| 372 | ((m->status & MCI_STATUS_MISCV) ? "" : "in"), | ||
| 373 | ((m->status & MCI_STATUS_PCC) ? "yes" : "no")); | 372 | ((m->status & MCI_STATUS_PCC) ? "yes" : "no")); |
| 374 | 373 | ||
| 375 | /* do the two bits[14:13] together */ | 374 | /* do the two bits[14:13] together */ |
| @@ -426,11 +425,15 @@ static struct notifier_block amd_mce_dec_nb = { | |||
| 426 | static int __init mce_amd_init(void) | 425 | static int __init mce_amd_init(void) |
| 427 | { | 426 | { |
| 428 | /* | 427 | /* |
| 429 | * We can decode MCEs for Opteron and later CPUs: | 428 | * We can decode MCEs for K8, F10h and F11h CPUs: |
| 430 | */ | 429 | */ |
| 431 | if ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && | 430 | if (boot_cpu_data.x86_vendor != X86_VENDOR_AMD) |
| 432 | (boot_cpu_data.x86 >= 0xf)) | 431 | return 0; |
| 433 | atomic_notifier_chain_register(&x86_mce_decoder_chain, &amd_mce_dec_nb); | 432 | |
| 433 | if (boot_cpu_data.x86 < 0xf || boot_cpu_data.x86 > 0x11) | ||
| 434 | return 0; | ||
| 435 | |||
| 436 | atomic_notifier_chain_register(&x86_mce_decoder_chain, &amd_mce_dec_nb); | ||
| 434 | 437 | ||
| 435 | return 0; | 438 | return 0; |
| 436 | } | 439 | } |
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c index ca7ca56661e0..b42a0bde8494 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c | |||
| @@ -81,6 +81,10 @@ static int close_transaction(struct fw_transaction *transaction, | |||
| 81 | spin_lock_irqsave(&card->lock, flags); | 81 | spin_lock_irqsave(&card->lock, flags); |
| 82 | list_for_each_entry(t, &card->transaction_list, link) { | 82 | list_for_each_entry(t, &card->transaction_list, link) { |
| 83 | if (t == transaction) { | 83 | if (t == transaction) { |
| 84 | if (!del_timer(&t->split_timeout_timer)) { | ||
| 85 | spin_unlock_irqrestore(&card->lock, flags); | ||
| 86 | goto timed_out; | ||
| 87 | } | ||
| 84 | list_del_init(&t->link); | 88 | list_del_init(&t->link); |
| 85 | card->tlabel_mask &= ~(1ULL << t->tlabel); | 89 | card->tlabel_mask &= ~(1ULL << t->tlabel); |
| 86 | break; | 90 | break; |
| @@ -89,11 +93,11 @@ static int close_transaction(struct fw_transaction *transaction, | |||
| 89 | spin_unlock_irqrestore(&card->lock, flags); | 93 | spin_unlock_irqrestore(&card->lock, flags); |
| 90 | 94 | ||
| 91 | if (&t->link != &card->transaction_list) { | 95 | if (&t->link != &card->transaction_list) { |
| 92 | del_timer_sync(&t->split_timeout_timer); | ||
| 93 | t->callback(card, rcode, NULL, 0, t->callback_data); | 96 | t->callback(card, rcode, NULL, 0, t->callback_data); |
| 94 | return 0; | 97 | return 0; |
| 95 | } | 98 | } |
| 96 | 99 | ||
| 100 | timed_out: | ||
| 97 | return -ENOENT; | 101 | return -ENOENT; |
| 98 | } | 102 | } |
| 99 | 103 | ||
| @@ -921,6 +925,10 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) | |||
| 921 | spin_lock_irqsave(&card->lock, flags); | 925 | spin_lock_irqsave(&card->lock, flags); |
| 922 | list_for_each_entry(t, &card->transaction_list, link) { | 926 | list_for_each_entry(t, &card->transaction_list, link) { |
| 923 | if (t->node_id == source && t->tlabel == tlabel) { | 927 | if (t->node_id == source && t->tlabel == tlabel) { |
| 928 | if (!del_timer(&t->split_timeout_timer)) { | ||
| 929 | spin_unlock_irqrestore(&card->lock, flags); | ||
| 930 | goto timed_out; | ||
| 931 | } | ||
| 924 | list_del_init(&t->link); | 932 | list_del_init(&t->link); |
| 925 | card->tlabel_mask &= ~(1ULL << t->tlabel); | 933 | card->tlabel_mask &= ~(1ULL << t->tlabel); |
| 926 | break; | 934 | break; |
| @@ -929,6 +937,7 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) | |||
| 929 | spin_unlock_irqrestore(&card->lock, flags); | 937 | spin_unlock_irqrestore(&card->lock, flags); |
| 930 | 938 | ||
| 931 | if (&t->link == &card->transaction_list) { | 939 | if (&t->link == &card->transaction_list) { |
| 940 | timed_out: | ||
| 932 | fw_notify("Unsolicited response (source %x, tlabel %x)\n", | 941 | fw_notify("Unsolicited response (source %x, tlabel %x)\n", |
| 933 | source, tlabel); | 942 | source, tlabel); |
| 934 | return; | 943 | return; |
| @@ -963,8 +972,6 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) | |||
| 963 | break; | 972 | break; |
| 964 | } | 973 | } |
| 965 | 974 | ||
| 966 | del_timer_sync(&t->split_timeout_timer); | ||
| 967 | |||
| 968 | /* | 975 | /* |
| 969 | * The response handler may be executed while the request handler | 976 | * The response handler may be executed while the request handler |
| 970 | * is still pending. Cancel the request handler. | 977 | * is still pending. Cancel the request handler. |
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c index da17d409a244..33f8421c71cc 100644 --- a/drivers/firewire/net.c +++ b/drivers/firewire/net.c | |||
| @@ -579,7 +579,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
| 579 | if (!peer) { | 579 | if (!peer) { |
| 580 | fw_notify("No peer for ARP packet from %016llx\n", | 580 | fw_notify("No peer for ARP packet from %016llx\n", |
| 581 | (unsigned long long)peer_guid); | 581 | (unsigned long long)peer_guid); |
| 582 | goto failed_proto; | 582 | goto no_peer; |
| 583 | } | 583 | } |
| 584 | 584 | ||
| 585 | /* | 585 | /* |
| @@ -656,7 +656,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
| 656 | 656 | ||
| 657 | return 0; | 657 | return 0; |
| 658 | 658 | ||
| 659 | failed_proto: | 659 | no_peer: |
| 660 | net->stats.rx_errors++; | 660 | net->stats.rx_errors++; |
| 661 | net->stats.rx_dropped++; | 661 | net->stats.rx_dropped++; |
| 662 | 662 | ||
| @@ -664,7 +664,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, | |||
| 664 | if (netif_queue_stopped(net)) | 664 | if (netif_queue_stopped(net)) |
| 665 | netif_wake_queue(net); | 665 | netif_wake_queue(net); |
| 666 | 666 | ||
| 667 | return 0; | 667 | return -ENOENT; |
| 668 | } | 668 | } |
| 669 | 669 | ||
| 670 | static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | 670 | static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, |
| @@ -701,7 +701,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
| 701 | fw_error("out of memory\n"); | 701 | fw_error("out of memory\n"); |
| 702 | net->stats.rx_dropped++; | 702 | net->stats.rx_dropped++; |
| 703 | 703 | ||
| 704 | return -1; | 704 | return -ENOMEM; |
| 705 | } | 705 | } |
| 706 | skb_reserve(skb, (net->hard_header_len + 15) & ~15); | 706 | skb_reserve(skb, (net->hard_header_len + 15) & ~15); |
| 707 | memcpy(skb_put(skb, len), buf, len); | 707 | memcpy(skb_put(skb, len), buf, len); |
| @@ -726,8 +726,10 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
| 726 | spin_lock_irqsave(&dev->lock, flags); | 726 | spin_lock_irqsave(&dev->lock, flags); |
| 727 | 727 | ||
| 728 | peer = fwnet_peer_find_by_node_id(dev, source_node_id, generation); | 728 | peer = fwnet_peer_find_by_node_id(dev, source_node_id, generation); |
| 729 | if (!peer) | 729 | if (!peer) { |
| 730 | goto bad_proto; | 730 | retval = -ENOENT; |
| 731 | goto fail; | ||
| 732 | } | ||
| 731 | 733 | ||
| 732 | pd = fwnet_pd_find(peer, datagram_label); | 734 | pd = fwnet_pd_find(peer, datagram_label); |
| 733 | if (pd == NULL) { | 735 | if (pd == NULL) { |
| @@ -741,7 +743,7 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
| 741 | dg_size, buf, fg_off, len); | 743 | dg_size, buf, fg_off, len); |
| 742 | if (pd == NULL) { | 744 | if (pd == NULL) { |
| 743 | retval = -ENOMEM; | 745 | retval = -ENOMEM; |
| 744 | goto bad_proto; | 746 | goto fail; |
| 745 | } | 747 | } |
| 746 | peer->pdg_size++; | 748 | peer->pdg_size++; |
| 747 | } else { | 749 | } else { |
| @@ -755,9 +757,9 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
| 755 | pd = fwnet_pd_new(net, peer, datagram_label, | 757 | pd = fwnet_pd_new(net, peer, datagram_label, |
| 756 | dg_size, buf, fg_off, len); | 758 | dg_size, buf, fg_off, len); |
| 757 | if (pd == NULL) { | 759 | if (pd == NULL) { |
| 758 | retval = -ENOMEM; | ||
| 759 | peer->pdg_size--; | 760 | peer->pdg_size--; |
| 760 | goto bad_proto; | 761 | retval = -ENOMEM; |
| 762 | goto fail; | ||
| 761 | } | 763 | } |
| 762 | } else { | 764 | } else { |
| 763 | if (!fwnet_pd_update(peer, pd, buf, fg_off, len)) { | 765 | if (!fwnet_pd_update(peer, pd, buf, fg_off, len)) { |
| @@ -768,7 +770,8 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
| 768 | */ | 770 | */ |
| 769 | fwnet_pd_delete(pd); | 771 | fwnet_pd_delete(pd); |
| 770 | peer->pdg_size--; | 772 | peer->pdg_size--; |
| 771 | goto bad_proto; | 773 | retval = -ENOMEM; |
| 774 | goto fail; | ||
| 772 | } | 775 | } |
| 773 | } | 776 | } |
| 774 | } /* new datagram or add to existing one */ | 777 | } /* new datagram or add to existing one */ |
| @@ -794,14 +797,13 @@ static int fwnet_incoming_packet(struct fwnet_device *dev, __be32 *buf, int len, | |||
| 794 | spin_unlock_irqrestore(&dev->lock, flags); | 797 | spin_unlock_irqrestore(&dev->lock, flags); |
| 795 | 798 | ||
| 796 | return 0; | 799 | return 0; |
| 797 | 800 | fail: | |
| 798 | bad_proto: | ||
| 799 | spin_unlock_irqrestore(&dev->lock, flags); | 801 | spin_unlock_irqrestore(&dev->lock, flags); |
| 800 | 802 | ||
| 801 | if (netif_queue_stopped(net)) | 803 | if (netif_queue_stopped(net)) |
| 802 | netif_wake_queue(net); | 804 | netif_wake_queue(net); |
| 803 | 805 | ||
| 804 | return 0; | 806 | return retval; |
| 805 | } | 807 | } |
| 806 | 808 | ||
| 807 | static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r, | 809 | static void fwnet_receive_packet(struct fw_card *card, struct fw_request *r, |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 7f03540cabe8..be29b0bb2471 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
| @@ -694,7 +694,15 @@ static __le32 *handle_ar_packet(struct ar_context *ctx, __le32 *buffer) | |||
| 694 | log_ar_at_event('R', p.speed, p.header, evt); | 694 | log_ar_at_event('R', p.speed, p.header, evt); |
| 695 | 695 | ||
| 696 | /* | 696 | /* |
| 697 | * The OHCI bus reset handler synthesizes a phy packet with | 697 | * Several controllers, notably from NEC and VIA, forget to |
| 698 | * write ack_complete status at PHY packet reception. | ||
| 699 | */ | ||
| 700 | if (evt == OHCI1394_evt_no_status && | ||
| 701 | (p.header[0] & 0xff) == (OHCI1394_phy_tcode << 4)) | ||
| 702 | p.ack = ACK_COMPLETE; | ||
| 703 | |||
| 704 | /* | ||
| 705 | * The OHCI bus reset handler synthesizes a PHY packet with | ||
| 698 | * the new generation number when a bus reset happens (see | 706 | * the new generation number when a bus reset happens (see |
| 699 | * section 8.4.2.3). This helps us determine when a request | 707 | * section 8.4.2.3). This helps us determine when a request |
| 700 | * was received and make sure we send the response in the same | 708 | * was received and make sure we send the response in the same |
diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 9f76171717e5..bfae4b309791 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c | |||
| @@ -450,7 +450,7 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request, | |||
| 450 | 450 | ||
| 451 | if (&orb->link != &lu->orb_list) { | 451 | if (&orb->link != &lu->orb_list) { |
| 452 | orb->callback(orb, &status); | 452 | orb->callback(orb, &status); |
| 453 | kref_put(&orb->kref, free_orb); | 453 | kref_put(&orb->kref, free_orb); /* orb callback reference */ |
| 454 | } else { | 454 | } else { |
| 455 | fw_error("status write for unknown orb\n"); | 455 | fw_error("status write for unknown orb\n"); |
| 456 | } | 456 | } |
| @@ -472,20 +472,28 @@ static void complete_transaction(struct fw_card *card, int rcode, | |||
| 472 | * So this callback only sets the rcode if it hasn't already | 472 | * So this callback only sets the rcode if it hasn't already |
| 473 | * been set and only does the cleanup if the transaction | 473 | * been set and only does the cleanup if the transaction |
| 474 | * failed and we didn't already get a status write. | 474 | * failed and we didn't already get a status write. |
| 475 | * | ||
| 476 | * Here we treat RCODE_CANCELLED like RCODE_COMPLETE because some | ||
| 477 | * OXUF936QSE firmwares occasionally respond after Split_Timeout and | ||
| 478 | * complete the ORB just fine. Note, we also get RCODE_CANCELLED | ||
| 479 | * from sbp2_cancel_orbs() if fw_cancel_transaction() == 0. | ||
| 475 | */ | 480 | */ |
| 476 | spin_lock_irqsave(&card->lock, flags); | 481 | spin_lock_irqsave(&card->lock, flags); |
| 477 | 482 | ||
| 478 | if (orb->rcode == -1) | 483 | if (orb->rcode == -1) |
| 479 | orb->rcode = rcode; | 484 | orb->rcode = rcode; |
| 480 | if (orb->rcode != RCODE_COMPLETE) { | 485 | |
| 486 | if (orb->rcode != RCODE_COMPLETE && orb->rcode != RCODE_CANCELLED) { | ||
| 481 | list_del(&orb->link); | 487 | list_del(&orb->link); |
| 482 | spin_unlock_irqrestore(&card->lock, flags); | 488 | spin_unlock_irqrestore(&card->lock, flags); |
| 489 | |||
| 483 | orb->callback(orb, NULL); | 490 | orb->callback(orb, NULL); |
| 491 | kref_put(&orb->kref, free_orb); /* orb callback reference */ | ||
| 484 | } else { | 492 | } else { |
| 485 | spin_unlock_irqrestore(&card->lock, flags); | 493 | spin_unlock_irqrestore(&card->lock, flags); |
| 486 | } | 494 | } |
| 487 | 495 | ||
| 488 | kref_put(&orb->kref, free_orb); | 496 | kref_put(&orb->kref, free_orb); /* transaction callback reference */ |
| 489 | } | 497 | } |
| 490 | 498 | ||
| 491 | static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu, | 499 | static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu, |
| @@ -501,9 +509,8 @@ static void sbp2_send_orb(struct sbp2_orb *orb, struct sbp2_logical_unit *lu, | |||
| 501 | list_add_tail(&orb->link, &lu->orb_list); | 509 | list_add_tail(&orb->link, &lu->orb_list); |
| 502 | spin_unlock_irqrestore(&device->card->lock, flags); | 510 | spin_unlock_irqrestore(&device->card->lock, flags); |
| 503 | 511 | ||
| 504 | /* Take a ref for the orb list and for the transaction callback. */ | 512 | kref_get(&orb->kref); /* transaction callback reference */ |
| 505 | kref_get(&orb->kref); | 513 | kref_get(&orb->kref); /* orb callback reference */ |
| 506 | kref_get(&orb->kref); | ||
| 507 | 514 | ||
| 508 | fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST, | 515 | fw_send_request(device->card, &orb->t, TCODE_WRITE_BLOCK_REQUEST, |
| 509 | node_id, generation, device->max_speed, offset, | 516 | node_id, generation, device->max_speed, offset, |
| @@ -525,11 +532,11 @@ static int sbp2_cancel_orbs(struct sbp2_logical_unit *lu) | |||
| 525 | 532 | ||
| 526 | list_for_each_entry_safe(orb, next, &list, link) { | 533 | list_for_each_entry_safe(orb, next, &list, link) { |
| 527 | retval = 0; | 534 | retval = 0; |
| 528 | if (fw_cancel_transaction(device->card, &orb->t) == 0) | 535 | fw_cancel_transaction(device->card, &orb->t); |
| 529 | continue; | ||
| 530 | 536 | ||
| 531 | orb->rcode = RCODE_CANCELLED; | 537 | orb->rcode = RCODE_CANCELLED; |
| 532 | orb->callback(orb, NULL); | 538 | orb->callback(orb, NULL); |
| 539 | kref_put(&orb->kref, free_orb); /* orb callback reference */ | ||
| 533 | } | 540 | } |
| 534 | 541 | ||
| 535 | return retval; | 542 | return retval; |
diff --git a/drivers/gpio/sx150x.c b/drivers/gpio/sx150x.c index b42f42ca70c3..823559ab0e24 100644 --- a/drivers/gpio/sx150x.c +++ b/drivers/gpio/sx150x.c | |||
| @@ -459,17 +459,33 @@ static int sx150x_init_io(struct sx150x_chip *chip, u8 base, u16 cfg) | |||
| 459 | return err; | 459 | return err; |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | static int sx150x_init_hw(struct sx150x_chip *chip, | 462 | static int sx150x_reset(struct sx150x_chip *chip) |
| 463 | struct sx150x_platform_data *pdata) | ||
| 464 | { | 463 | { |
| 465 | int err = 0; | 464 | int err; |
| 466 | 465 | ||
| 467 | err = i2c_smbus_write_word_data(chip->client, | 466 | err = i2c_smbus_write_byte_data(chip->client, |
| 468 | chip->dev_cfg->reg_reset, | 467 | chip->dev_cfg->reg_reset, |
| 469 | 0x3412); | 468 | 0x12); |
| 470 | if (err < 0) | 469 | if (err < 0) |
| 471 | return err; | 470 | return err; |
| 472 | 471 | ||
| 472 | err = i2c_smbus_write_byte_data(chip->client, | ||
| 473 | chip->dev_cfg->reg_reset, | ||
| 474 | 0x34); | ||
| 475 | return err; | ||
| 476 | } | ||
| 477 | |||
| 478 | static int sx150x_init_hw(struct sx150x_chip *chip, | ||
| 479 | struct sx150x_platform_data *pdata) | ||
| 480 | { | ||
| 481 | int err = 0; | ||
| 482 | |||
| 483 | if (pdata->reset_during_probe) { | ||
| 484 | err = sx150x_reset(chip); | ||
| 485 | if (err < 0) | ||
| 486 | return err; | ||
| 487 | } | ||
| 488 | |||
| 473 | err = sx150x_i2c_write(chip->client, | 489 | err = sx150x_i2c_write(chip->client, |
| 474 | chip->dev_cfg->reg_misc, | 490 | chip->dev_cfg->reg_misc, |
| 475 | 0x01); | 491 | 0x01); |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 7e31d4348340..d2ab01e90a96 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -34,6 +34,9 @@ | |||
| 34 | #include "drm_crtc_helper.h" | 34 | #include "drm_crtc_helper.h" |
| 35 | #include "drm_fb_helper.h" | 35 | #include "drm_fb_helper.h" |
| 36 | 36 | ||
| 37 | static bool drm_kms_helper_poll = true; | ||
| 38 | module_param_named(poll, drm_kms_helper_poll, bool, 0600); | ||
| 39 | |||
| 37 | static void drm_mode_validate_flag(struct drm_connector *connector, | 40 | static void drm_mode_validate_flag(struct drm_connector *connector, |
| 38 | int flags) | 41 | int flags) |
| 39 | { | 42 | { |
| @@ -99,8 +102,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | |||
| 99 | connector->status = connector_status_disconnected; | 102 | connector->status = connector_status_disconnected; |
| 100 | if (connector->funcs->force) | 103 | if (connector->funcs->force) |
| 101 | connector->funcs->force(connector); | 104 | connector->funcs->force(connector); |
| 102 | } else | 105 | } else { |
| 103 | connector->status = connector->funcs->detect(connector); | 106 | connector->status = connector->funcs->detect(connector); |
| 107 | drm_helper_hpd_irq_event(dev); | ||
| 108 | } | ||
| 104 | 109 | ||
| 105 | if (connector->status == connector_status_disconnected) { | 110 | if (connector->status == connector_status_disconnected) { |
| 106 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", | 111 | DRM_DEBUG_KMS("[CONNECTOR:%d:%s] disconnected\n", |
| @@ -110,11 +115,10 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, | |||
| 110 | } | 115 | } |
| 111 | 116 | ||
| 112 | count = (*connector_funcs->get_modes)(connector); | 117 | count = (*connector_funcs->get_modes)(connector); |
| 113 | if (!count) { | 118 | if (count == 0 && connector->status == connector_status_connected) |
| 114 | count = drm_add_modes_noedid(connector, 1024, 768); | 119 | count = drm_add_modes_noedid(connector, 1024, 768); |
| 115 | if (!count) | 120 | if (count == 0) |
| 116 | return 0; | 121 | goto prune; |
| 117 | } | ||
| 118 | 122 | ||
| 119 | drm_mode_connector_list_update(connector); | 123 | drm_mode_connector_list_update(connector); |
| 120 | 124 | ||
| @@ -840,6 +844,9 @@ static void output_poll_execute(struct work_struct *work) | |||
| 840 | enum drm_connector_status old_status, status; | 844 | enum drm_connector_status old_status, status; |
| 841 | bool repoll = false, changed = false; | 845 | bool repoll = false, changed = false; |
| 842 | 846 | ||
| 847 | if (!drm_kms_helper_poll) | ||
| 848 | return; | ||
| 849 | |||
| 843 | mutex_lock(&dev->mode_config.mutex); | 850 | mutex_lock(&dev->mode_config.mutex); |
| 844 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 851 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
| 845 | 852 | ||
| @@ -890,6 +897,9 @@ void drm_kms_helper_poll_enable(struct drm_device *dev) | |||
| 890 | bool poll = false; | 897 | bool poll = false; |
| 891 | struct drm_connector *connector; | 898 | struct drm_connector *connector; |
| 892 | 899 | ||
| 900 | if (!dev->mode_config.poll_enabled || !drm_kms_helper_poll) | ||
| 901 | return; | ||
| 902 | |||
| 893 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 903 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
| 894 | if (connector->polled) | 904 | if (connector->polled) |
| 895 | poll = true; | 905 | poll = true; |
| @@ -919,8 +929,10 @@ void drm_helper_hpd_irq_event(struct drm_device *dev) | |||
| 919 | { | 929 | { |
| 920 | if (!dev->mode_config.poll_enabled) | 930 | if (!dev->mode_config.poll_enabled) |
| 921 | return; | 931 | return; |
| 932 | |||
| 922 | /* kill timer and schedule immediate execution, this doesn't block */ | 933 | /* kill timer and schedule immediate execution, this doesn't block */ |
| 923 | cancel_delayed_work(&dev->mode_config.output_poll_work); | 934 | cancel_delayed_work(&dev->mode_config.output_poll_work); |
| 924 | queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0); | 935 | if (drm_kms_helper_poll) |
| 936 | queue_delayed_work(system_nrt_wq, &dev->mode_config.output_poll_work, 0); | ||
| 925 | } | 937 | } |
| 926 | EXPORT_SYMBOL(drm_helper_hpd_irq_event); | 938 | EXPORT_SYMBOL(drm_helper_hpd_irq_event); |
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 8dd7e6f86bb3..6a5e403f9aa1 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
| @@ -370,7 +370,7 @@ static void drm_fb_helper_restore_work_fn(struct work_struct *ignored) | |||
| 370 | } | 370 | } |
| 371 | static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn); | 371 | static DECLARE_WORK(drm_fb_helper_restore_work, drm_fb_helper_restore_work_fn); |
| 372 | 372 | ||
| 373 | static void drm_fb_helper_sysrq(int dummy1, struct tty_struct *dummy3) | 373 | static void drm_fb_helper_sysrq(int dummy1) |
| 374 | { | 374 | { |
| 375 | schedule_work(&drm_fb_helper_restore_work); | 375 | schedule_work(&drm_fb_helper_restore_work); |
| 376 | } | 376 | } |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 3a652a65546f..b744dad5c237 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
| @@ -41,6 +41,7 @@ | |||
| 41 | 41 | ||
| 42 | /* from BKL pushdown: note that nothing else serializes idr_find() */ | 42 | /* from BKL pushdown: note that nothing else serializes idr_find() */ |
| 43 | DEFINE_MUTEX(drm_global_mutex); | 43 | DEFINE_MUTEX(drm_global_mutex); |
| 44 | EXPORT_SYMBOL(drm_global_mutex); | ||
| 44 | 45 | ||
| 45 | static int drm_open_helper(struct inode *inode, struct file *filp, | 46 | static int drm_open_helper(struct inode *inode, struct file *filp, |
| 46 | struct drm_device * dev); | 47 | struct drm_device * dev); |
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index e2f70a516c34..9bf93bc9a32c 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c | |||
| @@ -92,7 +92,9 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | /* Contention */ | 94 | /* Contention */ |
| 95 | mutex_unlock(&drm_global_mutex); | ||
| 95 | schedule(); | 96 | schedule(); |
| 97 | mutex_lock(&drm_global_mutex); | ||
| 96 | if (signal_pending(current)) { | 98 | if (signal_pending(current)) { |
| 97 | ret = -EINTR; | 99 | ret = -EINTR; |
| 98 | break; | 100 | break; |
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index da99edc50888..a6bfc302ed90 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c | |||
| @@ -285,21 +285,21 @@ void drm_mm_put_block(struct drm_mm_node *cur) | |||
| 285 | 285 | ||
| 286 | EXPORT_SYMBOL(drm_mm_put_block); | 286 | EXPORT_SYMBOL(drm_mm_put_block); |
| 287 | 287 | ||
| 288 | static int check_free_mm_node(struct drm_mm_node *entry, unsigned long size, | 288 | static int check_free_hole(unsigned long start, unsigned long end, |
| 289 | unsigned alignment) | 289 | unsigned long size, unsigned alignment) |
| 290 | { | 290 | { |
| 291 | unsigned wasted = 0; | 291 | unsigned wasted = 0; |
| 292 | 292 | ||
| 293 | if (entry->size < size) | 293 | if (end - start < size) |
| 294 | return 0; | 294 | return 0; |
| 295 | 295 | ||
| 296 | if (alignment) { | 296 | if (alignment) { |
| 297 | register unsigned tmp = entry->start % alignment; | 297 | unsigned tmp = start % alignment; |
| 298 | if (tmp) | 298 | if (tmp) |
| 299 | wasted = alignment - tmp; | 299 | wasted = alignment - tmp; |
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | if (entry->size >= size + wasted) { | 302 | if (end >= start + size + wasted) { |
| 303 | return 1; | 303 | return 1; |
| 304 | } | 304 | } |
| 305 | 305 | ||
| @@ -320,7 +320,8 @@ struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, | |||
| 320 | best_size = ~0UL; | 320 | best_size = ~0UL; |
| 321 | 321 | ||
| 322 | list_for_each_entry(entry, &mm->free_stack, free_stack) { | 322 | list_for_each_entry(entry, &mm->free_stack, free_stack) { |
| 323 | if (!check_free_mm_node(entry, size, alignment)) | 323 | if (!check_free_hole(entry->start, entry->start + entry->size, |
| 324 | size, alignment)) | ||
| 324 | continue; | 325 | continue; |
| 325 | 326 | ||
| 326 | if (!best_match) | 327 | if (!best_match) |
| @@ -353,10 +354,12 @@ struct drm_mm_node *drm_mm_search_free_in_range(const struct drm_mm *mm, | |||
| 353 | best_size = ~0UL; | 354 | best_size = ~0UL; |
| 354 | 355 | ||
| 355 | list_for_each_entry(entry, &mm->free_stack, free_stack) { | 356 | list_for_each_entry(entry, &mm->free_stack, free_stack) { |
| 356 | if (entry->start > end || (entry->start+entry->size) < start) | 357 | unsigned long adj_start = entry->start < start ? |
| 357 | continue; | 358 | start : entry->start; |
| 359 | unsigned long adj_end = entry->start + entry->size > end ? | ||
| 360 | end : entry->start + entry->size; | ||
| 358 | 361 | ||
| 359 | if (!check_free_mm_node(entry, size, alignment)) | 362 | if (!check_free_hole(adj_start, adj_end, size, alignment)) |
| 360 | continue; | 363 | continue; |
| 361 | 364 | ||
| 362 | if (!best_match) | 365 | if (!best_match) |
| @@ -449,7 +452,8 @@ int drm_mm_scan_add_block(struct drm_mm_node *node) | |||
| 449 | node->free_stack.prev = prev_free; | 452 | node->free_stack.prev = prev_free; |
| 450 | node->free_stack.next = next_free; | 453 | node->free_stack.next = next_free; |
| 451 | 454 | ||
| 452 | if (check_free_mm_node(node, mm->scan_size, mm->scan_alignment)) { | 455 | if (check_free_hole(node->start, node->start + node->size, |
| 456 | mm->scan_size, mm->scan_alignment)) { | ||
| 453 | mm->scan_hit_start = node->start; | 457 | mm->scan_hit_start = node->start; |
| 454 | mm->scan_hit_size = node->size; | 458 | mm->scan_hit_size = node->size; |
| 455 | 459 | ||
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index f1f473ea97d3..949326d2a8e5 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
| @@ -251,7 +251,10 @@ struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, int hdisplay, | |||
| 251 | drm_mode->htotal = drm_mode->hdisplay + CVT_RB_H_BLANK; | 251 | drm_mode->htotal = drm_mode->hdisplay + CVT_RB_H_BLANK; |
| 252 | /* Fill in HSync values */ | 252 | /* Fill in HSync values */ |
| 253 | drm_mode->hsync_end = drm_mode->hdisplay + CVT_RB_H_BLANK / 2; | 253 | drm_mode->hsync_end = drm_mode->hdisplay + CVT_RB_H_BLANK / 2; |
| 254 | drm_mode->hsync_start = drm_mode->hsync_end = CVT_RB_H_SYNC; | 254 | drm_mode->hsync_start = drm_mode->hsync_end - CVT_RB_H_SYNC; |
| 255 | /* Fill in VSync values */ | ||
| 256 | drm_mode->vsync_start = drm_mode->vdisplay + CVT_RB_VFPORCH; | ||
| 257 | drm_mode->vsync_end = drm_mode->vsync_start + vsync; | ||
| 255 | } | 258 | } |
| 256 | /* 15/13. Find pixel clock frequency (kHz for xf86) */ | 259 | /* 15/13. Find pixel clock frequency (kHz for xf86) */ |
| 257 | drm_mode->clock = drm_mode->htotal * HV_FACTOR * 1000 / hperiod; | 260 | drm_mode->clock = drm_mode->htotal * HV_FACTOR * 1000 / hperiod; |
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 92d5605a34d1..5e43d7076789 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/slab.h> | 31 | #include <linux/slab.h> |
| 32 | #include "drmP.h" | 32 | #include "drmP.h" |
| 33 | #include "drm.h" | 33 | #include "drm.h" |
| 34 | #include "intel_drv.h" | ||
| 34 | #include "i915_drm.h" | 35 | #include "i915_drm.h" |
| 35 | #include "i915_drv.h" | 36 | #include "i915_drv.h" |
| 36 | 37 | ||
| @@ -121,6 +122,54 @@ static int i915_gem_object_list_info(struct seq_file *m, void *data) | |||
| 121 | return 0; | 122 | return 0; |
| 122 | } | 123 | } |
| 123 | 124 | ||
| 125 | static int i915_gem_pageflip_info(struct seq_file *m, void *data) | ||
| 126 | { | ||
| 127 | struct drm_info_node *node = (struct drm_info_node *) m->private; | ||
| 128 | struct drm_device *dev = node->minor->dev; | ||
| 129 | unsigned long flags; | ||
| 130 | struct intel_crtc *crtc; | ||
| 131 | |||
| 132 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) { | ||
| 133 | const char *pipe = crtc->pipe ? "B" : "A"; | ||
| 134 | const char *plane = crtc->plane ? "B" : "A"; | ||
| 135 | struct intel_unpin_work *work; | ||
| 136 | |||
| 137 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 138 | work = crtc->unpin_work; | ||
| 139 | if (work == NULL) { | ||
| 140 | seq_printf(m, "No flip due on pipe %s (plane %s)\n", | ||
| 141 | pipe, plane); | ||
| 142 | } else { | ||
| 143 | if (!work->pending) { | ||
| 144 | seq_printf(m, "Flip queued on pipe %s (plane %s)\n", | ||
| 145 | pipe, plane); | ||
| 146 | } else { | ||
| 147 | seq_printf(m, "Flip pending (waiting for vsync) on pipe %s (plane %s)\n", | ||
| 148 | pipe, plane); | ||
| 149 | } | ||
| 150 | if (work->enable_stall_check) | ||
| 151 | seq_printf(m, "Stall check enabled, "); | ||
| 152 | else | ||
| 153 | seq_printf(m, "Stall check waiting for page flip ioctl, "); | ||
| 154 | seq_printf(m, "%d prepares\n", work->pending); | ||
| 155 | |||
| 156 | if (work->old_fb_obj) { | ||
| 157 | struct drm_i915_gem_object *obj_priv = to_intel_bo(work->old_fb_obj); | ||
| 158 | if(obj_priv) | ||
| 159 | seq_printf(m, "Old framebuffer gtt_offset 0x%08x\n", obj_priv->gtt_offset ); | ||
| 160 | } | ||
| 161 | if (work->pending_flip_obj) { | ||
| 162 | struct drm_i915_gem_object *obj_priv = to_intel_bo(work->pending_flip_obj); | ||
| 163 | if(obj_priv) | ||
| 164 | seq_printf(m, "New framebuffer gtt_offset 0x%08x\n", obj_priv->gtt_offset ); | ||
| 165 | } | ||
| 166 | } | ||
| 167 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 168 | } | ||
| 169 | |||
| 170 | return 0; | ||
| 171 | } | ||
| 172 | |||
| 124 | static int i915_gem_request_info(struct seq_file *m, void *data) | 173 | static int i915_gem_request_info(struct seq_file *m, void *data) |
| 125 | { | 174 | { |
| 126 | struct drm_info_node *node = (struct drm_info_node *) m->private; | 175 | struct drm_info_node *node = (struct drm_info_node *) m->private; |
| @@ -777,6 +826,7 @@ static struct drm_info_list i915_debugfs_list[] = { | |||
| 777 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, | 826 | {"i915_gem_active", i915_gem_object_list_info, 0, (void *) ACTIVE_LIST}, |
| 778 | {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, | 827 | {"i915_gem_flushing", i915_gem_object_list_info, 0, (void *) FLUSHING_LIST}, |
| 779 | {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST}, | 828 | {"i915_gem_inactive", i915_gem_object_list_info, 0, (void *) INACTIVE_LIST}, |
| 829 | {"i915_gem_pageflip", i915_gem_pageflip_info, 0}, | ||
| 780 | {"i915_gem_request", i915_gem_request_info, 0}, | 830 | {"i915_gem_request", i915_gem_request_info, 0}, |
| 781 | {"i915_gem_seqno", i915_gem_seqno_info, 0}, | 831 | {"i915_gem_seqno", i915_gem_seqno_info, 0}, |
| 782 | {"i915_gem_fence_regs", i915_gem_fence_regs_info, 0}, | 832 | {"i915_gem_fence_regs", i915_gem_fence_regs_info, 0}, |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index a7ec93e62f81..9d67b4853030 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -620,8 +620,10 @@ static int i915_batchbuffer(struct drm_device *dev, void *data, | |||
| 620 | ret = copy_from_user(cliprects, batch->cliprects, | 620 | ret = copy_from_user(cliprects, batch->cliprects, |
| 621 | batch->num_cliprects * | 621 | batch->num_cliprects * |
| 622 | sizeof(struct drm_clip_rect)); | 622 | sizeof(struct drm_clip_rect)); |
| 623 | if (ret != 0) | 623 | if (ret != 0) { |
| 624 | ret = -EFAULT; | ||
| 624 | goto fail_free; | 625 | goto fail_free; |
| 626 | } | ||
| 625 | } | 627 | } |
| 626 | 628 | ||
| 627 | mutex_lock(&dev->struct_mutex); | 629 | mutex_lock(&dev->struct_mutex); |
| @@ -662,8 +664,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, | |||
| 662 | return -ENOMEM; | 664 | return -ENOMEM; |
| 663 | 665 | ||
| 664 | ret = copy_from_user(batch_data, cmdbuf->buf, cmdbuf->sz); | 666 | ret = copy_from_user(batch_data, cmdbuf->buf, cmdbuf->sz); |
| 665 | if (ret != 0) | 667 | if (ret != 0) { |
| 668 | ret = -EFAULT; | ||
| 666 | goto fail_batch_free; | 669 | goto fail_batch_free; |
| 670 | } | ||
| 667 | 671 | ||
| 668 | if (cmdbuf->num_cliprects) { | 672 | if (cmdbuf->num_cliprects) { |
| 669 | cliprects = kcalloc(cmdbuf->num_cliprects, | 673 | cliprects = kcalloc(cmdbuf->num_cliprects, |
| @@ -676,8 +680,10 @@ static int i915_cmdbuffer(struct drm_device *dev, void *data, | |||
| 676 | ret = copy_from_user(cliprects, cmdbuf->cliprects, | 680 | ret = copy_from_user(cliprects, cmdbuf->cliprects, |
| 677 | cmdbuf->num_cliprects * | 681 | cmdbuf->num_cliprects * |
| 678 | sizeof(struct drm_clip_rect)); | 682 | sizeof(struct drm_clip_rect)); |
| 679 | if (ret != 0) | 683 | if (ret != 0) { |
| 684 | ret = -EFAULT; | ||
| 680 | goto fail_clip_free; | 685 | goto fail_clip_free; |
| 686 | } | ||
| 681 | } | 687 | } |
| 682 | 688 | ||
| 683 | mutex_lock(&dev->struct_mutex); | 689 | mutex_lock(&dev->struct_mutex); |
| @@ -885,7 +891,7 @@ intel_alloc_mchbar_resource(struct drm_device *dev) | |||
| 885 | int reg = IS_I965G(dev) ? MCHBAR_I965 : MCHBAR_I915; | 891 | int reg = IS_I965G(dev) ? MCHBAR_I965 : MCHBAR_I915; |
| 886 | u32 temp_lo, temp_hi = 0; | 892 | u32 temp_lo, temp_hi = 0; |
| 887 | u64 mchbar_addr; | 893 | u64 mchbar_addr; |
| 888 | int ret = 0; | 894 | int ret; |
| 889 | 895 | ||
| 890 | if (IS_I965G(dev)) | 896 | if (IS_I965G(dev)) |
| 891 | pci_read_config_dword(dev_priv->bridge_dev, reg + 4, &temp_hi); | 897 | pci_read_config_dword(dev_priv->bridge_dev, reg + 4, &temp_hi); |
| @@ -895,22 +901,23 @@ intel_alloc_mchbar_resource(struct drm_device *dev) | |||
| 895 | /* If ACPI doesn't have it, assume we need to allocate it ourselves */ | 901 | /* If ACPI doesn't have it, assume we need to allocate it ourselves */ |
| 896 | #ifdef CONFIG_PNP | 902 | #ifdef CONFIG_PNP |
| 897 | if (mchbar_addr && | 903 | if (mchbar_addr && |
| 898 | pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) { | 904 | pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE)) |
| 899 | ret = 0; | 905 | return 0; |
| 900 | goto out; | ||
| 901 | } | ||
| 902 | #endif | 906 | #endif |
| 903 | 907 | ||
| 904 | /* Get some space for it */ | 908 | /* Get some space for it */ |
| 905 | ret = pci_bus_alloc_resource(dev_priv->bridge_dev->bus, &dev_priv->mch_res, | 909 | dev_priv->mch_res.name = "i915 MCHBAR"; |
| 910 | dev_priv->mch_res.flags = IORESOURCE_MEM; | ||
| 911 | ret = pci_bus_alloc_resource(dev_priv->bridge_dev->bus, | ||
| 912 | &dev_priv->mch_res, | ||
| 906 | MCHBAR_SIZE, MCHBAR_SIZE, | 913 | MCHBAR_SIZE, MCHBAR_SIZE, |
| 907 | PCIBIOS_MIN_MEM, | 914 | PCIBIOS_MIN_MEM, |
| 908 | 0, pcibios_align_resource, | 915 | 0, pcibios_align_resource, |
| 909 | dev_priv->bridge_dev); | 916 | dev_priv->bridge_dev); |
| 910 | if (ret) { | 917 | if (ret) { |
| 911 | DRM_DEBUG_DRIVER("failed bus alloc: %d\n", ret); | 918 | DRM_DEBUG_DRIVER("failed bus alloc: %d\n", ret); |
| 912 | dev_priv->mch_res.start = 0; | 919 | dev_priv->mch_res.start = 0; |
| 913 | goto out; | 920 | return ret; |
| 914 | } | 921 | } |
| 915 | 922 | ||
| 916 | if (IS_I965G(dev)) | 923 | if (IS_I965G(dev)) |
| @@ -919,8 +926,7 @@ intel_alloc_mchbar_resource(struct drm_device *dev) | |||
| 919 | 926 | ||
| 920 | pci_write_config_dword(dev_priv->bridge_dev, reg, | 927 | pci_write_config_dword(dev_priv->bridge_dev, reg, |
| 921 | lower_32_bits(dev_priv->mch_res.start)); | 928 | lower_32_bits(dev_priv->mch_res.start)); |
| 922 | out: | 929 | return 0; |
| 923 | return ret; | ||
| 924 | } | 930 | } |
| 925 | 931 | ||
| 926 | /* Setup MCHBAR if possible, return true if we should disable it again */ | 932 | /* Setup MCHBAR if possible, return true if we should disable it again */ |
| @@ -2082,6 +2088,10 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 2082 | goto free_priv; | 2088 | goto free_priv; |
| 2083 | } | 2089 | } |
| 2084 | 2090 | ||
| 2091 | /* overlay on gen2 is broken and can't address above 1G */ | ||
| 2092 | if (IS_GEN2(dev)) | ||
| 2093 | dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(30)); | ||
| 2094 | |||
| 2085 | dev_priv->regs = ioremap(base, size); | 2095 | dev_priv->regs = ioremap(base, size); |
| 2086 | if (!dev_priv->regs) { | 2096 | if (!dev_priv->regs) { |
| 2087 | DRM_ERROR("failed to map registers\n"); | 2097 | DRM_ERROR("failed to map registers\n"); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 00befce8fbb7..216deb579785 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
| @@ -61,91 +61,86 @@ extern int intel_agp_enabled; | |||
| 61 | .driver_data = (unsigned long) info } | 61 | .driver_data = (unsigned long) info } |
| 62 | 62 | ||
| 63 | static const struct intel_device_info intel_i830_info = { | 63 | static const struct intel_device_info intel_i830_info = { |
| 64 | .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1, | 64 | .gen = 2, .is_i8xx = 1, .is_mobile = 1, .cursor_needs_physical = 1, |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | static const struct intel_device_info intel_845g_info = { | 67 | static const struct intel_device_info intel_845g_info = { |
| 68 | .is_i8xx = 1, | 68 | .gen = 2, .is_i8xx = 1, |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | static const struct intel_device_info intel_i85x_info = { | 71 | static const struct intel_device_info intel_i85x_info = { |
| 72 | .is_i8xx = 1, .is_i85x = 1, .is_mobile = 1, | 72 | .gen = 2, .is_i8xx = 1, .is_i85x = 1, .is_mobile = 1, |
| 73 | .cursor_needs_physical = 1, | 73 | .cursor_needs_physical = 1, |
| 74 | }; | 74 | }; |
| 75 | 75 | ||
| 76 | static const struct intel_device_info intel_i865g_info = { | 76 | static const struct intel_device_info intel_i865g_info = { |
| 77 | .is_i8xx = 1, | 77 | .gen = 2, .is_i8xx = 1, |
| 78 | }; | 78 | }; |
| 79 | 79 | ||
| 80 | static const struct intel_device_info intel_i915g_info = { | 80 | static const struct intel_device_info intel_i915g_info = { |
| 81 | .is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1, | 81 | .gen = 3, .is_i915g = 1, .is_i9xx = 1, .cursor_needs_physical = 1, |
| 82 | }; | 82 | }; |
| 83 | static const struct intel_device_info intel_i915gm_info = { | 83 | static const struct intel_device_info intel_i915gm_info = { |
| 84 | .is_i9xx = 1, .is_mobile = 1, | 84 | .gen = 3, .is_i9xx = 1, .is_mobile = 1, |
| 85 | .cursor_needs_physical = 1, | 85 | .cursor_needs_physical = 1, |
| 86 | }; | 86 | }; |
| 87 | static const struct intel_device_info intel_i945g_info = { | 87 | static const struct intel_device_info intel_i945g_info = { |
| 88 | .is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1, | 88 | .gen = 3, .is_i9xx = 1, .has_hotplug = 1, .cursor_needs_physical = 1, |
| 89 | }; | 89 | }; |
| 90 | static const struct intel_device_info intel_i945gm_info = { | 90 | static const struct intel_device_info intel_i945gm_info = { |
| 91 | .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, | 91 | .gen = 3, .is_i945gm = 1, .is_i9xx = 1, .is_mobile = 1, |
| 92 | .has_hotplug = 1, .cursor_needs_physical = 1, | 92 | .has_hotplug = 1, .cursor_needs_physical = 1, |
| 93 | }; | 93 | }; |
| 94 | 94 | ||
| 95 | static const struct intel_device_info intel_i965g_info = { | 95 | static const struct intel_device_info intel_i965g_info = { |
| 96 | .is_broadwater = 1, .is_i965g = 1, .is_i9xx = 1, .has_hotplug = 1, | 96 | .gen = 4, .is_broadwater = 1, .is_i965g = 1, .is_i9xx = 1, |
| 97 | .has_hotplug = 1, | ||
| 97 | }; | 98 | }; |
| 98 | 99 | ||
| 99 | static const struct intel_device_info intel_i965gm_info = { | 100 | static const struct intel_device_info intel_i965gm_info = { |
| 100 | .is_crestline = 1, .is_i965g = 1, .is_i965gm = 1, .is_i9xx = 1, | 101 | .gen = 4, .is_crestline = 1, .is_i965g = 1, .is_i965gm = 1, .is_i9xx = 1, |
| 101 | .is_mobile = 1, .has_fbc = 1, .has_rc6 = 1, | 102 | .is_mobile = 1, .has_fbc = 1, .has_rc6 = 1, .has_hotplug = 1, |
| 102 | .has_hotplug = 1, | ||
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | static const struct intel_device_info intel_g33_info = { | 105 | static const struct intel_device_info intel_g33_info = { |
| 106 | .is_g33 = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 106 | .gen = 3, .is_g33 = 1, .is_i9xx = 1, |
| 107 | .has_hotplug = 1, | 107 | .need_gfx_hws = 1, .has_hotplug = 1, |
| 108 | }; | 108 | }; |
| 109 | 109 | ||
| 110 | static const struct intel_device_info intel_g45_info = { | 110 | static const struct intel_device_info intel_g45_info = { |
| 111 | .is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 111 | .gen = 4, .is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
| 112 | .has_pipe_cxsr = 1, | 112 | .has_pipe_cxsr = 1, .has_hotplug = 1, |
| 113 | .has_hotplug = 1, | ||
| 114 | }; | 113 | }; |
| 115 | 114 | ||
| 116 | static const struct intel_device_info intel_gm45_info = { | 115 | static const struct intel_device_info intel_gm45_info = { |
| 117 | .is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, | 116 | .gen = 4, .is_i965g = 1, .is_g4x = 1, .is_i9xx = 1, |
| 118 | .is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, | 117 | .is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, |
| 119 | .has_pipe_cxsr = 1, | 118 | .has_pipe_cxsr = 1, .has_hotplug = 1, |
| 120 | .has_hotplug = 1, | ||
| 121 | }; | 119 | }; |
| 122 | 120 | ||
| 123 | static const struct intel_device_info intel_pineview_info = { | 121 | static const struct intel_device_info intel_pineview_info = { |
| 124 | .is_g33 = 1, .is_pineview = 1, .is_mobile = 1, .is_i9xx = 1, | 122 | .gen = 3, .is_g33 = 1, .is_pineview = 1, .is_mobile = 1, .is_i9xx = 1, |
| 125 | .need_gfx_hws = 1, | 123 | .need_gfx_hws = 1, .has_hotplug = 1, |
| 126 | .has_hotplug = 1, | ||
| 127 | }; | 124 | }; |
| 128 | 125 | ||
| 129 | static const struct intel_device_info intel_ironlake_d_info = { | 126 | static const struct intel_device_info intel_ironlake_d_info = { |
| 130 | .is_ironlake = 1, .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 127 | .gen = 5, .is_ironlake = 1, .is_i965g = 1, .is_i9xx = 1, |
| 131 | .has_pipe_cxsr = 1, | 128 | .need_gfx_hws = 1, .has_pipe_cxsr = 1, .has_hotplug = 1, |
| 132 | .has_hotplug = 1, | ||
| 133 | }; | 129 | }; |
| 134 | 130 | ||
| 135 | static const struct intel_device_info intel_ironlake_m_info = { | 131 | static const struct intel_device_info intel_ironlake_m_info = { |
| 136 | .is_ironlake = 1, .is_mobile = 1, .is_i965g = 1, .is_i9xx = 1, | 132 | .gen = 5, .is_ironlake = 1, .is_mobile = 1, .is_i965g = 1, .is_i9xx = 1, |
| 137 | .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, | 133 | .need_gfx_hws = 1, .has_fbc = 1, .has_rc6 = 1, .has_hotplug = 1, |
| 138 | .has_hotplug = 1, | ||
| 139 | }; | 134 | }; |
| 140 | 135 | ||
| 141 | static const struct intel_device_info intel_sandybridge_d_info = { | 136 | static const struct intel_device_info intel_sandybridge_d_info = { |
| 142 | .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 137 | .gen = 6, .is_i965g = 1, .is_i9xx = 1, |
| 143 | .has_hotplug = 1, .is_gen6 = 1, | 138 | .need_gfx_hws = 1, .has_hotplug = 1, |
| 144 | }; | 139 | }; |
| 145 | 140 | ||
| 146 | static const struct intel_device_info intel_sandybridge_m_info = { | 141 | static const struct intel_device_info intel_sandybridge_m_info = { |
| 147 | .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 142 | .gen = 6, .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, |
| 148 | .has_hotplug = 1, .is_gen6 = 1, | 143 | .need_gfx_hws = 1, .has_hotplug = 1, |
| 149 | }; | 144 | }; |
| 150 | 145 | ||
| 151 | static const struct pci_device_id pciidlist[] = { /* aka */ | 146 | static const struct pci_device_id pciidlist[] = { /* aka */ |
| @@ -180,8 +175,12 @@ static const struct pci_device_id pciidlist[] = { /* aka */ | |||
| 180 | INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), | 175 | INTEL_VGA_DEVICE(0x0042, &intel_ironlake_d_info), |
| 181 | INTEL_VGA_DEVICE(0x0046, &intel_ironlake_m_info), | 176 | INTEL_VGA_DEVICE(0x0046, &intel_ironlake_m_info), |
| 182 | INTEL_VGA_DEVICE(0x0102, &intel_sandybridge_d_info), | 177 | INTEL_VGA_DEVICE(0x0102, &intel_sandybridge_d_info), |
| 178 | INTEL_VGA_DEVICE(0x0112, &intel_sandybridge_d_info), | ||
| 179 | INTEL_VGA_DEVICE(0x0122, &intel_sandybridge_d_info), | ||
| 183 | INTEL_VGA_DEVICE(0x0106, &intel_sandybridge_m_info), | 180 | INTEL_VGA_DEVICE(0x0106, &intel_sandybridge_m_info), |
| 181 | INTEL_VGA_DEVICE(0x0116, &intel_sandybridge_m_info), | ||
| 184 | INTEL_VGA_DEVICE(0x0126, &intel_sandybridge_m_info), | 182 | INTEL_VGA_DEVICE(0x0126, &intel_sandybridge_m_info), |
| 183 | INTEL_VGA_DEVICE(0x010A, &intel_sandybridge_d_info), | ||
| 185 | {0, 0, 0} | 184 | {0, 0, 0} |
| 186 | }; | 185 | }; |
| 187 | 186 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 047cd7ce7e1b..af4a263cf257 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
| @@ -191,6 +191,7 @@ struct drm_i915_display_funcs { | |||
| 191 | }; | 191 | }; |
| 192 | 192 | ||
| 193 | struct intel_device_info { | 193 | struct intel_device_info { |
| 194 | u8 gen; | ||
| 194 | u8 is_mobile : 1; | 195 | u8 is_mobile : 1; |
| 195 | u8 is_i8xx : 1; | 196 | u8 is_i8xx : 1; |
| 196 | u8 is_i85x : 1; | 197 | u8 is_i85x : 1; |
| @@ -206,7 +207,6 @@ struct intel_device_info { | |||
| 206 | u8 is_broadwater : 1; | 207 | u8 is_broadwater : 1; |
| 207 | u8 is_crestline : 1; | 208 | u8 is_crestline : 1; |
| 208 | u8 is_ironlake : 1; | 209 | u8 is_ironlake : 1; |
| 209 | u8 is_gen6 : 1; | ||
| 210 | u8 has_fbc : 1; | 210 | u8 has_fbc : 1; |
| 211 | u8 has_rc6 : 1; | 211 | u8 has_rc6 : 1; |
| 212 | u8 has_pipe_cxsr : 1; | 212 | u8 has_pipe_cxsr : 1; |
| @@ -1162,7 +1162,6 @@ extern void intel_overlay_print_error_state(struct seq_file *m, struct intel_ove | |||
| 1162 | #define IS_845G(dev) ((dev)->pci_device == 0x2562) | 1162 | #define IS_845G(dev) ((dev)->pci_device == 0x2562) |
| 1163 | #define IS_I85X(dev) (INTEL_INFO(dev)->is_i85x) | 1163 | #define IS_I85X(dev) (INTEL_INFO(dev)->is_i85x) |
| 1164 | #define IS_I865G(dev) ((dev)->pci_device == 0x2572) | 1164 | #define IS_I865G(dev) ((dev)->pci_device == 0x2572) |
| 1165 | #define IS_GEN2(dev) (INTEL_INFO(dev)->is_i8xx) | ||
| 1166 | #define IS_I915G(dev) (INTEL_INFO(dev)->is_i915g) | 1165 | #define IS_I915G(dev) (INTEL_INFO(dev)->is_i915g) |
| 1167 | #define IS_I915GM(dev) ((dev)->pci_device == 0x2592) | 1166 | #define IS_I915GM(dev) ((dev)->pci_device == 0x2592) |
| 1168 | #define IS_I945G(dev) ((dev)->pci_device == 0x2772) | 1167 | #define IS_I945G(dev) ((dev)->pci_device == 0x2772) |
| @@ -1181,27 +1180,13 @@ extern void intel_overlay_print_error_state(struct seq_file *m, struct intel_ove | |||
| 1181 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) | 1180 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) |
| 1182 | #define IS_IRONLAKE(dev) (INTEL_INFO(dev)->is_ironlake) | 1181 | #define IS_IRONLAKE(dev) (INTEL_INFO(dev)->is_ironlake) |
| 1183 | #define IS_I9XX(dev) (INTEL_INFO(dev)->is_i9xx) | 1182 | #define IS_I9XX(dev) (INTEL_INFO(dev)->is_i9xx) |
| 1184 | #define IS_GEN6(dev) (INTEL_INFO(dev)->is_gen6) | ||
| 1185 | #define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile) | 1183 | #define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile) |
| 1186 | 1184 | ||
| 1187 | #define IS_GEN3(dev) (IS_I915G(dev) || \ | 1185 | #define IS_GEN2(dev) (INTEL_INFO(dev)->gen == 2) |
| 1188 | IS_I915GM(dev) || \ | 1186 | #define IS_GEN3(dev) (INTEL_INFO(dev)->gen == 3) |
| 1189 | IS_I945G(dev) || \ | 1187 | #define IS_GEN4(dev) (INTEL_INFO(dev)->gen == 4) |
| 1190 | IS_I945GM(dev) || \ | 1188 | #define IS_GEN5(dev) (INTEL_INFO(dev)->gen == 5) |
| 1191 | IS_G33(dev) || \ | 1189 | #define IS_GEN6(dev) (INTEL_INFO(dev)->gen == 6) |
| 1192 | IS_PINEVIEW(dev)) | ||
| 1193 | #define IS_GEN4(dev) ((dev)->pci_device == 0x2972 || \ | ||
| 1194 | (dev)->pci_device == 0x2982 || \ | ||
| 1195 | (dev)->pci_device == 0x2992 || \ | ||
| 1196 | (dev)->pci_device == 0x29A2 || \ | ||
| 1197 | (dev)->pci_device == 0x2A02 || \ | ||
| 1198 | (dev)->pci_device == 0x2A12 || \ | ||
| 1199 | (dev)->pci_device == 0x2E02 || \ | ||
| 1200 | (dev)->pci_device == 0x2E12 || \ | ||
| 1201 | (dev)->pci_device == 0x2E22 || \ | ||
| 1202 | (dev)->pci_device == 0x2E32 || \ | ||
| 1203 | (dev)->pci_device == 0x2A42 || \ | ||
| 1204 | (dev)->pci_device == 0x2E42) | ||
| 1205 | 1190 | ||
| 1206 | #define HAS_BSD(dev) (IS_IRONLAKE(dev) || IS_G4X(dev)) | 1191 | #define HAS_BSD(dev) (IS_IRONLAKE(dev) || IS_G4X(dev)) |
| 1207 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) | 1192 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index df5a7135c261..16fca1d1799a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -34,6 +34,7 @@ | |||
| 34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
| 35 | #include <linux/swap.h> | 35 | #include <linux/swap.h> |
| 36 | #include <linux/pci.h> | 36 | #include <linux/pci.h> |
| 37 | #include <linux/intel-gtt.h> | ||
| 37 | 38 | ||
| 38 | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); | 39 | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); |
| 39 | static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); | 40 | static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); |
| @@ -135,12 +136,15 @@ i915_gem_create_ioctl(struct drm_device *dev, void *data, | |||
| 135 | return -ENOMEM; | 136 | return -ENOMEM; |
| 136 | 137 | ||
| 137 | ret = drm_gem_handle_create(file_priv, obj, &handle); | 138 | ret = drm_gem_handle_create(file_priv, obj, &handle); |
| 138 | drm_gem_object_unreference_unlocked(obj); | 139 | if (ret) { |
| 139 | if (ret) | 140 | drm_gem_object_unreference_unlocked(obj); |
| 140 | return ret; | 141 | return ret; |
| 142 | } | ||
| 141 | 143 | ||
| 142 | args->handle = handle; | 144 | /* Sink the floating reference from kref_init(handlecount) */ |
| 145 | drm_gem_object_handle_unreference_unlocked(obj); | ||
| 143 | 146 | ||
| 147 | args->handle = handle; | ||
| 144 | return 0; | 148 | return 0; |
| 145 | } | 149 | } |
| 146 | 150 | ||
| @@ -3585,6 +3589,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
| 3585 | if (ret != 0) { | 3589 | if (ret != 0) { |
| 3586 | DRM_ERROR("copy %d cliprects failed: %d\n", | 3590 | DRM_ERROR("copy %d cliprects failed: %d\n", |
| 3587 | args->num_cliprects, ret); | 3591 | args->num_cliprects, ret); |
| 3592 | ret = -EFAULT; | ||
| 3588 | goto pre_mutex_err; | 3593 | goto pre_mutex_err; |
| 3589 | } | 3594 | } |
| 3590 | } | 3595 | } |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 16861b800fee..744225ebb4b2 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
| @@ -887,6 +887,49 @@ static void i915_handle_error(struct drm_device *dev, bool wedged) | |||
| 887 | queue_work(dev_priv->wq, &dev_priv->error_work); | 887 | queue_work(dev_priv->wq, &dev_priv->error_work); |
| 888 | } | 888 | } |
| 889 | 889 | ||
| 890 | static void i915_pageflip_stall_check(struct drm_device *dev, int pipe) | ||
| 891 | { | ||
| 892 | drm_i915_private_t *dev_priv = dev->dev_private; | ||
| 893 | struct drm_crtc *crtc = dev_priv->pipe_to_crtc_mapping[pipe]; | ||
| 894 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | ||
| 895 | struct drm_i915_gem_object *obj_priv; | ||
| 896 | struct intel_unpin_work *work; | ||
| 897 | unsigned long flags; | ||
| 898 | bool stall_detected; | ||
| 899 | |||
| 900 | /* Ignore early vblank irqs */ | ||
| 901 | if (intel_crtc == NULL) | ||
| 902 | return; | ||
| 903 | |||
| 904 | spin_lock_irqsave(&dev->event_lock, flags); | ||
| 905 | work = intel_crtc->unpin_work; | ||
| 906 | |||
| 907 | if (work == NULL || work->pending || !work->enable_stall_check) { | ||
| 908 | /* Either the pending flip IRQ arrived, or we're too early. Don't check */ | ||
| 909 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 910 | return; | ||
| 911 | } | ||
| 912 | |||
| 913 | /* Potential stall - if we see that the flip has happened, assume a missed interrupt */ | ||
| 914 | obj_priv = to_intel_bo(work->pending_flip_obj); | ||
| 915 | if(IS_I965G(dev)) { | ||
| 916 | int dspsurf = intel_crtc->plane == 0 ? DSPASURF : DSPBSURF; | ||
| 917 | stall_detected = I915_READ(dspsurf) == obj_priv->gtt_offset; | ||
| 918 | } else { | ||
| 919 | int dspaddr = intel_crtc->plane == 0 ? DSPAADDR : DSPBADDR; | ||
| 920 | stall_detected = I915_READ(dspaddr) == (obj_priv->gtt_offset + | ||
| 921 | crtc->y * crtc->fb->pitch + | ||
| 922 | crtc->x * crtc->fb->bits_per_pixel/8); | ||
| 923 | } | ||
| 924 | |||
| 925 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 926 | |||
| 927 | if (stall_detected) { | ||
| 928 | DRM_DEBUG_DRIVER("Pageflip stall detected\n"); | ||
| 929 | intel_prepare_page_flip(dev, intel_crtc->plane); | ||
| 930 | } | ||
| 931 | } | ||
| 932 | |||
| 890 | irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | 933 | irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) |
| 891 | { | 934 | { |
| 892 | struct drm_device *dev = (struct drm_device *) arg; | 935 | struct drm_device *dev = (struct drm_device *) arg; |
| @@ -1004,15 +1047,19 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) | |||
| 1004 | if (pipea_stats & vblank_status) { | 1047 | if (pipea_stats & vblank_status) { |
| 1005 | vblank++; | 1048 | vblank++; |
| 1006 | drm_handle_vblank(dev, 0); | 1049 | drm_handle_vblank(dev, 0); |
| 1007 | if (!dev_priv->flip_pending_is_done) | 1050 | if (!dev_priv->flip_pending_is_done) { |
| 1051 | i915_pageflip_stall_check(dev, 0); | ||
| 1008 | intel_finish_page_flip(dev, 0); | 1052 | intel_finish_page_flip(dev, 0); |
| 1053 | } | ||
| 1009 | } | 1054 | } |
| 1010 | 1055 | ||
| 1011 | if (pipeb_stats & vblank_status) { | 1056 | if (pipeb_stats & vblank_status) { |
| 1012 | vblank++; | 1057 | vblank++; |
| 1013 | drm_handle_vblank(dev, 1); | 1058 | drm_handle_vblank(dev, 1); |
| 1014 | if (!dev_priv->flip_pending_is_done) | 1059 | if (!dev_priv->flip_pending_is_done) { |
| 1060 | i915_pageflip_stall_check(dev, 1); | ||
| 1015 | intel_finish_page_flip(dev, 1); | 1061 | intel_finish_page_flip(dev, 1); |
| 1062 | } | ||
| 1016 | } | 1063 | } |
| 1017 | 1064 | ||
| 1018 | if ((pipea_stats & PIPE_LEGACY_BLC_EVENT_STATUS) || | 1065 | if ((pipea_stats & PIPE_LEGACY_BLC_EVENT_STATUS) || |
| @@ -1303,17 +1350,25 @@ void i915_hangcheck_elapsed(unsigned long data) | |||
| 1303 | i915_seqno_passed(i915_get_gem_seqno(dev, | 1350 | i915_seqno_passed(i915_get_gem_seqno(dev, |
| 1304 | &dev_priv->render_ring), | 1351 | &dev_priv->render_ring), |
| 1305 | i915_get_tail_request(dev)->seqno)) { | 1352 | i915_get_tail_request(dev)->seqno)) { |
| 1353 | bool missed_wakeup = false; | ||
| 1354 | |||
| 1306 | dev_priv->hangcheck_count = 0; | 1355 | dev_priv->hangcheck_count = 0; |
| 1307 | 1356 | ||
| 1308 | /* Issue a wake-up to catch stuck h/w. */ | 1357 | /* Issue a wake-up to catch stuck h/w. */ |
| 1309 | if (dev_priv->render_ring.waiting_gem_seqno | | 1358 | if (dev_priv->render_ring.waiting_gem_seqno && |
| 1310 | dev_priv->bsd_ring.waiting_gem_seqno) { | 1359 | waitqueue_active(&dev_priv->render_ring.irq_queue)) { |
| 1311 | DRM_ERROR("Hangcheck timer elapsed... GPU idle, missed IRQ.\n"); | 1360 | DRM_WAKEUP(&dev_priv->render_ring.irq_queue); |
| 1312 | if (dev_priv->render_ring.waiting_gem_seqno) | 1361 | missed_wakeup = true; |
| 1313 | DRM_WAKEUP(&dev_priv->render_ring.irq_queue); | ||
| 1314 | if (dev_priv->bsd_ring.waiting_gem_seqno) | ||
| 1315 | DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); | ||
| 1316 | } | 1362 | } |
| 1363 | |||
| 1364 | if (dev_priv->bsd_ring.waiting_gem_seqno && | ||
| 1365 | waitqueue_active(&dev_priv->bsd_ring.irq_queue)) { | ||
| 1366 | DRM_WAKEUP(&dev_priv->bsd_ring.irq_queue); | ||
| 1367 | missed_wakeup = true; | ||
| 1368 | } | ||
| 1369 | |||
| 1370 | if (missed_wakeup) | ||
| 1371 | DRM_ERROR("Hangcheck timer elapsed... GPU idle, missed IRQ.\n"); | ||
| 1317 | return; | 1372 | return; |
| 1318 | } | 1373 | } |
| 1319 | 1374 | ||
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 67e3ec1a6af9..4f5e15577e89 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -319,6 +319,7 @@ | |||
| 319 | 319 | ||
| 320 | #define MI_MODE 0x0209c | 320 | #define MI_MODE 0x0209c |
| 321 | # define VS_TIMER_DISPATCH (1 << 6) | 321 | # define VS_TIMER_DISPATCH (1 << 6) |
| 322 | # define MI_FLUSH_ENABLE (1 << 11) | ||
| 322 | 323 | ||
| 323 | #define SCPD0 0x0209c /* 915+ only */ | 324 | #define SCPD0 0x0209c /* 915+ only */ |
| 324 | #define IER 0x020a0 | 325 | #define IER 0x020a0 |
| @@ -2205,9 +2206,17 @@ | |||
| 2205 | #define WM1_LP_SR_EN (1<<31) | 2206 | #define WM1_LP_SR_EN (1<<31) |
| 2206 | #define WM1_LP_LATENCY_SHIFT 24 | 2207 | #define WM1_LP_LATENCY_SHIFT 24 |
| 2207 | #define WM1_LP_LATENCY_MASK (0x7f<<24) | 2208 | #define WM1_LP_LATENCY_MASK (0x7f<<24) |
| 2209 | #define WM1_LP_FBC_LP1_MASK (0xf<<20) | ||
| 2210 | #define WM1_LP_FBC_LP1_SHIFT 20 | ||
| 2208 | #define WM1_LP_SR_MASK (0x1ff<<8) | 2211 | #define WM1_LP_SR_MASK (0x1ff<<8) |
| 2209 | #define WM1_LP_SR_SHIFT 8 | 2212 | #define WM1_LP_SR_SHIFT 8 |
| 2210 | #define WM1_LP_CURSOR_MASK (0x3f) | 2213 | #define WM1_LP_CURSOR_MASK (0x3f) |
| 2214 | #define WM2_LP_ILK 0x4510c | ||
| 2215 | #define WM2_LP_EN (1<<31) | ||
| 2216 | #define WM3_LP_ILK 0x45110 | ||
| 2217 | #define WM3_LP_EN (1<<31) | ||
| 2218 | #define WM1S_LP_ILK 0x45120 | ||
| 2219 | #define WM1S_LP_EN (1<<31) | ||
| 2211 | 2220 | ||
| 2212 | /* Memory latency timer register */ | 2221 | /* Memory latency timer register */ |
| 2213 | #define MLTR_ILK 0x11222 | 2222 | #define MLTR_ILK 0x11222 |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 11a3394f5fe1..19daead5b525 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -990,6 +990,22 @@ void intel_wait_for_vblank(struct drm_device *dev, int pipe) | |||
| 990 | struct drm_i915_private *dev_priv = dev->dev_private; | 990 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 991 | int pipestat_reg = (pipe == 0 ? PIPEASTAT : PIPEBSTAT); | 991 | int pipestat_reg = (pipe == 0 ? PIPEASTAT : PIPEBSTAT); |
| 992 | 992 | ||
| 993 | /* Clear existing vblank status. Note this will clear any other | ||
| 994 | * sticky status fields as well. | ||
| 995 | * | ||
| 996 | * This races with i915_driver_irq_handler() with the result | ||
| 997 | * that either function could miss a vblank event. Here it is not | ||
| 998 | * fatal, as we will either wait upon the next vblank interrupt or | ||
| 999 | * timeout. Generally speaking intel_wait_for_vblank() is only | ||
| 1000 | * called during modeset at which time the GPU should be idle and | ||
| 1001 | * should *not* be performing page flips and thus not waiting on | ||
| 1002 | * vblanks... | ||
| 1003 | * Currently, the result of us stealing a vblank from the irq | ||
| 1004 | * handler is that a single frame will be skipped during swapbuffers. | ||
| 1005 | */ | ||
| 1006 | I915_WRITE(pipestat_reg, | ||
| 1007 | I915_READ(pipestat_reg) | PIPE_VBLANK_INTERRUPT_STATUS); | ||
| 1008 | |||
| 993 | /* Wait for vblank interrupt bit to set */ | 1009 | /* Wait for vblank interrupt bit to set */ |
| 994 | if (wait_for((I915_READ(pipestat_reg) & | 1010 | if (wait_for((I915_READ(pipestat_reg) & |
| 995 | PIPE_VBLANK_INTERRUPT_STATUS), | 1011 | PIPE_VBLANK_INTERRUPT_STATUS), |
| @@ -1486,7 +1502,7 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
| 1486 | dspcntr &= ~DISPPLANE_TILED; | 1502 | dspcntr &= ~DISPPLANE_TILED; |
| 1487 | } | 1503 | } |
| 1488 | 1504 | ||
| 1489 | if (IS_IRONLAKE(dev)) | 1505 | if (HAS_PCH_SPLIT(dev)) |
| 1490 | /* must disable */ | 1506 | /* must disable */ |
| 1491 | dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; | 1507 | dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; |
| 1492 | 1508 | ||
| @@ -1495,20 +1511,19 @@ intel_pipe_set_base_atomic(struct drm_crtc *crtc, struct drm_framebuffer *fb, | |||
| 1495 | Start = obj_priv->gtt_offset; | 1511 | Start = obj_priv->gtt_offset; |
| 1496 | Offset = y * fb->pitch + x * (fb->bits_per_pixel / 8); | 1512 | Offset = y * fb->pitch + x * (fb->bits_per_pixel / 8); |
| 1497 | 1513 | ||
| 1498 | DRM_DEBUG("Writing base %08lX %08lX %d %d\n", Start, Offset, x, y); | 1514 | DRM_DEBUG_KMS("Writing base %08lX %08lX %d %d %d\n", |
| 1515 | Start, Offset, x, y, fb->pitch); | ||
| 1499 | I915_WRITE(dspstride, fb->pitch); | 1516 | I915_WRITE(dspstride, fb->pitch); |
| 1500 | if (IS_I965G(dev)) { | 1517 | if (IS_I965G(dev)) { |
| 1501 | I915_WRITE(dspbase, Offset); | ||
| 1502 | I915_READ(dspbase); | ||
| 1503 | I915_WRITE(dspsurf, Start); | 1518 | I915_WRITE(dspsurf, Start); |
| 1504 | I915_READ(dspsurf); | ||
| 1505 | I915_WRITE(dsptileoff, (y << 16) | x); | 1519 | I915_WRITE(dsptileoff, (y << 16) | x); |
| 1520 | I915_WRITE(dspbase, Offset); | ||
| 1506 | } else { | 1521 | } else { |
| 1507 | I915_WRITE(dspbase, Start + Offset); | 1522 | I915_WRITE(dspbase, Start + Offset); |
| 1508 | I915_READ(dspbase); | ||
| 1509 | } | 1523 | } |
| 1524 | POSTING_READ(dspbase); | ||
| 1510 | 1525 | ||
| 1511 | if ((IS_I965G(dev) || plane == 0)) | 1526 | if (IS_I965G(dev) || plane == 0) |
| 1512 | intel_update_fbc(crtc, &crtc->mode); | 1527 | intel_update_fbc(crtc, &crtc->mode); |
| 1513 | 1528 | ||
| 1514 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 1529 | intel_wait_for_vblank(dev, intel_crtc->pipe); |
| @@ -1522,7 +1537,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
| 1522 | struct drm_framebuffer *old_fb) | 1537 | struct drm_framebuffer *old_fb) |
| 1523 | { | 1538 | { |
| 1524 | struct drm_device *dev = crtc->dev; | 1539 | struct drm_device *dev = crtc->dev; |
| 1525 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1526 | struct drm_i915_master_private *master_priv; | 1540 | struct drm_i915_master_private *master_priv; |
| 1527 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 1541 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
| 1528 | struct intel_framebuffer *intel_fb; | 1542 | struct intel_framebuffer *intel_fb; |
| @@ -1530,13 +1544,6 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
| 1530 | struct drm_gem_object *obj; | 1544 | struct drm_gem_object *obj; |
| 1531 | int pipe = intel_crtc->pipe; | 1545 | int pipe = intel_crtc->pipe; |
| 1532 | int plane = intel_crtc->plane; | 1546 | int plane = intel_crtc->plane; |
| 1533 | unsigned long Start, Offset; | ||
| 1534 | int dspbase = (plane == 0 ? DSPAADDR : DSPBADDR); | ||
| 1535 | int dspsurf = (plane == 0 ? DSPASURF : DSPBSURF); | ||
| 1536 | int dspstride = (plane == 0) ? DSPASTRIDE : DSPBSTRIDE; | ||
| 1537 | int dsptileoff = (plane == 0 ? DSPATILEOFF : DSPBTILEOFF); | ||
| 1538 | int dspcntr_reg = (plane == 0) ? DSPACNTR : DSPBCNTR; | ||
| 1539 | u32 dspcntr; | ||
| 1540 | int ret; | 1547 | int ret; |
| 1541 | 1548 | ||
| 1542 | /* no fb bound */ | 1549 | /* no fb bound */ |
| @@ -1572,71 +1579,18 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, | |||
| 1572 | return ret; | 1579 | return ret; |
| 1573 | } | 1580 | } |
| 1574 | 1581 | ||
| 1575 | dspcntr = I915_READ(dspcntr_reg); | 1582 | ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y); |
| 1576 | /* Mask out pixel format bits in case we change it */ | 1583 | if (ret) { |
| 1577 | dspcntr &= ~DISPPLANE_PIXFORMAT_MASK; | ||
| 1578 | switch (crtc->fb->bits_per_pixel) { | ||
| 1579 | case 8: | ||
| 1580 | dspcntr |= DISPPLANE_8BPP; | ||
| 1581 | break; | ||
| 1582 | case 16: | ||
| 1583 | if (crtc->fb->depth == 15) | ||
| 1584 | dspcntr |= DISPPLANE_15_16BPP; | ||
| 1585 | else | ||
| 1586 | dspcntr |= DISPPLANE_16BPP; | ||
| 1587 | break; | ||
| 1588 | case 24: | ||
| 1589 | case 32: | ||
| 1590 | if (crtc->fb->depth == 30) | ||
| 1591 | dspcntr |= DISPPLANE_32BPP_30BIT_NO_ALPHA; | ||
| 1592 | else | ||
| 1593 | dspcntr |= DISPPLANE_32BPP_NO_ALPHA; | ||
| 1594 | break; | ||
| 1595 | default: | ||
| 1596 | DRM_ERROR("Unknown color depth\n"); | ||
| 1597 | i915_gem_object_unpin(obj); | 1584 | i915_gem_object_unpin(obj); |
| 1598 | mutex_unlock(&dev->struct_mutex); | 1585 | mutex_unlock(&dev->struct_mutex); |
| 1599 | return -EINVAL; | 1586 | return ret; |
| 1600 | } | ||
| 1601 | if (IS_I965G(dev)) { | ||
| 1602 | if (obj_priv->tiling_mode != I915_TILING_NONE) | ||
| 1603 | dspcntr |= DISPPLANE_TILED; | ||
| 1604 | else | ||
| 1605 | dspcntr &= ~DISPPLANE_TILED; | ||
| 1606 | } | ||
| 1607 | |||
| 1608 | if (HAS_PCH_SPLIT(dev)) | ||
| 1609 | /* must disable */ | ||
| 1610 | dspcntr |= DISPPLANE_TRICKLE_FEED_DISABLE; | ||
| 1611 | |||
| 1612 | I915_WRITE(dspcntr_reg, dspcntr); | ||
| 1613 | |||
| 1614 | Start = obj_priv->gtt_offset; | ||
| 1615 | Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8); | ||
| 1616 | |||
| 1617 | DRM_DEBUG_KMS("Writing base %08lX %08lX %d %d %d\n", | ||
| 1618 | Start, Offset, x, y, crtc->fb->pitch); | ||
| 1619 | I915_WRITE(dspstride, crtc->fb->pitch); | ||
| 1620 | if (IS_I965G(dev)) { | ||
| 1621 | I915_WRITE(dspsurf, Start); | ||
| 1622 | I915_WRITE(dsptileoff, (y << 16) | x); | ||
| 1623 | I915_WRITE(dspbase, Offset); | ||
| 1624 | } else { | ||
| 1625 | I915_WRITE(dspbase, Start + Offset); | ||
| 1626 | } | 1587 | } |
| 1627 | POSTING_READ(dspbase); | ||
| 1628 | |||
| 1629 | if ((IS_I965G(dev) || plane == 0)) | ||
| 1630 | intel_update_fbc(crtc, &crtc->mode); | ||
| 1631 | |||
| 1632 | intel_wait_for_vblank(dev, pipe); | ||
| 1633 | 1588 | ||
| 1634 | if (old_fb) { | 1589 | if (old_fb) { |
| 1635 | intel_fb = to_intel_framebuffer(old_fb); | 1590 | intel_fb = to_intel_framebuffer(old_fb); |
| 1636 | obj_priv = to_intel_bo(intel_fb->obj); | 1591 | obj_priv = to_intel_bo(intel_fb->obj); |
| 1637 | i915_gem_object_unpin(intel_fb->obj); | 1592 | i915_gem_object_unpin(intel_fb->obj); |
| 1638 | } | 1593 | } |
| 1639 | intel_increase_pllclock(crtc, true); | ||
| 1640 | 1594 | ||
| 1641 | mutex_unlock(&dev->struct_mutex); | 1595 | mutex_unlock(&dev->struct_mutex); |
| 1642 | 1596 | ||
| @@ -1911,9 +1865,6 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 1911 | int fdi_tx_reg = (pipe == 0) ? FDI_TXA_CTL : FDI_TXB_CTL; | 1865 | int fdi_tx_reg = (pipe == 0) ? FDI_TXA_CTL : FDI_TXB_CTL; |
| 1912 | int fdi_rx_reg = (pipe == 0) ? FDI_RXA_CTL : FDI_RXB_CTL; | 1866 | int fdi_rx_reg = (pipe == 0) ? FDI_RXA_CTL : FDI_RXB_CTL; |
| 1913 | int transconf_reg = (pipe == 0) ? TRANSACONF : TRANSBCONF; | 1867 | int transconf_reg = (pipe == 0) ? TRANSACONF : TRANSBCONF; |
| 1914 | int pf_ctl_reg = (pipe == 0) ? PFA_CTL_1 : PFB_CTL_1; | ||
| 1915 | int pf_win_size = (pipe == 0) ? PFA_WIN_SZ : PFB_WIN_SZ; | ||
| 1916 | int pf_win_pos = (pipe == 0) ? PFA_WIN_POS : PFB_WIN_POS; | ||
| 1917 | int cpu_htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B; | 1868 | int cpu_htot_reg = (pipe == 0) ? HTOTAL_A : HTOTAL_B; |
| 1918 | int cpu_hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B; | 1869 | int cpu_hblank_reg = (pipe == 0) ? HBLANK_A : HBLANK_B; |
| 1919 | int cpu_hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B; | 1870 | int cpu_hsync_reg = (pipe == 0) ? HSYNC_A : HSYNC_B; |
| @@ -1982,15 +1933,19 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 1982 | } | 1933 | } |
| 1983 | 1934 | ||
| 1984 | /* Enable panel fitting for LVDS */ | 1935 | /* Enable panel fitting for LVDS */ |
| 1985 | if (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) | 1936 | if (dev_priv->pch_pf_size && |
| 1986 | || HAS_eDP || intel_pch_has_edp(crtc)) { | 1937 | (intel_pipe_has_type(crtc, INTEL_OUTPUT_LVDS) |
| 1987 | if (dev_priv->pch_pf_size) { | 1938 | || HAS_eDP || intel_pch_has_edp(crtc))) { |
| 1988 | temp = I915_READ(pf_ctl_reg); | 1939 | /* Force use of hard-coded filter coefficients |
| 1989 | I915_WRITE(pf_ctl_reg, temp | PF_ENABLE | PF_FILTER_MED_3x3); | 1940 | * as some pre-programmed values are broken, |
| 1990 | I915_WRITE(pf_win_pos, dev_priv->pch_pf_pos); | 1941 | * e.g. x201. |
| 1991 | I915_WRITE(pf_win_size, dev_priv->pch_pf_size); | 1942 | */ |
| 1992 | } else | 1943 | I915_WRITE(pipe ? PFB_CTL_1 : PFA_CTL_1, |
| 1993 | I915_WRITE(pf_ctl_reg, temp & ~PF_ENABLE); | 1944 | PF_ENABLE | PF_FILTER_MED_3x3); |
| 1945 | I915_WRITE(pipe ? PFB_WIN_POS : PFA_WIN_POS, | ||
| 1946 | dev_priv->pch_pf_pos); | ||
| 1947 | I915_WRITE(pipe ? PFB_WIN_SZ : PFA_WIN_SZ, | ||
| 1948 | dev_priv->pch_pf_size); | ||
| 1994 | } | 1949 | } |
| 1995 | 1950 | ||
| 1996 | /* Enable CPU pipe */ | 1951 | /* Enable CPU pipe */ |
| @@ -2115,7 +2070,7 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2115 | I915_WRITE(transconf_reg, temp | TRANS_ENABLE); | 2070 | I915_WRITE(transconf_reg, temp | TRANS_ENABLE); |
| 2116 | I915_READ(transconf_reg); | 2071 | I915_READ(transconf_reg); |
| 2117 | 2072 | ||
| 2118 | if (wait_for(I915_READ(transconf_reg) & TRANS_STATE_ENABLE, 10, 0)) | 2073 | if (wait_for(I915_READ(transconf_reg) & TRANS_STATE_ENABLE, 100, 1)) |
| 2119 | DRM_ERROR("failed to enable transcoder\n"); | 2074 | DRM_ERROR("failed to enable transcoder\n"); |
| 2120 | } | 2075 | } |
| 2121 | 2076 | ||
| @@ -2155,14 +2110,8 @@ static void ironlake_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2155 | udelay(100); | 2110 | udelay(100); |
| 2156 | 2111 | ||
| 2157 | /* Disable PF */ | 2112 | /* Disable PF */ |
| 2158 | temp = I915_READ(pf_ctl_reg); | 2113 | I915_WRITE(pipe ? PFB_CTL_1 : PFA_CTL_1, 0); |
| 2159 | if ((temp & PF_ENABLE) != 0) { | 2114 | I915_WRITE(pipe ? PFB_WIN_SZ : PFA_WIN_SZ, 0); |
| 2160 | I915_WRITE(pf_ctl_reg, temp & ~PF_ENABLE); | ||
| 2161 | I915_READ(pf_ctl_reg); | ||
| 2162 | } | ||
| 2163 | I915_WRITE(pf_win_size, 0); | ||
| 2164 | POSTING_READ(pf_win_size); | ||
| 2165 | |||
| 2166 | 2115 | ||
| 2167 | /* disable CPU FDI tx and PCH FDI rx */ | 2116 | /* disable CPU FDI tx and PCH FDI rx */ |
| 2168 | temp = I915_READ(fdi_tx_reg); | 2117 | temp = I915_READ(fdi_tx_reg); |
| @@ -2421,6 +2370,9 @@ static void intel_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
| 2421 | int pipe = intel_crtc->pipe; | 2370 | int pipe = intel_crtc->pipe; |
| 2422 | bool enabled; | 2371 | bool enabled; |
| 2423 | 2372 | ||
| 2373 | if (intel_crtc->dpms_mode == mode) | ||
| 2374 | return; | ||
| 2375 | |||
| 2424 | intel_crtc->dpms_mode = mode; | 2376 | intel_crtc->dpms_mode = mode; |
| 2425 | intel_crtc->cursor_on = mode == DRM_MODE_DPMS_ON; | 2377 | intel_crtc->cursor_on = mode == DRM_MODE_DPMS_ON; |
| 2426 | 2378 | ||
| @@ -2815,14 +2767,8 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz, | |||
| 2815 | /* Don't promote wm_size to unsigned... */ | 2767 | /* Don't promote wm_size to unsigned... */ |
| 2816 | if (wm_size > (long)wm->max_wm) | 2768 | if (wm_size > (long)wm->max_wm) |
| 2817 | wm_size = wm->max_wm; | 2769 | wm_size = wm->max_wm; |
| 2818 | if (wm_size <= 0) { | 2770 | if (wm_size <= 0) |
| 2819 | wm_size = wm->default_wm; | 2771 | wm_size = wm->default_wm; |
| 2820 | DRM_ERROR("Insufficient FIFO for plane, expect flickering:" | ||
| 2821 | " entries required = %ld, available = %lu.\n", | ||
| 2822 | entries_required + wm->guard_size, | ||
| 2823 | wm->fifo_size); | ||
| 2824 | } | ||
| 2825 | |||
| 2826 | return wm_size; | 2772 | return wm_size; |
| 2827 | } | 2773 | } |
| 2828 | 2774 | ||
| @@ -3436,8 +3382,7 @@ static void ironlake_update_wm(struct drm_device *dev, int planea_clock, | |||
| 3436 | reg_value = I915_READ(WM1_LP_ILK); | 3382 | reg_value = I915_READ(WM1_LP_ILK); |
| 3437 | reg_value &= ~(WM1_LP_LATENCY_MASK | WM1_LP_SR_MASK | | 3383 | reg_value &= ~(WM1_LP_LATENCY_MASK | WM1_LP_SR_MASK | |
| 3438 | WM1_LP_CURSOR_MASK); | 3384 | WM1_LP_CURSOR_MASK); |
| 3439 | reg_value |= WM1_LP_SR_EN | | 3385 | reg_value |= (ilk_sr_latency << WM1_LP_LATENCY_SHIFT) | |
| 3440 | (ilk_sr_latency << WM1_LP_LATENCY_SHIFT) | | ||
| 3441 | (sr_wm << WM1_LP_SR_SHIFT) | cursor_wm; | 3386 | (sr_wm << WM1_LP_SR_SHIFT) | cursor_wm; |
| 3442 | 3387 | ||
| 3443 | I915_WRITE(WM1_LP_ILK, reg_value); | 3388 | I915_WRITE(WM1_LP_ILK, reg_value); |
| @@ -3554,10 +3499,9 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3554 | u32 dpll = 0, fp = 0, fp2 = 0, dspcntr, pipeconf; | 3499 | u32 dpll = 0, fp = 0, fp2 = 0, dspcntr, pipeconf; |
| 3555 | bool ok, has_reduced_clock = false, is_sdvo = false, is_dvo = false; | 3500 | bool ok, has_reduced_clock = false, is_sdvo = false, is_dvo = false; |
| 3556 | bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false; | 3501 | bool is_crt = false, is_lvds = false, is_tv = false, is_dp = false; |
| 3557 | bool is_edp = false; | 3502 | struct intel_encoder *has_edp_encoder = NULL; |
| 3558 | struct drm_mode_config *mode_config = &dev->mode_config; | 3503 | struct drm_mode_config *mode_config = &dev->mode_config; |
| 3559 | struct drm_encoder *encoder; | 3504 | struct drm_encoder *encoder; |
| 3560 | struct intel_encoder *intel_encoder = NULL; | ||
| 3561 | const intel_limit_t *limit; | 3505 | const intel_limit_t *limit; |
| 3562 | int ret; | 3506 | int ret; |
| 3563 | struct fdi_m_n m_n = {0}; | 3507 | struct fdi_m_n m_n = {0}; |
| @@ -3578,12 +3522,12 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3578 | drm_vblank_pre_modeset(dev, pipe); | 3522 | drm_vblank_pre_modeset(dev, pipe); |
| 3579 | 3523 | ||
| 3580 | list_for_each_entry(encoder, &mode_config->encoder_list, head) { | 3524 | list_for_each_entry(encoder, &mode_config->encoder_list, head) { |
| 3525 | struct intel_encoder *intel_encoder; | ||
| 3581 | 3526 | ||
| 3582 | if (!encoder || encoder->crtc != crtc) | 3527 | if (encoder->crtc != crtc) |
| 3583 | continue; | 3528 | continue; |
| 3584 | 3529 | ||
| 3585 | intel_encoder = enc_to_intel_encoder(encoder); | 3530 | intel_encoder = enc_to_intel_encoder(encoder); |
| 3586 | |||
| 3587 | switch (intel_encoder->type) { | 3531 | switch (intel_encoder->type) { |
| 3588 | case INTEL_OUTPUT_LVDS: | 3532 | case INTEL_OUTPUT_LVDS: |
| 3589 | is_lvds = true; | 3533 | is_lvds = true; |
| @@ -3607,7 +3551,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3607 | is_dp = true; | 3551 | is_dp = true; |
| 3608 | break; | 3552 | break; |
| 3609 | case INTEL_OUTPUT_EDP: | 3553 | case INTEL_OUTPUT_EDP: |
| 3610 | is_edp = true; | 3554 | has_edp_encoder = intel_encoder; |
| 3611 | break; | 3555 | break; |
| 3612 | } | 3556 | } |
| 3613 | 3557 | ||
| @@ -3685,10 +3629,10 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3685 | int lane = 0, link_bw, bpp; | 3629 | int lane = 0, link_bw, bpp; |
| 3686 | /* eDP doesn't require FDI link, so just set DP M/N | 3630 | /* eDP doesn't require FDI link, so just set DP M/N |
| 3687 | according to current link config */ | 3631 | according to current link config */ |
| 3688 | if (is_edp) { | 3632 | if (has_edp_encoder) { |
| 3689 | target_clock = mode->clock; | 3633 | target_clock = mode->clock; |
| 3690 | intel_edp_link_config(intel_encoder, | 3634 | intel_edp_link_config(has_edp_encoder, |
| 3691 | &lane, &link_bw); | 3635 | &lane, &link_bw); |
| 3692 | } else { | 3636 | } else { |
| 3693 | /* DP over FDI requires target mode clock | 3637 | /* DP over FDI requires target mode clock |
| 3694 | instead of link clock */ | 3638 | instead of link clock */ |
| @@ -3709,7 +3653,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3709 | temp |= PIPE_8BPC; | 3653 | temp |= PIPE_8BPC; |
| 3710 | else | 3654 | else |
| 3711 | temp |= PIPE_6BPC; | 3655 | temp |= PIPE_6BPC; |
| 3712 | } else if (is_edp || (is_dp && intel_pch_has_edp(crtc))) { | 3656 | } else if (has_edp_encoder || (is_dp && intel_pch_has_edp(crtc))) { |
| 3713 | switch (dev_priv->edp_bpp/3) { | 3657 | switch (dev_priv->edp_bpp/3) { |
| 3714 | case 8: | 3658 | case 8: |
| 3715 | temp |= PIPE_8BPC; | 3659 | temp |= PIPE_8BPC; |
| @@ -3782,7 +3726,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3782 | 3726 | ||
| 3783 | udelay(200); | 3727 | udelay(200); |
| 3784 | 3728 | ||
| 3785 | if (is_edp) { | 3729 | if (has_edp_encoder) { |
| 3786 | if (dev_priv->lvds_use_ssc) { | 3730 | if (dev_priv->lvds_use_ssc) { |
| 3787 | temp |= DREF_SSC1_ENABLE; | 3731 | temp |= DREF_SSC1_ENABLE; |
| 3788 | I915_WRITE(PCH_DREF_CONTROL, temp); | 3732 | I915_WRITE(PCH_DREF_CONTROL, temp); |
| @@ -3931,7 +3875,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3931 | dpll_reg = pch_dpll_reg; | 3875 | dpll_reg = pch_dpll_reg; |
| 3932 | } | 3876 | } |
| 3933 | 3877 | ||
| 3934 | if (!is_edp) { | 3878 | if (!has_edp_encoder) { |
| 3935 | I915_WRITE(fp_reg, fp); | 3879 | I915_WRITE(fp_reg, fp); |
| 3936 | I915_WRITE(dpll_reg, dpll & ~DPLL_VCO_ENABLE); | 3880 | I915_WRITE(dpll_reg, dpll & ~DPLL_VCO_ENABLE); |
| 3937 | I915_READ(dpll_reg); | 3881 | I915_READ(dpll_reg); |
| @@ -4026,7 +3970,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 4026 | } | 3970 | } |
| 4027 | } | 3971 | } |
| 4028 | 3972 | ||
| 4029 | if (!is_edp) { | 3973 | if (!has_edp_encoder) { |
| 4030 | I915_WRITE(fp_reg, fp); | 3974 | I915_WRITE(fp_reg, fp); |
| 4031 | I915_WRITE(dpll_reg, dpll); | 3975 | I915_WRITE(dpll_reg, dpll); |
| 4032 | I915_READ(dpll_reg); | 3976 | I915_READ(dpll_reg); |
| @@ -4105,7 +4049,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 4105 | I915_WRITE(link_m1_reg, m_n.link_m); | 4049 | I915_WRITE(link_m1_reg, m_n.link_m); |
| 4106 | I915_WRITE(link_n1_reg, m_n.link_n); | 4050 | I915_WRITE(link_n1_reg, m_n.link_n); |
| 4107 | 4051 | ||
| 4108 | if (is_edp) { | 4052 | if (has_edp_encoder) { |
| 4109 | ironlake_set_pll_edp(crtc, adjusted_mode->clock); | 4053 | ironlake_set_pll_edp(crtc, adjusted_mode->clock); |
| 4110 | } else { | 4054 | } else { |
| 4111 | /* enable FDI RX PLL too */ | 4055 | /* enable FDI RX PLL too */ |
| @@ -4911,15 +4855,6 @@ static void intel_crtc_destroy(struct drm_crtc *crtc) | |||
| 4911 | kfree(intel_crtc); | 4855 | kfree(intel_crtc); |
| 4912 | } | 4856 | } |
| 4913 | 4857 | ||
| 4914 | struct intel_unpin_work { | ||
| 4915 | struct work_struct work; | ||
| 4916 | struct drm_device *dev; | ||
| 4917 | struct drm_gem_object *old_fb_obj; | ||
| 4918 | struct drm_gem_object *pending_flip_obj; | ||
| 4919 | struct drm_pending_vblank_event *event; | ||
| 4920 | int pending; | ||
| 4921 | }; | ||
| 4922 | |||
| 4923 | static void intel_unpin_work_fn(struct work_struct *__work) | 4858 | static void intel_unpin_work_fn(struct work_struct *__work) |
| 4924 | { | 4859 | { |
| 4925 | struct intel_unpin_work *work = | 4860 | struct intel_unpin_work *work = |
| @@ -5007,7 +4942,8 @@ void intel_prepare_page_flip(struct drm_device *dev, int plane) | |||
| 5007 | 4942 | ||
| 5008 | spin_lock_irqsave(&dev->event_lock, flags); | 4943 | spin_lock_irqsave(&dev->event_lock, flags); |
| 5009 | if (intel_crtc->unpin_work) { | 4944 | if (intel_crtc->unpin_work) { |
| 5010 | intel_crtc->unpin_work->pending = 1; | 4945 | if ((++intel_crtc->unpin_work->pending) > 1) |
| 4946 | DRM_ERROR("Prepared flip multiple times\n"); | ||
| 5011 | } else { | 4947 | } else { |
| 5012 | DRM_DEBUG_DRIVER("preparing flip with no unpin work?\n"); | 4948 | DRM_DEBUG_DRIVER("preparing flip with no unpin work?\n"); |
| 5013 | } | 4949 | } |
| @@ -5026,9 +4962,9 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
| 5026 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 4962 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
| 5027 | struct intel_unpin_work *work; | 4963 | struct intel_unpin_work *work; |
| 5028 | unsigned long flags, offset; | 4964 | unsigned long flags, offset; |
| 5029 | int pipesrc_reg = (intel_crtc->pipe == 0) ? PIPEASRC : PIPEBSRC; | 4965 | int pipe = intel_crtc->pipe; |
| 5030 | int ret, pipesrc; | 4966 | u32 pf, pipesrc; |
| 5031 | u32 flip_mask; | 4967 | int ret; |
| 5032 | 4968 | ||
| 5033 | work = kzalloc(sizeof *work, GFP_KERNEL); | 4969 | work = kzalloc(sizeof *work, GFP_KERNEL); |
| 5034 | if (work == NULL) | 4970 | if (work == NULL) |
| @@ -5077,42 +5013,73 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
| 5077 | atomic_inc(&obj_priv->pending_flip); | 5013 | atomic_inc(&obj_priv->pending_flip); |
| 5078 | work->pending_flip_obj = obj; | 5014 | work->pending_flip_obj = obj; |
| 5079 | 5015 | ||
| 5080 | if (intel_crtc->plane) | ||
| 5081 | flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; | ||
| 5082 | else | ||
| 5083 | flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; | ||
| 5084 | |||
| 5085 | if (IS_GEN3(dev) || IS_GEN2(dev)) { | 5016 | if (IS_GEN3(dev) || IS_GEN2(dev)) { |
| 5017 | u32 flip_mask; | ||
| 5018 | |||
| 5019 | if (intel_crtc->plane) | ||
| 5020 | flip_mask = MI_WAIT_FOR_PLANE_B_FLIP; | ||
| 5021 | else | ||
| 5022 | flip_mask = MI_WAIT_FOR_PLANE_A_FLIP; | ||
| 5023 | |||
| 5086 | BEGIN_LP_RING(2); | 5024 | BEGIN_LP_RING(2); |
| 5087 | OUT_RING(MI_WAIT_FOR_EVENT | flip_mask); | 5025 | OUT_RING(MI_WAIT_FOR_EVENT | flip_mask); |
| 5088 | OUT_RING(0); | 5026 | OUT_RING(0); |
| 5089 | ADVANCE_LP_RING(); | 5027 | ADVANCE_LP_RING(); |
| 5090 | } | 5028 | } |
| 5091 | 5029 | ||
| 5030 | work->enable_stall_check = true; | ||
| 5031 | |||
| 5092 | /* Offset into the new buffer for cases of shared fbs between CRTCs */ | 5032 | /* Offset into the new buffer for cases of shared fbs between CRTCs */ |
| 5093 | offset = obj_priv->gtt_offset; | 5033 | offset = crtc->y * fb->pitch + crtc->x * fb->bits_per_pixel/8; |
| 5094 | offset += (crtc->y * fb->pitch) + (crtc->x * (fb->bits_per_pixel) / 8); | ||
| 5095 | 5034 | ||
| 5096 | BEGIN_LP_RING(4); | 5035 | BEGIN_LP_RING(4); |
| 5097 | if (IS_I965G(dev)) { | 5036 | switch(INTEL_INFO(dev)->gen) { |
| 5037 | case 2: | ||
| 5098 | OUT_RING(MI_DISPLAY_FLIP | | 5038 | OUT_RING(MI_DISPLAY_FLIP | |
| 5099 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 5039 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
| 5100 | OUT_RING(fb->pitch); | 5040 | OUT_RING(fb->pitch); |
| 5101 | OUT_RING(offset | obj_priv->tiling_mode); | 5041 | OUT_RING(obj_priv->gtt_offset + offset); |
| 5102 | pipesrc = I915_READ(pipesrc_reg); | 5042 | OUT_RING(MI_NOOP); |
| 5103 | OUT_RING(pipesrc & 0x0fff0fff); | 5043 | break; |
| 5104 | } else if (IS_GEN3(dev)) { | 5044 | |
| 5045 | case 3: | ||
| 5105 | OUT_RING(MI_DISPLAY_FLIP_I915 | | 5046 | OUT_RING(MI_DISPLAY_FLIP_I915 | |
| 5106 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 5047 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
| 5107 | OUT_RING(fb->pitch); | 5048 | OUT_RING(fb->pitch); |
| 5108 | OUT_RING(offset); | 5049 | OUT_RING(obj_priv->gtt_offset + offset); |
| 5109 | OUT_RING(MI_NOOP); | 5050 | OUT_RING(MI_NOOP); |
| 5110 | } else { | 5051 | break; |
| 5052 | |||
| 5053 | case 4: | ||
| 5054 | case 5: | ||
| 5055 | /* i965+ uses the linear or tiled offsets from the | ||
| 5056 | * Display Registers (which do not change across a page-flip) | ||
| 5057 | * so we need only reprogram the base address. | ||
| 5058 | */ | ||
| 5111 | OUT_RING(MI_DISPLAY_FLIP | | 5059 | OUT_RING(MI_DISPLAY_FLIP | |
| 5112 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | 5060 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); |
| 5113 | OUT_RING(fb->pitch); | 5061 | OUT_RING(fb->pitch); |
| 5114 | OUT_RING(offset); | 5062 | OUT_RING(obj_priv->gtt_offset | obj_priv->tiling_mode); |
| 5115 | OUT_RING(MI_NOOP); | 5063 | |
| 5064 | /* XXX Enabling the panel-fitter across page-flip is so far | ||
| 5065 | * untested on non-native modes, so ignore it for now. | ||
| 5066 | * pf = I915_READ(pipe == 0 ? PFA_CTL_1 : PFB_CTL_1) & PF_ENABLE; | ||
| 5067 | */ | ||
| 5068 | pf = 0; | ||
| 5069 | pipesrc = I915_READ(pipe == 0 ? PIPEASRC : PIPEBSRC) & 0x0fff0fff; | ||
| 5070 | OUT_RING(pf | pipesrc); | ||
| 5071 | break; | ||
| 5072 | |||
| 5073 | case 6: | ||
| 5074 | OUT_RING(MI_DISPLAY_FLIP | | ||
| 5075 | MI_DISPLAY_FLIP_PLANE(intel_crtc->plane)); | ||
| 5076 | OUT_RING(fb->pitch | obj_priv->tiling_mode); | ||
| 5077 | OUT_RING(obj_priv->gtt_offset); | ||
| 5078 | |||
| 5079 | pf = I915_READ(pipe == 0 ? PFA_CTL_1 : PFB_CTL_1) & PF_ENABLE; | ||
| 5080 | pipesrc = I915_READ(pipe == 0 ? PIPEASRC : PIPEBSRC) & 0x0fff0fff; | ||
| 5081 | OUT_RING(pf | pipesrc); | ||
| 5082 | break; | ||
| 5116 | } | 5083 | } |
| 5117 | ADVANCE_LP_RING(); | 5084 | ADVANCE_LP_RING(); |
| 5118 | 5085 | ||
| @@ -5193,7 +5160,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) | |||
| 5193 | dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base; | 5160 | dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base; |
| 5194 | 5161 | ||
| 5195 | intel_crtc->cursor_addr = 0; | 5162 | intel_crtc->cursor_addr = 0; |
| 5196 | intel_crtc->dpms_mode = DRM_MODE_DPMS_OFF; | 5163 | intel_crtc->dpms_mode = -1; |
| 5197 | drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); | 5164 | drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs); |
| 5198 | 5165 | ||
| 5199 | intel_crtc->busy = false; | 5166 | intel_crtc->busy = false; |
| @@ -5701,6 +5668,9 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
| 5701 | I915_WRITE(DISP_ARB_CTL, | 5668 | I915_WRITE(DISP_ARB_CTL, |
| 5702 | (I915_READ(DISP_ARB_CTL) | | 5669 | (I915_READ(DISP_ARB_CTL) | |
| 5703 | DISP_FBC_WM_DIS)); | 5670 | DISP_FBC_WM_DIS)); |
| 5671 | I915_WRITE(WM3_LP_ILK, 0); | ||
| 5672 | I915_WRITE(WM2_LP_ILK, 0); | ||
| 5673 | I915_WRITE(WM1_LP_ILK, 0); | ||
| 5704 | } | 5674 | } |
| 5705 | /* | 5675 | /* |
| 5706 | * Based on the document from hardware guys the following bits | 5676 | * Based on the document from hardware guys the following bits |
| @@ -5722,8 +5692,7 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
| 5722 | ILK_DPFC_DIS2 | | 5692 | ILK_DPFC_DIS2 | |
| 5723 | ILK_CLK_FBC); | 5693 | ILK_CLK_FBC); |
| 5724 | } | 5694 | } |
| 5725 | if (IS_GEN6(dev)) | 5695 | return; |
| 5726 | return; | ||
| 5727 | } else if (IS_G4X(dev)) { | 5696 | } else if (IS_G4X(dev)) { |
| 5728 | uint32_t dspclk_gate; | 5697 | uint32_t dspclk_gate; |
| 5729 | I915_WRITE(RENCLK_GATE_D1, 0); | 5698 | I915_WRITE(RENCLK_GATE_D1, 0); |
| @@ -5784,11 +5753,9 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
| 5784 | OUT_RING(MI_FLUSH); | 5753 | OUT_RING(MI_FLUSH); |
| 5785 | ADVANCE_LP_RING(); | 5754 | ADVANCE_LP_RING(); |
| 5786 | } | 5755 | } |
| 5787 | } else { | 5756 | } else |
| 5788 | DRM_DEBUG_KMS("Failed to allocate render context." | 5757 | DRM_DEBUG_KMS("Failed to allocate render context." |
| 5789 | "Disable RC6\n"); | 5758 | "Disable RC6\n"); |
| 5790 | return; | ||
| 5791 | } | ||
| 5792 | } | 5759 | } |
| 5793 | 5760 | ||
| 5794 | if (I915_HAS_RC6(dev) && drm_core_check_feature(dev, DRIVER_MODESET)) { | 5761 | if (I915_HAS_RC6(dev) && drm_core_check_feature(dev, DRIVER_MODESET)) { |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 9caccd03dccb..51d142939a26 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -239,7 +239,6 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
| 239 | uint32_t ch_data = ch_ctl + 4; | 239 | uint32_t ch_data = ch_ctl + 4; |
| 240 | int i; | 240 | int i; |
| 241 | int recv_bytes; | 241 | int recv_bytes; |
| 242 | uint32_t ctl; | ||
| 243 | uint32_t status; | 242 | uint32_t status; |
| 244 | uint32_t aux_clock_divider; | 243 | uint32_t aux_clock_divider; |
| 245 | int try, precharge; | 244 | int try, precharge; |
| @@ -263,41 +262,43 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
| 263 | else | 262 | else |
| 264 | precharge = 5; | 263 | precharge = 5; |
| 265 | 264 | ||
| 265 | if (I915_READ(ch_ctl) & DP_AUX_CH_CTL_SEND_BUSY) { | ||
| 266 | DRM_ERROR("dp_aux_ch not started status 0x%08x\n", | ||
| 267 | I915_READ(ch_ctl)); | ||
| 268 | return -EBUSY; | ||
| 269 | } | ||
| 270 | |||
| 266 | /* Must try at least 3 times according to DP spec */ | 271 | /* Must try at least 3 times according to DP spec */ |
| 267 | for (try = 0; try < 5; try++) { | 272 | for (try = 0; try < 5; try++) { |
| 268 | /* Load the send data into the aux channel data registers */ | 273 | /* Load the send data into the aux channel data registers */ |
| 269 | for (i = 0; i < send_bytes; i += 4) { | 274 | for (i = 0; i < send_bytes; i += 4) |
| 270 | uint32_t d = pack_aux(send + i, send_bytes - i); | 275 | I915_WRITE(ch_data + i, |
| 271 | 276 | pack_aux(send + i, send_bytes - i)); | |
| 272 | I915_WRITE(ch_data + i, d); | ||
| 273 | } | ||
| 274 | |||
| 275 | ctl = (DP_AUX_CH_CTL_SEND_BUSY | | ||
| 276 | DP_AUX_CH_CTL_TIME_OUT_400us | | ||
| 277 | (send_bytes << DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT) | | ||
| 278 | (precharge << DP_AUX_CH_CTL_PRECHARGE_2US_SHIFT) | | ||
| 279 | (aux_clock_divider << DP_AUX_CH_CTL_BIT_CLOCK_2X_SHIFT) | | ||
| 280 | DP_AUX_CH_CTL_DONE | | ||
| 281 | DP_AUX_CH_CTL_TIME_OUT_ERROR | | ||
| 282 | DP_AUX_CH_CTL_RECEIVE_ERROR); | ||
| 283 | 277 | ||
| 284 | /* Send the command and wait for it to complete */ | 278 | /* Send the command and wait for it to complete */ |
| 285 | I915_WRITE(ch_ctl, ctl); | 279 | I915_WRITE(ch_ctl, |
| 286 | (void) I915_READ(ch_ctl); | 280 | DP_AUX_CH_CTL_SEND_BUSY | |
| 281 | DP_AUX_CH_CTL_TIME_OUT_400us | | ||
| 282 | (send_bytes << DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT) | | ||
| 283 | (precharge << DP_AUX_CH_CTL_PRECHARGE_2US_SHIFT) | | ||
| 284 | (aux_clock_divider << DP_AUX_CH_CTL_BIT_CLOCK_2X_SHIFT) | | ||
| 285 | DP_AUX_CH_CTL_DONE | | ||
| 286 | DP_AUX_CH_CTL_TIME_OUT_ERROR | | ||
| 287 | DP_AUX_CH_CTL_RECEIVE_ERROR); | ||
| 287 | for (;;) { | 288 | for (;;) { |
| 288 | udelay(100); | ||
| 289 | status = I915_READ(ch_ctl); | 289 | status = I915_READ(ch_ctl); |
| 290 | if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0) | 290 | if ((status & DP_AUX_CH_CTL_SEND_BUSY) == 0) |
| 291 | break; | 291 | break; |
| 292 | udelay(100); | ||
| 292 | } | 293 | } |
| 293 | 294 | ||
| 294 | /* Clear done status and any errors */ | 295 | /* Clear done status and any errors */ |
| 295 | I915_WRITE(ch_ctl, (status | | 296 | I915_WRITE(ch_ctl, |
| 296 | DP_AUX_CH_CTL_DONE | | 297 | status | |
| 297 | DP_AUX_CH_CTL_TIME_OUT_ERROR | | 298 | DP_AUX_CH_CTL_DONE | |
| 298 | DP_AUX_CH_CTL_RECEIVE_ERROR)); | 299 | DP_AUX_CH_CTL_TIME_OUT_ERROR | |
| 299 | (void) I915_READ(ch_ctl); | 300 | DP_AUX_CH_CTL_RECEIVE_ERROR); |
| 300 | if ((status & DP_AUX_CH_CTL_TIME_OUT_ERROR) == 0) | 301 | if (status & DP_AUX_CH_CTL_DONE) |
| 301 | break; | 302 | break; |
| 302 | } | 303 | } |
| 303 | 304 | ||
| @@ -324,15 +325,12 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, | |||
| 324 | /* Unload any bytes sent back from the other side */ | 325 | /* Unload any bytes sent back from the other side */ |
| 325 | recv_bytes = ((status & DP_AUX_CH_CTL_MESSAGE_SIZE_MASK) >> | 326 | recv_bytes = ((status & DP_AUX_CH_CTL_MESSAGE_SIZE_MASK) >> |
| 326 | DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT); | 327 | DP_AUX_CH_CTL_MESSAGE_SIZE_SHIFT); |
| 327 | |||
| 328 | if (recv_bytes > recv_size) | 328 | if (recv_bytes > recv_size) |
| 329 | recv_bytes = recv_size; | 329 | recv_bytes = recv_size; |
| 330 | 330 | ||
| 331 | for (i = 0; i < recv_bytes; i += 4) { | 331 | for (i = 0; i < recv_bytes; i += 4) |
| 332 | uint32_t d = I915_READ(ch_data + i); | 332 | unpack_aux(I915_READ(ch_data + i), |
| 333 | 333 | recv + i, recv_bytes - i); | |
| 334 | unpack_aux(d, recv + i, recv_bytes - i); | ||
| 335 | } | ||
| 336 | 334 | ||
| 337 | return recv_bytes; | 335 | return recv_bytes; |
| 338 | } | 336 | } |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 0e92aa07b382..ad312ca6b3e5 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -176,6 +176,16 @@ struct intel_crtc { | |||
| 176 | #define enc_to_intel_encoder(x) container_of(x, struct intel_encoder, enc) | 176 | #define enc_to_intel_encoder(x) container_of(x, struct intel_encoder, enc) |
| 177 | #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) | 177 | #define to_intel_framebuffer(x) container_of(x, struct intel_framebuffer, base) |
| 178 | 178 | ||
| 179 | struct intel_unpin_work { | ||
| 180 | struct work_struct work; | ||
| 181 | struct drm_device *dev; | ||
| 182 | struct drm_gem_object *old_fb_obj; | ||
| 183 | struct drm_gem_object *pending_flip_obj; | ||
| 184 | struct drm_pending_vblank_event *event; | ||
| 185 | int pending; | ||
| 186 | bool enable_stall_check; | ||
| 187 | }; | ||
| 188 | |||
| 179 | struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg, | 189 | struct i2c_adapter *intel_i2c_create(struct drm_device *dev, const u32 reg, |
| 180 | const char *name); | 190 | const char *name); |
| 181 | void intel_i2c_destroy(struct i2c_adapter *adapter); | 191 | void intel_i2c_destroy(struct i2c_adapter *adapter); |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index b819c1081147..4fbb0165b26f 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -875,8 +875,6 @@ void intel_lvds_init(struct drm_device *dev) | |||
| 875 | 875 | ||
| 876 | intel_encoder->clone_mask = (1 << INTEL_LVDS_CLONE_BIT); | 876 | intel_encoder->clone_mask = (1 << INTEL_LVDS_CLONE_BIT); |
| 877 | intel_encoder->crtc_mask = (1 << 1); | 877 | intel_encoder->crtc_mask = (1 << 1); |
| 878 | if (IS_I965G(dev)) | ||
| 879 | intel_encoder->crtc_mask |= (1 << 0); | ||
| 880 | drm_encoder_helper_add(encoder, &intel_lvds_helper_funcs); | 878 | drm_encoder_helper_add(encoder, &intel_lvds_helper_funcs); |
| 881 | drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); | 879 | drm_connector_helper_add(connector, &intel_lvds_connector_helper_funcs); |
| 882 | connector->display_info.subpixel_order = SubPixelHorizontalRGB; | 880 | connector->display_info.subpixel_order = SubPixelHorizontalRGB; |
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index 4f00390d7c61..1d306a458be6 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
| @@ -25,6 +25,8 @@ | |||
| 25 | * | 25 | * |
| 26 | * Derived from Xorg ddx, xf86-video-intel, src/i830_video.c | 26 | * Derived from Xorg ddx, xf86-video-intel, src/i830_video.c |
| 27 | */ | 27 | */ |
| 28 | |||
| 29 | #include <linux/seq_file.h> | ||
| 28 | #include "drmP.h" | 30 | #include "drmP.h" |
| 29 | #include "drm.h" | 31 | #include "drm.h" |
| 30 | #include "i915_drm.h" | 32 | #include "i915_drm.h" |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 51e9c9e718c4..cb3508f78bc3 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
| @@ -220,9 +220,13 @@ static int init_render_ring(struct drm_device *dev, | |||
| 220 | { | 220 | { |
| 221 | drm_i915_private_t *dev_priv = dev->dev_private; | 221 | drm_i915_private_t *dev_priv = dev->dev_private; |
| 222 | int ret = init_ring_common(dev, ring); | 222 | int ret = init_ring_common(dev, ring); |
| 223 | int mode; | ||
| 224 | |||
| 223 | if (IS_I9XX(dev) && !IS_GEN3(dev)) { | 225 | if (IS_I9XX(dev) && !IS_GEN3(dev)) { |
| 224 | I915_WRITE(MI_MODE, | 226 | mode = VS_TIMER_DISPATCH << 16 | VS_TIMER_DISPATCH; |
| 225 | (VS_TIMER_DISPATCH) << 16 | VS_TIMER_DISPATCH); | 227 | if (IS_GEN6(dev)) |
| 228 | mode |= MI_FLUSH_ENABLE << 16 | MI_FLUSH_ENABLE; | ||
| 229 | I915_WRITE(MI_MODE, mode); | ||
| 226 | } | 230 | } |
| 227 | return ret; | 231 | return ret; |
| 228 | } | 232 | } |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 093e914e8a41..e3b7a7ee39cb 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -1061,8 +1061,9 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, | |||
| 1061 | if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode)) | 1061 | if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode)) |
| 1062 | return false; | 1062 | return false; |
| 1063 | 1063 | ||
| 1064 | if (!intel_sdvo_set_input_timings_for_mode(intel_sdvo, mode, adjusted_mode)) | 1064 | (void) intel_sdvo_set_input_timings_for_mode(intel_sdvo, |
| 1065 | return false; | 1065 | mode, |
| 1066 | adjusted_mode); | ||
| 1066 | } else if (intel_sdvo->is_lvds) { | 1067 | } else if (intel_sdvo->is_lvds) { |
| 1067 | drm_mode_set_crtcinfo(intel_sdvo->sdvo_lvds_fixed_mode, 0); | 1068 | drm_mode_set_crtcinfo(intel_sdvo->sdvo_lvds_fixed_mode, 0); |
| 1068 | 1069 | ||
| @@ -1070,8 +1071,9 @@ static bool intel_sdvo_mode_fixup(struct drm_encoder *encoder, | |||
| 1070 | intel_sdvo->sdvo_lvds_fixed_mode)) | 1071 | intel_sdvo->sdvo_lvds_fixed_mode)) |
| 1071 | return false; | 1072 | return false; |
| 1072 | 1073 | ||
| 1073 | if (!intel_sdvo_set_input_timings_for_mode(intel_sdvo, mode, adjusted_mode)) | 1074 | (void) intel_sdvo_set_input_timings_for_mode(intel_sdvo, |
| 1074 | return false; | 1075 | mode, |
| 1076 | adjusted_mode); | ||
| 1075 | } | 1077 | } |
| 1076 | 1078 | ||
| 1077 | /* Make the CRTC code factor in the SDVO pixel multiplier. The | 1079 | /* Make the CRTC code factor in the SDVO pixel multiplier. The |
| @@ -1108,10 +1110,9 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1108 | in_out.in0 = intel_sdvo->attached_output; | 1110 | in_out.in0 = intel_sdvo->attached_output; |
| 1109 | in_out.in1 = 0; | 1111 | in_out.in1 = 0; |
| 1110 | 1112 | ||
| 1111 | if (!intel_sdvo_set_value(intel_sdvo, | 1113 | intel_sdvo_set_value(intel_sdvo, |
| 1112 | SDVO_CMD_SET_IN_OUT_MAP, | 1114 | SDVO_CMD_SET_IN_OUT_MAP, |
| 1113 | &in_out, sizeof(in_out))) | 1115 | &in_out, sizeof(in_out)); |
| 1114 | return; | ||
| 1115 | 1116 | ||
| 1116 | if (intel_sdvo->is_hdmi) { | 1117 | if (intel_sdvo->is_hdmi) { |
| 1117 | if (!intel_sdvo_set_avi_infoframe(intel_sdvo, mode)) | 1118 | if (!intel_sdvo_set_avi_infoframe(intel_sdvo, mode)) |
| @@ -1122,11 +1123,9 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1122 | 1123 | ||
| 1123 | /* We have tried to get input timing in mode_fixup, and filled into | 1124 | /* We have tried to get input timing in mode_fixup, and filled into |
| 1124 | adjusted_mode */ | 1125 | adjusted_mode */ |
| 1125 | if (intel_sdvo->is_tv || intel_sdvo->is_lvds) { | 1126 | intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); |
| 1126 | intel_sdvo_get_dtd_from_mode(&input_dtd, adjusted_mode); | 1127 | if (intel_sdvo->is_tv || intel_sdvo->is_lvds) |
| 1127 | input_dtd.part2.sdvo_flags = intel_sdvo->sdvo_flags; | 1128 | input_dtd.part2.sdvo_flags = intel_sdvo->sdvo_flags; |
| 1128 | } else | ||
| 1129 | intel_sdvo_get_dtd_from_mode(&input_dtd, mode); | ||
| 1130 | 1129 | ||
| 1131 | /* If it's a TV, we already set the output timing in mode_fixup. | 1130 | /* If it's a TV, we already set the output timing in mode_fixup. |
| 1132 | * Otherwise, the output timing is equal to the input timing. | 1131 | * Otherwise, the output timing is equal to the input timing. |
| @@ -1137,8 +1136,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1137 | intel_sdvo->attached_output)) | 1136 | intel_sdvo->attached_output)) |
| 1138 | return; | 1137 | return; |
| 1139 | 1138 | ||
| 1140 | if (!intel_sdvo_set_output_timing(intel_sdvo, &input_dtd)) | 1139 | (void) intel_sdvo_set_output_timing(intel_sdvo, &input_dtd); |
| 1141 | return; | ||
| 1142 | } | 1140 | } |
| 1143 | 1141 | ||
| 1144 | /* Set the input timing to the screen. Assume always input 0. */ | 1142 | /* Set the input timing to the screen. Assume always input 0. */ |
| @@ -1165,8 +1163,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1165 | intel_sdvo_set_input_timing(encoder, &input_dtd); | 1163 | intel_sdvo_set_input_timing(encoder, &input_dtd); |
| 1166 | } | 1164 | } |
| 1167 | #else | 1165 | #else |
| 1168 | if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd)) | 1166 | (void) intel_sdvo_set_input_timing(intel_sdvo, &input_dtd); |
| 1169 | return; | ||
| 1170 | #endif | 1167 | #endif |
| 1171 | 1168 | ||
| 1172 | sdvo_pixel_multiply = intel_sdvo_get_pixel_multiplier(mode); | 1169 | sdvo_pixel_multiply = intel_sdvo_get_pixel_multiplier(mode); |
| @@ -1932,6 +1929,41 @@ static const struct drm_encoder_funcs intel_sdvo_enc_funcs = { | |||
| 1932 | .destroy = intel_sdvo_enc_destroy, | 1929 | .destroy = intel_sdvo_enc_destroy, |
| 1933 | }; | 1930 | }; |
| 1934 | 1931 | ||
| 1932 | static void | ||
| 1933 | intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo) | ||
| 1934 | { | ||
| 1935 | uint16_t mask = 0; | ||
| 1936 | unsigned int num_bits; | ||
| 1937 | |||
| 1938 | /* Make a mask of outputs less than or equal to our own priority in the | ||
| 1939 | * list. | ||
| 1940 | */ | ||
| 1941 | switch (sdvo->controlled_output) { | ||
| 1942 | case SDVO_OUTPUT_LVDS1: | ||
| 1943 | mask |= SDVO_OUTPUT_LVDS1; | ||
| 1944 | case SDVO_OUTPUT_LVDS0: | ||
| 1945 | mask |= SDVO_OUTPUT_LVDS0; | ||
| 1946 | case SDVO_OUTPUT_TMDS1: | ||
| 1947 | mask |= SDVO_OUTPUT_TMDS1; | ||
| 1948 | case SDVO_OUTPUT_TMDS0: | ||
| 1949 | mask |= SDVO_OUTPUT_TMDS0; | ||
| 1950 | case SDVO_OUTPUT_RGB1: | ||
| 1951 | mask |= SDVO_OUTPUT_RGB1; | ||
| 1952 | case SDVO_OUTPUT_RGB0: | ||
| 1953 | mask |= SDVO_OUTPUT_RGB0; | ||
| 1954 | break; | ||
| 1955 | } | ||
| 1956 | |||
| 1957 | /* Count bits to find what number we are in the priority list. */ | ||
| 1958 | mask &= sdvo->caps.output_flags; | ||
| 1959 | num_bits = hweight16(mask); | ||
| 1960 | /* If more than 3 outputs, default to DDC bus 3 for now. */ | ||
| 1961 | if (num_bits > 3) | ||
| 1962 | num_bits = 3; | ||
| 1963 | |||
| 1964 | /* Corresponds to SDVO_CONTROL_BUS_DDCx */ | ||
| 1965 | sdvo->ddc_bus = 1 << num_bits; | ||
| 1966 | } | ||
| 1935 | 1967 | ||
| 1936 | /** | 1968 | /** |
| 1937 | * Choose the appropriate DDC bus for control bus switch command for this | 1969 | * Choose the appropriate DDC bus for control bus switch command for this |
| @@ -1951,7 +1983,10 @@ intel_sdvo_select_ddc_bus(struct drm_i915_private *dev_priv, | |||
| 1951 | else | 1983 | else |
| 1952 | mapping = &(dev_priv->sdvo_mappings[1]); | 1984 | mapping = &(dev_priv->sdvo_mappings[1]); |
| 1953 | 1985 | ||
| 1954 | sdvo->ddc_bus = 1 << ((mapping->ddc_pin & 0xf0) >> 4); | 1986 | if (mapping->initialized) |
| 1987 | sdvo->ddc_bus = 1 << ((mapping->ddc_pin & 0xf0) >> 4); | ||
| 1988 | else | ||
| 1989 | intel_sdvo_guess_ddc_bus(sdvo); | ||
| 1955 | } | 1990 | } |
| 1956 | 1991 | ||
| 1957 | static bool | 1992 | static bool |
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c index d2029efee982..c671f60ce80b 100644 --- a/drivers/gpu/drm/i915/intel_tv.c +++ b/drivers/gpu/drm/i915/intel_tv.c | |||
| @@ -1231,7 +1231,6 @@ intel_tv_detect_type (struct intel_tv *intel_tv) | |||
| 1231 | struct drm_encoder *encoder = &intel_tv->base.enc; | 1231 | struct drm_encoder *encoder = &intel_tv->base.enc; |
| 1232 | struct drm_device *dev = encoder->dev; | 1232 | struct drm_device *dev = encoder->dev; |
| 1233 | struct drm_i915_private *dev_priv = dev->dev_private; | 1233 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1234 | struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); | ||
| 1235 | unsigned long irqflags; | 1234 | unsigned long irqflags; |
| 1236 | u32 tv_ctl, save_tv_ctl; | 1235 | u32 tv_ctl, save_tv_ctl; |
| 1237 | u32 tv_dac, save_tv_dac; | 1236 | u32 tv_dac, save_tv_dac; |
| @@ -1268,11 +1267,15 @@ intel_tv_detect_type (struct intel_tv *intel_tv) | |||
| 1268 | DAC_C_0_7_V); | 1267 | DAC_C_0_7_V); |
| 1269 | I915_WRITE(TV_CTL, tv_ctl); | 1268 | I915_WRITE(TV_CTL, tv_ctl); |
| 1270 | I915_WRITE(TV_DAC, tv_dac); | 1269 | I915_WRITE(TV_DAC, tv_dac); |
| 1271 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 1270 | POSTING_READ(TV_DAC); |
| 1271 | msleep(20); | ||
| 1272 | |||
| 1272 | tv_dac = I915_READ(TV_DAC); | 1273 | tv_dac = I915_READ(TV_DAC); |
| 1273 | I915_WRITE(TV_DAC, save_tv_dac); | 1274 | I915_WRITE(TV_DAC, save_tv_dac); |
| 1274 | I915_WRITE(TV_CTL, save_tv_ctl); | 1275 | I915_WRITE(TV_CTL, save_tv_ctl); |
| 1275 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 1276 | POSTING_READ(TV_CTL); |
| 1277 | msleep(20); | ||
| 1278 | |||
| 1276 | /* | 1279 | /* |
| 1277 | * A B C | 1280 | * A B C |
| 1278 | * 0 1 1 Composite | 1281 | * 0 1 1 Composite |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index e4f33a4edea1..974b0f8ae048 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
| @@ -3869,27 +3869,10 @@ static int call_lvds_manufacturer_script(struct drm_device *dev, struct dcb_entr | |||
| 3869 | } | 3869 | } |
| 3870 | #ifdef __powerpc__ | 3870 | #ifdef __powerpc__ |
| 3871 | /* Powerbook specific quirks */ | 3871 | /* Powerbook specific quirks */ |
| 3872 | if ((dev->pci_device & 0xffff) == 0x0179 || | 3872 | if (script == LVDS_RESET && |
| 3873 | (dev->pci_device & 0xffff) == 0x0189 || | 3873 | (dev->pci_device == 0x0179 || dev->pci_device == 0x0189 || |
| 3874 | (dev->pci_device & 0xffff) == 0x0329) { | 3874 | dev->pci_device == 0x0329)) |
| 3875 | if (script == LVDS_RESET) { | 3875 | nv_write_tmds(dev, dcbent->or, 0, 0x02, 0x72); |
| 3876 | nv_write_tmds(dev, dcbent->or, 0, 0x02, 0x72); | ||
| 3877 | |||
| 3878 | } else if (script == LVDS_PANEL_ON) { | ||
| 3879 | bios_wr32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL, | ||
| 3880 | bios_rd32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL) | ||
| 3881 | | (1 << 31)); | ||
| 3882 | bios_wr32(bios, NV_PCRTC_GPIO_EXT, | ||
| 3883 | bios_rd32(bios, NV_PCRTC_GPIO_EXT) | 1); | ||
| 3884 | |||
| 3885 | } else if (script == LVDS_PANEL_OFF) { | ||
| 3886 | bios_wr32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL, | ||
| 3887 | bios_rd32(bios, NV_PBUS_DEBUG_DUALHEAD_CTL) | ||
| 3888 | & ~(1 << 31)); | ||
| 3889 | bios_wr32(bios, NV_PCRTC_GPIO_EXT, | ||
| 3890 | bios_rd32(bios, NV_PCRTC_GPIO_EXT) & ~3); | ||
| 3891 | } | ||
| 3892 | } | ||
| 3893 | #endif | 3876 | #endif |
| 3894 | 3877 | ||
| 3895 | return 0; | 3878 | return 0; |
| @@ -4381,11 +4364,8 @@ int nouveau_bios_parse_lvds_table(struct drm_device *dev, int pxclk, bool *dl, b | |||
| 4381 | * | 4364 | * |
| 4382 | * For the moment, a quirk will do :) | 4365 | * For the moment, a quirk will do :) |
| 4383 | */ | 4366 | */ |
| 4384 | if ((dev->pdev->device == 0x01d7) && | 4367 | if (nv_match_device(dev, 0x01d7, 0x1028, 0x01c2)) |
| 4385 | (dev->pdev->subsystem_vendor == 0x1028) && | ||
| 4386 | (dev->pdev->subsystem_device == 0x01c2)) { | ||
| 4387 | bios->fp.duallink_transition_clk = 80000; | 4368 | bios->fp.duallink_transition_clk = 80000; |
| 4388 | } | ||
| 4389 | 4369 | ||
| 4390 | /* set dual_link flag for EDID case */ | 4370 | /* set dual_link flag for EDID case */ |
| 4391 | if (pxclk && (chip_version < 0x25 || chip_version > 0x28)) | 4371 | if (pxclk && (chip_version < 0x25 || chip_version > 0x28)) |
| @@ -5814,9 +5794,7 @@ parse_dcb_gpio_table(struct nvbios *bios) | |||
| 5814 | */ | 5794 | */ |
| 5815 | 5795 | ||
| 5816 | /* Apple iMac G4 NV18 */ | 5796 | /* Apple iMac G4 NV18 */ |
| 5817 | if (dev->pdev->device == 0x0189 && | 5797 | if (nv_match_device(dev, 0x0189, 0x10de, 0x0010)) { |
| 5818 | dev->pdev->subsystem_vendor == 0x10de && | ||
| 5819 | dev->pdev->subsystem_device == 0x0010) { | ||
| 5820 | struct dcb_gpio_entry *gpio = new_gpio_entry(bios); | 5798 | struct dcb_gpio_entry *gpio = new_gpio_entry(bios); |
| 5821 | 5799 | ||
| 5822 | gpio->tag = DCB_GPIO_TVDAC0; | 5800 | gpio->tag = DCB_GPIO_TVDAC0; |
| @@ -5898,9 +5876,7 @@ apply_dcb_connector_quirks(struct nvbios *bios, int idx) | |||
| 5898 | struct drm_device *dev = bios->dev; | 5876 | struct drm_device *dev = bios->dev; |
| 5899 | 5877 | ||
| 5900 | /* Gigabyte NX85T */ | 5878 | /* Gigabyte NX85T */ |
| 5901 | if ((dev->pdev->device == 0x0421) && | 5879 | if (nv_match_device(dev, 0x0421, 0x1458, 0x344c)) { |
| 5902 | (dev->pdev->subsystem_vendor == 0x1458) && | ||
| 5903 | (dev->pdev->subsystem_device == 0x344c)) { | ||
| 5904 | if (cte->type == DCB_CONNECTOR_HDMI_1) | 5880 | if (cte->type == DCB_CONNECTOR_HDMI_1) |
| 5905 | cte->type = DCB_CONNECTOR_DVI_I; | 5881 | cte->type = DCB_CONNECTOR_DVI_I; |
| 5906 | } | 5882 | } |
| @@ -6153,7 +6129,7 @@ parse_dcb20_entry(struct drm_device *dev, struct dcb_table *dcb, | |||
| 6153 | entry->tmdsconf.slave_addr = (conf & 0x00000070) >> 4; | 6129 | entry->tmdsconf.slave_addr = (conf & 0x00000070) >> 4; |
| 6154 | 6130 | ||
| 6155 | break; | 6131 | break; |
| 6156 | case 0xe: | 6132 | case OUTPUT_EOL: |
| 6157 | /* weird g80 mobile type that "nv" treats as a terminator */ | 6133 | /* weird g80 mobile type that "nv" treats as a terminator */ |
| 6158 | dcb->entries--; | 6134 | dcb->entries--; |
| 6159 | return false; | 6135 | return false; |
| @@ -6190,22 +6166,14 @@ parse_dcb15_entry(struct drm_device *dev, struct dcb_table *dcb, | |||
| 6190 | entry->type = OUTPUT_TV; | 6166 | entry->type = OUTPUT_TV; |
| 6191 | break; | 6167 | break; |
| 6192 | case 2: | 6168 | case 2: |
| 6193 | case 3: | ||
| 6194 | entry->type = OUTPUT_LVDS; | ||
| 6195 | break; | ||
| 6196 | case 4: | 6169 | case 4: |
| 6197 | switch ((conn & 0x000000f0) >> 4) { | 6170 | if (conn & 0x10) |
| 6198 | case 0: | ||
| 6199 | entry->type = OUTPUT_TMDS; | ||
| 6200 | break; | ||
| 6201 | case 1: | ||
| 6202 | entry->type = OUTPUT_LVDS; | 6171 | entry->type = OUTPUT_LVDS; |
| 6203 | break; | 6172 | else |
| 6204 | default: | 6173 | entry->type = OUTPUT_TMDS; |
| 6205 | NV_ERROR(dev, "Unknown DCB subtype 4/%d\n", | 6174 | break; |
| 6206 | (conn & 0x000000f0) >> 4); | 6175 | case 3: |
| 6207 | return false; | 6176 | entry->type = OUTPUT_LVDS; |
| 6208 | } | ||
| 6209 | break; | 6177 | break; |
| 6210 | default: | 6178 | default: |
| 6211 | NV_ERROR(dev, "Unknown DCB type %d\n", conn & 0x0000000f); | 6179 | NV_ERROR(dev, "Unknown DCB type %d\n", conn & 0x0000000f); |
| @@ -6321,9 +6289,7 @@ apply_dcb_encoder_quirks(struct drm_device *dev, int idx, u32 *conn, u32 *conf) | |||
| 6321 | * nasty problems until this is sorted (assuming it's not a | 6289 | * nasty problems until this is sorted (assuming it's not a |
| 6322 | * VBIOS bug). | 6290 | * VBIOS bug). |
| 6323 | */ | 6291 | */ |
| 6324 | if ((dev->pdev->device == 0x040d) && | 6292 | if (nv_match_device(dev, 0x040d, 0x1028, 0x019b)) { |
| 6325 | (dev->pdev->subsystem_vendor == 0x1028) && | ||
| 6326 | (dev->pdev->subsystem_device == 0x019b)) { | ||
| 6327 | if (*conn == 0x02026312 && *conf == 0x00000020) | 6293 | if (*conn == 0x02026312 && *conf == 0x00000020) |
| 6328 | return false; | 6294 | return false; |
| 6329 | } | 6295 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.h b/drivers/gpu/drm/nouveau/nouveau_bios.h index fd14dfd3d780..c1de2f3fcb0e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.h +++ b/drivers/gpu/drm/nouveau/nouveau_bios.h | |||
| @@ -95,6 +95,7 @@ enum dcb_type { | |||
| 95 | OUTPUT_TMDS = 2, | 95 | OUTPUT_TMDS = 2, |
| 96 | OUTPUT_LVDS = 3, | 96 | OUTPUT_LVDS = 3, |
| 97 | OUTPUT_DP = 6, | 97 | OUTPUT_DP = 6, |
| 98 | OUTPUT_EOL = 14, /* DCB 4.0+, appears to be end-of-list */ | ||
| 98 | OUTPUT_ANY = -1 | 99 | OUTPUT_ANY = -1 |
| 99 | }; | 100 | }; |
| 100 | 101 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 1e093a069b7b..b1be617373b6 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
| @@ -1389,6 +1389,15 @@ nv_two_reg_pll(struct drm_device *dev) | |||
| 1389 | return false; | 1389 | return false; |
| 1390 | } | 1390 | } |
| 1391 | 1391 | ||
| 1392 | static inline bool | ||
| 1393 | nv_match_device(struct drm_device *dev, unsigned device, | ||
| 1394 | unsigned sub_vendor, unsigned sub_device) | ||
| 1395 | { | ||
| 1396 | return dev->pdev->device == device && | ||
| 1397 | dev->pdev->subsystem_vendor == sub_vendor && | ||
| 1398 | dev->pdev->subsystem_device == sub_device; | ||
| 1399 | } | ||
| 1400 | |||
| 1392 | #define NV_SW 0x0000506e | 1401 | #define NV_SW 0x0000506e |
| 1393 | #define NV_SW_DMA_SEMAPHORE 0x00000060 | 1402 | #define NV_SW_DMA_SEMAPHORE 0x00000060 |
| 1394 | #define NV_SW_SEMAPHORE_OFFSET 0x00000064 | 1403 | #define NV_SW_SEMAPHORE_OFFSET 0x00000064 |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fence.c b/drivers/gpu/drm/nouveau/nouveau_fence.c index 6b208ffafa8d..87ac21ec23d2 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fence.c +++ b/drivers/gpu/drm/nouveau/nouveau_fence.c | |||
| @@ -64,16 +64,17 @@ nouveau_fence_update(struct nouveau_channel *chan) | |||
| 64 | struct nouveau_fence *fence; | 64 | struct nouveau_fence *fence; |
| 65 | uint32_t sequence; | 65 | uint32_t sequence; |
| 66 | 66 | ||
| 67 | spin_lock(&chan->fence.lock); | ||
| 68 | |||
| 67 | if (USE_REFCNT) | 69 | if (USE_REFCNT) |
| 68 | sequence = nvchan_rd32(chan, 0x48); | 70 | sequence = nvchan_rd32(chan, 0x48); |
| 69 | else | 71 | else |
| 70 | sequence = atomic_read(&chan->fence.last_sequence_irq); | 72 | sequence = atomic_read(&chan->fence.last_sequence_irq); |
| 71 | 73 | ||
| 72 | if (chan->fence.sequence_ack == sequence) | 74 | if (chan->fence.sequence_ack == sequence) |
| 73 | return; | 75 | goto out; |
| 74 | chan->fence.sequence_ack = sequence; | 76 | chan->fence.sequence_ack = sequence; |
| 75 | 77 | ||
| 76 | spin_lock(&chan->fence.lock); | ||
| 77 | list_for_each_safe(entry, tmp, &chan->fence.pending) { | 78 | list_for_each_safe(entry, tmp, &chan->fence.pending) { |
| 78 | fence = list_entry(entry, struct nouveau_fence, entry); | 79 | fence = list_entry(entry, struct nouveau_fence, entry); |
| 79 | 80 | ||
| @@ -85,6 +86,7 @@ nouveau_fence_update(struct nouveau_channel *chan) | |||
| 85 | if (sequence == chan->fence.sequence_ack) | 86 | if (sequence == chan->fence.sequence_ack) |
| 86 | break; | 87 | break; |
| 87 | } | 88 | } |
| 89 | out: | ||
| 88 | spin_unlock(&chan->fence.lock); | 90 | spin_unlock(&chan->fence.lock); |
| 89 | } | 91 | } |
| 90 | 92 | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 79fc5ffff226..ead7b8fc53fc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c | |||
| @@ -245,7 +245,7 @@ validate_fini_list(struct list_head *list, struct nouveau_fence *fence) | |||
| 245 | list_del(&nvbo->entry); | 245 | list_del(&nvbo->entry); |
| 246 | nvbo->reserved_by = NULL; | 246 | nvbo->reserved_by = NULL; |
| 247 | ttm_bo_unreserve(&nvbo->bo); | 247 | ttm_bo_unreserve(&nvbo->bo); |
| 248 | drm_gem_object_unreference(nvbo->gem); | 248 | drm_gem_object_unreference_unlocked(nvbo->gem); |
| 249 | } | 249 | } |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -300,7 +300,7 @@ retry: | |||
| 300 | validate_fini(op, NULL); | 300 | validate_fini(op, NULL); |
| 301 | if (ret == -EAGAIN) | 301 | if (ret == -EAGAIN) |
| 302 | ret = ttm_bo_wait_unreserved(&nvbo->bo, false); | 302 | ret = ttm_bo_wait_unreserved(&nvbo->bo, false); |
| 303 | drm_gem_object_unreference(gem); | 303 | drm_gem_object_unreference_unlocked(gem); |
| 304 | if (ret) { | 304 | if (ret) { |
| 305 | NV_ERROR(dev, "fail reserve\n"); | 305 | NV_ERROR(dev, "fail reserve\n"); |
| 306 | return ret; | 306 | return ret; |
| @@ -337,7 +337,9 @@ retry: | |||
| 337 | return -EINVAL; | 337 | return -EINVAL; |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | mutex_unlock(&drm_global_mutex); | ||
| 340 | ret = ttm_bo_wait_cpu(&nvbo->bo, false); | 341 | ret = ttm_bo_wait_cpu(&nvbo->bo, false); |
| 342 | mutex_lock(&drm_global_mutex); | ||
| 341 | if (ret) { | 343 | if (ret) { |
| 342 | NV_ERROR(dev, "fail wait_cpu\n"); | 344 | NV_ERROR(dev, "fail wait_cpu\n"); |
| 343 | return ret; | 345 | return ret; |
| @@ -614,8 +616,6 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, | |||
| 614 | return PTR_ERR(bo); | 616 | return PTR_ERR(bo); |
| 615 | } | 617 | } |
| 616 | 618 | ||
| 617 | mutex_lock(&dev->struct_mutex); | ||
| 618 | |||
| 619 | /* Mark push buffers as being used on PFIFO, the validation code | 619 | /* Mark push buffers as being used on PFIFO, the validation code |
| 620 | * will then make sure that if the pushbuf bo moves, that they | 620 | * will then make sure that if the pushbuf bo moves, that they |
| 621 | * happen on the kernel channel, which will in turn cause a sync | 621 | * happen on the kernel channel, which will in turn cause a sync |
| @@ -663,7 +663,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, | |||
| 663 | push[i].length); | 663 | push[i].length); |
| 664 | } | 664 | } |
| 665 | } else | 665 | } else |
| 666 | if (dev_priv->card_type >= NV_20) { | 666 | if (dev_priv->chipset >= 0x25) { |
| 667 | ret = RING_SPACE(chan, req->nr_push * 2); | 667 | ret = RING_SPACE(chan, req->nr_push * 2); |
| 668 | if (ret) { | 668 | if (ret) { |
| 669 | NV_ERROR(dev, "cal_space: %d\n", ret); | 669 | NV_ERROR(dev, "cal_space: %d\n", ret); |
| @@ -729,7 +729,6 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, | |||
| 729 | out: | 729 | out: |
| 730 | validate_fini(&op, fence); | 730 | validate_fini(&op, fence); |
| 731 | nouveau_fence_unref((void**)&fence); | 731 | nouveau_fence_unref((void**)&fence); |
| 732 | mutex_unlock(&dev->struct_mutex); | ||
| 733 | kfree(bo); | 732 | kfree(bo); |
| 734 | kfree(push); | 733 | kfree(push); |
| 735 | 734 | ||
| @@ -738,7 +737,7 @@ out_next: | |||
| 738 | req->suffix0 = 0x00000000; | 737 | req->suffix0 = 0x00000000; |
| 739 | req->suffix1 = 0x00000000; | 738 | req->suffix1 = 0x00000000; |
| 740 | } else | 739 | } else |
| 741 | if (dev_priv->card_type >= NV_20) { | 740 | if (dev_priv->chipset >= 0x25) { |
| 742 | req->suffix0 = 0x00020000; | 741 | req->suffix0 = 0x00020000; |
| 743 | req->suffix1 = 0x00000000; | 742 | req->suffix1 = 0x00000000; |
| 744 | } else { | 743 | } else { |
diff --git a/drivers/gpu/drm/nouveau/nv04_dfp.c b/drivers/gpu/drm/nouveau/nv04_dfp.c index a5dcf7685800..0d3206a7046c 100644 --- a/drivers/gpu/drm/nouveau/nv04_dfp.c +++ b/drivers/gpu/drm/nouveau/nv04_dfp.c | |||
| @@ -444,6 +444,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) | |||
| 444 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); | 444 | struct nouveau_encoder *nv_encoder = nouveau_encoder(encoder); |
| 445 | struct dcb_entry *dcbe = nv_encoder->dcb; | 445 | struct dcb_entry *dcbe = nv_encoder->dcb; |
| 446 | int head = nouveau_crtc(encoder->crtc)->index; | 446 | int head = nouveau_crtc(encoder->crtc)->index; |
| 447 | struct drm_encoder *slave_encoder; | ||
| 447 | 448 | ||
| 448 | if (dcbe->type == OUTPUT_TMDS) | 449 | if (dcbe->type == OUTPUT_TMDS) |
| 449 | run_tmds_table(dev, dcbe, head, nv_encoder->mode.clock); | 450 | run_tmds_table(dev, dcbe, head, nv_encoder->mode.clock); |
| @@ -462,9 +463,10 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) | |||
| 462 | NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); | 463 | NVWriteRAMDAC(dev, 0, NV_PRAMDAC_TEST_CONTROL + nv04_dac_output_offset(encoder), 0x00100000); |
| 463 | 464 | ||
| 464 | /* Init external transmitters */ | 465 | /* Init external transmitters */ |
| 465 | if (get_tmds_slave(encoder)) | 466 | slave_encoder = get_tmds_slave(encoder); |
| 466 | get_slave_funcs(get_tmds_slave(encoder))->mode_set( | 467 | if (slave_encoder) |
| 467 | encoder, &nv_encoder->mode, &nv_encoder->mode); | 468 | get_slave_funcs(slave_encoder)->mode_set( |
| 469 | slave_encoder, &nv_encoder->mode, &nv_encoder->mode); | ||
| 468 | 470 | ||
| 469 | helper->dpms(encoder, DRM_MODE_DPMS_ON); | 471 | helper->dpms(encoder, DRM_MODE_DPMS_ON); |
| 470 | 472 | ||
| @@ -473,6 +475,27 @@ static void nv04_dfp_commit(struct drm_encoder *encoder) | |||
| 473 | nv_crtc->index, '@' + ffs(nv_encoder->dcb->or)); | 475 | nv_crtc->index, '@' + ffs(nv_encoder->dcb->or)); |
| 474 | } | 476 | } |
| 475 | 477 | ||
| 478 | static void nv04_dfp_update_backlight(struct drm_encoder *encoder, int mode) | ||
| 479 | { | ||
| 480 | #ifdef __powerpc__ | ||
| 481 | struct drm_device *dev = encoder->dev; | ||
| 482 | |||
| 483 | /* BIOS scripts usually take care of the backlight, thanks | ||
| 484 | * Apple for your consistency. | ||
| 485 | */ | ||
| 486 | if (dev->pci_device == 0x0179 || dev->pci_device == 0x0189 || | ||
| 487 | dev->pci_device == 0x0329) { | ||
| 488 | if (mode == DRM_MODE_DPMS_ON) { | ||
| 489 | nv_mask(dev, NV_PBUS_DEBUG_DUALHEAD_CTL, 0, 1 << 31); | ||
| 490 | nv_mask(dev, NV_PCRTC_GPIO_EXT, 3, 1); | ||
| 491 | } else { | ||
| 492 | nv_mask(dev, NV_PBUS_DEBUG_DUALHEAD_CTL, 1 << 31, 0); | ||
| 493 | nv_mask(dev, NV_PCRTC_GPIO_EXT, 3, 0); | ||
| 494 | } | ||
| 495 | } | ||
| 496 | #endif | ||
| 497 | } | ||
| 498 | |||
| 476 | static inline bool is_powersaving_dpms(int mode) | 499 | static inline bool is_powersaving_dpms(int mode) |
| 477 | { | 500 | { |
| 478 | return (mode != DRM_MODE_DPMS_ON); | 501 | return (mode != DRM_MODE_DPMS_ON); |
| @@ -520,6 +543,7 @@ static void nv04_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 520 | LVDS_PANEL_OFF, 0); | 543 | LVDS_PANEL_OFF, 0); |
| 521 | } | 544 | } |
| 522 | 545 | ||
| 546 | nv04_dfp_update_backlight(encoder, mode); | ||
| 523 | nv04_dfp_update_fp_control(encoder, mode); | 547 | nv04_dfp_update_fp_control(encoder, mode); |
| 524 | 548 | ||
| 525 | if (mode == DRM_MODE_DPMS_ON) | 549 | if (mode == DRM_MODE_DPMS_ON) |
| @@ -543,6 +567,7 @@ static void nv04_tmds_dpms(struct drm_encoder *encoder, int mode) | |||
| 543 | NV_INFO(dev, "Setting dpms mode %d on tmds encoder (output %d)\n", | 567 | NV_INFO(dev, "Setting dpms mode %d on tmds encoder (output %d)\n", |
| 544 | mode, nv_encoder->dcb->index); | 568 | mode, nv_encoder->dcb->index); |
| 545 | 569 | ||
| 570 | nv04_dfp_update_backlight(encoder, mode); | ||
| 546 | nv04_dfp_update_fp_control(encoder, mode); | 571 | nv04_dfp_update_fp_control(encoder, mode); |
| 547 | } | 572 | } |
| 548 | 573 | ||
diff --git a/drivers/gpu/drm/nouveau/nv17_tv.c b/drivers/gpu/drm/nouveau/nv17_tv.c index eefa5c856932..13cdc05b7c2d 100644 --- a/drivers/gpu/drm/nouveau/nv17_tv.c +++ b/drivers/gpu/drm/nouveau/nv17_tv.c | |||
| @@ -121,18 +121,14 @@ static bool | |||
| 121 | get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) | 121 | get_tv_detect_quirks(struct drm_device *dev, uint32_t *pin_mask) |
| 122 | { | 122 | { |
| 123 | /* Zotac FX5200 */ | 123 | /* Zotac FX5200 */ |
| 124 | if (dev->pdev->device == 0x0322 && | 124 | if (nv_match_device(dev, 0x0322, 0x19da, 0x1035) || |
| 125 | dev->pdev->subsystem_vendor == 0x19da && | 125 | nv_match_device(dev, 0x0322, 0x19da, 0x2035)) { |
| 126 | (dev->pdev->subsystem_device == 0x1035 || | ||
| 127 | dev->pdev->subsystem_device == 0x2035)) { | ||
| 128 | *pin_mask = 0xc; | 126 | *pin_mask = 0xc; |
| 129 | return false; | 127 | return false; |
| 130 | } | 128 | } |
| 131 | 129 | ||
| 132 | /* MSI nForce2 IGP */ | 130 | /* MSI nForce2 IGP */ |
| 133 | if (dev->pdev->device == 0x01f0 && | 131 | if (nv_match_device(dev, 0x01f0, 0x1462, 0x5710)) { |
| 134 | dev->pdev->subsystem_vendor == 0x1462 && | ||
| 135 | dev->pdev->subsystem_device == 0x5710) { | ||
| 136 | *pin_mask = 0xc; | 132 | *pin_mask = 0xc; |
| 137 | return false; | 133 | return false; |
| 138 | } | 134 | } |
diff --git a/drivers/gpu/drm/nouveau/nv50_instmem.c b/drivers/gpu/drm/nouveau/nv50_instmem.c index c95bf9b681dd..91ef93cf1f35 100644 --- a/drivers/gpu/drm/nouveau/nv50_instmem.c +++ b/drivers/gpu/drm/nouveau/nv50_instmem.c | |||
| @@ -139,6 +139,8 @@ nv50_instmem_init(struct drm_device *dev) | |||
| 139 | chan->file_priv = (struct drm_file *)-2; | 139 | chan->file_priv = (struct drm_file *)-2; |
| 140 | dev_priv->fifos[0] = dev_priv->fifos[127] = chan; | 140 | dev_priv->fifos[0] = dev_priv->fifos[127] = chan; |
| 141 | 141 | ||
| 142 | INIT_LIST_HEAD(&chan->ramht_refs); | ||
| 143 | |||
| 142 | /* Channel's PRAMIN object + heap */ | 144 | /* Channel's PRAMIN object + heap */ |
| 143 | ret = nouveau_gpuobj_new_fake(dev, 0, c_offset, c_size, 0, | 145 | ret = nouveau_gpuobj_new_fake(dev, 0, c_offset, c_size, 0, |
| 144 | NULL, &chan->ramin); | 146 | NULL, &chan->ramin); |
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 577239a24fd5..464a81a1990f 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -332,6 +332,11 @@ static void atombios_crtc_set_timing(struct drm_crtc *crtc, | |||
| 332 | args.usV_SyncWidth = | 332 | args.usV_SyncWidth = |
| 333 | cpu_to_le16(mode->crtc_vsync_end - mode->crtc_vsync_start); | 333 | cpu_to_le16(mode->crtc_vsync_end - mode->crtc_vsync_start); |
| 334 | 334 | ||
| 335 | args.ucOverscanRight = radeon_crtc->h_border; | ||
| 336 | args.ucOverscanLeft = radeon_crtc->h_border; | ||
| 337 | args.ucOverscanBottom = radeon_crtc->v_border; | ||
| 338 | args.ucOverscanTop = radeon_crtc->v_border; | ||
| 339 | |||
| 335 | if (mode->flags & DRM_MODE_FLAG_NVSYNC) | 340 | if (mode->flags & DRM_MODE_FLAG_NVSYNC) |
| 336 | misc |= ATOM_VSYNC_POLARITY; | 341 | misc |= ATOM_VSYNC_POLARITY; |
| 337 | if (mode->flags & DRM_MODE_FLAG_NHSYNC) | 342 | if (mode->flags & DRM_MODE_FLAG_NHSYNC) |
| @@ -534,6 +539,20 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 534 | pll->algo = PLL_ALGO_LEGACY; | 539 | pll->algo = PLL_ALGO_LEGACY; |
| 535 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; | 540 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; |
| 536 | } | 541 | } |
| 542 | /* There is some evidence (often anecdotal) that RV515 LVDS | ||
| 543 | * (on some boards at least) prefers the legacy algo. I'm not | ||
| 544 | * sure whether this should handled generically or on a | ||
| 545 | * case-by-case quirk basis. Both algos should work fine in the | ||
| 546 | * majority of cases. | ||
| 547 | */ | ||
| 548 | if ((radeon_encoder->active_device & (ATOM_DEVICE_LCD_SUPPORT)) && | ||
| 549 | (rdev->family == CHIP_RV515)) { | ||
| 550 | /* allow the user to overrride just in case */ | ||
| 551 | if (radeon_new_pll == 1) | ||
| 552 | pll->algo = PLL_ALGO_NEW; | ||
| 553 | else | ||
| 554 | pll->algo = PLL_ALGO_LEGACY; | ||
| 555 | } | ||
| 537 | } else { | 556 | } else { |
| 538 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) | 557 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) |
| 539 | pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; | 558 | pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; |
| @@ -1056,11 +1075,11 @@ static int avivo_crtc_set_base(struct drm_crtc *crtc, int x, int y, | |||
| 1056 | 1075 | ||
| 1057 | if (rdev->family >= CHIP_RV770) { | 1076 | if (rdev->family >= CHIP_RV770) { |
| 1058 | if (radeon_crtc->crtc_id) { | 1077 | if (radeon_crtc->crtc_id) { |
| 1059 | WREG32(R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, 0); | 1078 | WREG32(R700_D2GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, upper_32_bits(fb_location)); |
| 1060 | WREG32(R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, 0); | 1079 | WREG32(R700_D2GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, upper_32_bits(fb_location)); |
| 1061 | } else { | 1080 | } else { |
| 1062 | WREG32(R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, 0); | 1081 | WREG32(R700_D1GRPH_PRIMARY_SURFACE_ADDRESS_HIGH, upper_32_bits(fb_location)); |
| 1063 | WREG32(R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, 0); | 1082 | WREG32(R700_D1GRPH_SECONDARY_SURFACE_ADDRESS_HIGH, upper_32_bits(fb_location)); |
| 1064 | } | 1083 | } |
| 1065 | } | 1084 | } |
| 1066 | WREG32(AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset, | 1085 | WREG32(AVIVO_D1GRPH_PRIMARY_SURFACE_ADDRESS + radeon_crtc->crtc_offset, |
| @@ -1197,8 +1216,18 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc, | |||
| 1197 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); | 1216 | struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc); |
| 1198 | struct drm_device *dev = crtc->dev; | 1217 | struct drm_device *dev = crtc->dev; |
| 1199 | struct radeon_device *rdev = dev->dev_private; | 1218 | struct radeon_device *rdev = dev->dev_private; |
| 1219 | struct drm_encoder *encoder; | ||
| 1220 | bool is_tvcv = false; | ||
| 1200 | 1221 | ||
| 1201 | /* TODO color tiling */ | 1222 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
| 1223 | /* find tv std */ | ||
| 1224 | if (encoder->crtc == crtc) { | ||
| 1225 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | ||
| 1226 | if (radeon_encoder->active_device & | ||
| 1227 | (ATOM_DEVICE_TV_SUPPORT | ATOM_DEVICE_CV_SUPPORT)) | ||
| 1228 | is_tvcv = true; | ||
| 1229 | } | ||
| 1230 | } | ||
| 1202 | 1231 | ||
| 1203 | atombios_disable_ss(crtc); | 1232 | atombios_disable_ss(crtc); |
| 1204 | /* always set DCPLL */ | 1233 | /* always set DCPLL */ |
| @@ -1207,9 +1236,14 @@ int atombios_crtc_mode_set(struct drm_crtc *crtc, | |||
| 1207 | atombios_crtc_set_pll(crtc, adjusted_mode); | 1236 | atombios_crtc_set_pll(crtc, adjusted_mode); |
| 1208 | atombios_enable_ss(crtc); | 1237 | atombios_enable_ss(crtc); |
| 1209 | 1238 | ||
| 1210 | if (ASIC_IS_AVIVO(rdev)) | 1239 | if (ASIC_IS_DCE4(rdev)) |
| 1211 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); | 1240 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); |
| 1212 | else { | 1241 | else if (ASIC_IS_AVIVO(rdev)) { |
| 1242 | if (is_tvcv) | ||
| 1243 | atombios_crtc_set_timing(crtc, adjusted_mode); | ||
| 1244 | else | ||
| 1245 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); | ||
| 1246 | } else { | ||
| 1213 | atombios_crtc_set_timing(crtc, adjusted_mode); | 1247 | atombios_crtc_set_timing(crtc, adjusted_mode); |
| 1214 | if (radeon_crtc->crtc_id == 0) | 1248 | if (radeon_crtc->crtc_id == 0) |
| 1215 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); | 1249 | atombios_set_crtc_dtd_timing(crtc, adjusted_mode); |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 957d5067ad9c..b8b7f010b25f 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
| @@ -675,6 +675,43 @@ static int evergreen_cp_load_microcode(struct radeon_device *rdev) | |||
| 675 | return 0; | 675 | return 0; |
| 676 | } | 676 | } |
| 677 | 677 | ||
| 678 | static int evergreen_cp_start(struct radeon_device *rdev) | ||
| 679 | { | ||
| 680 | int r; | ||
| 681 | uint32_t cp_me; | ||
| 682 | |||
| 683 | r = radeon_ring_lock(rdev, 7); | ||
| 684 | if (r) { | ||
| 685 | DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); | ||
| 686 | return r; | ||
| 687 | } | ||
| 688 | radeon_ring_write(rdev, PACKET3(PACKET3_ME_INITIALIZE, 5)); | ||
| 689 | radeon_ring_write(rdev, 0x1); | ||
| 690 | radeon_ring_write(rdev, 0x0); | ||
| 691 | radeon_ring_write(rdev, rdev->config.evergreen.max_hw_contexts - 1); | ||
| 692 | radeon_ring_write(rdev, PACKET3_ME_INITIALIZE_DEVICE_ID(1)); | ||
| 693 | radeon_ring_write(rdev, 0); | ||
| 694 | radeon_ring_write(rdev, 0); | ||
| 695 | radeon_ring_unlock_commit(rdev); | ||
| 696 | |||
| 697 | cp_me = 0xff; | ||
| 698 | WREG32(CP_ME_CNTL, cp_me); | ||
| 699 | |||
| 700 | r = radeon_ring_lock(rdev, 4); | ||
| 701 | if (r) { | ||
| 702 | DRM_ERROR("radeon: cp failed to lock ring (%d).\n", r); | ||
| 703 | return r; | ||
| 704 | } | ||
| 705 | /* init some VGT regs */ | ||
| 706 | radeon_ring_write(rdev, PACKET3(PACKET3_SET_CONTEXT_REG, 2)); | ||
| 707 | radeon_ring_write(rdev, (VGT_VERTEX_REUSE_BLOCK_CNTL - PACKET3_SET_CONTEXT_REG_START) >> 2); | ||
| 708 | radeon_ring_write(rdev, 0xe); | ||
| 709 | radeon_ring_write(rdev, 0x10); | ||
| 710 | radeon_ring_unlock_commit(rdev); | ||
| 711 | |||
| 712 | return 0; | ||
| 713 | } | ||
| 714 | |||
| 678 | int evergreen_cp_resume(struct radeon_device *rdev) | 715 | int evergreen_cp_resume(struct radeon_device *rdev) |
| 679 | { | 716 | { |
| 680 | u32 tmp; | 717 | u32 tmp; |
| @@ -719,7 +756,7 @@ int evergreen_cp_resume(struct radeon_device *rdev) | |||
| 719 | rdev->cp.rptr = RREG32(CP_RB_RPTR); | 756 | rdev->cp.rptr = RREG32(CP_RB_RPTR); |
| 720 | rdev->cp.wptr = RREG32(CP_RB_WPTR); | 757 | rdev->cp.wptr = RREG32(CP_RB_WPTR); |
| 721 | 758 | ||
| 722 | r600_cp_start(rdev); | 759 | evergreen_cp_start(rdev); |
| 723 | rdev->cp.ready = true; | 760 | rdev->cp.ready = true; |
| 724 | r = radeon_ring_test(rdev); | 761 | r = radeon_ring_test(rdev); |
| 725 | if (r) { | 762 | if (r) { |
| @@ -2054,11 +2091,6 @@ int evergreen_resume(struct radeon_device *rdev) | |||
| 2054 | */ | 2091 | */ |
| 2055 | /* post card */ | 2092 | /* post card */ |
| 2056 | atom_asic_init(rdev->mode_info.atom_context); | 2093 | atom_asic_init(rdev->mode_info.atom_context); |
| 2057 | /* Initialize clocks */ | ||
| 2058 | r = radeon_clocks_init(rdev); | ||
| 2059 | if (r) { | ||
| 2060 | return r; | ||
| 2061 | } | ||
| 2062 | 2094 | ||
| 2063 | r = evergreen_startup(rdev); | 2095 | r = evergreen_startup(rdev); |
| 2064 | if (r) { | 2096 | if (r) { |
| @@ -2164,9 +2196,6 @@ int evergreen_init(struct radeon_device *rdev) | |||
| 2164 | radeon_surface_init(rdev); | 2196 | radeon_surface_init(rdev); |
| 2165 | /* Initialize clocks */ | 2197 | /* Initialize clocks */ |
| 2166 | radeon_get_clock_info(rdev->ddev); | 2198 | radeon_get_clock_info(rdev->ddev); |
| 2167 | r = radeon_clocks_init(rdev); | ||
| 2168 | if (r) | ||
| 2169 | return r; | ||
| 2170 | /* Fence driver */ | 2199 | /* Fence driver */ |
| 2171 | r = radeon_fence_driver_init(rdev); | 2200 | r = radeon_fence_driver_init(rdev); |
| 2172 | if (r) | 2201 | if (r) |
| @@ -2236,7 +2265,6 @@ void evergreen_fini(struct radeon_device *rdev) | |||
| 2236 | evergreen_pcie_gart_fini(rdev); | 2265 | evergreen_pcie_gart_fini(rdev); |
| 2237 | radeon_gem_fini(rdev); | 2266 | radeon_gem_fini(rdev); |
| 2238 | radeon_fence_driver_fini(rdev); | 2267 | radeon_fence_driver_fini(rdev); |
| 2239 | radeon_clocks_fini(rdev); | ||
| 2240 | radeon_agp_fini(rdev); | 2268 | radeon_agp_fini(rdev); |
| 2241 | radeon_bo_fini(rdev); | 2269 | radeon_bo_fini(rdev); |
| 2242 | radeon_atombios_fini(rdev); | 2270 | radeon_atombios_fini(rdev); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index d0ebae9dde25..afc18d87fdca 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -2119,10 +2119,7 @@ int r600_cp_start(struct radeon_device *rdev) | |||
| 2119 | } | 2119 | } |
| 2120 | radeon_ring_write(rdev, PACKET3(PACKET3_ME_INITIALIZE, 5)); | 2120 | radeon_ring_write(rdev, PACKET3(PACKET3_ME_INITIALIZE, 5)); |
| 2121 | radeon_ring_write(rdev, 0x1); | 2121 | radeon_ring_write(rdev, 0x1); |
| 2122 | if (rdev->family >= CHIP_CEDAR) { | 2122 | if (rdev->family >= CHIP_RV770) { |
| 2123 | radeon_ring_write(rdev, 0x0); | ||
| 2124 | radeon_ring_write(rdev, rdev->config.evergreen.max_hw_contexts - 1); | ||
| 2125 | } else if (rdev->family >= CHIP_RV770) { | ||
| 2126 | radeon_ring_write(rdev, 0x0); | 2123 | radeon_ring_write(rdev, 0x0); |
| 2127 | radeon_ring_write(rdev, rdev->config.rv770.max_hw_contexts - 1); | 2124 | radeon_ring_write(rdev, rdev->config.rv770.max_hw_contexts - 1); |
| 2128 | } else { | 2125 | } else { |
| @@ -2489,11 +2486,6 @@ int r600_resume(struct radeon_device *rdev) | |||
| 2489 | */ | 2486 | */ |
| 2490 | /* post card */ | 2487 | /* post card */ |
| 2491 | atom_asic_init(rdev->mode_info.atom_context); | 2488 | atom_asic_init(rdev->mode_info.atom_context); |
| 2492 | /* Initialize clocks */ | ||
| 2493 | r = radeon_clocks_init(rdev); | ||
| 2494 | if (r) { | ||
| 2495 | return r; | ||
| 2496 | } | ||
| 2497 | 2489 | ||
| 2498 | r = r600_startup(rdev); | 2490 | r = r600_startup(rdev); |
| 2499 | if (r) { | 2491 | if (r) { |
| @@ -2586,9 +2578,6 @@ int r600_init(struct radeon_device *rdev) | |||
| 2586 | radeon_surface_init(rdev); | 2578 | radeon_surface_init(rdev); |
| 2587 | /* Initialize clocks */ | 2579 | /* Initialize clocks */ |
| 2588 | radeon_get_clock_info(rdev->ddev); | 2580 | radeon_get_clock_info(rdev->ddev); |
| 2589 | r = radeon_clocks_init(rdev); | ||
| 2590 | if (r) | ||
| 2591 | return r; | ||
| 2592 | /* Fence driver */ | 2581 | /* Fence driver */ |
| 2593 | r = radeon_fence_driver_init(rdev); | 2582 | r = radeon_fence_driver_init(rdev); |
| 2594 | if (r) | 2583 | if (r) |
| @@ -2663,7 +2652,6 @@ void r600_fini(struct radeon_device *rdev) | |||
| 2663 | radeon_agp_fini(rdev); | 2652 | radeon_agp_fini(rdev); |
| 2664 | radeon_gem_fini(rdev); | 2653 | radeon_gem_fini(rdev); |
| 2665 | radeon_fence_driver_fini(rdev); | 2654 | radeon_fence_driver_fini(rdev); |
| 2666 | radeon_clocks_fini(rdev); | ||
| 2667 | radeon_bo_fini(rdev); | 2655 | radeon_bo_fini(rdev); |
| 2668 | radeon_atombios_fini(rdev); | 2656 | radeon_atombios_fini(rdev); |
| 2669 | kfree(rdev->bios); | 2657 | kfree(rdev->bios); |
| @@ -3541,7 +3529,7 @@ void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) | |||
| 3541 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL | 3529 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL |
| 3542 | */ | 3530 | */ |
| 3543 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) { | 3531 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) { |
| 3544 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; | 3532 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; |
| 3545 | u32 tmp; | 3533 | u32 tmp; |
| 3546 | 3534 | ||
| 3547 | WREG32(HDP_DEBUG1, 0); | 3535 | WREG32(HDP_DEBUG1, 0); |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 3dfcfa3ca425..a168d644bf9e 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
| @@ -1013,6 +1013,11 @@ int radeon_gem_set_tiling_ioctl(struct drm_device *dev, void *data, | |||
| 1013 | int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data, | 1013 | int radeon_gem_get_tiling_ioctl(struct drm_device *dev, void *data, |
| 1014 | struct drm_file *filp); | 1014 | struct drm_file *filp); |
| 1015 | 1015 | ||
| 1016 | /* VRAM scratch page for HDP bug */ | ||
| 1017 | struct r700_vram_scratch { | ||
| 1018 | struct radeon_bo *robj; | ||
| 1019 | volatile uint32_t *ptr; | ||
| 1020 | }; | ||
| 1016 | 1021 | ||
| 1017 | /* | 1022 | /* |
| 1018 | * Core structure, functions and helpers. | 1023 | * Core structure, functions and helpers. |
| @@ -1079,6 +1084,7 @@ struct radeon_device { | |||
| 1079 | const struct firmware *pfp_fw; /* r6/700 PFP firmware */ | 1084 | const struct firmware *pfp_fw; /* r6/700 PFP firmware */ |
| 1080 | const struct firmware *rlc_fw; /* r6/700 RLC firmware */ | 1085 | const struct firmware *rlc_fw; /* r6/700 RLC firmware */ |
| 1081 | struct r600_blit r600_blit; | 1086 | struct r600_blit r600_blit; |
| 1087 | struct r700_vram_scratch vram_scratch; | ||
| 1082 | int msi_enabled; /* msi enabled */ | 1088 | int msi_enabled; /* msi enabled */ |
| 1083 | struct r600_ih ih; /* r6/700 interrupt ring */ | 1089 | struct r600_ih ih; /* r6/700 interrupt ring */ |
| 1084 | struct workqueue_struct *wq; | 1090 | struct workqueue_struct *wq; |
| @@ -1333,8 +1339,6 @@ extern bool radeon_card_posted(struct radeon_device *rdev); | |||
| 1333 | extern void radeon_update_bandwidth_info(struct radeon_device *rdev); | 1339 | extern void radeon_update_bandwidth_info(struct radeon_device *rdev); |
| 1334 | extern void radeon_update_display_priority(struct radeon_device *rdev); | 1340 | extern void radeon_update_display_priority(struct radeon_device *rdev); |
| 1335 | extern bool radeon_boot_test_post_card(struct radeon_device *rdev); | 1341 | extern bool radeon_boot_test_post_card(struct radeon_device *rdev); |
| 1336 | extern int radeon_clocks_init(struct radeon_device *rdev); | ||
| 1337 | extern void radeon_clocks_fini(struct radeon_device *rdev); | ||
| 1338 | extern void radeon_scratch_init(struct radeon_device *rdev); | 1342 | extern void radeon_scratch_init(struct radeon_device *rdev); |
| 1339 | extern void radeon_surface_init(struct radeon_device *rdev); | 1343 | extern void radeon_surface_init(struct radeon_device *rdev); |
| 1340 | extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data); | 1344 | extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data); |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index a21bf88e8c2d..25e1dd197791 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
| @@ -858,21 +858,3 @@ int radeon_asic_init(struct radeon_device *rdev) | |||
| 858 | return 0; | 858 | return 0; |
| 859 | } | 859 | } |
| 860 | 860 | ||
| 861 | /* | ||
| 862 | * Wrapper around modesetting bits. Move to radeon_clocks.c? | ||
| 863 | */ | ||
| 864 | int radeon_clocks_init(struct radeon_device *rdev) | ||
| 865 | { | ||
| 866 | int r; | ||
| 867 | |||
| 868 | r = radeon_static_clocks_init(rdev->ddev); | ||
| 869 | if (r) { | ||
| 870 | return r; | ||
| 871 | } | ||
| 872 | DRM_INFO("Clocks initialized !\n"); | ||
| 873 | return 0; | ||
| 874 | } | ||
| 875 | |||
| 876 | void radeon_clocks_fini(struct radeon_device *rdev) | ||
| 877 | { | ||
| 878 | } | ||
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 61141981880d..ebae14c4b768 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -85,6 +85,19 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev | |||
| 85 | for (i = 0; i < num_indices; i++) { | 85 | for (i = 0; i < num_indices; i++) { |
| 86 | gpio = &i2c_info->asGPIO_Info[i]; | 86 | gpio = &i2c_info->asGPIO_Info[i]; |
| 87 | 87 | ||
| 88 | /* some evergreen boards have bad data for this entry */ | ||
| 89 | if (ASIC_IS_DCE4(rdev)) { | ||
| 90 | if ((i == 7) && | ||
| 91 | (gpio->usClkMaskRegisterIndex == 0x1936) && | ||
| 92 | (gpio->sucI2cId.ucAccess == 0)) { | ||
| 93 | gpio->sucI2cId.ucAccess = 0x97; | ||
| 94 | gpio->ucDataMaskShift = 8; | ||
| 95 | gpio->ucDataEnShift = 8; | ||
| 96 | gpio->ucDataY_Shift = 8; | ||
| 97 | gpio->ucDataA_Shift = 8; | ||
| 98 | } | ||
| 99 | } | ||
| 100 | |||
| 88 | if (gpio->sucI2cId.ucAccess == id) { | 101 | if (gpio->sucI2cId.ucAccess == id) { |
| 89 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; | 102 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; |
| 90 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; | 103 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; |
| @@ -147,6 +160,20 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev) | |||
| 147 | for (i = 0; i < num_indices; i++) { | 160 | for (i = 0; i < num_indices; i++) { |
| 148 | gpio = &i2c_info->asGPIO_Info[i]; | 161 | gpio = &i2c_info->asGPIO_Info[i]; |
| 149 | i2c.valid = false; | 162 | i2c.valid = false; |
| 163 | |||
| 164 | /* some evergreen boards have bad data for this entry */ | ||
| 165 | if (ASIC_IS_DCE4(rdev)) { | ||
| 166 | if ((i == 7) && | ||
| 167 | (gpio->usClkMaskRegisterIndex == 0x1936) && | ||
| 168 | (gpio->sucI2cId.ucAccess == 0)) { | ||
| 169 | gpio->sucI2cId.ucAccess = 0x97; | ||
| 170 | gpio->ucDataMaskShift = 8; | ||
| 171 | gpio->ucDataEnShift = 8; | ||
| 172 | gpio->ucDataY_Shift = 8; | ||
| 173 | gpio->ucDataA_Shift = 8; | ||
| 174 | } | ||
| 175 | } | ||
| 176 | |||
| 150 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; | 177 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; |
| 151 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; | 178 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; |
| 152 | i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4; | 179 | i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4; |
diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c index 14448a740ba6..5249af8931e6 100644 --- a/drivers/gpu/drm/radeon/radeon_clocks.c +++ b/drivers/gpu/drm/radeon/radeon_clocks.c | |||
| @@ -327,6 +327,14 @@ void radeon_get_clock_info(struct drm_device *dev) | |||
| 327 | mpll->max_feedback_div = 0xff; | 327 | mpll->max_feedback_div = 0xff; |
| 328 | mpll->best_vco = 0; | 328 | mpll->best_vco = 0; |
| 329 | 329 | ||
| 330 | if (!rdev->clock.default_sclk) | ||
| 331 | rdev->clock.default_sclk = radeon_get_engine_clock(rdev); | ||
| 332 | if ((!rdev->clock.default_mclk) && rdev->asic->get_memory_clock) | ||
| 333 | rdev->clock.default_mclk = radeon_get_memory_clock(rdev); | ||
| 334 | |||
| 335 | rdev->pm.current_sclk = rdev->clock.default_sclk; | ||
| 336 | rdev->pm.current_mclk = rdev->clock.default_mclk; | ||
| 337 | |||
| 330 | } | 338 | } |
| 331 | 339 | ||
| 332 | /* 10 khz */ | 340 | /* 10 khz */ |
| @@ -897,53 +905,3 @@ void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable) | |||
| 897 | } | 905 | } |
| 898 | } | 906 | } |
| 899 | 907 | ||
| 900 | static void radeon_apply_clock_quirks(struct radeon_device *rdev) | ||
| 901 | { | ||
| 902 | uint32_t tmp; | ||
| 903 | |||
| 904 | /* XXX make sure engine is idle */ | ||
| 905 | |||
| 906 | if (rdev->family < CHIP_RS600) { | ||
| 907 | tmp = RREG32_PLL(RADEON_SCLK_CNTL); | ||
| 908 | if (ASIC_IS_R300(rdev) || ASIC_IS_RV100(rdev)) | ||
| 909 | tmp |= RADEON_SCLK_FORCE_CP | RADEON_SCLK_FORCE_VIP; | ||
| 910 | if ((rdev->family == CHIP_RV250) | ||
| 911 | || (rdev->family == CHIP_RV280)) | ||
| 912 | tmp |= | ||
| 913 | RADEON_SCLK_FORCE_DISP1 | RADEON_SCLK_FORCE_DISP2; | ||
| 914 | if ((rdev->family == CHIP_RV350) | ||
| 915 | || (rdev->family == CHIP_RV380)) | ||
| 916 | tmp |= R300_SCLK_FORCE_VAP; | ||
| 917 | if (rdev->family == CHIP_R420) | ||
| 918 | tmp |= R300_SCLK_FORCE_PX | R300_SCLK_FORCE_TX; | ||
| 919 | WREG32_PLL(RADEON_SCLK_CNTL, tmp); | ||
| 920 | } else if (rdev->family < CHIP_R600) { | ||
| 921 | tmp = RREG32_PLL(AVIVO_CP_DYN_CNTL); | ||
| 922 | tmp |= AVIVO_CP_FORCEON; | ||
| 923 | WREG32_PLL(AVIVO_CP_DYN_CNTL, tmp); | ||
| 924 | |||
| 925 | tmp = RREG32_PLL(AVIVO_E2_DYN_CNTL); | ||
| 926 | tmp |= AVIVO_E2_FORCEON; | ||
| 927 | WREG32_PLL(AVIVO_E2_DYN_CNTL, tmp); | ||
| 928 | |||
| 929 | tmp = RREG32_PLL(AVIVO_IDCT_DYN_CNTL); | ||
| 930 | tmp |= AVIVO_IDCT_FORCEON; | ||
| 931 | WREG32_PLL(AVIVO_IDCT_DYN_CNTL, tmp); | ||
| 932 | } | ||
| 933 | } | ||
| 934 | |||
| 935 | int radeon_static_clocks_init(struct drm_device *dev) | ||
| 936 | { | ||
| 937 | struct radeon_device *rdev = dev->dev_private; | ||
| 938 | |||
| 939 | /* XXX make sure engine is idle */ | ||
| 940 | |||
| 941 | if (radeon_dynclks != -1) { | ||
| 942 | if (radeon_dynclks) { | ||
| 943 | if (rdev->asic->set_clock_gating) | ||
| 944 | radeon_set_clock_gating(rdev, 1); | ||
| 945 | } | ||
| 946 | } | ||
| 947 | radeon_apply_clock_quirks(rdev); | ||
| 948 | return 0; | ||
| 949 | } | ||
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 31a09cd279ab..a9dd7847d96e 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -999,6 +999,7 @@ static enum drm_connector_status radeon_dp_detect(struct drm_connector *connecto | |||
| 999 | } | 999 | } |
| 1000 | } | 1000 | } |
| 1001 | 1001 | ||
| 1002 | radeon_connector_update_scratch_regs(connector, ret); | ||
| 1002 | return ret; | 1003 | return ret; |
| 1003 | } | 1004 | } |
| 1004 | 1005 | ||
| @@ -1050,10 +1051,16 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1050 | uint32_t subpixel_order = SubPixelNone; | 1051 | uint32_t subpixel_order = SubPixelNone; |
| 1051 | bool shared_ddc = false; | 1052 | bool shared_ddc = false; |
| 1052 | 1053 | ||
| 1053 | /* fixme - tv/cv/din */ | ||
| 1054 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) | 1054 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) |
| 1055 | return; | 1055 | return; |
| 1056 | 1056 | ||
| 1057 | /* if the user selected tv=0 don't try and add the connector */ | ||
| 1058 | if (((connector_type == DRM_MODE_CONNECTOR_SVIDEO) || | ||
| 1059 | (connector_type == DRM_MODE_CONNECTOR_Composite) || | ||
| 1060 | (connector_type == DRM_MODE_CONNECTOR_9PinDIN)) && | ||
| 1061 | (radeon_tv == 0)) | ||
| 1062 | return; | ||
| 1063 | |||
| 1057 | /* see if we already added it */ | 1064 | /* see if we already added it */ |
| 1058 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 1065 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
| 1059 | radeon_connector = to_radeon_connector(connector); | 1066 | radeon_connector = to_radeon_connector(connector); |
| @@ -1208,19 +1215,17 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1208 | case DRM_MODE_CONNECTOR_SVIDEO: | 1215 | case DRM_MODE_CONNECTOR_SVIDEO: |
| 1209 | case DRM_MODE_CONNECTOR_Composite: | 1216 | case DRM_MODE_CONNECTOR_Composite: |
| 1210 | case DRM_MODE_CONNECTOR_9PinDIN: | 1217 | case DRM_MODE_CONNECTOR_9PinDIN: |
| 1211 | if (radeon_tv == 1) { | 1218 | drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type); |
| 1212 | drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type); | 1219 | drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); |
| 1213 | drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); | 1220 | radeon_connector->dac_load_detect = true; |
| 1214 | radeon_connector->dac_load_detect = true; | 1221 | drm_connector_attach_property(&radeon_connector->base, |
| 1215 | drm_connector_attach_property(&radeon_connector->base, | 1222 | rdev->mode_info.load_detect_property, |
| 1216 | rdev->mode_info.load_detect_property, | 1223 | 1); |
| 1217 | 1); | 1224 | drm_connector_attach_property(&radeon_connector->base, |
| 1218 | drm_connector_attach_property(&radeon_connector->base, | 1225 | rdev->mode_info.tv_std_property, |
| 1219 | rdev->mode_info.tv_std_property, | 1226 | radeon_atombios_get_tv_info(rdev)); |
| 1220 | radeon_atombios_get_tv_info(rdev)); | 1227 | /* no HPD on analog connectors */ |
| 1221 | /* no HPD on analog connectors */ | 1228 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1222 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | ||
| 1223 | } | ||
| 1224 | break; | 1229 | break; |
| 1225 | case DRM_MODE_CONNECTOR_LVDS: | 1230 | case DRM_MODE_CONNECTOR_LVDS: |
| 1226 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); | 1231 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
| @@ -1271,10 +1276,16 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1271 | struct radeon_connector *radeon_connector; | 1276 | struct radeon_connector *radeon_connector; |
| 1272 | uint32_t subpixel_order = SubPixelNone; | 1277 | uint32_t subpixel_order = SubPixelNone; |
| 1273 | 1278 | ||
| 1274 | /* fixme - tv/cv/din */ | ||
| 1275 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) | 1279 | if (connector_type == DRM_MODE_CONNECTOR_Unknown) |
| 1276 | return; | 1280 | return; |
| 1277 | 1281 | ||
| 1282 | /* if the user selected tv=0 don't try and add the connector */ | ||
| 1283 | if (((connector_type == DRM_MODE_CONNECTOR_SVIDEO) || | ||
| 1284 | (connector_type == DRM_MODE_CONNECTOR_Composite) || | ||
| 1285 | (connector_type == DRM_MODE_CONNECTOR_9PinDIN)) && | ||
| 1286 | (radeon_tv == 0)) | ||
| 1287 | return; | ||
| 1288 | |||
| 1278 | /* see if we already added it */ | 1289 | /* see if we already added it */ |
| 1279 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { | 1290 | list_for_each_entry(connector, &dev->mode_config.connector_list, head) { |
| 1280 | radeon_connector = to_radeon_connector(connector); | 1291 | radeon_connector = to_radeon_connector(connector); |
| @@ -1346,26 +1357,24 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1346 | case DRM_MODE_CONNECTOR_SVIDEO: | 1357 | case DRM_MODE_CONNECTOR_SVIDEO: |
| 1347 | case DRM_MODE_CONNECTOR_Composite: | 1358 | case DRM_MODE_CONNECTOR_Composite: |
| 1348 | case DRM_MODE_CONNECTOR_9PinDIN: | 1359 | case DRM_MODE_CONNECTOR_9PinDIN: |
| 1349 | if (radeon_tv == 1) { | 1360 | drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type); |
| 1350 | drm_connector_init(dev, &radeon_connector->base, &radeon_tv_connector_funcs, connector_type); | 1361 | drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); |
| 1351 | drm_connector_helper_add(&radeon_connector->base, &radeon_tv_connector_helper_funcs); | 1362 | radeon_connector->dac_load_detect = true; |
| 1352 | radeon_connector->dac_load_detect = true; | 1363 | /* RS400,RC410,RS480 chipset seems to report a lot |
| 1353 | /* RS400,RC410,RS480 chipset seems to report a lot | 1364 | * of false positive on load detect, we haven't yet |
| 1354 | * of false positive on load detect, we haven't yet | 1365 | * found a way to make load detect reliable on those |
| 1355 | * found a way to make load detect reliable on those | 1366 | * chipset, thus just disable it for TV. |
| 1356 | * chipset, thus just disable it for TV. | 1367 | */ |
| 1357 | */ | 1368 | if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) |
| 1358 | if (rdev->family == CHIP_RS400 || rdev->family == CHIP_RS480) | 1369 | radeon_connector->dac_load_detect = false; |
| 1359 | radeon_connector->dac_load_detect = false; | 1370 | drm_connector_attach_property(&radeon_connector->base, |
| 1360 | drm_connector_attach_property(&radeon_connector->base, | 1371 | rdev->mode_info.load_detect_property, |
| 1361 | rdev->mode_info.load_detect_property, | 1372 | radeon_connector->dac_load_detect); |
| 1362 | radeon_connector->dac_load_detect); | 1373 | drm_connector_attach_property(&radeon_connector->base, |
| 1363 | drm_connector_attach_property(&radeon_connector->base, | 1374 | rdev->mode_info.tv_std_property, |
| 1364 | rdev->mode_info.tv_std_property, | 1375 | radeon_combios_get_tv_info(rdev)); |
| 1365 | radeon_combios_get_tv_info(rdev)); | 1376 | /* no HPD on analog connectors */ |
| 1366 | /* no HPD on analog connectors */ | 1377 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1367 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | ||
| 1368 | } | ||
| 1369 | break; | 1378 | break; |
| 1370 | case DRM_MODE_CONNECTOR_LVDS: | 1379 | case DRM_MODE_CONNECTOR_LVDS: |
| 1371 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); | 1380 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 69b3c2291e92..256d204a6d24 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -293,30 +293,20 @@ bool radeon_card_posted(struct radeon_device *rdev) | |||
| 293 | void radeon_update_bandwidth_info(struct radeon_device *rdev) | 293 | void radeon_update_bandwidth_info(struct radeon_device *rdev) |
| 294 | { | 294 | { |
| 295 | fixed20_12 a; | 295 | fixed20_12 a; |
| 296 | u32 sclk, mclk; | 296 | u32 sclk = rdev->pm.current_sclk; |
| 297 | u32 mclk = rdev->pm.current_mclk; | ||
| 297 | 298 | ||
| 298 | if (rdev->flags & RADEON_IS_IGP) { | 299 | /* sclk/mclk in Mhz */ |
| 299 | sclk = radeon_get_engine_clock(rdev); | 300 | a.full = dfixed_const(100); |
| 300 | mclk = rdev->clock.default_mclk; | 301 | rdev->pm.sclk.full = dfixed_const(sclk); |
| 301 | 302 | rdev->pm.sclk.full = dfixed_div(rdev->pm.sclk, a); | |
| 302 | a.full = dfixed_const(100); | 303 | rdev->pm.mclk.full = dfixed_const(mclk); |
| 303 | rdev->pm.sclk.full = dfixed_const(sclk); | 304 | rdev->pm.mclk.full = dfixed_div(rdev->pm.mclk, a); |
| 304 | rdev->pm.sclk.full = dfixed_div(rdev->pm.sclk, a); | ||
| 305 | rdev->pm.mclk.full = dfixed_const(mclk); | ||
| 306 | rdev->pm.mclk.full = dfixed_div(rdev->pm.mclk, a); | ||
| 307 | 305 | ||
| 306 | if (rdev->flags & RADEON_IS_IGP) { | ||
| 308 | a.full = dfixed_const(16); | 307 | a.full = dfixed_const(16); |
| 309 | /* core_bandwidth = sclk(Mhz) * 16 */ | 308 | /* core_bandwidth = sclk(Mhz) * 16 */ |
| 310 | rdev->pm.core_bandwidth.full = dfixed_div(rdev->pm.sclk, a); | 309 | rdev->pm.core_bandwidth.full = dfixed_div(rdev->pm.sclk, a); |
| 311 | } else { | ||
| 312 | sclk = radeon_get_engine_clock(rdev); | ||
| 313 | mclk = radeon_get_memory_clock(rdev); | ||
| 314 | |||
| 315 | a.full = dfixed_const(100); | ||
| 316 | rdev->pm.sclk.full = dfixed_const(sclk); | ||
| 317 | rdev->pm.sclk.full = dfixed_div(rdev->pm.sclk, a); | ||
| 318 | rdev->pm.mclk.full = dfixed_const(mclk); | ||
| 319 | rdev->pm.mclk.full = dfixed_div(rdev->pm.mclk, a); | ||
| 320 | } | 310 | } |
| 321 | } | 311 | } |
| 322 | 312 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_i2c.c b/drivers/gpu/drm/radeon/radeon_i2c.c index 0416804d8f30..6a13ee38a5b9 100644 --- a/drivers/gpu/drm/radeon/radeon_i2c.c +++ b/drivers/gpu/drm/radeon/radeon_i2c.c | |||
| @@ -213,7 +213,7 @@ static void post_xfer(struct i2c_adapter *i2c_adap) | |||
| 213 | 213 | ||
| 214 | static u32 radeon_get_i2c_prescale(struct radeon_device *rdev) | 214 | static u32 radeon_get_i2c_prescale(struct radeon_device *rdev) |
| 215 | { | 215 | { |
| 216 | u32 sclk = radeon_get_engine_clock(rdev); | 216 | u32 sclk = rdev->pm.current_sclk; |
| 217 | u32 prescale = 0; | 217 | u32 prescale = 0; |
| 218 | u32 nm; | 218 | u32 nm; |
| 219 | u8 n, m, loop; | 219 | u8 n, m, loop; |
diff --git a/drivers/gpu/drm/radeon/radeon_mode.h b/drivers/gpu/drm/radeon/radeon_mode.h index 8f93e2b4b0c8..efbe975312dc 100644 --- a/drivers/gpu/drm/radeon/radeon_mode.h +++ b/drivers/gpu/drm/radeon/radeon_mode.h | |||
| @@ -600,7 +600,6 @@ extern bool radeon_get_atom_connector_info_from_supported_devices_table(struct d | |||
| 600 | void radeon_enc_destroy(struct drm_encoder *encoder); | 600 | void radeon_enc_destroy(struct drm_encoder *encoder); |
| 601 | void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj); | 601 | void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj); |
| 602 | void radeon_combios_asic_init(struct drm_device *dev); | 602 | void radeon_combios_asic_init(struct drm_device *dev); |
| 603 | extern int radeon_static_clocks_init(struct drm_device *dev); | ||
| 604 | bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, | 603 | bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc, |
| 605 | struct drm_display_mode *mode, | 604 | struct drm_display_mode *mode, |
| 606 | struct drm_display_mode *adjusted_mode); | 605 | struct drm_display_mode *adjusted_mode); |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 477ba673e1b4..f87efec76236 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
| @@ -637,8 +637,6 @@ void radeon_pm_fini(struct radeon_device *rdev) | |||
| 637 | } | 637 | } |
| 638 | 638 | ||
| 639 | radeon_hwmon_fini(rdev); | 639 | radeon_hwmon_fini(rdev); |
| 640 | if (rdev->pm.i2c_bus) | ||
| 641 | radeon_i2c_destroy(rdev->pm.i2c_bus); | ||
| 642 | } | 640 | } |
| 643 | 641 | ||
| 644 | void radeon_pm_compute_clocks(struct radeon_device *rdev) | 642 | void radeon_pm_compute_clocks(struct radeon_device *rdev) |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index f1c796810117..bfa59db374d2 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
| @@ -905,6 +905,54 @@ static void rv770_gpu_init(struct radeon_device *rdev) | |||
| 905 | 905 | ||
| 906 | } | 906 | } |
| 907 | 907 | ||
| 908 | static int rv770_vram_scratch_init(struct radeon_device *rdev) | ||
| 909 | { | ||
| 910 | int r; | ||
| 911 | u64 gpu_addr; | ||
| 912 | |||
| 913 | if (rdev->vram_scratch.robj == NULL) { | ||
| 914 | r = radeon_bo_create(rdev, NULL, RADEON_GPU_PAGE_SIZE, | ||
| 915 | true, RADEON_GEM_DOMAIN_VRAM, | ||
| 916 | &rdev->vram_scratch.robj); | ||
| 917 | if (r) { | ||
| 918 | return r; | ||
| 919 | } | ||
| 920 | } | ||
| 921 | |||
| 922 | r = radeon_bo_reserve(rdev->vram_scratch.robj, false); | ||
| 923 | if (unlikely(r != 0)) | ||
| 924 | return r; | ||
| 925 | r = radeon_bo_pin(rdev->vram_scratch.robj, | ||
| 926 | RADEON_GEM_DOMAIN_VRAM, &gpu_addr); | ||
| 927 | if (r) { | ||
| 928 | radeon_bo_unreserve(rdev->vram_scratch.robj); | ||
| 929 | return r; | ||
| 930 | } | ||
| 931 | r = radeon_bo_kmap(rdev->vram_scratch.robj, | ||
| 932 | (void **)&rdev->vram_scratch.ptr); | ||
| 933 | if (r) | ||
| 934 | radeon_bo_unpin(rdev->vram_scratch.robj); | ||
| 935 | radeon_bo_unreserve(rdev->vram_scratch.robj); | ||
| 936 | |||
| 937 | return r; | ||
| 938 | } | ||
| 939 | |||
| 940 | static void rv770_vram_scratch_fini(struct radeon_device *rdev) | ||
| 941 | { | ||
| 942 | int r; | ||
| 943 | |||
| 944 | if (rdev->vram_scratch.robj == NULL) { | ||
| 945 | return; | ||
| 946 | } | ||
| 947 | r = radeon_bo_reserve(rdev->vram_scratch.robj, false); | ||
| 948 | if (likely(r == 0)) { | ||
| 949 | radeon_bo_kunmap(rdev->vram_scratch.robj); | ||
| 950 | radeon_bo_unpin(rdev->vram_scratch.robj); | ||
| 951 | radeon_bo_unreserve(rdev->vram_scratch.robj); | ||
| 952 | } | ||
| 953 | radeon_bo_unref(&rdev->vram_scratch.robj); | ||
| 954 | } | ||
| 955 | |||
| 908 | int rv770_mc_init(struct radeon_device *rdev) | 956 | int rv770_mc_init(struct radeon_device *rdev) |
| 909 | { | 957 | { |
| 910 | u32 tmp; | 958 | u32 tmp; |
| @@ -970,6 +1018,9 @@ static int rv770_startup(struct radeon_device *rdev) | |||
| 970 | if (r) | 1018 | if (r) |
| 971 | return r; | 1019 | return r; |
| 972 | } | 1020 | } |
| 1021 | r = rv770_vram_scratch_init(rdev); | ||
| 1022 | if (r) | ||
| 1023 | return r; | ||
| 973 | rv770_gpu_init(rdev); | 1024 | rv770_gpu_init(rdev); |
| 974 | r = r600_blit_init(rdev); | 1025 | r = r600_blit_init(rdev); |
| 975 | if (r) { | 1026 | if (r) { |
| @@ -1023,11 +1074,6 @@ int rv770_resume(struct radeon_device *rdev) | |||
| 1023 | */ | 1074 | */ |
| 1024 | /* post card */ | 1075 | /* post card */ |
| 1025 | atom_asic_init(rdev->mode_info.atom_context); | 1076 | atom_asic_init(rdev->mode_info.atom_context); |
| 1026 | /* Initialize clocks */ | ||
| 1027 | r = radeon_clocks_init(rdev); | ||
| 1028 | if (r) { | ||
| 1029 | return r; | ||
| 1030 | } | ||
| 1031 | 1077 | ||
| 1032 | r = rv770_startup(rdev); | 1078 | r = rv770_startup(rdev); |
| 1033 | if (r) { | 1079 | if (r) { |
| @@ -1118,9 +1164,6 @@ int rv770_init(struct radeon_device *rdev) | |||
| 1118 | radeon_surface_init(rdev); | 1164 | radeon_surface_init(rdev); |
| 1119 | /* Initialize clocks */ | 1165 | /* Initialize clocks */ |
| 1120 | radeon_get_clock_info(rdev->ddev); | 1166 | radeon_get_clock_info(rdev->ddev); |
| 1121 | r = radeon_clocks_init(rdev); | ||
| 1122 | if (r) | ||
| 1123 | return r; | ||
| 1124 | /* Fence driver */ | 1167 | /* Fence driver */ |
| 1125 | r = radeon_fence_driver_init(rdev); | 1168 | r = radeon_fence_driver_init(rdev); |
| 1126 | if (r) | 1169 | if (r) |
| @@ -1195,9 +1238,9 @@ void rv770_fini(struct radeon_device *rdev) | |||
| 1195 | r600_irq_fini(rdev); | 1238 | r600_irq_fini(rdev); |
| 1196 | radeon_irq_kms_fini(rdev); | 1239 | radeon_irq_kms_fini(rdev); |
| 1197 | rv770_pcie_gart_fini(rdev); | 1240 | rv770_pcie_gart_fini(rdev); |
| 1241 | rv770_vram_scratch_fini(rdev); | ||
| 1198 | radeon_gem_fini(rdev); | 1242 | radeon_gem_fini(rdev); |
| 1199 | radeon_fence_driver_fini(rdev); | 1243 | radeon_fence_driver_fini(rdev); |
| 1200 | radeon_clocks_fini(rdev); | ||
| 1201 | radeon_agp_fini(rdev); | 1244 | radeon_agp_fini(rdev); |
| 1202 | radeon_bo_fini(rdev); | 1245 | radeon_bo_fini(rdev); |
| 1203 | radeon_atombios_fini(rdev); | 1246 | radeon_atombios_fini(rdev); |
diff --git a/drivers/hwmon/ads7871.c b/drivers/hwmon/ads7871.c index b300a2048af1..52319340e182 100644 --- a/drivers/hwmon/ads7871.c +++ b/drivers/hwmon/ads7871.c | |||
| @@ -160,30 +160,12 @@ static const struct attribute_group ads7871_group = { | |||
| 160 | 160 | ||
| 161 | static int __devinit ads7871_probe(struct spi_device *spi) | 161 | static int __devinit ads7871_probe(struct spi_device *spi) |
| 162 | { | 162 | { |
| 163 | int status, ret, err = 0; | 163 | int ret, err; |
| 164 | uint8_t val; | 164 | uint8_t val; |
| 165 | struct ads7871_data *pdata; | 165 | struct ads7871_data *pdata; |
| 166 | 166 | ||
| 167 | dev_dbg(&spi->dev, "probe\n"); | 167 | dev_dbg(&spi->dev, "probe\n"); |
| 168 | 168 | ||
| 169 | pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL); | ||
| 170 | if (!pdata) { | ||
| 171 | err = -ENOMEM; | ||
| 172 | goto exit; | ||
| 173 | } | ||
| 174 | |||
| 175 | status = sysfs_create_group(&spi->dev.kobj, &ads7871_group); | ||
| 176 | if (status < 0) | ||
| 177 | goto error_free; | ||
| 178 | |||
| 179 | pdata->hwmon_dev = hwmon_device_register(&spi->dev); | ||
| 180 | if (IS_ERR(pdata->hwmon_dev)) { | ||
| 181 | err = PTR_ERR(pdata->hwmon_dev); | ||
| 182 | goto error_remove; | ||
| 183 | } | ||
| 184 | |||
| 185 | spi_set_drvdata(spi, pdata); | ||
| 186 | |||
| 187 | /* Configure the SPI bus */ | 169 | /* Configure the SPI bus */ |
| 188 | spi->mode = (SPI_MODE_0); | 170 | spi->mode = (SPI_MODE_0); |
| 189 | spi->bits_per_word = 8; | 171 | spi->bits_per_word = 8; |
| @@ -201,6 +183,24 @@ static int __devinit ads7871_probe(struct spi_device *spi) | |||
| 201 | we need to make sure we really have a chip*/ | 183 | we need to make sure we really have a chip*/ |
| 202 | if (val != ret) { | 184 | if (val != ret) { |
| 203 | err = -ENODEV; | 185 | err = -ENODEV; |
| 186 | goto exit; | ||
| 187 | } | ||
| 188 | |||
| 189 | pdata = kzalloc(sizeof(struct ads7871_data), GFP_KERNEL); | ||
| 190 | if (!pdata) { | ||
| 191 | err = -ENOMEM; | ||
| 192 | goto exit; | ||
| 193 | } | ||
| 194 | |||
| 195 | err = sysfs_create_group(&spi->dev.kobj, &ads7871_group); | ||
| 196 | if (err < 0) | ||
| 197 | goto error_free; | ||
| 198 | |||
| 199 | spi_set_drvdata(spi, pdata); | ||
| 200 | |||
| 201 | pdata->hwmon_dev = hwmon_device_register(&spi->dev); | ||
| 202 | if (IS_ERR(pdata->hwmon_dev)) { | ||
| 203 | err = PTR_ERR(pdata->hwmon_dev); | ||
| 204 | goto error_remove; | 204 | goto error_remove; |
| 205 | } | 205 | } |
| 206 | 206 | ||
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index c070c9714cbe..de8111114f46 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
| @@ -518,7 +518,6 @@ static struct notifier_block coretemp_cpu_notifier __refdata = { | |||
| 518 | static int __init coretemp_init(void) | 518 | static int __init coretemp_init(void) |
| 519 | { | 519 | { |
| 520 | int i, err = -ENODEV; | 520 | int i, err = -ENODEV; |
| 521 | struct pdev_entry *p, *n; | ||
| 522 | 521 | ||
| 523 | /* quick check if we run Intel */ | 522 | /* quick check if we run Intel */ |
| 524 | if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL) | 523 | if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL) |
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c index 7580f55e67e3..36e957532230 100644 --- a/drivers/hwmon/hp_accel.c +++ b/drivers/hwmon/hp_accel.c | |||
| @@ -221,6 +221,8 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = { | |||
| 221 | AXIS_DMI_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left), | 221 | AXIS_DMI_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left), |
| 222 | AXIS_DMI_MATCH("HPB452x", "HP ProBook 452", y_inverted), | 222 | AXIS_DMI_MATCH("HPB452x", "HP ProBook 452", y_inverted), |
| 223 | AXIS_DMI_MATCH("HPB522x", "HP ProBook 522", xy_swap), | 223 | AXIS_DMI_MATCH("HPB522x", "HP ProBook 522", xy_swap), |
| 224 | AXIS_DMI_MATCH("HPB532x", "HP ProBook 532", y_inverted), | ||
| 225 | AXIS_DMI_MATCH("Mini5102", "HP Mini 5102", xy_rotated_left_usd), | ||
| 224 | { NULL, } | 226 | { NULL, } |
| 225 | /* Laptop models without axis info (yet): | 227 | /* Laptop models without axis info (yet): |
| 226 | * "NC6910" "HP Compaq 6910" | 228 | * "NC6910" "HP Compaq 6910" |
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index b9bb3e0ca530..39ead2a4d3c5 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c | |||
| @@ -143,6 +143,37 @@ static const struct pci_device_id k8temp_ids[] = { | |||
| 143 | 143 | ||
| 144 | MODULE_DEVICE_TABLE(pci, k8temp_ids); | 144 | MODULE_DEVICE_TABLE(pci, k8temp_ids); |
| 145 | 145 | ||
| 146 | static int __devinit is_rev_g_desktop(u8 model) | ||
| 147 | { | ||
| 148 | u32 brandidx; | ||
| 149 | |||
| 150 | if (model < 0x69) | ||
| 151 | return 0; | ||
| 152 | |||
| 153 | if (model == 0xc1 || model == 0x6c || model == 0x7c) | ||
| 154 | return 0; | ||
| 155 | |||
| 156 | /* | ||
| 157 | * Differentiate between AM2 and ASB1. | ||
| 158 | * See "Constructing the processor Name String" in "Revision | ||
| 159 | * Guide for AMD NPT Family 0Fh Processors" (33610). | ||
| 160 | */ | ||
| 161 | brandidx = cpuid_ebx(0x80000001); | ||
| 162 | brandidx = (brandidx >> 9) & 0x1f; | ||
| 163 | |||
| 164 | /* Single core */ | ||
| 165 | if ((model == 0x6f || model == 0x7f) && | ||
| 166 | (brandidx == 0x7 || brandidx == 0x9 || brandidx == 0xc)) | ||
| 167 | return 0; | ||
| 168 | |||
| 169 | /* Dual core */ | ||
| 170 | if (model == 0x6b && | ||
| 171 | (brandidx == 0xb || brandidx == 0xc)) | ||
| 172 | return 0; | ||
| 173 | |||
| 174 | return 1; | ||
| 175 | } | ||
| 176 | |||
| 146 | static int __devinit k8temp_probe(struct pci_dev *pdev, | 177 | static int __devinit k8temp_probe(struct pci_dev *pdev, |
| 147 | const struct pci_device_id *id) | 178 | const struct pci_device_id *id) |
| 148 | { | 179 | { |
| @@ -179,9 +210,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, | |||
| 179 | "wrong - check erratum #141\n"); | 210 | "wrong - check erratum #141\n"); |
| 180 | } | 211 | } |
| 181 | 212 | ||
| 182 | if ((model >= 0x69) && | 213 | if (is_rev_g_desktop(model)) { |
| 183 | !(model == 0xc1 || model == 0x6c || model == 0x7c || | ||
| 184 | model == 0x6b || model == 0x6f || model == 0x7f)) { | ||
| 185 | /* | 214 | /* |
| 186 | * RevG desktop CPUs (i.e. no socket S1G1 or | 215 | * RevG desktop CPUs (i.e. no socket S1G1 or |
| 187 | * ASB1 parts) need additional offset, | 216 | * ASB1 parts) need additional offset, |
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index d0dc1db80b29..50815022cff1 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c | |||
| @@ -1106,7 +1106,7 @@ static int ohci_iso_recv_init(struct hpsb_iso *iso) | |||
| 1106 | if (recv->block_irq_interval * 4 > iso->buf_packets) | 1106 | if (recv->block_irq_interval * 4 > iso->buf_packets) |
| 1107 | recv->block_irq_interval = iso->buf_packets / 4; | 1107 | recv->block_irq_interval = iso->buf_packets / 4; |
| 1108 | if (recv->block_irq_interval < 1) | 1108 | if (recv->block_irq_interval < 1) |
| 1109 | recv->block_irq_interval = 1; | 1109 | recv->block_irq_interval = 1; |
| 1110 | 1110 | ||
| 1111 | /* choose a buffer stride */ | 1111 | /* choose a buffer stride */ |
| 1112 | /* must be a power of 2, and <= PAGE_SIZE */ | 1112 | /* must be a power of 2, and <= PAGE_SIZE */ |
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h index 8f0caf7d4482..78fbe9ffe7f0 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.h +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h | |||
| @@ -53,7 +53,7 @@ | |||
| 53 | #define T3_MAX_PBL_SIZE 256 | 53 | #define T3_MAX_PBL_SIZE 256 |
| 54 | #define T3_MAX_RQ_SIZE 1024 | 54 | #define T3_MAX_RQ_SIZE 1024 |
| 55 | #define T3_MAX_QP_DEPTH (T3_MAX_RQ_SIZE-1) | 55 | #define T3_MAX_QP_DEPTH (T3_MAX_RQ_SIZE-1) |
| 56 | #define T3_MAX_CQ_DEPTH 262144 | 56 | #define T3_MAX_CQ_DEPTH 65536 |
| 57 | #define T3_MAX_NUM_STAG (1<<15) | 57 | #define T3_MAX_NUM_STAG (1<<15) |
| 58 | #define T3_MAX_MR_SIZE 0x100000000ULL | 58 | #define T3_MAX_MR_SIZE 0x100000000ULL |
| 59 | #define T3_PAGESIZE_MASK 0xffff000 /* 4KB-128MB */ | 59 | #define T3_PAGESIZE_MASK 0xffff000 /* 4KB-128MB */ |
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 443cea55daac..61e0efd4ccfb 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
| @@ -502,7 +502,9 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct sk_buff *skb, | |||
| 502 | static void nes_retrans_expired(struct nes_cm_node *cm_node) | 502 | static void nes_retrans_expired(struct nes_cm_node *cm_node) |
| 503 | { | 503 | { |
| 504 | struct iw_cm_id *cm_id = cm_node->cm_id; | 504 | struct iw_cm_id *cm_id = cm_node->cm_id; |
| 505 | switch (cm_node->state) { | 505 | enum nes_cm_node_state state = cm_node->state; |
| 506 | cm_node->state = NES_CM_STATE_CLOSED; | ||
| 507 | switch (state) { | ||
| 506 | case NES_CM_STATE_SYN_RCVD: | 508 | case NES_CM_STATE_SYN_RCVD: |
| 507 | case NES_CM_STATE_CLOSING: | 509 | case NES_CM_STATE_CLOSING: |
| 508 | rem_ref_cm_node(cm_node->cm_core, cm_node); | 510 | rem_ref_cm_node(cm_node->cm_core, cm_node); |
| @@ -511,7 +513,6 @@ static void nes_retrans_expired(struct nes_cm_node *cm_node) | |||
| 511 | case NES_CM_STATE_FIN_WAIT1: | 513 | case NES_CM_STATE_FIN_WAIT1: |
| 512 | if (cm_node->cm_id) | 514 | if (cm_node->cm_id) |
| 513 | cm_id->rem_ref(cm_id); | 515 | cm_id->rem_ref(cm_id); |
| 514 | cm_node->state = NES_CM_STATE_CLOSED; | ||
| 515 | send_reset(cm_node, NULL); | 516 | send_reset(cm_node, NULL); |
| 516 | break; | 517 | break; |
| 517 | default: | 518 | default: |
| @@ -1439,9 +1440,6 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb, | |||
| 1439 | break; | 1440 | break; |
| 1440 | case NES_CM_STATE_MPAREQ_RCVD: | 1441 | case NES_CM_STATE_MPAREQ_RCVD: |
| 1441 | passive_state = atomic_add_return(1, &cm_node->passive_state); | 1442 | passive_state = atomic_add_return(1, &cm_node->passive_state); |
| 1442 | if (passive_state == NES_SEND_RESET_EVENT) | ||
| 1443 | create_event(cm_node, NES_CM_EVENT_RESET); | ||
| 1444 | cm_node->state = NES_CM_STATE_CLOSED; | ||
| 1445 | dev_kfree_skb_any(skb); | 1443 | dev_kfree_skb_any(skb); |
| 1446 | break; | 1444 | break; |
| 1447 | case NES_CM_STATE_ESTABLISHED: | 1445 | case NES_CM_STATE_ESTABLISHED: |
| @@ -1456,6 +1454,7 @@ static void handle_rst_pkt(struct nes_cm_node *cm_node, struct sk_buff *skb, | |||
| 1456 | case NES_CM_STATE_CLOSED: | 1454 | case NES_CM_STATE_CLOSED: |
| 1457 | drop_packet(skb); | 1455 | drop_packet(skb); |
| 1458 | break; | 1456 | break; |
| 1457 | case NES_CM_STATE_FIN_WAIT2: | ||
| 1459 | case NES_CM_STATE_FIN_WAIT1: | 1458 | case NES_CM_STATE_FIN_WAIT1: |
| 1460 | case NES_CM_STATE_LAST_ACK: | 1459 | case NES_CM_STATE_LAST_ACK: |
| 1461 | cm_node->cm_id->rem_ref(cm_node->cm_id); | 1460 | cm_node->cm_id->rem_ref(cm_node->cm_id); |
| @@ -2777,6 +2776,12 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
| 2777 | return -EINVAL; | 2776 | return -EINVAL; |
| 2778 | } | 2777 | } |
| 2779 | 2778 | ||
| 2779 | passive_state = atomic_add_return(1, &cm_node->passive_state); | ||
| 2780 | if (passive_state == NES_SEND_RESET_EVENT) { | ||
| 2781 | rem_ref_cm_node(cm_node->cm_core, cm_node); | ||
| 2782 | return -ECONNRESET; | ||
| 2783 | } | ||
| 2784 | |||
| 2780 | /* associate the node with the QP */ | 2785 | /* associate the node with the QP */ |
| 2781 | nesqp->cm_node = (void *)cm_node; | 2786 | nesqp->cm_node = (void *)cm_node; |
| 2782 | cm_node->nesqp = nesqp; | 2787 | cm_node->nesqp = nesqp; |
| @@ -2979,9 +2984,6 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) | |||
| 2979 | printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " | 2984 | printk(KERN_ERR "%s[%u] OFA CM event_handler returned, " |
| 2980 | "ret=%d\n", __func__, __LINE__, ret); | 2985 | "ret=%d\n", __func__, __LINE__, ret); |
| 2981 | 2986 | ||
| 2982 | passive_state = atomic_add_return(1, &cm_node->passive_state); | ||
| 2983 | if (passive_state == NES_SEND_RESET_EVENT) | ||
| 2984 | create_event(cm_node, NES_CM_EVENT_RESET); | ||
| 2985 | return 0; | 2987 | return 0; |
| 2986 | } | 2988 | } |
| 2987 | 2989 | ||
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c index f8233c851c69..1980a461c499 100644 --- a/drivers/infiniband/hw/nes/nes_hw.c +++ b/drivers/infiniband/hw/nes/nes_hw.c | |||
| @@ -3468,6 +3468,19 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, | |||
| 3468 | return; /* Ignore it, wait for close complete */ | 3468 | return; /* Ignore it, wait for close complete */ |
| 3469 | 3469 | ||
| 3470 | if (atomic_inc_return(&nesqp->close_timer_started) == 1) { | 3470 | if (atomic_inc_return(&nesqp->close_timer_started) == 1) { |
| 3471 | if ((tcp_state == NES_AEQE_TCP_STATE_CLOSE_WAIT) && | ||
| 3472 | (nesqp->ibqp_state == IB_QPS_RTS) && | ||
| 3473 | ((nesadapter->eeprom_version >> 16) != NES_A0)) { | ||
| 3474 | spin_lock_irqsave(&nesqp->lock, flags); | ||
| 3475 | nesqp->hw_iwarp_state = iwarp_state; | ||
| 3476 | nesqp->hw_tcp_state = tcp_state; | ||
| 3477 | nesqp->last_aeq = async_event_id; | ||
| 3478 | next_iwarp_state = NES_CQP_QP_IWARP_STATE_CLOSING; | ||
| 3479 | nesqp->hw_iwarp_state = NES_AEQE_IWARP_STATE_CLOSING; | ||
| 3480 | spin_unlock_irqrestore(&nesqp->lock, flags); | ||
| 3481 | nes_hw_modify_qp(nesdev, nesqp, next_iwarp_state, 0, 0); | ||
| 3482 | nes_cm_disconn(nesqp); | ||
| 3483 | } | ||
| 3471 | nesqp->cm_id->add_ref(nesqp->cm_id); | 3484 | nesqp->cm_id->add_ref(nesqp->cm_id); |
| 3472 | schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, | 3485 | schedule_nes_timer(nesqp->cm_node, (struct sk_buff *)nesqp, |
| 3473 | NES_TIMER_TYPE_CLOSE, 1, 0); | 3486 | NES_TIMER_TYPE_CLOSE, 1, 0); |
| @@ -3477,7 +3490,6 @@ static void nes_process_iwarp_aeqe(struct nes_device *nesdev, | |||
| 3477 | nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), | 3490 | nesqp->hwqp.qp_id, atomic_read(&nesqp->refcount), |
| 3478 | async_event_id, nesqp->last_aeq, tcp_state); | 3491 | async_event_id, nesqp->last_aeq, tcp_state); |
| 3479 | } | 3492 | } |
| 3480 | |||
| 3481 | break; | 3493 | break; |
| 3482 | case NES_AEQE_AEID_LLP_CLOSE_COMPLETE: | 3494 | case NES_AEQE_AEID_LLP_CLOSE_COMPLETE: |
| 3483 | if (nesqp->term_flags) { | 3495 | if (nesqp->term_flags) { |
diff --git a/drivers/infiniband/hw/nes/nes_hw.h b/drivers/infiniband/hw/nes/nes_hw.h index aa9183db32b1..1204c3432b63 100644 --- a/drivers/infiniband/hw/nes/nes_hw.h +++ b/drivers/infiniband/hw/nes/nes_hw.h | |||
| @@ -45,6 +45,7 @@ | |||
| 45 | #define NES_PHY_TYPE_KR 9 | 45 | #define NES_PHY_TYPE_KR 9 |
| 46 | 46 | ||
| 47 | #define NES_MULTICAST_PF_MAX 8 | 47 | #define NES_MULTICAST_PF_MAX 8 |
| 48 | #define NES_A0 3 | ||
| 48 | 49 | ||
| 49 | enum pci_regs { | 50 | enum pci_regs { |
| 50 | NES_INT_STAT = 0x0000, | 51 | NES_INT_STAT = 0x0000, |
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c index 6dfdd49cdbcf..10560c796fd6 100644 --- a/drivers/infiniband/hw/nes/nes_nic.c +++ b/drivers/infiniband/hw/nes/nes_nic.c | |||
| @@ -1446,14 +1446,14 @@ static int nes_netdev_set_pauseparam(struct net_device *netdev, | |||
| 1446 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); | 1446 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); |
| 1447 | u32temp |= NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; | 1447 | u32temp |= NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; |
| 1448 | nes_write_indexed(nesdev, | 1448 | nes_write_indexed(nesdev, |
| 1449 | NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE + (nesdev->mac_index*0x200), u32temp); | 1449 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200), u32temp); |
| 1450 | nesdev->disable_tx_flow_control = 0; | 1450 | nesdev->disable_tx_flow_control = 0; |
| 1451 | } else if ((et_pauseparam->tx_pause == 0) && (nesdev->disable_tx_flow_control == 0)) { | 1451 | } else if ((et_pauseparam->tx_pause == 0) && (nesdev->disable_tx_flow_control == 0)) { |
| 1452 | u32temp = nes_read_indexed(nesdev, | 1452 | u32temp = nes_read_indexed(nesdev, |
| 1453 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); | 1453 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200)); |
| 1454 | u32temp &= ~NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; | 1454 | u32temp &= ~NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE; |
| 1455 | nes_write_indexed(nesdev, | 1455 | nes_write_indexed(nesdev, |
| 1456 | NES_IDX_MAC_TX_CONFIG_ENABLE_PAUSE + (nesdev->mac_index*0x200), u32temp); | 1456 | NES_IDX_MAC_TX_CONFIG + (nesdev->mac_index*0x200), u32temp); |
| 1457 | nesdev->disable_tx_flow_control = 1; | 1457 | nesdev->disable_tx_flow_control = 1; |
| 1458 | } | 1458 | } |
| 1459 | if ((et_pauseparam->rx_pause == 1) && (nesdev->disable_rx_flow_control == 1)) { | 1459 | if ((et_pauseparam->rx_pause == 1) && (nesdev->disable_rx_flow_control == 1)) { |
diff --git a/drivers/input/input.c b/drivers/input/input.c index a9b025f4147a..ab6982056518 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
| @@ -1599,11 +1599,14 @@ EXPORT_SYMBOL(input_free_device); | |||
| 1599 | * @dev: input device supporting MT events and finger tracking | 1599 | * @dev: input device supporting MT events and finger tracking |
| 1600 | * @num_slots: number of slots used by the device | 1600 | * @num_slots: number of slots used by the device |
| 1601 | * | 1601 | * |
| 1602 | * This function allocates all necessary memory for MT slot handling | 1602 | * This function allocates all necessary memory for MT slot handling in the |
| 1603 | * in the input device, and adds ABS_MT_SLOT to the device capabilities. | 1603 | * input device, and adds ABS_MT_SLOT to the device capabilities. All slots |
| 1604 | * are initially marked as unused iby setting ABS_MT_TRACKING_ID to -1. | ||
| 1604 | */ | 1605 | */ |
| 1605 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) | 1606 | int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) |
| 1606 | { | 1607 | { |
| 1608 | int i; | ||
| 1609 | |||
| 1607 | if (!num_slots) | 1610 | if (!num_slots) |
| 1608 | return 0; | 1611 | return 0; |
| 1609 | 1612 | ||
| @@ -1614,6 +1617,10 @@ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) | |||
| 1614 | dev->mtsize = num_slots; | 1617 | dev->mtsize = num_slots; |
| 1615 | input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); | 1618 | input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); |
| 1616 | 1619 | ||
| 1620 | /* Mark slots as 'unused' */ | ||
| 1621 | for (i = 0; i < num_slots; i++) | ||
| 1622 | dev->mt[i].abs[ABS_MT_TRACKING_ID - ABS_MT_FIRST] = -1; | ||
| 1623 | |||
| 1617 | return 0; | 1624 | return 0; |
| 1618 | } | 1625 | } |
| 1619 | EXPORT_SYMBOL(input_mt_create_slots); | 1626 | EXPORT_SYMBOL(input_mt_create_slots); |
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index dcc86b97a153..19fa94af207a 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c | |||
| @@ -232,13 +232,13 @@ static void hil_dev_handle_ptr_events(struct hil_dev *ptr) | |||
| 232 | if (absdev) { | 232 | if (absdev) { |
| 233 | val = lo + (hi << 8); | 233 | val = lo + (hi << 8); |
| 234 | #ifdef TABLET_AUTOADJUST | 234 | #ifdef TABLET_AUTOADJUST |
| 235 | if (val < input_abs_min(dev, ABS_X + i)) | 235 | if (val < input_abs_get_min(dev, ABS_X + i)) |
| 236 | input_abs_set_min(dev, ABS_X + i, val); | 236 | input_abs_set_min(dev, ABS_X + i, val); |
| 237 | if (val > input_abs_max(dev, ABS_X + i)) | 237 | if (val > input_abs_get_max(dev, ABS_X + i)) |
| 238 | input_abs_set_max(dev, ABS_X + i, val); | 238 | input_abs_set_max(dev, ABS_X + i, val); |
| 239 | #endif | 239 | #endif |
| 240 | if (i % 3) | 240 | if (i % 3) |
| 241 | val = input_abs_max(dev, ABS_X + i) - val; | 241 | val = input_abs_get_max(dev, ABS_X + i) - val; |
| 242 | input_report_abs(dev, ABS_X + i, val); | 242 | input_report_abs(dev, ABS_X + i, val); |
| 243 | } else { | 243 | } else { |
| 244 | val = (int) (((int8_t) lo) | ((int8_t) hi << 8)); | 244 | val = (int) (((int8_t) lo) | ((int8_t) hi << 8)); |
| @@ -388,11 +388,11 @@ static void hil_dev_pointer_setup(struct hil_dev *ptr) | |||
| 388 | 388 | ||
| 389 | #ifdef TABLET_AUTOADJUST | 389 | #ifdef TABLET_AUTOADJUST |
| 390 | for (i = 0; i < ABS_MAX; i++) { | 390 | for (i = 0; i < ABS_MAX; i++) { |
| 391 | int diff = input_abs_max(input_dev, ABS_X + i) / 10; | 391 | int diff = input_abs_get_max(input_dev, ABS_X + i) / 10; |
| 392 | input_abs_set_min(input_dev, ABS_X + i, | 392 | input_abs_set_min(input_dev, ABS_X + i, |
| 393 | input_abs_min(input_dev, ABS_X + i) + diff) | 393 | input_abs_get_min(input_dev, ABS_X + i) + diff); |
| 394 | input_abs_set_max(input_dev, ABS_X + i, | 394 | input_abs_set_max(input_dev, ABS_X + i, |
| 395 | input_abs_max(input_dev, ABS_X + i) - diff) | 395 | input_abs_get_max(input_dev, ABS_X + i) - diff); |
| 396 | } | 396 | } |
| 397 | #endif | 397 | #endif |
| 398 | 398 | ||
diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 0e53b3bc39af..f32404f99189 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c | |||
| @@ -567,8 +567,6 @@ static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) | |||
| 567 | clk_put(keypad->clk); | 567 | clk_put(keypad->clk); |
| 568 | 568 | ||
| 569 | input_unregister_device(keypad->input_dev); | 569 | input_unregister_device(keypad->input_dev); |
| 570 | input_free_device(keypad->input_dev); | ||
| 571 | |||
| 572 | iounmap(keypad->mmio_base); | 570 | iounmap(keypad->mmio_base); |
| 573 | 571 | ||
| 574 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 572 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index bb53fd33cd1c..0d4266a533a5 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c | |||
| @@ -811,6 +811,8 @@ static struct miscdevice uinput_misc = { | |||
| 811 | .minor = UINPUT_MINOR, | 811 | .minor = UINPUT_MINOR, |
| 812 | .name = UINPUT_NAME, | 812 | .name = UINPUT_NAME, |
| 813 | }; | 813 | }; |
| 814 | MODULE_ALIAS_MISCDEV(UINPUT_MINOR); | ||
| 815 | MODULE_ALIAS("devname:" UINPUT_NAME); | ||
| 814 | 816 | ||
| 815 | static int __init uinput_init(void) | 817 | static int __init uinput_init(void) |
| 816 | { | 818 | { |
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c index ea67c49146a3..b95231763911 100644 --- a/drivers/input/mouse/bcm5974.c +++ b/drivers/input/mouse/bcm5974.c | |||
| @@ -337,10 +337,14 @@ static void report_finger_data(struct input_dev *input, | |||
| 337 | const struct bcm5974_config *cfg, | 337 | const struct bcm5974_config *cfg, |
| 338 | const struct tp_finger *f) | 338 | const struct tp_finger *f) |
| 339 | { | 339 | { |
| 340 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, raw2int(f->force_major)); | 340 | input_report_abs(input, ABS_MT_TOUCH_MAJOR, |
| 341 | input_report_abs(input, ABS_MT_TOUCH_MINOR, raw2int(f->force_minor)); | 341 | raw2int(f->force_major) << 1); |
| 342 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, raw2int(f->size_major)); | 342 | input_report_abs(input, ABS_MT_TOUCH_MINOR, |
| 343 | input_report_abs(input, ABS_MT_WIDTH_MINOR, raw2int(f->size_minor)); | 343 | raw2int(f->force_minor) << 1); |
| 344 | input_report_abs(input, ABS_MT_WIDTH_MAJOR, | ||
| 345 | raw2int(f->size_major) << 1); | ||
| 346 | input_report_abs(input, ABS_MT_WIDTH_MINOR, | ||
| 347 | raw2int(f->size_minor) << 1); | ||
| 344 | input_report_abs(input, ABS_MT_ORIENTATION, | 348 | input_report_abs(input, ABS_MT_ORIENTATION, |
| 345 | MAX_FINGER_ORIENTATION - raw2int(f->orientation)); | 349 | MAX_FINGER_ORIENTATION - raw2int(f->orientation)); |
| 346 | input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x)); | 350 | input_report_abs(input, ABS_MT_POSITION_X, raw2int(f->abs_x)); |
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 83c24cca234a..d528a2dba064 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
| @@ -138,8 +138,8 @@ static void mousedev_touchpad_event(struct input_dev *dev, | |||
| 138 | 138 | ||
| 139 | fx(0) = value; | 139 | fx(0) = value; |
| 140 | if (mousedev->touch && mousedev->pkt_count >= 2) { | 140 | if (mousedev->touch && mousedev->pkt_count >= 2) { |
| 141 | size = input_abs_get_min(dev, ABS_X) - | 141 | size = input_abs_get_max(dev, ABS_X) - |
| 142 | input_abs_get_max(dev, ABS_X); | 142 | input_abs_get_min(dev, ABS_X); |
| 143 | if (size == 0) | 143 | if (size == 0) |
| 144 | size = 256 * 2; | 144 | size = 256 * 2; |
| 145 | 145 | ||
| @@ -155,8 +155,8 @@ static void mousedev_touchpad_event(struct input_dev *dev, | |||
| 155 | fy(0) = value; | 155 | fy(0) = value; |
| 156 | if (mousedev->touch && mousedev->pkt_count >= 2) { | 156 | if (mousedev->touch && mousedev->pkt_count >= 2) { |
| 157 | /* use X size for ABS_Y to keep the same scale */ | 157 | /* use X size for ABS_Y to keep the same scale */ |
| 158 | size = input_abs_get_min(dev, ABS_X) - | 158 | size = input_abs_get_max(dev, ABS_X) - |
| 159 | input_abs_get_max(dev, ABS_X); | 159 | input_abs_get_min(dev, ABS_X); |
| 160 | if (size == 0) | 160 | if (size == 0) |
| 161 | size = 256 * 2; | 161 | size = 256 * 2; |
| 162 | 162 | ||
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 46e4ba0b9246..f58513160480 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
| @@ -1485,8 +1485,8 @@ static int __init i8042_init(void) | |||
| 1485 | 1485 | ||
| 1486 | static void __exit i8042_exit(void) | 1486 | static void __exit i8042_exit(void) |
| 1487 | { | 1487 | { |
| 1488 | platform_driver_unregister(&i8042_driver); | ||
| 1489 | platform_device_unregister(i8042_platform_device); | 1488 | platform_device_unregister(i8042_platform_device); |
| 1489 | platform_driver_unregister(&i8042_driver); | ||
| 1490 | i8042_platform_exit(); | 1490 | i8042_platform_exit(); |
| 1491 | 1491 | ||
| 1492 | panic_blink = NULL; | 1492 | panic_blink = NULL; |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 40d77ba8fdc1..6e29badb969e 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -243,10 +243,10 @@ static int wacom_graphire_irq(struct wacom_wac *wacom) | |||
| 243 | if (features->type == WACOM_G4 || | 243 | if (features->type == WACOM_G4 || |
| 244 | features->type == WACOM_MO) { | 244 | features->type == WACOM_MO) { |
| 245 | input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f); | 245 | input_report_abs(input, ABS_DISTANCE, data[6] & 0x3f); |
| 246 | rw = (signed)(data[7] & 0x04) - (data[7] & 0x03); | 246 | rw = (data[7] & 0x04) - (data[7] & 0x03); |
| 247 | } else { | 247 | } else { |
| 248 | input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f); | 248 | input_report_abs(input, ABS_DISTANCE, data[7] & 0x3f); |
| 249 | rw = -(signed)data[6]; | 249 | rw = -(signed char)data[6]; |
| 250 | } | 250 | } |
| 251 | input_report_rel(input, REL_WHEEL, rw); | 251 | input_report_rel(input, REL_WHEEL, rw); |
| 252 | } | 252 | } |
diff --git a/drivers/md/.gitignore b/drivers/md/.gitignore deleted file mode 100644 index a7afec6b19c6..000000000000 --- a/drivers/md/.gitignore +++ /dev/null | |||
| @@ -1,4 +0,0 @@ | |||
| 1 | mktables | ||
| 2 | raid6altivec*.c | ||
| 3 | raid6int*.c | ||
| 4 | raid6tables.c | ||
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 1ba1e122e948..ed4900ade93a 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
| @@ -1542,8 +1542,7 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector) | |||
| 1542 | atomic_read(&bitmap->mddev->recovery_active) == 0); | 1542 | atomic_read(&bitmap->mddev->recovery_active) == 0); |
| 1543 | 1543 | ||
| 1544 | bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; | 1544 | bitmap->mddev->curr_resync_completed = bitmap->mddev->curr_resync; |
| 1545 | if (bitmap->mddev->persistent) | 1545 | set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); |
| 1546 | set_bit(MD_CHANGE_CLEAN, &bitmap->mddev->flags); | ||
| 1547 | sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); | 1546 | sector &= ~((1ULL << CHUNK_BLOCK_SHIFT(bitmap)) - 1); |
| 1548 | s = 0; | 1547 | s = 0; |
| 1549 | while (s < sector && s < bitmap->mddev->resync_max_sectors) { | 1548 | while (s < sector && s < bitmap->mddev->resync_max_sectors) { |
diff --git a/drivers/md/md.c b/drivers/md/md.c index c148b6302154..43cf9cc9c1df 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -2167,9 +2167,9 @@ repeat: | |||
| 2167 | rdev->recovery_offset = mddev->curr_resync_completed; | 2167 | rdev->recovery_offset = mddev->curr_resync_completed; |
| 2168 | 2168 | ||
| 2169 | } | 2169 | } |
| 2170 | if (mddev->external || !mddev->persistent) { | 2170 | if (!mddev->persistent) { |
| 2171 | clear_bit(MD_CHANGE_DEVS, &mddev->flags); | ||
| 2172 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); | 2171 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); |
| 2172 | clear_bit(MD_CHANGE_DEVS, &mddev->flags); | ||
| 2173 | wake_up(&mddev->sb_wait); | 2173 | wake_up(&mddev->sb_wait); |
| 2174 | return; | 2174 | return; |
| 2175 | } | 2175 | } |
| @@ -2178,7 +2178,6 @@ repeat: | |||
| 2178 | 2178 | ||
| 2179 | mddev->utime = get_seconds(); | 2179 | mddev->utime = get_seconds(); |
| 2180 | 2180 | ||
| 2181 | set_bit(MD_CHANGE_PENDING, &mddev->flags); | ||
| 2182 | if (test_and_clear_bit(MD_CHANGE_DEVS, &mddev->flags)) | 2181 | if (test_and_clear_bit(MD_CHANGE_DEVS, &mddev->flags)) |
| 2183 | force_change = 1; | 2182 | force_change = 1; |
| 2184 | if (test_and_clear_bit(MD_CHANGE_CLEAN, &mddev->flags)) | 2183 | if (test_and_clear_bit(MD_CHANGE_CLEAN, &mddev->flags)) |
| @@ -3371,7 +3370,7 @@ array_state_show(mddev_t *mddev, char *page) | |||
| 3371 | case 0: | 3370 | case 0: |
| 3372 | if (mddev->in_sync) | 3371 | if (mddev->in_sync) |
| 3373 | st = clean; | 3372 | st = clean; |
| 3374 | else if (test_bit(MD_CHANGE_CLEAN, &mddev->flags)) | 3373 | else if (test_bit(MD_CHANGE_PENDING, &mddev->flags)) |
| 3375 | st = write_pending; | 3374 | st = write_pending; |
| 3376 | else if (mddev->safemode) | 3375 | else if (mddev->safemode) |
| 3377 | st = active_idle; | 3376 | st = active_idle; |
| @@ -3452,9 +3451,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) | |||
| 3452 | mddev->in_sync = 1; | 3451 | mddev->in_sync = 1; |
| 3453 | if (mddev->safemode == 1) | 3452 | if (mddev->safemode == 1) |
| 3454 | mddev->safemode = 0; | 3453 | mddev->safemode = 0; |
| 3455 | if (mddev->persistent) | 3454 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
| 3456 | set_bit(MD_CHANGE_CLEAN, | ||
| 3457 | &mddev->flags); | ||
| 3458 | } | 3455 | } |
| 3459 | err = 0; | 3456 | err = 0; |
| 3460 | } else | 3457 | } else |
| @@ -3466,8 +3463,7 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len) | |||
| 3466 | case active: | 3463 | case active: |
| 3467 | if (mddev->pers) { | 3464 | if (mddev->pers) { |
| 3468 | restart_array(mddev); | 3465 | restart_array(mddev); |
| 3469 | if (mddev->external) | 3466 | clear_bit(MD_CHANGE_PENDING, &mddev->flags); |
| 3470 | clear_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
| 3471 | wake_up(&mddev->sb_wait); | 3467 | wake_up(&mddev->sb_wait); |
| 3472 | err = 0; | 3468 | err = 0; |
| 3473 | } else { | 3469 | } else { |
| @@ -6572,6 +6568,7 @@ void md_write_start(mddev_t *mddev, struct bio *bi) | |||
| 6572 | if (mddev->in_sync) { | 6568 | if (mddev->in_sync) { |
| 6573 | mddev->in_sync = 0; | 6569 | mddev->in_sync = 0; |
| 6574 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | 6570 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
| 6571 | set_bit(MD_CHANGE_PENDING, &mddev->flags); | ||
| 6575 | md_wakeup_thread(mddev->thread); | 6572 | md_wakeup_thread(mddev->thread); |
| 6576 | did_change = 1; | 6573 | did_change = 1; |
| 6577 | } | 6574 | } |
| @@ -6580,7 +6577,6 @@ void md_write_start(mddev_t *mddev, struct bio *bi) | |||
| 6580 | if (did_change) | 6577 | if (did_change) |
| 6581 | sysfs_notify_dirent_safe(mddev->sysfs_state); | 6578 | sysfs_notify_dirent_safe(mddev->sysfs_state); |
| 6582 | wait_event(mddev->sb_wait, | 6579 | wait_event(mddev->sb_wait, |
| 6583 | !test_bit(MD_CHANGE_CLEAN, &mddev->flags) && | ||
| 6584 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); | 6580 | !test_bit(MD_CHANGE_PENDING, &mddev->flags)); |
| 6585 | } | 6581 | } |
| 6586 | 6582 | ||
| @@ -6616,6 +6612,7 @@ int md_allow_write(mddev_t *mddev) | |||
| 6616 | if (mddev->in_sync) { | 6612 | if (mddev->in_sync) { |
| 6617 | mddev->in_sync = 0; | 6613 | mddev->in_sync = 0; |
| 6618 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | 6614 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
| 6615 | set_bit(MD_CHANGE_PENDING, &mddev->flags); | ||
| 6619 | if (mddev->safemode_delay && | 6616 | if (mddev->safemode_delay && |
| 6620 | mddev->safemode == 0) | 6617 | mddev->safemode == 0) |
| 6621 | mddev->safemode = 1; | 6618 | mddev->safemode = 1; |
| @@ -6625,7 +6622,7 @@ int md_allow_write(mddev_t *mddev) | |||
| 6625 | } else | 6622 | } else |
| 6626 | spin_unlock_irq(&mddev->write_lock); | 6623 | spin_unlock_irq(&mddev->write_lock); |
| 6627 | 6624 | ||
| 6628 | if (test_bit(MD_CHANGE_CLEAN, &mddev->flags)) | 6625 | if (test_bit(MD_CHANGE_PENDING, &mddev->flags)) |
| 6629 | return -EAGAIN; | 6626 | return -EAGAIN; |
| 6630 | else | 6627 | else |
| 6631 | return 0; | 6628 | return 0; |
| @@ -6823,8 +6820,7 @@ void md_do_sync(mddev_t *mddev) | |||
| 6823 | atomic_read(&mddev->recovery_active) == 0); | 6820 | atomic_read(&mddev->recovery_active) == 0); |
| 6824 | mddev->curr_resync_completed = | 6821 | mddev->curr_resync_completed = |
| 6825 | mddev->curr_resync; | 6822 | mddev->curr_resync; |
| 6826 | if (mddev->persistent) | 6823 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
| 6827 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
| 6828 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); | 6824 | sysfs_notify(&mddev->kobj, NULL, "sync_completed"); |
| 6829 | } | 6825 | } |
| 6830 | 6826 | ||
| @@ -7103,8 +7099,7 @@ void md_check_recovery(mddev_t *mddev) | |||
| 7103 | mddev->recovery_cp == MaxSector) { | 7099 | mddev->recovery_cp == MaxSector) { |
| 7104 | mddev->in_sync = 1; | 7100 | mddev->in_sync = 1; |
| 7105 | did_change = 1; | 7101 | did_change = 1; |
| 7106 | if (mddev->persistent) | 7102 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); |
| 7107 | set_bit(MD_CHANGE_CLEAN, &mddev->flags); | ||
| 7108 | } | 7103 | } |
| 7109 | if (mddev->safemode == 1) | 7104 | if (mddev->safemode == 1) |
| 7110 | mddev->safemode = 0; | 7105 | mddev->safemode = 0; |
diff --git a/drivers/md/md.h b/drivers/md/md.h index a953fe2808ae..3931299788dc 100644 --- a/drivers/md/md.h +++ b/drivers/md/md.h | |||
| @@ -140,7 +140,7 @@ struct mddev_s | |||
| 140 | unsigned long flags; | 140 | unsigned long flags; |
| 141 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | 141 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ |
| 142 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | 142 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ |
| 143 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | 143 | #define MD_CHANGE_PENDING 2 /* switch from 'clean' to 'active' in progress */ |
| 144 | 144 | ||
| 145 | int suspended; | 145 | int suspended; |
| 146 | atomic_t active_io; | 146 | atomic_t active_io; |
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index bd2755e8d9a3..f332c52968b7 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c | |||
| @@ -362,9 +362,8 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, | |||
| 362 | goto err; | 362 | goto err; |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | err = mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid); | 365 | if (ocr & R4_MEMORY_PRESENT |
| 366 | 366 | && mmc_sd_get_cid(host, host->ocr & ocr, card->raw_cid) == 0) { | |
| 367 | if (!err) { | ||
| 368 | card->type = MMC_TYPE_SD_COMBO; | 367 | card->type = MMC_TYPE_SD_COMBO; |
| 369 | 368 | ||
| 370 | if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO || | 369 | if (oldcard && (oldcard->type != MMC_TYPE_SD_COMBO || |
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c index 5f3a599ead07..87226cd202a5 100644 --- a/drivers/mmc/host/at91_mci.c +++ b/drivers/mmc/host/at91_mci.c | |||
| @@ -66,6 +66,7 @@ | |||
| 66 | #include <linux/clk.h> | 66 | #include <linux/clk.h> |
| 67 | #include <linux/atmel_pdc.h> | 67 | #include <linux/atmel_pdc.h> |
| 68 | #include <linux/gfp.h> | 68 | #include <linux/gfp.h> |
| 69 | #include <linux/highmem.h> | ||
| 69 | 70 | ||
| 70 | #include <linux/mmc/host.h> | 71 | #include <linux/mmc/host.h> |
| 71 | 72 | ||
diff --git a/drivers/mmc/host/imxmmc.c b/drivers/mmc/host/imxmmc.c index 9a68ff4353a2..5a950b16d9e6 100644 --- a/drivers/mmc/host/imxmmc.c +++ b/drivers/mmc/host/imxmmc.c | |||
| @@ -148,11 +148,12 @@ static int imxmci_start_clock(struct imxmci_host *host) | |||
| 148 | 148 | ||
| 149 | while (delay--) { | 149 | while (delay--) { |
| 150 | reg = readw(host->base + MMC_REG_STATUS); | 150 | reg = readw(host->base + MMC_REG_STATUS); |
| 151 | if (reg & STATUS_CARD_BUS_CLK_RUN) | 151 | if (reg & STATUS_CARD_BUS_CLK_RUN) { |
| 152 | /* Check twice before cut */ | 152 | /* Check twice before cut */ |
| 153 | reg = readw(host->base + MMC_REG_STATUS); | 153 | reg = readw(host->base + MMC_REG_STATUS); |
| 154 | if (reg & STATUS_CARD_BUS_CLK_RUN) | 154 | if (reg & STATUS_CARD_BUS_CLK_RUN) |
| 155 | return 0; | 155 | return 0; |
| 156 | } | ||
| 156 | 157 | ||
| 157 | if (test_bit(IMXMCI_PEND_STARTED_b, &host->pending_events)) | 158 | if (test_bit(IMXMCI_PEND_STARTED_b, &host->pending_events)) |
| 158 | return 0; | 159 | return 0; |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4a8776f8afdd..4526d2791f29 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
| @@ -2305,7 +2305,6 @@ static int omap_hsmmc_suspend(struct device *dev) | |||
| 2305 | int ret = 0; | 2305 | int ret = 0; |
| 2306 | struct platform_device *pdev = to_platform_device(dev); | 2306 | struct platform_device *pdev = to_platform_device(dev); |
| 2307 | struct omap_hsmmc_host *host = platform_get_drvdata(pdev); | 2307 | struct omap_hsmmc_host *host = platform_get_drvdata(pdev); |
| 2308 | pm_message_t state = PMSG_SUSPEND; /* unused by MMC core */ | ||
| 2309 | 2308 | ||
| 2310 | if (host && host->suspended) | 2309 | if (host && host->suspended) |
| 2311 | return 0; | 2310 | return 0; |
| @@ -2324,8 +2323,8 @@ static int omap_hsmmc_suspend(struct device *dev) | |||
| 2324 | } | 2323 | } |
| 2325 | } | 2324 | } |
| 2326 | cancel_work_sync(&host->mmc_carddetect_work); | 2325 | cancel_work_sync(&host->mmc_carddetect_work); |
| 2327 | mmc_host_enable(host->mmc); | ||
| 2328 | ret = mmc_suspend_host(host->mmc); | 2326 | ret = mmc_suspend_host(host->mmc); |
| 2327 | mmc_host_enable(host->mmc); | ||
| 2329 | if (ret == 0) { | 2328 | if (ret == 0) { |
| 2330 | omap_hsmmc_disable_irq(host); | 2329 | omap_hsmmc_disable_irq(host); |
| 2331 | OMAP_HSMMC_WRITE(host->base, HCTL, | 2330 | OMAP_HSMMC_WRITE(host->base, HCTL, |
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 2e16e0a90a5e..976330de379e 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c | |||
| @@ -1600,7 +1600,7 @@ static int __devinit s3cmci_probe(struct platform_device *pdev) | |||
| 1600 | host->pio_active = XFER_NONE; | 1600 | host->pio_active = XFER_NONE; |
| 1601 | 1601 | ||
| 1602 | #ifdef CONFIG_MMC_S3C_PIODMA | 1602 | #ifdef CONFIG_MMC_S3C_PIODMA |
| 1603 | host->dodma = host->pdata->dma; | 1603 | host->dodma = host->pdata->use_dma; |
| 1604 | #endif | 1604 | #endif |
| 1605 | 1605 | ||
| 1606 | host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1606 | host->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index ee7d0a5a51c4..69d98e3bf6ab 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
| @@ -164,6 +164,7 @@ tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd) | |||
| 164 | static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) | 164 | static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) |
| 165 | { | 165 | { |
| 166 | struct mmc_data *data = host->data; | 166 | struct mmc_data *data = host->data; |
| 167 | void *sg_virt; | ||
| 167 | unsigned short *buf; | 168 | unsigned short *buf; |
| 168 | unsigned int count; | 169 | unsigned int count; |
| 169 | unsigned long flags; | 170 | unsigned long flags; |
| @@ -173,8 +174,8 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) | |||
| 173 | return; | 174 | return; |
| 174 | } | 175 | } |
| 175 | 176 | ||
| 176 | buf = (unsigned short *)(tmio_mmc_kmap_atomic(host, &flags) + | 177 | sg_virt = tmio_mmc_kmap_atomic(host->sg_ptr, &flags); |
| 177 | host->sg_off); | 178 | buf = (unsigned short *)(sg_virt + host->sg_off); |
| 178 | 179 | ||
| 179 | count = host->sg_ptr->length - host->sg_off; | 180 | count = host->sg_ptr->length - host->sg_off; |
| 180 | if (count > data->blksz) | 181 | if (count > data->blksz) |
| @@ -191,7 +192,7 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host) | |||
| 191 | 192 | ||
| 192 | host->sg_off += count; | 193 | host->sg_off += count; |
| 193 | 194 | ||
| 194 | tmio_mmc_kunmap_atomic(host, &flags); | 195 | tmio_mmc_kunmap_atomic(sg_virt, &flags); |
| 195 | 196 | ||
| 196 | if (host->sg_off == host->sg_ptr->length) | 197 | if (host->sg_off == host->sg_ptr->length) |
| 197 | tmio_mmc_next_sg(host); | 198 | tmio_mmc_next_sg(host); |
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h index 64f7d5dfc106..0fedc78e3ea5 100644 --- a/drivers/mmc/host/tmio_mmc.h +++ b/drivers/mmc/host/tmio_mmc.h | |||
| @@ -82,10 +82,7 @@ | |||
| 82 | 82 | ||
| 83 | #define ack_mmc_irqs(host, i) \ | 83 | #define ack_mmc_irqs(host, i) \ |
| 84 | do { \ | 84 | do { \ |
| 85 | u32 mask;\ | 85 | sd_ctrl_write32((host), CTL_STATUS, ~(i)); \ |
| 86 | mask = sd_ctrl_read32((host), CTL_STATUS); \ | ||
| 87 | mask &= ~((i) & TMIO_MASK_IRQ); \ | ||
| 88 | sd_ctrl_write32((host), CTL_STATUS, mask); \ | ||
| 89 | } while (0) | 86 | } while (0) |
| 90 | 87 | ||
| 91 | 88 | ||
| @@ -177,19 +174,17 @@ static inline int tmio_mmc_next_sg(struct tmio_mmc_host *host) | |||
| 177 | return --host->sg_len; | 174 | return --host->sg_len; |
| 178 | } | 175 | } |
| 179 | 176 | ||
| 180 | static inline char *tmio_mmc_kmap_atomic(struct tmio_mmc_host *host, | 177 | static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg, |
| 181 | unsigned long *flags) | 178 | unsigned long *flags) |
| 182 | { | 179 | { |
| 183 | struct scatterlist *sg = host->sg_ptr; | ||
| 184 | |||
| 185 | local_irq_save(*flags); | 180 | local_irq_save(*flags); |
| 186 | return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset; | 181 | return kmap_atomic(sg_page(sg), KM_BIO_SRC_IRQ) + sg->offset; |
| 187 | } | 182 | } |
| 188 | 183 | ||
| 189 | static inline void tmio_mmc_kunmap_atomic(struct tmio_mmc_host *host, | 184 | static inline void tmio_mmc_kunmap_atomic(void *virt, |
| 190 | unsigned long *flags) | 185 | unsigned long *flags) |
| 191 | { | 186 | { |
| 192 | kunmap_atomic(sg_page(host->sg_ptr), KM_BIO_SRC_IRQ); | 187 | kunmap_atomic(virt, KM_BIO_SRC_IRQ); |
| 193 | local_irq_restore(*flags); | 188 | local_irq_restore(*flags); |
| 194 | } | 189 | } |
| 195 | 190 | ||
diff --git a/drivers/mtd/ubi/Kconfig.debug b/drivers/mtd/ubi/Kconfig.debug index 2246f154e2f7..61f6e5e40458 100644 --- a/drivers/mtd/ubi/Kconfig.debug +++ b/drivers/mtd/ubi/Kconfig.debug | |||
| @@ -6,7 +6,7 @@ config MTD_UBI_DEBUG | |||
| 6 | depends on SYSFS | 6 | depends on SYSFS |
| 7 | depends on MTD_UBI | 7 | depends on MTD_UBI |
| 8 | select DEBUG_FS | 8 | select DEBUG_FS |
| 9 | select KALLSYMS_ALL | 9 | select KALLSYMS_ALL if KALLSYMS && DEBUG_KERNEL |
| 10 | help | 10 | help |
| 11 | This option enables UBI debugging. | 11 | This option enables UBI debugging. |
| 12 | 12 | ||
diff --git a/drivers/mtd/ubi/cdev.c b/drivers/mtd/ubi/cdev.c index 4dfa6b90c21c..3d2d1a69e9a0 100644 --- a/drivers/mtd/ubi/cdev.c +++ b/drivers/mtd/ubi/cdev.c | |||
| @@ -798,18 +798,18 @@ static int rename_volumes(struct ubi_device *ubi, | |||
| 798 | goto out_free; | 798 | goto out_free; |
| 799 | } | 799 | } |
| 800 | 800 | ||
| 801 | re = kzalloc(sizeof(struct ubi_rename_entry), GFP_KERNEL); | 801 | re1 = kzalloc(sizeof(struct ubi_rename_entry), GFP_KERNEL); |
| 802 | if (!re) { | 802 | if (!re1) { |
| 803 | err = -ENOMEM; | 803 | err = -ENOMEM; |
| 804 | ubi_close_volume(desc); | 804 | ubi_close_volume(desc); |
| 805 | goto out_free; | 805 | goto out_free; |
| 806 | } | 806 | } |
| 807 | 807 | ||
| 808 | re->remove = 1; | 808 | re1->remove = 1; |
| 809 | re->desc = desc; | 809 | re1->desc = desc; |
| 810 | list_add(&re->list, &rename_list); | 810 | list_add(&re1->list, &rename_list); |
| 811 | dbg_msg("will remove volume %d, name \"%s\"", | 811 | dbg_msg("will remove volume %d, name \"%s\"", |
| 812 | re->desc->vol->vol_id, re->desc->vol->name); | 812 | re1->desc->vol->vol_id, re1->desc->vol->name); |
| 813 | } | 813 | } |
| 814 | 814 | ||
| 815 | mutex_lock(&ubi->device_mutex); | 815 | mutex_lock(&ubi->device_mutex); |
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 372a15ac9995..69b52e9c9489 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
| @@ -843,7 +843,7 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
| 843 | case UBI_COMPAT_DELETE: | 843 | case UBI_COMPAT_DELETE: |
| 844 | ubi_msg("\"delete\" compatible internal volume %d:%d" | 844 | ubi_msg("\"delete\" compatible internal volume %d:%d" |
| 845 | " found, will remove it", vol_id, lnum); | 845 | " found, will remove it", vol_id, lnum); |
| 846 | err = add_to_list(si, pnum, ec, &si->corr); | 846 | err = add_to_list(si, pnum, ec, &si->erase); |
| 847 | if (err) | 847 | if (err) |
| 848 | return err; | 848 | return err; |
| 849 | return 0; | 849 | return 0; |
diff --git a/drivers/mtd/ubi/wl.c b/drivers/mtd/ubi/wl.c index ee7b1d8fbb92..97a435672eaf 100644 --- a/drivers/mtd/ubi/wl.c +++ b/drivers/mtd/ubi/wl.c | |||
| @@ -1212,7 +1212,8 @@ int ubi_wl_scrub_peb(struct ubi_device *ubi, int pnum) | |||
| 1212 | retry: | 1212 | retry: |
| 1213 | spin_lock(&ubi->wl_lock); | 1213 | spin_lock(&ubi->wl_lock); |
| 1214 | e = ubi->lookuptbl[pnum]; | 1214 | e = ubi->lookuptbl[pnum]; |
| 1215 | if (e == ubi->move_from || in_wl_tree(e, &ubi->scrub)) { | 1215 | if (e == ubi->move_from || in_wl_tree(e, &ubi->scrub) || |
| 1216 | in_wl_tree(e, &ubi->erroneous)) { | ||
| 1216 | spin_unlock(&ubi->wl_lock); | 1217 | spin_unlock(&ubi->wl_lock); |
| 1217 | return 0; | 1218 | return 0; |
| 1218 | } | 1219 | } |
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c index c754d88e5ec9..85671adae455 100644 --- a/drivers/net/3c59x.c +++ b/drivers/net/3c59x.c | |||
| @@ -633,7 +633,8 @@ struct vortex_private { | |||
| 633 | open:1, | 633 | open:1, |
| 634 | medialock:1, | 634 | medialock:1, |
| 635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ | 635 | must_free_region:1, /* Flag: if zero, Cardbus owns the I/O region */ |
| 636 | large_frames:1; /* accept large frames */ | 636 | large_frames:1, /* accept large frames */ |
| 637 | handling_irq:1; /* private in_irq indicator */ | ||
| 637 | int drv_flags; | 638 | int drv_flags; |
| 638 | u16 status_enable; | 639 | u16 status_enable; |
| 639 | u16 intr_enable; | 640 | u16 intr_enable; |
| @@ -646,7 +647,7 @@ struct vortex_private { | |||
| 646 | u16 io_size; /* Size of PCI region (for release_region) */ | 647 | u16 io_size; /* Size of PCI region (for release_region) */ |
| 647 | 648 | ||
| 648 | /* Serialises access to hardware other than MII and variables below. | 649 | /* Serialises access to hardware other than MII and variables below. |
| 649 | * The lock hierarchy is rtnl_lock > lock > mii_lock > window_lock. */ | 650 | * The lock hierarchy is rtnl_lock > {lock, mii_lock} > window_lock. */ |
| 650 | spinlock_t lock; | 651 | spinlock_t lock; |
| 651 | 652 | ||
| 652 | spinlock_t mii_lock; /* Serialises access to MII */ | 653 | spinlock_t mii_lock; /* Serialises access to MII */ |
| @@ -1993,10 +1994,9 @@ vortex_error(struct net_device *dev, int status) | |||
| 1993 | } | 1994 | } |
| 1994 | } | 1995 | } |
| 1995 | 1996 | ||
| 1996 | if (status & RxEarly) { /* Rx early is unused. */ | 1997 | if (status & RxEarly) /* Rx early is unused. */ |
| 1997 | vortex_rx(dev); | ||
| 1998 | iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD); | 1998 | iowrite16(AckIntr | RxEarly, ioaddr + EL3_CMD); |
| 1999 | } | 1999 | |
| 2000 | if (status & StatsFull) { /* Empty statistics. */ | 2000 | if (status & StatsFull) { /* Empty statistics. */ |
| 2001 | static int DoneDidThat; | 2001 | static int DoneDidThat; |
| 2002 | if (vortex_debug > 4) | 2002 | if (vortex_debug > 4) |
| @@ -2133,6 +2133,15 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
| 2133 | dev->name, vp->cur_tx); | 2133 | dev->name, vp->cur_tx); |
| 2134 | } | 2134 | } |
| 2135 | 2135 | ||
| 2136 | /* | ||
| 2137 | * We can't allow a recursion from our interrupt handler back into the | ||
| 2138 | * tx routine, as they take the same spin lock, and that causes | ||
| 2139 | * deadlock. Just return NETDEV_TX_BUSY and let the stack try again in | ||
| 2140 | * a bit | ||
| 2141 | */ | ||
| 2142 | if (vp->handling_irq) | ||
| 2143 | return NETDEV_TX_BUSY; | ||
| 2144 | |||
| 2136 | if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) { | 2145 | if (vp->cur_tx - vp->dirty_tx >= TX_RING_SIZE) { |
| 2137 | if (vortex_debug > 0) | 2146 | if (vortex_debug > 0) |
| 2138 | pr_warning("%s: BUG! Tx Ring full, refusing to send buffer.\n", | 2147 | pr_warning("%s: BUG! Tx Ring full, refusing to send buffer.\n", |
| @@ -2288,7 +2297,12 @@ vortex_interrupt(int irq, void *dev_id) | |||
| 2288 | if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) { | 2297 | if (status & (HostError | RxEarly | StatsFull | TxComplete | IntReq)) { |
| 2289 | if (status == 0xffff) | 2298 | if (status == 0xffff) |
| 2290 | break; | 2299 | break; |
| 2300 | if (status & RxEarly) | ||
| 2301 | vortex_rx(dev); | ||
| 2302 | spin_unlock(&vp->window_lock); | ||
| 2291 | vortex_error(dev, status); | 2303 | vortex_error(dev, status); |
| 2304 | spin_lock(&vp->window_lock); | ||
| 2305 | window_set(vp, 7); | ||
| 2292 | } | 2306 | } |
| 2293 | 2307 | ||
| 2294 | if (--work_done < 0) { | 2308 | if (--work_done < 0) { |
| @@ -2335,11 +2349,13 @@ boomerang_interrupt(int irq, void *dev_id) | |||
| 2335 | 2349 | ||
| 2336 | ioaddr = vp->ioaddr; | 2350 | ioaddr = vp->ioaddr; |
| 2337 | 2351 | ||
| 2352 | |||
| 2338 | /* | 2353 | /* |
| 2339 | * It seems dopey to put the spinlock this early, but we could race against vortex_tx_timeout | 2354 | * It seems dopey to put the spinlock this early, but we could race against vortex_tx_timeout |
| 2340 | * and boomerang_start_xmit | 2355 | * and boomerang_start_xmit |
| 2341 | */ | 2356 | */ |
| 2342 | spin_lock(&vp->lock); | 2357 | spin_lock(&vp->lock); |
| 2358 | vp->handling_irq = 1; | ||
| 2343 | 2359 | ||
| 2344 | status = ioread16(ioaddr + EL3_STATUS); | 2360 | status = ioread16(ioaddr + EL3_STATUS); |
| 2345 | 2361 | ||
| @@ -2447,6 +2463,7 @@ boomerang_interrupt(int irq, void *dev_id) | |||
| 2447 | pr_debug("%s: exiting interrupt, status %4.4x.\n", | 2463 | pr_debug("%s: exiting interrupt, status %4.4x.\n", |
| 2448 | dev->name, status); | 2464 | dev->name, status); |
| 2449 | handler_exit: | 2465 | handler_exit: |
| 2466 | vp->handling_irq = 0; | ||
| 2450 | spin_unlock(&vp->lock); | 2467 | spin_unlock(&vp->lock); |
| 2451 | return IRQ_HANDLED; | 2468 | return IRQ_HANDLED; |
| 2452 | } | 2469 | } |
| @@ -2971,7 +2988,6 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
| 2971 | { | 2988 | { |
| 2972 | int err; | 2989 | int err; |
| 2973 | struct vortex_private *vp = netdev_priv(dev); | 2990 | struct vortex_private *vp = netdev_priv(dev); |
| 2974 | unsigned long flags; | ||
| 2975 | pci_power_t state = 0; | 2991 | pci_power_t state = 0; |
| 2976 | 2992 | ||
| 2977 | if(VORTEX_PCI(vp)) | 2993 | if(VORTEX_PCI(vp)) |
| @@ -2981,9 +2997,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
| 2981 | 2997 | ||
| 2982 | if(state != 0) | 2998 | if(state != 0) |
| 2983 | pci_set_power_state(VORTEX_PCI(vp), PCI_D0); | 2999 | pci_set_power_state(VORTEX_PCI(vp), PCI_D0); |
| 2984 | spin_lock_irqsave(&vp->lock, flags); | ||
| 2985 | err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL); | 3000 | err = generic_mii_ioctl(&vp->mii, if_mii(rq), cmd, NULL); |
| 2986 | spin_unlock_irqrestore(&vp->lock, flags); | ||
| 2987 | if(state != 0) | 3001 | if(state != 0) |
| 2988 | pci_set_power_state(VORTEX_PCI(vp), state); | 3002 | pci_set_power_state(VORTEX_PCI(vp), state); |
| 2989 | 3003 | ||
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 37617abc1647..1e620e287ae0 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
| @@ -848,6 +848,15 @@ static int b44_poll(struct napi_struct *napi, int budget) | |||
| 848 | b44_tx(bp); | 848 | b44_tx(bp); |
| 849 | /* spin_unlock(&bp->tx_lock); */ | 849 | /* spin_unlock(&bp->tx_lock); */ |
| 850 | } | 850 | } |
| 851 | if (bp->istat & ISTAT_RFO) { /* fast recovery, in ~20msec */ | ||
| 852 | bp->istat &= ~ISTAT_RFO; | ||
| 853 | b44_disable_ints(bp); | ||
| 854 | ssb_device_enable(bp->sdev, 0); /* resets ISTAT_RFO */ | ||
| 855 | b44_init_rings(bp); | ||
| 856 | b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY); | ||
| 857 | netif_wake_queue(bp->dev); | ||
| 858 | } | ||
| 859 | |||
| 851 | spin_unlock_irqrestore(&bp->lock, flags); | 860 | spin_unlock_irqrestore(&bp->lock, flags); |
| 852 | 861 | ||
| 853 | work_done = 0; | 862 | work_done = 0; |
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 99197bd54da5..53306bf3f401 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
| @@ -181,6 +181,7 @@ struct be_drvr_stats { | |||
| 181 | u64 be_rx_bytes_prev; | 181 | u64 be_rx_bytes_prev; |
| 182 | u64 be_rx_pkts; | 182 | u64 be_rx_pkts; |
| 183 | u32 be_rx_rate; | 183 | u32 be_rx_rate; |
| 184 | u32 be_rx_mcast_pkt; | ||
| 184 | /* number of non ether type II frames dropped where | 185 | /* number of non ether type II frames dropped where |
| 185 | * frame len > length field of Mac Hdr */ | 186 | * frame len > length field of Mac Hdr */ |
| 186 | u32 be_802_3_dropped_frames; | 187 | u32 be_802_3_dropped_frames; |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 3d305494a606..34abcc9403d6 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
| @@ -140,10 +140,8 @@ int be_process_mcc(struct be_adapter *adapter, int *status) | |||
| 140 | while ((compl = be_mcc_compl_get(adapter))) { | 140 | while ((compl = be_mcc_compl_get(adapter))) { |
| 141 | if (compl->flags & CQE_FLAGS_ASYNC_MASK) { | 141 | if (compl->flags & CQE_FLAGS_ASYNC_MASK) { |
| 142 | /* Interpret flags as an async trailer */ | 142 | /* Interpret flags as an async trailer */ |
| 143 | BUG_ON(!is_link_state_evt(compl->flags)); | 143 | if (is_link_state_evt(compl->flags)) |
| 144 | 144 | be_async_link_state_process(adapter, | |
| 145 | /* Interpret compl as a async link evt */ | ||
| 146 | be_async_link_state_process(adapter, | ||
| 147 | (struct be_async_event_link_state *) compl); | 145 | (struct be_async_event_link_state *) compl); |
| 148 | } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) { | 146 | } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) { |
| 149 | *status = be_mcc_compl_process(adapter, compl); | 147 | *status = be_mcc_compl_process(adapter, compl); |
| @@ -207,7 +205,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db) | |||
| 207 | 205 | ||
| 208 | if (msecs > 4000) { | 206 | if (msecs > 4000) { |
| 209 | dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); | 207 | dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); |
| 210 | be_dump_ue(adapter); | 208 | be_detect_dump_ue(adapter); |
| 211 | return -1; | 209 | return -1; |
| 212 | } | 210 | } |
| 213 | 211 | ||
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index bdc10a28cfda..ad1e6fac60c5 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
| @@ -992,5 +992,5 @@ extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num, | |||
| 992 | extern int be_cmd_get_phy_info(struct be_adapter *adapter, | 992 | extern int be_cmd_get_phy_info(struct be_adapter *adapter, |
| 993 | struct be_dma_mem *cmd); | 993 | struct be_dma_mem *cmd); |
| 994 | extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain); | 994 | extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain); |
| 995 | extern void be_dump_ue(struct be_adapter *adapter); | 995 | extern void be_detect_dump_ue(struct be_adapter *adapter); |
| 996 | 996 | ||
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c index cd16243c7c36..13f0abbc5205 100644 --- a/drivers/net/benet/be_ethtool.c +++ b/drivers/net/benet/be_ethtool.c | |||
| @@ -60,6 +60,7 @@ static const struct be_ethtool_stat et_stats[] = { | |||
| 60 | {DRVSTAT_INFO(be_rx_events)}, | 60 | {DRVSTAT_INFO(be_rx_events)}, |
| 61 | {DRVSTAT_INFO(be_tx_compl)}, | 61 | {DRVSTAT_INFO(be_tx_compl)}, |
| 62 | {DRVSTAT_INFO(be_rx_compl)}, | 62 | {DRVSTAT_INFO(be_rx_compl)}, |
| 63 | {DRVSTAT_INFO(be_rx_mcast_pkt)}, | ||
| 63 | {DRVSTAT_INFO(be_ethrx_post_fail)}, | 64 | {DRVSTAT_INFO(be_ethrx_post_fail)}, |
| 64 | {DRVSTAT_INFO(be_802_3_dropped_frames)}, | 65 | {DRVSTAT_INFO(be_802_3_dropped_frames)}, |
| 65 | {DRVSTAT_INFO(be_802_3_malformed_frames)}, | 66 | {DRVSTAT_INFO(be_802_3_malformed_frames)}, |
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h index 5d38046402b2..a2ec5df0d733 100644 --- a/drivers/net/benet/be_hw.h +++ b/drivers/net/benet/be_hw.h | |||
| @@ -167,8 +167,11 @@ | |||
| 167 | #define FLASH_FCoE_BIOS_START_g3 (13631488) | 167 | #define FLASH_FCoE_BIOS_START_g3 (13631488) |
| 168 | #define FLASH_REDBOOT_START_g3 (262144) | 168 | #define FLASH_REDBOOT_START_g3 (262144) |
| 169 | 169 | ||
| 170 | 170 | /************* Rx Packet Type Encoding **************/ | |
| 171 | 171 | #define BE_UNICAST_PACKET 0 | |
| 172 | #define BE_MULTICAST_PACKET 1 | ||
| 173 | #define BE_BROADCAST_PACKET 2 | ||
| 174 | #define BE_RSVD_PACKET 3 | ||
| 172 | 175 | ||
| 173 | /* | 176 | /* |
| 174 | * BE descriptors: host memory data structures whose formats | 177 | * BE descriptors: host memory data structures whose formats |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index 74e146f470c6..6eda7a022256 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
| @@ -247,6 +247,7 @@ void netdev_stats_update(struct be_adapter *adapter) | |||
| 247 | dev_stats->tx_packets = drvr_stats(adapter)->be_tx_pkts; | 247 | dev_stats->tx_packets = drvr_stats(adapter)->be_tx_pkts; |
| 248 | dev_stats->rx_bytes = drvr_stats(adapter)->be_rx_bytes; | 248 | dev_stats->rx_bytes = drvr_stats(adapter)->be_rx_bytes; |
| 249 | dev_stats->tx_bytes = drvr_stats(adapter)->be_tx_bytes; | 249 | dev_stats->tx_bytes = drvr_stats(adapter)->be_tx_bytes; |
| 250 | dev_stats->multicast = drvr_stats(adapter)->be_rx_mcast_pkt; | ||
| 250 | 251 | ||
| 251 | /* bad pkts received */ | 252 | /* bad pkts received */ |
| 252 | dev_stats->rx_errors = port_stats->rx_crc_errors + | 253 | dev_stats->rx_errors = port_stats->rx_crc_errors + |
| @@ -294,7 +295,6 @@ void netdev_stats_update(struct be_adapter *adapter) | |||
| 294 | /* no space available in linux */ | 295 | /* no space available in linux */ |
| 295 | dev_stats->tx_dropped = 0; | 296 | dev_stats->tx_dropped = 0; |
| 296 | 297 | ||
| 297 | dev_stats->multicast = port_stats->rx_multicast_frames; | ||
| 298 | dev_stats->collisions = 0; | 298 | dev_stats->collisions = 0; |
| 299 | 299 | ||
| 300 | /* detailed tx_errors */ | 300 | /* detailed tx_errors */ |
| @@ -848,7 +848,7 @@ static void be_rx_rate_update(struct be_adapter *adapter) | |||
| 848 | } | 848 | } |
| 849 | 849 | ||
| 850 | static void be_rx_stats_update(struct be_adapter *adapter, | 850 | static void be_rx_stats_update(struct be_adapter *adapter, |
| 851 | u32 pktsize, u16 numfrags) | 851 | u32 pktsize, u16 numfrags, u8 pkt_type) |
| 852 | { | 852 | { |
| 853 | struct be_drvr_stats *stats = drvr_stats(adapter); | 853 | struct be_drvr_stats *stats = drvr_stats(adapter); |
| 854 | 854 | ||
| @@ -856,6 +856,9 @@ static void be_rx_stats_update(struct be_adapter *adapter, | |||
| 856 | stats->be_rx_frags += numfrags; | 856 | stats->be_rx_frags += numfrags; |
| 857 | stats->be_rx_bytes += pktsize; | 857 | stats->be_rx_bytes += pktsize; |
| 858 | stats->be_rx_pkts++; | 858 | stats->be_rx_pkts++; |
| 859 | |||
| 860 | if (pkt_type == BE_MULTICAST_PACKET) | ||
| 861 | stats->be_rx_mcast_pkt++; | ||
| 859 | } | 862 | } |
| 860 | 863 | ||
| 861 | static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso) | 864 | static inline bool do_pkt_csum(struct be_eth_rx_compl *rxcp, bool cso) |
| @@ -925,9 +928,11 @@ static void skb_fill_rx_data(struct be_adapter *adapter, | |||
| 925 | u16 rxq_idx, i, j; | 928 | u16 rxq_idx, i, j; |
| 926 | u32 pktsize, hdr_len, curr_frag_len, size; | 929 | u32 pktsize, hdr_len, curr_frag_len, size; |
| 927 | u8 *start; | 930 | u8 *start; |
| 931 | u8 pkt_type; | ||
| 928 | 932 | ||
| 929 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); | 933 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); |
| 930 | pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); | 934 | pktsize = AMAP_GET_BITS(struct amap_eth_rx_compl, pktsize, rxcp); |
| 935 | pkt_type = AMAP_GET_BITS(struct amap_eth_rx_compl, cast_enc, rxcp); | ||
| 931 | 936 | ||
| 932 | page_info = get_rx_page_info(adapter, rxq_idx); | 937 | page_info = get_rx_page_info(adapter, rxq_idx); |
| 933 | 938 | ||
| @@ -993,7 +998,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter, | |||
| 993 | BUG_ON(j > MAX_SKB_FRAGS); | 998 | BUG_ON(j > MAX_SKB_FRAGS); |
| 994 | 999 | ||
| 995 | done: | 1000 | done: |
| 996 | be_rx_stats_update(adapter, pktsize, num_rcvd); | 1001 | be_rx_stats_update(adapter, pktsize, num_rcvd, pkt_type); |
| 997 | } | 1002 | } |
| 998 | 1003 | ||
| 999 | /* Process the RX completion indicated by rxcp when GRO is disabled */ | 1004 | /* Process the RX completion indicated by rxcp when GRO is disabled */ |
| @@ -1060,6 +1065,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
| 1060 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; | 1065 | u32 num_rcvd, pkt_size, remaining, vlanf, curr_frag_len; |
| 1061 | u16 i, rxq_idx = 0, vid, j; | 1066 | u16 i, rxq_idx = 0, vid, j; |
| 1062 | u8 vtm; | 1067 | u8 vtm; |
| 1068 | u8 pkt_type; | ||
| 1063 | 1069 | ||
| 1064 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); | 1070 | num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); |
| 1065 | /* Is it a flush compl that has no data */ | 1071 | /* Is it a flush compl that has no data */ |
| @@ -1070,6 +1076,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
| 1070 | vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); | 1076 | vlanf = AMAP_GET_BITS(struct amap_eth_rx_compl, vtp, rxcp); |
| 1071 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); | 1077 | rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); |
| 1072 | vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); | 1078 | vtm = AMAP_GET_BITS(struct amap_eth_rx_compl, vtm, rxcp); |
| 1079 | pkt_type = AMAP_GET_BITS(struct amap_eth_rx_compl, cast_enc, rxcp); | ||
| 1073 | 1080 | ||
| 1074 | /* vlanf could be wrongly set in some cards. | 1081 | /* vlanf could be wrongly set in some cards. |
| 1075 | * ignore if vtm is not set */ | 1082 | * ignore if vtm is not set */ |
| @@ -1125,7 +1132,7 @@ static void be_rx_compl_process_gro(struct be_adapter *adapter, | |||
| 1125 | vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, vid); | 1132 | vlan_gro_frags(&eq_obj->napi, adapter->vlan_grp, vid); |
| 1126 | } | 1133 | } |
| 1127 | 1134 | ||
| 1128 | be_rx_stats_update(adapter, pkt_size, num_rcvd); | 1135 | be_rx_stats_update(adapter, pkt_size, num_rcvd, pkt_type); |
| 1129 | } | 1136 | } |
| 1130 | 1137 | ||
| 1131 | static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter) | 1138 | static struct be_eth_rx_compl *be_rx_compl_get(struct be_adapter *adapter) |
| @@ -1743,26 +1750,7 @@ static int be_poll_tx_mcc(struct napi_struct *napi, int budget) | |||
| 1743 | return 1; | 1750 | return 1; |
| 1744 | } | 1751 | } |
| 1745 | 1752 | ||
| 1746 | static inline bool be_detect_ue(struct be_adapter *adapter) | 1753 | void be_detect_dump_ue(struct be_adapter *adapter) |
| 1747 | { | ||
| 1748 | u32 online0 = 0, online1 = 0; | ||
| 1749 | |||
| 1750 | pci_read_config_dword(adapter->pdev, PCICFG_ONLINE0, &online0); | ||
| 1751 | |||
| 1752 | pci_read_config_dword(adapter->pdev, PCICFG_ONLINE1, &online1); | ||
| 1753 | |||
| 1754 | if (!online0 || !online1) { | ||
| 1755 | adapter->ue_detected = true; | ||
| 1756 | dev_err(&adapter->pdev->dev, | ||
| 1757 | "UE Detected!! online0=%d online1=%d\n", | ||
| 1758 | online0, online1); | ||
| 1759 | return true; | ||
| 1760 | } | ||
| 1761 | |||
| 1762 | return false; | ||
| 1763 | } | ||
| 1764 | |||
| 1765 | void be_dump_ue(struct be_adapter *adapter) | ||
| 1766 | { | 1754 | { |
| 1767 | u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask; | 1755 | u32 ue_status_lo, ue_status_hi, ue_status_lo_mask, ue_status_hi_mask; |
| 1768 | u32 i; | 1756 | u32 i; |
| @@ -1779,6 +1767,11 @@ void be_dump_ue(struct be_adapter *adapter) | |||
| 1779 | ue_status_lo = (ue_status_lo & (~ue_status_lo_mask)); | 1767 | ue_status_lo = (ue_status_lo & (~ue_status_lo_mask)); |
| 1780 | ue_status_hi = (ue_status_hi & (~ue_status_hi_mask)); | 1768 | ue_status_hi = (ue_status_hi & (~ue_status_hi_mask)); |
| 1781 | 1769 | ||
| 1770 | if (ue_status_lo || ue_status_hi) { | ||
| 1771 | adapter->ue_detected = true; | ||
| 1772 | dev_err(&adapter->pdev->dev, "UE Detected!!\n"); | ||
| 1773 | } | ||
| 1774 | |||
| 1782 | if (ue_status_lo) { | 1775 | if (ue_status_lo) { |
| 1783 | for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) { | 1776 | for (i = 0; ue_status_lo; ue_status_lo >>= 1, i++) { |
| 1784 | if (ue_status_lo & 1) | 1777 | if (ue_status_lo & 1) |
| @@ -1814,10 +1807,8 @@ static void be_worker(struct work_struct *work) | |||
| 1814 | adapter->rx_post_starved = false; | 1807 | adapter->rx_post_starved = false; |
| 1815 | be_post_rx_frags(adapter); | 1808 | be_post_rx_frags(adapter); |
| 1816 | } | 1809 | } |
| 1817 | if (!adapter->ue_detected) { | 1810 | if (!adapter->ue_detected) |
| 1818 | if (be_detect_ue(adapter)) | 1811 | be_detect_dump_ue(adapter); |
| 1819 | be_dump_ue(adapter); | ||
| 1820 | } | ||
| 1821 | 1812 | ||
| 1822 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); | 1813 | schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000)); |
| 1823 | } | 1814 | } |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2cc4cfc31892..3b16f62d5606 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -2797,9 +2797,15 @@ void bond_loadbalance_arp_mon(struct work_struct *work) | |||
| 2797 | * so it can wait | 2797 | * so it can wait |
| 2798 | */ | 2798 | */ |
| 2799 | bond_for_each_slave(bond, slave, i) { | 2799 | bond_for_each_slave(bond, slave, i) { |
| 2800 | unsigned long trans_start = dev_trans_start(slave->dev); | ||
| 2801 | |||
| 2800 | if (slave->link != BOND_LINK_UP) { | 2802 | if (slave->link != BOND_LINK_UP) { |
| 2801 | if (time_before_eq(jiffies, dev_trans_start(slave->dev) + delta_in_ticks) && | 2803 | if (time_in_range(jiffies, |
| 2802 | time_before_eq(jiffies, slave->dev->last_rx + delta_in_ticks)) { | 2804 | trans_start - delta_in_ticks, |
| 2805 | trans_start + delta_in_ticks) && | ||
| 2806 | time_in_range(jiffies, | ||
| 2807 | slave->dev->last_rx - delta_in_ticks, | ||
| 2808 | slave->dev->last_rx + delta_in_ticks)) { | ||
| 2803 | 2809 | ||
| 2804 | slave->link = BOND_LINK_UP; | 2810 | slave->link = BOND_LINK_UP; |
| 2805 | slave->state = BOND_STATE_ACTIVE; | 2811 | slave->state = BOND_STATE_ACTIVE; |
| @@ -2827,8 +2833,12 @@ void bond_loadbalance_arp_mon(struct work_struct *work) | |||
| 2827 | * when the source ip is 0, so don't take the link down | 2833 | * when the source ip is 0, so don't take the link down |
| 2828 | * if we don't know our ip yet | 2834 | * if we don't know our ip yet |
| 2829 | */ | 2835 | */ |
| 2830 | if (time_after_eq(jiffies, dev_trans_start(slave->dev) + 2*delta_in_ticks) || | 2836 | if (!time_in_range(jiffies, |
| 2831 | (time_after_eq(jiffies, slave->dev->last_rx + 2*delta_in_ticks))) { | 2837 | trans_start - delta_in_ticks, |
| 2838 | trans_start + 2 * delta_in_ticks) || | ||
| 2839 | !time_in_range(jiffies, | ||
| 2840 | slave->dev->last_rx - delta_in_ticks, | ||
| 2841 | slave->dev->last_rx + 2 * delta_in_ticks)) { | ||
| 2832 | 2842 | ||
| 2833 | slave->link = BOND_LINK_DOWN; | 2843 | slave->link = BOND_LINK_DOWN; |
| 2834 | slave->state = BOND_STATE_BACKUP; | 2844 | slave->state = BOND_STATE_BACKUP; |
| @@ -2883,13 +2893,16 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks) | |||
| 2883 | { | 2893 | { |
| 2884 | struct slave *slave; | 2894 | struct slave *slave; |
| 2885 | int i, commit = 0; | 2895 | int i, commit = 0; |
| 2896 | unsigned long trans_start; | ||
| 2886 | 2897 | ||
| 2887 | bond_for_each_slave(bond, slave, i) { | 2898 | bond_for_each_slave(bond, slave, i) { |
| 2888 | slave->new_link = BOND_LINK_NOCHANGE; | 2899 | slave->new_link = BOND_LINK_NOCHANGE; |
| 2889 | 2900 | ||
| 2890 | if (slave->link != BOND_LINK_UP) { | 2901 | if (slave->link != BOND_LINK_UP) { |
| 2891 | if (time_before_eq(jiffies, slave_last_rx(bond, slave) + | 2902 | if (time_in_range(jiffies, |
| 2892 | delta_in_ticks)) { | 2903 | slave_last_rx(bond, slave) - delta_in_ticks, |
| 2904 | slave_last_rx(bond, slave) + delta_in_ticks)) { | ||
| 2905 | |||
| 2893 | slave->new_link = BOND_LINK_UP; | 2906 | slave->new_link = BOND_LINK_UP; |
| 2894 | commit++; | 2907 | commit++; |
| 2895 | } | 2908 | } |
| @@ -2902,8 +2915,9 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks) | |||
| 2902 | * active. This avoids bouncing, as the last receive | 2915 | * active. This avoids bouncing, as the last receive |
| 2903 | * times need a full ARP monitor cycle to be updated. | 2916 | * times need a full ARP monitor cycle to be updated. |
| 2904 | */ | 2917 | */ |
| 2905 | if (!time_after_eq(jiffies, slave->jiffies + | 2918 | if (time_in_range(jiffies, |
| 2906 | 2 * delta_in_ticks)) | 2919 | slave->jiffies - delta_in_ticks, |
| 2920 | slave->jiffies + 2 * delta_in_ticks)) | ||
| 2907 | continue; | 2921 | continue; |
| 2908 | 2922 | ||
| 2909 | /* | 2923 | /* |
| @@ -2921,8 +2935,10 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks) | |||
| 2921 | */ | 2935 | */ |
| 2922 | if (slave->state == BOND_STATE_BACKUP && | 2936 | if (slave->state == BOND_STATE_BACKUP && |
| 2923 | !bond->current_arp_slave && | 2937 | !bond->current_arp_slave && |
| 2924 | time_after(jiffies, slave_last_rx(bond, slave) + | 2938 | !time_in_range(jiffies, |
| 2925 | 3 * delta_in_ticks)) { | 2939 | slave_last_rx(bond, slave) - delta_in_ticks, |
| 2940 | slave_last_rx(bond, slave) + 3 * delta_in_ticks)) { | ||
| 2941 | |||
| 2926 | slave->new_link = BOND_LINK_DOWN; | 2942 | slave->new_link = BOND_LINK_DOWN; |
| 2927 | commit++; | 2943 | commit++; |
| 2928 | } | 2944 | } |
| @@ -2933,11 +2949,15 @@ static int bond_ab_arp_inspect(struct bonding *bond, int delta_in_ticks) | |||
| 2933 | * - (more than 2*delta since receive AND | 2949 | * - (more than 2*delta since receive AND |
| 2934 | * the bond has an IP address) | 2950 | * the bond has an IP address) |
| 2935 | */ | 2951 | */ |
| 2952 | trans_start = dev_trans_start(slave->dev); | ||
| 2936 | if ((slave->state == BOND_STATE_ACTIVE) && | 2953 | if ((slave->state == BOND_STATE_ACTIVE) && |
| 2937 | (time_after_eq(jiffies, dev_trans_start(slave->dev) + | 2954 | (!time_in_range(jiffies, |
| 2938 | 2 * delta_in_ticks) || | 2955 | trans_start - delta_in_ticks, |
| 2939 | (time_after_eq(jiffies, slave_last_rx(bond, slave) | 2956 | trans_start + 2 * delta_in_ticks) || |
| 2940 | + 2 * delta_in_ticks)))) { | 2957 | !time_in_range(jiffies, |
| 2958 | slave_last_rx(bond, slave) - delta_in_ticks, | ||
| 2959 | slave_last_rx(bond, slave) + 2 * delta_in_ticks))) { | ||
| 2960 | |||
| 2941 | slave->new_link = BOND_LINK_DOWN; | 2961 | slave->new_link = BOND_LINK_DOWN; |
| 2942 | commit++; | 2962 | commit++; |
| 2943 | } | 2963 | } |
| @@ -2956,6 +2976,7 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) | |||
| 2956 | { | 2976 | { |
| 2957 | struct slave *slave; | 2977 | struct slave *slave; |
| 2958 | int i; | 2978 | int i; |
| 2979 | unsigned long trans_start; | ||
| 2959 | 2980 | ||
| 2960 | bond_for_each_slave(bond, slave, i) { | 2981 | bond_for_each_slave(bond, slave, i) { |
| 2961 | switch (slave->new_link) { | 2982 | switch (slave->new_link) { |
| @@ -2963,10 +2984,11 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks) | |||
| 2963 | continue; | 2984 | continue; |
| 2964 | 2985 | ||
| 2965 | case BOND_LINK_UP: | 2986 | case BOND_LINK_UP: |
| 2987 | trans_start = dev_trans_start(slave->dev); | ||
| 2966 | if ((!bond->curr_active_slave && | 2988 | if ((!bond->curr_active_slave && |
| 2967 | time_before_eq(jiffies, | 2989 | time_in_range(jiffies, |
| 2968 | dev_trans_start(slave->dev) + | 2990 | trans_start - delta_in_ticks, |
| 2969 | delta_in_ticks)) || | 2991 | trans_start + delta_in_ticks)) || |
| 2970 | bond->curr_active_slave != slave) { | 2992 | bond->curr_active_slave != slave) { |
| 2971 | slave->link = BOND_LINK_UP; | 2993 | slave->link = BOND_LINK_UP; |
| 2972 | bond->current_arp_slave = NULL; | 2994 | bond->current_arp_slave = NULL; |
diff --git a/drivers/net/caif/Kconfig b/drivers/net/caif/Kconfig index 631a6242b011..75bfc3a9d95f 100644 --- a/drivers/net/caif/Kconfig +++ b/drivers/net/caif/Kconfig | |||
| @@ -15,7 +15,7 @@ config CAIF_TTY | |||
| 15 | 15 | ||
| 16 | config CAIF_SPI_SLAVE | 16 | config CAIF_SPI_SLAVE |
| 17 | tristate "CAIF SPI transport driver for slave interface" | 17 | tristate "CAIF SPI transport driver for slave interface" |
| 18 | depends on CAIF | 18 | depends on CAIF && HAS_DMA |
| 19 | default n | 19 | default n |
| 20 | ---help--- | 20 | ---help--- |
| 21 | The CAIF Link layer SPI Protocol driver for Slave SPI interface. | 21 | The CAIF Link layer SPI Protocol driver for Slave SPI interface. |
diff --git a/drivers/net/ibm_newemac/debug.c b/drivers/net/ibm_newemac/debug.c index 3995fafc1e08..8c6c1e2a8750 100644 --- a/drivers/net/ibm_newemac/debug.c +++ b/drivers/net/ibm_newemac/debug.c | |||
| @@ -238,7 +238,7 @@ void emac_dbg_dump_all(void) | |||
| 238 | } | 238 | } |
| 239 | 239 | ||
| 240 | #if defined(CONFIG_MAGIC_SYSRQ) | 240 | #if defined(CONFIG_MAGIC_SYSRQ) |
| 241 | static void emac_sysrq_handler(int key, struct tty_struct *tty) | 241 | static void emac_sysrq_handler(int key) |
| 242 | { | 242 | { |
| 243 | emac_dbg_dump_all(); | 243 | emac_dbg_dump_all(); |
| 244 | } | 244 | } |
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c index b4fb07a6f13f..51919fcd50c2 100644 --- a/drivers/net/ks8851.c +++ b/drivers/net/ks8851.c | |||
| @@ -503,30 +503,33 @@ static void ks8851_rx_pkts(struct ks8851_net *ks) | |||
| 503 | ks8851_wrreg16(ks, KS_RXQCR, | 503 | ks8851_wrreg16(ks, KS_RXQCR, |
| 504 | ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE); | 504 | ks->rc_rxqcr | RXQCR_SDA | RXQCR_ADRFE); |
| 505 | 505 | ||
| 506 | if (rxlen > 0) { | 506 | if (rxlen > 4) { |
| 507 | skb = netdev_alloc_skb(ks->netdev, rxlen + 2 + 8); | 507 | unsigned int rxalign; |
| 508 | if (!skb) { | 508 | |
| 509 | /* todo - dump frame and move on */ | 509 | rxlen -= 4; |
| 510 | } | 510 | rxalign = ALIGN(rxlen, 4); |
| 511 | skb = netdev_alloc_skb_ip_align(ks->netdev, rxalign); | ||
| 512 | if (skb) { | ||
| 511 | 513 | ||
| 512 | /* two bytes to ensure ip is aligned, and four bytes | 514 | /* 4 bytes of status header + 4 bytes of |
| 513 | * for the status header and 4 bytes of garbage */ | 515 | * garbage: we put them before ethernet |
| 514 | skb_reserve(skb, 2 + 4 + 4); | 516 | * header, so that they are copied, |
| 517 | * but ignored. | ||
| 518 | */ | ||
| 515 | 519 | ||
| 516 | rxpkt = skb_put(skb, rxlen - 4) - 8; | 520 | rxpkt = skb_put(skb, rxlen) - 8; |
| 517 | 521 | ||
| 518 | /* align the packet length to 4 bytes, and add 4 bytes | 522 | ks8851_rdfifo(ks, rxpkt, rxalign + 8); |
| 519 | * as we're getting the rx status header as well */ | ||
| 520 | ks8851_rdfifo(ks, rxpkt, ALIGN(rxlen, 4) + 8); | ||
| 521 | 523 | ||
| 522 | if (netif_msg_pktdata(ks)) | 524 | if (netif_msg_pktdata(ks)) |
| 523 | ks8851_dbg_dumpkkt(ks, rxpkt); | 525 | ks8851_dbg_dumpkkt(ks, rxpkt); |
| 524 | 526 | ||
| 525 | skb->protocol = eth_type_trans(skb, ks->netdev); | 527 | skb->protocol = eth_type_trans(skb, ks->netdev); |
| 526 | netif_rx(skb); | 528 | netif_rx(skb); |
| 527 | 529 | ||
| 528 | ks->netdev->stats.rx_packets++; | 530 | ks->netdev->stats.rx_packets++; |
| 529 | ks->netdev->stats.rx_bytes += rxlen - 4; | 531 | ks->netdev->stats.rx_bytes += rxlen; |
| 532 | } | ||
| 530 | } | 533 | } |
| 531 | 534 | ||
| 532 | ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr); | 535 | ks8851_wrreg16(ks, KS_RXQCR, ks->rc_rxqcr); |
diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c index bdf2149e5296..87f0a93b165c 100644 --- a/drivers/net/ll_temac_main.c +++ b/drivers/net/ll_temac_main.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include <linux/of_device.h> | 38 | #include <linux/of_device.h> |
| 39 | #include <linux/of_mdio.h> | 39 | #include <linux/of_mdio.h> |
| 40 | #include <linux/of_platform.h> | 40 | #include <linux/of_platform.h> |
| 41 | #include <linux/of_address.h> | ||
| 41 | #include <linux/skbuff.h> | 42 | #include <linux/skbuff.h> |
| 42 | #include <linux/spinlock.h> | 43 | #include <linux/spinlock.h> |
| 43 | #include <linux/tcp.h> /* needed for sizeof(tcphdr) */ | 44 | #include <linux/tcp.h> /* needed for sizeof(tcphdr) */ |
diff --git a/drivers/net/ll_temac_mdio.c b/drivers/net/ll_temac_mdio.c index 5ae28c975b38..8cf9d4f56bb2 100644 --- a/drivers/net/ll_temac_mdio.c +++ b/drivers/net/ll_temac_mdio.c | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | #include <linux/phy.h> | 10 | #include <linux/phy.h> |
| 11 | #include <linux/of.h> | 11 | #include <linux/of.h> |
| 12 | #include <linux/of_device.h> | 12 | #include <linux/of_device.h> |
| 13 | #include <linux/of_address.h> | ||
| 13 | #include <linux/slab.h> | 14 | #include <linux/slab.h> |
| 14 | #include <linux/of_mdio.h> | 15 | #include <linux/of_mdio.h> |
| 15 | 16 | ||
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index cb30df106a2c..73d314592230 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
| @@ -2131,9 +2131,16 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget) | |||
| 2131 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2131 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 2132 | static void netxen_nic_poll_controller(struct net_device *netdev) | 2132 | static void netxen_nic_poll_controller(struct net_device *netdev) |
| 2133 | { | 2133 | { |
| 2134 | int ring; | ||
| 2135 | struct nx_host_sds_ring *sds_ring; | ||
| 2134 | struct netxen_adapter *adapter = netdev_priv(netdev); | 2136 | struct netxen_adapter *adapter = netdev_priv(netdev); |
| 2137 | struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; | ||
| 2138 | |||
| 2135 | disable_irq(adapter->irq); | 2139 | disable_irq(adapter->irq); |
| 2136 | netxen_intr(adapter->irq, adapter); | 2140 | for (ring = 0; ring < adapter->max_sds_rings; ring++) { |
| 2141 | sds_ring = &recv_ctx->sds_rings[ring]; | ||
| 2142 | netxen_intr(adapter->irq, sds_ring); | ||
| 2143 | } | ||
| 2137 | enable_irq(adapter->irq); | 2144 | enable_irq(adapter->irq); |
| 2138 | } | 2145 | } |
| 2139 | #endif | 2146 | #endif |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index bc695d53cdcc..fe6983af6918 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
| @@ -7269,32 +7269,28 @@ static int niu_get_ethtool_tcam_all(struct niu *np, | |||
| 7269 | struct niu_parent *parent = np->parent; | 7269 | struct niu_parent *parent = np->parent; |
| 7270 | struct niu_tcam_entry *tp; | 7270 | struct niu_tcam_entry *tp; |
| 7271 | int i, idx, cnt; | 7271 | int i, idx, cnt; |
| 7272 | u16 n_entries; | ||
| 7273 | unsigned long flags; | 7272 | unsigned long flags; |
| 7274 | 7273 | int ret = 0; | |
| 7275 | 7274 | ||
| 7276 | /* put the tcam size here */ | 7275 | /* put the tcam size here */ |
| 7277 | nfc->data = tcam_get_size(np); | 7276 | nfc->data = tcam_get_size(np); |
| 7278 | 7277 | ||
| 7279 | niu_lock_parent(np, flags); | 7278 | niu_lock_parent(np, flags); |
| 7280 | n_entries = nfc->rule_cnt; | ||
| 7281 | for (cnt = 0, i = 0; i < nfc->data; i++) { | 7279 | for (cnt = 0, i = 0; i < nfc->data; i++) { |
| 7282 | idx = tcam_get_index(np, i); | 7280 | idx = tcam_get_index(np, i); |
| 7283 | tp = &parent->tcam[idx]; | 7281 | tp = &parent->tcam[idx]; |
| 7284 | if (!tp->valid) | 7282 | if (!tp->valid) |
| 7285 | continue; | 7283 | continue; |
| 7284 | if (cnt == nfc->rule_cnt) { | ||
| 7285 | ret = -EMSGSIZE; | ||
| 7286 | break; | ||
| 7287 | } | ||
| 7286 | rule_locs[cnt] = i; | 7288 | rule_locs[cnt] = i; |
| 7287 | cnt++; | 7289 | cnt++; |
| 7288 | } | 7290 | } |
| 7289 | niu_unlock_parent(np, flags); | 7291 | niu_unlock_parent(np, flags); |
| 7290 | 7292 | ||
| 7291 | if (n_entries != cnt) { | 7293 | return ret; |
| 7292 | /* print warning, this should not happen */ | ||
| 7293 | netdev_info(np->dev, "niu%d: In %s(): n_entries[%d] != cnt[%d]!!!\n", | ||
| 7294 | np->parent->index, __func__, n_entries, cnt); | ||
| 7295 | } | ||
| 7296 | |||
| 7297 | return 0; | ||
| 7298 | } | 7294 | } |
| 7299 | 7295 | ||
| 7300 | static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, | 7296 | static int niu_get_nfc(struct net_device *dev, struct ethtool_rxnfc *cmd, |
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c index c3edfe4c2651..49279b0ee526 100644 --- a/drivers/net/pcmcia/pcnet_cs.c +++ b/drivers/net/pcmcia/pcnet_cs.c | |||
| @@ -1637,6 +1637,7 @@ static struct pcmcia_device_id pcnet_ids[] = { | |||
| 1637 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b), | 1637 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCETTX", 0x547e66dc, 0x6fc5459b), |
| 1638 | PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0), | 1638 | PCMCIA_DEVICE_PROD_ID12("iPort", "10/100 Ethernet Card", 0x56c538d2, 0x11b0ffc0), |
| 1639 | PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956), | 1639 | PCMCIA_DEVICE_PROD_ID12("KANSAI ELECTRIC CO.,LTD", "KLA-PCM/T", 0xb18dc3b4, 0xcc51a956), |
| 1640 | PCMCIA_DEVICE_PROD_ID12("KENTRONICS", "KEP-230", 0xaf8144c9, 0x868f6616), | ||
| 1640 | PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64), | 1641 | PCMCIA_DEVICE_PROD_ID12("KCI", "PE520 PCMCIA Ethernet Adapter", 0xa89b87d3, 0x1eb88e64), |
| 1641 | PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5), | 1642 | PCMCIA_DEVICE_PROD_ID12("KINGMAX", "EN10T2T", 0x7bcb459a, 0xa5c81fa5), |
| 1642 | PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3), | 1643 | PCMCIA_DEVICE_PROD_ID12("Kingston", "KNE-PC2", 0x1128e633, 0xce2a89b3), |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index c0761197c07e..16ddc77313cb 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
| @@ -466,6 +466,8 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
| 466 | 466 | ||
| 467 | phydev->interface = interface; | 467 | phydev->interface = interface; |
| 468 | 468 | ||
| 469 | phydev->state = PHY_READY; | ||
| 470 | |||
| 469 | /* Do initial configuration here, now that | 471 | /* Do initial configuration here, now that |
| 470 | * we have certain key parameters | 472 | * we have certain key parameters |
| 471 | * (dev_flags and interface) */ | 473 | * (dev_flags and interface) */ |
diff --git a/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c index ecc64d750cce..85eddda276bd 100644 --- a/drivers/net/pxa168_eth.c +++ b/drivers/net/pxa168_eth.c | |||
| @@ -654,15 +654,15 @@ static void eth_port_start(struct net_device *dev) | |||
| 654 | /* Assignment of Tx CTRP of given queue */ | 654 | /* Assignment of Tx CTRP of given queue */ |
| 655 | tx_curr_desc = pep->tx_curr_desc_q; | 655 | tx_curr_desc = pep->tx_curr_desc_q; |
| 656 | wrl(pep, ETH_C_TX_DESC_1, | 656 | wrl(pep, ETH_C_TX_DESC_1, |
| 657 | (u32) ((struct tx_desc *)pep->tx_desc_dma + tx_curr_desc)); | 657 | (u32) (pep->tx_desc_dma + tx_curr_desc * sizeof(struct tx_desc))); |
| 658 | 658 | ||
| 659 | /* Assignment of Rx CRDP of given queue */ | 659 | /* Assignment of Rx CRDP of given queue */ |
| 660 | rx_curr_desc = pep->rx_curr_desc_q; | 660 | rx_curr_desc = pep->rx_curr_desc_q; |
| 661 | wrl(pep, ETH_C_RX_DESC_0, | 661 | wrl(pep, ETH_C_RX_DESC_0, |
| 662 | (u32) ((struct rx_desc *)pep->rx_desc_dma + rx_curr_desc)); | 662 | (u32) (pep->rx_desc_dma + rx_curr_desc * sizeof(struct rx_desc))); |
| 663 | 663 | ||
| 664 | wrl(pep, ETH_F_RX_DESC_0, | 664 | wrl(pep, ETH_F_RX_DESC_0, |
| 665 | (u32) ((struct rx_desc *)pep->rx_desc_dma + rx_curr_desc)); | 665 | (u32) (pep->rx_desc_dma + rx_curr_desc * sizeof(struct rx_desc))); |
| 666 | 666 | ||
| 667 | /* Clear all interrupts */ | 667 | /* Clear all interrupts */ |
| 668 | wrl(pep, INT_CAUSE, 0); | 668 | wrl(pep, INT_CAUSE, 0); |
| @@ -1350,7 +1350,7 @@ static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, | |||
| 1350 | { | 1350 | { |
| 1351 | struct pxa168_eth_private *pep = netdev_priv(dev); | 1351 | struct pxa168_eth_private *pep = netdev_priv(dev); |
| 1352 | if (pep->phy != NULL) | 1352 | if (pep->phy != NULL) |
| 1353 | return phy_mii_ioctl(pep->phy, if_mii(ifr), cmd); | 1353 | return phy_mii_ioctl(pep->phy, ifr, cmd); |
| 1354 | 1354 | ||
| 1355 | return -EOPNOTSUPP; | 1355 | return -EOPNOTSUPP; |
| 1356 | } | 1356 | } |
| @@ -1414,10 +1414,8 @@ static int ethernet_phy_setup(struct net_device *dev) | |||
| 1414 | { | 1414 | { |
| 1415 | struct pxa168_eth_private *pep = netdev_priv(dev); | 1415 | struct pxa168_eth_private *pep = netdev_priv(dev); |
| 1416 | 1416 | ||
| 1417 | if (pep->pd != NULL) { | 1417 | if (pep->pd->init) |
| 1418 | if (pep->pd->init) | 1418 | pep->pd->init(); |
| 1419 | pep->pd->init(); | ||
| 1420 | } | ||
| 1421 | pep->phy = phy_scan(pep, pep->pd->phy_addr & 0x1f); | 1419 | pep->phy = phy_scan(pep, pep->pd->phy_addr & 0x1f); |
| 1422 | if (pep->phy != NULL) | 1420 | if (pep->phy != NULL) |
| 1423 | phy_init(pep, pep->pd->speed, pep->pd->duplex); | 1421 | phy_init(pep, pep->pd->speed, pep->pd->duplex); |
| @@ -1499,7 +1497,7 @@ static int pxa168_eth_probe(struct platform_device *pdev) | |||
| 1499 | dev = alloc_etherdev(sizeof(struct pxa168_eth_private)); | 1497 | dev = alloc_etherdev(sizeof(struct pxa168_eth_private)); |
| 1500 | if (!dev) { | 1498 | if (!dev) { |
| 1501 | err = -ENOMEM; | 1499 | err = -ENOMEM; |
| 1502 | goto out; | 1500 | goto err_clk; |
| 1503 | } | 1501 | } |
| 1504 | 1502 | ||
| 1505 | platform_set_drvdata(pdev, dev); | 1503 | platform_set_drvdata(pdev, dev); |
| @@ -1509,12 +1507,12 @@ static int pxa168_eth_probe(struct platform_device *pdev) | |||
| 1509 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1507 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
| 1510 | if (res == NULL) { | 1508 | if (res == NULL) { |
| 1511 | err = -ENODEV; | 1509 | err = -ENODEV; |
| 1512 | goto out; | 1510 | goto err_netdev; |
| 1513 | } | 1511 | } |
| 1514 | pep->base = ioremap(res->start, res->end - res->start + 1); | 1512 | pep->base = ioremap(res->start, res->end - res->start + 1); |
| 1515 | if (pep->base == NULL) { | 1513 | if (pep->base == NULL) { |
| 1516 | err = -ENOMEM; | 1514 | err = -ENOMEM; |
| 1517 | goto out; | 1515 | goto err_netdev; |
| 1518 | } | 1516 | } |
| 1519 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); | 1517 | res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); |
| 1520 | BUG_ON(!res); | 1518 | BUG_ON(!res); |
| @@ -1551,7 +1549,7 @@ static int pxa168_eth_probe(struct platform_device *pdev) | |||
| 1551 | pep->smi_bus = mdiobus_alloc(); | 1549 | pep->smi_bus = mdiobus_alloc(); |
| 1552 | if (pep->smi_bus == NULL) { | 1550 | if (pep->smi_bus == NULL) { |
| 1553 | err = -ENOMEM; | 1551 | err = -ENOMEM; |
| 1554 | goto out; | 1552 | goto err_base; |
| 1555 | } | 1553 | } |
| 1556 | pep->smi_bus->priv = pep; | 1554 | pep->smi_bus->priv = pep; |
| 1557 | pep->smi_bus->name = "pxa168_eth smi"; | 1555 | pep->smi_bus->name = "pxa168_eth smi"; |
| @@ -1560,31 +1558,31 @@ static int pxa168_eth_probe(struct platform_device *pdev) | |||
| 1560 | snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id); | 1558 | snprintf(pep->smi_bus->id, MII_BUS_ID_SIZE, "%d", pdev->id); |
| 1561 | pep->smi_bus->parent = &pdev->dev; | 1559 | pep->smi_bus->parent = &pdev->dev; |
| 1562 | pep->smi_bus->phy_mask = 0xffffffff; | 1560 | pep->smi_bus->phy_mask = 0xffffffff; |
| 1563 | if (mdiobus_register(pep->smi_bus) < 0) { | 1561 | err = mdiobus_register(pep->smi_bus); |
| 1564 | err = -ENOMEM; | 1562 | if (err) |
| 1565 | goto out; | 1563 | goto err_free_mdio; |
| 1566 | } | 1564 | |
| 1567 | pxa168_init_hw(pep); | 1565 | pxa168_init_hw(pep); |
| 1568 | err = ethernet_phy_setup(dev); | 1566 | err = ethernet_phy_setup(dev); |
| 1569 | if (err) | 1567 | if (err) |
| 1570 | goto out; | 1568 | goto err_mdiobus; |
| 1571 | SET_NETDEV_DEV(dev, &pdev->dev); | 1569 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 1572 | err = register_netdev(dev); | 1570 | err = register_netdev(dev); |
| 1573 | if (err) | 1571 | if (err) |
| 1574 | goto out; | 1572 | goto err_mdiobus; |
| 1575 | return 0; | 1573 | return 0; |
| 1576 | out: | 1574 | |
| 1577 | if (pep->clk) { | 1575 | err_mdiobus: |
| 1578 | clk_disable(pep->clk); | 1576 | mdiobus_unregister(pep->smi_bus); |
| 1579 | clk_put(pep->clk); | 1577 | err_free_mdio: |
| 1580 | pep->clk = NULL; | 1578 | mdiobus_free(pep->smi_bus); |
| 1581 | } | 1579 | err_base: |
| 1582 | if (pep->base) { | 1580 | iounmap(pep->base); |
| 1583 | iounmap(pep->base); | 1581 | err_netdev: |
| 1584 | pep->base = NULL; | 1582 | free_netdev(dev); |
| 1585 | } | 1583 | err_clk: |
| 1586 | if (dev) | 1584 | clk_disable(clk); |
| 1587 | free_netdev(dev); | 1585 | clk_put(clk); |
| 1588 | return err; | 1586 | return err; |
| 1589 | } | 1587 | } |
| 1590 | 1588 | ||
| @@ -1608,6 +1606,8 @@ static int pxa168_eth_remove(struct platform_device *pdev) | |||
| 1608 | 1606 | ||
| 1609 | iounmap(pep->base); | 1607 | iounmap(pep->base); |
| 1610 | pep->base = NULL; | 1608 | pep->base = NULL; |
| 1609 | mdiobus_unregister(pep->smi_bus); | ||
| 1610 | mdiobus_free(pep->smi_bus); | ||
| 1611 | unregister_netdev(dev); | 1611 | unregister_netdev(dev); |
| 1612 | flush_scheduled_work(); | 1612 | flush_scheduled_work(); |
| 1613 | free_netdev(dev); | 1613 | free_netdev(dev); |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index 213e3656d953..66eea5972020 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
| @@ -2188,9 +2188,16 @@ static int qlcnic_rx_poll(struct napi_struct *napi, int budget) | |||
| 2188 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2188 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 2189 | static void qlcnic_poll_controller(struct net_device *netdev) | 2189 | static void qlcnic_poll_controller(struct net_device *netdev) |
| 2190 | { | 2190 | { |
| 2191 | int ring; | ||
| 2192 | struct qlcnic_host_sds_ring *sds_ring; | ||
| 2191 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 2193 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
| 2194 | struct qlcnic_recv_context *recv_ctx = &adapter->recv_ctx; | ||
| 2195 | |||
| 2192 | disable_irq(adapter->irq); | 2196 | disable_irq(adapter->irq); |
| 2193 | qlcnic_intr(adapter->irq, adapter); | 2197 | for (ring = 0; ring < adapter->max_sds_rings; ring++) { |
| 2198 | sds_ring = &recv_ctx->sds_rings[ring]; | ||
| 2199 | qlcnic_intr(adapter->irq, sds_ring); | ||
| 2200 | } | ||
| 2194 | enable_irq(adapter->irq); | 2201 | enable_irq(adapter->irq); |
| 2195 | } | 2202 | } |
| 2196 | #endif | 2203 | #endif |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 8d63f69b27d9..5f89e83501f4 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
| @@ -3919,12 +3919,12 @@ static int ql_adapter_down(struct ql_adapter *qdev) | |||
| 3919 | for (i = 0; i < qdev->rss_ring_count; i++) | 3919 | for (i = 0; i < qdev->rss_ring_count; i++) |
| 3920 | netif_napi_del(&qdev->rx_ring[i].napi); | 3920 | netif_napi_del(&qdev->rx_ring[i].napi); |
| 3921 | 3921 | ||
| 3922 | ql_free_rx_buffers(qdev); | ||
| 3923 | |||
| 3924 | status = ql_adapter_reset(qdev); | 3922 | status = ql_adapter_reset(qdev); |
| 3925 | if (status) | 3923 | if (status) |
| 3926 | netif_err(qdev, ifdown, qdev->ndev, "reset(func #%d) FAILED!\n", | 3924 | netif_err(qdev, ifdown, qdev->ndev, "reset(func #%d) FAILED!\n", |
| 3927 | qdev->func); | 3925 | qdev->func); |
| 3926 | ql_free_rx_buffers(qdev); | ||
| 3927 | |||
| 3928 | return status; | 3928 | return status; |
| 3929 | } | 3929 | } |
| 3930 | 3930 | ||
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index bbb7951b9c4c..ea0461eb2dbe 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
| @@ -1865,15 +1865,15 @@ static int stmmac_resume(struct platform_device *pdev) | |||
| 1865 | if (!netif_running(dev)) | 1865 | if (!netif_running(dev)) |
| 1866 | return 0; | 1866 | return 0; |
| 1867 | 1867 | ||
| 1868 | spin_lock(&priv->lock); | ||
| 1869 | |||
| 1870 | if (priv->shutdown) { | 1868 | if (priv->shutdown) { |
| 1871 | /* Re-open the interface and re-init the MAC/DMA | 1869 | /* Re-open the interface and re-init the MAC/DMA |
| 1872 | and the rings. */ | 1870 | and the rings (i.e. on hibernation stage) */ |
| 1873 | stmmac_open(dev); | 1871 | stmmac_open(dev); |
| 1874 | goto out_resume; | 1872 | return 0; |
| 1875 | } | 1873 | } |
| 1876 | 1874 | ||
| 1875 | spin_lock(&priv->lock); | ||
| 1876 | |||
| 1877 | /* Power Down bit, into the PM register, is cleared | 1877 | /* Power Down bit, into the PM register, is cleared |
| 1878 | * automatically as soon as a magic packet or a Wake-up frame | 1878 | * automatically as soon as a magic packet or a Wake-up frame |
| 1879 | * is received. Anyway, it's better to manually clear | 1879 | * is received. Anyway, it's better to manually clear |
| @@ -1901,7 +1901,6 @@ static int stmmac_resume(struct platform_device *pdev) | |||
| 1901 | 1901 | ||
| 1902 | netif_start_queue(dev); | 1902 | netif_start_queue(dev); |
| 1903 | 1903 | ||
| 1904 | out_resume: | ||
| 1905 | spin_unlock(&priv->lock); | 1904 | spin_unlock(&priv->lock); |
| 1906 | return 0; | 1905 | return 0; |
| 1907 | } | 1906 | } |
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c index 8ed30fa35d0a..b2bcf99e6f08 100644 --- a/drivers/net/usb/ipheth.c +++ b/drivers/net/usb/ipheth.c | |||
| @@ -429,10 +429,6 @@ static const struct net_device_ops ipheth_netdev_ops = { | |||
| 429 | .ndo_get_stats = &ipheth_stats, | 429 | .ndo_get_stats = &ipheth_stats, |
| 430 | }; | 430 | }; |
| 431 | 431 | ||
| 432 | static struct device_type ipheth_type = { | ||
| 433 | .name = "wwan", | ||
| 434 | }; | ||
| 435 | |||
| 436 | static int ipheth_probe(struct usb_interface *intf, | 432 | static int ipheth_probe(struct usb_interface *intf, |
| 437 | const struct usb_device_id *id) | 433 | const struct usb_device_id *id) |
| 438 | { | 434 | { |
| @@ -450,7 +446,7 @@ static int ipheth_probe(struct usb_interface *intf, | |||
| 450 | 446 | ||
| 451 | netdev->netdev_ops = &ipheth_netdev_ops; | 447 | netdev->netdev_ops = &ipheth_netdev_ops; |
| 452 | netdev->watchdog_timeo = IPHETH_TX_TIMEOUT; | 448 | netdev->watchdog_timeo = IPHETH_TX_TIMEOUT; |
| 453 | strcpy(netdev->name, "wwan%d"); | 449 | strcpy(netdev->name, "eth%d"); |
| 454 | 450 | ||
| 455 | dev = netdev_priv(netdev); | 451 | dev = netdev_priv(netdev); |
| 456 | dev->udev = udev; | 452 | dev->udev = udev; |
| @@ -500,7 +496,6 @@ static int ipheth_probe(struct usb_interface *intf, | |||
| 500 | 496 | ||
| 501 | SET_NETDEV_DEV(netdev, &intf->dev); | 497 | SET_NETDEV_DEV(netdev, &intf->dev); |
| 502 | SET_ETHTOOL_OPS(netdev, &ops); | 498 | SET_ETHTOOL_OPS(netdev, &ops); |
| 503 | SET_NETDEV_DEVTYPE(netdev, &ipheth_type); | ||
| 504 | 499 | ||
| 505 | retval = register_netdev(netdev); | 500 | retval = register_netdev(netdev); |
| 506 | if (retval) { | 501 | if (retval) { |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index fd69095ef6e3..f53412368ce1 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
| @@ -2824,7 +2824,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi | |||
| 2824 | netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT); | 2824 | netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT); |
| 2825 | 2825 | ||
| 2826 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | | 2826 | dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_FILTER | |
| 2827 | NETIF_F_HW_VLAN_RX | NETIF_F_IP_CSUM | NETIF_F_SG; | 2827 | NETIF_F_HW_VLAN_RX | NETIF_F_IP_CSUM; |
| 2828 | 2828 | ||
| 2829 | ret = register_netdev(dev); | 2829 | ret = register_netdev(dev); |
| 2830 | if (ret < 0) | 2830 | if (ret < 0) |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 373dcfec689c..d77ce9906b6c 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
| @@ -1327,6 +1327,10 @@ ath5k_txbuf_setup(struct ath5k_softc *sc, struct ath5k_buf *bf, | |||
| 1327 | PCI_DMA_TODEVICE); | 1327 | PCI_DMA_TODEVICE); |
| 1328 | 1328 | ||
| 1329 | rate = ieee80211_get_tx_rate(sc->hw, info); | 1329 | rate = ieee80211_get_tx_rate(sc->hw, info); |
| 1330 | if (!rate) { | ||
| 1331 | ret = -EINVAL; | ||
| 1332 | goto err_unmap; | ||
| 1333 | } | ||
| 1330 | 1334 | ||
| 1331 | if (info->flags & IEEE80211_TX_CTL_NO_ACK) | 1335 | if (info->flags & IEEE80211_TX_CTL_NO_ACK) |
| 1332 | flags |= AR5K_TXDESC_NOACK; | 1336 | flags |= AR5K_TXDESC_NOACK; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index b883b174385b..057fb69ddf7f 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
| @@ -797,7 +797,7 @@ static bool ar9300_uncompress_block(struct ath_hw *ah, | |||
| 797 | length = block[it+1]; | 797 | length = block[it+1]; |
| 798 | length &= 0xff; | 798 | length &= 0xff; |
| 799 | 799 | ||
| 800 | if (length > 0 && spot >= 0 && spot+length < mdataSize) { | 800 | if (length > 0 && spot >= 0 && spot+length <= mdataSize) { |
| 801 | ath_print(common, ATH_DBG_EEPROM, | 801 | ath_print(common, ATH_DBG_EEPROM, |
| 802 | "Restore at %d: spot=%d " | 802 | "Restore at %d: spot=%d " |
| 803 | "offset=%d length=%d\n", | 803 | "offset=%d length=%d\n", |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index 7f48df1e2903..0b09db0f8e7d 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
| @@ -62,7 +62,7 @@ | |||
| 62 | 62 | ||
| 63 | #define SD_NO_CTL 0xE0 | 63 | #define SD_NO_CTL 0xE0 |
| 64 | #define NO_CTL 0xff | 64 | #define NO_CTL 0xff |
| 65 | #define CTL_MODE_M 7 | 65 | #define CTL_MODE_M 0xf |
| 66 | #define CTL_11A 0 | 66 | #define CTL_11A 0 |
| 67 | #define CTL_11B 1 | 67 | #define CTL_11B 1 |
| 68 | #define CTL_11G 2 | 68 | #define CTL_11G 2 |
diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h index a1c39526161a..345dd9721b41 100644 --- a/drivers/net/wireless/ath/regd.h +++ b/drivers/net/wireless/ath/regd.h | |||
| @@ -31,7 +31,6 @@ enum ctl_group { | |||
| 31 | #define NO_CTL 0xff | 31 | #define NO_CTL 0xff |
| 32 | #define SD_NO_CTL 0xE0 | 32 | #define SD_NO_CTL 0xE0 |
| 33 | #define NO_CTL 0xff | 33 | #define NO_CTL 0xff |
| 34 | #define CTL_MODE_M 7 | ||
| 35 | #define CTL_11A 0 | 34 | #define CTL_11A 0 |
| 36 | #define CTL_11B 1 | 35 | #define CTL_11B 1 |
| 37 | #define CTL_11G 2 | 36 | #define CTL_11G 2 |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index ba854c70ab94..87b634978b35 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
| @@ -128,7 +128,7 @@ struct if_sdio_card { | |||
| 128 | bool helper_allocated; | 128 | bool helper_allocated; |
| 129 | bool firmware_allocated; | 129 | bool firmware_allocated; |
| 130 | 130 | ||
| 131 | u8 buffer[65536]; | 131 | u8 buffer[65536] __attribute__((aligned(4))); |
| 132 | 132 | ||
| 133 | spinlock_t lock; | 133 | spinlock_t lock; |
| 134 | struct if_sdio_packet *packets; | 134 | struct if_sdio_packet *packets; |
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c index 173aec3d6e7e..0e937dc0c9c4 100644 --- a/drivers/net/wireless/p54/txrx.c +++ b/drivers/net/wireless/p54/txrx.c | |||
| @@ -446,7 +446,7 @@ static void p54_rx_frame_sent(struct p54_common *priv, struct sk_buff *skb) | |||
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && | 448 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && |
| 449 | (!payload->status)) | 449 | !(payload->status & P54_TX_FAILED)) |
| 450 | info->flags |= IEEE80211_TX_STAT_ACK; | 450 | info->flags |= IEEE80211_TX_STAT_ACK; |
| 451 | if (payload->status & P54_TX_PSM_CANCELLED) | 451 | if (payload->status & P54_TX_PSM_CANCELLED) |
| 452 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 452 | info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
diff --git a/drivers/pci/hotplug/acpi_pcihp.c b/drivers/pci/hotplug/acpi_pcihp.c index 45fcc1e96df9..3bc72d18b121 100644 --- a/drivers/pci/hotplug/acpi_pcihp.c +++ b/drivers/pci/hotplug/acpi_pcihp.c | |||
| @@ -338,9 +338,7 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev, u32 flags) | |||
| 338 | acpi_handle chandle, handle; | 338 | acpi_handle chandle, handle; |
| 339 | struct acpi_buffer string = { ACPI_ALLOCATE_BUFFER, NULL }; | 339 | struct acpi_buffer string = { ACPI_ALLOCATE_BUFFER, NULL }; |
| 340 | 340 | ||
| 341 | flags &= (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | | 341 | flags &= OSC_SHPC_NATIVE_HP_CONTROL; |
| 342 | OSC_SHPC_NATIVE_HP_CONTROL | | ||
| 343 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 344 | if (!flags) { | 342 | if (!flags) { |
| 345 | err("Invalid flags %u specified!\n", flags); | 343 | err("Invalid flags %u specified!\n", flags); |
| 346 | return -EINVAL; | 344 | return -EINVAL; |
| @@ -360,7 +358,7 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev, u32 flags) | |||
| 360 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &string); | 358 | acpi_get_name(handle, ACPI_FULL_PATHNAME, &string); |
| 361 | dbg("Trying to get hotplug control for %s\n", | 359 | dbg("Trying to get hotplug control for %s\n", |
| 362 | (char *)string.pointer); | 360 | (char *)string.pointer); |
| 363 | status = acpi_pci_osc_control_set(handle, flags); | 361 | status = acpi_pci_osc_control_set(handle, &flags, flags); |
| 364 | if (ACPI_SUCCESS(status)) | 362 | if (ACPI_SUCCESS(status)) |
| 365 | goto got_one; | 363 | goto got_one; |
| 366 | if (status == AE_SUPPORT) | 364 | if (status == AE_SUPPORT) |
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index 4ed76b47b6dc..73d513989263 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
| @@ -176,19 +176,11 @@ static inline void pciehp_firmware_init(void) | |||
| 176 | { | 176 | { |
| 177 | pciehp_acpi_slot_detection_init(); | 177 | pciehp_acpi_slot_detection_init(); |
| 178 | } | 178 | } |
| 179 | |||
| 180 | static inline int pciehp_get_hp_hw_control_from_firmware(struct pci_dev *dev) | ||
| 181 | { | ||
| 182 | int retval; | ||
| 183 | u32 flags = (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | | ||
| 184 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 185 | retval = acpi_get_hp_hw_control_from_firmware(dev, flags); | ||
| 186 | if (retval) | ||
| 187 | return retval; | ||
| 188 | return pciehp_acpi_slot_detection_check(dev); | ||
| 189 | } | ||
| 190 | #else | 179 | #else |
| 191 | #define pciehp_firmware_init() do {} while (0) | 180 | #define pciehp_firmware_init() do {} while (0) |
| 192 | #define pciehp_get_hp_hw_control_from_firmware(dev) 0 | 181 | static inline int pciehp_acpi_slot_detection_check(struct pci_dev *dev) |
| 182 | { | ||
| 183 | return 0; | ||
| 184 | } | ||
| 193 | #endif /* CONFIG_ACPI */ | 185 | #endif /* CONFIG_ACPI */ |
| 194 | #endif /* _PCIEHP_H */ | 186 | #endif /* _PCIEHP_H */ |
diff --git a/drivers/pci/hotplug/pciehp_acpi.c b/drivers/pci/hotplug/pciehp_acpi.c index 1f4000a5a108..2574700db461 100644 --- a/drivers/pci/hotplug/pciehp_acpi.c +++ b/drivers/pci/hotplug/pciehp_acpi.c | |||
| @@ -85,9 +85,7 @@ static int __init dummy_probe(struct pcie_device *dev) | |||
| 85 | acpi_handle handle; | 85 | acpi_handle handle; |
| 86 | struct dummy_slot *slot, *tmp; | 86 | struct dummy_slot *slot, *tmp; |
| 87 | struct pci_dev *pdev = dev->port; | 87 | struct pci_dev *pdev = dev->port; |
| 88 | /* Note: pciehp_detect_mode != PCIEHP_DETECT_ACPI here */ | 88 | |
| 89 | if (pciehp_get_hp_hw_control_from_firmware(pdev)) | ||
| 90 | return -ENODEV; | ||
| 91 | pos = pci_pcie_cap(pdev); | 89 | pos = pci_pcie_cap(pdev); |
| 92 | if (!pos) | 90 | if (!pos) |
| 93 | return -ENODEV; | 91 | return -ENODEV; |
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index 3588ea61b0dd..aa5f3ff629ff 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
| @@ -59,7 +59,7 @@ module_param(pciehp_force, bool, 0644); | |||
| 59 | MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not"); | 59 | MODULE_PARM_DESC(pciehp_debug, "Debugging mode enabled or not"); |
| 60 | MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); | 60 | MODULE_PARM_DESC(pciehp_poll_mode, "Using polling mechanism for hot-plug events or not"); |
| 61 | MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); | 61 | MODULE_PARM_DESC(pciehp_poll_time, "Polling mechanism frequency, in seconds"); |
| 62 | MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if _OSC and OSHP are missing"); | 62 | MODULE_PARM_DESC(pciehp_force, "Force pciehp, even if OSHP is missing"); |
| 63 | 63 | ||
| 64 | #define PCIE_MODULE_NAME "pciehp" | 64 | #define PCIE_MODULE_NAME "pciehp" |
| 65 | 65 | ||
| @@ -235,7 +235,7 @@ static int pciehp_probe(struct pcie_device *dev) | |||
| 235 | dev_info(&dev->device, | 235 | dev_info(&dev->device, |
| 236 | "Bypassing BIOS check for pciehp use on %s\n", | 236 | "Bypassing BIOS check for pciehp use on %s\n", |
| 237 | pci_name(dev->port)); | 237 | pci_name(dev->port)); |
| 238 | else if (pciehp_get_hp_hw_control_from_firmware(dev->port)) | 238 | else if (pciehp_acpi_slot_detection_check(dev->port)) |
| 239 | goto err_out_none; | 239 | goto err_out_none; |
| 240 | 240 | ||
| 241 | ctrl = pcie_init(dev); | 241 | ctrl = pcie_init(dev); |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 679c39de6a89..7754a678ab15 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
| @@ -140,8 +140,10 @@ static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | |||
| 140 | 140 | ||
| 141 | #ifdef CONFIG_PCIEAER | 141 | #ifdef CONFIG_PCIEAER |
| 142 | void pci_no_aer(void); | 142 | void pci_no_aer(void); |
| 143 | bool pci_aer_available(void); | ||
| 143 | #else | 144 | #else |
| 144 | static inline void pci_no_aer(void) { } | 145 | static inline void pci_no_aer(void) { } |
| 146 | static inline bool pci_aer_available(void) { return false; } | ||
| 145 | #endif | 147 | #endif |
| 146 | 148 | ||
| 147 | static inline int pci_no_d1d2(struct pci_dev *dev) | 149 | static inline int pci_no_d1d2(struct pci_dev *dev) |
diff --git a/drivers/pci/pcie/Makefile b/drivers/pci/pcie/Makefile index ea654545e7c4..00c62df5a9fc 100644 --- a/drivers/pci/pcie/Makefile +++ b/drivers/pci/pcie/Makefile | |||
| @@ -6,10 +6,11 @@ | |||
| 6 | obj-$(CONFIG_PCIEASPM) += aspm.o | 6 | obj-$(CONFIG_PCIEASPM) += aspm.o |
| 7 | 7 | ||
| 8 | pcieportdrv-y := portdrv_core.o portdrv_pci.o portdrv_bus.o | 8 | pcieportdrv-y := portdrv_core.o portdrv_pci.o portdrv_bus.o |
| 9 | pcieportdrv-$(CONFIG_ACPI) += portdrv_acpi.o | ||
| 9 | 10 | ||
| 10 | obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o | 11 | obj-$(CONFIG_PCIEPORTBUS) += pcieportdrv.o |
| 11 | 12 | ||
| 12 | # Build PCI Express AER if needed | 13 | # Build PCI Express AER if needed |
| 13 | obj-$(CONFIG_PCIEAER) += aer/ | 14 | obj-$(CONFIG_PCIEAER) += aer/ |
| 14 | 15 | ||
| 15 | obj-$(CONFIG_PCIE_PME) += pme/ | 16 | obj-$(CONFIG_PCIE_PME) += pme.o |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 484cc55194b8..f409948e1a9b 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
| @@ -72,6 +72,11 @@ void pci_no_aer(void) | |||
| 72 | pcie_aer_disable = 1; /* has priority over 'forceload' */ | 72 | pcie_aer_disable = 1; /* has priority over 'forceload' */ |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | bool pci_aer_available(void) | ||
| 76 | { | ||
| 77 | return !pcie_aer_disable && pci_msi_enabled(); | ||
| 78 | } | ||
| 79 | |||
| 75 | static int set_device_error_reporting(struct pci_dev *dev, void *data) | 80 | static int set_device_error_reporting(struct pci_dev *dev, void *data) |
| 76 | { | 81 | { |
| 77 | bool enable = *((bool *)data); | 82 | bool enable = *((bool *)data); |
| @@ -411,9 +416,7 @@ static void aer_error_resume(struct pci_dev *dev) | |||
| 411 | */ | 416 | */ |
| 412 | static int __init aer_service_init(void) | 417 | static int __init aer_service_init(void) |
| 413 | { | 418 | { |
| 414 | if (pcie_aer_disable) | 419 | if (!pci_aer_available()) |
| 415 | return -ENXIO; | ||
| 416 | if (!pci_msi_enabled()) | ||
| 417 | return -ENXIO; | 420 | return -ENXIO; |
| 418 | return pcie_port_service_register(&aerdriver); | 421 | return pcie_port_service_register(&aerdriver); |
| 419 | } | 422 | } |
diff --git a/drivers/pci/pcie/aer/aerdrv_acpi.c b/drivers/pci/pcie/aer/aerdrv_acpi.c index f278d7b0d95d..2bb9b8972211 100644 --- a/drivers/pci/pcie/aer/aerdrv_acpi.c +++ b/drivers/pci/pcie/aer/aerdrv_acpi.c | |||
| @@ -19,42 +19,6 @@ | |||
| 19 | #include <acpi/apei.h> | 19 | #include <acpi/apei.h> |
| 20 | #include "aerdrv.h" | 20 | #include "aerdrv.h" |
| 21 | 21 | ||
| 22 | /** | ||
| 23 | * aer_osc_setup - run ACPI _OSC method | ||
| 24 | * @pciedev: pcie_device which AER is being enabled on | ||
| 25 | * | ||
| 26 | * @return: Zero on success. Nonzero otherwise. | ||
| 27 | * | ||
| 28 | * Invoked when PCIe bus loads AER service driver. To avoid conflict with | ||
| 29 | * BIOS AER support requires BIOS to yield AER control to OS native driver. | ||
| 30 | **/ | ||
| 31 | int aer_osc_setup(struct pcie_device *pciedev) | ||
| 32 | { | ||
| 33 | acpi_status status = AE_NOT_FOUND; | ||
| 34 | struct pci_dev *pdev = pciedev->port; | ||
| 35 | acpi_handle handle = NULL; | ||
| 36 | |||
| 37 | if (acpi_pci_disabled) | ||
| 38 | return -1; | ||
| 39 | |||
| 40 | handle = acpi_find_root_bridge_handle(pdev); | ||
| 41 | if (handle) { | ||
| 42 | status = acpi_pci_osc_control_set(handle, | ||
| 43 | OSC_PCI_EXPRESS_AER_CONTROL | | ||
| 44 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 45 | } | ||
| 46 | |||
| 47 | if (ACPI_FAILURE(status)) { | ||
| 48 | dev_printk(KERN_DEBUG, &pciedev->device, "AER service couldn't " | ||
| 49 | "init device: %s\n", | ||
| 50 | (status == AE_SUPPORT || status == AE_NOT_FOUND) ? | ||
| 51 | "no _OSC support" : "_OSC failed"); | ||
| 52 | return -1; | ||
| 53 | } | ||
| 54 | |||
| 55 | return 0; | ||
| 56 | } | ||
| 57 | |||
| 58 | #ifdef CONFIG_ACPI_APEI | 22 | #ifdef CONFIG_ACPI_APEI |
| 59 | static inline int hest_match_pci(struct acpi_hest_aer_common *p, | 23 | static inline int hest_match_pci(struct acpi_hest_aer_common *p, |
| 60 | struct pci_dev *pci) | 24 | struct pci_dev *pci) |
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index fc0b5a93e1de..29e268fadf14 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
| @@ -772,22 +772,10 @@ void aer_isr(struct work_struct *work) | |||
| 772 | */ | 772 | */ |
| 773 | int aer_init(struct pcie_device *dev) | 773 | int aer_init(struct pcie_device *dev) |
| 774 | { | 774 | { |
| 775 | if (pcie_aer_get_firmware_first(dev->port)) { | ||
| 776 | dev_printk(KERN_DEBUG, &dev->device, | ||
| 777 | "PCIe errors handled by platform firmware.\n"); | ||
| 778 | goto out; | ||
| 779 | } | ||
| 780 | |||
| 781 | if (aer_osc_setup(dev)) | ||
| 782 | goto out; | ||
| 783 | |||
| 784 | return 0; | ||
| 785 | out: | ||
| 786 | if (forceload) { | 775 | if (forceload) { |
| 787 | dev_printk(KERN_DEBUG, &dev->device, | 776 | dev_printk(KERN_DEBUG, &dev->device, |
| 788 | "aerdrv forceload requested.\n"); | 777 | "aerdrv forceload requested.\n"); |
| 789 | pcie_aer_force_firmware_first(dev->port, 0); | 778 | pcie_aer_force_firmware_first(dev->port, 0); |
| 790 | return 0; | ||
| 791 | } | 779 | } |
| 792 | return -ENXIO; | 780 | return 0; |
| 793 | } | 781 | } |
diff --git a/drivers/pci/pcie/pme/pcie_pme.c b/drivers/pci/pcie/pme.c index bbdea18693d9..2f3c90407227 100644 --- a/drivers/pci/pcie/pme/pcie_pme.c +++ b/drivers/pci/pcie/pme.c | |||
| @@ -23,38 +23,13 @@ | |||
| 23 | #include <linux/pci-acpi.h> | 23 | #include <linux/pci-acpi.h> |
| 24 | #include <linux/pm_runtime.h> | 24 | #include <linux/pm_runtime.h> |
| 25 | 25 | ||
| 26 | #include "../../pci.h" | 26 | #include "../pci.h" |
| 27 | #include "pcie_pme.h" | 27 | #include "portdrv.h" |
| 28 | 28 | ||
| 29 | #define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ | 29 | #define PCI_EXP_RTSTA_PME 0x10000 /* PME status */ |
| 30 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ | 30 | #define PCI_EXP_RTSTA_PENDING 0x20000 /* PME pending */ |
| 31 | 31 | ||
| 32 | /* | 32 | /* |
| 33 | * If set, this switch will prevent the PCIe root port PME service driver from | ||
| 34 | * being registered. Consequently, the interrupt-based PCIe PME signaling will | ||
| 35 | * not be used by any PCIe root ports in that case. | ||
| 36 | */ | ||
| 37 | static bool pcie_pme_disabled = true; | ||
| 38 | |||
| 39 | /* | ||
| 40 | * The PCI Express Base Specification 2.0, Section 6.1.8, states the following: | ||
| 41 | * "In order to maintain compatibility with non-PCI Express-aware system | ||
| 42 | * software, system power management logic must be configured by firmware to use | ||
| 43 | * the legacy mechanism of signaling PME by default. PCI Express-aware system | ||
| 44 | * software must notify the firmware prior to enabling native, interrupt-based | ||
| 45 | * PME signaling." However, if the platform doesn't provide us with a suitable | ||
| 46 | * notification mechanism or the notification fails, it is not clear whether or | ||
| 47 | * not we are supposed to use the interrupt-based PCIe PME signaling. The | ||
| 48 | * switch below can be used to indicate the desired behaviour. When set, it | ||
| 49 | * will make the kernel use the interrupt-based PCIe PME signaling regardless of | ||
| 50 | * the platform notification status, although the kernel will attempt to notify | ||
| 51 | * the platform anyway. When unset, it will prevent the kernel from using the | ||
| 52 | * the interrupt-based PCIe PME signaling if the platform notification fails, | ||
| 53 | * which is the default. | ||
| 54 | */ | ||
| 55 | static bool pcie_pme_force_enable; | ||
| 56 | |||
| 57 | /* | ||
| 58 | * If this switch is set, MSI will not be used for PCIe PME signaling. This | 33 | * If this switch is set, MSI will not be used for PCIe PME signaling. This |
| 59 | * causes the PCIe port driver to use INTx interrupts only, but it turns out | 34 | * causes the PCIe port driver to use INTx interrupts only, but it turns out |
| 60 | * that using MSI for PCIe PME signaling doesn't play well with PCIe PME-based | 35 | * that using MSI for PCIe PME signaling doesn't play well with PCIe PME-based |
| @@ -64,38 +39,13 @@ bool pcie_pme_msi_disabled; | |||
| 64 | 39 | ||
| 65 | static int __init pcie_pme_setup(char *str) | 40 | static int __init pcie_pme_setup(char *str) |
| 66 | { | 41 | { |
| 67 | if (!strncmp(str, "auto", 4)) | 42 | if (!strncmp(str, "nomsi", 5)) |
| 68 | pcie_pme_disabled = false; | 43 | pcie_pme_msi_disabled = true; |
| 69 | else if (!strncmp(str, "force", 5)) | ||
| 70 | pcie_pme_force_enable = true; | ||
| 71 | |||
| 72 | str = strchr(str, ','); | ||
| 73 | if (str) { | ||
| 74 | str++; | ||
| 75 | str += strspn(str, " \t"); | ||
| 76 | if (*str && !strcmp(str, "nomsi")) | ||
| 77 | pcie_pme_msi_disabled = true; | ||
| 78 | } | ||
| 79 | 44 | ||
| 80 | return 1; | 45 | return 1; |
| 81 | } | 46 | } |
| 82 | __setup("pcie_pme=", pcie_pme_setup); | 47 | __setup("pcie_pme=", pcie_pme_setup); |
| 83 | 48 | ||
| 84 | /** | ||
| 85 | * pcie_pme_platform_setup - Ensure that the kernel controls the PCIe PME. | ||
| 86 | * @srv: PCIe PME root port service to use for carrying out the check. | ||
| 87 | * | ||
| 88 | * Notify the platform that the native PCIe PME is going to be used and return | ||
| 89 | * 'true' if the control of the PCIe PME registers has been acquired from the | ||
| 90 | * platform. | ||
| 91 | */ | ||
| 92 | static bool pcie_pme_platform_setup(struct pcie_device *srv) | ||
| 93 | { | ||
| 94 | if (!pcie_pme_platform_notify(srv)) | ||
| 95 | return true; | ||
| 96 | return pcie_pme_force_enable; | ||
| 97 | } | ||
| 98 | |||
| 99 | struct pcie_pme_service_data { | 49 | struct pcie_pme_service_data { |
| 100 | spinlock_t lock; | 50 | spinlock_t lock; |
| 101 | struct pcie_device *srv; | 51 | struct pcie_device *srv; |
| @@ -108,7 +58,7 @@ struct pcie_pme_service_data { | |||
| 108 | * @dev: PCIe root port or event collector. | 58 | * @dev: PCIe root port or event collector. |
| 109 | * @enable: Enable or disable the interrupt. | 59 | * @enable: Enable or disable the interrupt. |
| 110 | */ | 60 | */ |
| 111 | static void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable) | 61 | void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable) |
| 112 | { | 62 | { |
| 113 | int rtctl_pos; | 63 | int rtctl_pos; |
| 114 | u16 rtctl; | 64 | u16 rtctl; |
| @@ -417,9 +367,6 @@ static int pcie_pme_probe(struct pcie_device *srv) | |||
| 417 | struct pcie_pme_service_data *data; | 367 | struct pcie_pme_service_data *data; |
| 418 | int ret; | 368 | int ret; |
| 419 | 369 | ||
| 420 | if (!pcie_pme_platform_setup(srv)) | ||
| 421 | return -EACCES; | ||
| 422 | |||
| 423 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 370 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
| 424 | if (!data) | 371 | if (!data) |
| 425 | return -ENOMEM; | 372 | return -ENOMEM; |
| @@ -509,8 +456,7 @@ static struct pcie_port_service_driver pcie_pme_driver = { | |||
| 509 | */ | 456 | */ |
| 510 | static int __init pcie_pme_service_init(void) | 457 | static int __init pcie_pme_service_init(void) |
| 511 | { | 458 | { |
| 512 | return pcie_pme_disabled ? | 459 | return pcie_port_service_register(&pcie_pme_driver); |
| 513 | -ENODEV : pcie_port_service_register(&pcie_pme_driver); | ||
| 514 | } | 460 | } |
| 515 | 461 | ||
| 516 | module_init(pcie_pme_service_init); | 462 | module_init(pcie_pme_service_init); |
diff --git a/drivers/pci/pcie/pme/Makefile b/drivers/pci/pcie/pme/Makefile deleted file mode 100644 index 8b9238053080..000000000000 --- a/drivers/pci/pcie/pme/Makefile +++ /dev/null | |||
| @@ -1,8 +0,0 @@ | |||
| 1 | # | ||
| 2 | # Makefile for PCI-Express Root Port PME signaling driver | ||
| 3 | # | ||
| 4 | |||
| 5 | obj-$(CONFIG_PCIE_PME) += pmedriver.o | ||
| 6 | |||
| 7 | pmedriver-objs := pcie_pme.o | ||
| 8 | pmedriver-$(CONFIG_ACPI) += pcie_pme_acpi.o | ||
diff --git a/drivers/pci/pcie/pme/pcie_pme.h b/drivers/pci/pcie/pme/pcie_pme.h deleted file mode 100644 index b30d2b7c9775..000000000000 --- a/drivers/pci/pcie/pme/pcie_pme.h +++ /dev/null | |||
| @@ -1,28 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * drivers/pci/pcie/pme/pcie_pme.h | ||
| 3 | * | ||
| 4 | * PCI Express Root Port PME signaling support | ||
| 5 | * | ||
| 6 | * Copyright (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _PCIE_PME_H_ | ||
| 10 | #define _PCIE_PME_H_ | ||
| 11 | |||
| 12 | struct pcie_device; | ||
| 13 | |||
| 14 | #ifdef CONFIG_ACPI | ||
| 15 | extern int pcie_pme_acpi_setup(struct pcie_device *srv); | ||
| 16 | |||
| 17 | static inline int pcie_pme_platform_notify(struct pcie_device *srv) | ||
| 18 | { | ||
| 19 | return pcie_pme_acpi_setup(srv); | ||
| 20 | } | ||
| 21 | #else /* !CONFIG_ACPI */ | ||
| 22 | static inline int pcie_pme_platform_notify(struct pcie_device *srv) | ||
| 23 | { | ||
| 24 | return 0; | ||
| 25 | } | ||
| 26 | #endif /* !CONFIG_ACPI */ | ||
| 27 | |||
| 28 | #endif | ||
diff --git a/drivers/pci/pcie/pme/pcie_pme_acpi.c b/drivers/pci/pcie/pme/pcie_pme_acpi.c deleted file mode 100644 index 83ab2287ae3f..000000000000 --- a/drivers/pci/pcie/pme/pcie_pme_acpi.c +++ /dev/null | |||
| @@ -1,54 +0,0 @@ | |||
| 1 | /* | ||
| 2 | * PCIe Native PME support, ACPI-related part | ||
| 3 | * | ||
| 4 | * Copyright (C) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License V2. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <linux/pci.h> | ||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/errno.h> | ||
| 14 | #include <linux/acpi.h> | ||
| 15 | #include <linux/pci-acpi.h> | ||
| 16 | #include <linux/pcieport_if.h> | ||
| 17 | |||
| 18 | /** | ||
| 19 | * pcie_pme_acpi_setup - Request the ACPI BIOS to release control over PCIe PME. | ||
| 20 | * @srv - PCIe PME service for a root port or event collector. | ||
| 21 | * | ||
| 22 | * Invoked when the PCIe bus type loads PCIe PME service driver. To avoid | ||
| 23 | * conflict with the BIOS PCIe support requires the BIOS to yield PCIe PME | ||
| 24 | * control to the kernel. | ||
| 25 | */ | ||
| 26 | int pcie_pme_acpi_setup(struct pcie_device *srv) | ||
| 27 | { | ||
| 28 | acpi_status status = AE_NOT_FOUND; | ||
| 29 | struct pci_dev *port = srv->port; | ||
| 30 | acpi_handle handle; | ||
| 31 | int error = 0; | ||
| 32 | |||
| 33 | if (acpi_pci_disabled) | ||
| 34 | return -ENOSYS; | ||
| 35 | |||
| 36 | dev_info(&port->dev, "Requesting control of PCIe PME from ACPI BIOS\n"); | ||
| 37 | |||
| 38 | handle = acpi_find_root_bridge_handle(port); | ||
| 39 | if (!handle) | ||
| 40 | return -EINVAL; | ||
| 41 | |||
| 42 | status = acpi_pci_osc_control_set(handle, | ||
| 43 | OSC_PCI_EXPRESS_PME_CONTROL | | ||
| 44 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 45 | if (ACPI_FAILURE(status)) { | ||
| 46 | dev_info(&port->dev, | ||
| 47 | "Failed to receive control of PCIe PME service: %s\n", | ||
| 48 | (status == AE_SUPPORT || status == AE_NOT_FOUND) ? | ||
| 49 | "no _OSC support" : "ACPI _OSC failed"); | ||
| 50 | error = -ENODEV; | ||
| 51 | } | ||
| 52 | |||
| 53 | return error; | ||
| 54 | } | ||
diff --git a/drivers/pci/pcie/portdrv.h b/drivers/pci/pcie/portdrv.h index 813a5c3427b6..7b5aba0a3291 100644 --- a/drivers/pci/pcie/portdrv.h +++ b/drivers/pci/pcie/portdrv.h | |||
| @@ -20,6 +20,9 @@ | |||
| 20 | 20 | ||
| 21 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) | 21 | #define get_descriptor_id(type, service) (((type - 4) << 4) | service) |
| 22 | 22 | ||
| 23 | extern bool pcie_ports_disabled; | ||
| 24 | extern bool pcie_ports_auto; | ||
| 25 | |||
| 23 | extern struct bus_type pcie_port_bus_type; | 26 | extern struct bus_type pcie_port_bus_type; |
| 24 | extern int pcie_port_device_register(struct pci_dev *dev); | 27 | extern int pcie_port_device_register(struct pci_dev *dev); |
| 25 | #ifdef CONFIG_PM | 28 | #ifdef CONFIG_PM |
| @@ -30,6 +33,8 @@ extern void pcie_port_device_remove(struct pci_dev *dev); | |||
| 30 | extern int __must_check pcie_port_bus_register(void); | 33 | extern int __must_check pcie_port_bus_register(void); |
| 31 | extern void pcie_port_bus_unregister(void); | 34 | extern void pcie_port_bus_unregister(void); |
| 32 | 35 | ||
| 36 | struct pci_dev; | ||
| 37 | |||
| 33 | #ifdef CONFIG_PCIE_PME | 38 | #ifdef CONFIG_PCIE_PME |
| 34 | extern bool pcie_pme_msi_disabled; | 39 | extern bool pcie_pme_msi_disabled; |
| 35 | 40 | ||
| @@ -42,9 +47,26 @@ static inline bool pcie_pme_no_msi(void) | |||
| 42 | { | 47 | { |
| 43 | return pcie_pme_msi_disabled; | 48 | return pcie_pme_msi_disabled; |
| 44 | } | 49 | } |
| 50 | |||
| 51 | extern void pcie_pme_interrupt_enable(struct pci_dev *dev, bool enable); | ||
| 45 | #else /* !CONFIG_PCIE_PME */ | 52 | #else /* !CONFIG_PCIE_PME */ |
| 46 | static inline void pcie_pme_disable_msi(void) {} | 53 | static inline void pcie_pme_disable_msi(void) {} |
| 47 | static inline bool pcie_pme_no_msi(void) { return false; } | 54 | static inline bool pcie_pme_no_msi(void) { return false; } |
| 55 | static inline void pcie_pme_interrupt_enable(struct pci_dev *dev, bool en) {} | ||
| 48 | #endif /* !CONFIG_PCIE_PME */ | 56 | #endif /* !CONFIG_PCIE_PME */ |
| 49 | 57 | ||
| 58 | #ifdef CONFIG_ACPI | ||
| 59 | extern int pcie_port_acpi_setup(struct pci_dev *port, int *mask); | ||
| 60 | |||
| 61 | static inline int pcie_port_platform_notify(struct pci_dev *port, int *mask) | ||
| 62 | { | ||
| 63 | return pcie_port_acpi_setup(port, mask); | ||
| 64 | } | ||
| 65 | #else /* !CONFIG_ACPI */ | ||
| 66 | static inline int pcie_port_platform_notify(struct pci_dev *port, int *mask) | ||
| 67 | { | ||
| 68 | return 0; | ||
| 69 | } | ||
| 70 | #endif /* !CONFIG_ACPI */ | ||
| 71 | |||
| 50 | #endif /* _PORTDRV_H_ */ | 72 | #endif /* _PORTDRV_H_ */ |
diff --git a/drivers/pci/pcie/portdrv_acpi.c b/drivers/pci/pcie/portdrv_acpi.c new file mode 100644 index 000000000000..b7c4cb1ccb23 --- /dev/null +++ b/drivers/pci/pcie/portdrv_acpi.c | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | /* | ||
| 2 | * PCIe Port Native Services Support, ACPI-Related Part | ||
| 3 | * | ||
| 4 | * Copyright (C) 2010 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. | ||
| 5 | * | ||
| 6 | * This file is subject to the terms and conditions of the GNU General Public | ||
| 7 | * License V2. See the file "COPYING" in the main directory of this archive | ||
| 8 | * for more details. | ||
| 9 | */ | ||
| 10 | |||
| 11 | #include <linux/pci.h> | ||
| 12 | #include <linux/kernel.h> | ||
| 13 | #include <linux/errno.h> | ||
| 14 | #include <linux/acpi.h> | ||
| 15 | #include <linux/pci-acpi.h> | ||
| 16 | #include <linux/pcieport_if.h> | ||
| 17 | |||
| 18 | #include "aer/aerdrv.h" | ||
| 19 | #include "../pci.h" | ||
| 20 | |||
| 21 | /** | ||
| 22 | * pcie_port_acpi_setup - Request the BIOS to release control of PCIe services. | ||
| 23 | * @port: PCIe Port service for a root port or event collector. | ||
| 24 | * @srv_mask: Bit mask of services that can be enabled for @port. | ||
| 25 | * | ||
| 26 | * Invoked when @port is identified as a PCIe port device. To avoid conflicts | ||
| 27 | * with the BIOS PCIe port native services support requires the BIOS to yield | ||
| 28 | * control of these services to the kernel. The mask of services that the BIOS | ||
| 29 | * allows to be enabled for @port is written to @srv_mask. | ||
| 30 | * | ||
| 31 | * NOTE: It turns out that we cannot do that for individual port services | ||
| 32 | * separately, because that would make some systems work incorrectly. | ||
| 33 | */ | ||
| 34 | int pcie_port_acpi_setup(struct pci_dev *port, int *srv_mask) | ||
| 35 | { | ||
| 36 | acpi_status status; | ||
| 37 | acpi_handle handle; | ||
| 38 | u32 flags; | ||
| 39 | |||
| 40 | if (acpi_pci_disabled) | ||
| 41 | return 0; | ||
| 42 | |||
| 43 | handle = acpi_find_root_bridge_handle(port); | ||
| 44 | if (!handle) | ||
| 45 | return -EINVAL; | ||
| 46 | |||
| 47 | flags = OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL | ||
| 48 | | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | ||
| 49 | | OSC_PCI_EXPRESS_PME_CONTROL; | ||
| 50 | |||
| 51 | if (pci_aer_available()) { | ||
| 52 | if (pcie_aer_get_firmware_first(port)) | ||
| 53 | dev_dbg(&port->dev, "PCIe errors handled by BIOS.\n"); | ||
| 54 | else | ||
| 55 | flags |= OSC_PCI_EXPRESS_AER_CONTROL; | ||
| 56 | } | ||
| 57 | |||
| 58 | status = acpi_pci_osc_control_set(handle, &flags, | ||
| 59 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL); | ||
| 60 | if (ACPI_FAILURE(status)) { | ||
| 61 | dev_dbg(&port->dev, "ACPI _OSC request failed (code %d)\n", | ||
| 62 | status); | ||
| 63 | return -ENODEV; | ||
| 64 | } | ||
| 65 | |||
| 66 | dev_info(&port->dev, "ACPI _OSC control granted for 0x%02x\n", flags); | ||
| 67 | |||
| 68 | *srv_mask = PCIE_PORT_SERVICE_VC; | ||
| 69 | if (flags & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL) | ||
| 70 | *srv_mask |= PCIE_PORT_SERVICE_HP; | ||
| 71 | if (flags & OSC_PCI_EXPRESS_PME_CONTROL) | ||
| 72 | *srv_mask |= PCIE_PORT_SERVICE_PME; | ||
| 73 | if (flags & OSC_PCI_EXPRESS_AER_CONTROL) | ||
| 74 | *srv_mask |= PCIE_PORT_SERVICE_AER; | ||
| 75 | |||
| 76 | return 0; | ||
| 77 | } | ||
diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c index e73effbe402c..a9c222d79ebc 100644 --- a/drivers/pci/pcie/portdrv_core.c +++ b/drivers/pci/pcie/portdrv_core.c | |||
| @@ -14,6 +14,8 @@ | |||
| 14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
| 15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
| 16 | #include <linux/pcieport_if.h> | 16 | #include <linux/pcieport_if.h> |
| 17 | #include <linux/aer.h> | ||
| 18 | #include <linux/pci-aspm.h> | ||
| 17 | 19 | ||
| 18 | #include "../pci.h" | 20 | #include "../pci.h" |
| 19 | #include "portdrv.h" | 21 | #include "portdrv.h" |
| @@ -236,24 +238,64 @@ static int get_port_device_capability(struct pci_dev *dev) | |||
| 236 | int services = 0, pos; | 238 | int services = 0, pos; |
| 237 | u16 reg16; | 239 | u16 reg16; |
| 238 | u32 reg32; | 240 | u32 reg32; |
| 241 | int cap_mask; | ||
| 242 | int err; | ||
| 243 | |||
| 244 | err = pcie_port_platform_notify(dev, &cap_mask); | ||
| 245 | if (pcie_ports_auto) { | ||
| 246 | if (err) { | ||
| 247 | pcie_no_aspm(); | ||
| 248 | return 0; | ||
| 249 | } | ||
| 250 | } else { | ||
| 251 | cap_mask = PCIE_PORT_SERVICE_PME | PCIE_PORT_SERVICE_HP | ||
| 252 | | PCIE_PORT_SERVICE_VC; | ||
| 253 | if (pci_aer_available()) | ||
| 254 | cap_mask |= PCIE_PORT_SERVICE_AER; | ||
| 255 | } | ||
| 239 | 256 | ||
| 240 | pos = pci_pcie_cap(dev); | 257 | pos = pci_pcie_cap(dev); |
| 241 | pci_read_config_word(dev, pos + PCI_EXP_FLAGS, ®16); | 258 | pci_read_config_word(dev, pos + PCI_EXP_FLAGS, ®16); |
| 242 | /* Hot-Plug Capable */ | 259 | /* Hot-Plug Capable */ |
| 243 | if (reg16 & PCI_EXP_FLAGS_SLOT) { | 260 | if ((cap_mask & PCIE_PORT_SERVICE_HP) && (reg16 & PCI_EXP_FLAGS_SLOT)) { |
| 244 | pci_read_config_dword(dev, pos + PCI_EXP_SLTCAP, ®32); | 261 | pci_read_config_dword(dev, pos + PCI_EXP_SLTCAP, ®32); |
| 245 | if (reg32 & PCI_EXP_SLTCAP_HPC) | 262 | if (reg32 & PCI_EXP_SLTCAP_HPC) { |
| 246 | services |= PCIE_PORT_SERVICE_HP; | 263 | services |= PCIE_PORT_SERVICE_HP; |
| 264 | /* | ||
| 265 | * Disable hot-plug interrupts in case they have been | ||
| 266 | * enabled by the BIOS and the hot-plug service driver | ||
| 267 | * is not loaded. | ||
| 268 | */ | ||
| 269 | pos += PCI_EXP_SLTCTL; | ||
| 270 | pci_read_config_word(dev, pos, ®16); | ||
| 271 | reg16 &= ~(PCI_EXP_SLTCTL_CCIE | PCI_EXP_SLTCTL_HPIE); | ||
| 272 | pci_write_config_word(dev, pos, reg16); | ||
| 273 | } | ||
| 247 | } | 274 | } |
| 248 | /* AER capable */ | 275 | /* AER capable */ |
| 249 | if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR)) | 276 | if ((cap_mask & PCIE_PORT_SERVICE_AER) |
| 277 | && pci_find_ext_capability(dev, PCI_EXT_CAP_ID_ERR)) { | ||
| 250 | services |= PCIE_PORT_SERVICE_AER; | 278 | services |= PCIE_PORT_SERVICE_AER; |
| 279 | /* | ||
| 280 | * Disable AER on this port in case it's been enabled by the | ||
| 281 | * BIOS (the AER service driver will enable it when necessary). | ||
| 282 | */ | ||
| 283 | pci_disable_pcie_error_reporting(dev); | ||
| 284 | } | ||
| 251 | /* VC support */ | 285 | /* VC support */ |
| 252 | if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VC)) | 286 | if (pci_find_ext_capability(dev, PCI_EXT_CAP_ID_VC)) |
| 253 | services |= PCIE_PORT_SERVICE_VC; | 287 | services |= PCIE_PORT_SERVICE_VC; |
| 254 | /* Root ports are capable of generating PME too */ | 288 | /* Root ports are capable of generating PME too */ |
| 255 | if (dev->pcie_type == PCI_EXP_TYPE_ROOT_PORT) | 289 | if ((cap_mask & PCIE_PORT_SERVICE_PME) |
| 290 | && dev->pcie_type == PCI_EXP_TYPE_ROOT_PORT) { | ||
| 256 | services |= PCIE_PORT_SERVICE_PME; | 291 | services |= PCIE_PORT_SERVICE_PME; |
| 292 | /* | ||
| 293 | * Disable PME interrupt on this port in case it's been enabled | ||
| 294 | * by the BIOS (the PME service driver will enable it when | ||
| 295 | * necessary). | ||
| 296 | */ | ||
| 297 | pcie_pme_interrupt_enable(dev, false); | ||
| 298 | } | ||
| 257 | 299 | ||
| 258 | return services; | 300 | return services; |
| 259 | } | 301 | } |
| @@ -494,6 +536,9 @@ static void pcie_port_shutdown_service(struct device *dev) {} | |||
| 494 | */ | 536 | */ |
| 495 | int pcie_port_service_register(struct pcie_port_service_driver *new) | 537 | int pcie_port_service_register(struct pcie_port_service_driver *new) |
| 496 | { | 538 | { |
| 539 | if (pcie_ports_disabled) | ||
| 540 | return -ENODEV; | ||
| 541 | |||
| 497 | new->driver.name = (char *)new->name; | 542 | new->driver.name = (char *)new->name; |
| 498 | new->driver.bus = &pcie_port_bus_type; | 543 | new->driver.bus = &pcie_port_bus_type; |
| 499 | new->driver.probe = pcie_port_probe_service; | 544 | new->driver.probe = pcie_port_probe_service; |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index 3debed25e46b..f9033e190fb6 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/pcieport_if.h> | 15 | #include <linux/pcieport_if.h> |
| 16 | #include <linux/aer.h> | 16 | #include <linux/aer.h> |
| 17 | #include <linux/dmi.h> | 17 | #include <linux/dmi.h> |
| 18 | #include <linux/pci-aspm.h> | ||
| 18 | 19 | ||
| 19 | #include "portdrv.h" | 20 | #include "portdrv.h" |
| 20 | #include "aer/aerdrv.h" | 21 | #include "aer/aerdrv.h" |
| @@ -29,6 +30,31 @@ MODULE_AUTHOR(DRIVER_AUTHOR); | |||
| 29 | MODULE_DESCRIPTION(DRIVER_DESC); | 30 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 30 | MODULE_LICENSE("GPL"); | 31 | MODULE_LICENSE("GPL"); |
| 31 | 32 | ||
| 33 | /* If this switch is set, PCIe port native services should not be enabled. */ | ||
| 34 | bool pcie_ports_disabled; | ||
| 35 | |||
| 36 | /* | ||
| 37 | * If this switch is set, ACPI _OSC will be used to determine whether or not to | ||
| 38 | * enable PCIe port native services. | ||
| 39 | */ | ||
| 40 | bool pcie_ports_auto = true; | ||
| 41 | |||
| 42 | static int __init pcie_port_setup(char *str) | ||
| 43 | { | ||
| 44 | if (!strncmp(str, "compat", 6)) { | ||
| 45 | pcie_ports_disabled = true; | ||
| 46 | } else if (!strncmp(str, "native", 6)) { | ||
| 47 | pcie_ports_disabled = false; | ||
| 48 | pcie_ports_auto = false; | ||
| 49 | } else if (!strncmp(str, "auto", 4)) { | ||
| 50 | pcie_ports_disabled = false; | ||
| 51 | pcie_ports_auto = true; | ||
| 52 | } | ||
| 53 | |||
| 54 | return 1; | ||
| 55 | } | ||
| 56 | __setup("pcie_ports=", pcie_port_setup); | ||
| 57 | |||
| 32 | /* global data */ | 58 | /* global data */ |
| 33 | 59 | ||
| 34 | static int pcie_portdrv_restore_config(struct pci_dev *dev) | 60 | static int pcie_portdrv_restore_config(struct pci_dev *dev) |
| @@ -301,6 +327,11 @@ static int __init pcie_portdrv_init(void) | |||
| 301 | { | 327 | { |
| 302 | int retval; | 328 | int retval; |
| 303 | 329 | ||
| 330 | if (pcie_ports_disabled) { | ||
| 331 | pcie_no_aspm(); | ||
| 332 | return -EACCES; | ||
| 333 | } | ||
| 334 | |||
| 304 | dmi_check_system(pcie_portdrv_dmi_table); | 335 | dmi_check_system(pcie_portdrv_dmi_table); |
| 305 | 336 | ||
| 306 | retval = pcie_port_bus_register(); | 337 | retval = pcie_port_bus_register(); |
| @@ -315,11 +346,4 @@ static int __init pcie_portdrv_init(void) | |||
| 315 | return retval; | 346 | return retval; |
| 316 | } | 347 | } |
| 317 | 348 | ||
| 318 | static void __exit pcie_portdrv_exit(void) | ||
| 319 | { | ||
| 320 | pci_unregister_driver(&pcie_portdriver); | ||
| 321 | pcie_port_bus_unregister(); | ||
| 322 | } | ||
| 323 | |||
| 324 | module_init(pcie_portdrv_init); | 349 | module_init(pcie_portdrv_init); |
| 325 | module_exit(pcie_portdrv_exit); | ||
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c index 659eaa0fc48f..968cfea04f74 100644 --- a/drivers/pci/slot.c +++ b/drivers/pci/slot.c | |||
| @@ -49,7 +49,7 @@ static ssize_t address_read_file(struct pci_slot *slot, char *buf) | |||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | /* these strings match up with the values in pci_bus_speed */ | 51 | /* these strings match up with the values in pci_bus_speed */ |
| 52 | static char *pci_bus_speed_strings[] = { | 52 | static const char *pci_bus_speed_strings[] = { |
| 53 | "33 MHz PCI", /* 0x00 */ | 53 | "33 MHz PCI", /* 0x00 */ |
| 54 | "66 MHz PCI", /* 0x01 */ | 54 | "66 MHz PCI", /* 0x01 */ |
| 55 | "66 MHz PCI-X", /* 0x02 */ | 55 | "66 MHz PCI-X", /* 0x02 */ |
diff --git a/drivers/rtc/rtc-bfin.c b/drivers/rtc/rtc-bfin.c index 72b2bcc2c224..d4fb82d85e9b 100644 --- a/drivers/rtc/rtc-bfin.c +++ b/drivers/rtc/rtc-bfin.c | |||
| @@ -426,7 +426,7 @@ static int bfin_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
| 426 | enable_irq_wake(IRQ_RTC); | 426 | enable_irq_wake(IRQ_RTC); |
| 427 | bfin_rtc_sync_pending(&pdev->dev); | 427 | bfin_rtc_sync_pending(&pdev->dev); |
| 428 | } else | 428 | } else |
| 429 | bfin_rtc_int_clear(-1); | 429 | bfin_rtc_int_clear(0); |
| 430 | 430 | ||
| 431 | return 0; | 431 | return 0; |
| 432 | } | 432 | } |
| @@ -435,8 +435,17 @@ static int bfin_rtc_resume(struct platform_device *pdev) | |||
| 435 | { | 435 | { |
| 436 | if (device_may_wakeup(&pdev->dev)) | 436 | if (device_may_wakeup(&pdev->dev)) |
| 437 | disable_irq_wake(IRQ_RTC); | 437 | disable_irq_wake(IRQ_RTC); |
| 438 | else | 438 | |
| 439 | bfin_write_RTC_ISTAT(-1); | 439 | /* |
| 440 | * Since only some of the RTC bits are maintained externally in the | ||
| 441 | * Vbat domain, we need to wait for the RTC MMRs to be synced into | ||
| 442 | * the core after waking up. This happens every RTC 1HZ. Once that | ||
| 443 | * has happened, we can go ahead and re-enable the important write | ||
| 444 | * complete interrupt event. | ||
| 445 | */ | ||
| 446 | while (!(bfin_read_RTC_ISTAT() & RTC_ISTAT_SEC)) | ||
| 447 | continue; | ||
| 448 | bfin_rtc_int_set(RTC_ISTAT_WRITE_COMPLETE); | ||
| 440 | 449 | ||
| 441 | return 0; | 450 | return 0; |
| 442 | } | 451 | } |
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 66377f3e28b8..d60557cae8ef 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c | |||
| @@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) | |||
| 364 | t->time.tm_isdst = -1; | 364 | t->time.tm_isdst = -1; |
| 365 | t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); | 365 | t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); |
| 366 | t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); | 366 | t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); |
| 367 | return rtc_valid_tm(t); | 367 | return 0; |
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | static struct rtc_class_ops m41t80_rtc_ops = { | 370 | static struct rtc_class_ops m41t80_rtc_ops = { |
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 6c418fe7f288..b7a6690e5b35 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
| @@ -403,7 +403,7 @@ static int pl031_probe(struct amba_device *adev, struct amba_id *id) | |||
| 403 | } | 403 | } |
| 404 | 404 | ||
| 405 | if (request_irq(adev->irq[0], pl031_interrupt, | 405 | if (request_irq(adev->irq[0], pl031_interrupt, |
| 406 | IRQF_DISABLED | IRQF_SHARED, "rtc-pl031", ldata)) { | 406 | IRQF_DISABLED, "rtc-pl031", ldata)) { |
| 407 | ret = -EIO; | 407 | ret = -EIO; |
| 408 | goto out_no_irq; | 408 | goto out_no_irq; |
| 409 | } | 409 | } |
diff --git a/drivers/s390/char/ctrlchar.c b/drivers/s390/char/ctrlchar.c index c6cbcb3f925e..0e9a309b9669 100644 --- a/drivers/s390/char/ctrlchar.c +++ b/drivers/s390/char/ctrlchar.c | |||
| @@ -16,12 +16,11 @@ | |||
| 16 | 16 | ||
| 17 | #ifdef CONFIG_MAGIC_SYSRQ | 17 | #ifdef CONFIG_MAGIC_SYSRQ |
| 18 | static int ctrlchar_sysrq_key; | 18 | static int ctrlchar_sysrq_key; |
| 19 | static struct tty_struct *sysrq_tty; | ||
| 20 | 19 | ||
| 21 | static void | 20 | static void |
| 22 | ctrlchar_handle_sysrq(struct work_struct *work) | 21 | ctrlchar_handle_sysrq(struct work_struct *work) |
| 23 | { | 22 | { |
| 24 | handle_sysrq(ctrlchar_sysrq_key, sysrq_tty); | 23 | handle_sysrq(ctrlchar_sysrq_key); |
| 25 | } | 24 | } |
| 26 | 25 | ||
| 27 | static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq); | 26 | static DECLARE_WORK(ctrlchar_work, ctrlchar_handle_sysrq); |
| @@ -54,7 +53,6 @@ ctrlchar_handle(const unsigned char *buf, int len, struct tty_struct *tty) | |||
| 54 | /* racy */ | 53 | /* racy */ |
| 55 | if (len == 3 && buf[1] == '-') { | 54 | if (len == 3 && buf[1] == '-') { |
| 56 | ctrlchar_sysrq_key = buf[2]; | 55 | ctrlchar_sysrq_key = buf[2]; |
| 57 | sysrq_tty = tty; | ||
| 58 | schedule_work(&ctrlchar_work); | 56 | schedule_work(&ctrlchar_work); |
| 59 | return CTRLCHAR_SYSRQ; | 57 | return CTRLCHAR_SYSRQ; |
| 60 | } | 58 | } |
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index 18d9a497863b..8cd58e412b5e 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c | |||
| @@ -305,7 +305,7 @@ kbd_keycode(struct kbd_data *kbd, unsigned int keycode) | |||
| 305 | if (kbd->sysrq) { | 305 | if (kbd->sysrq) { |
| 306 | if (kbd->sysrq == K(KT_LATIN, '-')) { | 306 | if (kbd->sysrq == K(KT_LATIN, '-')) { |
| 307 | kbd->sysrq = 0; | 307 | kbd->sysrq = 0; |
| 308 | handle_sysrq(value, kbd->tty); | 308 | handle_sysrq(value); |
| 309 | return; | 309 | return; |
| 310 | } | 310 | } |
| 311 | if (value == '-') { | 311 | if (value == '-') { |
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c index b7de02525ec9..85cf607fc78f 100644 --- a/drivers/s390/char/tape_block.c +++ b/drivers/s390/char/tape_block.c | |||
| @@ -217,8 +217,7 @@ tapeblock_setup_device(struct tape_device * device) | |||
| 217 | if (!blkdat->request_queue) | 217 | if (!blkdat->request_queue) |
| 218 | return -ENOMEM; | 218 | return -ENOMEM; |
| 219 | 219 | ||
| 220 | elevator_exit(blkdat->request_queue->elevator); | 220 | rc = elevator_change(blkdat->request_queue, "noop"); |
| 221 | rc = elevator_init(blkdat->request_queue, "noop"); | ||
| 222 | if (rc) | 221 | if (rc) |
| 223 | goto cleanup_queue; | 222 | goto cleanup_queue; |
| 224 | 223 | ||
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index 7d4d2275573c..7f11f3e48e12 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/drivers/scsi/be2iscsi/be_iscsi.c | |||
| @@ -300,8 +300,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost, | |||
| 300 | enum iscsi_host_param param, char *buf) | 300 | enum iscsi_host_param param, char *buf) |
| 301 | { | 301 | { |
| 302 | struct beiscsi_hba *phba = (struct beiscsi_hba *)iscsi_host_priv(shost); | 302 | struct beiscsi_hba *phba = (struct beiscsi_hba *)iscsi_host_priv(shost); |
| 303 | int len = 0; | 303 | int status = 0; |
| 304 | int status; | ||
| 305 | 304 | ||
| 306 | SE_DEBUG(DBG_LVL_8, "In beiscsi_get_host_param, param= %d\n", param); | 305 | SE_DEBUG(DBG_LVL_8, "In beiscsi_get_host_param, param= %d\n", param); |
| 307 | switch (param) { | 306 | switch (param) { |
| @@ -315,7 +314,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost, | |||
| 315 | default: | 314 | default: |
| 316 | return iscsi_host_get_param(shost, param, buf); | 315 | return iscsi_host_get_param(shost, param, buf); |
| 317 | } | 316 | } |
| 318 | return len; | 317 | return status; |
| 319 | } | 318 | } |
| 320 | 319 | ||
| 321 | int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba) | 320 | int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba) |
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 26350e470bcc..877324fc594c 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
| @@ -368,7 +368,7 @@ int mgmt_open_connection(struct beiscsi_hba *phba, | |||
| 368 | memset(req, 0, sizeof(*req)); | 368 | memset(req, 0, sizeof(*req)); |
| 369 | wrb->tag0 |= tag; | 369 | wrb->tag0 |= tag; |
| 370 | 370 | ||
| 371 | be_wrb_hdr_prepare(wrb, sizeof(*req), true, 1); | 371 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1); |
| 372 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, | 372 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ISCSI, |
| 373 | OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD, | 373 | OPCODE_COMMON_ISCSI_TCP_CONNECT_AND_OFFLOAD, |
| 374 | sizeof(*req)); | 374 | sizeof(*req)); |
diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c index cd05e049d5f6..d0c82340f0e2 100644 --- a/drivers/scsi/constants.c +++ b/drivers/scsi/constants.c | |||
| @@ -1404,13 +1404,13 @@ void scsi_print_sense(char *name, struct scsi_cmnd *cmd) | |||
| 1404 | { | 1404 | { |
| 1405 | struct scsi_sense_hdr sshdr; | 1405 | struct scsi_sense_hdr sshdr; |
| 1406 | 1406 | ||
| 1407 | scmd_printk(KERN_INFO, cmd, ""); | 1407 | scmd_printk(KERN_INFO, cmd, " "); |
| 1408 | scsi_decode_sense_buffer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE, | 1408 | scsi_decode_sense_buffer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE, |
| 1409 | &sshdr); | 1409 | &sshdr); |
| 1410 | scsi_show_sense_hdr(&sshdr); | 1410 | scsi_show_sense_hdr(&sshdr); |
| 1411 | scsi_decode_sense_extras(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE, | 1411 | scsi_decode_sense_extras(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE, |
| 1412 | &sshdr); | 1412 | &sshdr); |
| 1413 | scmd_printk(KERN_INFO, cmd, ""); | 1413 | scmd_printk(KERN_INFO, cmd, " "); |
| 1414 | scsi_show_extd_sense(sshdr.asc, sshdr.ascq); | 1414 | scsi_show_extd_sense(sshdr.asc, sshdr.ascq); |
| 1415 | } | 1415 | } |
| 1416 | EXPORT_SYMBOL(scsi_print_sense); | 1416 | EXPORT_SYMBOL(scsi_print_sense); |
| @@ -1453,7 +1453,7 @@ EXPORT_SYMBOL(scsi_show_result); | |||
| 1453 | 1453 | ||
| 1454 | void scsi_print_result(struct scsi_cmnd *cmd) | 1454 | void scsi_print_result(struct scsi_cmnd *cmd) |
| 1455 | { | 1455 | { |
| 1456 | scmd_printk(KERN_INFO, cmd, ""); | 1456 | scmd_printk(KERN_INFO, cmd, " "); |
| 1457 | scsi_show_result(cmd->result); | 1457 | scsi_show_result(cmd->result); |
| 1458 | } | 1458 | } |
| 1459 | EXPORT_SYMBOL(scsi_print_result); | 1459 | EXPORT_SYMBOL(scsi_print_result); |
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 4f5551b5fe53..c5d0606ad097 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
| @@ -3231,6 +3231,12 @@ static __devinit int hpsa_kdump_hard_reset_controller(struct pci_dev *pdev) | |||
| 3231 | misc_fw_support = readl(&cfgtable->misc_fw_support); | 3231 | misc_fw_support = readl(&cfgtable->misc_fw_support); |
| 3232 | use_doorbell = misc_fw_support & MISC_FW_DOORBELL_RESET; | 3232 | use_doorbell = misc_fw_support & MISC_FW_DOORBELL_RESET; |
| 3233 | 3233 | ||
| 3234 | /* The doorbell reset seems to cause lockups on some Smart | ||
| 3235 | * Arrays (e.g. P410, P410i, maybe others). Until this is | ||
| 3236 | * fixed or at least isolated, avoid the doorbell reset. | ||
| 3237 | */ | ||
| 3238 | use_doorbell = 0; | ||
| 3239 | |||
| 3234 | rc = hpsa_controller_hard_reset(pdev, vaddr, use_doorbell); | 3240 | rc = hpsa_controller_hard_reset(pdev, vaddr, use_doorbell); |
| 3235 | if (rc) | 3241 | if (rc) |
| 3236 | goto unmap_cfgtable; | 3242 | goto unmap_cfgtable; |
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index fda4de3440c4..e88bbdde49c5 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c | |||
| @@ -865,7 +865,7 @@ void osd_req_read(struct osd_request *or, | |||
| 865 | { | 865 | { |
| 866 | _osd_req_encode_common(or, OSD_ACT_READ, obj, offset, len); | 866 | _osd_req_encode_common(or, OSD_ACT_READ, obj, offset, len); |
| 867 | WARN_ON(or->in.bio || or->in.total_bytes); | 867 | WARN_ON(or->in.bio || or->in.total_bytes); |
| 868 | WARN_ON(1 == (bio->bi_rw & REQ_WRITE)); | 868 | WARN_ON(bio->bi_rw & REQ_WRITE); |
| 869 | or->in.bio = bio; | 869 | or->in.bio = bio; |
| 870 | or->in.total_bytes = len; | 870 | or->in.total_bytes = len; |
| 871 | } | 871 | } |
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 420238cc794e..114bc5a81171 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
| @@ -1838,26 +1838,33 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) | |||
| 1838 | 1838 | ||
| 1839 | qla24xx_disable_vp(vha); | 1839 | qla24xx_disable_vp(vha); |
| 1840 | 1840 | ||
| 1841 | vha->flags.delete_progress = 1; | ||
| 1842 | |||
| 1841 | fc_remove_host(vha->host); | 1843 | fc_remove_host(vha->host); |
| 1842 | 1844 | ||
| 1843 | scsi_remove_host(vha->host); | 1845 | scsi_remove_host(vha->host); |
| 1844 | 1846 | ||
| 1845 | qla2x00_free_fcports(vha); | 1847 | if (vha->timer_active) { |
| 1848 | qla2x00_vp_stop_timer(vha); | ||
| 1849 | DEBUG15(printk(KERN_INFO "scsi(%ld): timer for the vport[%d]" | ||
| 1850 | " = %p has stopped\n", vha->host_no, vha->vp_idx, vha)); | ||
| 1851 | } | ||
| 1846 | 1852 | ||
| 1847 | qla24xx_deallocate_vp_id(vha); | 1853 | qla24xx_deallocate_vp_id(vha); |
| 1848 | 1854 | ||
| 1855 | /* No pending activities shall be there on the vha now */ | ||
| 1856 | DEBUG(msleep(random32()%10)); /* Just to see if something falls on | ||
| 1857 | * the net we have placed below */ | ||
| 1858 | |||
| 1859 | BUG_ON(atomic_read(&vha->vref_count)); | ||
| 1860 | |||
| 1861 | qla2x00_free_fcports(vha); | ||
| 1862 | |||
| 1849 | mutex_lock(&ha->vport_lock); | 1863 | mutex_lock(&ha->vport_lock); |
| 1850 | ha->cur_vport_count--; | 1864 | ha->cur_vport_count--; |
| 1851 | clear_bit(vha->vp_idx, ha->vp_idx_map); | 1865 | clear_bit(vha->vp_idx, ha->vp_idx_map); |
| 1852 | mutex_unlock(&ha->vport_lock); | 1866 | mutex_unlock(&ha->vport_lock); |
| 1853 | 1867 | ||
| 1854 | if (vha->timer_active) { | ||
| 1855 | qla2x00_vp_stop_timer(vha); | ||
| 1856 | DEBUG15(printk ("scsi(%ld): timer for the vport[%d] = %p " | ||
| 1857 | "has stopped\n", | ||
| 1858 | vha->host_no, vha->vp_idx, vha)); | ||
| 1859 | } | ||
| 1860 | |||
| 1861 | if (vha->req->id && !ha->flags.cpu_affinity_enabled) { | 1868 | if (vha->req->id && !ha->flags.cpu_affinity_enabled) { |
| 1862 | if (qla25xx_delete_req_que(vha, vha->req) != QLA_SUCCESS) | 1869 | if (qla25xx_delete_req_que(vha, vha->req) != QLA_SUCCESS) |
| 1863 | qla_printk(KERN_WARNING, ha, | 1870 | qla_printk(KERN_WARNING, ha, |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.h b/drivers/scsi/qla2xxx/qla_dbg.h index 6cfc28a25eb3..b74e6b5743dc 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.h +++ b/drivers/scsi/qla2xxx/qla_dbg.h | |||
| @@ -29,8 +29,6 @@ | |||
| 29 | /* #define QL_DEBUG_LEVEL_17 */ /* Output EEH trace messages */ | 29 | /* #define QL_DEBUG_LEVEL_17 */ /* Output EEH trace messages */ |
| 30 | /* #define QL_DEBUG_LEVEL_18 */ /* Output T10 CRC trace messages */ | 30 | /* #define QL_DEBUG_LEVEL_18 */ /* Output T10 CRC trace messages */ |
| 31 | 31 | ||
| 32 | /* #define QL_PRINTK_BUF */ /* Captures printk to buffer */ | ||
| 33 | |||
| 34 | /* | 32 | /* |
| 35 | * Macros use for debugging the driver. | 33 | * Macros use for debugging the driver. |
| 36 | */ | 34 | */ |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 3a432ea0c7a3..d2a4e1530708 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
| @@ -2641,6 +2641,7 @@ struct qla_hw_data { | |||
| 2641 | #define MBX_UPDATE_FLASH_ACTIVE 3 | 2641 | #define MBX_UPDATE_FLASH_ACTIVE 3 |
| 2642 | 2642 | ||
| 2643 | struct mutex vport_lock; /* Virtual port synchronization */ | 2643 | struct mutex vport_lock; /* Virtual port synchronization */ |
| 2644 | spinlock_t vport_slock; /* order is hardware_lock, then vport_slock */ | ||
| 2644 | struct completion mbx_cmd_comp; /* Serialize mbx access */ | 2645 | struct completion mbx_cmd_comp; /* Serialize mbx access */ |
| 2645 | struct completion mbx_intr_comp; /* Used for completion notification */ | 2646 | struct completion mbx_intr_comp; /* Used for completion notification */ |
| 2646 | struct completion dcbx_comp; /* For set port config notification */ | 2647 | struct completion dcbx_comp; /* For set port config notification */ |
| @@ -2828,6 +2829,7 @@ typedef struct scsi_qla_host { | |||
| 2828 | uint32_t management_server_logged_in :1; | 2829 | uint32_t management_server_logged_in :1; |
| 2829 | uint32_t process_response_queue :1; | 2830 | uint32_t process_response_queue :1; |
| 2830 | uint32_t difdix_supported:1; | 2831 | uint32_t difdix_supported:1; |
| 2832 | uint32_t delete_progress:1; | ||
| 2831 | } flags; | 2833 | } flags; |
| 2832 | 2834 | ||
| 2833 | atomic_t loop_state; | 2835 | atomic_t loop_state; |
| @@ -2922,6 +2924,8 @@ typedef struct scsi_qla_host { | |||
| 2922 | struct req_que *req; | 2924 | struct req_que *req; |
| 2923 | int fw_heartbeat_counter; | 2925 | int fw_heartbeat_counter; |
| 2924 | int seconds_since_last_heartbeat; | 2926 | int seconds_since_last_heartbeat; |
| 2927 | |||
| 2928 | atomic_t vref_count; | ||
| 2925 | } scsi_qla_host_t; | 2929 | } scsi_qla_host_t; |
| 2926 | 2930 | ||
| 2927 | /* | 2931 | /* |
| @@ -2932,6 +2936,22 @@ typedef struct scsi_qla_host { | |||
| 2932 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ | 2936 | test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags) || \ |
| 2933 | atomic_read(&ha->loop_state) == LOOP_DOWN) | 2937 | atomic_read(&ha->loop_state) == LOOP_DOWN) |
| 2934 | 2938 | ||
| 2939 | #define QLA_VHA_MARK_BUSY(__vha, __bail) do { \ | ||
| 2940 | atomic_inc(&__vha->vref_count); \ | ||
| 2941 | mb(); \ | ||
| 2942 | if (__vha->flags.delete_progress) { \ | ||
| 2943 | atomic_dec(&__vha->vref_count); \ | ||
| 2944 | __bail = 1; \ | ||
| 2945 | } else { \ | ||
| 2946 | __bail = 0; \ | ||
| 2947 | } \ | ||
| 2948 | } while (0) | ||
| 2949 | |||
| 2950 | #define QLA_VHA_MARK_NOT_BUSY(__vha) do { \ | ||
| 2951 | atomic_dec(&__vha->vref_count); \ | ||
| 2952 | } while (0) | ||
| 2953 | |||
| 2954 | |||
| 2935 | #define qla_printk(level, ha, format, arg...) \ | 2955 | #define qla_printk(level, ha, format, arg...) \ |
| 2936 | dev_printk(level , &((ha)->pdev->dev) , format , ## arg) | 2956 | dev_printk(level , &((ha)->pdev->dev) , format , ## arg) |
| 2937 | 2957 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index d863ed2619b5..9c383baebe27 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -69,21 +69,29 @@ qla2x00_ctx_sp_free(srb_t *sp) | |||
| 69 | { | 69 | { |
| 70 | struct srb_ctx *ctx = sp->ctx; | 70 | struct srb_ctx *ctx = sp->ctx; |
| 71 | struct srb_iocb *iocb = ctx->u.iocb_cmd; | 71 | struct srb_iocb *iocb = ctx->u.iocb_cmd; |
| 72 | struct scsi_qla_host *vha = sp->fcport->vha; | ||
| 72 | 73 | ||
| 73 | del_timer_sync(&iocb->timer); | 74 | del_timer_sync(&iocb->timer); |
| 74 | kfree(iocb); | 75 | kfree(iocb); |
| 75 | kfree(ctx); | 76 | kfree(ctx); |
| 76 | mempool_free(sp, sp->fcport->vha->hw->srb_mempool); | 77 | mempool_free(sp, sp->fcport->vha->hw->srb_mempool); |
| 78 | |||
| 79 | QLA_VHA_MARK_NOT_BUSY(vha); | ||
| 77 | } | 80 | } |
| 78 | 81 | ||
| 79 | inline srb_t * | 82 | inline srb_t * |
| 80 | qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size, | 83 | qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size, |
| 81 | unsigned long tmo) | 84 | unsigned long tmo) |
| 82 | { | 85 | { |
| 83 | srb_t *sp; | 86 | srb_t *sp = NULL; |
| 84 | struct qla_hw_data *ha = vha->hw; | 87 | struct qla_hw_data *ha = vha->hw; |
| 85 | struct srb_ctx *ctx; | 88 | struct srb_ctx *ctx; |
| 86 | struct srb_iocb *iocb; | 89 | struct srb_iocb *iocb; |
| 90 | uint8_t bail; | ||
| 91 | |||
| 92 | QLA_VHA_MARK_BUSY(vha, bail); | ||
| 93 | if (bail) | ||
| 94 | return NULL; | ||
| 87 | 95 | ||
| 88 | sp = mempool_alloc(ha->srb_mempool, GFP_KERNEL); | 96 | sp = mempool_alloc(ha->srb_mempool, GFP_KERNEL); |
| 89 | if (!sp) | 97 | if (!sp) |
| @@ -116,6 +124,8 @@ qla2x00_get_ctx_sp(scsi_qla_host_t *vha, fc_port_t *fcport, size_t size, | |||
| 116 | iocb->timer.function = qla2x00_ctx_sp_timeout; | 124 | iocb->timer.function = qla2x00_ctx_sp_timeout; |
| 117 | add_timer(&iocb->timer); | 125 | add_timer(&iocb->timer); |
| 118 | done: | 126 | done: |
| 127 | if (!sp) | ||
| 128 | QLA_VHA_MARK_NOT_BUSY(vha); | ||
| 119 | return sp; | 129 | return sp; |
| 120 | } | 130 | } |
| 121 | 131 | ||
| @@ -1777,11 +1787,15 @@ qla2x00_init_rings(scsi_qla_host_t *vha) | |||
| 1777 | qla2x00_init_response_q_entries(rsp); | 1787 | qla2x00_init_response_q_entries(rsp); |
| 1778 | } | 1788 | } |
| 1779 | 1789 | ||
| 1790 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 1780 | /* Clear RSCN queue. */ | 1791 | /* Clear RSCN queue. */ |
| 1781 | list_for_each_entry(vp, &ha->vp_list, list) { | 1792 | list_for_each_entry(vp, &ha->vp_list, list) { |
| 1782 | vp->rscn_in_ptr = 0; | 1793 | vp->rscn_in_ptr = 0; |
| 1783 | vp->rscn_out_ptr = 0; | 1794 | vp->rscn_out_ptr = 0; |
| 1784 | } | 1795 | } |
| 1796 | |||
| 1797 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 1798 | |||
| 1785 | ha->isp_ops->config_rings(vha); | 1799 | ha->isp_ops->config_rings(vha); |
| 1786 | 1800 | ||
| 1787 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1801 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
| @@ -3218,12 +3232,17 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha, | |||
| 3218 | /* Bypass virtual ports of the same host. */ | 3232 | /* Bypass virtual ports of the same host. */ |
| 3219 | found = 0; | 3233 | found = 0; |
| 3220 | if (ha->num_vhosts) { | 3234 | if (ha->num_vhosts) { |
| 3235 | unsigned long flags; | ||
| 3236 | |||
| 3237 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 3221 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { | 3238 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
| 3222 | if (new_fcport->d_id.b24 == vp->d_id.b24) { | 3239 | if (new_fcport->d_id.b24 == vp->d_id.b24) { |
| 3223 | found = 1; | 3240 | found = 1; |
| 3224 | break; | 3241 | break; |
| 3225 | } | 3242 | } |
| 3226 | } | 3243 | } |
| 3244 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 3245 | |||
| 3227 | if (found) | 3246 | if (found) |
| 3228 | continue; | 3247 | continue; |
| 3229 | } | 3248 | } |
| @@ -3343,6 +3362,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
| 3343 | struct qla_hw_data *ha = vha->hw; | 3362 | struct qla_hw_data *ha = vha->hw; |
| 3344 | struct scsi_qla_host *vp; | 3363 | struct scsi_qla_host *vp; |
| 3345 | struct scsi_qla_host *tvp; | 3364 | struct scsi_qla_host *tvp; |
| 3365 | unsigned long flags = 0; | ||
| 3346 | 3366 | ||
| 3347 | rval = QLA_SUCCESS; | 3367 | rval = QLA_SUCCESS; |
| 3348 | 3368 | ||
| @@ -3367,6 +3387,8 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
| 3367 | /* Check for loop ID being already in use. */ | 3387 | /* Check for loop ID being already in use. */ |
| 3368 | found = 0; | 3388 | found = 0; |
| 3369 | fcport = NULL; | 3389 | fcport = NULL; |
| 3390 | |||
| 3391 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 3370 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { | 3392 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { |
| 3371 | list_for_each_entry(fcport, &vp->vp_fcports, list) { | 3393 | list_for_each_entry(fcport, &vp->vp_fcports, list) { |
| 3372 | if (fcport->loop_id == dev->loop_id && | 3394 | if (fcport->loop_id == dev->loop_id && |
| @@ -3379,6 +3401,7 @@ qla2x00_find_new_loop_id(scsi_qla_host_t *vha, fc_port_t *dev) | |||
| 3379 | if (found) | 3401 | if (found) |
| 3380 | break; | 3402 | break; |
| 3381 | } | 3403 | } |
| 3404 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 3382 | 3405 | ||
| 3383 | /* If not in use then it is free to use. */ | 3406 | /* If not in use then it is free to use. */ |
| 3384 | if (!found) { | 3407 | if (!found) { |
| @@ -3791,14 +3814,27 @@ void | |||
| 3791 | qla2x00_update_fcports(scsi_qla_host_t *base_vha) | 3814 | qla2x00_update_fcports(scsi_qla_host_t *base_vha) |
| 3792 | { | 3815 | { |
| 3793 | fc_port_t *fcport; | 3816 | fc_port_t *fcport; |
| 3794 | struct scsi_qla_host *tvp, *vha; | 3817 | struct scsi_qla_host *vha; |
| 3818 | struct qla_hw_data *ha = base_vha->hw; | ||
| 3819 | unsigned long flags; | ||
| 3795 | 3820 | ||
| 3821 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 3796 | /* Go with deferred removal of rport references. */ | 3822 | /* Go with deferred removal of rport references. */ |
| 3797 | list_for_each_entry_safe(vha, tvp, &base_vha->hw->vp_list, list) | 3823 | list_for_each_entry(vha, &base_vha->hw->vp_list, list) { |
| 3798 | list_for_each_entry(fcport, &vha->vp_fcports, list) | 3824 | atomic_inc(&vha->vref_count); |
| 3825 | list_for_each_entry(fcport, &vha->vp_fcports, list) { | ||
| 3799 | if (fcport && fcport->drport && | 3826 | if (fcport && fcport->drport && |
| 3800 | atomic_read(&fcport->state) != FCS_UNCONFIGURED) | 3827 | atomic_read(&fcport->state) != FCS_UNCONFIGURED) { |
| 3828 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 3829 | |||
| 3801 | qla2x00_rport_del(fcport); | 3830 | qla2x00_rport_del(fcport); |
| 3831 | |||
| 3832 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 3833 | } | ||
| 3834 | } | ||
| 3835 | atomic_dec(&vha->vref_count); | ||
| 3836 | } | ||
| 3837 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 3802 | } | 3838 | } |
| 3803 | 3839 | ||
| 3804 | void | 3840 | void |
| @@ -3806,7 +3842,7 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) | |||
| 3806 | { | 3842 | { |
| 3807 | struct qla_hw_data *ha = vha->hw; | 3843 | struct qla_hw_data *ha = vha->hw; |
| 3808 | struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); | 3844 | struct scsi_qla_host *vp, *base_vha = pci_get_drvdata(ha->pdev); |
| 3809 | struct scsi_qla_host *tvp; | 3845 | unsigned long flags; |
| 3810 | 3846 | ||
| 3811 | vha->flags.online = 0; | 3847 | vha->flags.online = 0; |
| 3812 | ha->flags.chip_reset_done = 0; | 3848 | ha->flags.chip_reset_done = 0; |
| @@ -3824,8 +3860,18 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) | |||
| 3824 | if (atomic_read(&vha->loop_state) != LOOP_DOWN) { | 3860 | if (atomic_read(&vha->loop_state) != LOOP_DOWN) { |
| 3825 | atomic_set(&vha->loop_state, LOOP_DOWN); | 3861 | atomic_set(&vha->loop_state, LOOP_DOWN); |
| 3826 | qla2x00_mark_all_devices_lost(vha, 0); | 3862 | qla2x00_mark_all_devices_lost(vha, 0); |
| 3827 | list_for_each_entry_safe(vp, tvp, &base_vha->hw->vp_list, list) | 3863 | |
| 3864 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 3865 | list_for_each_entry(vp, &base_vha->hw->vp_list, list) { | ||
| 3866 | atomic_inc(&vp->vref_count); | ||
| 3867 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 3868 | |||
| 3828 | qla2x00_mark_all_devices_lost(vp, 0); | 3869 | qla2x00_mark_all_devices_lost(vp, 0); |
| 3870 | |||
| 3871 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 3872 | atomic_dec(&vp->vref_count); | ||
| 3873 | } | ||
| 3874 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 3829 | } else { | 3875 | } else { |
| 3830 | if (!atomic_read(&vha->loop_down_timer)) | 3876 | if (!atomic_read(&vha->loop_down_timer)) |
| 3831 | atomic_set(&vha->loop_down_timer, | 3877 | atomic_set(&vha->loop_down_timer, |
| @@ -3862,8 +3908,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
| 3862 | uint8_t status = 0; | 3908 | uint8_t status = 0; |
| 3863 | struct qla_hw_data *ha = vha->hw; | 3909 | struct qla_hw_data *ha = vha->hw; |
| 3864 | struct scsi_qla_host *vp; | 3910 | struct scsi_qla_host *vp; |
| 3865 | struct scsi_qla_host *tvp; | ||
| 3866 | struct req_que *req = ha->req_q_map[0]; | 3911 | struct req_que *req = ha->req_q_map[0]; |
| 3912 | unsigned long flags; | ||
| 3867 | 3913 | ||
| 3868 | if (vha->flags.online) { | 3914 | if (vha->flags.online) { |
| 3869 | qla2x00_abort_isp_cleanup(vha); | 3915 | qla2x00_abort_isp_cleanup(vha); |
| @@ -3970,10 +4016,21 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) | |||
| 3970 | DEBUG(printk(KERN_INFO | 4016 | DEBUG(printk(KERN_INFO |
| 3971 | "qla2x00_abort_isp(%ld): succeeded.\n", | 4017 | "qla2x00_abort_isp(%ld): succeeded.\n", |
| 3972 | vha->host_no)); | 4018 | vha->host_no)); |
| 3973 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { | 4019 | |
| 3974 | if (vp->vp_idx) | 4020 | spin_lock_irqsave(&ha->vport_slock, flags); |
| 4021 | list_for_each_entry(vp, &ha->vp_list, list) { | ||
| 4022 | if (vp->vp_idx) { | ||
| 4023 | atomic_inc(&vp->vref_count); | ||
| 4024 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 4025 | |||
| 3975 | qla2x00_vp_abort_isp(vp); | 4026 | qla2x00_vp_abort_isp(vp); |
| 4027 | |||
| 4028 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 4029 | atomic_dec(&vp->vref_count); | ||
| 4030 | } | ||
| 3976 | } | 4031 | } |
| 4032 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 4033 | |||
| 3977 | } else { | 4034 | } else { |
| 3978 | qla_printk(KERN_INFO, ha, | 4035 | qla_printk(KERN_INFO, ha, |
| 3979 | "qla2x00_abort_isp: **** FAILED ****\n"); | 4036 | "qla2x00_abort_isp: **** FAILED ****\n"); |
| @@ -5185,7 +5242,7 @@ qla82xx_restart_isp(scsi_qla_host_t *vha) | |||
| 5185 | struct req_que *req = ha->req_q_map[0]; | 5242 | struct req_que *req = ha->req_q_map[0]; |
| 5186 | struct rsp_que *rsp = ha->rsp_q_map[0]; | 5243 | struct rsp_que *rsp = ha->rsp_q_map[0]; |
| 5187 | struct scsi_qla_host *vp; | 5244 | struct scsi_qla_host *vp; |
| 5188 | struct scsi_qla_host *tvp; | 5245 | unsigned long flags; |
| 5189 | 5246 | ||
| 5190 | status = qla2x00_init_rings(vha); | 5247 | status = qla2x00_init_rings(vha); |
| 5191 | if (!status) { | 5248 | if (!status) { |
| @@ -5272,10 +5329,21 @@ qla82xx_restart_isp(scsi_qla_host_t *vha) | |||
| 5272 | DEBUG(printk(KERN_INFO | 5329 | DEBUG(printk(KERN_INFO |
| 5273 | "qla82xx_restart_isp(%ld): succeeded.\n", | 5330 | "qla82xx_restart_isp(%ld): succeeded.\n", |
| 5274 | vha->host_no)); | 5331 | vha->host_no)); |
| 5275 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { | 5332 | |
| 5276 | if (vp->vp_idx) | 5333 | spin_lock_irqsave(&ha->vport_slock, flags); |
| 5334 | list_for_each_entry(vp, &ha->vp_list, list) { | ||
| 5335 | if (vp->vp_idx) { | ||
| 5336 | atomic_inc(&vp->vref_count); | ||
| 5337 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 5338 | |||
| 5277 | qla2x00_vp_abort_isp(vp); | 5339 | qla2x00_vp_abort_isp(vp); |
| 5340 | |||
| 5341 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 5342 | atomic_dec(&vp->vref_count); | ||
| 5343 | } | ||
| 5278 | } | 5344 | } |
| 5345 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 5346 | |||
| 5279 | } else { | 5347 | } else { |
| 5280 | qla_printk(KERN_INFO, ha, | 5348 | qla_printk(KERN_INFO, ha, |
| 5281 | "qla82xx_restart_isp: **** FAILED ****\n"); | 5349 | "qla82xx_restart_isp: **** FAILED ****\n"); |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 6982ba70e12a..28f65be19dad 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
| @@ -1706,19 +1706,20 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
| 1706 | cp->result = DID_ERROR << 16; | 1706 | cp->result = DID_ERROR << 16; |
| 1707 | break; | 1707 | break; |
| 1708 | } | 1708 | } |
| 1709 | } else if (!lscsi_status) { | 1709 | } else { |
| 1710 | DEBUG2(qla_printk(KERN_INFO, ha, | 1710 | DEBUG2(qla_printk(KERN_INFO, ha, |
| 1711 | "scsi(%ld:%d:%d) Dropped frame(s) detected (0x%x " | 1711 | "scsi(%ld:%d:%d) Dropped frame(s) detected (0x%x " |
| 1712 | "of 0x%x bytes).\n", vha->host_no, cp->device->id, | 1712 | "of 0x%x bytes).\n", vha->host_no, cp->device->id, |
| 1713 | cp->device->lun, resid, scsi_bufflen(cp))); | 1713 | cp->device->lun, resid, scsi_bufflen(cp))); |
| 1714 | 1714 | ||
| 1715 | cp->result = DID_ERROR << 16; | 1715 | cp->result = DID_ERROR << 16 | lscsi_status; |
| 1716 | break; | 1716 | goto check_scsi_status; |
| 1717 | } | 1717 | } |
| 1718 | 1718 | ||
| 1719 | cp->result = DID_OK << 16 | lscsi_status; | 1719 | cp->result = DID_OK << 16 | lscsi_status; |
| 1720 | logit = 0; | 1720 | logit = 0; |
| 1721 | 1721 | ||
| 1722 | check_scsi_status: | ||
| 1722 | /* | 1723 | /* |
| 1723 | * Check to see if SCSI Status is non zero. If so report SCSI | 1724 | * Check to see if SCSI Status is non zero. If so report SCSI |
| 1724 | * Status. | 1725 | * Status. |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 6009b0c69488..a595ec8264f8 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
| @@ -2913,7 +2913,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
| 2913 | uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); | 2913 | uint16_t stat = le16_to_cpu(rptid_entry->vp_idx); |
| 2914 | struct qla_hw_data *ha = vha->hw; | 2914 | struct qla_hw_data *ha = vha->hw; |
| 2915 | scsi_qla_host_t *vp; | 2915 | scsi_qla_host_t *vp; |
| 2916 | scsi_qla_host_t *tvp; | 2916 | unsigned long flags; |
| 2917 | 2917 | ||
| 2918 | if (rptid_entry->entry_status != 0) | 2918 | if (rptid_entry->entry_status != 0) |
| 2919 | return; | 2919 | return; |
| @@ -2945,9 +2945,12 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, | |||
| 2945 | return; | 2945 | return; |
| 2946 | } | 2946 | } |
| 2947 | 2947 | ||
| 2948 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) | 2948 | spin_lock_irqsave(&ha->vport_slock, flags); |
| 2949 | list_for_each_entry(vp, &ha->vp_list, list) | ||
| 2949 | if (vp_idx == vp->vp_idx) | 2950 | if (vp_idx == vp->vp_idx) |
| 2950 | break; | 2951 | break; |
| 2952 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 2953 | |||
| 2951 | if (!vp) | 2954 | if (!vp) |
| 2952 | return; | 2955 | return; |
| 2953 | 2956 | ||
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 987c5b0ca78e..2b69392a71a1 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
| @@ -30,6 +30,7 @@ qla24xx_allocate_vp_id(scsi_qla_host_t *vha) | |||
| 30 | { | 30 | { |
| 31 | uint32_t vp_id; | 31 | uint32_t vp_id; |
| 32 | struct qla_hw_data *ha = vha->hw; | 32 | struct qla_hw_data *ha = vha->hw; |
| 33 | unsigned long flags; | ||
| 33 | 34 | ||
| 34 | /* Find an empty slot and assign an vp_id */ | 35 | /* Find an empty slot and assign an vp_id */ |
| 35 | mutex_lock(&ha->vport_lock); | 36 | mutex_lock(&ha->vport_lock); |
| @@ -44,7 +45,11 @@ qla24xx_allocate_vp_id(scsi_qla_host_t *vha) | |||
| 44 | set_bit(vp_id, ha->vp_idx_map); | 45 | set_bit(vp_id, ha->vp_idx_map); |
| 45 | ha->num_vhosts++; | 46 | ha->num_vhosts++; |
| 46 | vha->vp_idx = vp_id; | 47 | vha->vp_idx = vp_id; |
| 48 | |||
| 49 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 47 | list_add_tail(&vha->list, &ha->vp_list); | 50 | list_add_tail(&vha->list, &ha->vp_list); |
| 51 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 52 | |||
| 48 | mutex_unlock(&ha->vport_lock); | 53 | mutex_unlock(&ha->vport_lock); |
| 49 | return vp_id; | 54 | return vp_id; |
| 50 | } | 55 | } |
| @@ -54,12 +59,31 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha) | |||
| 54 | { | 59 | { |
| 55 | uint16_t vp_id; | 60 | uint16_t vp_id; |
| 56 | struct qla_hw_data *ha = vha->hw; | 61 | struct qla_hw_data *ha = vha->hw; |
| 62 | unsigned long flags = 0; | ||
| 57 | 63 | ||
| 58 | mutex_lock(&ha->vport_lock); | 64 | mutex_lock(&ha->vport_lock); |
| 65 | /* | ||
| 66 | * Wait for all pending activities to finish before removing vport from | ||
| 67 | * the list. | ||
| 68 | * Lock needs to be held for safe removal from the list (it | ||
| 69 | * ensures no active vp_list traversal while the vport is removed | ||
| 70 | * from the queue) | ||
| 71 | */ | ||
| 72 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 73 | while (atomic_read(&vha->vref_count)) { | ||
| 74 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 75 | |||
| 76 | msleep(500); | ||
| 77 | |||
| 78 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 79 | } | ||
| 80 | list_del(&vha->list); | ||
| 81 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 82 | |||
| 59 | vp_id = vha->vp_idx; | 83 | vp_id = vha->vp_idx; |
| 60 | ha->num_vhosts--; | 84 | ha->num_vhosts--; |
| 61 | clear_bit(vp_id, ha->vp_idx_map); | 85 | clear_bit(vp_id, ha->vp_idx_map); |
| 62 | list_del(&vha->list); | 86 | |
| 63 | mutex_unlock(&ha->vport_lock); | 87 | mutex_unlock(&ha->vport_lock); |
| 64 | } | 88 | } |
| 65 | 89 | ||
| @@ -68,12 +92,17 @@ qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) | |||
| 68 | { | 92 | { |
| 69 | scsi_qla_host_t *vha; | 93 | scsi_qla_host_t *vha; |
| 70 | struct scsi_qla_host *tvha; | 94 | struct scsi_qla_host *tvha; |
| 95 | unsigned long flags; | ||
| 71 | 96 | ||
| 97 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 72 | /* Locate matching device in database. */ | 98 | /* Locate matching device in database. */ |
| 73 | list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { | 99 | list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { |
| 74 | if (!memcmp(port_name, vha->port_name, WWN_SIZE)) | 100 | if (!memcmp(port_name, vha->port_name, WWN_SIZE)) { |
| 101 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 75 | return vha; | 102 | return vha; |
| 103 | } | ||
| 76 | } | 104 | } |
| 105 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 77 | return NULL; | 106 | return NULL; |
| 78 | } | 107 | } |
| 79 | 108 | ||
| @@ -93,6 +122,12 @@ qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name) | |||
| 93 | static void | 122 | static void |
| 94 | qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha) | 123 | qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha) |
| 95 | { | 124 | { |
| 125 | /* | ||
| 126 | * !!! NOTE !!! | ||
| 127 | * This function, if called in contexts other than vp create, disable | ||
| 128 | * or delete, please make sure this is synchronized with the | ||
| 129 | * delete thread. | ||
| 130 | */ | ||
| 96 | fc_port_t *fcport; | 131 | fc_port_t *fcport; |
| 97 | 132 | ||
| 98 | list_for_each_entry(fcport, &vha->vp_fcports, list) { | 133 | list_for_each_entry(fcport, &vha->vp_fcports, list) { |
| @@ -100,7 +135,6 @@ qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha) | |||
| 100 | "loop_id=0x%04x :%x\n", | 135 | "loop_id=0x%04x :%x\n", |
| 101 | vha->host_no, fcport->loop_id, fcport->vp_idx)); | 136 | vha->host_no, fcport->loop_id, fcport->vp_idx)); |
| 102 | 137 | ||
| 103 | atomic_set(&fcport->state, FCS_DEVICE_DEAD); | ||
| 104 | qla2x00_mark_device_lost(vha, fcport, 0, 0); | 138 | qla2x00_mark_device_lost(vha, fcport, 0, 0); |
| 105 | atomic_set(&fcport->state, FCS_UNCONFIGURED); | 139 | atomic_set(&fcport->state, FCS_UNCONFIGURED); |
| 106 | } | 140 | } |
| @@ -194,12 +228,17 @@ qla24xx_configure_vp(scsi_qla_host_t *vha) | |||
| 194 | void | 228 | void |
| 195 | qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) | 229 | qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) |
| 196 | { | 230 | { |
| 197 | scsi_qla_host_t *vha, *tvha; | 231 | scsi_qla_host_t *vha; |
| 198 | struct qla_hw_data *ha = rsp->hw; | 232 | struct qla_hw_data *ha = rsp->hw; |
| 199 | int i = 0; | 233 | int i = 0; |
| 234 | unsigned long flags; | ||
| 200 | 235 | ||
| 201 | list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) { | 236 | spin_lock_irqsave(&ha->vport_slock, flags); |
| 237 | list_for_each_entry(vha, &ha->vp_list, list) { | ||
| 202 | if (vha->vp_idx) { | 238 | if (vha->vp_idx) { |
| 239 | atomic_inc(&vha->vref_count); | ||
| 240 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 241 | |||
| 203 | switch (mb[0]) { | 242 | switch (mb[0]) { |
| 204 | case MBA_LIP_OCCURRED: | 243 | case MBA_LIP_OCCURRED: |
| 205 | case MBA_LOOP_UP: | 244 | case MBA_LOOP_UP: |
| @@ -215,9 +254,13 @@ qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) | |||
| 215 | qla2x00_async_event(vha, rsp, mb); | 254 | qla2x00_async_event(vha, rsp, mb); |
| 216 | break; | 255 | break; |
| 217 | } | 256 | } |
| 257 | |||
| 258 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 259 | atomic_dec(&vha->vref_count); | ||
| 218 | } | 260 | } |
| 219 | i++; | 261 | i++; |
| 220 | } | 262 | } |
| 263 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 221 | } | 264 | } |
| 222 | 265 | ||
| 223 | int | 266 | int |
| @@ -297,7 +340,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha) | |||
| 297 | int ret; | 340 | int ret; |
| 298 | struct qla_hw_data *ha = vha->hw; | 341 | struct qla_hw_data *ha = vha->hw; |
| 299 | scsi_qla_host_t *vp; | 342 | scsi_qla_host_t *vp; |
| 300 | struct scsi_qla_host *tvp; | 343 | unsigned long flags = 0; |
| 301 | 344 | ||
| 302 | if (vha->vp_idx) | 345 | if (vha->vp_idx) |
| 303 | return; | 346 | return; |
| @@ -309,10 +352,19 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha) | |||
| 309 | if (!(ha->current_topology & ISP_CFG_F)) | 352 | if (!(ha->current_topology & ISP_CFG_F)) |
| 310 | return; | 353 | return; |
| 311 | 354 | ||
| 312 | list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) { | 355 | spin_lock_irqsave(&ha->vport_slock, flags); |
| 313 | if (vp->vp_idx) | 356 | list_for_each_entry(vp, &ha->vp_list, list) { |
| 357 | if (vp->vp_idx) { | ||
| 358 | atomic_inc(&vp->vref_count); | ||
| 359 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 360 | |||
| 314 | ret = qla2x00_do_dpc_vp(vp); | 361 | ret = qla2x00_do_dpc_vp(vp); |
| 362 | |||
| 363 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 364 | atomic_dec(&vp->vref_count); | ||
| 365 | } | ||
| 315 | } | 366 | } |
| 367 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 316 | } | 368 | } |
| 317 | 369 | ||
| 318 | int | 370 | int |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 915b77a6e193..0a71cc71eab2 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
| @@ -2672,6 +2672,19 @@ qla82xx_start_scsi(srb_t *sp) | |||
| 2672 | sufficient_dsds: | 2672 | sufficient_dsds: |
| 2673 | req_cnt = 1; | 2673 | req_cnt = 1; |
| 2674 | 2674 | ||
| 2675 | if (req->cnt < (req_cnt + 2)) { | ||
| 2676 | cnt = (uint16_t)RD_REG_DWORD_RELAXED( | ||
| 2677 | ®->req_q_out[0]); | ||
| 2678 | if (req->ring_index < cnt) | ||
| 2679 | req->cnt = cnt - req->ring_index; | ||
| 2680 | else | ||
| 2681 | req->cnt = req->length - | ||
| 2682 | (req->ring_index - cnt); | ||
| 2683 | } | ||
| 2684 | |||
| 2685 | if (req->cnt < (req_cnt + 2)) | ||
| 2686 | goto queuing_error; | ||
| 2687 | |||
| 2675 | ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC); | 2688 | ctx = sp->ctx = mempool_alloc(ha->ctx_mempool, GFP_ATOMIC); |
| 2676 | if (!sp->ctx) { | 2689 | if (!sp->ctx) { |
| 2677 | DEBUG(printk(KERN_INFO | 2690 | DEBUG(printk(KERN_INFO |
| @@ -3307,16 +3320,19 @@ qla82xx_check_fw_alive(scsi_qla_host_t *vha) | |||
| 3307 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | 3320 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); |
| 3308 | } | 3321 | } |
| 3309 | qla2xxx_wake_dpc(vha); | 3322 | qla2xxx_wake_dpc(vha); |
| 3323 | ha->flags.fw_hung = 1; | ||
| 3310 | if (ha->flags.mbox_busy) { | 3324 | if (ha->flags.mbox_busy) { |
| 3311 | ha->flags.fw_hung = 1; | ||
| 3312 | ha->flags.mbox_int = 1; | 3325 | ha->flags.mbox_int = 1; |
| 3313 | DEBUG2(qla_printk(KERN_ERR, ha, | 3326 | DEBUG2(qla_printk(KERN_ERR, ha, |
| 3314 | "Due to fw hung, doing premature " | 3327 | "Due to fw hung, doing premature " |
| 3315 | "completion of mbx command\n")); | 3328 | "completion of mbx command\n")); |
| 3316 | complete(&ha->mbx_intr_comp); | 3329 | if (test_bit(MBX_INTR_WAIT, |
| 3330 | &ha->mbx_cmd_flags)) | ||
| 3331 | complete(&ha->mbx_intr_comp); | ||
| 3317 | } | 3332 | } |
| 3318 | } | 3333 | } |
| 3319 | } | 3334 | } else |
| 3335 | vha->seconds_since_last_heartbeat = 0; | ||
| 3320 | vha->fw_heartbeat_counter = fw_heartbeat_counter; | 3336 | vha->fw_heartbeat_counter = fw_heartbeat_counter; |
| 3321 | } | 3337 | } |
| 3322 | 3338 | ||
| @@ -3418,13 +3434,15 @@ void qla82xx_watchdog(scsi_qla_host_t *vha) | |||
| 3418 | "%s(): Adapter reset needed!\n", __func__); | 3434 | "%s(): Adapter reset needed!\n", __func__); |
| 3419 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); | 3435 | set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); |
| 3420 | qla2xxx_wake_dpc(vha); | 3436 | qla2xxx_wake_dpc(vha); |
| 3437 | ha->flags.fw_hung = 1; | ||
| 3421 | if (ha->flags.mbox_busy) { | 3438 | if (ha->flags.mbox_busy) { |
| 3422 | ha->flags.fw_hung = 1; | ||
| 3423 | ha->flags.mbox_int = 1; | 3439 | ha->flags.mbox_int = 1; |
| 3424 | DEBUG2(qla_printk(KERN_ERR, ha, | 3440 | DEBUG2(qla_printk(KERN_ERR, ha, |
| 3425 | "Need reset, doing premature " | 3441 | "Need reset, doing premature " |
| 3426 | "completion of mbx command\n")); | 3442 | "completion of mbx command\n")); |
| 3427 | complete(&ha->mbx_intr_comp); | 3443 | if (test_bit(MBX_INTR_WAIT, |
| 3444 | &ha->mbx_cmd_flags)) | ||
| 3445 | complete(&ha->mbx_intr_comp); | ||
| 3428 | } | 3446 | } |
| 3429 | } else { | 3447 | } else { |
| 3430 | qla82xx_check_fw_alive(vha); | 3448 | qla82xx_check_fw_alive(vha); |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 8c80b49ac1c4..1e4bff695254 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -2341,16 +2341,28 @@ probe_out: | |||
| 2341 | static void | 2341 | static void |
| 2342 | qla2x00_remove_one(struct pci_dev *pdev) | 2342 | qla2x00_remove_one(struct pci_dev *pdev) |
| 2343 | { | 2343 | { |
| 2344 | scsi_qla_host_t *base_vha, *vha, *temp; | 2344 | scsi_qla_host_t *base_vha, *vha; |
| 2345 | struct qla_hw_data *ha; | 2345 | struct qla_hw_data *ha; |
| 2346 | unsigned long flags; | ||
| 2346 | 2347 | ||
| 2347 | base_vha = pci_get_drvdata(pdev); | 2348 | base_vha = pci_get_drvdata(pdev); |
| 2348 | ha = base_vha->hw; | 2349 | ha = base_vha->hw; |
| 2349 | 2350 | ||
| 2350 | list_for_each_entry_safe(vha, temp, &ha->vp_list, list) { | 2351 | spin_lock_irqsave(&ha->vport_slock, flags); |
| 2351 | if (vha && vha->fc_vport) | 2352 | list_for_each_entry(vha, &ha->vp_list, list) { |
| 2353 | atomic_inc(&vha->vref_count); | ||
| 2354 | |||
| 2355 | if (vha && vha->fc_vport) { | ||
| 2356 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 2357 | |||
| 2352 | fc_vport_terminate(vha->fc_vport); | 2358 | fc_vport_terminate(vha->fc_vport); |
| 2359 | |||
| 2360 | spin_lock_irqsave(&ha->vport_slock, flags); | ||
| 2361 | } | ||
| 2362 | |||
| 2363 | atomic_dec(&vha->vref_count); | ||
| 2353 | } | 2364 | } |
| 2365 | spin_unlock_irqrestore(&ha->vport_slock, flags); | ||
| 2354 | 2366 | ||
| 2355 | set_bit(UNLOADING, &base_vha->dpc_flags); | 2367 | set_bit(UNLOADING, &base_vha->dpc_flags); |
| 2356 | 2368 | ||
| @@ -2975,10 +2987,17 @@ static struct qla_work_evt * | |||
| 2975 | qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) | 2987 | qla2x00_alloc_work(struct scsi_qla_host *vha, enum qla_work_type type) |
| 2976 | { | 2988 | { |
| 2977 | struct qla_work_evt *e; | 2989 | struct qla_work_evt *e; |
| 2990 | uint8_t bail; | ||
| 2991 | |||
| 2992 | QLA_VHA_MARK_BUSY(vha, bail); | ||
| 2993 | if (bail) | ||
| 2994 | return NULL; | ||
| 2978 | 2995 | ||
| 2979 | e = kzalloc(sizeof(struct qla_work_evt), GFP_ATOMIC); | 2996 | e = kzalloc(sizeof(struct qla_work_evt), GFP_ATOMIC); |
| 2980 | if (!e) | 2997 | if (!e) { |
| 2998 | QLA_VHA_MARK_NOT_BUSY(vha); | ||
| 2981 | return NULL; | 2999 | return NULL; |
| 3000 | } | ||
| 2982 | 3001 | ||
| 2983 | INIT_LIST_HEAD(&e->list); | 3002 | INIT_LIST_HEAD(&e->list); |
| 2984 | e->type = type; | 3003 | e->type = type; |
| @@ -3135,6 +3154,9 @@ qla2x00_do_work(struct scsi_qla_host *vha) | |||
| 3135 | } | 3154 | } |
| 3136 | if (e->flags & QLA_EVT_FLAG_FREE) | 3155 | if (e->flags & QLA_EVT_FLAG_FREE) |
| 3137 | kfree(e); | 3156 | kfree(e); |
| 3157 | |||
| 3158 | /* For each work completed decrement vha ref count */ | ||
| 3159 | QLA_VHA_MARK_NOT_BUSY(vha); | ||
| 3138 | } | 3160 | } |
| 3139 | } | 3161 | } |
| 3140 | 3162 | ||
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index e75ccb91317d..8edbccb3232d 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | /* | 7 | /* |
| 8 | * Driver version | 8 | * Driver version |
| 9 | */ | 9 | */ |
| 10 | #define QLA2XXX_VERSION "8.03.03-k0" | 10 | #define QLA2XXX_VERSION "8.03.04-k0" |
| 11 | 11 | ||
| 12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
| 13 | #define QLA_DRIVER_MINOR_VER 3 | 13 | #define QLA_DRIVER_MINOR_VER 3 |
| 14 | #define QLA_DRIVER_PATCH_VER 3 | 14 | #define QLA_DRIVER_PATCH_VER 4 |
| 15 | #define QLA_DRIVER_BETA_VER 0 | 15 | #define QLA_DRIVER_BETA_VER 0 |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 9ade720422c6..ee02d3838a0a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -1011,8 +1011,8 @@ int scsi_init_io(struct scsi_cmnd *cmd, gfp_t gfp_mask) | |||
| 1011 | 1011 | ||
| 1012 | err_exit: | 1012 | err_exit: |
| 1013 | scsi_release_buffers(cmd); | 1013 | scsi_release_buffers(cmd); |
| 1014 | scsi_put_command(cmd); | ||
| 1015 | cmd->request->special = NULL; | 1014 | cmd->request->special = NULL; |
| 1015 | scsi_put_command(cmd); | ||
| 1016 | return error; | 1016 | return error; |
| 1017 | } | 1017 | } |
| 1018 | EXPORT_SYMBOL(scsi_init_io); | 1018 | EXPORT_SYMBOL(scsi_init_io); |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 2714becc2eaf..ffa0689ee840 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
| @@ -870,7 +870,7 @@ static int sd_release(struct gendisk *disk, fmode_t mode) | |||
| 870 | 870 | ||
| 871 | SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_release\n")); | 871 | SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, "sd_release\n")); |
| 872 | 872 | ||
| 873 | if (atomic_dec_return(&sdkp->openers) && sdev->removable) { | 873 | if (atomic_dec_return(&sdkp->openers) == 0 && sdev->removable) { |
| 874 | if (scsi_block_when_processing_errors(sdev)) | 874 | if (scsi_block_when_processing_errors(sdev)) |
| 875 | scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); | 875 | scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); |
| 876 | } | 876 | } |
| @@ -2625,15 +2625,15 @@ module_exit(exit_sd); | |||
| 2625 | static void sd_print_sense_hdr(struct scsi_disk *sdkp, | 2625 | static void sd_print_sense_hdr(struct scsi_disk *sdkp, |
| 2626 | struct scsi_sense_hdr *sshdr) | 2626 | struct scsi_sense_hdr *sshdr) |
| 2627 | { | 2627 | { |
| 2628 | sd_printk(KERN_INFO, sdkp, ""); | 2628 | sd_printk(KERN_INFO, sdkp, " "); |
| 2629 | scsi_show_sense_hdr(sshdr); | 2629 | scsi_show_sense_hdr(sshdr); |
| 2630 | sd_printk(KERN_INFO, sdkp, ""); | 2630 | sd_printk(KERN_INFO, sdkp, " "); |
| 2631 | scsi_show_extd_sense(sshdr->asc, sshdr->ascq); | 2631 | scsi_show_extd_sense(sshdr->asc, sshdr->ascq); |
| 2632 | } | 2632 | } |
| 2633 | 2633 | ||
| 2634 | static void sd_print_result(struct scsi_disk *sdkp, int result) | 2634 | static void sd_print_result(struct scsi_disk *sdkp, int result) |
| 2635 | { | 2635 | { |
| 2636 | sd_printk(KERN_INFO, sdkp, ""); | 2636 | sd_printk(KERN_INFO, sdkp, " "); |
| 2637 | scsi_show_result(result); | 2637 | scsi_show_result(result); |
| 2638 | } | 2638 | } |
| 2639 | 2639 | ||
diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index a7bc8b7b09ac..2c3e89ddf069 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c | |||
| @@ -72,10 +72,7 @@ static void sym_printl_hex(u_char *p, int n) | |||
| 72 | 72 | ||
| 73 | static void sym_print_msg(struct sym_ccb *cp, char *label, u_char *msg) | 73 | static void sym_print_msg(struct sym_ccb *cp, char *label, u_char *msg) |
| 74 | { | 74 | { |
| 75 | if (label) | 75 | sym_print_addr(cp->cmd, "%s: ", label); |
| 76 | sym_print_addr(cp->cmd, "%s: ", label); | ||
| 77 | else | ||
| 78 | sym_print_addr(cp->cmd, ""); | ||
| 79 | 76 | ||
| 80 | spi_print_msg(msg); | 77 | spi_print_msg(msg); |
| 81 | printf("\n"); | 78 | printf("\n"); |
| @@ -4558,7 +4555,8 @@ static void sym_int_sir(struct sym_hcb *np) | |||
| 4558 | switch (np->msgin [2]) { | 4555 | switch (np->msgin [2]) { |
| 4559 | case M_X_MODIFY_DP: | 4556 | case M_X_MODIFY_DP: |
| 4560 | if (DEBUG_FLAGS & DEBUG_POINTER) | 4557 | if (DEBUG_FLAGS & DEBUG_POINTER) |
| 4561 | sym_print_msg(cp, NULL, np->msgin); | 4558 | sym_print_msg(cp, "extended msg ", |
| 4559 | np->msgin); | ||
| 4562 | tmp = (np->msgin[3]<<24) + (np->msgin[4]<<16) + | 4560 | tmp = (np->msgin[3]<<24) + (np->msgin[4]<<16) + |
| 4563 | (np->msgin[5]<<8) + (np->msgin[6]); | 4561 | (np->msgin[5]<<8) + (np->msgin[6]); |
| 4564 | sym_modify_dp(np, tp, cp, tmp); | 4562 | sym_modify_dp(np, tp, cp, tmp); |
| @@ -4585,7 +4583,7 @@ static void sym_int_sir(struct sym_hcb *np) | |||
| 4585 | */ | 4583 | */ |
| 4586 | case M_IGN_RESIDUE: | 4584 | case M_IGN_RESIDUE: |
| 4587 | if (DEBUG_FLAGS & DEBUG_POINTER) | 4585 | if (DEBUG_FLAGS & DEBUG_POINTER) |
| 4588 | sym_print_msg(cp, NULL, np->msgin); | 4586 | sym_print_msg(cp, "1 or 2 byte ", np->msgin); |
| 4589 | if (cp->host_flags & HF_SENSE) | 4587 | if (cp->host_flags & HF_SENSE) |
| 4590 | OUTL_DSP(np, SCRIPTA_BA(np, clrack)); | 4588 | OUTL_DSP(np, SCRIPTA_BA(np, clrack)); |
| 4591 | else | 4589 | else |
diff --git a/drivers/serial/bfin_sport_uart.c b/drivers/serial/bfin_sport_uart.c index e57fb3d228e2..5318dd3774ae 100644 --- a/drivers/serial/bfin_sport_uart.c +++ b/drivers/serial/bfin_sport_uart.c | |||
| @@ -121,7 +121,7 @@ static int sport_uart_setup(struct sport_uart_port *up, int size, int baud_rate) | |||
| 121 | unsigned int sclk = get_sclk(); | 121 | unsigned int sclk = get_sclk(); |
| 122 | 122 | ||
| 123 | /* Set TCR1 and TCR2, TFSR is not enabled for uart */ | 123 | /* Set TCR1 and TCR2, TFSR is not enabled for uart */ |
| 124 | SPORT_PUT_TCR1(up, (ITFS | TLSBIT | ITCLK)); | 124 | SPORT_PUT_TCR1(up, (LATFS | ITFS | TFSR | TLSBIT | ITCLK)); |
| 125 | SPORT_PUT_TCR2(up, size + 1); | 125 | SPORT_PUT_TCR2(up, size + 1); |
| 126 | pr_debug("%s TCR1:%x, TCR2:%x\n", __func__, SPORT_GET_TCR1(up), SPORT_GET_TCR2(up)); | 126 | pr_debug("%s TCR1:%x, TCR2:%x\n", __func__, SPORT_GET_TCR1(up), SPORT_GET_TCR2(up)); |
| 127 | 127 | ||
diff --git a/drivers/serial/mpc52xx_uart.c b/drivers/serial/mpc52xx_uart.c index 8dedb266f143..c4399e23565a 100644 --- a/drivers/serial/mpc52xx_uart.c +++ b/drivers/serial/mpc52xx_uart.c | |||
| @@ -500,6 +500,7 @@ static int __init mpc512x_psc_fifoc_init(void) | |||
| 500 | psc_fifoc = of_iomap(np, 0); | 500 | psc_fifoc = of_iomap(np, 0); |
| 501 | if (!psc_fifoc) { | 501 | if (!psc_fifoc) { |
| 502 | pr_err("%s: Can't map FIFOC\n", __func__); | 502 | pr_err("%s: Can't map FIFOC\n", __func__); |
| 503 | of_node_put(np); | ||
| 503 | return -ENODEV; | 504 | return -ENODEV; |
| 504 | } | 505 | } |
| 505 | 506 | ||
diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 7e5e5efea4e2..cff9a306660f 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c | |||
| @@ -492,7 +492,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags) | |||
| 492 | sysrq_requested = 0; | 492 | sysrq_requested = 0; |
| 493 | if (ch && time_before(jiffies, sysrq_timeout)) { | 493 | if (ch && time_before(jiffies, sysrq_timeout)) { |
| 494 | spin_unlock_irqrestore(&port->sc_port.lock, flags); | 494 | spin_unlock_irqrestore(&port->sc_port.lock, flags); |
| 495 | handle_sysrq(ch, NULL); | 495 | handle_sysrq(ch); |
| 496 | spin_lock_irqsave(&port->sc_port.lock, flags); | 496 | spin_lock_irqsave(&port->sc_port.lock, flags); |
| 497 | /* ignore actual sysrq command char */ | 497 | /* ignore actual sysrq command char */ |
| 498 | continue; | 498 | continue; |
diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c index acd35d1ebd12..4c37c4e28647 100644 --- a/drivers/spi/amba-pl022.c +++ b/drivers/spi/amba-pl022.c | |||
| @@ -503,8 +503,9 @@ static void giveback(struct pl022 *pl022) | |||
| 503 | msg->state = NULL; | 503 | msg->state = NULL; |
| 504 | if (msg->complete) | 504 | if (msg->complete) |
| 505 | msg->complete(msg->context); | 505 | msg->complete(msg->context); |
| 506 | /* This message is completed, so let's turn off the clock! */ | 506 | /* This message is completed, so let's turn off the clocks! */ |
| 507 | clk_disable(pl022->clk); | 507 | clk_disable(pl022->clk); |
| 508 | amba_pclk_disable(pl022->adev); | ||
| 508 | } | 509 | } |
| 509 | 510 | ||
| 510 | /** | 511 | /** |
| @@ -1139,9 +1140,10 @@ static void pump_messages(struct work_struct *work) | |||
| 1139 | /* Setup the SPI using the per chip configuration */ | 1140 | /* Setup the SPI using the per chip configuration */ |
| 1140 | pl022->cur_chip = spi_get_ctldata(pl022->cur_msg->spi); | 1141 | pl022->cur_chip = spi_get_ctldata(pl022->cur_msg->spi); |
| 1141 | /* | 1142 | /* |
| 1142 | * We enable the clock here, then the clock will be disabled when | 1143 | * We enable the clocks here, then the clocks will be disabled when |
| 1143 | * giveback() is called in each method (poll/interrupt/DMA) | 1144 | * giveback() is called in each method (poll/interrupt/DMA) |
| 1144 | */ | 1145 | */ |
| 1146 | amba_pclk_enable(pl022->adev); | ||
| 1145 | clk_enable(pl022->clk); | 1147 | clk_enable(pl022->clk); |
| 1146 | restore_state(pl022); | 1148 | restore_state(pl022); |
| 1147 | flush(pl022); | 1149 | flush(pl022); |
| @@ -1786,11 +1788,9 @@ pl022_probe(struct amba_device *adev, struct amba_id *id) | |||
| 1786 | } | 1788 | } |
| 1787 | 1789 | ||
| 1788 | /* Disable SSP */ | 1790 | /* Disable SSP */ |
| 1789 | clk_enable(pl022->clk); | ||
| 1790 | writew((readw(SSP_CR1(pl022->virtbase)) & (~SSP_CR1_MASK_SSE)), | 1791 | writew((readw(SSP_CR1(pl022->virtbase)) & (~SSP_CR1_MASK_SSE)), |
| 1791 | SSP_CR1(pl022->virtbase)); | 1792 | SSP_CR1(pl022->virtbase)); |
| 1792 | load_ssp_default_config(pl022); | 1793 | load_ssp_default_config(pl022); |
| 1793 | clk_disable(pl022->clk); | ||
| 1794 | 1794 | ||
| 1795 | status = request_irq(adev->irq[0], pl022_interrupt_handler, 0, "pl022", | 1795 | status = request_irq(adev->irq[0], pl022_interrupt_handler, 0, "pl022", |
| 1796 | pl022); | 1796 | pl022); |
| @@ -1818,6 +1818,8 @@ pl022_probe(struct amba_device *adev, struct amba_id *id) | |||
| 1818 | goto err_spi_register; | 1818 | goto err_spi_register; |
| 1819 | } | 1819 | } |
| 1820 | dev_dbg(dev, "probe succeded\n"); | 1820 | dev_dbg(dev, "probe succeded\n"); |
| 1821 | /* Disable the silicon block pclk and clock it when needed */ | ||
| 1822 | amba_pclk_disable(adev); | ||
| 1821 | return 0; | 1823 | return 0; |
| 1822 | 1824 | ||
| 1823 | err_spi_register: | 1825 | err_spi_register: |
| @@ -1879,9 +1881,9 @@ static int pl022_suspend(struct amba_device *adev, pm_message_t state) | |||
| 1879 | return status; | 1881 | return status; |
| 1880 | } | 1882 | } |
| 1881 | 1883 | ||
| 1882 | clk_enable(pl022->clk); | 1884 | amba_pclk_enable(adev); |
| 1883 | load_ssp_default_config(pl022); | 1885 | load_ssp_default_config(pl022); |
| 1884 | clk_disable(pl022->clk); | 1886 | amba_pclk_disable(adev); |
| 1885 | dev_dbg(&adev->dev, "suspended\n"); | 1887 | dev_dbg(&adev->dev, "suspended\n"); |
| 1886 | return 0; | 1888 | return 0; |
| 1887 | } | 1889 | } |
| @@ -1981,7 +1983,7 @@ static int __init pl022_init(void) | |||
| 1981 | return amba_driver_register(&pl022_driver); | 1983 | return amba_driver_register(&pl022_driver); |
| 1982 | } | 1984 | } |
| 1983 | 1985 | ||
| 1984 | module_init(pl022_init); | 1986 | subsys_initcall(pl022_init); |
| 1985 | 1987 | ||
| 1986 | static void __exit pl022_exit(void) | 1988 | static void __exit pl022_exit(void) |
| 1987 | { | 1989 | { |
diff --git a/drivers/spi/dw_spi.c b/drivers/spi/dw_spi.c index d256cb00604c..56247853c298 100644 --- a/drivers/spi/dw_spi.c +++ b/drivers/spi/dw_spi.c | |||
| @@ -181,10 +181,6 @@ static void flush(struct dw_spi *dws) | |||
| 181 | wait_till_not_busy(dws); | 181 | wait_till_not_busy(dws); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | static void null_cs_control(u32 command) | ||
| 185 | { | ||
| 186 | } | ||
| 187 | |||
| 188 | static int null_writer(struct dw_spi *dws) | 184 | static int null_writer(struct dw_spi *dws) |
| 189 | { | 185 | { |
| 190 | u8 n_bytes = dws->n_bytes; | 186 | u8 n_bytes = dws->n_bytes; |
| @@ -322,7 +318,7 @@ static void giveback(struct dw_spi *dws) | |||
| 322 | struct spi_transfer, | 318 | struct spi_transfer, |
| 323 | transfer_list); | 319 | transfer_list); |
| 324 | 320 | ||
| 325 | if (!last_transfer->cs_change) | 321 | if (!last_transfer->cs_change && dws->cs_control) |
| 326 | dws->cs_control(MRST_SPI_DEASSERT); | 322 | dws->cs_control(MRST_SPI_DEASSERT); |
| 327 | 323 | ||
| 328 | msg->state = NULL; | 324 | msg->state = NULL; |
| @@ -396,6 +392,11 @@ static irqreturn_t interrupt_transfer(struct dw_spi *dws) | |||
| 396 | static irqreturn_t dw_spi_irq(int irq, void *dev_id) | 392 | static irqreturn_t dw_spi_irq(int irq, void *dev_id) |
| 397 | { | 393 | { |
| 398 | struct dw_spi *dws = dev_id; | 394 | struct dw_spi *dws = dev_id; |
| 395 | u16 irq_status, irq_mask = 0x3f; | ||
| 396 | |||
| 397 | irq_status = dw_readw(dws, isr) & irq_mask; | ||
| 398 | if (!irq_status) | ||
| 399 | return IRQ_NONE; | ||
| 399 | 400 | ||
| 400 | if (!dws->cur_msg) { | 401 | if (!dws->cur_msg) { |
| 401 | spi_mask_intr(dws, SPI_INT_TXEI); | 402 | spi_mask_intr(dws, SPI_INT_TXEI); |
| @@ -544,13 +545,13 @@ static void pump_transfers(unsigned long data) | |||
| 544 | */ | 545 | */ |
| 545 | if (dws->cs_control) { | 546 | if (dws->cs_control) { |
| 546 | if (dws->rx && dws->tx) | 547 | if (dws->rx && dws->tx) |
| 547 | chip->tmode = 0x00; | 548 | chip->tmode = SPI_TMOD_TR; |
| 548 | else if (dws->rx) | 549 | else if (dws->rx) |
| 549 | chip->tmode = 0x02; | 550 | chip->tmode = SPI_TMOD_RO; |
| 550 | else | 551 | else |
| 551 | chip->tmode = 0x01; | 552 | chip->tmode = SPI_TMOD_TO; |
| 552 | 553 | ||
| 553 | cr0 &= ~(0x3 << SPI_MODE_OFFSET); | 554 | cr0 &= ~SPI_TMOD_MASK; |
| 554 | cr0 |= (chip->tmode << SPI_TMOD_OFFSET); | 555 | cr0 |= (chip->tmode << SPI_TMOD_OFFSET); |
| 555 | } | 556 | } |
| 556 | 557 | ||
| @@ -699,9 +700,6 @@ static int dw_spi_setup(struct spi_device *spi) | |||
| 699 | chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); | 700 | chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); |
| 700 | if (!chip) | 701 | if (!chip) |
| 701 | return -ENOMEM; | 702 | return -ENOMEM; |
| 702 | |||
| 703 | chip->cs_control = null_cs_control; | ||
| 704 | chip->enable_dma = 0; | ||
| 705 | } | 703 | } |
| 706 | 704 | ||
| 707 | /* | 705 | /* |
| @@ -883,7 +881,7 @@ int __devinit dw_spi_add_host(struct dw_spi *dws) | |||
| 883 | dws->dma_inited = 0; | 881 | dws->dma_inited = 0; |
| 884 | dws->dma_addr = (dma_addr_t)(dws->paddr + 0x60); | 882 | dws->dma_addr = (dma_addr_t)(dws->paddr + 0x60); |
| 885 | 883 | ||
| 886 | ret = request_irq(dws->irq, dw_spi_irq, 0, | 884 | ret = request_irq(dws->irq, dw_spi_irq, IRQF_SHARED, |
| 887 | "dw_spi", dws); | 885 | "dw_spi", dws); |
| 888 | if (ret < 0) { | 886 | if (ret < 0) { |
| 889 | dev_err(&master->dev, "can not get IRQ\n"); | 887 | dev_err(&master->dev, "can not get IRQ\n"); |
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index a9e5c79ae52a..0bcf4c1601a2 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
| @@ -554,11 +554,9 @@ done: | |||
| 554 | EXPORT_SYMBOL_GPL(spi_register_master); | 554 | EXPORT_SYMBOL_GPL(spi_register_master); |
| 555 | 555 | ||
| 556 | 556 | ||
| 557 | static int __unregister(struct device *dev, void *master_dev) | 557 | static int __unregister(struct device *dev, void *null) |
| 558 | { | 558 | { |
| 559 | /* note: before about 2.6.14-rc1 this would corrupt memory: */ | 559 | spi_unregister_device(to_spi_device(dev)); |
| 560 | if (dev != master_dev) | ||
| 561 | spi_unregister_device(to_spi_device(dev)); | ||
| 562 | return 0; | 560 | return 0; |
| 563 | } | 561 | } |
| 564 | 562 | ||
| @@ -576,8 +574,7 @@ void spi_unregister_master(struct spi_master *master) | |||
| 576 | { | 574 | { |
| 577 | int dummy; | 575 | int dummy; |
| 578 | 576 | ||
| 579 | dummy = device_for_each_child(master->dev.parent, &master->dev, | 577 | dummy = device_for_each_child(&master->dev, NULL, __unregister); |
| 580 | __unregister); | ||
| 581 | device_unregister(&master->dev); | 578 | device_unregister(&master->dev); |
| 582 | } | 579 | } |
| 583 | EXPORT_SYMBOL_GPL(spi_unregister_master); | 580 | EXPORT_SYMBOL_GPL(spi_unregister_master); |
diff --git a/drivers/spi/spi_s3c64xx.c b/drivers/spi/spi_s3c64xx.c index 97365815a729..c3038da2648a 100644 --- a/drivers/spi/spi_s3c64xx.c +++ b/drivers/spi/spi_s3c64xx.c | |||
| @@ -200,6 +200,9 @@ static void flush_fifo(struct s3c64xx_spi_driver_data *sdd) | |||
| 200 | val = readl(regs + S3C64XX_SPI_STATUS); | 200 | val = readl(regs + S3C64XX_SPI_STATUS); |
| 201 | } while (TX_FIFO_LVL(val, sci) && loops--); | 201 | } while (TX_FIFO_LVL(val, sci) && loops--); |
| 202 | 202 | ||
| 203 | if (loops == 0) | ||
| 204 | dev_warn(&sdd->pdev->dev, "Timed out flushing TX FIFO\n"); | ||
| 205 | |||
| 203 | /* Flush RxFIFO*/ | 206 | /* Flush RxFIFO*/ |
| 204 | loops = msecs_to_loops(1); | 207 | loops = msecs_to_loops(1); |
| 205 | do { | 208 | do { |
| @@ -210,6 +213,9 @@ static void flush_fifo(struct s3c64xx_spi_driver_data *sdd) | |||
| 210 | break; | 213 | break; |
| 211 | } while (loops--); | 214 | } while (loops--); |
| 212 | 215 | ||
| 216 | if (loops == 0) | ||
| 217 | dev_warn(&sdd->pdev->dev, "Timed out flushing RX FIFO\n"); | ||
| 218 | |||
| 213 | val = readl(regs + S3C64XX_SPI_CH_CFG); | 219 | val = readl(regs + S3C64XX_SPI_CH_CFG); |
| 214 | val &= ~S3C64XX_SPI_CH_SW_RST; | 220 | val &= ~S3C64XX_SPI_CH_SW_RST; |
| 215 | writel(val, regs + S3C64XX_SPI_CH_CFG); | 221 | writel(val, regs + S3C64XX_SPI_CH_CFG); |
| @@ -320,16 +326,17 @@ static int wait_for_xfer(struct s3c64xx_spi_driver_data *sdd, | |||
| 320 | 326 | ||
| 321 | /* millisecs to xfer 'len' bytes @ 'cur_speed' */ | 327 | /* millisecs to xfer 'len' bytes @ 'cur_speed' */ |
| 322 | ms = xfer->len * 8 * 1000 / sdd->cur_speed; | 328 | ms = xfer->len * 8 * 1000 / sdd->cur_speed; |
| 323 | ms += 5; /* some tolerance */ | 329 | ms += 10; /* some tolerance */ |
| 324 | 330 | ||
| 325 | if (dma_mode) { | 331 | if (dma_mode) { |
| 326 | val = msecs_to_jiffies(ms) + 10; | 332 | val = msecs_to_jiffies(ms) + 10; |
| 327 | val = wait_for_completion_timeout(&sdd->xfer_completion, val); | 333 | val = wait_for_completion_timeout(&sdd->xfer_completion, val); |
| 328 | } else { | 334 | } else { |
| 335 | u32 status; | ||
| 329 | val = msecs_to_loops(ms); | 336 | val = msecs_to_loops(ms); |
| 330 | do { | 337 | do { |
| 331 | val = readl(regs + S3C64XX_SPI_STATUS); | 338 | status = readl(regs + S3C64XX_SPI_STATUS); |
| 332 | } while (RX_FIFO_LVL(val, sci) < xfer->len && --val); | 339 | } while (RX_FIFO_LVL(status, sci) < xfer->len && --val); |
| 333 | } | 340 | } |
| 334 | 341 | ||
| 335 | if (!val) | 342 | if (!val) |
| @@ -447,8 +454,8 @@ static void s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) | |||
| 447 | writel(val, regs + S3C64XX_SPI_CLK_CFG); | 454 | writel(val, regs + S3C64XX_SPI_CLK_CFG); |
| 448 | } | 455 | } |
| 449 | 456 | ||
| 450 | void s3c64xx_spi_dma_rxcb(struct s3c2410_dma_chan *chan, void *buf_id, | 457 | static void s3c64xx_spi_dma_rxcb(struct s3c2410_dma_chan *chan, void *buf_id, |
| 451 | int size, enum s3c2410_dma_buffresult res) | 458 | int size, enum s3c2410_dma_buffresult res) |
| 452 | { | 459 | { |
| 453 | struct s3c64xx_spi_driver_data *sdd = buf_id; | 460 | struct s3c64xx_spi_driver_data *sdd = buf_id; |
| 454 | unsigned long flags; | 461 | unsigned long flags; |
| @@ -467,8 +474,8 @@ void s3c64xx_spi_dma_rxcb(struct s3c2410_dma_chan *chan, void *buf_id, | |||
| 467 | spin_unlock_irqrestore(&sdd->lock, flags); | 474 | spin_unlock_irqrestore(&sdd->lock, flags); |
| 468 | } | 475 | } |
| 469 | 476 | ||
| 470 | void s3c64xx_spi_dma_txcb(struct s3c2410_dma_chan *chan, void *buf_id, | 477 | static void s3c64xx_spi_dma_txcb(struct s3c2410_dma_chan *chan, void *buf_id, |
| 471 | int size, enum s3c2410_dma_buffresult res) | 478 | int size, enum s3c2410_dma_buffresult res) |
| 472 | { | 479 | { |
| 473 | struct s3c64xx_spi_driver_data *sdd = buf_id; | 480 | struct s3c64xx_spi_driver_data *sdd = buf_id; |
| 474 | unsigned long flags; | 481 | unsigned long flags; |
| @@ -508,8 +515,9 @@ static int s3c64xx_spi_map_mssg(struct s3c64xx_spi_driver_data *sdd, | |||
| 508 | list_for_each_entry(xfer, &msg->transfers, transfer_list) { | 515 | list_for_each_entry(xfer, &msg->transfers, transfer_list) { |
| 509 | 516 | ||
| 510 | if (xfer->tx_buf != NULL) { | 517 | if (xfer->tx_buf != NULL) { |
| 511 | xfer->tx_dma = dma_map_single(dev, xfer->tx_buf, | 518 | xfer->tx_dma = dma_map_single(dev, |
| 512 | xfer->len, DMA_TO_DEVICE); | 519 | (void *)xfer->tx_buf, xfer->len, |
| 520 | DMA_TO_DEVICE); | ||
| 513 | if (dma_mapping_error(dev, xfer->tx_dma)) { | 521 | if (dma_mapping_error(dev, xfer->tx_dma)) { |
| 514 | dev_err(dev, "dma_map_single Tx failed\n"); | 522 | dev_err(dev, "dma_map_single Tx failed\n"); |
| 515 | xfer->tx_dma = XFER_DMAADDR_INVALID; | 523 | xfer->tx_dma = XFER_DMAADDR_INVALID; |
| @@ -919,6 +927,13 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) | |||
| 919 | return -ENODEV; | 927 | return -ENODEV; |
| 920 | } | 928 | } |
| 921 | 929 | ||
| 930 | sci = pdev->dev.platform_data; | ||
| 931 | if (!sci->src_clk_name) { | ||
| 932 | dev_err(&pdev->dev, | ||
| 933 | "Board init must call s3c64xx_spi_set_info()\n"); | ||
| 934 | return -EINVAL; | ||
| 935 | } | ||
| 936 | |||
| 922 | /* Check for availability of necessary resource */ | 937 | /* Check for availability of necessary resource */ |
| 923 | 938 | ||
| 924 | dmatx_res = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 939 | dmatx_res = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
| @@ -946,8 +961,6 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev) | |||
| 946 | return -ENOMEM; | 961 | return -ENOMEM; |
| 947 | } | 962 | } |
| 948 | 963 | ||
| 949 | sci = pdev->dev.platform_data; | ||
| 950 | |||
| 951 | platform_set_drvdata(pdev, master); | 964 | platform_set_drvdata(pdev, master); |
| 952 | 965 | ||
| 953 | sdd = spi_master_get_devdata(master); | 966 | sdd = spi_master_get_devdata(master); |
| @@ -1170,7 +1183,7 @@ static int __init s3c64xx_spi_init(void) | |||
| 1170 | { | 1183 | { |
| 1171 | return platform_driver_probe(&s3c64xx_spi_driver, s3c64xx_spi_probe); | 1184 | return platform_driver_probe(&s3c64xx_spi_driver, s3c64xx_spi_probe); |
| 1172 | } | 1185 | } |
| 1173 | module_init(s3c64xx_spi_init); | 1186 | subsys_initcall(s3c64xx_spi_init); |
| 1174 | 1187 | ||
| 1175 | static void __exit s3c64xx_spi_exit(void) | 1188 | static void __exit s3c64xx_spi_exit(void) |
| 1176 | { | 1189 | { |
diff --git a/drivers/staging/comedi/drivers/das08_cs.c b/drivers/staging/comedi/drivers/das08_cs.c index c6aa52f8dcee..48d9fb1227df 100644 --- a/drivers/staging/comedi/drivers/das08_cs.c +++ b/drivers/staging/comedi/drivers/das08_cs.c | |||
| @@ -222,7 +222,6 @@ static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev, | |||
| 222 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; | 222 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
| 223 | p_dev->resource[0]->flags |= | 223 | p_dev->resource[0]->flags |= |
| 224 | pcmcia_io_cfg_data_width(io->flags); | 224 | pcmcia_io_cfg_data_width(io->flags); |
| 225 | p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | ||
| 226 | p_dev->resource[0]->start = io->win[0].base; | 225 | p_dev->resource[0]->start = io->win[0].base; |
| 227 | p_dev->resource[0]->end = io->win[0].len; | 226 | p_dev->resource[0]->end = io->win[0].len; |
| 228 | if (io->nwin > 1) { | 227 | if (io->nwin > 1) { |
diff --git a/drivers/staging/hv/netvsc_drv.c b/drivers/staging/hv/netvsc_drv.c index 56e11575c977..64a01147ecae 100644 --- a/drivers/staging/hv/netvsc_drv.c +++ b/drivers/staging/hv/netvsc_drv.c | |||
| @@ -327,6 +327,9 @@ static const struct net_device_ops device_ops = { | |||
| 327 | .ndo_stop = netvsc_close, | 327 | .ndo_stop = netvsc_close, |
| 328 | .ndo_start_xmit = netvsc_start_xmit, | 328 | .ndo_start_xmit = netvsc_start_xmit, |
| 329 | .ndo_set_multicast_list = netvsc_set_multicast_list, | 329 | .ndo_set_multicast_list = netvsc_set_multicast_list, |
| 330 | .ndo_change_mtu = eth_change_mtu, | ||
| 331 | .ndo_validate_addr = eth_validate_addr, | ||
| 332 | .ndo_set_mac_address = eth_mac_addr, | ||
| 330 | }; | 333 | }; |
| 331 | 334 | ||
| 332 | static int netvsc_probe(struct device *device) | 335 | static int netvsc_probe(struct device *device) |
diff --git a/drivers/staging/hv/ring_buffer.c b/drivers/staging/hv/ring_buffer.c index 17bc7626f70a..d78c569ac94a 100644 --- a/drivers/staging/hv/ring_buffer.c +++ b/drivers/staging/hv/ring_buffer.c | |||
| @@ -193,8 +193,7 @@ Description: | |||
| 193 | static inline u64 | 193 | static inline u64 |
| 194 | GetRingBufferIndices(struct hv_ring_buffer_info *RingInfo) | 194 | GetRingBufferIndices(struct hv_ring_buffer_info *RingInfo) |
| 195 | { | 195 | { |
| 196 | return ((u64)RingInfo->RingBuffer->WriteIndex << 32) | 196 | return (u64)RingInfo->RingBuffer->WriteIndex << 32; |
| 197 | || RingInfo->RingBuffer->ReadIndex; | ||
| 198 | } | 197 | } |
| 199 | 198 | ||
| 200 | 199 | ||
diff --git a/drivers/staging/hv/storvsc_api.h b/drivers/staging/hv/storvsc_api.h index 0063bde9a4b2..8505a1c5f9ee 100644 --- a/drivers/staging/hv/storvsc_api.h +++ b/drivers/staging/hv/storvsc_api.h | |||
| @@ -28,10 +28,10 @@ | |||
| 28 | #include "vmbus_api.h" | 28 | #include "vmbus_api.h" |
| 29 | 29 | ||
| 30 | /* Defines */ | 30 | /* Defines */ |
| 31 | #define STORVSC_RING_BUFFER_SIZE (10*PAGE_SIZE) | 31 | #define STORVSC_RING_BUFFER_SIZE (20*PAGE_SIZE) |
| 32 | #define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE) | 32 | #define BLKVSC_RING_BUFFER_SIZE (20*PAGE_SIZE) |
| 33 | 33 | ||
| 34 | #define STORVSC_MAX_IO_REQUESTS 64 | 34 | #define STORVSC_MAX_IO_REQUESTS 128 |
| 35 | 35 | ||
| 36 | /* | 36 | /* |
| 37 | * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In | 37 | * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In |
diff --git a/drivers/staging/hv/storvsc_drv.c b/drivers/staging/hv/storvsc_drv.c index 075b61bd492f..62882a437aa4 100644 --- a/drivers/staging/hv/storvsc_drv.c +++ b/drivers/staging/hv/storvsc_drv.c | |||
| @@ -495,7 +495,7 @@ static unsigned int copy_to_bounce_buffer(struct scatterlist *orig_sgl, | |||
| 495 | 495 | ||
| 496 | /* ASSERT(orig_sgl[i].offset + orig_sgl[i].length <= PAGE_SIZE); */ | 496 | /* ASSERT(orig_sgl[i].offset + orig_sgl[i].length <= PAGE_SIZE); */ |
| 497 | 497 | ||
| 498 | if (j == 0) | 498 | if (bounce_addr == 0) |
| 499 | bounce_addr = (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), KM_IRQ0); | 499 | bounce_addr = (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), KM_IRQ0); |
| 500 | 500 | ||
| 501 | while (srclen) { | 501 | while (srclen) { |
| @@ -556,7 +556,7 @@ static unsigned int copy_from_bounce_buffer(struct scatterlist *orig_sgl, | |||
| 556 | destlen = orig_sgl[i].length; | 556 | destlen = orig_sgl[i].length; |
| 557 | /* ASSERT(orig_sgl[i].offset + orig_sgl[i].length <= PAGE_SIZE); */ | 557 | /* ASSERT(orig_sgl[i].offset + orig_sgl[i].length <= PAGE_SIZE); */ |
| 558 | 558 | ||
| 559 | if (j == 0) | 559 | if (bounce_addr == 0) |
| 560 | bounce_addr = (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), KM_IRQ0); | 560 | bounce_addr = (unsigned long)kmap_atomic(sg_page((&bounce_sgl[j])), KM_IRQ0); |
| 561 | 561 | ||
| 562 | while (destlen) { | 562 | while (destlen) { |
| @@ -615,6 +615,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, | |||
| 615 | unsigned int request_size = 0; | 615 | unsigned int request_size = 0; |
| 616 | int i; | 616 | int i; |
| 617 | struct scatterlist *sgl; | 617 | struct scatterlist *sgl; |
| 618 | unsigned int sg_count = 0; | ||
| 618 | 619 | ||
| 619 | DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d " | 620 | DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d " |
| 620 | "queue depth %d tagged %d", scmnd, scmnd->sc_data_direction, | 621 | "queue depth %d tagged %d", scmnd, scmnd->sc_data_direction, |
| @@ -697,6 +698,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, | |||
| 697 | request->DataBuffer.Length = scsi_bufflen(scmnd); | 698 | request->DataBuffer.Length = scsi_bufflen(scmnd); |
| 698 | if (scsi_sg_count(scmnd)) { | 699 | if (scsi_sg_count(scmnd)) { |
| 699 | sgl = (struct scatterlist *)scsi_sglist(scmnd); | 700 | sgl = (struct scatterlist *)scsi_sglist(scmnd); |
| 701 | sg_count = scsi_sg_count(scmnd); | ||
| 700 | 702 | ||
| 701 | /* check if we need to bounce the sgl */ | 703 | /* check if we need to bounce the sgl */ |
| 702 | if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) { | 704 | if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) { |
| @@ -731,15 +733,16 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, | |||
| 731 | scsi_sg_count(scmnd)); | 733 | scsi_sg_count(scmnd)); |
| 732 | 734 | ||
| 733 | sgl = cmd_request->bounce_sgl; | 735 | sgl = cmd_request->bounce_sgl; |
| 736 | sg_count = cmd_request->bounce_sgl_count; | ||
| 734 | } | 737 | } |
| 735 | 738 | ||
| 736 | request->DataBuffer.Offset = sgl[0].offset; | 739 | request->DataBuffer.Offset = sgl[0].offset; |
| 737 | 740 | ||
| 738 | for (i = 0; i < scsi_sg_count(scmnd); i++) { | 741 | for (i = 0; i < sg_count; i++) { |
| 739 | DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n", | 742 | DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n", |
| 740 | i, sgl[i].length, sgl[i].offset); | 743 | i, sgl[i].length, sgl[i].offset); |
| 741 | request->DataBuffer.PfnArray[i] = | 744 | request->DataBuffer.PfnArray[i] = |
| 742 | page_to_pfn(sg_page((&sgl[i]))); | 745 | page_to_pfn(sg_page((&sgl[i]))); |
| 743 | } | 746 | } |
| 744 | } else if (scsi_sglist(scmnd)) { | 747 | } else if (scsi_sglist(scmnd)) { |
| 745 | /* ASSERT(scsi_bufflen(scmnd) <= PAGE_SIZE); */ | 748 | /* ASSERT(scsi_bufflen(scmnd) <= PAGE_SIZE); */ |
diff --git a/drivers/staging/octeon/Kconfig b/drivers/staging/octeon/Kconfig index 638ad6b35891..9493128e5fd2 100644 --- a/drivers/staging/octeon/Kconfig +++ b/drivers/staging/octeon/Kconfig | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | config OCTEON_ETHERNET | 1 | config OCTEON_ETHERNET |
| 2 | tristate "Cavium Networks Octeon Ethernet support" | 2 | tristate "Cavium Networks Octeon Ethernet support" |
| 3 | depends on CPU_CAVIUM_OCTEON | 3 | depends on CPU_CAVIUM_OCTEON && NETDEVICES |
| 4 | select PHYLIB | 4 | select PHYLIB |
| 5 | select MDIO_OCTEON | 5 | select MDIO_OCTEON |
| 6 | help | 6 | help |
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index a0fe31de0a6d..ebf9074a9083 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c | |||
| @@ -44,6 +44,7 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 44 | {USB_DEVICE(0x07B8, 0x2870)}, /* AboCom */ | 44 | {USB_DEVICE(0x07B8, 0x2870)}, /* AboCom */ |
| 45 | {USB_DEVICE(0x07B8, 0x2770)}, /* AboCom */ | 45 | {USB_DEVICE(0x07B8, 0x2770)}, /* AboCom */ |
| 46 | {USB_DEVICE(0x0DF6, 0x0039)}, /* Sitecom 2770 */ | 46 | {USB_DEVICE(0x0DF6, 0x0039)}, /* Sitecom 2770 */ |
| 47 | {USB_DEVICE(0x0DF6, 0x003F)}, /* Sitecom 2770 */ | ||
| 47 | {USB_DEVICE(0x083A, 0x7512)}, /* Arcadyan 2770 */ | 48 | {USB_DEVICE(0x083A, 0x7512)}, /* Arcadyan 2770 */ |
| 48 | {USB_DEVICE(0x0789, 0x0162)}, /* Logitec 2870 */ | 49 | {USB_DEVICE(0x0789, 0x0162)}, /* Logitec 2870 */ |
| 49 | {USB_DEVICE(0x0789, 0x0163)}, /* Logitec 2870 */ | 50 | {USB_DEVICE(0x0789, 0x0163)}, /* Logitec 2870 */ |
| @@ -95,7 +96,8 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 95 | {USB_DEVICE(0x050d, 0x815c)}, | 96 | {USB_DEVICE(0x050d, 0x815c)}, |
| 96 | {USB_DEVICE(0x1482, 0x3C09)}, /* Abocom */ | 97 | {USB_DEVICE(0x1482, 0x3C09)}, /* Abocom */ |
| 97 | {USB_DEVICE(0x14B2, 0x3C09)}, /* Alpha */ | 98 | {USB_DEVICE(0x14B2, 0x3C09)}, /* Alpha */ |
| 98 | {USB_DEVICE(0x04E8, 0x2018)}, /* samsung */ | 99 | {USB_DEVICE(0x04E8, 0x2018)}, /* samsung linkstick2 */ |
| 100 | {USB_DEVICE(0x1690, 0x0740)}, /* Askey */ | ||
| 99 | {USB_DEVICE(0x5A57, 0x0280)}, /* Zinwell */ | 101 | {USB_DEVICE(0x5A57, 0x0280)}, /* Zinwell */ |
| 100 | {USB_DEVICE(0x5A57, 0x0282)}, /* Zinwell */ | 102 | {USB_DEVICE(0x5A57, 0x0282)}, /* Zinwell */ |
| 101 | {USB_DEVICE(0x7392, 0x7718)}, | 103 | {USB_DEVICE(0x7392, 0x7718)}, |
| @@ -105,21 +107,34 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 105 | {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ | 107 | {USB_DEVICE(0x1737, 0x0071)}, /* Linksys WUSB600N */ |
| 106 | {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ | 108 | {USB_DEVICE(0x0411, 0x00e8)}, /* Buffalo WLI-UC-G300N */ |
| 107 | {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ | 109 | {USB_DEVICE(0x050d, 0x815c)}, /* Belkin F5D8053 */ |
| 110 | {USB_DEVICE(0x100D, 0x9031)}, /* Motorola 2770 */ | ||
| 108 | #endif /* RT2870 // */ | 111 | #endif /* RT2870 // */ |
| 109 | #ifdef RT3070 | 112 | #ifdef RT3070 |
| 110 | {USB_DEVICE(0x148F, 0x3070)}, /* Ralink 3070 */ | 113 | {USB_DEVICE(0x148F, 0x3070)}, /* Ralink 3070 */ |
| 111 | {USB_DEVICE(0x148F, 0x3071)}, /* Ralink 3071 */ | 114 | {USB_DEVICE(0x148F, 0x3071)}, /* Ralink 3071 */ |
| 112 | {USB_DEVICE(0x148F, 0x3072)}, /* Ralink 3072 */ | 115 | {USB_DEVICE(0x148F, 0x3072)}, /* Ralink 3072 */ |
| 113 | {USB_DEVICE(0x0DB0, 0x3820)}, /* Ralink 3070 */ | 116 | {USB_DEVICE(0x0DB0, 0x3820)}, /* Ralink 3070 */ |
| 117 | {USB_DEVICE(0x0DB0, 0x871C)}, /* Ralink 3070 */ | ||
| 118 | {USB_DEVICE(0x0DB0, 0x822C)}, /* Ralink 3070 */ | ||
| 119 | {USB_DEVICE(0x0DB0, 0x871B)}, /* Ralink 3070 */ | ||
| 120 | {USB_DEVICE(0x0DB0, 0x822B)}, /* Ralink 3070 */ | ||
| 114 | {USB_DEVICE(0x0DF6, 0x003E)}, /* Sitecom 3070 */ | 121 | {USB_DEVICE(0x0DF6, 0x003E)}, /* Sitecom 3070 */ |
| 115 | {USB_DEVICE(0x0DF6, 0x0042)}, /* Sitecom 3072 */ | 122 | {USB_DEVICE(0x0DF6, 0x0042)}, /* Sitecom 3072 */ |
| 123 | {USB_DEVICE(0x0DF6, 0x0048)}, /* Sitecom 3070 */ | ||
| 124 | {USB_DEVICE(0x0DF6, 0x0047)}, /* Sitecom 3071 */ | ||
| 116 | {USB_DEVICE(0x14B2, 0x3C12)}, /* AL 3070 */ | 125 | {USB_DEVICE(0x14B2, 0x3C12)}, /* AL 3070 */ |
| 117 | {USB_DEVICE(0x18C5, 0x0012)}, /* Corega 3070 */ | 126 | {USB_DEVICE(0x18C5, 0x0012)}, /* Corega 3070 */ |
| 118 | {USB_DEVICE(0x083A, 0x7511)}, /* Arcadyan 3070 */ | 127 | {USB_DEVICE(0x083A, 0x7511)}, /* Arcadyan 3070 */ |
| 128 | {USB_DEVICE(0x083A, 0xA701)}, /* SMC 3070 */ | ||
| 129 | {USB_DEVICE(0x083A, 0xA702)}, /* SMC 3072 */ | ||
| 119 | {USB_DEVICE(0x1740, 0x9703)}, /* EnGenius 3070 */ | 130 | {USB_DEVICE(0x1740, 0x9703)}, /* EnGenius 3070 */ |
| 120 | {USB_DEVICE(0x1740, 0x9705)}, /* EnGenius 3071 */ | 131 | {USB_DEVICE(0x1740, 0x9705)}, /* EnGenius 3071 */ |
| 121 | {USB_DEVICE(0x1740, 0x9706)}, /* EnGenius 3072 */ | 132 | {USB_DEVICE(0x1740, 0x9706)}, /* EnGenius 3072 */ |
| 133 | {USB_DEVICE(0x1740, 0x9707)}, /* EnGenius 3070 */ | ||
| 134 | {USB_DEVICE(0x1740, 0x9708)}, /* EnGenius 3071 */ | ||
| 135 | {USB_DEVICE(0x1740, 0x9709)}, /* EnGenius 3072 */ | ||
| 122 | {USB_DEVICE(0x13D3, 0x3273)}, /* AzureWave 3070 */ | 136 | {USB_DEVICE(0x13D3, 0x3273)}, /* AzureWave 3070 */ |
| 137 | {USB_DEVICE(0x13D3, 0x3305)}, /* AzureWave 3070*/ | ||
| 123 | {USB_DEVICE(0x1044, 0x800D)}, /* Gigabyte GN-WB32L 3070 */ | 138 | {USB_DEVICE(0x1044, 0x800D)}, /* Gigabyte GN-WB32L 3070 */ |
| 124 | {USB_DEVICE(0x2019, 0xAB25)}, /* Planex Communications, Inc. RT3070 */ | 139 | {USB_DEVICE(0x2019, 0xAB25)}, /* Planex Communications, Inc. RT3070 */ |
| 125 | {USB_DEVICE(0x07B8, 0x3070)}, /* AboCom 3070 */ | 140 | {USB_DEVICE(0x07B8, 0x3070)}, /* AboCom 3070 */ |
| @@ -132,14 +147,36 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 132 | {USB_DEVICE(0x07D1, 0x3C0D)}, /* D-Link 3070 */ | 147 | {USB_DEVICE(0x07D1, 0x3C0D)}, /* D-Link 3070 */ |
| 133 | {USB_DEVICE(0x07D1, 0x3C0E)}, /* D-Link 3070 */ | 148 | {USB_DEVICE(0x07D1, 0x3C0E)}, /* D-Link 3070 */ |
| 134 | {USB_DEVICE(0x07D1, 0x3C0F)}, /* D-Link 3070 */ | 149 | {USB_DEVICE(0x07D1, 0x3C0F)}, /* D-Link 3070 */ |
| 150 | {USB_DEVICE(0x07D1, 0x3C16)}, /* D-Link 3070 */ | ||
| 151 | {USB_DEVICE(0x07D1, 0x3C17)}, /* D-Link 8070 */ | ||
| 135 | {USB_DEVICE(0x1D4D, 0x000C)}, /* Pegatron Corporation 3070 */ | 152 | {USB_DEVICE(0x1D4D, 0x000C)}, /* Pegatron Corporation 3070 */ |
| 136 | {USB_DEVICE(0x1D4D, 0x000E)}, /* Pegatron Corporation 3070 */ | 153 | {USB_DEVICE(0x1D4D, 0x000E)}, /* Pegatron Corporation 3070 */ |
| 137 | {USB_DEVICE(0x5A57, 0x5257)}, /* Zinwell 3070 */ | 154 | {USB_DEVICE(0x5A57, 0x5257)}, /* Zinwell 3070 */ |
| 138 | {USB_DEVICE(0x5A57, 0x0283)}, /* Zinwell 3072 */ | 155 | {USB_DEVICE(0x5A57, 0x0283)}, /* Zinwell 3072 */ |
| 139 | {USB_DEVICE(0x04BB, 0x0945)}, /* I-O DATA 3072 */ | 156 | {USB_DEVICE(0x04BB, 0x0945)}, /* I-O DATA 3072 */ |
| 157 | {USB_DEVICE(0x04BB, 0x0947)}, /* I-O DATA 3070 */ | ||
| 158 | {USB_DEVICE(0x04BB, 0x0948)}, /* I-O DATA 3072 */ | ||
| 140 | {USB_DEVICE(0x203D, 0x1480)}, /* Encore 3070 */ | 159 | {USB_DEVICE(0x203D, 0x1480)}, /* Encore 3070 */ |
| 160 | {USB_DEVICE(0x20B8, 0x8888)}, /* PARA INDUSTRIAL 3070 */ | ||
| 161 | {USB_DEVICE(0x0B05, 0x1784)}, /* Asus 3072 */ | ||
| 162 | {USB_DEVICE(0x203D, 0x14A9)}, /* Encore 3070*/ | ||
| 163 | {USB_DEVICE(0x0DB0, 0x899A)}, /* MSI 3070*/ | ||
| 164 | {USB_DEVICE(0x0DB0, 0x3870)}, /* MSI 3070*/ | ||
| 165 | {USB_DEVICE(0x0DB0, 0x870A)}, /* MSI 3070*/ | ||
| 166 | {USB_DEVICE(0x0DB0, 0x6899)}, /* MSI 3070 */ | ||
| 167 | {USB_DEVICE(0x0DB0, 0x3822)}, /* MSI 3070 */ | ||
| 168 | {USB_DEVICE(0x0DB0, 0x3871)}, /* MSI 3070 */ | ||
| 169 | {USB_DEVICE(0x0DB0, 0x871A)}, /* MSI 3070 */ | ||
| 170 | {USB_DEVICE(0x0DB0, 0x822A)}, /* MSI 3070 */ | ||
| 171 | {USB_DEVICE(0x0DB0, 0x3821)}, /* Ralink 3070 */ | ||
| 172 | {USB_DEVICE(0x0DB0, 0x821A)}, /* Ralink 3070 */ | ||
| 173 | {USB_DEVICE(0x083A, 0xA703)}, /* IO-MAGIC */ | ||
| 174 | {USB_DEVICE(0x13D3, 0x3307)}, /* Azurewave */ | ||
| 175 | {USB_DEVICE(0x13D3, 0x3321)}, /* Azurewave */ | ||
| 176 | {USB_DEVICE(0x07FA, 0x7712)}, /* Edimax */ | ||
| 177 | {USB_DEVICE(0x0789, 0x0166)}, /* Edimax */ | ||
| 178 | {USB_DEVICE(0x148F, 0x2070)}, /* Edimax */ | ||
| 141 | #endif /* RT3070 // */ | 179 | #endif /* RT3070 // */ |
| 142 | {USB_DEVICE(0x0DF6, 0x003F)}, /* Sitecom WL-608 */ | ||
| 143 | {USB_DEVICE(0x1737, 0x0077)}, /* Linksys WUSB54GC-EU v3 */ | 180 | {USB_DEVICE(0x1737, 0x0077)}, /* Linksys WUSB54GC-EU v3 */ |
| 144 | {USB_DEVICE(0x2001, 0x3C09)}, /* D-Link */ | 181 | {USB_DEVICE(0x2001, 0x3C09)}, /* D-Link */ |
| 145 | {USB_DEVICE(0x2001, 0x3C0A)}, /* D-Link 3072 */ | 182 | {USB_DEVICE(0x2001, 0x3C0A)}, /* D-Link 3072 */ |
diff --git a/drivers/staging/spectra/Kconfig b/drivers/staging/spectra/Kconfig index 5e2ffefb60af..d231ae27299d 100644 --- a/drivers/staging/spectra/Kconfig +++ b/drivers/staging/spectra/Kconfig | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | menuconfig SPECTRA | 2 | menuconfig SPECTRA |
| 3 | tristate "Denali Spectra Flash Translation Layer" | 3 | tristate "Denali Spectra Flash Translation Layer" |
| 4 | depends on BLOCK | 4 | depends on BLOCK |
| 5 | depends on X86_MRST | ||
| 5 | default n | 6 | default n |
| 6 | ---help--- | 7 | ---help--- |
| 7 | Enable the FTL pseudo-filesystem used with the NAND Flash | 8 | Enable the FTL pseudo-filesystem used with the NAND Flash |
diff --git a/drivers/staging/spectra/ffsport.c b/drivers/staging/spectra/ffsport.c index 44a7fbe7eccd..fa21a0fd8e84 100644 --- a/drivers/staging/spectra/ffsport.c +++ b/drivers/staging/spectra/ffsport.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/log2.h> | 28 | #include <linux/log2.h> |
| 29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
| 30 | #include <linux/smp_lock.h> | 30 | #include <linux/smp_lock.h> |
| 31 | #include <linux/slab.h> | ||
| 31 | 32 | ||
| 32 | /**** Helper functions used for Div, Remainder operation on u64 ****/ | 33 | /**** Helper functions used for Div, Remainder operation on u64 ****/ |
| 33 | 34 | ||
diff --git a/drivers/staging/wlan-ng/cfg80211.c b/drivers/staging/wlan-ng/cfg80211.c index 368c30a9d5ff..4af83d5318f2 100644 --- a/drivers/staging/wlan-ng/cfg80211.c +++ b/drivers/staging/wlan-ng/cfg80211.c | |||
| @@ -219,6 +219,7 @@ int prism2_get_key(struct wiphy *wiphy, struct net_device *dev, | |||
| 219 | return -ENOENT; | 219 | return -ENOENT; |
| 220 | params.key_len = len; | 220 | params.key_len = len; |
| 221 | params.key = wlandev->wep_keys[key_index]; | 221 | params.key = wlandev->wep_keys[key_index]; |
| 222 | params.seq_len = 0; | ||
| 222 | 223 | ||
| 223 | callback(cookie, ¶ms); | 224 | callback(cookie, ¶ms); |
| 224 | 225 | ||
| @@ -735,6 +736,8 @@ struct wiphy *wlan_create_wiphy(struct device *dev, wlandevice_t *wlandev) | |||
| 735 | priv->band.n_channels = ARRAY_SIZE(prism2_channels); | 736 | priv->band.n_channels = ARRAY_SIZE(prism2_channels); |
| 736 | priv->band.bitrates = priv->rates; | 737 | priv->band.bitrates = priv->rates; |
| 737 | priv->band.n_bitrates = ARRAY_SIZE(prism2_rates); | 738 | priv->band.n_bitrates = ARRAY_SIZE(prism2_rates); |
| 739 | priv->band.band = IEEE80211_BAND_2GHZ; | ||
| 740 | priv->band.ht_cap.ht_supported = false; | ||
| 738 | wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; | 741 | wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band; |
| 739 | 742 | ||
| 740 | set_wiphy_dev(wiphy, dev); | 743 | set_wiphy_dev(wiphy, dev); |
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c index 77d4d715a789..722c840ac638 100644 --- a/drivers/staging/zram/zram_drv.c +++ b/drivers/staging/zram/zram_drv.c | |||
| @@ -769,6 +769,7 @@ static int __init zram_init(void) | |||
| 769 | free_devices: | 769 | free_devices: |
| 770 | while (dev_id) | 770 | while (dev_id) |
| 771 | destroy_device(&devices[--dev_id]); | 771 | destroy_device(&devices[--dev_id]); |
| 772 | kfree(devices); | ||
| 772 | unregister: | 773 | unregister: |
| 773 | unregister_blkdev(zram_major, "zram"); | 774 | unregister_blkdev(zram_major, "zram"); |
| 774 | out: | 775 | out: |
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c index 593fc5e2d2e6..5af23cc5ea9f 100644 --- a/drivers/usb/atm/cxacru.c +++ b/drivers/usb/atm/cxacru.c | |||
| @@ -1127,6 +1127,7 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, | |||
| 1127 | { | 1127 | { |
| 1128 | struct cxacru_data *instance; | 1128 | struct cxacru_data *instance; |
| 1129 | struct usb_device *usb_dev = interface_to_usbdev(intf); | 1129 | struct usb_device *usb_dev = interface_to_usbdev(intf); |
| 1130 | struct usb_host_endpoint *cmd_ep = usb_dev->ep_in[CXACRU_EP_CMD]; | ||
| 1130 | int ret; | 1131 | int ret; |
| 1131 | 1132 | ||
| 1132 | /* instance init */ | 1133 | /* instance init */ |
| @@ -1171,15 +1172,34 @@ static int cxacru_bind(struct usbatm_data *usbatm_instance, | |||
| 1171 | goto fail; | 1172 | goto fail; |
| 1172 | } | 1173 | } |
| 1173 | 1174 | ||
| 1174 | usb_fill_int_urb(instance->rcv_urb, | 1175 | if (!cmd_ep) { |
| 1176 | dbg("cxacru_bind: no command endpoint"); | ||
| 1177 | ret = -ENODEV; | ||
| 1178 | goto fail; | ||
| 1179 | } | ||
| 1180 | |||
| 1181 | if ((cmd_ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) | ||
| 1182 | == USB_ENDPOINT_XFER_INT) { | ||
| 1183 | usb_fill_int_urb(instance->rcv_urb, | ||
| 1175 | usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD), | 1184 | usb_dev, usb_rcvintpipe(usb_dev, CXACRU_EP_CMD), |
| 1176 | instance->rcv_buf, PAGE_SIZE, | 1185 | instance->rcv_buf, PAGE_SIZE, |
| 1177 | cxacru_blocking_completion, &instance->rcv_done, 1); | 1186 | cxacru_blocking_completion, &instance->rcv_done, 1); |
| 1178 | 1187 | ||
| 1179 | usb_fill_int_urb(instance->snd_urb, | 1188 | usb_fill_int_urb(instance->snd_urb, |
| 1180 | usb_dev, usb_sndintpipe(usb_dev, CXACRU_EP_CMD), | 1189 | usb_dev, usb_sndintpipe(usb_dev, CXACRU_EP_CMD), |
| 1181 | instance->snd_buf, PAGE_SIZE, | 1190 | instance->snd_buf, PAGE_SIZE, |
| 1182 | cxacru_blocking_completion, &instance->snd_done, 4); | 1191 | cxacru_blocking_completion, &instance->snd_done, 4); |
| 1192 | } else { | ||
| 1193 | usb_fill_bulk_urb(instance->rcv_urb, | ||
| 1194 | usb_dev, usb_rcvbulkpipe(usb_dev, CXACRU_EP_CMD), | ||
| 1195 | instance->rcv_buf, PAGE_SIZE, | ||
| 1196 | cxacru_blocking_completion, &instance->rcv_done); | ||
| 1197 | |||
| 1198 | usb_fill_bulk_urb(instance->snd_urb, | ||
| 1199 | usb_dev, usb_sndbulkpipe(usb_dev, CXACRU_EP_CMD), | ||
| 1200 | instance->snd_buf, PAGE_SIZE, | ||
| 1201 | cxacru_blocking_completion, &instance->snd_done); | ||
| 1202 | } | ||
| 1183 | 1203 | ||
| 1184 | mutex_init(&instance->cm_serialize); | 1204 | mutex_init(&instance->cm_serialize); |
| 1185 | 1205 | ||
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 1833b3a71515..bc62fae0680f 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
| @@ -965,7 +965,8 @@ static int acm_probe(struct usb_interface *intf, | |||
| 965 | } | 965 | } |
| 966 | 966 | ||
| 967 | if (!buflen) { | 967 | if (!buflen) { |
| 968 | if (intf->cur_altsetting->endpoint->extralen && | 968 | if (intf->cur_altsetting->endpoint && |
| 969 | intf->cur_altsetting->endpoint->extralen && | ||
| 969 | intf->cur_altsetting->endpoint->extra) { | 970 | intf->cur_altsetting->endpoint->extra) { |
| 970 | dev_dbg(&intf->dev, | 971 | dev_dbg(&intf->dev, |
| 971 | "Seeking extra descriptors on endpoint\n"); | 972 | "Seeking extra descriptors on endpoint\n"); |
| @@ -1481,6 +1482,11 @@ static int acm_reset_resume(struct usb_interface *intf) | |||
| 1481 | USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \ | 1482 | USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \ |
| 1482 | USB_CDC_ACM_PROTO_VENDOR) | 1483 | USB_CDC_ACM_PROTO_VENDOR) |
| 1483 | 1484 | ||
| 1485 | #define SAMSUNG_PCSUITE_ACM_INFO(x) \ | ||
| 1486 | USB_DEVICE_AND_INTERFACE_INFO(0x04e7, x, \ | ||
| 1487 | USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, \ | ||
| 1488 | USB_CDC_ACM_PROTO_VENDOR) | ||
| 1489 | |||
| 1484 | /* | 1490 | /* |
| 1485 | * USB driver structure. | 1491 | * USB driver structure. |
| 1486 | */ | 1492 | */ |
| @@ -1591,6 +1597,17 @@ static const struct usb_device_id acm_ids[] = { | |||
| 1591 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ | 1597 | { NOKIA_PCSUITE_ACM_INFO(0x0108), }, /* Nokia 5320 XpressMusic 2G */ |
| 1592 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ | 1598 | { NOKIA_PCSUITE_ACM_INFO(0x01f5), }, /* Nokia N97, RM-505 */ |
| 1593 | { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */ | 1599 | { NOKIA_PCSUITE_ACM_INFO(0x02e3), }, /* Nokia 5230, RM-588 */ |
| 1600 | { NOKIA_PCSUITE_ACM_INFO(0x0178), }, /* Nokia E63 */ | ||
| 1601 | { NOKIA_PCSUITE_ACM_INFO(0x010e), }, /* Nokia E75 */ | ||
| 1602 | { NOKIA_PCSUITE_ACM_INFO(0x02d9), }, /* Nokia 6760 Slide */ | ||
| 1603 | { NOKIA_PCSUITE_ACM_INFO(0x01d0), }, /* Nokia E52 */ | ||
| 1604 | { NOKIA_PCSUITE_ACM_INFO(0x0223), }, /* Nokia E72 */ | ||
| 1605 | { NOKIA_PCSUITE_ACM_INFO(0x0275), }, /* Nokia X6 */ | ||
| 1606 | { NOKIA_PCSUITE_ACM_INFO(0x026c), }, /* Nokia N97 Mini */ | ||
| 1607 | { NOKIA_PCSUITE_ACM_INFO(0x0154), }, /* Nokia 5800 XpressMusic */ | ||
| 1608 | { NOKIA_PCSUITE_ACM_INFO(0x04ce), }, /* Nokia E90 */ | ||
| 1609 | { NOKIA_PCSUITE_ACM_INFO(0x01d4), }, /* Nokia E55 */ | ||
| 1610 | { SAMSUNG_PCSUITE_ACM_INFO(0x6651), }, /* Samsung GTi8510 (INNOV8) */ | ||
| 1594 | 1611 | ||
| 1595 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ | 1612 | /* NOTE: non-Nokia COMM/ACM/0xff is likely MSFT RNDIS... NOT a modem! */ |
| 1596 | 1613 | ||
| @@ -1599,6 +1616,10 @@ static const struct usb_device_id acm_ids[] = { | |||
| 1599 | .driver_info = NOT_A_MODEM, | 1616 | .driver_info = NOT_A_MODEM, |
| 1600 | }, | 1617 | }, |
| 1601 | 1618 | ||
| 1619 | /* control interfaces without any protocol set */ | ||
| 1620 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, | ||
| 1621 | USB_CDC_PROTO_NONE) }, | ||
| 1622 | |||
| 1602 | /* control interfaces with various AT-command sets */ | 1623 | /* control interfaces with various AT-command sets */ |
| 1603 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, | 1624 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
| 1604 | USB_CDC_ACM_PROTO_AT_V25TER) }, | 1625 | USB_CDC_ACM_PROTO_AT_V25TER) }, |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index fd4c36ea5e46..844683e50383 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
| @@ -1724,6 +1724,15 @@ free_interfaces: | |||
| 1724 | if (ret) | 1724 | if (ret) |
| 1725 | goto free_interfaces; | 1725 | goto free_interfaces; |
| 1726 | 1726 | ||
| 1727 | /* if it's already configured, clear out old state first. | ||
| 1728 | * getting rid of old interfaces means unbinding their drivers. | ||
| 1729 | */ | ||
| 1730 | if (dev->state != USB_STATE_ADDRESS) | ||
| 1731 | usb_disable_device(dev, 1); /* Skip ep0 */ | ||
| 1732 | |||
| 1733 | /* Get rid of pending async Set-Config requests for this device */ | ||
| 1734 | cancel_async_set_config(dev); | ||
| 1735 | |||
| 1727 | /* Make sure we have bandwidth (and available HCD resources) for this | 1736 | /* Make sure we have bandwidth (and available HCD resources) for this |
| 1728 | * configuration. Remove endpoints from the schedule if we're dropping | 1737 | * configuration. Remove endpoints from the schedule if we're dropping |
| 1729 | * this configuration to set configuration 0. After this point, the | 1738 | * this configuration to set configuration 0. After this point, the |
| @@ -1733,20 +1742,11 @@ free_interfaces: | |||
| 1733 | mutex_lock(&hcd->bandwidth_mutex); | 1742 | mutex_lock(&hcd->bandwidth_mutex); |
| 1734 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); | 1743 | ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL); |
| 1735 | if (ret < 0) { | 1744 | if (ret < 0) { |
| 1736 | usb_autosuspend_device(dev); | ||
| 1737 | mutex_unlock(&hcd->bandwidth_mutex); | 1745 | mutex_unlock(&hcd->bandwidth_mutex); |
| 1746 | usb_autosuspend_device(dev); | ||
| 1738 | goto free_interfaces; | 1747 | goto free_interfaces; |
| 1739 | } | 1748 | } |
| 1740 | 1749 | ||
| 1741 | /* if it's already configured, clear out old state first. | ||
| 1742 | * getting rid of old interfaces means unbinding their drivers. | ||
| 1743 | */ | ||
| 1744 | if (dev->state != USB_STATE_ADDRESS) | ||
| 1745 | usb_disable_device(dev, 1); /* Skip ep0 */ | ||
| 1746 | |||
| 1747 | /* Get rid of pending async Set-Config requests for this device */ | ||
| 1748 | cancel_async_set_config(dev); | ||
| 1749 | |||
| 1750 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), | 1750 | ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), |
| 1751 | USB_REQ_SET_CONFIGURATION, 0, configuration, 0, | 1751 | USB_REQ_SET_CONFIGURATION, 0, configuration, 0, |
| 1752 | NULL, 0, USB_CTRL_SET_TIMEOUT); | 1752 | NULL, 0, USB_CTRL_SET_TIMEOUT); |
| @@ -1761,8 +1761,8 @@ free_interfaces: | |||
| 1761 | if (!cp) { | 1761 | if (!cp) { |
| 1762 | usb_set_device_state(dev, USB_STATE_ADDRESS); | 1762 | usb_set_device_state(dev, USB_STATE_ADDRESS); |
| 1763 | usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); | 1763 | usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL); |
| 1764 | usb_autosuspend_device(dev); | ||
| 1765 | mutex_unlock(&hcd->bandwidth_mutex); | 1764 | mutex_unlock(&hcd->bandwidth_mutex); |
| 1765 | usb_autosuspend_device(dev); | ||
| 1766 | goto free_interfaces; | 1766 | goto free_interfaces; |
| 1767 | } | 1767 | } |
| 1768 | mutex_unlock(&hcd->bandwidth_mutex); | 1768 | mutex_unlock(&hcd->bandwidth_mutex); |
diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 020fa5a25fda..972d5ddd1e18 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c | |||
| @@ -293,9 +293,13 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len, | |||
| 293 | /* mandatory */ | 293 | /* mandatory */ |
| 294 | case OID_GEN_VENDOR_DESCRIPTION: | 294 | case OID_GEN_VENDOR_DESCRIPTION: |
| 295 | pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__); | 295 | pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__); |
| 296 | length = strlen (rndis_per_dev_params [configNr].vendorDescr); | 296 | if ( rndis_per_dev_params [configNr].vendorDescr ) { |
| 297 | memcpy (outbuf, | 297 | length = strlen (rndis_per_dev_params [configNr].vendorDescr); |
| 298 | rndis_per_dev_params [configNr].vendorDescr, length); | 298 | memcpy (outbuf, |
| 299 | rndis_per_dev_params [configNr].vendorDescr, length); | ||
| 300 | } else { | ||
| 301 | outbuf[0] = 0; | ||
| 302 | } | ||
| 299 | retval = 0; | 303 | retval = 0; |
| 300 | break; | 304 | break; |
| 301 | 305 | ||
| @@ -1148,7 +1152,7 @@ static struct proc_dir_entry *rndis_connect_state [RNDIS_MAX_CONFIGS]; | |||
| 1148 | #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ | 1152 | #endif /* CONFIG_USB_GADGET_DEBUG_FILES */ |
| 1149 | 1153 | ||
| 1150 | 1154 | ||
| 1151 | int __init rndis_init (void) | 1155 | int rndis_init(void) |
| 1152 | { | 1156 | { |
| 1153 | u8 i; | 1157 | u8 i; |
| 1154 | 1158 | ||
diff --git a/drivers/usb/gadget/rndis.h b/drivers/usb/gadget/rndis.h index c236aaa9dcd1..907c33008118 100644 --- a/drivers/usb/gadget/rndis.h +++ b/drivers/usb/gadget/rndis.h | |||
| @@ -262,7 +262,7 @@ int rndis_signal_disconnect (int configNr); | |||
| 262 | int rndis_state (int configNr); | 262 | int rndis_state (int configNr); |
| 263 | extern void rndis_set_host_mac (int configNr, const u8 *addr); | 263 | extern void rndis_set_host_mac (int configNr, const u8 *addr); |
| 264 | 264 | ||
| 265 | int __devinit rndis_init (void); | 265 | int rndis_init(void); |
| 266 | void rndis_exit (void); | 266 | void rndis_exit (void); |
| 267 | 267 | ||
| 268 | #endif /* _LINUX_RNDIS_H */ | 268 | #endif /* _LINUX_RNDIS_H */ |
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 521ebed0118d..a229744a8c7d 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
| @@ -12,8 +12,6 @@ | |||
| 12 | * published by the Free Software Foundation. | 12 | * published by the Free Software Foundation. |
| 13 | */ | 13 | */ |
| 14 | 14 | ||
| 15 | #define DEBUG | ||
| 16 | |||
| 17 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 18 | #include <linux/module.h> | 16 | #include <linux/module.h> |
| 19 | #include <linux/spinlock.h> | 17 | #include <linux/spinlock.h> |
diff --git a/drivers/usb/host/ehci-ppc-of.c b/drivers/usb/host/ehci-ppc-of.c index 335ee699fd85..ba52be473027 100644 --- a/drivers/usb/host/ehci-ppc-of.c +++ b/drivers/usb/host/ehci-ppc-of.c | |||
| @@ -192,17 +192,19 @@ ehci_hcd_ppc_of_probe(struct platform_device *op, const struct of_device_id *mat | |||
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | rv = usb_add_hcd(hcd, irq, 0); | 194 | rv = usb_add_hcd(hcd, irq, 0); |
| 195 | if (rv == 0) | 195 | if (rv) |
| 196 | return 0; | 196 | goto err_ehci; |
| 197 | |||
| 198 | return 0; | ||
| 197 | 199 | ||
| 200 | err_ehci: | ||
| 201 | if (ehci->has_amcc_usb23) | ||
| 202 | iounmap(ehci->ohci_hcctrl_reg); | ||
| 198 | iounmap(hcd->regs); | 203 | iounmap(hcd->regs); |
| 199 | err_ioremap: | 204 | err_ioremap: |
| 200 | irq_dispose_mapping(irq); | 205 | irq_dispose_mapping(irq); |
| 201 | err_irq: | 206 | err_irq: |
| 202 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 207 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
| 203 | |||
| 204 | if (ehci->has_amcc_usb23) | ||
| 205 | iounmap(ehci->ohci_hcctrl_reg); | ||
| 206 | err_rmr: | 208 | err_rmr: |
| 207 | usb_put_hcd(hcd); | 209 | usb_put_hcd(hcd); |
| 208 | 210 | ||
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c index 80bf8333bb03..4f1744c5871f 100644 --- a/drivers/usb/serial/cp210x.c +++ b/drivers/usb/serial/cp210x.c | |||
| @@ -56,6 +56,7 @@ static int debug; | |||
| 56 | static const struct usb_device_id id_table[] = { | 56 | static const struct usb_device_id id_table[] = { |
| 57 | { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ | 57 | { USB_DEVICE(0x0471, 0x066A) }, /* AKTAKOM ACE-1001 cable */ |
| 58 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | 58 | { USB_DEVICE(0x0489, 0xE000) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ |
| 59 | { USB_DEVICE(0x0489, 0xE003) }, /* Pirelli Broadband S.p.A, DP-L10 SIP/GSM Mobile */ | ||
| 59 | { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */ | 60 | { USB_DEVICE(0x0745, 0x1000) }, /* CipherLab USB CCD Barcode Scanner 1000 */ |
| 60 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ | 61 | { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ |
| 61 | { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ | 62 | { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ |
| @@ -88,6 +89,7 @@ static const struct usb_device_id id_table[] = { | |||
| 88 | { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */ | 89 | { USB_DEVICE(0x10C4, 0x8149) }, /* West Mountain Radio Computerized Battery Analyzer */ |
| 89 | { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ | 90 | { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ |
| 90 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | 91 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ |
| 92 | { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */ | ||
| 91 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ | 93 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
| 92 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ | 94 | { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */ |
| 93 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ | 95 | { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */ |
| @@ -109,6 +111,7 @@ static const struct usb_device_id id_table[] = { | |||
| 109 | { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ | 111 | { USB_DEVICE(0x10C4, 0x83A8) }, /* Amber Wireless AMB2560 */ |
| 110 | { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ | 112 | { USB_DEVICE(0x10C4, 0x8411) }, /* Kyocera GPS Module */ |
| 111 | { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ | 113 | { USB_DEVICE(0x10C4, 0x846E) }, /* BEI USB Sensor Interface (VCP) */ |
| 114 | { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */ | ||
| 112 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ | 115 | { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
| 113 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ | 116 | { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */ |
| 114 | { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ | 117 | { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */ |
| @@ -122,14 +125,14 @@ static const struct usb_device_id id_table[] = { | |||
| 122 | { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ | 125 | { USB_DEVICE(0x1555, 0x0004) }, /* Owen AC4 USB-RS485 Converter */ |
| 123 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ | 126 | { USB_DEVICE(0x166A, 0x0303) }, /* Clipsal 5500PCU C-Bus USB interface */ |
| 124 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ | 127 | { USB_DEVICE(0x16D6, 0x0001) }, /* Jablotron serial interface */ |
| 125 | { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ | ||
| 126 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | ||
| 127 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | ||
| 128 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ | ||
| 129 | { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ | 128 | { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */ |
| 130 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ | 129 | { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */ |
| 131 | { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ | 130 | { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */ |
| 132 | { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ | 131 | { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ |
| 132 | { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ | ||
| 133 | { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ | ||
| 134 | { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ | ||
| 135 | { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */ | ||
| 133 | { } /* Terminating Entry */ | 136 | { } /* Terminating Entry */ |
| 134 | }; | 137 | }; |
| 135 | 138 | ||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 63ddb2f65cee..97cc87d654ce 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -753,6 +753,14 @@ static struct usb_device_id id_table_combined [] = { | |||
| 753 | { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, | 753 | { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) }, |
| 754 | { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), | 754 | { USB_DEVICE(IONICS_VID, IONICS_PLUGCOMPUTER_PID), |
| 755 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, | 755 | .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, |
| 756 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_24_MASTER_WING_PID) }, | ||
| 757 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_PC_WING_PID) }, | ||
| 758 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_USB_DMX_PID) }, | ||
| 759 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MIDI_TIMECODE_PID) }, | ||
| 760 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MINI_WING_PID) }, | ||
| 761 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MAXI_WING_PID) }, | ||
| 762 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_MEDIA_WING_PID) }, | ||
| 763 | { USB_DEVICE(FTDI_VID, FTDI_CHAMSYS_WING_PID) }, | ||
| 756 | { }, /* Optional parameter entry */ | 764 | { }, /* Optional parameter entry */ |
| 757 | { } /* Terminating entry */ | 765 | { } /* Terminating entry */ |
| 758 | }; | 766 | }; |
| @@ -1834,7 +1842,7 @@ static int ftdi_process_packet(struct tty_struct *tty, | |||
| 1834 | 1842 | ||
| 1835 | if (port->port.console && port->sysrq) { | 1843 | if (port->port.console && port->sysrq) { |
| 1836 | for (i = 0; i < len; i++, ch++) { | 1844 | for (i = 0; i < len; i++, ch++) { |
| 1837 | if (!usb_serial_handle_sysrq_char(tty, port, *ch)) | 1845 | if (!usb_serial_handle_sysrq_char(port, *ch)) |
| 1838 | tty_insert_flip_char(tty, *ch, flag); | 1846 | tty_insert_flip_char(tty, *ch, flag); |
| 1839 | } | 1847 | } |
| 1840 | } else { | 1848 | } else { |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 2e95857c9633..15a4583775ad 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -135,6 +135,18 @@ | |||
| 135 | #define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */ | 135 | #define FTDI_NDI_AURORA_SCU_PID 0xDA74 /* NDI Aurora SCU */ |
| 136 | 136 | ||
| 137 | /* | 137 | /* |
| 138 | * ChamSys Limited (www.chamsys.co.uk) USB wing/interface product IDs | ||
| 139 | */ | ||
| 140 | #define FTDI_CHAMSYS_24_MASTER_WING_PID 0xDAF8 | ||
| 141 | #define FTDI_CHAMSYS_PC_WING_PID 0xDAF9 | ||
| 142 | #define FTDI_CHAMSYS_USB_DMX_PID 0xDAFA | ||
| 143 | #define FTDI_CHAMSYS_MIDI_TIMECODE_PID 0xDAFB | ||
| 144 | #define FTDI_CHAMSYS_MINI_WING_PID 0xDAFC | ||
| 145 | #define FTDI_CHAMSYS_MAXI_WING_PID 0xDAFD | ||
| 146 | #define FTDI_CHAMSYS_MEDIA_WING_PID 0xDAFE | ||
| 147 | #define FTDI_CHAMSYS_WING_PID 0xDAFF | ||
| 148 | |||
| 149 | /* | ||
| 138 | * Westrex International devices submitted by Cory Lee | 150 | * Westrex International devices submitted by Cory Lee |
| 139 | */ | 151 | */ |
| 140 | #define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */ | 152 | #define FTDI_WESTREX_MODEL_777_PID 0xDC00 /* Model 777 */ |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 0b1a13384c6d..e6833e216fc9 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
| @@ -343,7 +343,7 @@ void usb_serial_generic_process_read_urb(struct urb *urb) | |||
| 343 | tty_insert_flip_string(tty, ch, urb->actual_length); | 343 | tty_insert_flip_string(tty, ch, urb->actual_length); |
| 344 | else { | 344 | else { |
| 345 | for (i = 0; i < urb->actual_length; i++, ch++) { | 345 | for (i = 0; i < urb->actual_length; i++, ch++) { |
| 346 | if (!usb_serial_handle_sysrq_char(tty, port, *ch)) | 346 | if (!usb_serial_handle_sysrq_char(port, *ch)) |
| 347 | tty_insert_flip_char(tty, *ch, TTY_NORMAL); | 347 | tty_insert_flip_char(tty, *ch, TTY_NORMAL); |
| 348 | } | 348 | } |
| 349 | } | 349 | } |
| @@ -448,12 +448,11 @@ void usb_serial_generic_unthrottle(struct tty_struct *tty) | |||
| 448 | EXPORT_SYMBOL_GPL(usb_serial_generic_unthrottle); | 448 | EXPORT_SYMBOL_GPL(usb_serial_generic_unthrottle); |
| 449 | 449 | ||
| 450 | #ifdef CONFIG_MAGIC_SYSRQ | 450 | #ifdef CONFIG_MAGIC_SYSRQ |
| 451 | int usb_serial_handle_sysrq_char(struct tty_struct *tty, | 451 | int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) |
| 452 | struct usb_serial_port *port, unsigned int ch) | ||
| 453 | { | 452 | { |
| 454 | if (port->sysrq && port->port.console) { | 453 | if (port->sysrq && port->port.console) { |
| 455 | if (ch && time_before(jiffies, port->sysrq)) { | 454 | if (ch && time_before(jiffies, port->sysrq)) { |
| 456 | handle_sysrq(ch, tty); | 455 | handle_sysrq(ch); |
| 457 | port->sysrq = 0; | 456 | port->sysrq = 0; |
| 458 | return 1; | 457 | return 1; |
| 459 | } | 458 | } |
| @@ -462,8 +461,7 @@ int usb_serial_handle_sysrq_char(struct tty_struct *tty, | |||
| 462 | return 0; | 461 | return 0; |
| 463 | } | 462 | } |
| 464 | #else | 463 | #else |
| 465 | int usb_serial_handle_sysrq_char(struct tty_struct *tty, | 464 | int usb_serial_handle_sysrq_char(struct usb_serial_port *port, unsigned int ch) |
| 466 | struct usb_serial_port *port, unsigned int ch) | ||
| 467 | { | 465 | { |
| 468 | return 0; | 466 | return 0; |
| 469 | } | 467 | } |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index 585b7e663740..1c9b6e9b2386 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
| @@ -119,16 +119,20 @@ | |||
| 119 | * by making a change here, in moschip_port_id_table, and in | 119 | * by making a change here, in moschip_port_id_table, and in |
| 120 | * moschip_id_table_combined | 120 | * moschip_id_table_combined |
| 121 | */ | 121 | */ |
| 122 | #define USB_VENDOR_ID_BANDB 0x0856 | 122 | #define USB_VENDOR_ID_BANDB 0x0856 |
| 123 | #define BANDB_DEVICE_ID_USO9ML2_2 0xAC22 | 123 | #define BANDB_DEVICE_ID_USO9ML2_2 0xAC22 |
| 124 | #define BANDB_DEVICE_ID_USO9ML2_4 0xAC24 | 124 | #define BANDB_DEVICE_ID_USO9ML2_2P 0xBC00 |
| 125 | #define BANDB_DEVICE_ID_US9ML2_2 0xAC29 | 125 | #define BANDB_DEVICE_ID_USO9ML2_4 0xAC24 |
| 126 | #define BANDB_DEVICE_ID_US9ML2_4 0xAC30 | 126 | #define BANDB_DEVICE_ID_USO9ML2_4P 0xBC01 |
| 127 | #define BANDB_DEVICE_ID_USPTL4_2 0xAC31 | 127 | #define BANDB_DEVICE_ID_US9ML2_2 0xAC29 |
| 128 | #define BANDB_DEVICE_ID_USPTL4_4 0xAC32 | 128 | #define BANDB_DEVICE_ID_US9ML2_4 0xAC30 |
| 129 | #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 | 129 | #define BANDB_DEVICE_ID_USPTL4_2 0xAC31 |
| 130 | #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 | 130 | #define BANDB_DEVICE_ID_USPTL4_4 0xAC32 |
| 131 | #define BANDB_DEVICE_ID_USOPTL2_4 0xAC24 | 131 | #define BANDB_DEVICE_ID_USOPTL4_2 0xAC42 |
| 132 | #define BANDB_DEVICE_ID_USOPTL4_2P 0xBC02 | ||
| 133 | #define BANDB_DEVICE_ID_USOPTL4_4 0xAC44 | ||
| 134 | #define BANDB_DEVICE_ID_USOPTL4_4P 0xBC03 | ||
| 135 | #define BANDB_DEVICE_ID_USOPTL2_4 0xAC24 | ||
| 132 | 136 | ||
| 133 | /* This driver also supports | 137 | /* This driver also supports |
| 134 | * ATEN UC2324 device using Moschip MCS7840 | 138 | * ATEN UC2324 device using Moschip MCS7840 |
| @@ -184,13 +188,17 @@ static const struct usb_device_id moschip_port_id_table[] = { | |||
| 184 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 188 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
| 185 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 189 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
| 186 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, | 190 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, |
| 191 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)}, | ||
| 187 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, | 192 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, |
| 193 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)}, | ||
| 188 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, | 194 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, |
| 189 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, | 195 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, |
| 190 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, | 196 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, |
| 191 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, | 197 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, |
| 192 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, | 198 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, |
| 199 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)}, | ||
| 193 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, | 200 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, |
| 201 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)}, | ||
| 194 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, | 202 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, |
| 195 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, | 203 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, |
| 196 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, | 204 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, |
| @@ -201,13 +209,17 @@ static const struct usb_device_id moschip_id_table_combined[] __devinitconst = { | |||
| 201 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, | 209 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7840)}, |
| 202 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, | 210 | {USB_DEVICE(USB_VENDOR_ID_MOSCHIP, MOSCHIP_DEVICE_ID_7820)}, |
| 203 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, | 211 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2)}, |
| 212 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_2P)}, | ||
| 204 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, | 213 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4)}, |
| 214 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USO9ML2_4P)}, | ||
| 205 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, | 215 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_2)}, |
| 206 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, | 216 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_US9ML2_4)}, |
| 207 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, | 217 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_2)}, |
| 208 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, | 218 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USPTL4_4)}, |
| 209 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, | 219 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2)}, |
| 220 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_2P)}, | ||
| 210 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, | 221 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4)}, |
| 222 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL4_4P)}, | ||
| 211 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, | 223 | {USB_DEVICE(USB_VENDOR_ID_BANDB, BANDB_DEVICE_ID_USOPTL2_4)}, |
| 212 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, | 224 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2324)}, |
| 213 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, | 225 | {USB_DEVICE(USB_VENDOR_ID_ATENINTL, ATENINTL_DEVICE_ID_UC2322)}, |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index adcbdb994de3..c46911af282f 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -164,6 +164,14 @@ static void option_instat_callback(struct urb *urb); | |||
| 164 | #define YISO_VENDOR_ID 0x0EAB | 164 | #define YISO_VENDOR_ID 0x0EAB |
| 165 | #define YISO_PRODUCT_U893 0xC893 | 165 | #define YISO_PRODUCT_U893 0xC893 |
| 166 | 166 | ||
| 167 | /* | ||
| 168 | * NOVATEL WIRELESS PRODUCTS | ||
| 169 | * | ||
| 170 | * Note from Novatel Wireless: | ||
| 171 | * If your Novatel modem does not work on linux, don't | ||
| 172 | * change the option module, but check our website. If | ||
| 173 | * that does not help, contact ddeschepper@nvtl.com | ||
| 174 | */ | ||
| 167 | /* MERLIN EVDO PRODUCTS */ | 175 | /* MERLIN EVDO PRODUCTS */ |
| 168 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 | 176 | #define NOVATELWIRELESS_PRODUCT_V640 0x1100 |
| 169 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 | 177 | #define NOVATELWIRELESS_PRODUCT_V620 0x1110 |
| @@ -185,24 +193,39 @@ static void option_instat_callback(struct urb *urb); | |||
| 185 | #define NOVATELWIRELESS_PRODUCT_EU730 0x2400 | 193 | #define NOVATELWIRELESS_PRODUCT_EU730 0x2400 |
| 186 | #define NOVATELWIRELESS_PRODUCT_EU740 0x2410 | 194 | #define NOVATELWIRELESS_PRODUCT_EU740 0x2410 |
| 187 | #define NOVATELWIRELESS_PRODUCT_EU870D 0x2420 | 195 | #define NOVATELWIRELESS_PRODUCT_EU870D 0x2420 |
| 188 | |||
| 189 | /* OVATION PRODUCTS */ | 196 | /* OVATION PRODUCTS */ |
| 190 | #define NOVATELWIRELESS_PRODUCT_MC727 0x4100 | 197 | #define NOVATELWIRELESS_PRODUCT_MC727 0x4100 |
| 191 | #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 | 198 | #define NOVATELWIRELESS_PRODUCT_MC950D 0x4400 |
| 192 | #define NOVATELWIRELESS_PRODUCT_U727 0x5010 | 199 | /* |
| 193 | #define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100 | 200 | * Note from Novatel Wireless: |
| 194 | #define NOVATELWIRELESS_PRODUCT_MC760 0x6000 | 201 | * All PID in the 5xxx range are currently reserved for |
| 202 | * auto-install CDROMs, and should not be added to this | ||
| 203 | * module. | ||
| 204 | * | ||
| 205 | * #define NOVATELWIRELESS_PRODUCT_U727 0x5010 | ||
| 206 | * #define NOVATELWIRELESS_PRODUCT_MC727_NEW 0x5100 | ||
| 207 | */ | ||
| 195 | #define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002 | 208 | #define NOVATELWIRELESS_PRODUCT_OVMC760 0x6002 |
| 196 | 209 | #define NOVATELWIRELESS_PRODUCT_MC780 0x6010 | |
| 197 | /* FUTURE NOVATEL PRODUCTS */ | 210 | #define NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED 0x6000 |
| 198 | #define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0X6001 | 211 | #define NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED 0x6001 |
| 199 | #define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0X7000 | 212 | #define NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED 0x7000 |
| 200 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0X7001 | 213 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED 0x7001 |
| 201 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0X8000 | 214 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3 0x7003 |
| 202 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0X8001 | 215 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4 0x7004 |
| 203 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0X9000 | 216 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5 0x7005 |
| 204 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0X9001 | 217 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED6 0x7006 |
| 205 | #define NOVATELWIRELESS_PRODUCT_GLOBAL 0XA001 | 218 | #define NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED7 0x7007 |
| 219 | #define NOVATELWIRELESS_PRODUCT_MC996D 0x7030 | ||
| 220 | #define NOVATELWIRELESS_PRODUCT_MF3470 0x7041 | ||
| 221 | #define NOVATELWIRELESS_PRODUCT_MC547 0x7042 | ||
| 222 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED 0x8000 | ||
| 223 | #define NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED 0x8001 | ||
| 224 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED 0x9000 | ||
| 225 | #define NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED 0x9001 | ||
| 226 | #define NOVATELWIRELESS_PRODUCT_G1 0xA001 | ||
| 227 | #define NOVATELWIRELESS_PRODUCT_G1_M 0xA002 | ||
| 228 | #define NOVATELWIRELESS_PRODUCT_G2 0xA010 | ||
| 206 | 229 | ||
| 207 | /* AMOI PRODUCTS */ | 230 | /* AMOI PRODUCTS */ |
| 208 | #define AMOI_VENDOR_ID 0x1614 | 231 | #define AMOI_VENDOR_ID 0x1614 |
| @@ -490,36 +513,44 @@ static const struct usb_device_id option_ids[] = { | |||
| 490 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) }, | 513 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) }, |
| 491 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) }, | 514 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) }, |
| 492 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) }, | 515 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) }, |
| 493 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */ | 516 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, |
| 494 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, /* Novatel Merlin V620/S620 */ | 517 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V620) }, |
| 495 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) }, /* Novatel Merlin EX720/V740/X720 */ | 518 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V740) }, |
| 496 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V720) }, /* Novatel Merlin V720/S720/PC720 */ | 519 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V720) }, |
| 497 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U730) }, /* Novatel U730/U740 (VF version) */ | 520 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U730) }, |
| 498 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U740) }, /* Novatel U740 */ | 521 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U740) }, |
| 499 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U870) }, /* Novatel U870 */ | 522 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U870) }, |
| 500 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_XU870) }, /* Novatel Merlin XU870 HSDPA/3G */ | 523 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_XU870) }, |
| 501 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_X950D) }, /* Novatel X950D */ | 524 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_X950D) }, |
| 502 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EV620) }, /* Novatel EV620/ES620 CDMA/EV-DO */ | 525 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EV620) }, |
| 503 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES720) }, /* Novatel ES620/ES720/U720/USB720 */ | 526 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES720) }, |
| 504 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E725) }, /* Novatel E725/E726 */ | 527 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_E725) }, |
| 505 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES620) }, /* Novatel Merlin ES620 SM Bus */ | 528 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_ES620) }, |
| 506 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU730) }, /* Novatel EU730 and Vodafone EU740 */ | 529 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU730) }, |
| 507 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU740) }, /* Novatel non-Vodafone EU740 */ | 530 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU740) }, |
| 508 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, /* Novatel EU850D/EU860D/EU870D */ | 531 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EU870D) }, |
| 509 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, /* Novatel MC930D/MC950D */ | 532 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC950D) }, |
| 510 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, /* Novatel MC727/U727/USB727 */ | 533 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727) }, |
| 511 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC727_NEW) }, /* Novatel MC727/U727/USB727 refresh */ | 534 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, |
| 512 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_U727) }, /* Novatel MC727/U727/USB727 */ | 535 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC780) }, |
| 513 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC760) }, /* Novatel MC760/U760/USB760 */ | 536 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_FULLSPEED) }, |
| 514 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_OVMC760) }, /* Novatel Ovation MC760 */ | 537 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, |
| 515 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_FULLSPEED) }, /* Novatel HSPA product */ | 538 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, |
| 516 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_FULLSPEED) }, /* Novatel EVDO Embedded product */ | 539 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, |
| 517 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_FULLSPEED) }, /* Novatel HSPA Embedded product */ | 540 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, |
| 518 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_HIGHSPEED) }, /* Novatel EVDO product */ | 541 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED3) }, |
| 519 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED) }, /* Novatel HSPA product */ | 542 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED4) }, |
| 520 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, /* Novatel EVDO Embedded product */ | 543 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED5) }, |
| 521 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, /* Novatel HSPA Embedded product */ | 544 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED6) }, |
| 522 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_GLOBAL) }, /* Novatel Global product */ | 545 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_HIGHSPEED7) }, |
| 546 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC996D) }, | ||
| 547 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MF3470) }, | ||
| 548 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_MC547) }, | ||
| 549 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_EVDO_EMBEDDED_HIGHSPEED) }, | ||
| 550 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_HSPA_EMBEDDED_HIGHSPEED) }, | ||
| 551 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1) }, | ||
| 552 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G1_M) }, | ||
| 553 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_G2) }, | ||
| 523 | 554 | ||
| 524 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, | 555 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01) }, |
| 525 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, | 556 | { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_H01A) }, |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index c98f0fb675ba..8ae4c6cbc38a 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
| @@ -789,7 +789,7 @@ static void pl2303_process_read_urb(struct urb *urb) | |||
| 789 | 789 | ||
| 790 | if (port->port.console && port->sysrq) { | 790 | if (port->port.console && port->sysrq) { |
| 791 | for (i = 0; i < urb->actual_length; ++i) | 791 | for (i = 0; i < urb->actual_length; ++i) |
| 792 | if (!usb_serial_handle_sysrq_char(tty, port, data[i])) | 792 | if (!usb_serial_handle_sysrq_char(port, data[i])) |
| 793 | tty_insert_flip_char(tty, data[i], tty_flag); | 793 | tty_insert_flip_char(tty, data[i], tty_flag); |
| 794 | } else { | 794 | } else { |
| 795 | tty_insert_flip_string_fixed_flag(tty, data, tty_flag, | 795 | tty_insert_flip_string_fixed_flag(tty, data, tty_flag, |
diff --git a/drivers/usb/serial/ssu100.c b/drivers/usb/serial/ssu100.c index 660c31f14999..e986002b3844 100644 --- a/drivers/usb/serial/ssu100.c +++ b/drivers/usb/serial/ssu100.c | |||
| @@ -46,7 +46,7 @@ | |||
| 46 | #define FULLPWRBIT 0x00000080 | 46 | #define FULLPWRBIT 0x00000080 |
| 47 | #define NEXT_BOARD_POWER_BIT 0x00000004 | 47 | #define NEXT_BOARD_POWER_BIT 0x00000004 |
| 48 | 48 | ||
| 49 | static int debug = 1; | 49 | static int debug; |
| 50 | 50 | ||
| 51 | /* Version Information */ | 51 | /* Version Information */ |
| 52 | #define DRIVER_VERSION "v0.1" | 52 | #define DRIVER_VERSION "v0.1" |
| @@ -672,7 +672,7 @@ static int ssu100_process_packet(struct tty_struct *tty, | |||
| 672 | 672 | ||
| 673 | if (port->port.console && port->sysrq) { | 673 | if (port->port.console && port->sysrq) { |
| 674 | for (i = 0; i < len; i++, ch++) { | 674 | for (i = 0; i < len; i++, ch++) { |
| 675 | if (!usb_serial_handle_sysrq_char(tty, port, *ch)) | 675 | if (!usb_serial_handle_sysrq_char(port, *ch)) |
| 676 | tty_insert_flip_char(tty, *ch, flag); | 676 | tty_insert_flip_char(tty, *ch, flag); |
| 677 | } | 677 | } |
| 678 | } else | 678 | } else |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e05557d52999..c579dcc9200c 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
| @@ -60,22 +60,25 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync, | |||
| 60 | return 0; | 60 | return 0; |
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | static void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) | ||
| 64 | { | ||
| 65 | INIT_LIST_HEAD(&work->node); | ||
| 66 | work->fn = fn; | ||
| 67 | init_waitqueue_head(&work->done); | ||
| 68 | work->flushing = 0; | ||
| 69 | work->queue_seq = work->done_seq = 0; | ||
| 70 | } | ||
| 71 | |||
| 63 | /* Init poll structure */ | 72 | /* Init poll structure */ |
| 64 | void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, | 73 | void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, |
| 65 | unsigned long mask, struct vhost_dev *dev) | 74 | unsigned long mask, struct vhost_dev *dev) |
| 66 | { | 75 | { |
| 67 | struct vhost_work *work = &poll->work; | ||
| 68 | |||
| 69 | init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); | 76 | init_waitqueue_func_entry(&poll->wait, vhost_poll_wakeup); |
| 70 | init_poll_funcptr(&poll->table, vhost_poll_func); | 77 | init_poll_funcptr(&poll->table, vhost_poll_func); |
| 71 | poll->mask = mask; | 78 | poll->mask = mask; |
| 72 | poll->dev = dev; | 79 | poll->dev = dev; |
| 73 | 80 | ||
| 74 | INIT_LIST_HEAD(&work->node); | 81 | vhost_work_init(&poll->work, fn); |
| 75 | work->fn = fn; | ||
| 76 | init_waitqueue_head(&work->done); | ||
| 77 | work->flushing = 0; | ||
| 78 | work->queue_seq = work->done_seq = 0; | ||
| 79 | } | 82 | } |
| 80 | 83 | ||
| 81 | /* Start polling a file. We add ourselves to file's wait queue. The caller must | 84 | /* Start polling a file. We add ourselves to file's wait queue. The caller must |
| @@ -95,35 +98,38 @@ void vhost_poll_stop(struct vhost_poll *poll) | |||
| 95 | remove_wait_queue(poll->wqh, &poll->wait); | 98 | remove_wait_queue(poll->wqh, &poll->wait); |
| 96 | } | 99 | } |
| 97 | 100 | ||
| 98 | /* Flush any work that has been scheduled. When calling this, don't hold any | 101 | static void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work) |
| 99 | * locks that are also used by the callback. */ | ||
| 100 | void vhost_poll_flush(struct vhost_poll *poll) | ||
| 101 | { | 102 | { |
| 102 | struct vhost_work *work = &poll->work; | ||
| 103 | unsigned seq; | 103 | unsigned seq; |
| 104 | int left; | 104 | int left; |
| 105 | int flushing; | 105 | int flushing; |
| 106 | 106 | ||
| 107 | spin_lock_irq(&poll->dev->work_lock); | 107 | spin_lock_irq(&dev->work_lock); |
| 108 | seq = work->queue_seq; | 108 | seq = work->queue_seq; |
| 109 | work->flushing++; | 109 | work->flushing++; |
| 110 | spin_unlock_irq(&poll->dev->work_lock); | 110 | spin_unlock_irq(&dev->work_lock); |
| 111 | wait_event(work->done, ({ | 111 | wait_event(work->done, ({ |
| 112 | spin_lock_irq(&poll->dev->work_lock); | 112 | spin_lock_irq(&dev->work_lock); |
| 113 | left = seq - work->done_seq <= 0; | 113 | left = seq - work->done_seq <= 0; |
| 114 | spin_unlock_irq(&poll->dev->work_lock); | 114 | spin_unlock_irq(&dev->work_lock); |
| 115 | left; | 115 | left; |
| 116 | })); | 116 | })); |
| 117 | spin_lock_irq(&poll->dev->work_lock); | 117 | spin_lock_irq(&dev->work_lock); |
| 118 | flushing = --work->flushing; | 118 | flushing = --work->flushing; |
| 119 | spin_unlock_irq(&poll->dev->work_lock); | 119 | spin_unlock_irq(&dev->work_lock); |
| 120 | BUG_ON(flushing < 0); | 120 | BUG_ON(flushing < 0); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | void vhost_poll_queue(struct vhost_poll *poll) | 123 | /* Flush any work that has been scheduled. When calling this, don't hold any |
| 124 | * locks that are also used by the callback. */ | ||
| 125 | void vhost_poll_flush(struct vhost_poll *poll) | ||
| 126 | { | ||
| 127 | vhost_work_flush(poll->dev, &poll->work); | ||
| 128 | } | ||
| 129 | |||
| 130 | static inline void vhost_work_queue(struct vhost_dev *dev, | ||
| 131 | struct vhost_work *work) | ||
| 124 | { | 132 | { |
| 125 | struct vhost_dev *dev = poll->dev; | ||
| 126 | struct vhost_work *work = &poll->work; | ||
| 127 | unsigned long flags; | 133 | unsigned long flags; |
| 128 | 134 | ||
| 129 | spin_lock_irqsave(&dev->work_lock, flags); | 135 | spin_lock_irqsave(&dev->work_lock, flags); |
| @@ -135,6 +141,11 @@ void vhost_poll_queue(struct vhost_poll *poll) | |||
| 135 | spin_unlock_irqrestore(&dev->work_lock, flags); | 141 | spin_unlock_irqrestore(&dev->work_lock, flags); |
| 136 | } | 142 | } |
| 137 | 143 | ||
| 144 | void vhost_poll_queue(struct vhost_poll *poll) | ||
| 145 | { | ||
| 146 | vhost_work_queue(poll->dev, &poll->work); | ||
| 147 | } | ||
| 148 | |||
| 138 | static void vhost_vq_reset(struct vhost_dev *dev, | 149 | static void vhost_vq_reset(struct vhost_dev *dev, |
| 139 | struct vhost_virtqueue *vq) | 150 | struct vhost_virtqueue *vq) |
| 140 | { | 151 | { |
| @@ -236,6 +247,29 @@ long vhost_dev_check_owner(struct vhost_dev *dev) | |||
| 236 | return dev->mm == current->mm ? 0 : -EPERM; | 247 | return dev->mm == current->mm ? 0 : -EPERM; |
| 237 | } | 248 | } |
| 238 | 249 | ||
| 250 | struct vhost_attach_cgroups_struct { | ||
| 251 | struct vhost_work work; | ||
| 252 | struct task_struct *owner; | ||
| 253 | int ret; | ||
| 254 | }; | ||
| 255 | |||
| 256 | static void vhost_attach_cgroups_work(struct vhost_work *work) | ||
| 257 | { | ||
| 258 | struct vhost_attach_cgroups_struct *s; | ||
| 259 | s = container_of(work, struct vhost_attach_cgroups_struct, work); | ||
| 260 | s->ret = cgroup_attach_task_all(s->owner, current); | ||
| 261 | } | ||
| 262 | |||
| 263 | static int vhost_attach_cgroups(struct vhost_dev *dev) | ||
| 264 | { | ||
| 265 | struct vhost_attach_cgroups_struct attach; | ||
| 266 | attach.owner = current; | ||
| 267 | vhost_work_init(&attach.work, vhost_attach_cgroups_work); | ||
| 268 | vhost_work_queue(dev, &attach.work); | ||
| 269 | vhost_work_flush(dev, &attach.work); | ||
| 270 | return attach.ret; | ||
| 271 | } | ||
| 272 | |||
| 239 | /* Caller should have device mutex */ | 273 | /* Caller should have device mutex */ |
| 240 | static long vhost_dev_set_owner(struct vhost_dev *dev) | 274 | static long vhost_dev_set_owner(struct vhost_dev *dev) |
| 241 | { | 275 | { |
| @@ -255,14 +289,16 @@ static long vhost_dev_set_owner(struct vhost_dev *dev) | |||
| 255 | } | 289 | } |
| 256 | 290 | ||
| 257 | dev->worker = worker; | 291 | dev->worker = worker; |
| 258 | err = cgroup_attach_task_current_cg(worker); | 292 | wake_up_process(worker); /* avoid contributing to loadavg */ |
| 293 | |||
| 294 | err = vhost_attach_cgroups(dev); | ||
| 259 | if (err) | 295 | if (err) |
| 260 | goto err_cgroup; | 296 | goto err_cgroup; |
| 261 | wake_up_process(worker); /* avoid contributing to loadavg */ | ||
| 262 | 297 | ||
| 263 | return 0; | 298 | return 0; |
| 264 | err_cgroup: | 299 | err_cgroup: |
| 265 | kthread_stop(worker); | 300 | kthread_stop(worker); |
| 301 | dev->worker = NULL; | ||
| 266 | err_worker: | 302 | err_worker: |
| 267 | if (dev->mm) | 303 | if (dev->mm) |
| 268 | mmput(dev->mm); | 304 | mmput(dev->mm); |
| @@ -323,7 +359,10 @@ void vhost_dev_cleanup(struct vhost_dev *dev) | |||
| 323 | dev->mm = NULL; | 359 | dev->mm = NULL; |
| 324 | 360 | ||
| 325 | WARN_ON(!list_empty(&dev->work_list)); | 361 | WARN_ON(!list_empty(&dev->work_list)); |
| 326 | kthread_stop(dev->worker); | 362 | if (dev->worker) { |
| 363 | kthread_stop(dev->worker); | ||
| 364 | dev->worker = NULL; | ||
| 365 | } | ||
| 327 | } | 366 | } |
| 328 | 367 | ||
| 329 | static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz) | 368 | static int log_access_ok(void __user *log_base, u64 addr, unsigned long sz) |
diff --git a/drivers/video/pxa168fb.c b/drivers/video/pxa168fb.c index c91a7f70f7b0..5d786bd3e304 100644 --- a/drivers/video/pxa168fb.c +++ b/drivers/video/pxa168fb.c | |||
| @@ -559,7 +559,7 @@ static struct fb_ops pxa168fb_ops = { | |||
| 559 | .fb_imageblit = cfb_imageblit, | 559 | .fb_imageblit = cfb_imageblit, |
| 560 | }; | 560 | }; |
| 561 | 561 | ||
| 562 | static int __init pxa168fb_init_mode(struct fb_info *info, | 562 | static int __devinit pxa168fb_init_mode(struct fb_info *info, |
| 563 | struct pxa168fb_mach_info *mi) | 563 | struct pxa168fb_mach_info *mi) |
| 564 | { | 564 | { |
| 565 | struct pxa168fb_info *fbi = info->par; | 565 | struct pxa168fb_info *fbi = info->par; |
| @@ -599,7 +599,7 @@ static int __init pxa168fb_init_mode(struct fb_info *info, | |||
| 599 | return ret; | 599 | return ret; |
| 600 | } | 600 | } |
| 601 | 601 | ||
| 602 | static int __init pxa168fb_probe(struct platform_device *pdev) | 602 | static int __devinit pxa168fb_probe(struct platform_device *pdev) |
| 603 | { | 603 | { |
| 604 | struct pxa168fb_mach_info *mi; | 604 | struct pxa168fb_mach_info *mi; |
| 605 | struct fb_info *info = 0; | 605 | struct fb_info *info = 0; |
| @@ -792,7 +792,7 @@ static struct platform_driver pxa168fb_driver = { | |||
| 792 | .probe = pxa168fb_probe, | 792 | .probe = pxa168fb_probe, |
| 793 | }; | 793 | }; |
| 794 | 794 | ||
| 795 | static int __devinit pxa168fb_init(void) | 795 | static int __init pxa168fb_init(void) |
| 796 | { | 796 | { |
| 797 | return platform_driver_register(&pxa168fb_driver); | 797 | return platform_driver_register(&pxa168fb_driver); |
| 798 | } | 798 | } |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 72f91bff29c7..13365ba35218 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
| @@ -112,6 +112,7 @@ static inline unsigned long *cpu_evtchn_mask(int cpu) | |||
| 112 | #define VALID_EVTCHN(chn) ((chn) != 0) | 112 | #define VALID_EVTCHN(chn) ((chn) != 0) |
| 113 | 113 | ||
| 114 | static struct irq_chip xen_dynamic_chip; | 114 | static struct irq_chip xen_dynamic_chip; |
| 115 | static struct irq_chip xen_percpu_chip; | ||
| 115 | 116 | ||
| 116 | /* Constructor for packed IRQ information. */ | 117 | /* Constructor for packed IRQ information. */ |
| 117 | static struct irq_info mk_unbound_info(void) | 118 | static struct irq_info mk_unbound_info(void) |
| @@ -377,7 +378,7 @@ int bind_evtchn_to_irq(unsigned int evtchn) | |||
| 377 | irq = find_unbound_irq(); | 378 | irq = find_unbound_irq(); |
| 378 | 379 | ||
| 379 | set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, | 380 | set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, |
| 380 | handle_level_irq, "event"); | 381 | handle_edge_irq, "event"); |
| 381 | 382 | ||
| 382 | evtchn_to_irq[evtchn] = irq; | 383 | evtchn_to_irq[evtchn] = irq; |
| 383 | irq_info[irq] = mk_evtchn_info(evtchn); | 384 | irq_info[irq] = mk_evtchn_info(evtchn); |
| @@ -403,8 +404,8 @@ static int bind_ipi_to_irq(unsigned int ipi, unsigned int cpu) | |||
| 403 | if (irq < 0) | 404 | if (irq < 0) |
| 404 | goto out; | 405 | goto out; |
| 405 | 406 | ||
| 406 | set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, | 407 | set_irq_chip_and_handler_name(irq, &xen_percpu_chip, |
| 407 | handle_level_irq, "ipi"); | 408 | handle_percpu_irq, "ipi"); |
| 408 | 409 | ||
| 409 | bind_ipi.vcpu = cpu; | 410 | bind_ipi.vcpu = cpu; |
| 410 | if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, | 411 | if (HYPERVISOR_event_channel_op(EVTCHNOP_bind_ipi, |
| @@ -444,8 +445,8 @@ static int bind_virq_to_irq(unsigned int virq, unsigned int cpu) | |||
| 444 | 445 | ||
| 445 | irq = find_unbound_irq(); | 446 | irq = find_unbound_irq(); |
| 446 | 447 | ||
| 447 | set_irq_chip_and_handler_name(irq, &xen_dynamic_chip, | 448 | set_irq_chip_and_handler_name(irq, &xen_percpu_chip, |
| 448 | handle_level_irq, "virq"); | 449 | handle_percpu_irq, "virq"); |
| 449 | 450 | ||
| 450 | evtchn_to_irq[evtchn] = irq; | 451 | evtchn_to_irq[evtchn] = irq; |
| 451 | irq_info[irq] = mk_virq_info(evtchn, virq); | 452 | irq_info[irq] = mk_virq_info(evtchn, virq); |
| @@ -964,6 +965,16 @@ static struct irq_chip xen_dynamic_chip __read_mostly = { | |||
| 964 | .retrigger = retrigger_dynirq, | 965 | .retrigger = retrigger_dynirq, |
| 965 | }; | 966 | }; |
| 966 | 967 | ||
| 968 | static struct irq_chip xen_percpu_chip __read_mostly = { | ||
| 969 | .name = "xen-percpu", | ||
| 970 | |||
| 971 | .disable = disable_dynirq, | ||
| 972 | .mask = disable_dynirq, | ||
| 973 | .unmask = enable_dynirq, | ||
| 974 | |||
| 975 | .ack = ack_dynirq, | ||
| 976 | }; | ||
| 977 | |||
| 967 | int xen_set_callback_via(uint64_t via) | 978 | int xen_set_callback_via(uint64_t via) |
| 968 | { | 979 | { |
| 969 | struct xen_hvm_param a; | 980 | struct xen_hvm_param a; |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 1799bd890315..ef9c7db52077 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
| @@ -237,7 +237,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec, | |||
| 237 | goto again; | 237 | goto again; |
| 238 | 238 | ||
| 239 | if (sysrq_key != '\0') | 239 | if (sysrq_key != '\0') |
| 240 | handle_sysrq(sysrq_key, NULL); | 240 | handle_sysrq(sysrq_key); |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | static struct xenbus_watch sysrq_watch = { | 243 | static struct xenbus_watch sysrq_watch = { |
