diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-09 00:27:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-09 00:27:51 -0400 |
commit | 141dc40ee343ab532717b235dd645e2d25ae3092 (patch) | |
tree | 2289e5d1ec20df5e465b9b629e291877f4d70485 /drivers | |
parent | 1c83d94ff646001f9ee83f0330a3933b55660927 (diff) | |
parent | 317ddd256b9c24b0d78fa8018f80f1e495481a10 (diff) |
Merge 3.10-rc5 into usb-next
We need the changes in this branch.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
229 files changed, 2139 insertions, 1127 deletions
diff --git a/drivers/acpi/apei/cper.c b/drivers/acpi/apei/cper.c index fefc2ca7cc3e..33dc6a004802 100644 --- a/drivers/acpi/apei/cper.c +++ b/drivers/acpi/apei/cper.c | |||
@@ -250,10 +250,6 @@ static const char *cper_pcie_port_type_strs[] = { | |||
250 | static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, | 250 | static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, |
251 | const struct acpi_hest_generic_data *gdata) | 251 | const struct acpi_hest_generic_data *gdata) |
252 | { | 252 | { |
253 | #ifdef CONFIG_ACPI_APEI_PCIEAER | ||
254 | struct pci_dev *dev; | ||
255 | #endif | ||
256 | |||
257 | if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) | 253 | if (pcie->validation_bits & CPER_PCIE_VALID_PORT_TYPE) |
258 | printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, | 254 | printk("%s""port_type: %d, %s\n", pfx, pcie->port_type, |
259 | pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ? | 255 | pcie->port_type < ARRAY_SIZE(cper_pcie_port_type_strs) ? |
@@ -285,20 +281,6 @@ static void cper_print_pcie(const char *pfx, const struct cper_sec_pcie *pcie, | |||
285 | printk( | 281 | printk( |
286 | "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", | 282 | "%s""bridge: secondary_status: 0x%04x, control: 0x%04x\n", |
287 | pfx, pcie->bridge.secondary_status, pcie->bridge.control); | 283 | pfx, pcie->bridge.secondary_status, pcie->bridge.control); |
288 | #ifdef CONFIG_ACPI_APEI_PCIEAER | ||
289 | dev = pci_get_domain_bus_and_slot(pcie->device_id.segment, | ||
290 | pcie->device_id.bus, pcie->device_id.function); | ||
291 | if (!dev) { | ||
292 | pr_err("PCI AER Cannot get PCI device %04x:%02x:%02x.%d\n", | ||
293 | pcie->device_id.segment, pcie->device_id.bus, | ||
294 | pcie->device_id.slot, pcie->device_id.function); | ||
295 | return; | ||
296 | } | ||
297 | if (pcie->validation_bits & CPER_PCIE_VALID_AER_INFO) | ||
298 | cper_print_aer(pfx, dev, gdata->error_severity, | ||
299 | (struct aer_capability_regs *) pcie->aer_info); | ||
300 | pci_dev_put(dev); | ||
301 | #endif | ||
302 | } | 284 | } |
303 | 285 | ||
304 | static const char *apei_estatus_section_flag_strs[] = { | 286 | static const char *apei_estatus_section_flag_strs[] = { |
diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index d668a8ae602b..fcd7d91cec34 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c | |||
@@ -454,7 +454,9 @@ static void ghes_do_proc(struct ghes *ghes, | |||
454 | aer_severity = cper_severity_to_aer(sev); | 454 | aer_severity = cper_severity_to_aer(sev); |
455 | aer_recover_queue(pcie_err->device_id.segment, | 455 | aer_recover_queue(pcie_err->device_id.segment, |
456 | pcie_err->device_id.bus, | 456 | pcie_err->device_id.bus, |
457 | devfn, aer_severity); | 457 | devfn, aer_severity, |
458 | (struct aer_capability_regs *) | ||
459 | pcie_err->aer_info); | ||
458 | } | 460 | } |
459 | 461 | ||
460 | } | 462 | } |
@@ -917,13 +919,14 @@ static int ghes_probe(struct platform_device *ghes_dev) | |||
917 | break; | 919 | break; |
918 | case ACPI_HEST_NOTIFY_EXTERNAL: | 920 | case ACPI_HEST_NOTIFY_EXTERNAL: |
919 | /* External interrupt vector is GSI */ | 921 | /* External interrupt vector is GSI */ |
920 | if (acpi_gsi_to_irq(generic->notify.vector, &ghes->irq)) { | 922 | rc = acpi_gsi_to_irq(generic->notify.vector, &ghes->irq); |
923 | if (rc) { | ||
921 | pr_err(GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n", | 924 | pr_err(GHES_PFX "Failed to map GSI to IRQ for generic hardware error source: %d\n", |
922 | generic->header.source_id); | 925 | generic->header.source_id); |
923 | goto err_edac_unreg; | 926 | goto err_edac_unreg; |
924 | } | 927 | } |
925 | if (request_irq(ghes->irq, ghes_irq_func, | 928 | rc = request_irq(ghes->irq, ghes_irq_func, 0, "GHES IRQ", ghes); |
926 | 0, "GHES IRQ", ghes)) { | 929 | if (rc) { |
927 | pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n", | 930 | pr_err(GHES_PFX "Failed to register IRQ for generic hardware error source: %d\n", |
928 | generic->header.source_id); | 931 | generic->header.source_id); |
929 | goto err_edac_unreg; | 932 | goto err_edac_unreg; |
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index bc493aa3af19..318fa32a141e 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -278,11 +278,13 @@ int acpi_bus_init_power(struct acpi_device *device) | |||
278 | if (result) | 278 | if (result) |
279 | return result; | 279 | return result; |
280 | } else if (state == ACPI_STATE_UNKNOWN) { | 280 | } else if (state == ACPI_STATE_UNKNOWN) { |
281 | /* No power resources and missing _PSC? Try to force D0. */ | 281 | /* |
282 | * No power resources and missing _PSC? Cross fingers and make | ||
283 | * it D0 in hope that this is what the BIOS put the device into. | ||
284 | * [We tried to force D0 here by executing _PS0, but that broke | ||
285 | * Toshiba P870-303 in a nasty way.] | ||
286 | */ | ||
282 | state = ACPI_STATE_D0; | 287 | state = ACPI_STATE_D0; |
283 | result = acpi_dev_pm_explicit_set(device, state); | ||
284 | if (result) | ||
285 | return result; | ||
286 | } | 288 | } |
287 | device->power.state = state; | 289 | device->power.state = state; |
288 | return 0; | 290 | return 0; |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 5b32e15a65ce..5d7075d25700 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -458,12 +458,28 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
458 | }, | 458 | }, |
459 | { | 459 | { |
460 | .callback = video_ignore_initial_backlight, | 460 | .callback = video_ignore_initial_backlight, |
461 | .ident = "HP Pavilion g6 Notebook PC", | ||
462 | .matches = { | ||
463 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | ||
464 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion g6 Notebook PC"), | ||
465 | }, | ||
466 | }, | ||
467 | { | ||
468 | .callback = video_ignore_initial_backlight, | ||
461 | .ident = "HP 1000 Notebook PC", | 469 | .ident = "HP 1000 Notebook PC", |
462 | .matches = { | 470 | .matches = { |
463 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | 471 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), |
464 | DMI_MATCH(DMI_PRODUCT_NAME, "HP 1000 Notebook PC"), | 472 | DMI_MATCH(DMI_PRODUCT_NAME, "HP 1000 Notebook PC"), |
465 | }, | 473 | }, |
466 | }, | 474 | }, |
475 | { | ||
476 | .callback = video_ignore_initial_backlight, | ||
477 | .ident = "HP Pavilion m4", | ||
478 | .matches = { | ||
479 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | ||
480 | DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion m4 Notebook PC"), | ||
481 | }, | ||
482 | }, | ||
467 | {} | 483 | {} |
468 | }; | 484 | }; |
469 | 485 | ||
diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c index 4e94ba29cb8d..9d0cf019ce59 100644 --- a/drivers/ata/acard-ahci.c +++ b/drivers/ata/acard-ahci.c | |||
@@ -2,7 +2,7 @@ | |||
2 | /* | 2 | /* |
3 | * acard-ahci.c - ACard AHCI SATA support | 3 | * acard-ahci.c - ACard AHCI SATA support |
4 | * | 4 | * |
5 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 5 | * Maintained by: Tejun Heo <tj@kernel.org> |
6 | * Please ALWAYS copy linux-ide@vger.kernel.org | 6 | * Please ALWAYS copy linux-ide@vger.kernel.org |
7 | * on emails. | 7 | * on emails. |
8 | * | 8 | * |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 251e57d38942..2b50dfdf1cfc 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ahci.c - AHCI SATA support | 2 | * ahci.c - AHCI SATA support |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
@@ -423,6 +423,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
423 | .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ | 423 | .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ |
424 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a), | 424 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a), |
425 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ | 425 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ |
426 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172), | ||
427 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ | ||
426 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192), | 428 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9192), |
427 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ | 429 | .driver_data = board_ahci_yes_fbs }, /* 88se9172 on some Gigabyte */ |
428 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3), | 430 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3), |
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index b830e6c9fe49..10b14d45cfd2 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ahci.h - Common AHCI SATA definitions and declarations | 2 | * ahci.h - Common AHCI SATA definitions and declarations |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 2f48123d74c4..9a8a674e8fac 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ata_piix.c - Intel PATA/SATA controllers | 2 | * ata_piix.c - Intel PATA/SATA controllers |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
@@ -151,6 +151,7 @@ enum piix_controller_ids { | |||
151 | piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ | 151 | piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */ |
152 | ich8_sata_snb, | 152 | ich8_sata_snb, |
153 | ich8_2port_sata_snb, | 153 | ich8_2port_sata_snb, |
154 | ich8_2port_sata_byt, | ||
154 | }; | 155 | }; |
155 | 156 | ||
156 | struct piix_map_db { | 157 | struct piix_map_db { |
@@ -334,6 +335,9 @@ static const struct pci_device_id piix_pci_tbl[] = { | |||
334 | { 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, | 335 | { 0x8086, 0x8d60, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata_snb }, |
335 | /* SATA Controller IDE (Wellsburg) */ | 336 | /* SATA Controller IDE (Wellsburg) */ |
336 | { 0x8086, 0x8d68, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | 337 | { 0x8086, 0x8d68, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
338 | /* SATA Controller IDE (BayTrail) */ | ||
339 | { 0x8086, 0x0F20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt }, | ||
340 | { 0x8086, 0x0F21, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata_byt }, | ||
337 | 341 | ||
338 | { } /* terminate list */ | 342 | { } /* terminate list */ |
339 | }; | 343 | }; |
@@ -441,6 +445,7 @@ static const struct piix_map_db *piix_map_db_table[] = { | |||
441 | [tolapai_sata] = &tolapai_map_db, | 445 | [tolapai_sata] = &tolapai_map_db, |
442 | [ich8_sata_snb] = &ich8_map_db, | 446 | [ich8_sata_snb] = &ich8_map_db, |
443 | [ich8_2port_sata_snb] = &ich8_2port_map_db, | 447 | [ich8_2port_sata_snb] = &ich8_2port_map_db, |
448 | [ich8_2port_sata_byt] = &ich8_2port_map_db, | ||
444 | }; | 449 | }; |
445 | 450 | ||
446 | static struct pci_bits piix_enable_bits[] = { | 451 | static struct pci_bits piix_enable_bits[] = { |
@@ -1254,6 +1259,16 @@ static struct ata_port_info piix_port_info[] = { | |||
1254 | .udma_mask = ATA_UDMA6, | 1259 | .udma_mask = ATA_UDMA6, |
1255 | .port_ops = &piix_sata_ops, | 1260 | .port_ops = &piix_sata_ops, |
1256 | }, | 1261 | }, |
1262 | |||
1263 | [ich8_2port_sata_byt] = | ||
1264 | { | ||
1265 | .flags = PIIX_SATA_FLAGS | PIIX_FLAG_SIDPR | PIIX_FLAG_PIO16, | ||
1266 | .pio_mask = ATA_PIO4, | ||
1267 | .mwdma_mask = ATA_MWDMA2, | ||
1268 | .udma_mask = ATA_UDMA6, | ||
1269 | .port_ops = &piix_sata_ops, | ||
1270 | }, | ||
1271 | |||
1257 | }; | 1272 | }; |
1258 | 1273 | ||
1259 | #define AHCI_PCI_BAR 5 | 1274 | #define AHCI_PCI_BAR 5 |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 34c82167b962..a70ff154f586 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * libahci.c - Common AHCI SATA low-level routines | 2 | * libahci.c - Common AHCI SATA low-level routines |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 63c743baf920..f2184276539d 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * libata-core.c - helper library for ATA | 2 | * libata-core.c - helper library for ATA |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
@@ -1602,6 +1602,12 @@ unsigned ata_exec_internal_sg(struct ata_device *dev, | |||
1602 | qc->tf = *tf; | 1602 | qc->tf = *tf; |
1603 | if (cdb) | 1603 | if (cdb) |
1604 | memcpy(qc->cdb, cdb, ATAPI_CDB_LEN); | 1604 | memcpy(qc->cdb, cdb, ATAPI_CDB_LEN); |
1605 | |||
1606 | /* some SATA bridges need us to indicate data xfer direction */ | ||
1607 | if (tf->protocol == ATAPI_PROT_DMA && (dev->flags & ATA_DFLAG_DMADIR) && | ||
1608 | dma_dir == DMA_FROM_DEVICE) | ||
1609 | qc->tf.feature |= ATAPI_DMADIR; | ||
1610 | |||
1605 | qc->flags |= ATA_QCFLAG_RESULT_TF; | 1611 | qc->flags |= ATA_QCFLAG_RESULT_TF; |
1606 | qc->dma_dir = dma_dir; | 1612 | qc->dma_dir = dma_dir; |
1607 | if (dma_dir != DMA_NONE) { | 1613 | if (dma_dir != DMA_NONE) { |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index f9476fb3ac43..c69fcce505c0 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * libata-eh.c - libata error handling | 2 | * libata-eh.c - libata error handling |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index dd310b27b24c..0101af541436 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * libata-scsi.c - helper library for ATA | 2 | * libata-scsi.c - helper library for ATA |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index d8af325a6bda..b603720b877d 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * libata-sff.c - helper library for PCI IDE BMDMA | 2 | * libata-sff.c - helper library for PCI IDE BMDMA |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/pdc_adma.c b/drivers/ata/pdc_adma.c index 505333340ad5..8ea6e6afd041 100644 --- a/drivers/ata/pdc_adma.c +++ b/drivers/ata/pdc_adma.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * pdc_adma.c - Pacific Digital Corporation ADMA | 2 | * pdc_adma.c - Pacific Digital Corporation ADMA |
3 | * | 3 | * |
4 | * Maintained by: Mark Lord <mlord@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * | 5 | * |
6 | * Copyright 2005 Mark Lord | 6 | * Copyright 2005 Mark Lord |
7 | * | 7 | * |
diff --git a/drivers/ata/sata_promise.c b/drivers/ata/sata_promise.c index fb0dd87f8893..958ba2a420c3 100644 --- a/drivers/ata/sata_promise.c +++ b/drivers/ata/sata_promise.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * sata_promise.c - Promise SATA | 2 | * sata_promise.c - Promise SATA |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Mikael Pettersson <mikpe@it.uu.se> | 5 | * Mikael Pettersson <mikpe@it.uu.se> |
6 | * Please ALWAYS copy linux-ide@vger.kernel.org | 6 | * Please ALWAYS copy linux-ide@vger.kernel.org |
7 | * on emails. | 7 | * on emails. |
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c index 4799868bd733..249c8a289bfd 100644 --- a/drivers/ata/sata_rcar.c +++ b/drivers/ata/sata_rcar.c | |||
@@ -549,6 +549,7 @@ static void sata_rcar_bmdma_start(struct ata_queued_cmd *qc) | |||
549 | 549 | ||
550 | /* start host DMA transaction */ | 550 | /* start host DMA transaction */ |
551 | dmactl = ioread32(priv->base + ATAPI_CONTROL1_REG); | 551 | dmactl = ioread32(priv->base + ATAPI_CONTROL1_REG); |
552 | dmactl &= ~ATAPI_CONTROL1_STOP; | ||
552 | dmactl |= ATAPI_CONTROL1_START; | 553 | dmactl |= ATAPI_CONTROL1_START; |
553 | iowrite32(dmactl, priv->base + ATAPI_CONTROL1_REG); | 554 | iowrite32(dmactl, priv->base + ATAPI_CONTROL1_REG); |
554 | } | 555 | } |
@@ -618,17 +619,16 @@ static struct ata_port_operations sata_rcar_port_ops = { | |||
618 | .bmdma_status = sata_rcar_bmdma_status, | 619 | .bmdma_status = sata_rcar_bmdma_status, |
619 | }; | 620 | }; |
620 | 621 | ||
621 | static int sata_rcar_serr_interrupt(struct ata_port *ap) | 622 | static void sata_rcar_serr_interrupt(struct ata_port *ap) |
622 | { | 623 | { |
623 | struct sata_rcar_priv *priv = ap->host->private_data; | 624 | struct sata_rcar_priv *priv = ap->host->private_data; |
624 | struct ata_eh_info *ehi = &ap->link.eh_info; | 625 | struct ata_eh_info *ehi = &ap->link.eh_info; |
625 | int freeze = 0; | 626 | int freeze = 0; |
626 | int handled = 0; | ||
627 | u32 serror; | 627 | u32 serror; |
628 | 628 | ||
629 | serror = ioread32(priv->base + SCRSERR_REG); | 629 | serror = ioread32(priv->base + SCRSERR_REG); |
630 | if (!serror) | 630 | if (!serror) |
631 | return 0; | 631 | return; |
632 | 632 | ||
633 | DPRINTK("SError @host_intr: 0x%x\n", serror); | 633 | DPRINTK("SError @host_intr: 0x%x\n", serror); |
634 | 634 | ||
@@ -641,7 +641,6 @@ static int sata_rcar_serr_interrupt(struct ata_port *ap) | |||
641 | ata_ehi_push_desc(ehi, "%s", "hotplug"); | 641 | ata_ehi_push_desc(ehi, "%s", "hotplug"); |
642 | 642 | ||
643 | freeze = serror & SERR_COMM_WAKE ? 0 : 1; | 643 | freeze = serror & SERR_COMM_WAKE ? 0 : 1; |
644 | handled = 1; | ||
645 | } | 644 | } |
646 | 645 | ||
647 | /* freeze or abort */ | 646 | /* freeze or abort */ |
@@ -649,11 +648,9 @@ static int sata_rcar_serr_interrupt(struct ata_port *ap) | |||
649 | ata_port_freeze(ap); | 648 | ata_port_freeze(ap); |
650 | else | 649 | else |
651 | ata_port_abort(ap); | 650 | ata_port_abort(ap); |
652 | |||
653 | return handled; | ||
654 | } | 651 | } |
655 | 652 | ||
656 | static int sata_rcar_ata_interrupt(struct ata_port *ap) | 653 | static void sata_rcar_ata_interrupt(struct ata_port *ap) |
657 | { | 654 | { |
658 | struct ata_queued_cmd *qc; | 655 | struct ata_queued_cmd *qc; |
659 | int handled = 0; | 656 | int handled = 0; |
@@ -662,7 +659,9 @@ static int sata_rcar_ata_interrupt(struct ata_port *ap) | |||
662 | if (qc) | 659 | if (qc) |
663 | handled |= ata_bmdma_port_intr(ap, qc); | 660 | handled |= ata_bmdma_port_intr(ap, qc); |
664 | 661 | ||
665 | return handled; | 662 | /* be sure to clear ATA interrupt */ |
663 | if (!handled) | ||
664 | sata_rcar_check_status(ap); | ||
666 | } | 665 | } |
667 | 666 | ||
668 | static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance) | 667 | static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance) |
@@ -677,20 +676,21 @@ static irqreturn_t sata_rcar_interrupt(int irq, void *dev_instance) | |||
677 | spin_lock_irqsave(&host->lock, flags); | 676 | spin_lock_irqsave(&host->lock, flags); |
678 | 677 | ||
679 | sataintstat = ioread32(priv->base + SATAINTSTAT_REG); | 678 | sataintstat = ioread32(priv->base + SATAINTSTAT_REG); |
679 | sataintstat &= SATA_RCAR_INT_MASK; | ||
680 | if (!sataintstat) | 680 | if (!sataintstat) |
681 | goto done; | 681 | goto done; |
682 | /* ack */ | 682 | /* ack */ |
683 | iowrite32(sataintstat & ~SATA_RCAR_INT_MASK, | 683 | iowrite32(~sataintstat & 0x7ff, priv->base + SATAINTSTAT_REG); |
684 | priv->base + SATAINTSTAT_REG); | ||
685 | 684 | ||
686 | ap = host->ports[0]; | 685 | ap = host->ports[0]; |
687 | 686 | ||
688 | if (sataintstat & SATAINTSTAT_ATA) | 687 | if (sataintstat & SATAINTSTAT_ATA) |
689 | handled |= sata_rcar_ata_interrupt(ap); | 688 | sata_rcar_ata_interrupt(ap); |
690 | 689 | ||
691 | if (sataintstat & SATAINTSTAT_SERR) | 690 | if (sataintstat & SATAINTSTAT_SERR) |
692 | handled |= sata_rcar_serr_interrupt(ap); | 691 | sata_rcar_serr_interrupt(ap); |
693 | 692 | ||
693 | handled = 1; | ||
694 | done: | 694 | done: |
695 | spin_unlock_irqrestore(&host->lock, flags); | 695 | spin_unlock_irqrestore(&host->lock, flags); |
696 | 696 | ||
diff --git a/drivers/ata/sata_sil.c b/drivers/ata/sata_sil.c index a7b31672c4b7..0ae3ca4bf5c0 100644 --- a/drivers/ata/sata_sil.c +++ b/drivers/ata/sata_sil.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * sata_sil.c - Silicon Image SATA | 2 | * sata_sil.c - Silicon Image SATA |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/sata_sx4.c b/drivers/ata/sata_sx4.c index 7b7127a58f51..9947010afc0f 100644 --- a/drivers/ata/sata_sx4.c +++ b/drivers/ata/sata_sx4.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * sata_sx4.c - Promise SATA | 2 | * sata_sx4.c - Promise SATA |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index 5913ea9d57b2..87f056e54a9d 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * sata_via.c - VIA Serial ATA controllers | 2 | * sata_via.c - VIA Serial ATA controllers |
3 | * | 3 | * |
4 | * Maintained by: Jeff Garzik <jgarzik@pobox.com> | 4 | * Maintained by: Tejun Heo <tj@kernel.org> |
5 | * Please ALWAYS copy linux-ide@vger.kernel.org | 5 | * Please ALWAYS copy linux-ide@vger.kernel.org |
6 | * on emails. | 6 | * on emails. |
7 | * | 7 | * |
diff --git a/drivers/clk/clk-si5351.c b/drivers/clk/clk-si5351.c index 892728412e9d..24f553673b72 100644 --- a/drivers/clk/clk-si5351.c +++ b/drivers/clk/clk-si5351.c | |||
@@ -932,7 +932,7 @@ static unsigned long si5351_clkout_recalc_rate(struct clk_hw *hw, | |||
932 | unsigned char reg; | 932 | unsigned char reg; |
933 | unsigned char rdiv; | 933 | unsigned char rdiv; |
934 | 934 | ||
935 | if (hwdata->num > 5) | 935 | if (hwdata->num <= 5) |
936 | reg = si5351_msynth_params_address(hwdata->num) + 2; | 936 | reg = si5351_msynth_params_address(hwdata->num) + 2; |
937 | else | 937 | else |
938 | reg = SI5351_CLK6_7_OUTPUT_DIVIDER; | 938 | reg = SI5351_CLK6_7_OUTPUT_DIVIDER; |
@@ -1477,6 +1477,16 @@ static int si5351_i2c_probe(struct i2c_client *client, | |||
1477 | return -EINVAL; | 1477 | return -EINVAL; |
1478 | } | 1478 | } |
1479 | drvdata->onecell.clks[n] = clk; | 1479 | drvdata->onecell.clks[n] = clk; |
1480 | |||
1481 | /* set initial clkout rate */ | ||
1482 | if (pdata->clkout[n].rate != 0) { | ||
1483 | int ret; | ||
1484 | ret = clk_set_rate(clk, pdata->clkout[n].rate); | ||
1485 | if (ret != 0) { | ||
1486 | dev_err(&client->dev, "Cannot set rate : %d\n", | ||
1487 | ret); | ||
1488 | } | ||
1489 | } | ||
1480 | } | 1490 | } |
1481 | 1491 | ||
1482 | ret = of_clk_add_provider(client->dev.of_node, of_clk_src_onecell_get, | 1492 | ret = of_clk_add_provider(client->dev.of_node, of_clk_src_onecell_get, |
diff --git a/drivers/clk/clk-vt8500.c b/drivers/clk/clk-vt8500.c index debf688afa8e..553ac35bcc91 100644 --- a/drivers/clk/clk-vt8500.c +++ b/drivers/clk/clk-vt8500.c | |||
@@ -183,7 +183,7 @@ static int vt8500_dclk_set_rate(struct clk_hw *hw, unsigned long rate, | |||
183 | writel(divisor, cdev->div_reg); | 183 | writel(divisor, cdev->div_reg); |
184 | vt8500_pmc_wait_busy(); | 184 | vt8500_pmc_wait_busy(); |
185 | 185 | ||
186 | spin_lock_irqsave(cdev->lock, flags); | 186 | spin_unlock_irqrestore(cdev->lock, flags); |
187 | 187 | ||
188 | return 0; | 188 | return 0; |
189 | } | 189 | } |
diff --git a/drivers/clk/mxs/clk-imx28.c b/drivers/clk/mxs/clk-imx28.c index d0e5eed146de..4faf0afc44cd 100644 --- a/drivers/clk/mxs/clk-imx28.c +++ b/drivers/clk/mxs/clk-imx28.c | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/clk.h> | 12 | #include <linux/clk.h> |
13 | #include <linux/clk/mxs.h> | ||
13 | #include <linux/clkdev.h> | 14 | #include <linux/clkdev.h> |
14 | #include <linux/err.h> | 15 | #include <linux/err.h> |
15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
diff --git a/drivers/clk/samsung/clk-exynos4.c b/drivers/clk/samsung/clk-exynos4.c index d0940e69d034..3c1f88868f29 100644 --- a/drivers/clk/samsung/clk-exynos4.c +++ b/drivers/clk/samsung/clk-exynos4.c | |||
@@ -791,7 +791,8 @@ struct samsung_gate_clock exynos4210_gate_clks[] __initdata = { | |||
791 | GATE(smmu_pcie, "smmu_pcie", "aclk133", GATE_IP_FSYS, 18, 0, 0), | 791 | GATE(smmu_pcie, "smmu_pcie", "aclk133", GATE_IP_FSYS, 18, 0, 0), |
792 | GATE(modemif, "modemif", "aclk100", GATE_IP_PERIL, 28, 0, 0), | 792 | GATE(modemif, "modemif", "aclk100", GATE_IP_PERIL, 28, 0, 0), |
793 | GATE(chipid, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0), | 793 | GATE(chipid, "chipid", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0), |
794 | GATE(sysreg, "sysreg", "aclk100", E4210_GATE_IP_PERIR, 0, 0, 0), | 794 | GATE(sysreg, "sysreg", "aclk100", E4210_GATE_IP_PERIR, 0, |
795 | CLK_IGNORE_UNUSED, 0), | ||
795 | GATE(hdmi_cec, "hdmi_cec", "aclk100", E4210_GATE_IP_PERIR, 11, 0, 0), | 796 | GATE(hdmi_cec, "hdmi_cec", "aclk100", E4210_GATE_IP_PERIR, 11, 0, 0), |
796 | GATE(smmu_rotator, "smmu_rotator", "aclk200", | 797 | GATE(smmu_rotator, "smmu_rotator", "aclk200", |
797 | E4210_GATE_IP_IMAGE, 4, 0, 0), | 798 | E4210_GATE_IP_IMAGE, 4, 0, 0), |
@@ -819,7 +820,8 @@ struct samsung_gate_clock exynos4x12_gate_clks[] __initdata = { | |||
819 | GATE(smmu_mdma, "smmu_mdma", "aclk200", E4X12_GATE_IP_IMAGE, 5, 0, 0), | 820 | GATE(smmu_mdma, "smmu_mdma", "aclk200", E4X12_GATE_IP_IMAGE, 5, 0, 0), |
820 | GATE(mipi_hsi, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0), | 821 | GATE(mipi_hsi, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0), |
821 | GATE(chipid, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0), | 822 | GATE(chipid, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0), |
822 | GATE(sysreg, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1, 0, 0), | 823 | GATE(sysreg, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1, |
824 | CLK_IGNORE_UNUSED, 0), | ||
823 | GATE(hdmi_cec, "hdmi_cec", "aclk100", E4X12_GATE_IP_PERIR, 11, 0, 0), | 825 | GATE(hdmi_cec, "hdmi_cec", "aclk100", E4X12_GATE_IP_PERIR, 11, 0, 0), |
824 | GATE(sclk_mdnie0, "sclk_mdnie0", "div_mdnie0", | 826 | GATE(sclk_mdnie0, "sclk_mdnie0", "div_mdnie0", |
825 | SRC_MASK_LCD0, 4, CLK_SET_RATE_PARENT, 0), | 827 | SRC_MASK_LCD0, 4, CLK_SET_RATE_PARENT, 0), |
diff --git a/drivers/clk/ux500/clk-sysctrl.c b/drivers/clk/ux500/clk-sysctrl.c index bc7e9bde792b..e364c9d4aa60 100644 --- a/drivers/clk/ux500/clk-sysctrl.c +++ b/drivers/clk/ux500/clk-sysctrl.c | |||
@@ -145,7 +145,13 @@ static struct clk *clk_reg_sysctrl(struct device *dev, | |||
145 | return ERR_PTR(-ENOMEM); | 145 | return ERR_PTR(-ENOMEM); |
146 | } | 146 | } |
147 | 147 | ||
148 | for (i = 0; i < num_parents; i++) { | 148 | /* set main clock registers */ |
149 | clk->reg_sel[0] = reg_sel[0]; | ||
150 | clk->reg_bits[0] = reg_bits[0]; | ||
151 | clk->reg_mask[0] = reg_mask[0]; | ||
152 | |||
153 | /* handle clocks with more than one parent */ | ||
154 | for (i = 1; i < num_parents; i++) { | ||
149 | clk->reg_sel[i] = reg_sel[i]; | 155 | clk->reg_sel[i] = reg_sel[i]; |
150 | clk->reg_bits[i] = reg_bits[i]; | 156 | clk->reg_bits[i] = reg_bits[i]; |
151 | clk->reg_mask[i] = reg_mask[i]; | 157 | clk->reg_mask[i] = reg_mask[i]; |
diff --git a/drivers/clk/ux500/u8500_clk.c b/drivers/clk/ux500/u8500_clk.c index 0b4f35a5ffc2..80069c370a47 100644 --- a/drivers/clk/ux500/u8500_clk.c +++ b/drivers/clk/ux500/u8500_clk.c | |||
@@ -325,7 +325,7 @@ void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, | |||
325 | clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", clkrst3_base, | 325 | clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", clkrst3_base, |
326 | BIT(0), 0); | 326 | BIT(0), 0); |
327 | clk_register_clkdev(clk, "fsmc", NULL); | 327 | clk_register_clkdev(clk, "fsmc", NULL); |
328 | clk_register_clkdev(clk, NULL, "smsc911x"); | 328 | clk_register_clkdev(clk, NULL, "smsc911x.0"); |
329 | 329 | ||
330 | clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", clkrst3_base, | 330 | clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", clkrst3_base, |
331 | BIT(1), 0); | 331 | BIT(1), 0); |
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 11b8b4b54ceb..edc089e9d0c4 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c | |||
@@ -347,11 +347,11 @@ static u32 get_cur_val(const struct cpumask *mask) | |||
347 | switch (per_cpu(acfreq_data, cpumask_first(mask))->cpu_feature) { | 347 | switch (per_cpu(acfreq_data, cpumask_first(mask))->cpu_feature) { |
348 | case SYSTEM_INTEL_MSR_CAPABLE: | 348 | case SYSTEM_INTEL_MSR_CAPABLE: |
349 | cmd.type = SYSTEM_INTEL_MSR_CAPABLE; | 349 | cmd.type = SYSTEM_INTEL_MSR_CAPABLE; |
350 | cmd.addr.msr.reg = MSR_IA32_PERF_STATUS; | 350 | cmd.addr.msr.reg = MSR_IA32_PERF_CTL; |
351 | break; | 351 | break; |
352 | case SYSTEM_AMD_MSR_CAPABLE: | 352 | case SYSTEM_AMD_MSR_CAPABLE: |
353 | cmd.type = SYSTEM_AMD_MSR_CAPABLE; | 353 | cmd.type = SYSTEM_AMD_MSR_CAPABLE; |
354 | cmd.addr.msr.reg = MSR_AMD_PERF_STATUS; | 354 | cmd.addr.msr.reg = MSR_AMD_PERF_CTL; |
355 | break; | 355 | break; |
356 | case SYSTEM_IO_CAPABLE: | 356 | case SYSTEM_IO_CAPABLE: |
357 | cmd.type = SYSTEM_IO_CAPABLE; | 357 | cmd.type = SYSTEM_IO_CAPABLE; |
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index a64eb8b70444..ad1fde277661 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c | |||
@@ -45,7 +45,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, | |||
45 | struct cpufreq_freqs freqs; | 45 | struct cpufreq_freqs freqs; |
46 | struct opp *opp; | 46 | struct opp *opp; |
47 | unsigned long volt = 0, volt_old = 0, tol = 0; | 47 | unsigned long volt = 0, volt_old = 0, tol = 0; |
48 | long freq_Hz; | 48 | long freq_Hz, freq_exact; |
49 | unsigned int index; | 49 | unsigned int index; |
50 | int ret; | 50 | int ret; |
51 | 51 | ||
@@ -60,6 +60,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, | |||
60 | freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000); | 60 | freq_Hz = clk_round_rate(cpu_clk, freq_table[index].frequency * 1000); |
61 | if (freq_Hz < 0) | 61 | if (freq_Hz < 0) |
62 | freq_Hz = freq_table[index].frequency * 1000; | 62 | freq_Hz = freq_table[index].frequency * 1000; |
63 | freq_exact = freq_Hz; | ||
63 | freqs.new = freq_Hz / 1000; | 64 | freqs.new = freq_Hz / 1000; |
64 | freqs.old = clk_get_rate(cpu_clk) / 1000; | 65 | freqs.old = clk_get_rate(cpu_clk) / 1000; |
65 | 66 | ||
@@ -98,7 +99,7 @@ static int cpu0_set_target(struct cpufreq_policy *policy, | |||
98 | } | 99 | } |
99 | } | 100 | } |
100 | 101 | ||
101 | ret = clk_set_rate(cpu_clk, freqs.new * 1000); | 102 | ret = clk_set_rate(cpu_clk, freq_exact); |
102 | if (ret) { | 103 | if (ret) { |
103 | pr_err("failed to set clock rate: %d\n", ret); | 104 | pr_err("failed to set clock rate: %d\n", ret); |
104 | if (cpu_reg) | 105 | if (cpu_reg) |
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c index 5af40ad82d23..dc9b72e25c1a 100644 --- a/drivers/cpufreq/cpufreq_governor.c +++ b/drivers/cpufreq/cpufreq_governor.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/tick.h> | 26 | #include <linux/tick.h> |
27 | #include <linux/types.h> | 27 | #include <linux/types.h> |
28 | #include <linux/workqueue.h> | 28 | #include <linux/workqueue.h> |
29 | #include <linux/cpu.h> | ||
29 | 30 | ||
30 | #include "cpufreq_governor.h" | 31 | #include "cpufreq_governor.h" |
31 | 32 | ||
@@ -180,8 +181,10 @@ void gov_queue_work(struct dbs_data *dbs_data, struct cpufreq_policy *policy, | |||
180 | if (!all_cpus) { | 181 | if (!all_cpus) { |
181 | __gov_queue_work(smp_processor_id(), dbs_data, delay); | 182 | __gov_queue_work(smp_processor_id(), dbs_data, delay); |
182 | } else { | 183 | } else { |
184 | get_online_cpus(); | ||
183 | for_each_cpu(i, policy->cpus) | 185 | for_each_cpu(i, policy->cpus) |
184 | __gov_queue_work(i, dbs_data, delay); | 186 | __gov_queue_work(i, dbs_data, delay); |
187 | put_online_cpus(); | ||
185 | } | 188 | } |
186 | } | 189 | } |
187 | EXPORT_SYMBOL_GPL(gov_queue_work); | 190 | EXPORT_SYMBOL_GPL(gov_queue_work); |
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 765fdf5ce579..bf416a8391a7 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c | |||
@@ -1154,7 +1154,7 @@ static struct aead_edesc *aead_edesc_alloc(struct aead_request *req, | |||
1154 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); | 1154 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); |
1155 | 1155 | ||
1156 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, | 1156 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, |
1157 | DMA_BIDIRECTIONAL, assoc_chained); | 1157 | DMA_TO_DEVICE, assoc_chained); |
1158 | if (likely(req->src == req->dst)) { | 1158 | if (likely(req->src == req->dst)) { |
1159 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, | 1159 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, |
1160 | DMA_BIDIRECTIONAL, src_chained); | 1160 | DMA_BIDIRECTIONAL, src_chained); |
@@ -1336,7 +1336,7 @@ static struct aead_edesc *aead_giv_edesc_alloc(struct aead_givcrypt_request | |||
1336 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); | 1336 | dst_nents = sg_count(req->dst, req->cryptlen, &dst_chained); |
1337 | 1337 | ||
1338 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, | 1338 | sgc = dma_map_sg_chained(jrdev, req->assoc, assoc_nents ? : 1, |
1339 | DMA_BIDIRECTIONAL, assoc_chained); | 1339 | DMA_TO_DEVICE, assoc_chained); |
1340 | if (likely(req->src == req->dst)) { | 1340 | if (likely(req->src == req->dst)) { |
1341 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, | 1341 | sgc = dma_map_sg_chained(jrdev, req->src, src_nents ? : 1, |
1342 | DMA_BIDIRECTIONAL, src_chained); | 1342 | DMA_BIDIRECTIONAL, src_chained); |
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index d8ce4ecfef18..e88ded2c8d2f 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -716,8 +716,7 @@ static int dmatest_func(void *data) | |||
716 | } | 716 | } |
717 | dma_async_issue_pending(chan); | 717 | dma_async_issue_pending(chan); |
718 | 718 | ||
719 | wait_event_freezable_timeout(done_wait, | 719 | wait_event_freezable_timeout(done_wait, done.done, |
720 | done.done || kthread_should_stop(), | ||
721 | msecs_to_jiffies(params->timeout)); | 720 | msecs_to_jiffies(params->timeout)); |
722 | 721 | ||
723 | status = dma_async_is_tx_complete(chan, cookie, NULL, NULL); | 722 | status = dma_async_is_tx_complete(chan, cookie, NULL, NULL); |
@@ -997,7 +996,6 @@ static void stop_threaded_test(struct dmatest_info *info) | |||
997 | static int __restart_threaded_test(struct dmatest_info *info, bool run) | 996 | static int __restart_threaded_test(struct dmatest_info *info, bool run) |
998 | { | 997 | { |
999 | struct dmatest_params *params = &info->params; | 998 | struct dmatest_params *params = &info->params; |
1000 | int ret; | ||
1001 | 999 | ||
1002 | /* Stop any running test first */ | 1000 | /* Stop any running test first */ |
1003 | __stop_threaded_test(info); | 1001 | __stop_threaded_test(info); |
@@ -1012,13 +1010,23 @@ static int __restart_threaded_test(struct dmatest_info *info, bool run) | |||
1012 | memcpy(params, &info->dbgfs_params, sizeof(*params)); | 1010 | memcpy(params, &info->dbgfs_params, sizeof(*params)); |
1013 | 1011 | ||
1014 | /* Run test with new parameters */ | 1012 | /* Run test with new parameters */ |
1015 | ret = __run_threaded_test(info); | 1013 | return __run_threaded_test(info); |
1016 | if (ret) { | 1014 | } |
1017 | __stop_threaded_test(info); | 1015 | |
1018 | pr_err("dmatest: Can't run test\n"); | 1016 | static bool __is_threaded_test_run(struct dmatest_info *info) |
1017 | { | ||
1018 | struct dmatest_chan *dtc; | ||
1019 | |||
1020 | list_for_each_entry(dtc, &info->channels, node) { | ||
1021 | struct dmatest_thread *thread; | ||
1022 | |||
1023 | list_for_each_entry(thread, &dtc->threads, node) { | ||
1024 | if (!thread->done) | ||
1025 | return true; | ||
1026 | } | ||
1019 | } | 1027 | } |
1020 | 1028 | ||
1021 | return ret; | 1029 | return false; |
1022 | } | 1030 | } |
1023 | 1031 | ||
1024 | static ssize_t dtf_write_string(void *to, size_t available, loff_t *ppos, | 1032 | static ssize_t dtf_write_string(void *to, size_t available, loff_t *ppos, |
@@ -1091,22 +1099,10 @@ static ssize_t dtf_read_run(struct file *file, char __user *user_buf, | |||
1091 | { | 1099 | { |
1092 | struct dmatest_info *info = file->private_data; | 1100 | struct dmatest_info *info = file->private_data; |
1093 | char buf[3]; | 1101 | char buf[3]; |
1094 | struct dmatest_chan *dtc; | ||
1095 | bool alive = false; | ||
1096 | 1102 | ||
1097 | mutex_lock(&info->lock); | 1103 | mutex_lock(&info->lock); |
1098 | list_for_each_entry(dtc, &info->channels, node) { | ||
1099 | struct dmatest_thread *thread; | ||
1100 | |||
1101 | list_for_each_entry(thread, &dtc->threads, node) { | ||
1102 | if (!thread->done) { | ||
1103 | alive = true; | ||
1104 | break; | ||
1105 | } | ||
1106 | } | ||
1107 | } | ||
1108 | 1104 | ||
1109 | if (alive) { | 1105 | if (__is_threaded_test_run(info)) { |
1110 | buf[0] = 'Y'; | 1106 | buf[0] = 'Y'; |
1111 | } else { | 1107 | } else { |
1112 | __stop_threaded_test(info); | 1108 | __stop_threaded_test(info); |
@@ -1132,7 +1128,12 @@ static ssize_t dtf_write_run(struct file *file, const char __user *user_buf, | |||
1132 | 1128 | ||
1133 | if (strtobool(buf, &bv) == 0) { | 1129 | if (strtobool(buf, &bv) == 0) { |
1134 | mutex_lock(&info->lock); | 1130 | mutex_lock(&info->lock); |
1135 | ret = __restart_threaded_test(info, bv); | 1131 | |
1132 | if (__is_threaded_test_run(info)) | ||
1133 | ret = -EBUSY; | ||
1134 | else | ||
1135 | ret = __restart_threaded_test(info, bv); | ||
1136 | |||
1136 | mutex_unlock(&info->lock); | 1137 | mutex_unlock(&info->lock); |
1137 | } | 1138 | } |
1138 | 1139 | ||
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 1734feec47b1..71bf4ec300ea 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c | |||
@@ -1566,10 +1566,12 @@ static void dma_tc_handle(struct d40_chan *d40c) | |||
1566 | return; | 1566 | return; |
1567 | } | 1567 | } |
1568 | 1568 | ||
1569 | if (d40_queue_start(d40c) == NULL) | 1569 | if (d40_queue_start(d40c) == NULL) { |
1570 | d40c->busy = false; | 1570 | d40c->busy = false; |
1571 | pm_runtime_mark_last_busy(d40c->base->dev); | 1571 | |
1572 | pm_runtime_put_autosuspend(d40c->base->dev); | 1572 | pm_runtime_mark_last_busy(d40c->base->dev); |
1573 | pm_runtime_put_autosuspend(d40c->base->dev); | ||
1574 | } | ||
1573 | 1575 | ||
1574 | d40_desc_remove(d40d); | 1576 | d40_desc_remove(d40d); |
1575 | d40_desc_done(d40c, d40d); | 1577 | d40_desc_done(d40c, d40d); |
diff --git a/drivers/firmware/efi/efivars.c b/drivers/firmware/efi/efivars.c index b623c599e572..8bd1bb6dbe47 100644 --- a/drivers/firmware/efi/efivars.c +++ b/drivers/firmware/efi/efivars.c | |||
@@ -523,13 +523,11 @@ static void efivar_update_sysfs_entries(struct work_struct *work) | |||
523 | struct efivar_entry *entry; | 523 | struct efivar_entry *entry; |
524 | int err; | 524 | int err; |
525 | 525 | ||
526 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); | ||
527 | if (!entry) | ||
528 | return; | ||
529 | |||
530 | /* Add new sysfs entries */ | 526 | /* Add new sysfs entries */ |
531 | while (1) { | 527 | while (1) { |
532 | memset(entry, 0, sizeof(*entry)); | 528 | entry = kzalloc(sizeof(*entry), GFP_KERNEL); |
529 | if (!entry) | ||
530 | return; | ||
533 | 531 | ||
534 | err = efivar_init(efivar_update_sysfs_entry, entry, | 532 | err = efivar_init(efivar_update_sysfs_entry, entry, |
535 | true, false, &efivar_sysfs_list); | 533 | true, false, &efivar_sysfs_list); |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index a6a8643a6a77..8bcce7866d36 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -1054,7 +1054,7 @@ EXPORT_SYMBOL(drm_vblank_off); | |||
1054 | */ | 1054 | */ |
1055 | void drm_vblank_pre_modeset(struct drm_device *dev, int crtc) | 1055 | void drm_vblank_pre_modeset(struct drm_device *dev, int crtc) |
1056 | { | 1056 | { |
1057 | /* vblank is not initialized (IRQ not installed ?) */ | 1057 | /* vblank is not initialized (IRQ not installed ?), or has been freed */ |
1058 | if (!dev->num_crtcs) | 1058 | if (!dev->num_crtcs) |
1059 | return; | 1059 | return; |
1060 | /* | 1060 | /* |
@@ -1076,6 +1076,10 @@ void drm_vblank_post_modeset(struct drm_device *dev, int crtc) | |||
1076 | { | 1076 | { |
1077 | unsigned long irqflags; | 1077 | unsigned long irqflags; |
1078 | 1078 | ||
1079 | /* vblank is not initialized (IRQ not installed ?), or has been freed */ | ||
1080 | if (!dev->num_crtcs) | ||
1081 | return; | ||
1082 | |||
1079 | if (dev->vblank_inmodeset[crtc]) { | 1083 | if (dev->vblank_inmodeset[crtc]) { |
1080 | spin_lock_irqsave(&dev->vbl_lock, irqflags); | 1084 | spin_lock_irqsave(&dev->vbl_lock, irqflags); |
1081 | dev->vblank_disable_allowed = 1; | 1085 | dev->vblank_disable_allowed = 1; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index e8894bc9e6d5..c200e4d71e3d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c | |||
@@ -48,6 +48,8 @@ struct exynos_drm_crtc { | |||
48 | unsigned int pipe; | 48 | unsigned int pipe; |
49 | unsigned int dpms; | 49 | unsigned int dpms; |
50 | enum exynos_crtc_mode mode; | 50 | enum exynos_crtc_mode mode; |
51 | wait_queue_head_t pending_flip_queue; | ||
52 | atomic_t pending_flip; | ||
51 | }; | 53 | }; |
52 | 54 | ||
53 | static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) | 55 | static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) |
@@ -61,6 +63,13 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode) | |||
61 | return; | 63 | return; |
62 | } | 64 | } |
63 | 65 | ||
66 | if (mode > DRM_MODE_DPMS_ON) { | ||
67 | /* wait for the completion of page flip. */ | ||
68 | wait_event(exynos_crtc->pending_flip_queue, | ||
69 | atomic_read(&exynos_crtc->pending_flip) == 0); | ||
70 | drm_vblank_off(crtc->dev, exynos_crtc->pipe); | ||
71 | } | ||
72 | |||
64 | exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms); | 73 | exynos_drm_fn_encoder(crtc, &mode, exynos_drm_encoder_crtc_dpms); |
65 | exynos_crtc->dpms = mode; | 74 | exynos_crtc->dpms = mode; |
66 | } | 75 | } |
@@ -217,7 +226,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, | |||
217 | ret = drm_vblank_get(dev, exynos_crtc->pipe); | 226 | ret = drm_vblank_get(dev, exynos_crtc->pipe); |
218 | if (ret) { | 227 | if (ret) { |
219 | DRM_DEBUG("failed to acquire vblank counter\n"); | 228 | DRM_DEBUG("failed to acquire vblank counter\n"); |
220 | list_del(&event->base.link); | ||
221 | 229 | ||
222 | goto out; | 230 | goto out; |
223 | } | 231 | } |
@@ -225,6 +233,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, | |||
225 | spin_lock_irq(&dev->event_lock); | 233 | spin_lock_irq(&dev->event_lock); |
226 | list_add_tail(&event->base.link, | 234 | list_add_tail(&event->base.link, |
227 | &dev_priv->pageflip_event_list); | 235 | &dev_priv->pageflip_event_list); |
236 | atomic_set(&exynos_crtc->pending_flip, 1); | ||
228 | spin_unlock_irq(&dev->event_lock); | 237 | spin_unlock_irq(&dev->event_lock); |
229 | 238 | ||
230 | crtc->fb = fb; | 239 | crtc->fb = fb; |
@@ -344,6 +353,8 @@ int exynos_drm_crtc_create(struct drm_device *dev, unsigned int nr) | |||
344 | 353 | ||
345 | exynos_crtc->pipe = nr; | 354 | exynos_crtc->pipe = nr; |
346 | exynos_crtc->dpms = DRM_MODE_DPMS_OFF; | 355 | exynos_crtc->dpms = DRM_MODE_DPMS_OFF; |
356 | init_waitqueue_head(&exynos_crtc->pending_flip_queue); | ||
357 | atomic_set(&exynos_crtc->pending_flip, 0); | ||
347 | exynos_crtc->plane = exynos_plane_init(dev, 1 << nr, true); | 358 | exynos_crtc->plane = exynos_plane_init(dev, 1 << nr, true); |
348 | if (!exynos_crtc->plane) { | 359 | if (!exynos_crtc->plane) { |
349 | kfree(exynos_crtc); | 360 | kfree(exynos_crtc); |
@@ -398,7 +409,8 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc) | |||
398 | { | 409 | { |
399 | struct exynos_drm_private *dev_priv = dev->dev_private; | 410 | struct exynos_drm_private *dev_priv = dev->dev_private; |
400 | struct drm_pending_vblank_event *e, *t; | 411 | struct drm_pending_vblank_event *e, *t; |
401 | struct timeval now; | 412 | struct drm_crtc *drm_crtc = dev_priv->crtc[crtc]; |
413 | struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc); | ||
402 | unsigned long flags; | 414 | unsigned long flags; |
403 | 415 | ||
404 | DRM_DEBUG_KMS("%s\n", __FILE__); | 416 | DRM_DEBUG_KMS("%s\n", __FILE__); |
@@ -411,14 +423,11 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int crtc) | |||
411 | if (crtc != e->pipe) | 423 | if (crtc != e->pipe) |
412 | continue; | 424 | continue; |
413 | 425 | ||
414 | do_gettimeofday(&now); | 426 | list_del(&e->base.link); |
415 | e->event.sequence = 0; | 427 | drm_send_vblank_event(dev, -1, e); |
416 | e->event.tv_sec = now.tv_sec; | ||
417 | e->event.tv_usec = now.tv_usec; | ||
418 | |||
419 | list_move_tail(&e->base.link, &e->base.file_priv->event_list); | ||
420 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
421 | drm_vblank_put(dev, crtc); | 428 | drm_vblank_put(dev, crtc); |
429 | atomic_set(&exynos_crtc->pending_flip, 0); | ||
430 | wake_up(&exynos_crtc->pending_flip_queue); | ||
422 | } | 431 | } |
423 | 432 | ||
424 | spin_unlock_irqrestore(&dev->event_lock, flags); | 433 | spin_unlock_irqrestore(&dev->event_lock, flags); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c index 68f0045f86b8..8f007aaeffc3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c | |||
@@ -182,7 +182,7 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper, | |||
182 | 182 | ||
183 | helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd, | 183 | helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd, |
184 | &exynos_gem_obj->base); | 184 | &exynos_gem_obj->base); |
185 | if (IS_ERR_OR_NULL(helper->fb)) { | 185 | if (IS_ERR(helper->fb)) { |
186 | DRM_ERROR("failed to create drm framebuffer.\n"); | 186 | DRM_ERROR("failed to create drm framebuffer.\n"); |
187 | ret = PTR_ERR(helper->fb); | 187 | ret = PTR_ERR(helper->fb); |
188 | goto err_destroy_gem; | 188 | goto err_destroy_gem; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimc.c b/drivers/gpu/drm/exynos/exynos_drm_fimc.c index 773f583fa964..4a1616a18ab7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimc.c | |||
@@ -12,9 +12,9 @@ | |||
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/mfd/syscon.h> | ||
16 | #include <linux/module.h> | 15 | #include <linux/module.h> |
17 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/mfd/syscon.h> | ||
18 | #include <linux/regmap.h> | 18 | #include <linux/regmap.h> |
19 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
20 | #include <linux/pm_runtime.h> | 20 | #include <linux/pm_runtime.h> |
@@ -1845,7 +1845,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1845 | } | 1845 | } |
1846 | 1846 | ||
1847 | ctx->irq = res->start; | 1847 | ctx->irq = res->start; |
1848 | ret = request_threaded_irq(ctx->irq, NULL, fimc_irq_handler, | 1848 | ret = devm_request_threaded_irq(dev, ctx->irq, NULL, fimc_irq_handler, |
1849 | IRQF_ONESHOT, "drm_fimc", ctx); | 1849 | IRQF_ONESHOT, "drm_fimc", ctx); |
1850 | if (ret < 0) { | 1850 | if (ret < 0) { |
1851 | dev_err(dev, "failed to request irq.\n"); | 1851 | dev_err(dev, "failed to request irq.\n"); |
@@ -1854,7 +1854,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1854 | 1854 | ||
1855 | ret = fimc_setup_clocks(ctx); | 1855 | ret = fimc_setup_clocks(ctx); |
1856 | if (ret < 0) | 1856 | if (ret < 0) |
1857 | goto err_free_irq; | 1857 | return ret; |
1858 | 1858 | ||
1859 | ippdrv = &ctx->ippdrv; | 1859 | ippdrv = &ctx->ippdrv; |
1860 | ippdrv->ops[EXYNOS_DRM_OPS_SRC] = &fimc_src_ops; | 1860 | ippdrv->ops[EXYNOS_DRM_OPS_SRC] = &fimc_src_ops; |
@@ -1884,7 +1884,7 @@ static int fimc_probe(struct platform_device *pdev) | |||
1884 | goto err_pm_dis; | 1884 | goto err_pm_dis; |
1885 | } | 1885 | } |
1886 | 1886 | ||
1887 | dev_info(&pdev->dev, "drm fimc registered successfully.\n"); | 1887 | dev_info(dev, "drm fimc registered successfully.\n"); |
1888 | 1888 | ||
1889 | return 0; | 1889 | return 0; |
1890 | 1890 | ||
@@ -1892,8 +1892,6 @@ err_pm_dis: | |||
1892 | pm_runtime_disable(dev); | 1892 | pm_runtime_disable(dev); |
1893 | err_put_clk: | 1893 | err_put_clk: |
1894 | fimc_put_clocks(ctx); | 1894 | fimc_put_clocks(ctx); |
1895 | err_free_irq: | ||
1896 | free_irq(ctx->irq, ctx); | ||
1897 | 1895 | ||
1898 | return ret; | 1896 | return ret; |
1899 | } | 1897 | } |
@@ -1911,8 +1909,6 @@ static int fimc_remove(struct platform_device *pdev) | |||
1911 | pm_runtime_set_suspended(dev); | 1909 | pm_runtime_set_suspended(dev); |
1912 | pm_runtime_disable(dev); | 1910 | pm_runtime_disable(dev); |
1913 | 1911 | ||
1914 | free_irq(ctx->irq, ctx); | ||
1915 | |||
1916 | return 0; | 1912 | return 0; |
1917 | } | 1913 | } |
1918 | 1914 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 746b282b343a..97c61dbffd82 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c | |||
@@ -885,7 +885,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
885 | 885 | ||
886 | DRM_DEBUG_KMS("%s\n", __FILE__); | 886 | DRM_DEBUG_KMS("%s\n", __FILE__); |
887 | 887 | ||
888 | if (pdev->dev.of_node) { | 888 | if (dev->of_node) { |
889 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); | 889 | pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); |
890 | if (!pdata) { | 890 | if (!pdata) { |
891 | DRM_ERROR("memory allocation for pdata failed\n"); | 891 | DRM_ERROR("memory allocation for pdata failed\n"); |
@@ -899,7 +899,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
899 | return ret; | 899 | return ret; |
900 | } | 900 | } |
901 | } else { | 901 | } else { |
902 | pdata = pdev->dev.platform_data; | 902 | pdata = dev->platform_data; |
903 | if (!pdata) { | 903 | if (!pdata) { |
904 | DRM_ERROR("no platform data specified\n"); | 904 | DRM_ERROR("no platform data specified\n"); |
905 | return -EINVAL; | 905 | return -EINVAL; |
@@ -912,7 +912,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
912 | return -EINVAL; | 912 | return -EINVAL; |
913 | } | 913 | } |
914 | 914 | ||
915 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 915 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
916 | if (!ctx) | 916 | if (!ctx) |
917 | return -ENOMEM; | 917 | return -ENOMEM; |
918 | 918 | ||
@@ -930,7 +930,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
930 | 930 | ||
931 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 931 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
932 | 932 | ||
933 | ctx->regs = devm_ioremap_resource(&pdev->dev, res); | 933 | ctx->regs = devm_ioremap_resource(dev, res); |
934 | if (IS_ERR(ctx->regs)) | 934 | if (IS_ERR(ctx->regs)) |
935 | return PTR_ERR(ctx->regs); | 935 | return PTR_ERR(ctx->regs); |
936 | 936 | ||
@@ -942,7 +942,7 @@ static int fimd_probe(struct platform_device *pdev) | |||
942 | 942 | ||
943 | ctx->irq = res->start; | 943 | ctx->irq = res->start; |
944 | 944 | ||
945 | ret = devm_request_irq(&pdev->dev, ctx->irq, fimd_irq_handler, | 945 | ret = devm_request_irq(dev, ctx->irq, fimd_irq_handler, |
946 | 0, "drm_fimd", ctx); | 946 | 0, "drm_fimd", ctx); |
947 | if (ret) { | 947 | if (ret) { |
948 | dev_err(dev, "irq request failed.\n"); | 948 | dev_err(dev, "irq request failed.\n"); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index 47a493c8a71f..af75434ee4d7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c | |||
@@ -1379,7 +1379,7 @@ static int g2d_probe(struct platform_device *pdev) | |||
1379 | struct exynos_drm_subdrv *subdrv; | 1379 | struct exynos_drm_subdrv *subdrv; |
1380 | int ret; | 1380 | int ret; |
1381 | 1381 | ||
1382 | g2d = devm_kzalloc(&pdev->dev, sizeof(*g2d), GFP_KERNEL); | 1382 | g2d = devm_kzalloc(dev, sizeof(*g2d), GFP_KERNEL); |
1383 | if (!g2d) { | 1383 | if (!g2d) { |
1384 | dev_err(dev, "failed to allocate driver data\n"); | 1384 | dev_err(dev, "failed to allocate driver data\n"); |
1385 | return -ENOMEM; | 1385 | return -ENOMEM; |
@@ -1417,7 +1417,7 @@ static int g2d_probe(struct platform_device *pdev) | |||
1417 | 1417 | ||
1418 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1418 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1419 | 1419 | ||
1420 | g2d->regs = devm_ioremap_resource(&pdev->dev, res); | 1420 | g2d->regs = devm_ioremap_resource(dev, res); |
1421 | if (IS_ERR(g2d->regs)) { | 1421 | if (IS_ERR(g2d->regs)) { |
1422 | ret = PTR_ERR(g2d->regs); | 1422 | ret = PTR_ERR(g2d->regs); |
1423 | goto err_put_clk; | 1423 | goto err_put_clk; |
@@ -1430,7 +1430,7 @@ static int g2d_probe(struct platform_device *pdev) | |||
1430 | goto err_put_clk; | 1430 | goto err_put_clk; |
1431 | } | 1431 | } |
1432 | 1432 | ||
1433 | ret = devm_request_irq(&pdev->dev, g2d->irq, g2d_irq_handler, 0, | 1433 | ret = devm_request_irq(dev, g2d->irq, g2d_irq_handler, 0, |
1434 | "drm_g2d", g2d); | 1434 | "drm_g2d", g2d); |
1435 | if (ret < 0) { | 1435 | if (ret < 0) { |
1436 | dev_err(dev, "irq request failed\n"); | 1436 | dev_err(dev, "irq request failed\n"); |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c index 7841c3b8a20e..762f40d548b7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c | |||
@@ -1704,7 +1704,7 @@ static int gsc_probe(struct platform_device *pdev) | |||
1704 | } | 1704 | } |
1705 | 1705 | ||
1706 | ctx->irq = res->start; | 1706 | ctx->irq = res->start; |
1707 | ret = request_threaded_irq(ctx->irq, NULL, gsc_irq_handler, | 1707 | ret = devm_request_threaded_irq(dev, ctx->irq, NULL, gsc_irq_handler, |
1708 | IRQF_ONESHOT, "drm_gsc", ctx); | 1708 | IRQF_ONESHOT, "drm_gsc", ctx); |
1709 | if (ret < 0) { | 1709 | if (ret < 0) { |
1710 | dev_err(dev, "failed to request irq.\n"); | 1710 | dev_err(dev, "failed to request irq.\n"); |
@@ -1725,7 +1725,7 @@ static int gsc_probe(struct platform_device *pdev) | |||
1725 | ret = gsc_init_prop_list(ippdrv); | 1725 | ret = gsc_init_prop_list(ippdrv); |
1726 | if (ret < 0) { | 1726 | if (ret < 0) { |
1727 | dev_err(dev, "failed to init property list.\n"); | 1727 | dev_err(dev, "failed to init property list.\n"); |
1728 | goto err_get_irq; | 1728 | return ret; |
1729 | } | 1729 | } |
1730 | 1730 | ||
1731 | DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id, | 1731 | DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id, |
@@ -1743,15 +1743,12 @@ static int gsc_probe(struct platform_device *pdev) | |||
1743 | goto err_ippdrv_register; | 1743 | goto err_ippdrv_register; |
1744 | } | 1744 | } |
1745 | 1745 | ||
1746 | dev_info(&pdev->dev, "drm gsc registered successfully.\n"); | 1746 | dev_info(dev, "drm gsc registered successfully.\n"); |
1747 | 1747 | ||
1748 | return 0; | 1748 | return 0; |
1749 | 1749 | ||
1750 | err_ippdrv_register: | 1750 | err_ippdrv_register: |
1751 | devm_kfree(dev, ippdrv->prop_list); | ||
1752 | pm_runtime_disable(dev); | 1751 | pm_runtime_disable(dev); |
1753 | err_get_irq: | ||
1754 | free_irq(ctx->irq, ctx); | ||
1755 | return ret; | 1752 | return ret; |
1756 | } | 1753 | } |
1757 | 1754 | ||
@@ -1761,15 +1758,12 @@ static int gsc_remove(struct platform_device *pdev) | |||
1761 | struct gsc_context *ctx = get_gsc_context(dev); | 1758 | struct gsc_context *ctx = get_gsc_context(dev); |
1762 | struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; | 1759 | struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv; |
1763 | 1760 | ||
1764 | devm_kfree(dev, ippdrv->prop_list); | ||
1765 | exynos_drm_ippdrv_unregister(ippdrv); | 1761 | exynos_drm_ippdrv_unregister(ippdrv); |
1766 | mutex_destroy(&ctx->lock); | 1762 | mutex_destroy(&ctx->lock); |
1767 | 1763 | ||
1768 | pm_runtime_set_suspended(dev); | 1764 | pm_runtime_set_suspended(dev); |
1769 | pm_runtime_disable(dev); | 1765 | pm_runtime_disable(dev); |
1770 | 1766 | ||
1771 | free_irq(ctx->irq, ctx); | ||
1772 | |||
1773 | return 0; | 1767 | return 0; |
1774 | } | 1768 | } |
1775 | 1769 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c index ba2f0f1aa05f..437fb947e46d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_hdmi.c | |||
@@ -442,7 +442,7 @@ static int exynos_drm_hdmi_probe(struct platform_device *pdev) | |||
442 | 442 | ||
443 | DRM_DEBUG_KMS("%s\n", __FILE__); | 443 | DRM_DEBUG_KMS("%s\n", __FILE__); |
444 | 444 | ||
445 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 445 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
446 | if (!ctx) { | 446 | if (!ctx) { |
447 | DRM_LOG_KMS("failed to alloc common hdmi context.\n"); | 447 | DRM_LOG_KMS("failed to alloc common hdmi context.\n"); |
448 | return -ENOMEM; | 448 | return -ENOMEM; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_ipp.c b/drivers/gpu/drm/exynos/exynos_drm_ipp.c index 29d2ad314490..be1e88463466 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_ipp.c +++ b/drivers/gpu/drm/exynos/exynos_drm_ipp.c | |||
@@ -222,7 +222,7 @@ static struct exynos_drm_ippdrv *ipp_find_driver(struct ipp_context *ctx, | |||
222 | /* find ipp driver using idr */ | 222 | /* find ipp driver using idr */ |
223 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, | 223 | ippdrv = ipp_find_obj(&ctx->ipp_idr, &ctx->ipp_lock, |
224 | ipp_id); | 224 | ipp_id); |
225 | if (IS_ERR_OR_NULL(ippdrv)) { | 225 | if (IS_ERR(ippdrv)) { |
226 | DRM_ERROR("not found ipp%d driver.\n", ipp_id); | 226 | DRM_ERROR("not found ipp%d driver.\n", ipp_id); |
227 | return ippdrv; | 227 | return ippdrv; |
228 | } | 228 | } |
@@ -388,7 +388,7 @@ static int ipp_find_and_set_property(struct drm_exynos_ipp_property *property) | |||
388 | DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id); | 388 | DRM_DEBUG_KMS("%s:prop_id[%d]\n", __func__, prop_id); |
389 | 389 | ||
390 | ippdrv = ipp_find_drv_by_handle(prop_id); | 390 | ippdrv = ipp_find_drv_by_handle(prop_id); |
391 | if (IS_ERR_OR_NULL(ippdrv)) { | 391 | if (IS_ERR(ippdrv)) { |
392 | DRM_ERROR("failed to get ipp driver.\n"); | 392 | DRM_ERROR("failed to get ipp driver.\n"); |
393 | return -EINVAL; | 393 | return -EINVAL; |
394 | } | 394 | } |
@@ -492,7 +492,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, | |||
492 | 492 | ||
493 | /* find ipp driver using ipp id */ | 493 | /* find ipp driver using ipp id */ |
494 | ippdrv = ipp_find_driver(ctx, property); | 494 | ippdrv = ipp_find_driver(ctx, property); |
495 | if (IS_ERR_OR_NULL(ippdrv)) { | 495 | if (IS_ERR(ippdrv)) { |
496 | DRM_ERROR("failed to get ipp driver.\n"); | 496 | DRM_ERROR("failed to get ipp driver.\n"); |
497 | return -EINVAL; | 497 | return -EINVAL; |
498 | } | 498 | } |
@@ -521,19 +521,19 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, | |||
521 | c_node->state = IPP_STATE_IDLE; | 521 | c_node->state = IPP_STATE_IDLE; |
522 | 522 | ||
523 | c_node->start_work = ipp_create_cmd_work(); | 523 | c_node->start_work = ipp_create_cmd_work(); |
524 | if (IS_ERR_OR_NULL(c_node->start_work)) { | 524 | if (IS_ERR(c_node->start_work)) { |
525 | DRM_ERROR("failed to create start work.\n"); | 525 | DRM_ERROR("failed to create start work.\n"); |
526 | goto err_clear; | 526 | goto err_clear; |
527 | } | 527 | } |
528 | 528 | ||
529 | c_node->stop_work = ipp_create_cmd_work(); | 529 | c_node->stop_work = ipp_create_cmd_work(); |
530 | if (IS_ERR_OR_NULL(c_node->stop_work)) { | 530 | if (IS_ERR(c_node->stop_work)) { |
531 | DRM_ERROR("failed to create stop work.\n"); | 531 | DRM_ERROR("failed to create stop work.\n"); |
532 | goto err_free_start; | 532 | goto err_free_start; |
533 | } | 533 | } |
534 | 534 | ||
535 | c_node->event_work = ipp_create_event_work(); | 535 | c_node->event_work = ipp_create_event_work(); |
536 | if (IS_ERR_OR_NULL(c_node->event_work)) { | 536 | if (IS_ERR(c_node->event_work)) { |
537 | DRM_ERROR("failed to create event work.\n"); | 537 | DRM_ERROR("failed to create event work.\n"); |
538 | goto err_free_stop; | 538 | goto err_free_stop; |
539 | } | 539 | } |
@@ -915,7 +915,7 @@ static int ipp_queue_buf_with_run(struct device *dev, | |||
915 | DRM_DEBUG_KMS("%s\n", __func__); | 915 | DRM_DEBUG_KMS("%s\n", __func__); |
916 | 916 | ||
917 | ippdrv = ipp_find_drv_by_handle(qbuf->prop_id); | 917 | ippdrv = ipp_find_drv_by_handle(qbuf->prop_id); |
918 | if (IS_ERR_OR_NULL(ippdrv)) { | 918 | if (IS_ERR(ippdrv)) { |
919 | DRM_ERROR("failed to get ipp driver.\n"); | 919 | DRM_ERROR("failed to get ipp driver.\n"); |
920 | return -EFAULT; | 920 | return -EFAULT; |
921 | } | 921 | } |
@@ -1909,7 +1909,7 @@ static int ipp_probe(struct platform_device *pdev) | |||
1909 | struct exynos_drm_subdrv *subdrv; | 1909 | struct exynos_drm_subdrv *subdrv; |
1910 | int ret; | 1910 | int ret; |
1911 | 1911 | ||
1912 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 1912 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
1913 | if (!ctx) | 1913 | if (!ctx) |
1914 | return -ENOMEM; | 1914 | return -ENOMEM; |
1915 | 1915 | ||
@@ -1963,7 +1963,7 @@ static int ipp_probe(struct platform_device *pdev) | |||
1963 | goto err_cmd_workq; | 1963 | goto err_cmd_workq; |
1964 | } | 1964 | } |
1965 | 1965 | ||
1966 | dev_info(&pdev->dev, "drm ipp registered successfully.\n"); | 1966 | dev_info(dev, "drm ipp registered successfully.\n"); |
1967 | 1967 | ||
1968 | return 0; | 1968 | return 0; |
1969 | 1969 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_rotator.c b/drivers/gpu/drm/exynos/exynos_drm_rotator.c index 947f09f15ad1..9b6c70964d71 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_rotator.c +++ b/drivers/gpu/drm/exynos/exynos_drm_rotator.c | |||
@@ -666,8 +666,8 @@ static int rotator_probe(struct platform_device *pdev) | |||
666 | return rot->irq; | 666 | return rot->irq; |
667 | } | 667 | } |
668 | 668 | ||
669 | ret = request_threaded_irq(rot->irq, NULL, rotator_irq_handler, | 669 | ret = devm_request_threaded_irq(dev, rot->irq, NULL, |
670 | IRQF_ONESHOT, "drm_rotator", rot); | 670 | rotator_irq_handler, IRQF_ONESHOT, "drm_rotator", rot); |
671 | if (ret < 0) { | 671 | if (ret < 0) { |
672 | dev_err(dev, "failed to request irq\n"); | 672 | dev_err(dev, "failed to request irq\n"); |
673 | return ret; | 673 | return ret; |
@@ -676,8 +676,7 @@ static int rotator_probe(struct platform_device *pdev) | |||
676 | rot->clock = devm_clk_get(dev, "rotator"); | 676 | rot->clock = devm_clk_get(dev, "rotator"); |
677 | if (IS_ERR(rot->clock)) { | 677 | if (IS_ERR(rot->clock)) { |
678 | dev_err(dev, "failed to get clock\n"); | 678 | dev_err(dev, "failed to get clock\n"); |
679 | ret = PTR_ERR(rot->clock); | 679 | return PTR_ERR(rot->clock); |
680 | goto err_clk_get; | ||
681 | } | 680 | } |
682 | 681 | ||
683 | pm_runtime_enable(dev); | 682 | pm_runtime_enable(dev); |
@@ -709,10 +708,7 @@ static int rotator_probe(struct platform_device *pdev) | |||
709 | return 0; | 708 | return 0; |
710 | 709 | ||
711 | err_ippdrv_register: | 710 | err_ippdrv_register: |
712 | devm_kfree(dev, ippdrv->prop_list); | ||
713 | pm_runtime_disable(dev); | 711 | pm_runtime_disable(dev); |
714 | err_clk_get: | ||
715 | free_irq(rot->irq, rot); | ||
716 | return ret; | 712 | return ret; |
717 | } | 713 | } |
718 | 714 | ||
@@ -722,13 +718,10 @@ static int rotator_remove(struct platform_device *pdev) | |||
722 | struct rot_context *rot = dev_get_drvdata(dev); | 718 | struct rot_context *rot = dev_get_drvdata(dev); |
723 | struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv; | 719 | struct exynos_drm_ippdrv *ippdrv = &rot->ippdrv; |
724 | 720 | ||
725 | devm_kfree(dev, ippdrv->prop_list); | ||
726 | exynos_drm_ippdrv_unregister(ippdrv); | 721 | exynos_drm_ippdrv_unregister(ippdrv); |
727 | 722 | ||
728 | pm_runtime_disable(dev); | 723 | pm_runtime_disable(dev); |
729 | 724 | ||
730 | free_irq(rot->irq, rot); | ||
731 | |||
732 | return 0; | 725 | return 0; |
733 | } | 726 | } |
734 | 727 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 9504b0cd825a..24376c194a5e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c | |||
@@ -594,7 +594,7 @@ static int vidi_probe(struct platform_device *pdev) | |||
594 | 594 | ||
595 | DRM_DEBUG_KMS("%s\n", __FILE__); | 595 | DRM_DEBUG_KMS("%s\n", __FILE__); |
596 | 596 | ||
597 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 597 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
598 | if (!ctx) | 598 | if (!ctx) |
599 | return -ENOMEM; | 599 | return -ENOMEM; |
600 | 600 | ||
@@ -612,7 +612,7 @@ static int vidi_probe(struct platform_device *pdev) | |||
612 | 612 | ||
613 | platform_set_drvdata(pdev, ctx); | 613 | platform_set_drvdata(pdev, ctx); |
614 | 614 | ||
615 | ret = device_create_file(&pdev->dev, &dev_attr_connection); | 615 | ret = device_create_file(dev, &dev_attr_connection); |
616 | if (ret < 0) | 616 | if (ret < 0) |
617 | DRM_INFO("failed to create connection sysfs.\n"); | 617 | DRM_INFO("failed to create connection sysfs.\n"); |
618 | 618 | ||
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 6652597586a1..fd1426dca882 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -1946,14 +1946,14 @@ static int hdmi_probe(struct platform_device *pdev) | |||
1946 | 1946 | ||
1947 | DRM_DEBUG_KMS("[%d]\n", __LINE__); | 1947 | DRM_DEBUG_KMS("[%d]\n", __LINE__); |
1948 | 1948 | ||
1949 | if (pdev->dev.of_node) { | 1949 | if (dev->of_node) { |
1950 | pdata = drm_hdmi_dt_parse_pdata(dev); | 1950 | pdata = drm_hdmi_dt_parse_pdata(dev); |
1951 | if (IS_ERR(pdata)) { | 1951 | if (IS_ERR(pdata)) { |
1952 | DRM_ERROR("failed to parse dt\n"); | 1952 | DRM_ERROR("failed to parse dt\n"); |
1953 | return PTR_ERR(pdata); | 1953 | return PTR_ERR(pdata); |
1954 | } | 1954 | } |
1955 | } else { | 1955 | } else { |
1956 | pdata = pdev->dev.platform_data; | 1956 | pdata = dev->platform_data; |
1957 | } | 1957 | } |
1958 | 1958 | ||
1959 | if (!pdata) { | 1959 | if (!pdata) { |
@@ -1961,14 +1961,14 @@ static int hdmi_probe(struct platform_device *pdev) | |||
1961 | return -EINVAL; | 1961 | return -EINVAL; |
1962 | } | 1962 | } |
1963 | 1963 | ||
1964 | drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx), | 1964 | drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx), |
1965 | GFP_KERNEL); | 1965 | GFP_KERNEL); |
1966 | if (!drm_hdmi_ctx) { | 1966 | if (!drm_hdmi_ctx) { |
1967 | DRM_ERROR("failed to allocate common hdmi context.\n"); | 1967 | DRM_ERROR("failed to allocate common hdmi context.\n"); |
1968 | return -ENOMEM; | 1968 | return -ENOMEM; |
1969 | } | 1969 | } |
1970 | 1970 | ||
1971 | hdata = devm_kzalloc(&pdev->dev, sizeof(struct hdmi_context), | 1971 | hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), |
1972 | GFP_KERNEL); | 1972 | GFP_KERNEL); |
1973 | if (!hdata) { | 1973 | if (!hdata) { |
1974 | DRM_ERROR("out of memory\n"); | 1974 | DRM_ERROR("out of memory\n"); |
@@ -1985,7 +1985,7 @@ static int hdmi_probe(struct platform_device *pdev) | |||
1985 | if (dev->of_node) { | 1985 | if (dev->of_node) { |
1986 | const struct of_device_id *match; | 1986 | const struct of_device_id *match; |
1987 | match = of_match_node(of_match_ptr(hdmi_match_types), | 1987 | match = of_match_node(of_match_ptr(hdmi_match_types), |
1988 | pdev->dev.of_node); | 1988 | dev->of_node); |
1989 | if (match == NULL) | 1989 | if (match == NULL) |
1990 | return -ENODEV; | 1990 | return -ENODEV; |
1991 | hdata->type = (enum hdmi_type)match->data; | 1991 | hdata->type = (enum hdmi_type)match->data; |
@@ -2005,11 +2005,11 @@ static int hdmi_probe(struct platform_device *pdev) | |||
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 2007 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
2008 | hdata->regs = devm_ioremap_resource(&pdev->dev, res); | 2008 | hdata->regs = devm_ioremap_resource(dev, res); |
2009 | if (IS_ERR(hdata->regs)) | 2009 | if (IS_ERR(hdata->regs)) |
2010 | return PTR_ERR(hdata->regs); | 2010 | return PTR_ERR(hdata->regs); |
2011 | 2011 | ||
2012 | ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD"); | 2012 | ret = devm_gpio_request(dev, hdata->hpd_gpio, "HPD"); |
2013 | if (ret) { | 2013 | if (ret) { |
2014 | DRM_ERROR("failed to request HPD gpio\n"); | 2014 | DRM_ERROR("failed to request HPD gpio\n"); |
2015 | return ret; | 2015 | return ret; |
@@ -2041,7 +2041,7 @@ static int hdmi_probe(struct platform_device *pdev) | |||
2041 | 2041 | ||
2042 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); | 2042 | hdata->hpd = gpio_get_value(hdata->hpd_gpio); |
2043 | 2043 | ||
2044 | ret = request_threaded_irq(hdata->irq, NULL, | 2044 | ret = devm_request_threaded_irq(dev, hdata->irq, NULL, |
2045 | hdmi_irq_thread, IRQF_TRIGGER_RISING | | 2045 | hdmi_irq_thread, IRQF_TRIGGER_RISING | |
2046 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | 2046 | IRQF_TRIGGER_FALLING | IRQF_ONESHOT, |
2047 | "hdmi", drm_hdmi_ctx); | 2047 | "hdmi", drm_hdmi_ctx); |
@@ -2070,16 +2070,11 @@ err_ddc: | |||
2070 | static int hdmi_remove(struct platform_device *pdev) | 2070 | static int hdmi_remove(struct platform_device *pdev) |
2071 | { | 2071 | { |
2072 | struct device *dev = &pdev->dev; | 2072 | struct device *dev = &pdev->dev; |
2073 | struct exynos_drm_hdmi_context *ctx = platform_get_drvdata(pdev); | ||
2074 | struct hdmi_context *hdata = ctx->ctx; | ||
2075 | 2073 | ||
2076 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); | 2074 | DRM_DEBUG_KMS("[%d] %s\n", __LINE__, __func__); |
2077 | 2075 | ||
2078 | pm_runtime_disable(dev); | 2076 | pm_runtime_disable(dev); |
2079 | 2077 | ||
2080 | free_irq(hdata->irq, hdata); | ||
2081 | |||
2082 | |||
2083 | /* hdmiphy i2c driver */ | 2078 | /* hdmiphy i2c driver */ |
2084 | i2c_del_driver(&hdmiphy_driver); | 2079 | i2c_del_driver(&hdmiphy_driver); |
2085 | /* DDC i2c driver */ | 2080 | /* DDC i2c driver */ |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index ec3e376b7e01..7c197d3820c5 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -1061,7 +1061,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1061 | return -ENXIO; | 1061 | return -ENXIO; |
1062 | } | 1062 | } |
1063 | 1063 | ||
1064 | mixer_res->mixer_regs = devm_ioremap(&pdev->dev, res->start, | 1064 | mixer_res->mixer_regs = devm_ioremap(dev, res->start, |
1065 | resource_size(res)); | 1065 | resource_size(res)); |
1066 | if (mixer_res->mixer_regs == NULL) { | 1066 | if (mixer_res->mixer_regs == NULL) { |
1067 | dev_err(dev, "register mapping failed.\n"); | 1067 | dev_err(dev, "register mapping failed.\n"); |
@@ -1074,7 +1074,7 @@ static int mixer_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1074 | return -ENXIO; | 1074 | return -ENXIO; |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | ret = devm_request_irq(&pdev->dev, res->start, mixer_irq_handler, | 1077 | ret = devm_request_irq(dev, res->start, mixer_irq_handler, |
1078 | 0, "drm_mixer", ctx); | 1078 | 0, "drm_mixer", ctx); |
1079 | if (ret) { | 1079 | if (ret) { |
1080 | dev_err(dev, "request interrupt failed.\n"); | 1080 | dev_err(dev, "request interrupt failed.\n"); |
@@ -1118,7 +1118,7 @@ static int vp_resources_init(struct exynos_drm_hdmi_context *ctx, | |||
1118 | return -ENXIO; | 1118 | return -ENXIO; |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | mixer_res->vp_regs = devm_ioremap(&pdev->dev, res->start, | 1121 | mixer_res->vp_regs = devm_ioremap(dev, res->start, |
1122 | resource_size(res)); | 1122 | resource_size(res)); |
1123 | if (mixer_res->vp_regs == NULL) { | 1123 | if (mixer_res->vp_regs == NULL) { |
1124 | dev_err(dev, "register mapping failed.\n"); | 1124 | dev_err(dev, "register mapping failed.\n"); |
@@ -1169,14 +1169,14 @@ static int mixer_probe(struct platform_device *pdev) | |||
1169 | 1169 | ||
1170 | dev_info(dev, "probe start\n"); | 1170 | dev_info(dev, "probe start\n"); |
1171 | 1171 | ||
1172 | drm_hdmi_ctx = devm_kzalloc(&pdev->dev, sizeof(*drm_hdmi_ctx), | 1172 | drm_hdmi_ctx = devm_kzalloc(dev, sizeof(*drm_hdmi_ctx), |
1173 | GFP_KERNEL); | 1173 | GFP_KERNEL); |
1174 | if (!drm_hdmi_ctx) { | 1174 | if (!drm_hdmi_ctx) { |
1175 | DRM_ERROR("failed to allocate common hdmi context.\n"); | 1175 | DRM_ERROR("failed to allocate common hdmi context.\n"); |
1176 | return -ENOMEM; | 1176 | return -ENOMEM; |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL); | 1179 | ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); |
1180 | if (!ctx) { | 1180 | if (!ctx) { |
1181 | DRM_ERROR("failed to alloc mixer context.\n"); | 1181 | DRM_ERROR("failed to alloc mixer context.\n"); |
1182 | return -ENOMEM; | 1182 | return -ENOMEM; |
@@ -1187,14 +1187,14 @@ static int mixer_probe(struct platform_device *pdev) | |||
1187 | if (dev->of_node) { | 1187 | if (dev->of_node) { |
1188 | const struct of_device_id *match; | 1188 | const struct of_device_id *match; |
1189 | match = of_match_node(of_match_ptr(mixer_match_types), | 1189 | match = of_match_node(of_match_ptr(mixer_match_types), |
1190 | pdev->dev.of_node); | 1190 | dev->of_node); |
1191 | drv = (struct mixer_drv_data *)match->data; | 1191 | drv = (struct mixer_drv_data *)match->data; |
1192 | } else { | 1192 | } else { |
1193 | drv = (struct mixer_drv_data *) | 1193 | drv = (struct mixer_drv_data *) |
1194 | platform_get_device_id(pdev)->driver_data; | 1194 | platform_get_device_id(pdev)->driver_data; |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | ctx->dev = &pdev->dev; | 1197 | ctx->dev = dev; |
1198 | ctx->parent_ctx = (void *)drm_hdmi_ctx; | 1198 | ctx->parent_ctx = (void *)drm_hdmi_ctx; |
1199 | drm_hdmi_ctx->ctx = (void *)ctx; | 1199 | drm_hdmi_ctx->ctx = (void *)ctx; |
1200 | ctx->vp_enabled = drv->is_vp_enabled; | 1200 | ctx->vp_enabled = drv->is_vp_enabled; |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 9ebe895c17d6..a2e4953b8e8d 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -364,40 +364,64 @@ static const struct pci_device_id pciidlist[] = { /* aka */ | |||
364 | INTEL_VGA_DEVICE(0x016a, &intel_ivybridge_d_info), /* GT2 server */ | 364 | INTEL_VGA_DEVICE(0x016a, &intel_ivybridge_d_info), /* GT2 server */ |
365 | INTEL_VGA_DEVICE(0x0402, &intel_haswell_d_info), /* GT1 desktop */ | 365 | INTEL_VGA_DEVICE(0x0402, &intel_haswell_d_info), /* GT1 desktop */ |
366 | INTEL_VGA_DEVICE(0x0412, &intel_haswell_d_info), /* GT2 desktop */ | 366 | INTEL_VGA_DEVICE(0x0412, &intel_haswell_d_info), /* GT2 desktop */ |
367 | INTEL_VGA_DEVICE(0x0422, &intel_haswell_d_info), /* GT2 desktop */ | 367 | INTEL_VGA_DEVICE(0x0422, &intel_haswell_d_info), /* GT3 desktop */ |
368 | INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ | 368 | INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ |
369 | INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ | 369 | INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ |
370 | INTEL_VGA_DEVICE(0x042a, &intel_haswell_d_info), /* GT2 server */ | 370 | INTEL_VGA_DEVICE(0x042a, &intel_haswell_d_info), /* GT3 server */ |
371 | INTEL_VGA_DEVICE(0x0406, &intel_haswell_m_info), /* GT1 mobile */ | 371 | INTEL_VGA_DEVICE(0x0406, &intel_haswell_m_info), /* GT1 mobile */ |
372 | INTEL_VGA_DEVICE(0x0416, &intel_haswell_m_info), /* GT2 mobile */ | 372 | INTEL_VGA_DEVICE(0x0416, &intel_haswell_m_info), /* GT2 mobile */ |
373 | INTEL_VGA_DEVICE(0x0426, &intel_haswell_m_info), /* GT2 mobile */ | 373 | INTEL_VGA_DEVICE(0x0426, &intel_haswell_m_info), /* GT2 mobile */ |
374 | INTEL_VGA_DEVICE(0x040B, &intel_haswell_d_info), /* GT1 reserved */ | ||
375 | INTEL_VGA_DEVICE(0x041B, &intel_haswell_d_info), /* GT2 reserved */ | ||
376 | INTEL_VGA_DEVICE(0x042B, &intel_haswell_d_info), /* GT3 reserved */ | ||
377 | INTEL_VGA_DEVICE(0x040E, &intel_haswell_d_info), /* GT1 reserved */ | ||
378 | INTEL_VGA_DEVICE(0x041E, &intel_haswell_d_info), /* GT2 reserved */ | ||
379 | INTEL_VGA_DEVICE(0x042E, &intel_haswell_d_info), /* GT3 reserved */ | ||
374 | INTEL_VGA_DEVICE(0x0C02, &intel_haswell_d_info), /* SDV GT1 desktop */ | 380 | INTEL_VGA_DEVICE(0x0C02, &intel_haswell_d_info), /* SDV GT1 desktop */ |
375 | INTEL_VGA_DEVICE(0x0C12, &intel_haswell_d_info), /* SDV GT2 desktop */ | 381 | INTEL_VGA_DEVICE(0x0C12, &intel_haswell_d_info), /* SDV GT2 desktop */ |
376 | INTEL_VGA_DEVICE(0x0C22, &intel_haswell_d_info), /* SDV GT2 desktop */ | 382 | INTEL_VGA_DEVICE(0x0C22, &intel_haswell_d_info), /* SDV GT3 desktop */ |
377 | INTEL_VGA_DEVICE(0x0C0A, &intel_haswell_d_info), /* SDV GT1 server */ | 383 | INTEL_VGA_DEVICE(0x0C0A, &intel_haswell_d_info), /* SDV GT1 server */ |
378 | INTEL_VGA_DEVICE(0x0C1A, &intel_haswell_d_info), /* SDV GT2 server */ | 384 | INTEL_VGA_DEVICE(0x0C1A, &intel_haswell_d_info), /* SDV GT2 server */ |
379 | INTEL_VGA_DEVICE(0x0C2A, &intel_haswell_d_info), /* SDV GT2 server */ | 385 | INTEL_VGA_DEVICE(0x0C2A, &intel_haswell_d_info), /* SDV GT3 server */ |
380 | INTEL_VGA_DEVICE(0x0C06, &intel_haswell_m_info), /* SDV GT1 mobile */ | 386 | INTEL_VGA_DEVICE(0x0C06, &intel_haswell_m_info), /* SDV GT1 mobile */ |
381 | INTEL_VGA_DEVICE(0x0C16, &intel_haswell_m_info), /* SDV GT2 mobile */ | 387 | INTEL_VGA_DEVICE(0x0C16, &intel_haswell_m_info), /* SDV GT2 mobile */ |
382 | INTEL_VGA_DEVICE(0x0C26, &intel_haswell_m_info), /* SDV GT2 mobile */ | 388 | INTEL_VGA_DEVICE(0x0C26, &intel_haswell_m_info), /* SDV GT3 mobile */ |
389 | INTEL_VGA_DEVICE(0x0C0B, &intel_haswell_d_info), /* SDV GT1 reserved */ | ||
390 | INTEL_VGA_DEVICE(0x0C1B, &intel_haswell_d_info), /* SDV GT2 reserved */ | ||
391 | INTEL_VGA_DEVICE(0x0C2B, &intel_haswell_d_info), /* SDV GT3 reserved */ | ||
392 | INTEL_VGA_DEVICE(0x0C0E, &intel_haswell_d_info), /* SDV GT1 reserved */ | ||
393 | INTEL_VGA_DEVICE(0x0C1E, &intel_haswell_d_info), /* SDV GT2 reserved */ | ||
394 | INTEL_VGA_DEVICE(0x0C2E, &intel_haswell_d_info), /* SDV GT3 reserved */ | ||
383 | INTEL_VGA_DEVICE(0x0A02, &intel_haswell_d_info), /* ULT GT1 desktop */ | 395 | INTEL_VGA_DEVICE(0x0A02, &intel_haswell_d_info), /* ULT GT1 desktop */ |
384 | INTEL_VGA_DEVICE(0x0A12, &intel_haswell_d_info), /* ULT GT2 desktop */ | 396 | INTEL_VGA_DEVICE(0x0A12, &intel_haswell_d_info), /* ULT GT2 desktop */ |
385 | INTEL_VGA_DEVICE(0x0A22, &intel_haswell_d_info), /* ULT GT2 desktop */ | 397 | INTEL_VGA_DEVICE(0x0A22, &intel_haswell_d_info), /* ULT GT3 desktop */ |
386 | INTEL_VGA_DEVICE(0x0A0A, &intel_haswell_d_info), /* ULT GT1 server */ | 398 | INTEL_VGA_DEVICE(0x0A0A, &intel_haswell_d_info), /* ULT GT1 server */ |
387 | INTEL_VGA_DEVICE(0x0A1A, &intel_haswell_d_info), /* ULT GT2 server */ | 399 | INTEL_VGA_DEVICE(0x0A1A, &intel_haswell_d_info), /* ULT GT2 server */ |
388 | INTEL_VGA_DEVICE(0x0A2A, &intel_haswell_d_info), /* ULT GT2 server */ | 400 | INTEL_VGA_DEVICE(0x0A2A, &intel_haswell_d_info), /* ULT GT3 server */ |
389 | INTEL_VGA_DEVICE(0x0A06, &intel_haswell_m_info), /* ULT GT1 mobile */ | 401 | INTEL_VGA_DEVICE(0x0A06, &intel_haswell_m_info), /* ULT GT1 mobile */ |
390 | INTEL_VGA_DEVICE(0x0A16, &intel_haswell_m_info), /* ULT GT2 mobile */ | 402 | INTEL_VGA_DEVICE(0x0A16, &intel_haswell_m_info), /* ULT GT2 mobile */ |
391 | INTEL_VGA_DEVICE(0x0A26, &intel_haswell_m_info), /* ULT GT2 mobile */ | 403 | INTEL_VGA_DEVICE(0x0A26, &intel_haswell_m_info), /* ULT GT3 mobile */ |
404 | INTEL_VGA_DEVICE(0x0A0B, &intel_haswell_d_info), /* ULT GT1 reserved */ | ||
405 | INTEL_VGA_DEVICE(0x0A1B, &intel_haswell_d_info), /* ULT GT2 reserved */ | ||
406 | INTEL_VGA_DEVICE(0x0A2B, &intel_haswell_d_info), /* ULT GT3 reserved */ | ||
407 | INTEL_VGA_DEVICE(0x0A0E, &intel_haswell_m_info), /* ULT GT1 reserved */ | ||
408 | INTEL_VGA_DEVICE(0x0A1E, &intel_haswell_m_info), /* ULT GT2 reserved */ | ||
409 | INTEL_VGA_DEVICE(0x0A2E, &intel_haswell_m_info), /* ULT GT3 reserved */ | ||
392 | INTEL_VGA_DEVICE(0x0D02, &intel_haswell_d_info), /* CRW GT1 desktop */ | 410 | INTEL_VGA_DEVICE(0x0D02, &intel_haswell_d_info), /* CRW GT1 desktop */ |
393 | INTEL_VGA_DEVICE(0x0D12, &intel_haswell_d_info), /* CRW GT2 desktop */ | 411 | INTEL_VGA_DEVICE(0x0D12, &intel_haswell_d_info), /* CRW GT2 desktop */ |
394 | INTEL_VGA_DEVICE(0x0D22, &intel_haswell_d_info), /* CRW GT2 desktop */ | 412 | INTEL_VGA_DEVICE(0x0D22, &intel_haswell_d_info), /* CRW GT3 desktop */ |
395 | INTEL_VGA_DEVICE(0x0D0A, &intel_haswell_d_info), /* CRW GT1 server */ | 413 | INTEL_VGA_DEVICE(0x0D0A, &intel_haswell_d_info), /* CRW GT1 server */ |
396 | INTEL_VGA_DEVICE(0x0D1A, &intel_haswell_d_info), /* CRW GT2 server */ | 414 | INTEL_VGA_DEVICE(0x0D1A, &intel_haswell_d_info), /* CRW GT2 server */ |
397 | INTEL_VGA_DEVICE(0x0D2A, &intel_haswell_d_info), /* CRW GT2 server */ | 415 | INTEL_VGA_DEVICE(0x0D2A, &intel_haswell_d_info), /* CRW GT3 server */ |
398 | INTEL_VGA_DEVICE(0x0D06, &intel_haswell_m_info), /* CRW GT1 mobile */ | 416 | INTEL_VGA_DEVICE(0x0D06, &intel_haswell_m_info), /* CRW GT1 mobile */ |
399 | INTEL_VGA_DEVICE(0x0D16, &intel_haswell_m_info), /* CRW GT2 mobile */ | 417 | INTEL_VGA_DEVICE(0x0D16, &intel_haswell_m_info), /* CRW GT2 mobile */ |
400 | INTEL_VGA_DEVICE(0x0D26, &intel_haswell_m_info), /* CRW GT2 mobile */ | 418 | INTEL_VGA_DEVICE(0x0D26, &intel_haswell_m_info), /* CRW GT3 mobile */ |
419 | INTEL_VGA_DEVICE(0x0D0B, &intel_haswell_d_info), /* CRW GT1 reserved */ | ||
420 | INTEL_VGA_DEVICE(0x0D1B, &intel_haswell_d_info), /* CRW GT2 reserved */ | ||
421 | INTEL_VGA_DEVICE(0x0D2B, &intel_haswell_d_info), /* CRW GT3 reserved */ | ||
422 | INTEL_VGA_DEVICE(0x0D0E, &intel_haswell_d_info), /* CRW GT1 reserved */ | ||
423 | INTEL_VGA_DEVICE(0x0D1E, &intel_haswell_d_info), /* CRW GT2 reserved */ | ||
424 | INTEL_VGA_DEVICE(0x0D2E, &intel_haswell_d_info), /* CRW GT3 reserved */ | ||
401 | INTEL_VGA_DEVICE(0x0f30, &intel_valleyview_m_info), | 425 | INTEL_VGA_DEVICE(0x0f30, &intel_valleyview_m_info), |
402 | INTEL_VGA_DEVICE(0x0f31, &intel_valleyview_m_info), | 426 | INTEL_VGA_DEVICE(0x0f31, &intel_valleyview_m_info), |
403 | INTEL_VGA_DEVICE(0x0f32, &intel_valleyview_m_info), | 427 | INTEL_VGA_DEVICE(0x0f32, &intel_valleyview_m_info), |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d5dcf7fe1ee9..b9d00dcf9a2d 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -1943,4 +1943,19 @@ static inline void __user *to_user_ptr(u64 address) | |||
1943 | return (void __user *)(uintptr_t)address; | 1943 | return (void __user *)(uintptr_t)address; |
1944 | } | 1944 | } |
1945 | 1945 | ||
1946 | static inline unsigned long msecs_to_jiffies_timeout(const unsigned int m) | ||
1947 | { | ||
1948 | unsigned long j = msecs_to_jiffies(m); | ||
1949 | |||
1950 | return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1); | ||
1951 | } | ||
1952 | |||
1953 | static inline unsigned long | ||
1954 | timespec_to_jiffies_timeout(const struct timespec *value) | ||
1955 | { | ||
1956 | unsigned long j = timespec_to_jiffies(value); | ||
1957 | |||
1958 | return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1); | ||
1959 | } | ||
1960 | |||
1946 | #endif | 1961 | #endif |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 6165535d15f0..970ad17c99ab 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -91,14 +91,11 @@ i915_gem_wait_for_error(struct i915_gpu_error *error) | |||
91 | { | 91 | { |
92 | int ret; | 92 | int ret; |
93 | 93 | ||
94 | #define EXIT_COND (!i915_reset_in_progress(error)) | 94 | #define EXIT_COND (!i915_reset_in_progress(error) || \ |
95 | i915_terminally_wedged(error)) | ||
95 | if (EXIT_COND) | 96 | if (EXIT_COND) |
96 | return 0; | 97 | return 0; |
97 | 98 | ||
98 | /* GPU is already declared terminally dead, give up. */ | ||
99 | if (i915_terminally_wedged(error)) | ||
100 | return -EIO; | ||
101 | |||
102 | /* | 99 | /* |
103 | * Only wait 10 seconds for the gpu reset to complete to avoid hanging | 100 | * Only wait 10 seconds for the gpu reset to complete to avoid hanging |
104 | * userspace. If it takes that long something really bad is going on and | 101 | * userspace. If it takes that long something really bad is going on and |
@@ -1003,7 +1000,7 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, | |||
1003 | wait_forever = false; | 1000 | wait_forever = false; |
1004 | } | 1001 | } |
1005 | 1002 | ||
1006 | timeout_jiffies = timespec_to_jiffies(&wait_time); | 1003 | timeout_jiffies = timespec_to_jiffies_timeout(&wait_time); |
1007 | 1004 | ||
1008 | if (WARN_ON(!ring->irq_get(ring))) | 1005 | if (WARN_ON(!ring->irq_get(ring))) |
1009 | return -ENODEV; | 1006 | return -ENODEV; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index efe829919755..56746dcac40f 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7937,6 +7937,11 @@ intel_modeset_check_state(struct drm_device *dev) | |||
7937 | memset(&pipe_config, 0, sizeof(pipe_config)); | 7937 | memset(&pipe_config, 0, sizeof(pipe_config)); |
7938 | active = dev_priv->display.get_pipe_config(crtc, | 7938 | active = dev_priv->display.get_pipe_config(crtc, |
7939 | &pipe_config); | 7939 | &pipe_config); |
7940 | |||
7941 | /* hw state is inconsistent with the pipe A quirk */ | ||
7942 | if (crtc->pipe == PIPE_A && dev_priv->quirks & QUIRK_PIPEA_FORCE) | ||
7943 | active = crtc->active; | ||
7944 | |||
7940 | WARN(crtc->active != active, | 7945 | WARN(crtc->active != active, |
7941 | "crtc active state doesn't match with hw state " | 7946 | "crtc active state doesn't match with hw state " |
7942 | "(expected %i, found %i)\n", crtc->active, active); | 7947 | "(expected %i, found %i)\n", crtc->active, active); |
@@ -8140,6 +8145,21 @@ static void intel_set_config_restore_state(struct drm_device *dev, | |||
8140 | } | 8145 | } |
8141 | } | 8146 | } |
8142 | 8147 | ||
8148 | static bool | ||
8149 | is_crtc_connector_off(struct drm_crtc *crtc, struct drm_connector *connectors, | ||
8150 | int num_connectors) | ||
8151 | { | ||
8152 | int i; | ||
8153 | |||
8154 | for (i = 0; i < num_connectors; i++) | ||
8155 | if (connectors[i].encoder && | ||
8156 | connectors[i].encoder->crtc == crtc && | ||
8157 | connectors[i].dpms != DRM_MODE_DPMS_ON) | ||
8158 | return true; | ||
8159 | |||
8160 | return false; | ||
8161 | } | ||
8162 | |||
8143 | static void | 8163 | static void |
8144 | intel_set_config_compute_mode_changes(struct drm_mode_set *set, | 8164 | intel_set_config_compute_mode_changes(struct drm_mode_set *set, |
8145 | struct intel_set_config *config) | 8165 | struct intel_set_config *config) |
@@ -8147,7 +8167,11 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set, | |||
8147 | 8167 | ||
8148 | /* We should be able to check here if the fb has the same properties | 8168 | /* We should be able to check here if the fb has the same properties |
8149 | * and then just flip_or_move it */ | 8169 | * and then just flip_or_move it */ |
8150 | if (set->crtc->fb != set->fb) { | 8170 | if (set->connectors != NULL && |
8171 | is_crtc_connector_off(set->crtc, *set->connectors, | ||
8172 | set->num_connectors)) { | ||
8173 | config->mode_changed = true; | ||
8174 | } else if (set->crtc->fb != set->fb) { | ||
8151 | /* If we have no fb then treat it as a full mode set */ | 8175 | /* If we have no fb then treat it as a full mode set */ |
8152 | if (set->crtc->fb == NULL) { | 8176 | if (set->crtc->fb == NULL) { |
8153 | DRM_DEBUG_KMS("crtc has no fb, full mode set\n"); | 8177 | DRM_DEBUG_KMS("crtc has no fb, full mode set\n"); |
@@ -8157,8 +8181,9 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set, | |||
8157 | } else if (set->fb->pixel_format != | 8181 | } else if (set->fb->pixel_format != |
8158 | set->crtc->fb->pixel_format) { | 8182 | set->crtc->fb->pixel_format) { |
8159 | config->mode_changed = true; | 8183 | config->mode_changed = true; |
8160 | } else | 8184 | } else { |
8161 | config->fb_changed = true; | 8185 | config->fb_changed = true; |
8186 | } | ||
8162 | } | 8187 | } |
8163 | 8188 | ||
8164 | if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y)) | 8189 | if (set->fb && (set->x != set->crtc->x || set->y != set->crtc->y)) |
@@ -8332,11 +8357,6 @@ static int intel_crtc_set_config(struct drm_mode_set *set) | |||
8332 | 8357 | ||
8333 | ret = intel_set_mode(set->crtc, set->mode, | 8358 | ret = intel_set_mode(set->crtc, set->mode, |
8334 | set->x, set->y, set->fb); | 8359 | set->x, set->y, set->fb); |
8335 | if (ret) { | ||
8336 | DRM_ERROR("failed to set mode on [CRTC:%d], err = %d\n", | ||
8337 | set->crtc->base.id, ret); | ||
8338 | goto fail; | ||
8339 | } | ||
8340 | } else if (config->fb_changed) { | 8360 | } else if (config->fb_changed) { |
8341 | intel_crtc_wait_for_pending_flips(set->crtc); | 8361 | intel_crtc_wait_for_pending_flips(set->crtc); |
8342 | 8362 | ||
@@ -8344,18 +8364,18 @@ static int intel_crtc_set_config(struct drm_mode_set *set) | |||
8344 | set->x, set->y, set->fb); | 8364 | set->x, set->y, set->fb); |
8345 | } | 8365 | } |
8346 | 8366 | ||
8347 | intel_set_config_free(config); | 8367 | if (ret) { |
8348 | 8368 | DRM_ERROR("failed to set mode on [CRTC:%d], err = %d\n", | |
8349 | return 0; | 8369 | set->crtc->base.id, ret); |
8350 | |||
8351 | fail: | 8370 | fail: |
8352 | intel_set_config_restore_state(dev, config); | 8371 | intel_set_config_restore_state(dev, config); |
8353 | 8372 | ||
8354 | /* Try to restore the config */ | 8373 | /* Try to restore the config */ |
8355 | if (config->mode_changed && | 8374 | if (config->mode_changed && |
8356 | intel_set_mode(save_set.crtc, save_set.mode, | 8375 | intel_set_mode(save_set.crtc, save_set.mode, |
8357 | save_set.x, save_set.y, save_set.fb)) | 8376 | save_set.x, save_set.y, save_set.fb)) |
8358 | DRM_ERROR("failed to restore config after modeset failure\n"); | 8377 | DRM_ERROR("failed to restore config after modeset failure\n"); |
8378 | } | ||
8359 | 8379 | ||
8360 | out_config: | 8380 | out_config: |
8361 | intel_set_config_free(config); | 8381 | intel_set_config_free(config); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 3d704b706a8d..70789b1b5642 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -303,7 +303,7 @@ intel_dp_aux_wait_done(struct intel_dp *intel_dp, bool has_aux_irq) | |||
303 | #define C (((status = I915_READ_NOTRACE(ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0) | 303 | #define C (((status = I915_READ_NOTRACE(ch_ctl)) & DP_AUX_CH_CTL_SEND_BUSY) == 0) |
304 | if (has_aux_irq) | 304 | if (has_aux_irq) |
305 | done = wait_event_timeout(dev_priv->gmbus_wait_queue, C, | 305 | done = wait_event_timeout(dev_priv->gmbus_wait_queue, C, |
306 | msecs_to_jiffies(10)); | 306 | msecs_to_jiffies_timeout(10)); |
307 | else | 307 | else |
308 | done = wait_for_atomic(C, 10) == 0; | 308 | done = wait_for_atomic(C, 10) == 0; |
309 | if (!done) | 309 | if (!done) |
diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c index 5d245031e391..639fe192997c 100644 --- a/drivers/gpu/drm/i915/intel_i2c.c +++ b/drivers/gpu/drm/i915/intel_i2c.c | |||
@@ -228,7 +228,7 @@ gmbus_wait_hw_status(struct drm_i915_private *dev_priv, | |||
228 | * need to wake up periodically and check that ourselves. */ | 228 | * need to wake up periodically and check that ourselves. */ |
229 | I915_WRITE(GMBUS4 + reg_offset, gmbus4_irq_en); | 229 | I915_WRITE(GMBUS4 + reg_offset, gmbus4_irq_en); |
230 | 230 | ||
231 | for (i = 0; i < msecs_to_jiffies(50) + 1; i++) { | 231 | for (i = 0; i < msecs_to_jiffies_timeout(50); i++) { |
232 | prepare_to_wait(&dev_priv->gmbus_wait_queue, &wait, | 232 | prepare_to_wait(&dev_priv->gmbus_wait_queue, &wait, |
233 | TASK_UNINTERRUPTIBLE); | 233 | TASK_UNINTERRUPTIBLE); |
234 | 234 | ||
@@ -263,7 +263,8 @@ gmbus_wait_idle(struct drm_i915_private *dev_priv) | |||
263 | /* Important: The hw handles only the first bit, so set only one! */ | 263 | /* Important: The hw handles only the first bit, so set only one! */ |
264 | I915_WRITE(GMBUS4 + reg_offset, GMBUS_IDLE_EN); | 264 | I915_WRITE(GMBUS4 + reg_offset, GMBUS_IDLE_EN); |
265 | 265 | ||
266 | ret = wait_event_timeout(dev_priv->gmbus_wait_queue, C, 10); | 266 | ret = wait_event_timeout(dev_priv->gmbus_wait_queue, C, |
267 | msecs_to_jiffies_timeout(10)); | ||
267 | 268 | ||
268 | I915_WRITE(GMBUS4 + reg_offset, 0); | 269 | I915_WRITE(GMBUS4 + reg_offset, 0); |
269 | 270 | ||
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index f36f1baabd5a..29412cc89c7a 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -815,10 +815,10 @@ static const struct dmi_system_id intel_no_lvds[] = { | |||
815 | }, | 815 | }, |
816 | { | 816 | { |
817 | .callback = intel_no_lvds_dmi_callback, | 817 | .callback = intel_no_lvds_dmi_callback, |
818 | .ident = "Hewlett-Packard HP t5740e Thin Client", | 818 | .ident = "Hewlett-Packard HP t5740", |
819 | .matches = { | 819 | .matches = { |
820 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | 820 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), |
821 | DMI_MATCH(DMI_PRODUCT_NAME, "HP t5740e Thin Client"), | 821 | DMI_MATCH(DMI_PRODUCT_NAME, " t5740"), |
822 | }, | 822 | }, |
823 | }, | 823 | }, |
824 | { | 824 | { |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index d15428404b9a..4c47b449b775 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1776,7 +1776,7 @@ static void intel_sdvo_get_lvds_modes(struct drm_connector *connector) | |||
1776 | * Assume that the preferred modes are | 1776 | * Assume that the preferred modes are |
1777 | * arranged in priority order. | 1777 | * arranged in priority order. |
1778 | */ | 1778 | */ |
1779 | intel_ddc_get_modes(connector, intel_sdvo->i2c); | 1779 | intel_ddc_get_modes(connector, &intel_sdvo->ddc); |
1780 | if (list_empty(&connector->probed_modes) == false) | 1780 | if (list_empty(&connector->probed_modes) == false) |
1781 | goto end; | 1781 | goto end; |
1782 | 1782 | ||
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index 77b8a45fb10a..ee66badc8bb6 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c | |||
@@ -1034,13 +1034,14 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, | |||
1034 | else | 1034 | else |
1035 | hi_pri_lvl = 5; | 1035 | hi_pri_lvl = 5; |
1036 | 1036 | ||
1037 | WREG8(0x1fde, 0x06); | 1037 | WREG8(MGAREG_CRTCEXT_INDEX, 0x06); |
1038 | WREG8(0x1fdf, hi_pri_lvl); | 1038 | WREG8(MGAREG_CRTCEXT_DATA, hi_pri_lvl); |
1039 | } else { | 1039 | } else { |
1040 | WREG8(MGAREG_CRTCEXT_INDEX, 0x06); | ||
1040 | if (mdev->reg_1e24 >= 0x01) | 1041 | if (mdev->reg_1e24 >= 0x01) |
1041 | WREG8(0x1fdf, 0x03); | 1042 | WREG8(MGAREG_CRTCEXT_DATA, 0x03); |
1042 | else | 1043 | else |
1043 | WREG8(0x1fdf, 0x04); | 1044 | WREG8(MGAREG_CRTCEXT_DATA, 0x04); |
1044 | } | 1045 | } |
1045 | } | 1046 | } |
1046 | return 0; | 1047 | return 0; |
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c index d0817d94454c..f02fd9f443ff 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/dacnv50.c | |||
@@ -50,11 +50,16 @@ nv50_dac_sense(struct nv50_disp_priv *priv, int or, u32 loadval) | |||
50 | { | 50 | { |
51 | const u32 doff = (or * 0x800); | 51 | const u32 doff = (or * 0x800); |
52 | int load = -EINVAL; | 52 | int load = -EINVAL; |
53 | nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80150000); | ||
54 | nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000); | ||
53 | nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); | 55 | nv_wr32(priv, 0x61a00c + doff, 0x00100000 | loadval); |
54 | udelay(9500); | 56 | mdelay(9); |
57 | udelay(500); | ||
55 | nv_wr32(priv, 0x61a00c + doff, 0x80000000); | 58 | nv_wr32(priv, 0x61a00c + doff, 0x80000000); |
56 | load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27; | 59 | load = (nv_rd32(priv, 0x61a00c + doff) & 0x38000000) >> 27; |
57 | nv_wr32(priv, 0x61a00c + doff, 0x00000000); | 60 | nv_wr32(priv, 0x61a00c + doff, 0x00000000); |
61 | nv_mask(priv, 0x61a004 + doff, 0x807f0000, 0x80550000); | ||
62 | nv_wait(priv, 0x61a004 + doff, 0x80000000, 0x00000000); | ||
58 | return load; | 63 | return load; |
59 | } | 64 | } |
60 | 65 | ||
diff --git a/drivers/gpu/drm/nouveau/core/engine/disp/hdminv84.c b/drivers/gpu/drm/nouveau/core/engine/disp/hdminv84.c index 0d36bdc51417..7fdade6e604d 100644 --- a/drivers/gpu/drm/nouveau/core/engine/disp/hdminv84.c +++ b/drivers/gpu/drm/nouveau/core/engine/disp/hdminv84.c | |||
@@ -55,6 +55,10 @@ nv84_hdmi_ctrl(struct nv50_disp_priv *priv, int head, int or, u32 data) | |||
55 | nv_wr32(priv, 0x616510 + hoff, 0x00000000); | 55 | nv_wr32(priv, 0x616510 + hoff, 0x00000000); |
56 | nv_mask(priv, 0x616500 + hoff, 0x00000001, 0x00000001); | 56 | nv_mask(priv, 0x616500 + hoff, 0x00000001, 0x00000001); |
57 | 57 | ||
58 | nv_mask(priv, 0x6165d0 + hoff, 0x00070001, 0x00010001); /* SPARE, HW_CTS */ | ||
59 | nv_mask(priv, 0x616568 + hoff, 0x00010101, 0x00000000); /* ACR_CTRL, ?? */ | ||
60 | nv_mask(priv, 0x616578 + hoff, 0x80000000, 0x80000000); /* ACR_0441_ENABLE */ | ||
61 | |||
58 | /* ??? */ | 62 | /* ??? */ |
59 | nv_mask(priv, 0x61733c, 0x00100000, 0x00100000); /* RESETF */ | 63 | nv_mask(priv, 0x61733c, 0x00100000, 0x00100000); /* RESETF */ |
60 | nv_mask(priv, 0x61733c, 0x10000000, 0x10000000); /* LOOKUP_EN */ | 64 | nv_mask(priv, 0x61733c, 0x10000000, 0x10000000); /* LOOKUP_EN */ |
diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c index 89bf459d584b..e9b8217d0075 100644 --- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c +++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv50.c | |||
@@ -40,14 +40,13 @@ | |||
40 | * FIFO channel objects | 40 | * FIFO channel objects |
41 | ******************************************************************************/ | 41 | ******************************************************************************/ |
42 | 42 | ||
43 | void | 43 | static void |
44 | nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) | 44 | nv50_fifo_playlist_update_locked(struct nv50_fifo_priv *priv) |
45 | { | 45 | { |
46 | struct nouveau_bar *bar = nouveau_bar(priv); | 46 | struct nouveau_bar *bar = nouveau_bar(priv); |
47 | struct nouveau_gpuobj *cur; | 47 | struct nouveau_gpuobj *cur; |
48 | int i, p; | 48 | int i, p; |
49 | 49 | ||
50 | mutex_lock(&nv_subdev(priv)->mutex); | ||
51 | cur = priv->playlist[priv->cur_playlist]; | 50 | cur = priv->playlist[priv->cur_playlist]; |
52 | priv->cur_playlist = !priv->cur_playlist; | 51 | priv->cur_playlist = !priv->cur_playlist; |
53 | 52 | ||
@@ -61,6 +60,13 @@ nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) | |||
61 | nv_wr32(priv, 0x0032f4, cur->addr >> 12); | 60 | nv_wr32(priv, 0x0032f4, cur->addr >> 12); |
62 | nv_wr32(priv, 0x0032ec, p); | 61 | nv_wr32(priv, 0x0032ec, p); |
63 | nv_wr32(priv, 0x002500, 0x00000101); | 62 | nv_wr32(priv, 0x002500, 0x00000101); |
63 | } | ||
64 | |||
65 | void | ||
66 | nv50_fifo_playlist_update(struct nv50_fifo_priv *priv) | ||
67 | { | ||
68 | mutex_lock(&nv_subdev(priv)->mutex); | ||
69 | nv50_fifo_playlist_update_locked(priv); | ||
64 | mutex_unlock(&nv_subdev(priv)->mutex); | 70 | mutex_unlock(&nv_subdev(priv)->mutex); |
65 | } | 71 | } |
66 | 72 | ||
@@ -489,7 +495,7 @@ nv50_fifo_init(struct nouveau_object *object) | |||
489 | 495 | ||
490 | for (i = 0; i < 128; i++) | 496 | for (i = 0; i < 128; i++) |
491 | nv_wr32(priv, 0x002600 + (i * 4), 0x00000000); | 497 | nv_wr32(priv, 0x002600 + (i * 4), 0x00000000); |
492 | nv50_fifo_playlist_update(priv); | 498 | nv50_fifo_playlist_update_locked(priv); |
493 | 499 | ||
494 | nv_wr32(priv, 0x003200, 0x00000001); | 500 | nv_wr32(priv, 0x003200, 0x00000001); |
495 | nv_wr32(priv, 0x003250, 0x00000001); | 501 | nv_wr32(priv, 0x003250, 0x00000001); |
diff --git a/drivers/gpu/drm/nouveau/core/include/core/class.h b/drivers/gpu/drm/nouveau/core/include/core/class.h index 0a393f7f055f..5a5961b6a6a3 100644 --- a/drivers/gpu/drm/nouveau/core/include/core/class.h +++ b/drivers/gpu/drm/nouveau/core/include/core/class.h | |||
@@ -218,7 +218,7 @@ struct nv04_display_class { | |||
218 | #define NV50_DISP_DAC_PWR_STATE 0x00000040 | 218 | #define NV50_DISP_DAC_PWR_STATE 0x00000040 |
219 | #define NV50_DISP_DAC_PWR_STATE_ON 0x00000000 | 219 | #define NV50_DISP_DAC_PWR_STATE_ON 0x00000000 |
220 | #define NV50_DISP_DAC_PWR_STATE_OFF 0x00000040 | 220 | #define NV50_DISP_DAC_PWR_STATE_OFF 0x00000040 |
221 | #define NV50_DISP_DAC_LOAD 0x0002000c | 221 | #define NV50_DISP_DAC_LOAD 0x00020100 |
222 | #define NV50_DISP_DAC_LOAD_VALUE 0x00000007 | 222 | #define NV50_DISP_DAC_LOAD_VALUE 0x00000007 |
223 | 223 | ||
224 | #define NV50_DISP_PIOR_MTHD 0x00030000 | 224 | #define NV50_DISP_PIOR_MTHD 0x00030000 |
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index 7bf22d4a3d96..f17dc2ab03ec 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c | |||
@@ -638,17 +638,8 @@ nouveau_finish_page_flip(struct nouveau_channel *chan, | |||
638 | } | 638 | } |
639 | 639 | ||
640 | s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); | 640 | s = list_first_entry(&fctx->flip, struct nouveau_page_flip_state, head); |
641 | if (s->event) { | 641 | if (s->event) |
642 | struct drm_pending_vblank_event *e = s->event; | 642 | drm_send_vblank_event(dev, -1, s->event); |
643 | struct timeval now; | ||
644 | |||
645 | do_gettimeofday(&now); | ||
646 | e->event.sequence = 0; | ||
647 | e->event.tv_sec = now.tv_sec; | ||
648 | e->event.tv_usec = now.tv_usec; | ||
649 | list_add_tail(&e->base.link, &e->base.file_priv->event_list); | ||
650 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
651 | } | ||
652 | 643 | ||
653 | list_del(&s->head); | 644 | list_del(&s->head); |
654 | if (ps) | 645 | if (ps) |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index ebf0a683305e..dd5e01f89f28 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
@@ -1554,7 +1554,9 @@ nv50_dac_detect(struct drm_encoder *encoder, struct drm_connector *connector) | |||
1554 | { | 1554 | { |
1555 | struct nv50_disp *disp = nv50_disp(encoder->dev); | 1555 | struct nv50_disp *disp = nv50_disp(encoder->dev); |
1556 | int ret, or = nouveau_encoder(encoder)->or; | 1556 | int ret, or = nouveau_encoder(encoder)->or; |
1557 | u32 load = 0; | 1557 | u32 load = nouveau_drm(encoder->dev)->vbios.dactestval; |
1558 | if (load == 0) | ||
1559 | load = 340; | ||
1558 | 1560 | ||
1559 | ret = nv_exec(disp->core, NV50_DISP_DAC_LOAD + or, &load, sizeof(load)); | 1561 | ret = nv_exec(disp->core, NV50_DISP_DAC_LOAD + or, &load, sizeof(load)); |
1560 | if (ret || load != 7) | 1562 | if (ret || load != 7) |
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 9c53c25e5201..826586ffbe83 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c | |||
@@ -649,6 +649,9 @@ static void pdev_shutdown(struct platform_device *device) | |||
649 | 649 | ||
650 | static int pdev_probe(struct platform_device *device) | 650 | static int pdev_probe(struct platform_device *device) |
651 | { | 651 | { |
652 | if (omapdss_is_initialized() == false) | ||
653 | return -EPROBE_DEFER; | ||
654 | |||
652 | DBG("%s", device->name); | 655 | DBG("%s", device->name); |
653 | return drm_platform_init(&omap_drm_driver, device); | 656 | return drm_platform_init(&omap_drm_driver, device); |
654 | } | 657 | } |
diff --git a/drivers/gpu/drm/qxl/Kconfig b/drivers/gpu/drm/qxl/Kconfig index 2f1a57e11140..d6c12796023c 100644 --- a/drivers/gpu/drm/qxl/Kconfig +++ b/drivers/gpu/drm/qxl/Kconfig | |||
@@ -4,6 +4,7 @@ config DRM_QXL | |||
4 | select FB_SYS_FILLRECT | 4 | select FB_SYS_FILLRECT |
5 | select FB_SYS_COPYAREA | 5 | select FB_SYS_COPYAREA |
6 | select FB_SYS_IMAGEBLIT | 6 | select FB_SYS_IMAGEBLIT |
7 | select FB_DEFERRED_IO | ||
7 | select DRM_KMS_HELPER | 8 | select DRM_KMS_HELPER |
8 | select DRM_TTM | 9 | select DRM_TTM |
9 | help | 10 | help |
diff --git a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c index 6db7370373ea..a4b71b25fa53 100644 --- a/drivers/gpu/drm/qxl/qxl_ioctl.c +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c | |||
@@ -151,7 +151,7 @@ static int qxl_execbuffer_ioctl(struct drm_device *dev, void *data, | |||
151 | struct qxl_bo *cmd_bo; | 151 | struct qxl_bo *cmd_bo; |
152 | int release_type; | 152 | int release_type; |
153 | struct drm_qxl_command *commands = | 153 | struct drm_qxl_command *commands = |
154 | (struct drm_qxl_command *)execbuffer->commands; | 154 | (struct drm_qxl_command *)(uintptr_t)execbuffer->commands; |
155 | 155 | ||
156 | if (DRM_COPY_FROM_USER(&user_cmd, &commands[cmd_num], | 156 | if (DRM_COPY_FROM_USER(&user_cmd, &commands[cmd_num], |
157 | sizeof(user_cmd))) | 157 | sizeof(user_cmd))) |
@@ -193,7 +193,7 @@ static int qxl_execbuffer_ioctl(struct drm_device *dev, void *data, | |||
193 | 193 | ||
194 | for (i = 0 ; i < user_cmd.relocs_num; ++i) { | 194 | for (i = 0 ; i < user_cmd.relocs_num; ++i) { |
195 | if (DRM_COPY_FROM_USER(&reloc, | 195 | if (DRM_COPY_FROM_USER(&reloc, |
196 | &((struct drm_qxl_reloc *)user_cmd.relocs)[i], | 196 | &((struct drm_qxl_reloc *)(uintptr_t)user_cmd.relocs)[i], |
197 | sizeof(reloc))) { | 197 | sizeof(reloc))) { |
198 | qxl_bo_list_unreserve(&reloc_list, true); | 198 | qxl_bo_list_unreserve(&reloc_list, true); |
199 | qxl_release_unreserve(qdev, release); | 199 | qxl_release_unreserve(qdev, release); |
diff --git a/drivers/gpu/drm/qxl/qxl_kms.c b/drivers/gpu/drm/qxl/qxl_kms.c index 85127ed24cfd..e27ce2a907cf 100644 --- a/drivers/gpu/drm/qxl/qxl_kms.c +++ b/drivers/gpu/drm/qxl/qxl_kms.c | |||
@@ -128,12 +128,13 @@ int qxl_device_init(struct qxl_device *qdev, | |||
128 | 128 | ||
129 | qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0)); | 129 | qdev->vram_mapping = io_mapping_create_wc(qdev->vram_base, pci_resource_len(pdev, 0)); |
130 | qdev->surface_mapping = io_mapping_create_wc(qdev->surfaceram_base, qdev->surfaceram_size); | 130 | qdev->surface_mapping = io_mapping_create_wc(qdev->surfaceram_base, qdev->surfaceram_size); |
131 | DRM_DEBUG_KMS("qxl: vram %p-%p(%dM %dk), surface %p-%p(%dM %dk)\n", | 131 | DRM_DEBUG_KMS("qxl: vram %llx-%llx(%dM %dk), surface %llx-%llx(%dM %dk)\n", |
132 | (void *)qdev->vram_base, (void *)pci_resource_end(pdev, 0), | 132 | (unsigned long long)qdev->vram_base, |
133 | (unsigned long long)pci_resource_end(pdev, 0), | ||
133 | (int)pci_resource_len(pdev, 0) / 1024 / 1024, | 134 | (int)pci_resource_len(pdev, 0) / 1024 / 1024, |
134 | (int)pci_resource_len(pdev, 0) / 1024, | 135 | (int)pci_resource_len(pdev, 0) / 1024, |
135 | (void *)qdev->surfaceram_base, | 136 | (unsigned long long)qdev->surfaceram_base, |
136 | (void *)pci_resource_end(pdev, 1), | 137 | (unsigned long long)pci_resource_end(pdev, 1), |
137 | (int)qdev->surfaceram_size / 1024 / 1024, | 138 | (int)qdev->surfaceram_size / 1024 / 1024, |
138 | (int)qdev->surfaceram_size / 1024); | 139 | (int)qdev->surfaceram_size / 1024); |
139 | 140 | ||
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 44a7da66e081..8406c8251fbf 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -667,6 +667,8 @@ atombios_digital_setup(struct drm_encoder *encoder, int action) | |||
667 | int | 667 | int |
668 | atombios_get_encoder_mode(struct drm_encoder *encoder) | 668 | atombios_get_encoder_mode(struct drm_encoder *encoder) |
669 | { | 669 | { |
670 | struct drm_device *dev = encoder->dev; | ||
671 | struct radeon_device *rdev = dev->dev_private; | ||
670 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); | 672 | struct radeon_encoder *radeon_encoder = to_radeon_encoder(encoder); |
671 | struct drm_connector *connector; | 673 | struct drm_connector *connector; |
672 | struct radeon_connector *radeon_connector; | 674 | struct radeon_connector *radeon_connector; |
@@ -693,7 +695,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
693 | case DRM_MODE_CONNECTOR_DVII: | 695 | case DRM_MODE_CONNECTOR_DVII: |
694 | case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ | 696 | case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ |
695 | if (drm_detect_hdmi_monitor(radeon_connector->edid) && | 697 | if (drm_detect_hdmi_monitor(radeon_connector->edid) && |
696 | radeon_audio) | 698 | radeon_audio && |
699 | !ASIC_IS_DCE6(rdev)) /* remove once we support DCE6 */ | ||
697 | return ATOM_ENCODER_MODE_HDMI; | 700 | return ATOM_ENCODER_MODE_HDMI; |
698 | else if (radeon_connector->use_digital) | 701 | else if (radeon_connector->use_digital) |
699 | return ATOM_ENCODER_MODE_DVI; | 702 | return ATOM_ENCODER_MODE_DVI; |
@@ -704,7 +707,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
704 | case DRM_MODE_CONNECTOR_HDMIA: | 707 | case DRM_MODE_CONNECTOR_HDMIA: |
705 | default: | 708 | default: |
706 | if (drm_detect_hdmi_monitor(radeon_connector->edid) && | 709 | if (drm_detect_hdmi_monitor(radeon_connector->edid) && |
707 | radeon_audio) | 710 | radeon_audio && |
711 | !ASIC_IS_DCE6(rdev)) /* remove once we support DCE6 */ | ||
708 | return ATOM_ENCODER_MODE_HDMI; | 712 | return ATOM_ENCODER_MODE_HDMI; |
709 | else | 713 | else |
710 | return ATOM_ENCODER_MODE_DVI; | 714 | return ATOM_ENCODER_MODE_DVI; |
@@ -718,7 +722,8 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
718 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) | 722 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) |
719 | return ATOM_ENCODER_MODE_DP; | 723 | return ATOM_ENCODER_MODE_DP; |
720 | else if (drm_detect_hdmi_monitor(radeon_connector->edid) && | 724 | else if (drm_detect_hdmi_monitor(radeon_connector->edid) && |
721 | radeon_audio) | 725 | radeon_audio && |
726 | !ASIC_IS_DCE6(rdev)) /* remove once we support DCE6 */ | ||
722 | return ATOM_ENCODER_MODE_HDMI; | 727 | return ATOM_ENCODER_MODE_HDMI; |
723 | else | 728 | else |
724 | return ATOM_ENCODER_MODE_DVI; | 729 | return ATOM_ENCODER_MODE_DVI; |
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c index 8f9e2d31b255..0f89ce3d02b9 100644 --- a/drivers/gpu/drm/radeon/evergreen.c +++ b/drivers/gpu/drm/radeon/evergreen.c | |||
@@ -4754,6 +4754,12 @@ static int evergreen_startup(struct radeon_device *rdev) | |||
4754 | rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; | 4754 | rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; |
4755 | 4755 | ||
4756 | /* Enable IRQ */ | 4756 | /* Enable IRQ */ |
4757 | if (!rdev->irq.installed) { | ||
4758 | r = radeon_irq_kms_init(rdev); | ||
4759 | if (r) | ||
4760 | return r; | ||
4761 | } | ||
4762 | |||
4757 | r = r600_irq_init(rdev); | 4763 | r = r600_irq_init(rdev); |
4758 | if (r) { | 4764 | if (r) { |
4759 | DRM_ERROR("radeon: IH init failed (%d).\n", r); | 4765 | DRM_ERROR("radeon: IH init failed (%d).\n", r); |
@@ -4923,10 +4929,6 @@ int evergreen_init(struct radeon_device *rdev) | |||
4923 | if (r) | 4929 | if (r) |
4924 | return r; | 4930 | return r; |
4925 | 4931 | ||
4926 | r = radeon_irq_kms_init(rdev); | ||
4927 | if (r) | ||
4928 | return r; | ||
4929 | |||
4930 | rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; | 4932 | rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; |
4931 | r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); | 4933 | r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); |
4932 | 4934 | ||
@@ -4999,8 +5001,7 @@ void evergreen_fini(struct radeon_device *rdev) | |||
4999 | 5001 | ||
5000 | void evergreen_pcie_gen2_enable(struct radeon_device *rdev) | 5002 | void evergreen_pcie_gen2_enable(struct radeon_device *rdev) |
5001 | { | 5003 | { |
5002 | u32 link_width_cntl, speed_cntl, mask; | 5004 | u32 link_width_cntl, speed_cntl; |
5003 | int ret; | ||
5004 | 5005 | ||
5005 | if (radeon_pcie_gen2 == 0) | 5006 | if (radeon_pcie_gen2 == 0) |
5006 | return; | 5007 | return; |
@@ -5015,11 +5016,8 @@ void evergreen_pcie_gen2_enable(struct radeon_device *rdev) | |||
5015 | if (ASIC_IS_X2(rdev)) | 5016 | if (ASIC_IS_X2(rdev)) |
5016 | return; | 5017 | return; |
5017 | 5018 | ||
5018 | ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask); | 5019 | if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) && |
5019 | if (ret != 0) | 5020 | (rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT)) |
5020 | return; | ||
5021 | |||
5022 | if (!(mask & DRM_PCIE_SPEED_50)) | ||
5023 | return; | 5021 | return; |
5024 | 5022 | ||
5025 | speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); | 5023 | speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 7969c0c8ec20..84583302b081 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -2025,6 +2025,12 @@ static int cayman_startup(struct radeon_device *rdev) | |||
2025 | } | 2025 | } |
2026 | 2026 | ||
2027 | /* Enable IRQ */ | 2027 | /* Enable IRQ */ |
2028 | if (!rdev->irq.installed) { | ||
2029 | r = radeon_irq_kms_init(rdev); | ||
2030 | if (r) | ||
2031 | return r; | ||
2032 | } | ||
2033 | |||
2028 | r = r600_irq_init(rdev); | 2034 | r = r600_irq_init(rdev); |
2029 | if (r) { | 2035 | if (r) { |
2030 | DRM_ERROR("radeon: IH init failed (%d).\n", r); | 2036 | DRM_ERROR("radeon: IH init failed (%d).\n", r); |
@@ -2190,10 +2196,6 @@ int cayman_init(struct radeon_device *rdev) | |||
2190 | if (r) | 2196 | if (r) |
2191 | return r; | 2197 | return r; |
2192 | 2198 | ||
2193 | r = radeon_irq_kms_init(rdev); | ||
2194 | if (r) | ||
2195 | return r; | ||
2196 | |||
2197 | ring->ring_obj = NULL; | 2199 | ring->ring_obj = NULL; |
2198 | r600_ring_init(rdev, ring, 1024 * 1024); | 2200 | r600_ring_init(rdev, ring, 1024 * 1024); |
2199 | 2201 | ||
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 4973bff37fec..d0314ecbd7c1 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -3869,6 +3869,12 @@ static int r100_startup(struct radeon_device *rdev) | |||
3869 | } | 3869 | } |
3870 | 3870 | ||
3871 | /* Enable IRQ */ | 3871 | /* Enable IRQ */ |
3872 | if (!rdev->irq.installed) { | ||
3873 | r = radeon_irq_kms_init(rdev); | ||
3874 | if (r) | ||
3875 | return r; | ||
3876 | } | ||
3877 | |||
3872 | r100_irq_set(rdev); | 3878 | r100_irq_set(rdev); |
3873 | rdev->config.r100.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 3879 | rdev->config.r100.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
3874 | /* 1M ring buffer */ | 3880 | /* 1M ring buffer */ |
@@ -4024,9 +4030,6 @@ int r100_init(struct radeon_device *rdev) | |||
4024 | r = radeon_fence_driver_init(rdev); | 4030 | r = radeon_fence_driver_init(rdev); |
4025 | if (r) | 4031 | if (r) |
4026 | return r; | 4032 | return r; |
4027 | r = radeon_irq_kms_init(rdev); | ||
4028 | if (r) | ||
4029 | return r; | ||
4030 | /* Memory manager */ | 4033 | /* Memory manager */ |
4031 | r = radeon_bo_init(rdev); | 4034 | r = radeon_bo_init(rdev); |
4032 | if (r) | 4035 | if (r) |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index c60350e6872d..b9b776f1e582 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -1382,6 +1382,12 @@ static int r300_startup(struct radeon_device *rdev) | |||
1382 | } | 1382 | } |
1383 | 1383 | ||
1384 | /* Enable IRQ */ | 1384 | /* Enable IRQ */ |
1385 | if (!rdev->irq.installed) { | ||
1386 | r = radeon_irq_kms_init(rdev); | ||
1387 | if (r) | ||
1388 | return r; | ||
1389 | } | ||
1390 | |||
1385 | r100_irq_set(rdev); | 1391 | r100_irq_set(rdev); |
1386 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 1392 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
1387 | /* 1M ring buffer */ | 1393 | /* 1M ring buffer */ |
@@ -1516,9 +1522,6 @@ int r300_init(struct radeon_device *rdev) | |||
1516 | r = radeon_fence_driver_init(rdev); | 1522 | r = radeon_fence_driver_init(rdev); |
1517 | if (r) | 1523 | if (r) |
1518 | return r; | 1524 | return r; |
1519 | r = radeon_irq_kms_init(rdev); | ||
1520 | if (r) | ||
1521 | return r; | ||
1522 | /* Memory manager */ | 1525 | /* Memory manager */ |
1523 | r = radeon_bo_init(rdev); | 1526 | r = radeon_bo_init(rdev); |
1524 | if (r) | 1527 | if (r) |
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c index 6fce2eb4dd16..4e796ecf9ea4 100644 --- a/drivers/gpu/drm/radeon/r420.c +++ b/drivers/gpu/drm/radeon/r420.c | |||
@@ -265,6 +265,12 @@ static int r420_startup(struct radeon_device *rdev) | |||
265 | } | 265 | } |
266 | 266 | ||
267 | /* Enable IRQ */ | 267 | /* Enable IRQ */ |
268 | if (!rdev->irq.installed) { | ||
269 | r = radeon_irq_kms_init(rdev); | ||
270 | if (r) | ||
271 | return r; | ||
272 | } | ||
273 | |||
268 | r100_irq_set(rdev); | 274 | r100_irq_set(rdev); |
269 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 275 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
270 | /* 1M ring buffer */ | 276 | /* 1M ring buffer */ |
@@ -411,10 +417,6 @@ int r420_init(struct radeon_device *rdev) | |||
411 | if (r) { | 417 | if (r) { |
412 | return r; | 418 | return r; |
413 | } | 419 | } |
414 | r = radeon_irq_kms_init(rdev); | ||
415 | if (r) { | ||
416 | return r; | ||
417 | } | ||
418 | /* Memory manager */ | 420 | /* Memory manager */ |
419 | r = radeon_bo_init(rdev); | 421 | r = radeon_bo_init(rdev); |
420 | if (r) { | 422 | if (r) { |
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c index f795a4e092cb..e1aece73b370 100644 --- a/drivers/gpu/drm/radeon/r520.c +++ b/drivers/gpu/drm/radeon/r520.c | |||
@@ -194,6 +194,12 @@ static int r520_startup(struct radeon_device *rdev) | |||
194 | } | 194 | } |
195 | 195 | ||
196 | /* Enable IRQ */ | 196 | /* Enable IRQ */ |
197 | if (!rdev->irq.installed) { | ||
198 | r = radeon_irq_kms_init(rdev); | ||
199 | if (r) | ||
200 | return r; | ||
201 | } | ||
202 | |||
197 | rs600_irq_set(rdev); | 203 | rs600_irq_set(rdev); |
198 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 204 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
199 | /* 1M ring buffer */ | 205 | /* 1M ring buffer */ |
@@ -297,9 +303,6 @@ int r520_init(struct radeon_device *rdev) | |||
297 | r = radeon_fence_driver_init(rdev); | 303 | r = radeon_fence_driver_init(rdev); |
298 | if (r) | 304 | if (r) |
299 | return r; | 305 | return r; |
300 | r = radeon_irq_kms_init(rdev); | ||
301 | if (r) | ||
302 | return r; | ||
303 | /* Memory manager */ | 306 | /* Memory manager */ |
304 | r = radeon_bo_init(rdev); | 307 | r = radeon_bo_init(rdev); |
305 | if (r) | 308 | if (r) |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 1a08008c978b..0e5341695922 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -1046,6 +1046,24 @@ int r600_mc_wait_for_idle(struct radeon_device *rdev) | |||
1046 | return -1; | 1046 | return -1; |
1047 | } | 1047 | } |
1048 | 1048 | ||
1049 | uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg) | ||
1050 | { | ||
1051 | uint32_t r; | ||
1052 | |||
1053 | WREG32(R_0028F8_MC_INDEX, S_0028F8_MC_IND_ADDR(reg)); | ||
1054 | r = RREG32(R_0028FC_MC_DATA); | ||
1055 | WREG32(R_0028F8_MC_INDEX, ~C_0028F8_MC_IND_ADDR); | ||
1056 | return r; | ||
1057 | } | ||
1058 | |||
1059 | void rs780_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v) | ||
1060 | { | ||
1061 | WREG32(R_0028F8_MC_INDEX, S_0028F8_MC_IND_ADDR(reg) | | ||
1062 | S_0028F8_MC_IND_WR_EN(1)); | ||
1063 | WREG32(R_0028FC_MC_DATA, v); | ||
1064 | WREG32(R_0028F8_MC_INDEX, 0x7F); | ||
1065 | } | ||
1066 | |||
1049 | static void r600_mc_program(struct radeon_device *rdev) | 1067 | static void r600_mc_program(struct radeon_device *rdev) |
1050 | { | 1068 | { |
1051 | struct rv515_mc_save save; | 1069 | struct rv515_mc_save save; |
@@ -1181,6 +1199,8 @@ static int r600_mc_init(struct radeon_device *rdev) | |||
1181 | { | 1199 | { |
1182 | u32 tmp; | 1200 | u32 tmp; |
1183 | int chansize, numchan; | 1201 | int chansize, numchan; |
1202 | uint32_t h_addr, l_addr; | ||
1203 | unsigned long long k8_addr; | ||
1184 | 1204 | ||
1185 | /* Get VRAM informations */ | 1205 | /* Get VRAM informations */ |
1186 | rdev->mc.vram_is_ddr = true; | 1206 | rdev->mc.vram_is_ddr = true; |
@@ -1221,7 +1241,30 @@ static int r600_mc_init(struct radeon_device *rdev) | |||
1221 | if (rdev->flags & RADEON_IS_IGP) { | 1241 | if (rdev->flags & RADEON_IS_IGP) { |
1222 | rs690_pm_info(rdev); | 1242 | rs690_pm_info(rdev); |
1223 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); | 1243 | rdev->mc.igp_sideport_enabled = radeon_atombios_sideport_present(rdev); |
1244 | |||
1245 | if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) { | ||
1246 | /* Use K8 direct mapping for fast fb access. */ | ||
1247 | rdev->fastfb_working = false; | ||
1248 | h_addr = G_000012_K8_ADDR_EXT(RREG32_MC(R_000012_MC_MISC_UMA_CNTL)); | ||
1249 | l_addr = RREG32_MC(R_000011_K8_FB_LOCATION); | ||
1250 | k8_addr = ((unsigned long long)h_addr) << 32 | l_addr; | ||
1251 | #if defined(CONFIG_X86_32) && !defined(CONFIG_X86_PAE) | ||
1252 | if (k8_addr + rdev->mc.visible_vram_size < 0x100000000ULL) | ||
1253 | #endif | ||
1254 | { | ||
1255 | /* FastFB shall be used with UMA memory. Here it is simply disabled when sideport | ||
1256 | * memory is present. | ||
1257 | */ | ||
1258 | if (rdev->mc.igp_sideport_enabled == false && radeon_fastfb == 1) { | ||
1259 | DRM_INFO("Direct mapping: aper base at 0x%llx, replaced by direct mapping base 0x%llx.\n", | ||
1260 | (unsigned long long)rdev->mc.aper_base, k8_addr); | ||
1261 | rdev->mc.aper_base = (resource_size_t)k8_addr; | ||
1262 | rdev->fastfb_working = true; | ||
1263 | } | ||
1264 | } | ||
1265 | } | ||
1224 | } | 1266 | } |
1267 | |||
1225 | radeon_update_bandwidth_info(rdev); | 1268 | radeon_update_bandwidth_info(rdev); |
1226 | return 0; | 1269 | return 0; |
1227 | } | 1270 | } |
@@ -3202,6 +3245,12 @@ static int r600_startup(struct radeon_device *rdev) | |||
3202 | } | 3245 | } |
3203 | 3246 | ||
3204 | /* Enable IRQ */ | 3247 | /* Enable IRQ */ |
3248 | if (!rdev->irq.installed) { | ||
3249 | r = radeon_irq_kms_init(rdev); | ||
3250 | if (r) | ||
3251 | return r; | ||
3252 | } | ||
3253 | |||
3205 | r = r600_irq_init(rdev); | 3254 | r = r600_irq_init(rdev); |
3206 | if (r) { | 3255 | if (r) { |
3207 | DRM_ERROR("radeon: IH init failed (%d).\n", r); | 3256 | DRM_ERROR("radeon: IH init failed (%d).\n", r); |
@@ -3356,10 +3405,6 @@ int r600_init(struct radeon_device *rdev) | |||
3356 | if (r) | 3405 | if (r) |
3357 | return r; | 3406 | return r; |
3358 | 3407 | ||
3359 | r = radeon_irq_kms_init(rdev); | ||
3360 | if (r) | ||
3361 | return r; | ||
3362 | |||
3363 | rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; | 3408 | rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; |
3364 | r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); | 3409 | r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); |
3365 | 3410 | ||
@@ -4631,8 +4676,6 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev) | |||
4631 | { | 4676 | { |
4632 | u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp; | 4677 | u32 link_width_cntl, lanes, speed_cntl, training_cntl, tmp; |
4633 | u16 link_cntl2; | 4678 | u16 link_cntl2; |
4634 | u32 mask; | ||
4635 | int ret; | ||
4636 | 4679 | ||
4637 | if (radeon_pcie_gen2 == 0) | 4680 | if (radeon_pcie_gen2 == 0) |
4638 | return; | 4681 | return; |
@@ -4651,11 +4694,8 @@ static void r600_pcie_gen2_enable(struct radeon_device *rdev) | |||
4651 | if (rdev->family <= CHIP_R600) | 4694 | if (rdev->family <= CHIP_R600) |
4652 | return; | 4695 | return; |
4653 | 4696 | ||
4654 | ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask); | 4697 | if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) && |
4655 | if (ret != 0) | 4698 | (rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT)) |
4656 | return; | ||
4657 | |||
4658 | if (!(mask & DRM_PCIE_SPEED_50)) | ||
4659 | return; | 4699 | return; |
4660 | 4700 | ||
4661 | speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); | 4701 | speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); |
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h index acb146c06973..79df558f8c40 100644 --- a/drivers/gpu/drm/radeon/r600d.h +++ b/drivers/gpu/drm/radeon/r600d.h | |||
@@ -1342,6 +1342,14 @@ | |||
1342 | #define PACKET3_STRMOUT_BASE_UPDATE 0x72 /* r7xx */ | 1342 | #define PACKET3_STRMOUT_BASE_UPDATE 0x72 /* r7xx */ |
1343 | #define PACKET3_SURFACE_BASE_UPDATE 0x73 | 1343 | #define PACKET3_SURFACE_BASE_UPDATE 0x73 |
1344 | 1344 | ||
1345 | #define R_000011_K8_FB_LOCATION 0x11 | ||
1346 | #define R_000012_MC_MISC_UMA_CNTL 0x12 | ||
1347 | #define G_000012_K8_ADDR_EXT(x) (((x) >> 0) & 0xFF) | ||
1348 | #define R_0028F8_MC_INDEX 0x28F8 | ||
1349 | #define S_0028F8_MC_IND_ADDR(x) (((x) & 0x1FF) << 0) | ||
1350 | #define C_0028F8_MC_IND_ADDR 0xFFFFFE00 | ||
1351 | #define S_0028F8_MC_IND_WR_EN(x) (((x) & 0x1) << 9) | ||
1352 | #define R_0028FC_MC_DATA 0x28FC | ||
1345 | 1353 | ||
1346 | #define R_008020_GRBM_SOFT_RESET 0x8020 | 1354 | #define R_008020_GRBM_SOFT_RESET 0x8020 |
1347 | #define S_008020_SOFT_RESET_CP(x) (((x) & 1) << 0) | 1355 | #define S_008020_SOFT_RESET_CP(x) (((x) & 1) << 0) |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 06b8c19ab19e..a2802b47ee95 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -122,6 +122,10 @@ static void radeon_register_accessor_init(struct radeon_device *rdev) | |||
122 | rdev->mc_rreg = &rs600_mc_rreg; | 122 | rdev->mc_rreg = &rs600_mc_rreg; |
123 | rdev->mc_wreg = &rs600_mc_wreg; | 123 | rdev->mc_wreg = &rs600_mc_wreg; |
124 | } | 124 | } |
125 | if (rdev->family == CHIP_RS780 || rdev->family == CHIP_RS880) { | ||
126 | rdev->mc_rreg = &rs780_mc_rreg; | ||
127 | rdev->mc_wreg = &rs780_mc_wreg; | ||
128 | } | ||
125 | if (rdev->family >= CHIP_R600) { | 129 | if (rdev->family >= CHIP_R600) { |
126 | rdev->pciep_rreg = &r600_pciep_rreg; | 130 | rdev->pciep_rreg = &r600_pciep_rreg; |
127 | rdev->pciep_wreg = &r600_pciep_wreg; | 131 | rdev->pciep_wreg = &r600_pciep_wreg; |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h index 2c87365d345f..a72759ede753 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.h +++ b/drivers/gpu/drm/radeon/radeon_asic.h | |||
@@ -347,6 +347,8 @@ extern bool r600_gui_idle(struct radeon_device *rdev); | |||
347 | extern void r600_pm_misc(struct radeon_device *rdev); | 347 | extern void r600_pm_misc(struct radeon_device *rdev); |
348 | extern void r600_pm_init_profile(struct radeon_device *rdev); | 348 | extern void r600_pm_init_profile(struct radeon_device *rdev); |
349 | extern void rs780_pm_init_profile(struct radeon_device *rdev); | 349 | extern void rs780_pm_init_profile(struct radeon_device *rdev); |
350 | extern uint32_t rs780_mc_rreg(struct radeon_device *rdev, uint32_t reg); | ||
351 | extern void rs780_mc_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v); | ||
350 | extern void r600_pm_get_dynpm_state(struct radeon_device *rdev); | 352 | extern void r600_pm_get_dynpm_state(struct radeon_device *rdev); |
351 | extern void r600_set_pcie_lanes(struct radeon_device *rdev, int lanes); | 353 | extern void r600_set_pcie_lanes(struct radeon_device *rdev, int lanes); |
352 | extern int r600_get_pcie_lanes(struct radeon_device *rdev); | 354 | extern int r600_get_pcie_lanes(struct radeon_device *rdev); |
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index c2c59fb1ea01..189973836cff 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
@@ -467,23 +467,27 @@ bool radeon_card_posted(struct radeon_device *rdev) | |||
467 | { | 467 | { |
468 | uint32_t reg; | 468 | uint32_t reg; |
469 | 469 | ||
470 | /* required for EFI mode on macbook2,1 which uses an r5xx asic */ | ||
470 | if (efi_enabled(EFI_BOOT) && | 471 | if (efi_enabled(EFI_BOOT) && |
471 | rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) | 472 | (rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) && |
473 | (rdev->family < CHIP_R600)) | ||
472 | return false; | 474 | return false; |
473 | 475 | ||
476 | if (ASIC_IS_NODCE(rdev)) | ||
477 | goto check_memsize; | ||
478 | |||
474 | /* first check CRTCs */ | 479 | /* first check CRTCs */ |
475 | if (ASIC_IS_DCE41(rdev)) { | 480 | if (ASIC_IS_DCE4(rdev)) { |
476 | reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) | | 481 | reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) | |
477 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET); | 482 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET); |
478 | if (reg & EVERGREEN_CRTC_MASTER_EN) | 483 | if (rdev->num_crtc >= 4) { |
479 | return true; | 484 | reg |= RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) | |
480 | } else if (ASIC_IS_DCE4(rdev)) { | 485 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET); |
481 | reg = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET) | | 486 | } |
482 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET) | | 487 | if (rdev->num_crtc >= 6) { |
483 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET) | | 488 | reg |= RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) | |
484 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET) | | 489 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET); |
485 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET) | | 490 | } |
486 | RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET); | ||
487 | if (reg & EVERGREEN_CRTC_MASTER_EN) | 491 | if (reg & EVERGREEN_CRTC_MASTER_EN) |
488 | return true; | 492 | return true; |
489 | } else if (ASIC_IS_AVIVO(rdev)) { | 493 | } else if (ASIC_IS_AVIVO(rdev)) { |
@@ -500,6 +504,7 @@ bool radeon_card_posted(struct radeon_device *rdev) | |||
500 | } | 504 | } |
501 | } | 505 | } |
502 | 506 | ||
507 | check_memsize: | ||
503 | /* then check MEM_SIZE, in case the crtcs are off */ | 508 | /* then check MEM_SIZE, in case the crtcs are off */ |
504 | if (rdev->family >= CHIP_R600) | 509 | if (rdev->family >= CHIP_R600) |
505 | reg = RREG32(R600_CONFIG_MEMSIZE); | 510 | reg = RREG32(R600_CONFIG_MEMSIZE); |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index e38fd559f1ab..eb18bb7af1cc 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -271,8 +271,6 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) | |||
271 | { | 271 | { |
272 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; | 272 | struct radeon_crtc *radeon_crtc = rdev->mode_info.crtcs[crtc_id]; |
273 | struct radeon_unpin_work *work; | 273 | struct radeon_unpin_work *work; |
274 | struct drm_pending_vblank_event *e; | ||
275 | struct timeval now; | ||
276 | unsigned long flags; | 274 | unsigned long flags; |
277 | u32 update_pending; | 275 | u32 update_pending; |
278 | int vpos, hpos; | 276 | int vpos, hpos; |
@@ -328,14 +326,9 @@ void radeon_crtc_handle_flip(struct radeon_device *rdev, int crtc_id) | |||
328 | radeon_crtc->unpin_work = NULL; | 326 | radeon_crtc->unpin_work = NULL; |
329 | 327 | ||
330 | /* wakeup userspace */ | 328 | /* wakeup userspace */ |
331 | if (work->event) { | 329 | if (work->event) |
332 | e = work->event; | 330 | drm_send_vblank_event(rdev->ddev, crtc_id, work->event); |
333 | e->event.sequence = drm_vblank_count_and_time(rdev->ddev, crtc_id, &now); | 331 | |
334 | e->event.tv_sec = now.tv_sec; | ||
335 | e->event.tv_usec = now.tv_usec; | ||
336 | list_add_tail(&e->base.link, &e->base.file_priv->event_list); | ||
337 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
338 | } | ||
339 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); | 332 | spin_unlock_irqrestore(&rdev->ddev->event_lock, flags); |
340 | 333 | ||
341 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); | 334 | drm_vblank_put(rdev->ddev, radeon_crtc->crtc_id); |
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c index 73051ce3121e..233a9b9fa1f7 100644 --- a/drivers/gpu/drm/radeon/rs400.c +++ b/drivers/gpu/drm/radeon/rs400.c | |||
@@ -417,6 +417,12 @@ static int rs400_startup(struct radeon_device *rdev) | |||
417 | } | 417 | } |
418 | 418 | ||
419 | /* Enable IRQ */ | 419 | /* Enable IRQ */ |
420 | if (!rdev->irq.installed) { | ||
421 | r = radeon_irq_kms_init(rdev); | ||
422 | if (r) | ||
423 | return r; | ||
424 | } | ||
425 | |||
420 | r100_irq_set(rdev); | 426 | r100_irq_set(rdev); |
421 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 427 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
422 | /* 1M ring buffer */ | 428 | /* 1M ring buffer */ |
@@ -535,9 +541,6 @@ int rs400_init(struct radeon_device *rdev) | |||
535 | r = radeon_fence_driver_init(rdev); | 541 | r = radeon_fence_driver_init(rdev); |
536 | if (r) | 542 | if (r) |
537 | return r; | 543 | return r; |
538 | r = radeon_irq_kms_init(rdev); | ||
539 | if (r) | ||
540 | return r; | ||
541 | /* Memory manager */ | 544 | /* Memory manager */ |
542 | r = radeon_bo_init(rdev); | 545 | r = radeon_bo_init(rdev); |
543 | if (r) | 546 | if (r) |
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c index 46fa1b07c560..670b555d2ca2 100644 --- a/drivers/gpu/drm/radeon/rs600.c +++ b/drivers/gpu/drm/radeon/rs600.c | |||
@@ -923,6 +923,12 @@ static int rs600_startup(struct radeon_device *rdev) | |||
923 | } | 923 | } |
924 | 924 | ||
925 | /* Enable IRQ */ | 925 | /* Enable IRQ */ |
926 | if (!rdev->irq.installed) { | ||
927 | r = radeon_irq_kms_init(rdev); | ||
928 | if (r) | ||
929 | return r; | ||
930 | } | ||
931 | |||
926 | rs600_irq_set(rdev); | 932 | rs600_irq_set(rdev); |
927 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 933 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
928 | /* 1M ring buffer */ | 934 | /* 1M ring buffer */ |
@@ -1047,9 +1053,6 @@ int rs600_init(struct radeon_device *rdev) | |||
1047 | r = radeon_fence_driver_init(rdev); | 1053 | r = radeon_fence_driver_init(rdev); |
1048 | if (r) | 1054 | if (r) |
1049 | return r; | 1055 | return r; |
1050 | r = radeon_irq_kms_init(rdev); | ||
1051 | if (r) | ||
1052 | return r; | ||
1053 | /* Memory manager */ | 1056 | /* Memory manager */ |
1054 | r = radeon_bo_init(rdev); | 1057 | r = radeon_bo_init(rdev); |
1055 | if (r) | 1058 | if (r) |
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c index ab4c86cfd552..55880d5962c3 100644 --- a/drivers/gpu/drm/radeon/rs690.c +++ b/drivers/gpu/drm/radeon/rs690.c | |||
@@ -651,6 +651,12 @@ static int rs690_startup(struct radeon_device *rdev) | |||
651 | } | 651 | } |
652 | 652 | ||
653 | /* Enable IRQ */ | 653 | /* Enable IRQ */ |
654 | if (!rdev->irq.installed) { | ||
655 | r = radeon_irq_kms_init(rdev); | ||
656 | if (r) | ||
657 | return r; | ||
658 | } | ||
659 | |||
654 | rs600_irq_set(rdev); | 660 | rs600_irq_set(rdev); |
655 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 661 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
656 | /* 1M ring buffer */ | 662 | /* 1M ring buffer */ |
@@ -776,9 +782,6 @@ int rs690_init(struct radeon_device *rdev) | |||
776 | r = radeon_fence_driver_init(rdev); | 782 | r = radeon_fence_driver_init(rdev); |
777 | if (r) | 783 | if (r) |
778 | return r; | 784 | return r; |
779 | r = radeon_irq_kms_init(rdev); | ||
780 | if (r) | ||
781 | return r; | ||
782 | /* Memory manager */ | 785 | /* Memory manager */ |
783 | r = radeon_bo_init(rdev); | 786 | r = radeon_bo_init(rdev); |
784 | if (r) | 787 | if (r) |
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c index ffcba730c57c..21c7d7b26e55 100644 --- a/drivers/gpu/drm/radeon/rv515.c +++ b/drivers/gpu/drm/radeon/rv515.c | |||
@@ -532,6 +532,12 @@ static int rv515_startup(struct radeon_device *rdev) | |||
532 | } | 532 | } |
533 | 533 | ||
534 | /* Enable IRQ */ | 534 | /* Enable IRQ */ |
535 | if (!rdev->irq.installed) { | ||
536 | r = radeon_irq_kms_init(rdev); | ||
537 | if (r) | ||
538 | return r; | ||
539 | } | ||
540 | |||
535 | rs600_irq_set(rdev); | 541 | rs600_irq_set(rdev); |
536 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); | 542 | rdev->config.r300.hdp_cntl = RREG32(RADEON_HOST_PATH_CNTL); |
537 | /* 1M ring buffer */ | 543 | /* 1M ring buffer */ |
@@ -662,9 +668,6 @@ int rv515_init(struct radeon_device *rdev) | |||
662 | r = radeon_fence_driver_init(rdev); | 668 | r = radeon_fence_driver_init(rdev); |
663 | if (r) | 669 | if (r) |
664 | return r; | 670 | return r; |
665 | r = radeon_irq_kms_init(rdev); | ||
666 | if (r) | ||
667 | return r; | ||
668 | /* Memory manager */ | 671 | /* Memory manager */ |
669 | r = radeon_bo_init(rdev); | 672 | r = radeon_bo_init(rdev); |
670 | if (r) | 673 | if (r) |
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c index 83f612a9500b..4a62ad2e5399 100644 --- a/drivers/gpu/drm/radeon/rv770.c +++ b/drivers/gpu/drm/radeon/rv770.c | |||
@@ -862,10 +862,8 @@ int rv770_uvd_resume(struct radeon_device *rdev) | |||
862 | chip_id = 0x0100000b; | 862 | chip_id = 0x0100000b; |
863 | break; | 863 | break; |
864 | case CHIP_SUMO: | 864 | case CHIP_SUMO: |
865 | chip_id = 0x0100000c; | ||
866 | break; | ||
867 | case CHIP_SUMO2: | 865 | case CHIP_SUMO2: |
868 | chip_id = 0x0100000d; | 866 | chip_id = 0x0100000c; |
869 | break; | 867 | break; |
870 | case CHIP_PALM: | 868 | case CHIP_PALM: |
871 | chip_id = 0x0100000e; | 869 | chip_id = 0x0100000e; |
@@ -1889,6 +1887,12 @@ static int rv770_startup(struct radeon_device *rdev) | |||
1889 | rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; | 1887 | rdev->ring[R600_RING_TYPE_UVD_INDEX].ring_size = 0; |
1890 | 1888 | ||
1891 | /* Enable IRQ */ | 1889 | /* Enable IRQ */ |
1890 | if (!rdev->irq.installed) { | ||
1891 | r = radeon_irq_kms_init(rdev); | ||
1892 | if (r) | ||
1893 | return r; | ||
1894 | } | ||
1895 | |||
1892 | r = r600_irq_init(rdev); | 1896 | r = r600_irq_init(rdev); |
1893 | if (r) { | 1897 | if (r) { |
1894 | DRM_ERROR("radeon: IH init failed (%d).\n", r); | 1898 | DRM_ERROR("radeon: IH init failed (%d).\n", r); |
@@ -2047,10 +2051,6 @@ int rv770_init(struct radeon_device *rdev) | |||
2047 | if (r) | 2051 | if (r) |
2048 | return r; | 2052 | return r; |
2049 | 2053 | ||
2050 | r = radeon_irq_kms_init(rdev); | ||
2051 | if (r) | ||
2052 | return r; | ||
2053 | |||
2054 | rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; | 2054 | rdev->ring[RADEON_RING_TYPE_GFX_INDEX].ring_obj = NULL; |
2055 | r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); | 2055 | r600_ring_init(rdev, &rdev->ring[RADEON_RING_TYPE_GFX_INDEX], 1024 * 1024); |
2056 | 2056 | ||
@@ -2113,8 +2113,6 @@ static void rv770_pcie_gen2_enable(struct radeon_device *rdev) | |||
2113 | { | 2113 | { |
2114 | u32 link_width_cntl, lanes, speed_cntl, tmp; | 2114 | u32 link_width_cntl, lanes, speed_cntl, tmp; |
2115 | u16 link_cntl2; | 2115 | u16 link_cntl2; |
2116 | u32 mask; | ||
2117 | int ret; | ||
2118 | 2116 | ||
2119 | if (radeon_pcie_gen2 == 0) | 2117 | if (radeon_pcie_gen2 == 0) |
2120 | return; | 2118 | return; |
@@ -2129,11 +2127,8 @@ static void rv770_pcie_gen2_enable(struct radeon_device *rdev) | |||
2129 | if (ASIC_IS_X2(rdev)) | 2127 | if (ASIC_IS_X2(rdev)) |
2130 | return; | 2128 | return; |
2131 | 2129 | ||
2132 | ret = drm_pcie_get_speed_cap_mask(rdev->ddev, &mask); | 2130 | if ((rdev->pdev->bus->max_bus_speed != PCIE_SPEED_5_0GT) && |
2133 | if (ret != 0) | 2131 | (rdev->pdev->bus->max_bus_speed != PCIE_SPEED_8_0GT)) |
2134 | return; | ||
2135 | |||
2136 | if (!(mask & DRM_PCIE_SPEED_50)) | ||
2137 | return; | 2132 | return; |
2138 | 2133 | ||
2139 | DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n"); | 2134 | DRM_INFO("enabling PCIE gen 2 link speeds, disable with radeon.pcie_gen2=0\n"); |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 5ffade69af25..a1b0da6b5808 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -2616,7 +2616,7 @@ static void si_gpu_init(struct radeon_device *rdev) | |||
2616 | default: | 2616 | default: |
2617 | rdev->config.si.max_shader_engines = 1; | 2617 | rdev->config.si.max_shader_engines = 1; |
2618 | rdev->config.si.max_tile_pipes = 4; | 2618 | rdev->config.si.max_tile_pipes = 4; |
2619 | rdev->config.si.max_cu_per_sh = 2; | 2619 | rdev->config.si.max_cu_per_sh = 5; |
2620 | rdev->config.si.max_sh_per_se = 2; | 2620 | rdev->config.si.max_sh_per_se = 2; |
2621 | rdev->config.si.max_backends_per_se = 4; | 2621 | rdev->config.si.max_backends_per_se = 4; |
2622 | rdev->config.si.max_texture_channel_caches = 4; | 2622 | rdev->config.si.max_texture_channel_caches = 4; |
@@ -5350,6 +5350,12 @@ static int si_startup(struct radeon_device *rdev) | |||
5350 | } | 5350 | } |
5351 | 5351 | ||
5352 | /* Enable IRQ */ | 5352 | /* Enable IRQ */ |
5353 | if (!rdev->irq.installed) { | ||
5354 | r = radeon_irq_kms_init(rdev); | ||
5355 | if (r) | ||
5356 | return r; | ||
5357 | } | ||
5358 | |||
5353 | r = si_irq_init(rdev); | 5359 | r = si_irq_init(rdev); |
5354 | if (r) { | 5360 | if (r) { |
5355 | DRM_ERROR("radeon: IH init failed (%d).\n", r); | 5361 | DRM_ERROR("radeon: IH init failed (%d).\n", r); |
@@ -5533,10 +5539,6 @@ int si_init(struct radeon_device *rdev) | |||
5533 | if (r) | 5539 | if (r) |
5534 | return r; | 5540 | return r; |
5535 | 5541 | ||
5536 | r = radeon_irq_kms_init(rdev); | ||
5537 | if (r) | ||
5538 | return r; | ||
5539 | |||
5540 | ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; | 5542 | ring = &rdev->ring[RADEON_RING_TYPE_GFX_INDEX]; |
5541 | ring->ring_obj = NULL; | 5543 | ring->ring_obj = NULL; |
5542 | r600_ring_init(rdev, ring, 1024 * 1024); | 5544 | r600_ring_init(rdev, ring, 1024 * 1024); |
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c index 7dff49ed66e7..99e2034e49cc 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_crtc.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_crtc.c | |||
@@ -451,27 +451,16 @@ void shmob_drm_crtc_finish_page_flip(struct shmob_drm_crtc *scrtc) | |||
451 | { | 451 | { |
452 | struct drm_pending_vblank_event *event; | 452 | struct drm_pending_vblank_event *event; |
453 | struct drm_device *dev = scrtc->crtc.dev; | 453 | struct drm_device *dev = scrtc->crtc.dev; |
454 | struct timeval vblanktime; | ||
455 | unsigned long flags; | 454 | unsigned long flags; |
456 | 455 | ||
457 | spin_lock_irqsave(&dev->event_lock, flags); | 456 | spin_lock_irqsave(&dev->event_lock, flags); |
458 | event = scrtc->event; | 457 | event = scrtc->event; |
459 | scrtc->event = NULL; | 458 | scrtc->event = NULL; |
459 | if (event) { | ||
460 | drm_send_vblank_event(dev, 0, event); | ||
461 | drm_vblank_put(dev, 0); | ||
462 | } | ||
460 | spin_unlock_irqrestore(&dev->event_lock, flags); | 463 | spin_unlock_irqrestore(&dev->event_lock, flags); |
461 | |||
462 | if (event == NULL) | ||
463 | return; | ||
464 | |||
465 | event->event.sequence = drm_vblank_count_and_time(dev, 0, &vblanktime); | ||
466 | event->event.tv_sec = vblanktime.tv_sec; | ||
467 | event->event.tv_usec = vblanktime.tv_usec; | ||
468 | |||
469 | spin_lock_irqsave(&dev->event_lock, flags); | ||
470 | list_add_tail(&event->base.link, &event->base.file_priv->event_list); | ||
471 | wake_up_interruptible(&event->base.file_priv->event_wait); | ||
472 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
473 | |||
474 | drm_vblank_put(dev, 0); | ||
475 | } | 464 | } |
476 | 465 | ||
477 | static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, | 466 | static int shmob_drm_crtc_page_flip(struct drm_crtc *crtc, |
diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig index e461e9972455..7a4d10106906 100644 --- a/drivers/gpu/drm/tilcdc/Kconfig +++ b/drivers/gpu/drm/tilcdc/Kconfig | |||
@@ -6,6 +6,7 @@ config DRM_TILCDC | |||
6 | select DRM_GEM_CMA_HELPER | 6 | select DRM_GEM_CMA_HELPER |
7 | select VIDEOMODE_HELPERS | 7 | select VIDEOMODE_HELPERS |
8 | select BACKLIGHT_CLASS_DEVICE | 8 | select BACKLIGHT_CLASS_DEVICE |
9 | select BACKLIGHT_LCD_SUPPORT | ||
9 | help | 10 | help |
10 | Choose this option if you have an TI SoC with LCDC display | 11 | Choose this option if you have an TI SoC with LCDC display |
11 | controller, for example AM33xx in beagle-bone, DA8xx, or | 12 | controller, for example AM33xx in beagle-bone, DA8xx, or |
diff --git a/drivers/iio/buffer_cb.c b/drivers/iio/buffer_cb.c index 9201022945e9..9d19ba74f22b 100644 --- a/drivers/iio/buffer_cb.c +++ b/drivers/iio/buffer_cb.c | |||
@@ -64,7 +64,7 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, | |||
64 | while (chan->indio_dev) { | 64 | while (chan->indio_dev) { |
65 | if (chan->indio_dev != indio_dev) { | 65 | if (chan->indio_dev != indio_dev) { |
66 | ret = -EINVAL; | 66 | ret = -EINVAL; |
67 | goto error_release_channels; | 67 | goto error_free_scan_mask; |
68 | } | 68 | } |
69 | set_bit(chan->channel->scan_index, | 69 | set_bit(chan->channel->scan_index, |
70 | cb_buff->buffer.scan_mask); | 70 | cb_buff->buffer.scan_mask); |
@@ -73,6 +73,8 @@ struct iio_cb_buffer *iio_channel_get_all_cb(struct device *dev, | |||
73 | 73 | ||
74 | return cb_buff; | 74 | return cb_buff; |
75 | 75 | ||
76 | error_free_scan_mask: | ||
77 | kfree(cb_buff->buffer.scan_mask); | ||
76 | error_release_channels: | 78 | error_release_channels: |
77 | iio_channel_release_all(cb_buff->channels); | 79 | iio_channel_release_all(cb_buff->channels); |
78 | error_free_cb_buff: | 80 | error_free_cb_buff: |
@@ -100,6 +102,7 @@ EXPORT_SYMBOL_GPL(iio_channel_stop_all_cb); | |||
100 | 102 | ||
101 | void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) | 103 | void iio_channel_release_all_cb(struct iio_cb_buffer *cb_buff) |
102 | { | 104 | { |
105 | kfree(cb_buff->buffer.scan_mask); | ||
103 | iio_channel_release_all(cb_buff->channels); | 106 | iio_channel_release_all(cb_buff->channels); |
104 | kfree(cb_buff); | 107 | kfree(cb_buff); |
105 | } | 108 | } |
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c index a884252ac66b..e76d4ace53ff 100644 --- a/drivers/iio/frequency/adf4350.c +++ b/drivers/iio/frequency/adf4350.c | |||
@@ -212,7 +212,7 @@ static int adf4350_set_freq(struct adf4350_state *st, unsigned long long freq) | |||
212 | (pdata->r2_user_settings & (ADF4350_REG2_PD_POLARITY_POS | | 212 | (pdata->r2_user_settings & (ADF4350_REG2_PD_POLARITY_POS | |
213 | ADF4350_REG2_LDP_6ns | ADF4350_REG2_LDF_INT_N | | 213 | ADF4350_REG2_LDP_6ns | ADF4350_REG2_LDF_INT_N | |
214 | ADF4350_REG2_CHARGE_PUMP_CURR_uA(5000) | | 214 | ADF4350_REG2_CHARGE_PUMP_CURR_uA(5000) | |
215 | ADF4350_REG2_MUXOUT(0x7) | ADF4350_REG2_NOISE_MODE(0x9))); | 215 | ADF4350_REG2_MUXOUT(0x7) | ADF4350_REG2_NOISE_MODE(0x3))); |
216 | 216 | ||
217 | st->regs[ADF4350_REG3] = pdata->r3_user_settings & | 217 | st->regs[ADF4350_REG3] = pdata->r3_user_settings & |
218 | (ADF4350_REG3_12BIT_CLKDIV(0xFFF) | | 218 | (ADF4350_REG3_12BIT_CLKDIV(0xFFF) | |
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index 795d100b4c36..98ddc323add0 100644 --- a/drivers/iio/inkern.c +++ b/drivers/iio/inkern.c | |||
@@ -124,7 +124,7 @@ static int __of_iio_channel_get(struct iio_channel *channel, | |||
124 | channel->indio_dev = indio_dev; | 124 | channel->indio_dev = indio_dev; |
125 | index = iiospec.args_count ? iiospec.args[0] : 0; | 125 | index = iiospec.args_count ? iiospec.args[0] : 0; |
126 | if (index >= indio_dev->num_channels) { | 126 | if (index >= indio_dev->num_channels) { |
127 | return -EINVAL; | 127 | err = -EINVAL; |
128 | goto err_put; | 128 | goto err_put; |
129 | } | 129 | } |
130 | channel->channel = &indio_dev->channels[index]; | 130 | channel->channel = &indio_dev->channels[index]; |
@@ -450,7 +450,7 @@ static int iio_convert_raw_to_processed_unlocked(struct iio_channel *chan, | |||
450 | s64 raw64 = raw; | 450 | s64 raw64 = raw; |
451 | int ret; | 451 | int ret; |
452 | 452 | ||
453 | ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_SCALE); | 453 | ret = iio_channel_read(chan, &offset, NULL, IIO_CHAN_INFO_OFFSET); |
454 | if (ret == 0) | 454 | if (ret == 0) |
455 | raw64 += offset; | 455 | raw64 += offset; |
456 | 456 | ||
diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index 81c7b73695d2..3b9afccaaade 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c | |||
@@ -61,7 +61,7 @@ int qib_alloc_lkey(struct qib_mregion *mr, int dma_region) | |||
61 | if (dma_region) { | 61 | if (dma_region) { |
62 | struct qib_mregion *tmr; | 62 | struct qib_mregion *tmr; |
63 | 63 | ||
64 | tmr = rcu_dereference(dev->dma_mr); | 64 | tmr = rcu_access_pointer(dev->dma_mr); |
65 | if (!tmr) { | 65 | if (!tmr) { |
66 | qib_get_mr(mr); | 66 | qib_get_mr(mr); |
67 | rcu_assign_pointer(dev->dma_mr, mr); | 67 | rcu_assign_pointer(dev->dma_mr, mr); |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index f19b0998a53c..2e84ef859c5b 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -5,6 +5,7 @@ | |||
5 | * Copyright (C) 2004 Alex Aizman | 5 | * Copyright (C) 2004 Alex Aizman |
6 | * Copyright (C) 2005 Mike Christie | 6 | * Copyright (C) 2005 Mike Christie |
7 | * Copyright (c) 2005, 2006 Voltaire, Inc. All rights reserved. | 7 | * Copyright (c) 2005, 2006 Voltaire, Inc. All rights reserved. |
8 | * Copyright (c) 2013 Mellanox Technologies. All rights reserved. | ||
8 | * maintained by openib-general@openib.org | 9 | * maintained by openib-general@openib.org |
9 | * | 10 | * |
10 | * This software is available to you under a choice of one of two | 11 | * This software is available to you under a choice of one of two |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 06f578cde75b..4f069c0d4c04 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
@@ -8,6 +8,7 @@ | |||
8 | * | 8 | * |
9 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. | 9 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. |
10 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. | 10 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
11 | * Copyright (c) 2013 Mellanox Technologies. All rights reserved. | ||
11 | * | 12 | * |
12 | * This software is available to you under a choice of one of two | 13 | * This software is available to you under a choice of one of two |
13 | * licenses. You may choose to be licensed under the terms of the GNU | 14 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c b/drivers/infiniband/ulp/iser/iser_initiator.c index a00ccd1ca333..b6d81a86c976 100644 --- a/drivers/infiniband/ulp/iser/iser_initiator.c +++ b/drivers/infiniband/ulp/iser/iser_initiator.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. | 2 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. |
3 | * Copyright (c) 2013 Mellanox Technologies. All rights reserved. | ||
3 | * | 4 | * |
4 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 6 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c index 68ebb7fe072a..7827baf455a1 100644 --- a/drivers/infiniband/ulp/iser/iser_memory.c +++ b/drivers/infiniband/ulp/iser/iser_memory.c | |||
@@ -1,5 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. | 2 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. |
3 | * Copyright (c) 2013 Mellanox Technologies. All rights reserved. | ||
3 | * | 4 | * |
4 | * This software is available to you under a choice of one of two | 5 | * This software is available to you under a choice of one of two |
5 | * licenses. You may choose to be licensed under the terms of the GNU | 6 | * licenses. You may choose to be licensed under the terms of the GNU |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 5278916c3103..2c4941d0656b 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. | 2 | * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved. |
3 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. | 3 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
4 | * Copyright (c) 2013 Mellanox Technologies. All rights reserved. | ||
4 | * | 5 | * |
5 | * This software is available to you under a choice of one of two | 6 | * This software is available to you under a choice of one of two |
6 | * licenses. You may choose to be licensed under the terms of the GNU | 7 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -292,10 +293,10 @@ out_err: | |||
292 | } | 293 | } |
293 | 294 | ||
294 | /** | 295 | /** |
295 | * releases the FMR pool, QP and CMA ID objects, returns 0 on success, | 296 | * releases the FMR pool and QP objects, returns 0 on success, |
296 | * -1 on failure | 297 | * -1 on failure |
297 | */ | 298 | */ |
298 | static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id) | 299 | static int iser_free_ib_conn_res(struct iser_conn *ib_conn) |
299 | { | 300 | { |
300 | int cq_index; | 301 | int cq_index; |
301 | BUG_ON(ib_conn == NULL); | 302 | BUG_ON(ib_conn == NULL); |
@@ -314,13 +315,9 @@ static int iser_free_ib_conn_res(struct iser_conn *ib_conn, int can_destroy_id) | |||
314 | 315 | ||
315 | rdma_destroy_qp(ib_conn->cma_id); | 316 | rdma_destroy_qp(ib_conn->cma_id); |
316 | } | 317 | } |
317 | /* if cma handler context, the caller acts s.t the cma destroy the id */ | ||
318 | if (ib_conn->cma_id != NULL && can_destroy_id) | ||
319 | rdma_destroy_id(ib_conn->cma_id); | ||
320 | 318 | ||
321 | ib_conn->fmr_pool = NULL; | 319 | ib_conn->fmr_pool = NULL; |
322 | ib_conn->qp = NULL; | 320 | ib_conn->qp = NULL; |
323 | ib_conn->cma_id = NULL; | ||
324 | kfree(ib_conn->page_vec); | 321 | kfree(ib_conn->page_vec); |
325 | 322 | ||
326 | if (ib_conn->login_buf) { | 323 | if (ib_conn->login_buf) { |
@@ -415,11 +412,16 @@ static void iser_conn_release(struct iser_conn *ib_conn, int can_destroy_id) | |||
415 | list_del(&ib_conn->conn_list); | 412 | list_del(&ib_conn->conn_list); |
416 | mutex_unlock(&ig.connlist_mutex); | 413 | mutex_unlock(&ig.connlist_mutex); |
417 | iser_free_rx_descriptors(ib_conn); | 414 | iser_free_rx_descriptors(ib_conn); |
418 | iser_free_ib_conn_res(ib_conn, can_destroy_id); | 415 | iser_free_ib_conn_res(ib_conn); |
419 | ib_conn->device = NULL; | 416 | ib_conn->device = NULL; |
420 | /* on EVENT_ADDR_ERROR there's no device yet for this conn */ | 417 | /* on EVENT_ADDR_ERROR there's no device yet for this conn */ |
421 | if (device != NULL) | 418 | if (device != NULL) |
422 | iser_device_try_release(device); | 419 | iser_device_try_release(device); |
420 | /* if cma handler context, the caller actually destroy the id */ | ||
421 | if (ib_conn->cma_id != NULL && can_destroy_id) { | ||
422 | rdma_destroy_id(ib_conn->cma_id); | ||
423 | ib_conn->cma_id = NULL; | ||
424 | } | ||
423 | iscsi_destroy_endpoint(ib_conn->ep); | 425 | iscsi_destroy_endpoint(ib_conn->ep); |
424 | } | 426 | } |
425 | 427 | ||
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c index b08ca7a9f76b..3f3f0416fbdd 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.c +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c | |||
@@ -2227,6 +2227,27 @@ static void srpt_close_ch(struct srpt_rdma_ch *ch) | |||
2227 | } | 2227 | } |
2228 | 2228 | ||
2229 | /** | 2229 | /** |
2230 | * srpt_shutdown_session() - Whether or not a session may be shut down. | ||
2231 | */ | ||
2232 | static int srpt_shutdown_session(struct se_session *se_sess) | ||
2233 | { | ||
2234 | struct srpt_rdma_ch *ch = se_sess->fabric_sess_ptr; | ||
2235 | unsigned long flags; | ||
2236 | |||
2237 | spin_lock_irqsave(&ch->spinlock, flags); | ||
2238 | if (ch->in_shutdown) { | ||
2239 | spin_unlock_irqrestore(&ch->spinlock, flags); | ||
2240 | return true; | ||
2241 | } | ||
2242 | |||
2243 | ch->in_shutdown = true; | ||
2244 | target_sess_cmd_list_set_waiting(se_sess); | ||
2245 | spin_unlock_irqrestore(&ch->spinlock, flags); | ||
2246 | |||
2247 | return true; | ||
2248 | } | ||
2249 | |||
2250 | /** | ||
2230 | * srpt_drain_channel() - Drain a channel by resetting the IB queue pair. | 2251 | * srpt_drain_channel() - Drain a channel by resetting the IB queue pair. |
2231 | * @cm_id: Pointer to the CM ID of the channel to be drained. | 2252 | * @cm_id: Pointer to the CM ID of the channel to be drained. |
2232 | * | 2253 | * |
@@ -2264,6 +2285,9 @@ static void srpt_drain_channel(struct ib_cm_id *cm_id) | |||
2264 | spin_unlock_irq(&sdev->spinlock); | 2285 | spin_unlock_irq(&sdev->spinlock); |
2265 | 2286 | ||
2266 | if (do_reset) { | 2287 | if (do_reset) { |
2288 | if (ch->sess) | ||
2289 | srpt_shutdown_session(ch->sess); | ||
2290 | |||
2267 | ret = srpt_ch_qp_err(ch); | 2291 | ret = srpt_ch_qp_err(ch); |
2268 | if (ret < 0) | 2292 | if (ret < 0) |
2269 | printk(KERN_ERR "Setting queue pair in error state" | 2293 | printk(KERN_ERR "Setting queue pair in error state" |
@@ -2328,7 +2352,7 @@ static void srpt_release_channel_work(struct work_struct *w) | |||
2328 | se_sess = ch->sess; | 2352 | se_sess = ch->sess; |
2329 | BUG_ON(!se_sess); | 2353 | BUG_ON(!se_sess); |
2330 | 2354 | ||
2331 | target_wait_for_sess_cmds(se_sess, 0); | 2355 | target_wait_for_sess_cmds(se_sess); |
2332 | 2356 | ||
2333 | transport_deregister_session_configfs(se_sess); | 2357 | transport_deregister_session_configfs(se_sess); |
2334 | transport_deregister_session(se_sess); | 2358 | transport_deregister_session(se_sess); |
@@ -3467,14 +3491,6 @@ static void srpt_release_cmd(struct se_cmd *se_cmd) | |||
3467 | } | 3491 | } |
3468 | 3492 | ||
3469 | /** | 3493 | /** |
3470 | * srpt_shutdown_session() - Whether or not a session may be shut down. | ||
3471 | */ | ||
3472 | static int srpt_shutdown_session(struct se_session *se_sess) | ||
3473 | { | ||
3474 | return true; | ||
3475 | } | ||
3476 | |||
3477 | /** | ||
3478 | * srpt_close_session() - Forcibly close a session. | 3494 | * srpt_close_session() - Forcibly close a session. |
3479 | * | 3495 | * |
3480 | * Callback function invoked by the TCM core to clean up sessions associated | 3496 | * Callback function invoked by the TCM core to clean up sessions associated |
diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.h b/drivers/infiniband/ulp/srpt/ib_srpt.h index 4caf55cda7b1..3dae156905de 100644 --- a/drivers/infiniband/ulp/srpt/ib_srpt.h +++ b/drivers/infiniband/ulp/srpt/ib_srpt.h | |||
@@ -325,6 +325,7 @@ struct srpt_rdma_ch { | |||
325 | u8 sess_name[36]; | 325 | u8 sess_name[36]; |
326 | struct work_struct release_work; | 326 | struct work_struct release_work; |
327 | struct completion *release_done; | 327 | struct completion *release_done; |
328 | bool in_shutdown; | ||
328 | }; | 329 | }; |
329 | 330 | ||
330 | /** | 331 | /** |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 2f78538e09d0..b2420ae19e14 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -1379,6 +1379,7 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
1379 | { | 1379 | { |
1380 | struct synaptics_data *priv = psmouse->private; | 1380 | struct synaptics_data *priv = psmouse->private; |
1381 | struct synaptics_data old_priv = *priv; | 1381 | struct synaptics_data old_priv = *priv; |
1382 | unsigned char param[2]; | ||
1382 | int retry = 0; | 1383 | int retry = 0; |
1383 | int error; | 1384 | int error; |
1384 | 1385 | ||
@@ -1394,6 +1395,7 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
1394 | */ | 1395 | */ |
1395 | ssleep(1); | 1396 | ssleep(1); |
1396 | } | 1397 | } |
1398 | ps2_command(&psmouse->ps2dev, param, PSMOUSE_CMD_GETID); | ||
1397 | error = synaptics_detect(psmouse, 0); | 1399 | error = synaptics_detect(psmouse, 0); |
1398 | } while (error && ++retry < 3); | 1400 | } while (error && ++retry < 3); |
1399 | 1401 | ||
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 5c68e4486845..518282da6d85 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
@@ -1966,7 +1966,8 @@ static const struct wacom_features wacom_features_0xF4 = | |||
1966 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 1966 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
1967 | static const struct wacom_features wacom_features_0xF8 = | 1967 | static const struct wacom_features wacom_features_0xF8 = |
1968 | { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */ | 1968 | { "Wacom Cintiq 24HD touch", WACOM_PKGLEN_INTUOS, 104480, 65600, 2047, /* Pen */ |
1969 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; | 1969 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
1970 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf6 }; | ||
1970 | static const struct wacom_features wacom_features_0xF6 = | 1971 | static const struct wacom_features wacom_features_0xF6 = |
1971 | { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ | 1972 | { "Wacom Cintiq 24HD touch", .type = WACOM_24HDT, /* Touch */ |
1972 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; | 1973 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0xf8, .touch_max = 10 }; |
@@ -2009,7 +2010,8 @@ static const struct wacom_features wacom_features_0xFA = | |||
2009 | 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; | 2010 | 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES }; |
2010 | static const struct wacom_features wacom_features_0x5B = | 2011 | static const struct wacom_features wacom_features_0x5B = |
2011 | { "Wacom Cintiq 22HDT", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, | 2012 | { "Wacom Cintiq 22HDT", WACOM_PKGLEN_INTUOS, 95840, 54260, 2047, |
2012 | 63, WACOM_24HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e }; | 2013 | 63, WACOM_22HD, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, |
2014 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5e }; | ||
2013 | static const struct wacom_features wacom_features_0x5E = | 2015 | static const struct wacom_features wacom_features_0x5E = |
2014 | { "Wacom Cintiq 22HDT", .type = WACOM_24HDT, | 2016 | { "Wacom Cintiq 22HDT", .type = WACOM_24HDT, |
2015 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10 }; | 2017 | .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x5b, .touch_max = 10 }; |
@@ -2042,7 +2044,7 @@ static const struct wacom_features wacom_features_0xE5 = | |||
2042 | static const struct wacom_features wacom_features_0xE6 = | 2044 | static const struct wacom_features wacom_features_0xE6 = |
2043 | { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, | 2045 | { "Wacom ISDv4 E6", WACOM_PKGLEN_TPC2FG, 27760, 15694, 255, |
2044 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, | 2046 | 0, TABLETPC2FG, WACOM_INTUOS_RES, WACOM_INTUOS_RES, |
2045 | .touch_max = 2 }; | 2047 | .touch_max = 2 }; |
2046 | static const struct wacom_features wacom_features_0xEC = | 2048 | static const struct wacom_features wacom_features_0xEC = |
2047 | { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, | 2049 | { "Wacom ISDv4 EC", WACOM_PKGLEN_GRAPHIRE, 25710, 14500, 255, |
2048 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 2050 | 0, TABLETPC, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c index 29889bbdcc6d..63b3d4eb0ef7 100644 --- a/drivers/irqchip/irq-mxs.c +++ b/drivers/irqchip/irq-mxs.c | |||
@@ -76,16 +76,10 @@ asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs) | |||
76 | { | 76 | { |
77 | u32 irqnr; | 77 | u32 irqnr; |
78 | 78 | ||
79 | do { | 79 | irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET); |
80 | irqnr = __raw_readl(icoll_base + HW_ICOLL_STAT_OFFSET); | 80 | __raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR); |
81 | if (irqnr != 0x7f) { | 81 | irqnr = irq_find_mapping(icoll_domain, irqnr); |
82 | __raw_writel(irqnr, icoll_base + HW_ICOLL_VECTOR); | 82 | handle_IRQ(irqnr, regs); |
83 | irqnr = irq_find_mapping(icoll_domain, irqnr); | ||
84 | handle_IRQ(irqnr, regs); | ||
85 | continue; | ||
86 | } | ||
87 | break; | ||
88 | } while (1); | ||
89 | } | 83 | } |
90 | 84 | ||
91 | static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq, | 85 | static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq, |
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 065b7a31a478..47a52ab580d8 100644 --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c | |||
@@ -119,7 +119,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
119 | 119 | ||
120 | /* Skip invalid IRQs, only register handlers for the real ones */ | 120 | /* Skip invalid IRQs, only register handlers for the real ones */ |
121 | if (!(f->valid & BIT(hwirq))) | 121 | if (!(f->valid & BIT(hwirq))) |
122 | return -ENOTSUPP; | 122 | return -EPERM; |
123 | irq_set_chip_data(irq, f); | 123 | irq_set_chip_data(irq, f); |
124 | irq_set_chip_and_handler(irq, &f->chip, | 124 | irq_set_chip_and_handler(irq, &f->chip, |
125 | handle_level_irq); | 125 | handle_level_irq); |
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 884d11c7355f..2bbb00404cf5 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c | |||
@@ -197,7 +197,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
197 | 197 | ||
198 | /* Skip invalid IRQs, only register handlers for the real ones */ | 198 | /* Skip invalid IRQs, only register handlers for the real ones */ |
199 | if (!(v->valid_sources & (1 << hwirq))) | 199 | if (!(v->valid_sources & (1 << hwirq))) |
200 | return -ENOTSUPP; | 200 | return -EPERM; |
201 | irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); | 201 | irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); |
202 | irq_set_chip_data(irq, v->base); | 202 | irq_set_chip_data(irq, v->base); |
203 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 203 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); |
diff --git a/drivers/media/pci/zoran/zoran.h b/drivers/media/pci/zoran/zoran.h index ca2754a3cd63..5e040085c2ff 100644 --- a/drivers/media/pci/zoran/zoran.h +++ b/drivers/media/pci/zoran/zoran.h | |||
@@ -176,7 +176,7 @@ struct zoran_fh; | |||
176 | 176 | ||
177 | struct zoran_mapping { | 177 | struct zoran_mapping { |
178 | struct zoran_fh *fh; | 178 | struct zoran_fh *fh; |
179 | int count; | 179 | atomic_t count; |
180 | }; | 180 | }; |
181 | 181 | ||
182 | struct zoran_buffer { | 182 | struct zoran_buffer { |
diff --git a/drivers/media/pci/zoran/zoran_driver.c b/drivers/media/pci/zoran/zoran_driver.c index 1168a84a737d..d133c30c3fdc 100644 --- a/drivers/media/pci/zoran/zoran_driver.c +++ b/drivers/media/pci/zoran/zoran_driver.c | |||
@@ -2803,8 +2803,7 @@ static void | |||
2803 | zoran_vm_open (struct vm_area_struct *vma) | 2803 | zoran_vm_open (struct vm_area_struct *vma) |
2804 | { | 2804 | { |
2805 | struct zoran_mapping *map = vma->vm_private_data; | 2805 | struct zoran_mapping *map = vma->vm_private_data; |
2806 | 2806 | atomic_inc(&map->count); | |
2807 | map->count++; | ||
2808 | } | 2807 | } |
2809 | 2808 | ||
2810 | static void | 2809 | static void |
@@ -2815,7 +2814,7 @@ zoran_vm_close (struct vm_area_struct *vma) | |||
2815 | struct zoran *zr = fh->zr; | 2814 | struct zoran *zr = fh->zr; |
2816 | int i; | 2815 | int i; |
2817 | 2816 | ||
2818 | if (--map->count > 0) | 2817 | if (!atomic_dec_and_mutex_lock(&map->count, &zr->resource_lock)) |
2819 | return; | 2818 | return; |
2820 | 2819 | ||
2821 | dprintk(3, KERN_INFO "%s: %s - munmap(%s)\n", ZR_DEVNAME(zr), | 2820 | dprintk(3, KERN_INFO "%s: %s - munmap(%s)\n", ZR_DEVNAME(zr), |
@@ -2828,14 +2827,16 @@ zoran_vm_close (struct vm_area_struct *vma) | |||
2828 | kfree(map); | 2827 | kfree(map); |
2829 | 2828 | ||
2830 | /* Any buffers still mapped? */ | 2829 | /* Any buffers still mapped? */ |
2831 | for (i = 0; i < fh->buffers.num_buffers; i++) | 2830 | for (i = 0; i < fh->buffers.num_buffers; i++) { |
2832 | if (fh->buffers.buffer[i].map) | 2831 | if (fh->buffers.buffer[i].map) { |
2832 | mutex_unlock(&zr->resource_lock); | ||
2833 | return; | 2833 | return; |
2834 | } | ||
2835 | } | ||
2834 | 2836 | ||
2835 | dprintk(3, KERN_INFO "%s: %s - free %s buffers\n", ZR_DEVNAME(zr), | 2837 | dprintk(3, KERN_INFO "%s: %s - free %s buffers\n", ZR_DEVNAME(zr), |
2836 | __func__, mode_name(fh->map_mode)); | 2838 | __func__, mode_name(fh->map_mode)); |
2837 | 2839 | ||
2838 | mutex_lock(&zr->resource_lock); | ||
2839 | 2840 | ||
2840 | if (fh->map_mode == ZORAN_MAP_MODE_RAW) { | 2841 | if (fh->map_mode == ZORAN_MAP_MODE_RAW) { |
2841 | if (fh->buffers.active != ZORAN_FREE) { | 2842 | if (fh->buffers.active != ZORAN_FREE) { |
@@ -2939,7 +2940,7 @@ zoran_mmap (struct file *file, | |||
2939 | goto mmap_unlock_and_return; | 2940 | goto mmap_unlock_and_return; |
2940 | } | 2941 | } |
2941 | map->fh = fh; | 2942 | map->fh = fh; |
2942 | map->count = 1; | 2943 | atomic_set(&map->count, 1); |
2943 | 2944 | ||
2944 | vma->vm_ops = &zoran_vm_ops; | 2945 | vma->vm_ops = &zoran_vm_ops; |
2945 | vma->vm_flags |= VM_DONTEXPAND; | 2946 | vma->vm_flags |= VM_DONTEXPAND; |
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 477268a2415f..d338b19da544 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c | |||
@@ -2150,6 +2150,9 @@ static int __init omap_vout_probe(struct platform_device *pdev) | |||
2150 | struct omap_dss_device *def_display; | 2150 | struct omap_dss_device *def_display; |
2151 | struct omap2video_device *vid_dev = NULL; | 2151 | struct omap2video_device *vid_dev = NULL; |
2152 | 2152 | ||
2153 | if (omapdss_is_initialized() == false) | ||
2154 | return -EPROBE_DEFER; | ||
2155 | |||
2153 | ret = omapdss_compat_init(); | 2156 | ret = omapdss_compat_init(); |
2154 | if (ret) { | 2157 | if (ret) { |
2155 | dev_err(&pdev->dev, "failed to init dss\n"); | 2158 | dev_err(&pdev->dev, "failed to init dss\n"); |
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index e75774f72606..aca59d93d5a9 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c | |||
@@ -2230,10 +2230,15 @@ static void __exit atmci_cleanup_slot(struct atmel_mci_slot *slot, | |||
2230 | mmc_free_host(slot->mmc); | 2230 | mmc_free_host(slot->mmc); |
2231 | } | 2231 | } |
2232 | 2232 | ||
2233 | static bool atmci_filter(struct dma_chan *chan, void *slave) | 2233 | static bool atmci_filter(struct dma_chan *chan, void *pdata) |
2234 | { | 2234 | { |
2235 | struct mci_dma_data *sl = slave; | 2235 | struct mci_platform_data *sl_pdata = pdata; |
2236 | struct mci_dma_data *sl; | ||
2236 | 2237 | ||
2238 | if (!sl_pdata) | ||
2239 | return false; | ||
2240 | |||
2241 | sl = sl_pdata->dma_slave; | ||
2237 | if (sl && find_slave_dev(sl) == chan->device->dev) { | 2242 | if (sl && find_slave_dev(sl) == chan->device->dev) { |
2238 | chan->private = slave_data_ptr(sl); | 2243 | chan->private = slave_data_ptr(sl); |
2239 | return true; | 2244 | return true; |
@@ -2245,24 +2250,18 @@ static bool atmci_filter(struct dma_chan *chan, void *slave) | |||
2245 | static bool atmci_configure_dma(struct atmel_mci *host) | 2250 | static bool atmci_configure_dma(struct atmel_mci *host) |
2246 | { | 2251 | { |
2247 | struct mci_platform_data *pdata; | 2252 | struct mci_platform_data *pdata; |
2253 | dma_cap_mask_t mask; | ||
2248 | 2254 | ||
2249 | if (host == NULL) | 2255 | if (host == NULL) |
2250 | return false; | 2256 | return false; |
2251 | 2257 | ||
2252 | pdata = host->pdev->dev.platform_data; | 2258 | pdata = host->pdev->dev.platform_data; |
2253 | 2259 | ||
2254 | if (!pdata) | 2260 | dma_cap_zero(mask); |
2255 | return false; | 2261 | dma_cap_set(DMA_SLAVE, mask); |
2256 | 2262 | ||
2257 | if (pdata->dma_slave && find_slave_dev(pdata->dma_slave)) { | 2263 | host->dma.chan = dma_request_slave_channel_compat(mask, atmci_filter, pdata, |
2258 | dma_cap_mask_t mask; | 2264 | &host->pdev->dev, "rxtx"); |
2259 | |||
2260 | /* Try to grab a DMA channel */ | ||
2261 | dma_cap_zero(mask); | ||
2262 | dma_cap_set(DMA_SLAVE, mask); | ||
2263 | host->dma.chan = | ||
2264 | dma_request_channel(mask, atmci_filter, pdata->dma_slave); | ||
2265 | } | ||
2266 | if (!host->dma.chan) { | 2265 | if (!host->dma.chan) { |
2267 | dev_warn(&host->pdev->dev, "no DMA channel available\n"); | 2266 | dev_warn(&host->pdev->dev, "no DMA channel available\n"); |
2268 | return false; | 2267 | return false; |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 6e44025acf01..eccedc7d06a4 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -161,6 +161,7 @@ struct omap_hsmmc_host { | |||
161 | */ | 161 | */ |
162 | struct regulator *vcc; | 162 | struct regulator *vcc; |
163 | struct regulator *vcc_aux; | 163 | struct regulator *vcc_aux; |
164 | int pbias_disable; | ||
164 | void __iomem *base; | 165 | void __iomem *base; |
165 | resource_size_t mapbase; | 166 | resource_size_t mapbase; |
166 | spinlock_t irq_lock; /* Prevent races with irq handler */ | 167 | spinlock_t irq_lock; /* Prevent races with irq handler */ |
@@ -255,11 +256,11 @@ static int omap_hsmmc_set_power(struct device *dev, int slot, int power_on, | |||
255 | if (!host->vcc) | 256 | if (!host->vcc) |
256 | return 0; | 257 | return 0; |
257 | /* | 258 | /* |
258 | * With DT, never turn OFF the regulator. This is because | 259 | * With DT, never turn OFF the regulator for MMC1. This is because |
259 | * the pbias cell programming support is still missing when | 260 | * the pbias cell programming support is still missing when |
260 | * booting with Device tree | 261 | * booting with Device tree |
261 | */ | 262 | */ |
262 | if (dev->of_node && !vdd) | 263 | if (host->pbias_disable && !vdd) |
263 | return 0; | 264 | return 0; |
264 | 265 | ||
265 | if (mmc_slot(host).before_set_reg) | 266 | if (mmc_slot(host).before_set_reg) |
@@ -1520,10 +1521,10 @@ static void omap_hsmmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1520 | (ios->vdd == DUAL_VOLT_OCR_BIT) && | 1521 | (ios->vdd == DUAL_VOLT_OCR_BIT) && |
1521 | /* | 1522 | /* |
1522 | * With pbias cell programming missing, this | 1523 | * With pbias cell programming missing, this |
1523 | * can't be allowed when booting with device | 1524 | * can't be allowed on MMC1 when booting with device |
1524 | * tree. | 1525 | * tree. |
1525 | */ | 1526 | */ |
1526 | !host->dev->of_node) { | 1527 | !host->pbias_disable) { |
1527 | /* | 1528 | /* |
1528 | * The mmc_select_voltage fn of the core does | 1529 | * The mmc_select_voltage fn of the core does |
1529 | * not seem to set the power_mode to | 1530 | * not seem to set the power_mode to |
@@ -1871,6 +1872,10 @@ static int omap_hsmmc_probe(struct platform_device *pdev) | |||
1871 | 1872 | ||
1872 | omap_hsmmc_context_save(host); | 1873 | omap_hsmmc_context_save(host); |
1873 | 1874 | ||
1875 | /* This can be removed once we support PBIAS with DT */ | ||
1876 | if (host->dev->of_node && host->mapbase == 0x4809c000) | ||
1877 | host->pbias_disable = 1; | ||
1878 | |||
1874 | host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck"); | 1879 | host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck"); |
1875 | /* | 1880 | /* |
1876 | * MMC can still work without debounce clock. | 1881 | * MMC can still work without debounce clock. |
@@ -1906,33 +1911,41 @@ static int omap_hsmmc_probe(struct platform_device *pdev) | |||
1906 | 1911 | ||
1907 | omap_hsmmc_conf_bus_power(host); | 1912 | omap_hsmmc_conf_bus_power(host); |
1908 | 1913 | ||
1909 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); | 1914 | if (!pdev->dev.of_node) { |
1910 | if (!res) { | 1915 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "tx"); |
1911 | dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); | 1916 | if (!res) { |
1912 | ret = -ENXIO; | 1917 | dev_err(mmc_dev(host->mmc), "cannot get DMA TX channel\n"); |
1913 | goto err_irq; | 1918 | ret = -ENXIO; |
1914 | } | 1919 | goto err_irq; |
1915 | tx_req = res->start; | 1920 | } |
1921 | tx_req = res->start; | ||
1916 | 1922 | ||
1917 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); | 1923 | res = platform_get_resource_byname(pdev, IORESOURCE_DMA, "rx"); |
1918 | if (!res) { | 1924 | if (!res) { |
1919 | dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); | 1925 | dev_err(mmc_dev(host->mmc), "cannot get DMA RX channel\n"); |
1920 | ret = -ENXIO; | 1926 | ret = -ENXIO; |
1921 | goto err_irq; | 1927 | goto err_irq; |
1928 | } | ||
1929 | rx_req = res->start; | ||
1922 | } | 1930 | } |
1923 | rx_req = res->start; | ||
1924 | 1931 | ||
1925 | dma_cap_zero(mask); | 1932 | dma_cap_zero(mask); |
1926 | dma_cap_set(DMA_SLAVE, mask); | 1933 | dma_cap_set(DMA_SLAVE, mask); |
1927 | 1934 | ||
1928 | host->rx_chan = dma_request_channel(mask, omap_dma_filter_fn, &rx_req); | 1935 | host->rx_chan = |
1936 | dma_request_slave_channel_compat(mask, omap_dma_filter_fn, | ||
1937 | &rx_req, &pdev->dev, "rx"); | ||
1938 | |||
1929 | if (!host->rx_chan) { | 1939 | if (!host->rx_chan) { |
1930 | dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); | 1940 | dev_err(mmc_dev(host->mmc), "unable to obtain RX DMA engine channel %u\n", rx_req); |
1931 | ret = -ENXIO; | 1941 | ret = -ENXIO; |
1932 | goto err_irq; | 1942 | goto err_irq; |
1933 | } | 1943 | } |
1934 | 1944 | ||
1935 | host->tx_chan = dma_request_channel(mask, omap_dma_filter_fn, &tx_req); | 1945 | host->tx_chan = |
1946 | dma_request_slave_channel_compat(mask, omap_dma_filter_fn, | ||
1947 | &tx_req, &pdev->dev, "tx"); | ||
1948 | |||
1936 | if (!host->tx_chan) { | 1949 | if (!host->tx_chan) { |
1937 | dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); | 1950 | dev_err(mmc_dev(host->mmc), "unable to obtain TX DMA engine channel %u\n", tx_req); |
1938 | ret = -ENXIO; | 1951 | ret = -ENXIO; |
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c index 7bcf74b1a5cd..706d9cb1a49e 100644 --- a/drivers/mmc/host/sdhci-acpi.c +++ b/drivers/mmc/host/sdhci-acpi.c | |||
@@ -87,6 +87,12 @@ static const struct sdhci_ops sdhci_acpi_ops_dflt = { | |||
87 | .enable_dma = sdhci_acpi_enable_dma, | 87 | .enable_dma = sdhci_acpi_enable_dma, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = { | ||
91 | .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, | ||
92 | .caps2 = MMC_CAP2_HC_ERASE_SZ, | ||
93 | .flags = SDHCI_ACPI_RUNTIME_PM, | ||
94 | }; | ||
95 | |||
90 | static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = { | 96 | static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = { |
91 | .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON, | 97 | .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON, |
92 | .caps = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD, | 98 | .caps = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD, |
@@ -94,23 +100,67 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = { | |||
94 | .pm_caps = MMC_PM_KEEP_POWER, | 100 | .pm_caps = MMC_PM_KEEP_POWER, |
95 | }; | 101 | }; |
96 | 102 | ||
103 | static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sd = { | ||
104 | }; | ||
105 | |||
106 | struct sdhci_acpi_uid_slot { | ||
107 | const char *hid; | ||
108 | const char *uid; | ||
109 | const struct sdhci_acpi_slot *slot; | ||
110 | }; | ||
111 | |||
112 | static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = { | ||
113 | { "80860F14" , "1" , &sdhci_acpi_slot_int_emmc }, | ||
114 | { "80860F14" , "3" , &sdhci_acpi_slot_int_sd }, | ||
115 | { "INT33BB" , "2" , &sdhci_acpi_slot_int_sdio }, | ||
116 | { "INT33C6" , NULL, &sdhci_acpi_slot_int_sdio }, | ||
117 | { "PNP0D40" }, | ||
118 | { }, | ||
119 | }; | ||
120 | |||
97 | static const struct acpi_device_id sdhci_acpi_ids[] = { | 121 | static const struct acpi_device_id sdhci_acpi_ids[] = { |
98 | { "INT33C6", (kernel_ulong_t)&sdhci_acpi_slot_int_sdio }, | 122 | { "80860F14" }, |
99 | { "PNP0D40" }, | 123 | { "INT33BB" }, |
124 | { "INT33C6" }, | ||
125 | { "PNP0D40" }, | ||
100 | { }, | 126 | { }, |
101 | }; | 127 | }; |
102 | MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids); | 128 | MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids); |
103 | 129 | ||
104 | static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(const char *hid) | 130 | static const struct sdhci_acpi_slot *sdhci_acpi_get_slot_by_ids(const char *hid, |
131 | const char *uid) | ||
105 | { | 132 | { |
106 | const struct acpi_device_id *id; | 133 | const struct sdhci_acpi_uid_slot *u; |
107 | 134 | ||
108 | for (id = sdhci_acpi_ids; id->id[0]; id++) | 135 | for (u = sdhci_acpi_uids; u->hid; u++) { |
109 | if (!strcmp(id->id, hid)) | 136 | if (strcmp(u->hid, hid)) |
110 | return (const struct sdhci_acpi_slot *)id->driver_data; | 137 | continue; |
138 | if (!u->uid) | ||
139 | return u->slot; | ||
140 | if (uid && !strcmp(u->uid, uid)) | ||
141 | return u->slot; | ||
142 | } | ||
111 | return NULL; | 143 | return NULL; |
112 | } | 144 | } |
113 | 145 | ||
146 | static const struct sdhci_acpi_slot *sdhci_acpi_get_slot(acpi_handle handle, | ||
147 | const char *hid) | ||
148 | { | ||
149 | const struct sdhci_acpi_slot *slot; | ||
150 | struct acpi_device_info *info; | ||
151 | const char *uid = NULL; | ||
152 | acpi_status status; | ||
153 | |||
154 | status = acpi_get_object_info(handle, &info); | ||
155 | if (!ACPI_FAILURE(status) && (info->valid & ACPI_VALID_UID)) | ||
156 | uid = info->unique_id.string; | ||
157 | |||
158 | slot = sdhci_acpi_get_slot_by_ids(hid, uid); | ||
159 | |||
160 | kfree(info); | ||
161 | return slot; | ||
162 | } | ||
163 | |||
114 | static int sdhci_acpi_probe(struct platform_device *pdev) | 164 | static int sdhci_acpi_probe(struct platform_device *pdev) |
115 | { | 165 | { |
116 | struct device *dev = &pdev->dev; | 166 | struct device *dev = &pdev->dev; |
@@ -148,7 +198,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) | |||
148 | 198 | ||
149 | c = sdhci_priv(host); | 199 | c = sdhci_priv(host); |
150 | c->host = host; | 200 | c->host = host; |
151 | c->slot = sdhci_acpi_get_slot(hid); | 201 | c->slot = sdhci_acpi_get_slot(handle, hid); |
152 | c->pdev = pdev; | 202 | c->pdev = pdev; |
153 | c->use_runtime_pm = sdhci_acpi_flag(c, SDHCI_ACPI_RUNTIME_PM); | 203 | c->use_runtime_pm = sdhci_acpi_flag(c, SDHCI_ACPI_RUNTIME_PM); |
154 | 204 | ||
@@ -202,6 +252,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev) | |||
202 | goto err_free; | 252 | goto err_free; |
203 | 253 | ||
204 | if (c->use_runtime_pm) { | 254 | if (c->use_runtime_pm) { |
255 | pm_runtime_set_active(dev); | ||
205 | pm_suspend_ignore_children(dev, 1); | 256 | pm_suspend_ignore_children(dev, 1); |
206 | pm_runtime_set_autosuspend_delay(dev, 50); | 257 | pm_runtime_set_autosuspend_delay(dev, 50); |
207 | pm_runtime_use_autosuspend(dev); | 258 | pm_runtime_use_autosuspend(dev); |
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 67d6dde2ff19..d5f0d59e1310 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -85,6 +85,12 @@ struct pltfm_imx_data { | |||
85 | struct clk *clk_ipg; | 85 | struct clk *clk_ipg; |
86 | struct clk *clk_ahb; | 86 | struct clk *clk_ahb; |
87 | struct clk *clk_per; | 87 | struct clk *clk_per; |
88 | enum { | ||
89 | NO_CMD_PENDING, /* no multiblock command pending*/ | ||
90 | MULTIBLK_IN_PROCESS, /* exact multiblock cmd in process */ | ||
91 | WAIT_FOR_INT, /* sent CMD12, waiting for response INT */ | ||
92 | } multiblock_status; | ||
93 | |||
88 | }; | 94 | }; |
89 | 95 | ||
90 | static struct platform_device_id imx_esdhc_devtype[] = { | 96 | static struct platform_device_id imx_esdhc_devtype[] = { |
@@ -154,6 +160,8 @@ static inline void esdhc_clrset_le(struct sdhci_host *host, u32 mask, u32 val, i | |||
154 | 160 | ||
155 | static u32 esdhc_readl_le(struct sdhci_host *host, int reg) | 161 | static u32 esdhc_readl_le(struct sdhci_host *host, int reg) |
156 | { | 162 | { |
163 | struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); | ||
164 | struct pltfm_imx_data *imx_data = pltfm_host->priv; | ||
157 | u32 val = readl(host->ioaddr + reg); | 165 | u32 val = readl(host->ioaddr + reg); |
158 | 166 | ||
159 | if (unlikely(reg == SDHCI_CAPABILITIES)) { | 167 | if (unlikely(reg == SDHCI_CAPABILITIES)) { |
@@ -175,6 +183,18 @@ static u32 esdhc_readl_le(struct sdhci_host *host, int reg) | |||
175 | val &= ~ESDHC_INT_VENDOR_SPEC_DMA_ERR; | 183 | val &= ~ESDHC_INT_VENDOR_SPEC_DMA_ERR; |
176 | val |= SDHCI_INT_ADMA_ERROR; | 184 | val |= SDHCI_INT_ADMA_ERROR; |
177 | } | 185 | } |
186 | |||
187 | /* | ||
188 | * mask off the interrupt we get in response to the manually | ||
189 | * sent CMD12 | ||
190 | */ | ||
191 | if ((imx_data->multiblock_status == WAIT_FOR_INT) && | ||
192 | ((val & SDHCI_INT_RESPONSE) == SDHCI_INT_RESPONSE)) { | ||
193 | val &= ~SDHCI_INT_RESPONSE; | ||
194 | writel(SDHCI_INT_RESPONSE, host->ioaddr + | ||
195 | SDHCI_INT_STATUS); | ||
196 | imx_data->multiblock_status = NO_CMD_PENDING; | ||
197 | } | ||
178 | } | 198 | } |
179 | 199 | ||
180 | return val; | 200 | return val; |
@@ -211,6 +231,15 @@ static void esdhc_writel_le(struct sdhci_host *host, u32 val, int reg) | |||
211 | v = readl(host->ioaddr + ESDHC_VENDOR_SPEC); | 231 | v = readl(host->ioaddr + ESDHC_VENDOR_SPEC); |
212 | v &= ~ESDHC_VENDOR_SPEC_SDIO_QUIRK; | 232 | v &= ~ESDHC_VENDOR_SPEC_SDIO_QUIRK; |
213 | writel(v, host->ioaddr + ESDHC_VENDOR_SPEC); | 233 | writel(v, host->ioaddr + ESDHC_VENDOR_SPEC); |
234 | |||
235 | if (imx_data->multiblock_status == MULTIBLK_IN_PROCESS) | ||
236 | { | ||
237 | /* send a manual CMD12 with RESPTYP=none */ | ||
238 | data = MMC_STOP_TRANSMISSION << 24 | | ||
239 | SDHCI_CMD_ABORTCMD << 16; | ||
240 | writel(data, host->ioaddr + SDHCI_TRANSFER_MODE); | ||
241 | imx_data->multiblock_status = WAIT_FOR_INT; | ||
242 | } | ||
214 | } | 243 | } |
215 | 244 | ||
216 | if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) { | 245 | if (unlikely(reg == SDHCI_INT_ENABLE || reg == SDHCI_SIGNAL_ENABLE)) { |
@@ -277,11 +306,13 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) | |||
277 | } | 306 | } |
278 | return; | 307 | return; |
279 | case SDHCI_COMMAND: | 308 | case SDHCI_COMMAND: |
280 | if ((host->cmd->opcode == MMC_STOP_TRANSMISSION || | 309 | if (host->cmd->opcode == MMC_STOP_TRANSMISSION) |
281 | host->cmd->opcode == MMC_SET_BLOCK_COUNT) && | ||
282 | (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) | ||
283 | val |= SDHCI_CMD_ABORTCMD; | 310 | val |= SDHCI_CMD_ABORTCMD; |
284 | 311 | ||
312 | if ((host->cmd->opcode == MMC_SET_BLOCK_COUNT) && | ||
313 | (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) | ||
314 | imx_data->multiblock_status = MULTIBLK_IN_PROCESS; | ||
315 | |||
285 | if (is_imx6q_usdhc(imx_data)) | 316 | if (is_imx6q_usdhc(imx_data)) |
286 | writel(val << 16, | 317 | writel(val << 16, |
287 | host->ioaddr + SDHCI_TRANSFER_MODE); | 318 | host->ioaddr + SDHCI_TRANSFER_MODE); |
@@ -324,8 +355,10 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg) | |||
324 | /* | 355 | /* |
325 | * Do not touch buswidth bits here. This is done in | 356 | * Do not touch buswidth bits here. This is done in |
326 | * esdhc_pltfm_bus_width. | 357 | * esdhc_pltfm_bus_width. |
358 | * Do not touch the D3CD bit either which is used for the | ||
359 | * SDIO interrupt errata workaround. | ||
327 | */ | 360 | */ |
328 | mask = 0xffff & ~ESDHC_CTRL_BUSWIDTH_MASK; | 361 | mask = 0xffff & ~(ESDHC_CTRL_BUSWIDTH_MASK | ESDHC_CTRL_D3CD); |
329 | 362 | ||
330 | esdhc_clrset_le(host, mask, new_val, reg); | 363 | esdhc_clrset_le(host, mask, new_val, reg); |
331 | return; | 364 | return; |
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 0012d3fdc999..701d06d0e1fb 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -33,6 +33,9 @@ | |||
33 | */ | 33 | */ |
34 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809 | 34 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO0 0x8809 |
35 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a | 35 | #define PCI_DEVICE_ID_INTEL_PCH_SDIO1 0x880a |
36 | #define PCI_DEVICE_ID_INTEL_BYT_EMMC 0x0f14 | ||
37 | #define PCI_DEVICE_ID_INTEL_BYT_SDIO 0x0f15 | ||
38 | #define PCI_DEVICE_ID_INTEL_BYT_SD 0x0f16 | ||
36 | 39 | ||
37 | /* | 40 | /* |
38 | * PCI registers | 41 | * PCI registers |
@@ -304,6 +307,33 @@ static const struct sdhci_pci_fixes sdhci_intel_pch_sdio = { | |||
304 | .probe_slot = pch_hc_probe_slot, | 307 | .probe_slot = pch_hc_probe_slot, |
305 | }; | 308 | }; |
306 | 309 | ||
310 | static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot) | ||
311 | { | ||
312 | slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE; | ||
313 | slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ; | ||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot) | ||
318 | { | ||
319 | slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE; | ||
320 | return 0; | ||
321 | } | ||
322 | |||
323 | static const struct sdhci_pci_fixes sdhci_intel_byt_emmc = { | ||
324 | .allow_runtime_pm = true, | ||
325 | .probe_slot = byt_emmc_probe_slot, | ||
326 | }; | ||
327 | |||
328 | static const struct sdhci_pci_fixes sdhci_intel_byt_sdio = { | ||
329 | .quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON, | ||
330 | .allow_runtime_pm = true, | ||
331 | .probe_slot = byt_sdio_probe_slot, | ||
332 | }; | ||
333 | |||
334 | static const struct sdhci_pci_fixes sdhci_intel_byt_sd = { | ||
335 | }; | ||
336 | |||
307 | /* O2Micro extra registers */ | 337 | /* O2Micro extra registers */ |
308 | #define O2_SD_LOCK_WP 0xD3 | 338 | #define O2_SD_LOCK_WP 0xD3 |
309 | #define O2_SD_MULTI_VCC3V 0xEE | 339 | #define O2_SD_MULTI_VCC3V 0xEE |
@@ -856,6 +886,30 @@ static const struct pci_device_id pci_ids[] = { | |||
856 | }, | 886 | }, |
857 | 887 | ||
858 | { | 888 | { |
889 | .vendor = PCI_VENDOR_ID_INTEL, | ||
890 | .device = PCI_DEVICE_ID_INTEL_BYT_EMMC, | ||
891 | .subvendor = PCI_ANY_ID, | ||
892 | .subdevice = PCI_ANY_ID, | ||
893 | .driver_data = (kernel_ulong_t)&sdhci_intel_byt_emmc, | ||
894 | }, | ||
895 | |||
896 | { | ||
897 | .vendor = PCI_VENDOR_ID_INTEL, | ||
898 | .device = PCI_DEVICE_ID_INTEL_BYT_SDIO, | ||
899 | .subvendor = PCI_ANY_ID, | ||
900 | .subdevice = PCI_ANY_ID, | ||
901 | .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sdio, | ||
902 | }, | ||
903 | |||
904 | { | ||
905 | .vendor = PCI_VENDOR_ID_INTEL, | ||
906 | .device = PCI_DEVICE_ID_INTEL_BYT_SD, | ||
907 | .subvendor = PCI_ANY_ID, | ||
908 | .subdevice = PCI_ANY_ID, | ||
909 | .driver_data = (kernel_ulong_t)&sdhci_intel_byt_sd, | ||
910 | }, | ||
911 | |||
912 | { | ||
859 | .vendor = PCI_VENDOR_ID_O2, | 913 | .vendor = PCI_VENDOR_ID_O2, |
860 | .device = PCI_DEVICE_ID_O2_8120, | 914 | .device = PCI_DEVICE_ID_O2_8120, |
861 | .subvendor = PCI_ANY_ID, | 915 | .subvendor = PCI_ANY_ID, |
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c index 9b74d1e3ad44..6aa7b3266c80 100644 --- a/drivers/net/can/usb/esd_usb2.c +++ b/drivers/net/can/usb/esd_usb2.c | |||
@@ -612,9 +612,15 @@ static int esd_usb2_start(struct esd_usb2_net_priv *priv) | |||
612 | { | 612 | { |
613 | struct esd_usb2 *dev = priv->usb2; | 613 | struct esd_usb2 *dev = priv->usb2; |
614 | struct net_device *netdev = priv->netdev; | 614 | struct net_device *netdev = priv->netdev; |
615 | struct esd_usb2_msg msg; | 615 | struct esd_usb2_msg *msg; |
616 | int err, i; | 616 | int err, i; |
617 | 617 | ||
618 | msg = kmalloc(sizeof(*msg), GFP_KERNEL); | ||
619 | if (!msg) { | ||
620 | err = -ENOMEM; | ||
621 | goto out; | ||
622 | } | ||
623 | |||
618 | /* | 624 | /* |
619 | * Enable all IDs | 625 | * Enable all IDs |
620 | * The IDADD message takes up to 64 32 bit bitmasks (2048 bits). | 626 | * The IDADD message takes up to 64 32 bit bitmasks (2048 bits). |
@@ -628,33 +634,32 @@ static int esd_usb2_start(struct esd_usb2_net_priv *priv) | |||
628 | * the number of the starting bitmask (0..64) to the filter.option | 634 | * the number of the starting bitmask (0..64) to the filter.option |
629 | * field followed by only some bitmasks. | 635 | * field followed by only some bitmasks. |
630 | */ | 636 | */ |
631 | msg.msg.hdr.cmd = CMD_IDADD; | 637 | msg->msg.hdr.cmd = CMD_IDADD; |
632 | msg.msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; | 638 | msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; |
633 | msg.msg.filter.net = priv->index; | 639 | msg->msg.filter.net = priv->index; |
634 | msg.msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ | 640 | msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ |
635 | for (i = 0; i < ESD_MAX_ID_SEGMENT; i++) | 641 | for (i = 0; i < ESD_MAX_ID_SEGMENT; i++) |
636 | msg.msg.filter.mask[i] = cpu_to_le32(0xffffffff); | 642 | msg->msg.filter.mask[i] = cpu_to_le32(0xffffffff); |
637 | /* enable 29bit extended IDs */ | 643 | /* enable 29bit extended IDs */ |
638 | msg.msg.filter.mask[ESD_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); | 644 | msg->msg.filter.mask[ESD_MAX_ID_SEGMENT] = cpu_to_le32(0x00000001); |
639 | 645 | ||
640 | err = esd_usb2_send_msg(dev, &msg); | 646 | err = esd_usb2_send_msg(dev, msg); |
641 | if (err) | 647 | if (err) |
642 | goto failed; | 648 | goto out; |
643 | 649 | ||
644 | err = esd_usb2_setup_rx_urbs(dev); | 650 | err = esd_usb2_setup_rx_urbs(dev); |
645 | if (err) | 651 | if (err) |
646 | goto failed; | 652 | goto out; |
647 | 653 | ||
648 | priv->can.state = CAN_STATE_ERROR_ACTIVE; | 654 | priv->can.state = CAN_STATE_ERROR_ACTIVE; |
649 | 655 | ||
650 | return 0; | 656 | out: |
651 | |||
652 | failed: | ||
653 | if (err == -ENODEV) | 657 | if (err == -ENODEV) |
654 | netif_device_detach(netdev); | 658 | netif_device_detach(netdev); |
659 | if (err) | ||
660 | netdev_err(netdev, "couldn't start device: %d\n", err); | ||
655 | 661 | ||
656 | netdev_err(netdev, "couldn't start device: %d\n", err); | 662 | kfree(msg); |
657 | |||
658 | return err; | 663 | return err; |
659 | } | 664 | } |
660 | 665 | ||
@@ -833,26 +838,30 @@ nourbmem: | |||
833 | static int esd_usb2_close(struct net_device *netdev) | 838 | static int esd_usb2_close(struct net_device *netdev) |
834 | { | 839 | { |
835 | struct esd_usb2_net_priv *priv = netdev_priv(netdev); | 840 | struct esd_usb2_net_priv *priv = netdev_priv(netdev); |
836 | struct esd_usb2_msg msg; | 841 | struct esd_usb2_msg *msg; |
837 | int i; | 842 | int i; |
838 | 843 | ||
844 | msg = kmalloc(sizeof(*msg), GFP_KERNEL); | ||
845 | if (!msg) | ||
846 | return -ENOMEM; | ||
847 | |||
839 | /* Disable all IDs (see esd_usb2_start()) */ | 848 | /* Disable all IDs (see esd_usb2_start()) */ |
840 | msg.msg.hdr.cmd = CMD_IDADD; | 849 | msg->msg.hdr.cmd = CMD_IDADD; |
841 | msg.msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; | 850 | msg->msg.hdr.len = 2 + ESD_MAX_ID_SEGMENT; |
842 | msg.msg.filter.net = priv->index; | 851 | msg->msg.filter.net = priv->index; |
843 | msg.msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ | 852 | msg->msg.filter.option = ESD_ID_ENABLE; /* start with segment 0 */ |
844 | for (i = 0; i <= ESD_MAX_ID_SEGMENT; i++) | 853 | for (i = 0; i <= ESD_MAX_ID_SEGMENT; i++) |
845 | msg.msg.filter.mask[i] = 0; | 854 | msg->msg.filter.mask[i] = 0; |
846 | if (esd_usb2_send_msg(priv->usb2, &msg) < 0) | 855 | if (esd_usb2_send_msg(priv->usb2, msg) < 0) |
847 | netdev_err(netdev, "sending idadd message failed\n"); | 856 | netdev_err(netdev, "sending idadd message failed\n"); |
848 | 857 | ||
849 | /* set CAN controller to reset mode */ | 858 | /* set CAN controller to reset mode */ |
850 | msg.msg.hdr.len = 2; | 859 | msg->msg.hdr.len = 2; |
851 | msg.msg.hdr.cmd = CMD_SETBAUD; | 860 | msg->msg.hdr.cmd = CMD_SETBAUD; |
852 | msg.msg.setbaud.net = priv->index; | 861 | msg->msg.setbaud.net = priv->index; |
853 | msg.msg.setbaud.rsvd = 0; | 862 | msg->msg.setbaud.rsvd = 0; |
854 | msg.msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE); | 863 | msg->msg.setbaud.baud = cpu_to_le32(ESD_USB2_NO_BAUDRATE); |
855 | if (esd_usb2_send_msg(priv->usb2, &msg) < 0) | 864 | if (esd_usb2_send_msg(priv->usb2, msg) < 0) |
856 | netdev_err(netdev, "sending setbaud message failed\n"); | 865 | netdev_err(netdev, "sending setbaud message failed\n"); |
857 | 866 | ||
858 | priv->can.state = CAN_STATE_STOPPED; | 867 | priv->can.state = CAN_STATE_STOPPED; |
@@ -861,6 +870,8 @@ static int esd_usb2_close(struct net_device *netdev) | |||
861 | 870 | ||
862 | close_candev(netdev); | 871 | close_candev(netdev); |
863 | 872 | ||
873 | kfree(msg); | ||
874 | |||
864 | return 0; | 875 | return 0; |
865 | } | 876 | } |
866 | 877 | ||
@@ -886,7 +897,8 @@ static int esd_usb2_set_bittiming(struct net_device *netdev) | |||
886 | { | 897 | { |
887 | struct esd_usb2_net_priv *priv = netdev_priv(netdev); | 898 | struct esd_usb2_net_priv *priv = netdev_priv(netdev); |
888 | struct can_bittiming *bt = &priv->can.bittiming; | 899 | struct can_bittiming *bt = &priv->can.bittiming; |
889 | struct esd_usb2_msg msg; | 900 | struct esd_usb2_msg *msg; |
901 | int err; | ||
890 | u32 canbtr; | 902 | u32 canbtr; |
891 | int sjw_shift; | 903 | int sjw_shift; |
892 | 904 | ||
@@ -912,15 +924,22 @@ static int esd_usb2_set_bittiming(struct net_device *netdev) | |||
912 | if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) | 924 | if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES) |
913 | canbtr |= ESD_USB2_3_SAMPLES; | 925 | canbtr |= ESD_USB2_3_SAMPLES; |
914 | 926 | ||
915 | msg.msg.hdr.len = 2; | 927 | msg = kmalloc(sizeof(*msg), GFP_KERNEL); |
916 | msg.msg.hdr.cmd = CMD_SETBAUD; | 928 | if (!msg) |
917 | msg.msg.setbaud.net = priv->index; | 929 | return -ENOMEM; |
918 | msg.msg.setbaud.rsvd = 0; | 930 | |
919 | msg.msg.setbaud.baud = cpu_to_le32(canbtr); | 931 | msg->msg.hdr.len = 2; |
932 | msg->msg.hdr.cmd = CMD_SETBAUD; | ||
933 | msg->msg.setbaud.net = priv->index; | ||
934 | msg->msg.setbaud.rsvd = 0; | ||
935 | msg->msg.setbaud.baud = cpu_to_le32(canbtr); | ||
920 | 936 | ||
921 | netdev_info(netdev, "setting BTR=%#x\n", canbtr); | 937 | netdev_info(netdev, "setting BTR=%#x\n", canbtr); |
922 | 938 | ||
923 | return esd_usb2_send_msg(priv->usb2, &msg); | 939 | err = esd_usb2_send_msg(priv->usb2, msg); |
940 | |||
941 | kfree(msg); | ||
942 | return err; | ||
924 | } | 943 | } |
925 | 944 | ||
926 | static int esd_usb2_get_berr_counter(const struct net_device *netdev, | 945 | static int esd_usb2_get_berr_counter(const struct net_device *netdev, |
@@ -1022,7 +1041,7 @@ static int esd_usb2_probe(struct usb_interface *intf, | |||
1022 | const struct usb_device_id *id) | 1041 | const struct usb_device_id *id) |
1023 | { | 1042 | { |
1024 | struct esd_usb2 *dev; | 1043 | struct esd_usb2 *dev; |
1025 | struct esd_usb2_msg msg; | 1044 | struct esd_usb2_msg *msg; |
1026 | int i, err; | 1045 | int i, err; |
1027 | 1046 | ||
1028 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); | 1047 | dev = kzalloc(sizeof(*dev), GFP_KERNEL); |
@@ -1037,27 +1056,33 @@ static int esd_usb2_probe(struct usb_interface *intf, | |||
1037 | 1056 | ||
1038 | usb_set_intfdata(intf, dev); | 1057 | usb_set_intfdata(intf, dev); |
1039 | 1058 | ||
1059 | msg = kmalloc(sizeof(*msg), GFP_KERNEL); | ||
1060 | if (!msg) { | ||
1061 | err = -ENOMEM; | ||
1062 | goto free_msg; | ||
1063 | } | ||
1064 | |||
1040 | /* query number of CAN interfaces (nets) */ | 1065 | /* query number of CAN interfaces (nets) */ |
1041 | msg.msg.hdr.cmd = CMD_VERSION; | 1066 | msg->msg.hdr.cmd = CMD_VERSION; |
1042 | msg.msg.hdr.len = 2; | 1067 | msg->msg.hdr.len = 2; |
1043 | msg.msg.version.rsvd = 0; | 1068 | msg->msg.version.rsvd = 0; |
1044 | msg.msg.version.flags = 0; | 1069 | msg->msg.version.flags = 0; |
1045 | msg.msg.version.drv_version = 0; | 1070 | msg->msg.version.drv_version = 0; |
1046 | 1071 | ||
1047 | err = esd_usb2_send_msg(dev, &msg); | 1072 | err = esd_usb2_send_msg(dev, msg); |
1048 | if (err < 0) { | 1073 | if (err < 0) { |
1049 | dev_err(&intf->dev, "sending version message failed\n"); | 1074 | dev_err(&intf->dev, "sending version message failed\n"); |
1050 | goto free_dev; | 1075 | goto free_msg; |
1051 | } | 1076 | } |
1052 | 1077 | ||
1053 | err = esd_usb2_wait_msg(dev, &msg); | 1078 | err = esd_usb2_wait_msg(dev, msg); |
1054 | if (err < 0) { | 1079 | if (err < 0) { |
1055 | dev_err(&intf->dev, "no version message answer\n"); | 1080 | dev_err(&intf->dev, "no version message answer\n"); |
1056 | goto free_dev; | 1081 | goto free_msg; |
1057 | } | 1082 | } |
1058 | 1083 | ||
1059 | dev->net_count = (int)msg.msg.version_reply.nets; | 1084 | dev->net_count = (int)msg->msg.version_reply.nets; |
1060 | dev->version = le32_to_cpu(msg.msg.version_reply.version); | 1085 | dev->version = le32_to_cpu(msg->msg.version_reply.version); |
1061 | 1086 | ||
1062 | if (device_create_file(&intf->dev, &dev_attr_firmware)) | 1087 | if (device_create_file(&intf->dev, &dev_attr_firmware)) |
1063 | dev_err(&intf->dev, | 1088 | dev_err(&intf->dev, |
@@ -1075,10 +1100,10 @@ static int esd_usb2_probe(struct usb_interface *intf, | |||
1075 | for (i = 0; i < dev->net_count; i++) | 1100 | for (i = 0; i < dev->net_count; i++) |
1076 | esd_usb2_probe_one_net(intf, i); | 1101 | esd_usb2_probe_one_net(intf, i); |
1077 | 1102 | ||
1078 | return 0; | 1103 | free_msg: |
1079 | 1104 | kfree(msg); | |
1080 | free_dev: | 1105 | if (err) |
1081 | kfree(dev); | 1106 | kfree(dev); |
1082 | done: | 1107 | done: |
1083 | return err; | 1108 | return err; |
1084 | } | 1109 | } |
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 45cb9f3c1324..3b9546588240 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
@@ -136,6 +136,9 @@ | |||
136 | #define KVASER_CTRL_MODE_SELFRECEPTION 3 | 136 | #define KVASER_CTRL_MODE_SELFRECEPTION 3 |
137 | #define KVASER_CTRL_MODE_OFF 4 | 137 | #define KVASER_CTRL_MODE_OFF 4 |
138 | 138 | ||
139 | /* log message */ | ||
140 | #define KVASER_EXTENDED_FRAME BIT(31) | ||
141 | |||
139 | struct kvaser_msg_simple { | 142 | struct kvaser_msg_simple { |
140 | u8 tid; | 143 | u8 tid; |
141 | u8 channel; | 144 | u8 channel; |
@@ -817,8 +820,13 @@ static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, | |||
817 | priv = dev->nets[channel]; | 820 | priv = dev->nets[channel]; |
818 | stats = &priv->netdev->stats; | 821 | stats = &priv->netdev->stats; |
819 | 822 | ||
820 | if (msg->u.rx_can.flag & (MSG_FLAG_ERROR_FRAME | MSG_FLAG_NERR | | 823 | if ((msg->u.rx_can.flag & MSG_FLAG_ERROR_FRAME) && |
821 | MSG_FLAG_OVERRUN)) { | 824 | (msg->id == CMD_LOG_MESSAGE)) { |
825 | kvaser_usb_rx_error(dev, msg); | ||
826 | return; | ||
827 | } else if (msg->u.rx_can.flag & (MSG_FLAG_ERROR_FRAME | | ||
828 | MSG_FLAG_NERR | | ||
829 | MSG_FLAG_OVERRUN)) { | ||
822 | kvaser_usb_rx_can_err(priv, msg); | 830 | kvaser_usb_rx_can_err(priv, msg); |
823 | return; | 831 | return; |
824 | } else if (msg->u.rx_can.flag & ~MSG_FLAG_REMOTE_FRAME) { | 832 | } else if (msg->u.rx_can.flag & ~MSG_FLAG_REMOTE_FRAME) { |
@@ -834,22 +842,40 @@ static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, | |||
834 | return; | 842 | return; |
835 | } | 843 | } |
836 | 844 | ||
837 | cf->can_id = ((msg->u.rx_can.msg[0] & 0x1f) << 6) | | 845 | if (msg->id == CMD_LOG_MESSAGE) { |
838 | (msg->u.rx_can.msg[1] & 0x3f); | 846 | cf->can_id = le32_to_cpu(msg->u.log_message.id); |
839 | cf->can_dlc = get_can_dlc(msg->u.rx_can.msg[5]); | 847 | if (cf->can_id & KVASER_EXTENDED_FRAME) |
848 | cf->can_id &= CAN_EFF_MASK | CAN_EFF_FLAG; | ||
849 | else | ||
850 | cf->can_id &= CAN_SFF_MASK; | ||
840 | 851 | ||
841 | if (msg->id == CMD_RX_EXT_MESSAGE) { | 852 | cf->can_dlc = get_can_dlc(msg->u.log_message.dlc); |
842 | cf->can_id <<= 18; | ||
843 | cf->can_id |= ((msg->u.rx_can.msg[2] & 0x0f) << 14) | | ||
844 | ((msg->u.rx_can.msg[3] & 0xff) << 6) | | ||
845 | (msg->u.rx_can.msg[4] & 0x3f); | ||
846 | cf->can_id |= CAN_EFF_FLAG; | ||
847 | } | ||
848 | 853 | ||
849 | if (msg->u.rx_can.flag & MSG_FLAG_REMOTE_FRAME) | 854 | if (msg->u.log_message.flags & MSG_FLAG_REMOTE_FRAME) |
850 | cf->can_id |= CAN_RTR_FLAG; | 855 | cf->can_id |= CAN_RTR_FLAG; |
851 | else | 856 | else |
852 | memcpy(cf->data, &msg->u.rx_can.msg[6], cf->can_dlc); | 857 | memcpy(cf->data, &msg->u.log_message.data, |
858 | cf->can_dlc); | ||
859 | } else { | ||
860 | cf->can_id = ((msg->u.rx_can.msg[0] & 0x1f) << 6) | | ||
861 | (msg->u.rx_can.msg[1] & 0x3f); | ||
862 | |||
863 | if (msg->id == CMD_RX_EXT_MESSAGE) { | ||
864 | cf->can_id <<= 18; | ||
865 | cf->can_id |= ((msg->u.rx_can.msg[2] & 0x0f) << 14) | | ||
866 | ((msg->u.rx_can.msg[3] & 0xff) << 6) | | ||
867 | (msg->u.rx_can.msg[4] & 0x3f); | ||
868 | cf->can_id |= CAN_EFF_FLAG; | ||
869 | } | ||
870 | |||
871 | cf->can_dlc = get_can_dlc(msg->u.rx_can.msg[5]); | ||
872 | |||
873 | if (msg->u.rx_can.flag & MSG_FLAG_REMOTE_FRAME) | ||
874 | cf->can_id |= CAN_RTR_FLAG; | ||
875 | else | ||
876 | memcpy(cf->data, &msg->u.rx_can.msg[6], | ||
877 | cf->can_dlc); | ||
878 | } | ||
853 | 879 | ||
854 | netif_rx(skb); | 880 | netif_rx(skb); |
855 | 881 | ||
@@ -911,6 +937,7 @@ static void kvaser_usb_handle_message(const struct kvaser_usb *dev, | |||
911 | 937 | ||
912 | case CMD_RX_STD_MESSAGE: | 938 | case CMD_RX_STD_MESSAGE: |
913 | case CMD_RX_EXT_MESSAGE: | 939 | case CMD_RX_EXT_MESSAGE: |
940 | case CMD_LOG_MESSAGE: | ||
914 | kvaser_usb_rx_can_msg(dev, msg); | 941 | kvaser_usb_rx_can_msg(dev, msg); |
915 | break; | 942 | break; |
916 | 943 | ||
@@ -919,11 +946,6 @@ static void kvaser_usb_handle_message(const struct kvaser_usb *dev, | |||
919 | kvaser_usb_rx_error(dev, msg); | 946 | kvaser_usb_rx_error(dev, msg); |
920 | break; | 947 | break; |
921 | 948 | ||
922 | case CMD_LOG_MESSAGE: | ||
923 | if (msg->u.log_message.flags & MSG_FLAG_ERROR_FRAME) | ||
924 | kvaser_usb_rx_error(dev, msg); | ||
925 | break; | ||
926 | |||
927 | case CMD_TX_ACKNOWLEDGE: | 949 | case CMD_TX_ACKNOWLEDGE: |
928 | kvaser_usb_tx_acknowledge(dev, msg); | 950 | kvaser_usb_tx_acknowledge(dev, msg); |
929 | break; | 951 | break; |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c index 30d79bfa5b10..8ee9d1556e6e 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c | |||
@@ -504,15 +504,24 @@ static int pcan_usb_pro_restart_async(struct peak_usb_device *dev, | |||
504 | return usb_submit_urb(urb, GFP_ATOMIC); | 504 | return usb_submit_urb(urb, GFP_ATOMIC); |
505 | } | 505 | } |
506 | 506 | ||
507 | static void pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded) | 507 | static int pcan_usb_pro_drv_loaded(struct peak_usb_device *dev, int loaded) |
508 | { | 508 | { |
509 | u8 buffer[16]; | 509 | u8 *buffer; |
510 | int err; | ||
511 | |||
512 | buffer = kmalloc(PCAN_USBPRO_FCT_DRVLD_REQ_LEN, GFP_KERNEL); | ||
513 | if (!buffer) | ||
514 | return -ENOMEM; | ||
510 | 515 | ||
511 | buffer[0] = 0; | 516 | buffer[0] = 0; |
512 | buffer[1] = !!loaded; | 517 | buffer[1] = !!loaded; |
513 | 518 | ||
514 | pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_FCT, | 519 | err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_FCT, |
515 | PCAN_USBPRO_FCT_DRVLD, buffer, sizeof(buffer)); | 520 | PCAN_USBPRO_FCT_DRVLD, buffer, |
521 | PCAN_USBPRO_FCT_DRVLD_REQ_LEN); | ||
522 | kfree(buffer); | ||
523 | |||
524 | return err; | ||
516 | } | 525 | } |
517 | 526 | ||
518 | static inline | 527 | static inline |
@@ -851,21 +860,24 @@ static int pcan_usb_pro_stop(struct peak_usb_device *dev) | |||
851 | */ | 860 | */ |
852 | static int pcan_usb_pro_init(struct peak_usb_device *dev) | 861 | static int pcan_usb_pro_init(struct peak_usb_device *dev) |
853 | { | 862 | { |
854 | struct pcan_usb_pro_interface *usb_if; | ||
855 | struct pcan_usb_pro_device *pdev = | 863 | struct pcan_usb_pro_device *pdev = |
856 | container_of(dev, struct pcan_usb_pro_device, dev); | 864 | container_of(dev, struct pcan_usb_pro_device, dev); |
865 | struct pcan_usb_pro_interface *usb_if = NULL; | ||
866 | struct pcan_usb_pro_fwinfo *fi = NULL; | ||
867 | struct pcan_usb_pro_blinfo *bi = NULL; | ||
868 | int err; | ||
857 | 869 | ||
858 | /* do this for 1st channel only */ | 870 | /* do this for 1st channel only */ |
859 | if (!dev->prev_siblings) { | 871 | if (!dev->prev_siblings) { |
860 | struct pcan_usb_pro_fwinfo fi; | ||
861 | struct pcan_usb_pro_blinfo bi; | ||
862 | int err; | ||
863 | |||
864 | /* allocate netdevices common structure attached to first one */ | 872 | /* allocate netdevices common structure attached to first one */ |
865 | usb_if = kzalloc(sizeof(struct pcan_usb_pro_interface), | 873 | usb_if = kzalloc(sizeof(struct pcan_usb_pro_interface), |
866 | GFP_KERNEL); | 874 | GFP_KERNEL); |
867 | if (!usb_if) | 875 | fi = kmalloc(sizeof(struct pcan_usb_pro_fwinfo), GFP_KERNEL); |
868 | return -ENOMEM; | 876 | bi = kmalloc(sizeof(struct pcan_usb_pro_blinfo), GFP_KERNEL); |
877 | if (!usb_if || !fi || !bi) { | ||
878 | err = -ENOMEM; | ||
879 | goto err_out; | ||
880 | } | ||
869 | 881 | ||
870 | /* number of ts msgs to ignore before taking one into account */ | 882 | /* number of ts msgs to ignore before taking one into account */ |
871 | usb_if->cm_ignore_count = 5; | 883 | usb_if->cm_ignore_count = 5; |
@@ -877,34 +889,34 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) | |||
877 | */ | 889 | */ |
878 | err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_INFO, | 890 | err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_INFO, |
879 | PCAN_USBPRO_INFO_FW, | 891 | PCAN_USBPRO_INFO_FW, |
880 | &fi, sizeof(fi)); | 892 | fi, sizeof(*fi)); |
881 | if (err) { | 893 | if (err) { |
882 | kfree(usb_if); | ||
883 | dev_err(dev->netdev->dev.parent, | 894 | dev_err(dev->netdev->dev.parent, |
884 | "unable to read %s firmware info (err %d)\n", | 895 | "unable to read %s firmware info (err %d)\n", |
885 | pcan_usb_pro.name, err); | 896 | pcan_usb_pro.name, err); |
886 | return err; | 897 | goto err_out; |
887 | } | 898 | } |
888 | 899 | ||
889 | err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_INFO, | 900 | err = pcan_usb_pro_send_req(dev, PCAN_USBPRO_REQ_INFO, |
890 | PCAN_USBPRO_INFO_BL, | 901 | PCAN_USBPRO_INFO_BL, |
891 | &bi, sizeof(bi)); | 902 | bi, sizeof(*bi)); |
892 | if (err) { | 903 | if (err) { |
893 | kfree(usb_if); | ||
894 | dev_err(dev->netdev->dev.parent, | 904 | dev_err(dev->netdev->dev.parent, |
895 | "unable to read %s bootloader info (err %d)\n", | 905 | "unable to read %s bootloader info (err %d)\n", |
896 | pcan_usb_pro.name, err); | 906 | pcan_usb_pro.name, err); |
897 | return err; | 907 | goto err_out; |
898 | } | 908 | } |
899 | 909 | ||
910 | /* tell the device the can driver is running */ | ||
911 | err = pcan_usb_pro_drv_loaded(dev, 1); | ||
912 | if (err) | ||
913 | goto err_out; | ||
914 | |||
900 | dev_info(dev->netdev->dev.parent, | 915 | dev_info(dev->netdev->dev.parent, |
901 | "PEAK-System %s hwrev %u serial %08X.%08X (%u channels)\n", | 916 | "PEAK-System %s hwrev %u serial %08X.%08X (%u channels)\n", |
902 | pcan_usb_pro.name, | 917 | pcan_usb_pro.name, |
903 | bi.hw_rev, bi.serial_num_hi, bi.serial_num_lo, | 918 | bi->hw_rev, bi->serial_num_hi, bi->serial_num_lo, |
904 | pcan_usb_pro.ctrl_count); | 919 | pcan_usb_pro.ctrl_count); |
905 | |||
906 | /* tell the device the can driver is running */ | ||
907 | pcan_usb_pro_drv_loaded(dev, 1); | ||
908 | } else { | 920 | } else { |
909 | usb_if = pcan_usb_pro_dev_if(dev->prev_siblings); | 921 | usb_if = pcan_usb_pro_dev_if(dev->prev_siblings); |
910 | } | 922 | } |
@@ -916,6 +928,13 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev) | |||
916 | pcan_usb_pro_set_led(dev, 0, 1); | 928 | pcan_usb_pro_set_led(dev, 0, 1); |
917 | 929 | ||
918 | return 0; | 930 | return 0; |
931 | |||
932 | err_out: | ||
933 | kfree(bi); | ||
934 | kfree(fi); | ||
935 | kfree(usb_if); | ||
936 | |||
937 | return err; | ||
919 | } | 938 | } |
920 | 939 | ||
921 | static void pcan_usb_pro_exit(struct peak_usb_device *dev) | 940 | static void pcan_usb_pro_exit(struct peak_usb_device *dev) |
diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.h b/drivers/net/can/usb/peak_usb/pcan_usb_pro.h index a869918c5620..32275af547e0 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.h +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | /* Vendor Request value for XXX_FCT */ | 30 | /* Vendor Request value for XXX_FCT */ |
31 | #define PCAN_USBPRO_FCT_DRVLD 5 /* tell device driver is loaded */ | 31 | #define PCAN_USBPRO_FCT_DRVLD 5 /* tell device driver is loaded */ |
32 | #define PCAN_USBPRO_FCT_DRVLD_REQ_LEN 16 | ||
32 | 33 | ||
33 | /* PCAN_USBPRO_INFO_BL vendor request record type */ | 34 | /* PCAN_USBPRO_INFO_BL vendor request record type */ |
34 | struct __packed pcan_usb_pro_blinfo { | 35 | struct __packed pcan_usb_pro_blinfo { |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index be59ec4b2c30..638e55435b04 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -3192,11 +3192,11 @@ static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb) | |||
3192 | rc |= XMIT_CSUM_TCP; | 3192 | rc |= XMIT_CSUM_TCP; |
3193 | 3193 | ||
3194 | if (skb_is_gso_v6(skb)) { | 3194 | if (skb_is_gso_v6(skb)) { |
3195 | rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP | XMIT_CSUM_V6); | 3195 | rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP); |
3196 | if (rc & XMIT_CSUM_ENC) | 3196 | if (rc & XMIT_CSUM_ENC) |
3197 | rc |= XMIT_GSO_ENC_V6; | 3197 | rc |= XMIT_GSO_ENC_V6; |
3198 | } else if (skb_is_gso(skb)) { | 3198 | } else if (skb_is_gso(skb)) { |
3199 | rc |= (XMIT_GSO_V4 | XMIT_CSUM_V4 | XMIT_CSUM_TCP); | 3199 | rc |= (XMIT_GSO_V4 | XMIT_CSUM_TCP); |
3200 | if (rc & XMIT_CSUM_ENC) | 3200 | if (rc & XMIT_CSUM_ENC) |
3201 | rc |= XMIT_GSO_ENC_V4; | 3201 | rc |= XMIT_GSO_ENC_V4; |
3202 | } | 3202 | } |
@@ -3483,19 +3483,18 @@ static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb, | |||
3483 | { | 3483 | { |
3484 | u16 hlen_w = 0; | 3484 | u16 hlen_w = 0; |
3485 | u8 outerip_off, outerip_len = 0; | 3485 | u8 outerip_off, outerip_len = 0; |
3486 | |||
3486 | /* from outer IP to transport */ | 3487 | /* from outer IP to transport */ |
3487 | hlen_w = (skb_inner_transport_header(skb) - | 3488 | hlen_w = (skb_inner_transport_header(skb) - |
3488 | skb_network_header(skb)) >> 1; | 3489 | skb_network_header(skb)) >> 1; |
3489 | 3490 | ||
3490 | /* transport len */ | 3491 | /* transport len */ |
3491 | if (xmit_type & XMIT_CSUM_TCP) | 3492 | hlen_w += inner_tcp_hdrlen(skb) >> 1; |
3492 | hlen_w += inner_tcp_hdrlen(skb) >> 1; | ||
3493 | else | ||
3494 | hlen_w += sizeof(struct udphdr) >> 1; | ||
3495 | 3493 | ||
3496 | pbd2->fw_ip_hdr_to_payload_w = hlen_w; | 3494 | pbd2->fw_ip_hdr_to_payload_w = hlen_w; |
3497 | 3495 | ||
3498 | if (xmit_type & XMIT_CSUM_ENC_V4) { | 3496 | /* outer IP header info */ |
3497 | if (xmit_type & XMIT_CSUM_V4) { | ||
3499 | struct iphdr *iph = ip_hdr(skb); | 3498 | struct iphdr *iph = ip_hdr(skb); |
3500 | pbd2->fw_ip_csum_wo_len_flags_frag = | 3499 | pbd2->fw_ip_csum_wo_len_flags_frag = |
3501 | bswab16(csum_fold((~iph->check) - | 3500 | bswab16(csum_fold((~iph->check) - |
@@ -3818,8 +3817,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
3818 | bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, | 3817 | bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, |
3819 | xmit_type); | 3818 | xmit_type); |
3820 | else | 3819 | else |
3821 | bnx2x_set_pbd_gso(skb, pbd_e1x, tx_start_bd, | 3820 | bnx2x_set_pbd_gso(skb, pbd_e1x, first_bd, xmit_type); |
3822 | xmit_type); | ||
3823 | } | 3821 | } |
3824 | 3822 | ||
3825 | /* Set the PBD's parsing_data field if not zero | 3823 | /* Set the PBD's parsing_data field if not zero |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 1f2dd928888a..0f493c8dc28b 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -9468,6 +9468,14 @@ static void tg3_rss_write_indir_tbl(struct tg3 *tp) | |||
9468 | } | 9468 | } |
9469 | } | 9469 | } |
9470 | 9470 | ||
9471 | static inline u32 tg3_lso_rd_dma_workaround_bit(struct tg3 *tp) | ||
9472 | { | ||
9473 | if (tg3_asic_rev(tp) == ASIC_REV_5719) | ||
9474 | return TG3_LSO_RD_DMA_TX_LENGTH_WA_5719; | ||
9475 | else | ||
9476 | return TG3_LSO_RD_DMA_TX_LENGTH_WA_5720; | ||
9477 | } | ||
9478 | |||
9471 | /* tp->lock is held. */ | 9479 | /* tp->lock is held. */ |
9472 | static int tg3_reset_hw(struct tg3 *tp, bool reset_phy) | 9480 | static int tg3_reset_hw(struct tg3 *tp, bool reset_phy) |
9473 | { | 9481 | { |
@@ -10153,16 +10161,17 @@ static int tg3_reset_hw(struct tg3 *tp, bool reset_phy) | |||
10153 | tw32_f(RDMAC_MODE, rdmac_mode); | 10161 | tw32_f(RDMAC_MODE, rdmac_mode); |
10154 | udelay(40); | 10162 | udelay(40); |
10155 | 10163 | ||
10156 | if (tg3_asic_rev(tp) == ASIC_REV_5719) { | 10164 | if (tg3_asic_rev(tp) == ASIC_REV_5719 || |
10165 | tg3_asic_rev(tp) == ASIC_REV_5720) { | ||
10157 | for (i = 0; i < TG3_NUM_RDMA_CHANNELS; i++) { | 10166 | for (i = 0; i < TG3_NUM_RDMA_CHANNELS; i++) { |
10158 | if (tr32(TG3_RDMA_LENGTH + (i << 2)) > TG3_MAX_MTU(tp)) | 10167 | if (tr32(TG3_RDMA_LENGTH + (i << 2)) > TG3_MAX_MTU(tp)) |
10159 | break; | 10168 | break; |
10160 | } | 10169 | } |
10161 | if (i < TG3_NUM_RDMA_CHANNELS) { | 10170 | if (i < TG3_NUM_RDMA_CHANNELS) { |
10162 | val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); | 10171 | val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); |
10163 | val |= TG3_LSO_RD_DMA_TX_LENGTH_WA; | 10172 | val |= tg3_lso_rd_dma_workaround_bit(tp); |
10164 | tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val); | 10173 | tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val); |
10165 | tg3_flag_set(tp, 5719_RDMA_BUG); | 10174 | tg3_flag_set(tp, 5719_5720_RDMA_BUG); |
10166 | } | 10175 | } |
10167 | } | 10176 | } |
10168 | 10177 | ||
@@ -10526,15 +10535,15 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp) | |||
10526 | TG3_STAT_ADD32(&sp->tx_ucast_packets, MAC_TX_STATS_UCAST); | 10535 | TG3_STAT_ADD32(&sp->tx_ucast_packets, MAC_TX_STATS_UCAST); |
10527 | TG3_STAT_ADD32(&sp->tx_mcast_packets, MAC_TX_STATS_MCAST); | 10536 | TG3_STAT_ADD32(&sp->tx_mcast_packets, MAC_TX_STATS_MCAST); |
10528 | TG3_STAT_ADD32(&sp->tx_bcast_packets, MAC_TX_STATS_BCAST); | 10537 | TG3_STAT_ADD32(&sp->tx_bcast_packets, MAC_TX_STATS_BCAST); |
10529 | if (unlikely(tg3_flag(tp, 5719_RDMA_BUG) && | 10538 | if (unlikely(tg3_flag(tp, 5719_5720_RDMA_BUG) && |
10530 | (sp->tx_ucast_packets.low + sp->tx_mcast_packets.low + | 10539 | (sp->tx_ucast_packets.low + sp->tx_mcast_packets.low + |
10531 | sp->tx_bcast_packets.low) > TG3_NUM_RDMA_CHANNELS)) { | 10540 | sp->tx_bcast_packets.low) > TG3_NUM_RDMA_CHANNELS)) { |
10532 | u32 val; | 10541 | u32 val; |
10533 | 10542 | ||
10534 | val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); | 10543 | val = tr32(TG3_LSO_RD_DMA_CRPTEN_CTRL); |
10535 | val &= ~TG3_LSO_RD_DMA_TX_LENGTH_WA; | 10544 | val &= ~tg3_lso_rd_dma_workaround_bit(tp); |
10536 | tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val); | 10545 | tw32(TG3_LSO_RD_DMA_CRPTEN_CTRL, val); |
10537 | tg3_flag_clear(tp, 5719_RDMA_BUG); | 10546 | tg3_flag_clear(tp, 5719_5720_RDMA_BUG); |
10538 | } | 10547 | } |
10539 | 10548 | ||
10540 | TG3_STAT_ADD32(&sp->rx_octets, MAC_RX_STATS_OCTETS); | 10549 | TG3_STAT_ADD32(&sp->rx_octets, MAC_RX_STATS_OCTETS); |
diff --git a/drivers/net/ethernet/broadcom/tg3.h b/drivers/net/ethernet/broadcom/tg3.h index 9b2d3ac2474a..ff6e30eeae35 100644 --- a/drivers/net/ethernet/broadcom/tg3.h +++ b/drivers/net/ethernet/broadcom/tg3.h | |||
@@ -1422,7 +1422,8 @@ | |||
1422 | #define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910 | 1422 | #define TG3_LSO_RD_DMA_CRPTEN_CTRL 0x00004910 |
1423 | #define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 | 1423 | #define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_BD_4K 0x00030000 |
1424 | #define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K 0x000c0000 | 1424 | #define TG3_LSO_RD_DMA_CRPTEN_CTRL_BLEN_LSO_4K 0x000c0000 |
1425 | #define TG3_LSO_RD_DMA_TX_LENGTH_WA 0x02000000 | 1425 | #define TG3_LSO_RD_DMA_TX_LENGTH_WA_5719 0x02000000 |
1426 | #define TG3_LSO_RD_DMA_TX_LENGTH_WA_5720 0x00200000 | ||
1426 | /* 0x4914 --> 0x4be0 unused */ | 1427 | /* 0x4914 --> 0x4be0 unused */ |
1427 | 1428 | ||
1428 | #define TG3_NUM_RDMA_CHANNELS 4 | 1429 | #define TG3_NUM_RDMA_CHANNELS 4 |
@@ -3059,7 +3060,7 @@ enum TG3_FLAGS { | |||
3059 | TG3_FLAG_APE_HAS_NCSI, | 3060 | TG3_FLAG_APE_HAS_NCSI, |
3060 | TG3_FLAG_TX_TSTAMP_EN, | 3061 | TG3_FLAG_TX_TSTAMP_EN, |
3061 | TG3_FLAG_4K_FIFO_LIMIT, | 3062 | TG3_FLAG_4K_FIFO_LIMIT, |
3062 | TG3_FLAG_5719_RDMA_BUG, | 3063 | TG3_FLAG_5719_5720_RDMA_BUG, |
3063 | TG3_FLAG_RESET_TASK_PENDING, | 3064 | TG3_FLAG_RESET_TASK_PENDING, |
3064 | TG3_FLAG_PTP_CAPABLE, | 3065 | TG3_FLAG_PTP_CAPABLE, |
3065 | TG3_FLAG_5705_PLUS, | 3066 | TG3_FLAG_5705_PLUS, |
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index f544b297c9ab..0a510684e468 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -262,6 +262,7 @@ struct be_rx_compl_info { | |||
262 | u8 ipv6; | 262 | u8 ipv6; |
263 | u8 vtm; | 263 | u8 vtm; |
264 | u8 pkt_type; | 264 | u8 pkt_type; |
265 | u8 ip_frag; | ||
265 | }; | 266 | }; |
266 | 267 | ||
267 | struct be_rx_obj { | 268 | struct be_rx_obj { |
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index a236ecd27cf3..1db2df61b8af 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -562,7 +562,7 @@ int lancer_test_and_set_rdy_state(struct be_adapter *adapter) | |||
562 | 562 | ||
563 | resource_error = lancer_provisioning_error(adapter); | 563 | resource_error = lancer_provisioning_error(adapter); |
564 | if (resource_error) | 564 | if (resource_error) |
565 | return -1; | 565 | return -EAGAIN; |
566 | 566 | ||
567 | status = lancer_wait_ready(adapter); | 567 | status = lancer_wait_ready(adapter); |
568 | if (!status) { | 568 | if (!status) { |
@@ -590,8 +590,8 @@ int lancer_test_and_set_rdy_state(struct be_adapter *adapter) | |||
590 | * when PF provisions resources. | 590 | * when PF provisions resources. |
591 | */ | 591 | */ |
592 | resource_error = lancer_provisioning_error(adapter); | 592 | resource_error = lancer_provisioning_error(adapter); |
593 | if (status == -1 && !resource_error) | 593 | if (resource_error) |
594 | adapter->eeh_error = true; | 594 | status = -EAGAIN; |
595 | 595 | ||
596 | return status; | 596 | return status; |
597 | } | 597 | } |
diff --git a/drivers/net/ethernet/emulex/benet/be_hw.h b/drivers/net/ethernet/emulex/benet/be_hw.h index 3c1099b47f2a..8780183c6d1c 100644 --- a/drivers/net/ethernet/emulex/benet/be_hw.h +++ b/drivers/net/ethernet/emulex/benet/be_hw.h | |||
@@ -356,7 +356,7 @@ struct amap_eth_rx_compl_v0 { | |||
356 | u8 ip_version; /* dword 1 */ | 356 | u8 ip_version; /* dword 1 */ |
357 | u8 macdst[6]; /* dword 1 */ | 357 | u8 macdst[6]; /* dword 1 */ |
358 | u8 vtp; /* dword 1 */ | 358 | u8 vtp; /* dword 1 */ |
359 | u8 rsvd0; /* dword 1 */ | 359 | u8 ip_frag; /* dword 1 */ |
360 | u8 fragndx[10]; /* dword 1 */ | 360 | u8 fragndx[10]; /* dword 1 */ |
361 | u8 ct[2]; /* dword 1 */ | 361 | u8 ct[2]; /* dword 1 */ |
362 | u8 sw; /* dword 1 */ | 362 | u8 sw; /* dword 1 */ |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index ca2967b0f18b..8bc1b21b1c79 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -1599,6 +1599,8 @@ static void be_parse_rx_compl_v0(struct be_eth_rx_compl *compl, | |||
1599 | compl); | 1599 | compl); |
1600 | } | 1600 | } |
1601 | rxcp->port = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, port, compl); | 1601 | rxcp->port = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, port, compl); |
1602 | rxcp->ip_frag = AMAP_GET_BITS(struct amap_eth_rx_compl_v0, | ||
1603 | ip_frag, compl); | ||
1602 | } | 1604 | } |
1603 | 1605 | ||
1604 | static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) | 1606 | static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) |
@@ -1620,6 +1622,9 @@ static struct be_rx_compl_info *be_rx_compl_get(struct be_rx_obj *rxo) | |||
1620 | else | 1622 | else |
1621 | be_parse_rx_compl_v0(compl, rxcp); | 1623 | be_parse_rx_compl_v0(compl, rxcp); |
1622 | 1624 | ||
1625 | if (rxcp->ip_frag) | ||
1626 | rxcp->l4_csum = 0; | ||
1627 | |||
1623 | if (rxcp->vlanf) { | 1628 | if (rxcp->vlanf) { |
1624 | /* vlanf could be wrongly set in some cards. | 1629 | /* vlanf could be wrongly set in some cards. |
1625 | * ignore if vtm is not set */ | 1630 | * ignore if vtm is not set */ |
@@ -2168,7 +2173,7 @@ static irqreturn_t be_msix(int irq, void *dev) | |||
2168 | 2173 | ||
2169 | static inline bool do_gro(struct be_rx_compl_info *rxcp) | 2174 | static inline bool do_gro(struct be_rx_compl_info *rxcp) |
2170 | { | 2175 | { |
2171 | return (rxcp->tcpf && !rxcp->err) ? true : false; | 2176 | return (rxcp->tcpf && !rxcp->err && rxcp->l4_csum) ? true : false; |
2172 | } | 2177 | } |
2173 | 2178 | ||
2174 | static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi, | 2179 | static int be_process_rx(struct be_rx_obj *rxo, struct napi_struct *napi, |
@@ -4093,6 +4098,7 @@ static int be_get_initial_config(struct be_adapter *adapter) | |||
4093 | 4098 | ||
4094 | static int lancer_recover_func(struct be_adapter *adapter) | 4099 | static int lancer_recover_func(struct be_adapter *adapter) |
4095 | { | 4100 | { |
4101 | struct device *dev = &adapter->pdev->dev; | ||
4096 | int status; | 4102 | int status; |
4097 | 4103 | ||
4098 | status = lancer_test_and_set_rdy_state(adapter); | 4104 | status = lancer_test_and_set_rdy_state(adapter); |
@@ -4104,8 +4110,7 @@ static int lancer_recover_func(struct be_adapter *adapter) | |||
4104 | 4110 | ||
4105 | be_clear(adapter); | 4111 | be_clear(adapter); |
4106 | 4112 | ||
4107 | adapter->hw_error = false; | 4113 | be_clear_all_error(adapter); |
4108 | adapter->fw_timeout = false; | ||
4109 | 4114 | ||
4110 | status = be_setup(adapter); | 4115 | status = be_setup(adapter); |
4111 | if (status) | 4116 | if (status) |
@@ -4117,13 +4122,13 @@ static int lancer_recover_func(struct be_adapter *adapter) | |||
4117 | goto err; | 4122 | goto err; |
4118 | } | 4123 | } |
4119 | 4124 | ||
4120 | dev_err(&adapter->pdev->dev, | 4125 | dev_err(dev, "Error recovery successful\n"); |
4121 | "Adapter SLIPORT recovery succeeded\n"); | ||
4122 | return 0; | 4126 | return 0; |
4123 | err: | 4127 | err: |
4124 | if (adapter->eeh_error) | 4128 | if (status == -EAGAIN) |
4125 | dev_err(&adapter->pdev->dev, | 4129 | dev_err(dev, "Waiting for resource provisioning\n"); |
4126 | "Adapter SLIPORT recovery failed\n"); | 4130 | else |
4131 | dev_err(dev, "Error recovery failed\n"); | ||
4127 | 4132 | ||
4128 | return status; | 4133 | return status; |
4129 | } | 4134 | } |
@@ -4132,28 +4137,27 @@ static void be_func_recovery_task(struct work_struct *work) | |||
4132 | { | 4137 | { |
4133 | struct be_adapter *adapter = | 4138 | struct be_adapter *adapter = |
4134 | container_of(work, struct be_adapter, func_recovery_work.work); | 4139 | container_of(work, struct be_adapter, func_recovery_work.work); |
4135 | int status; | 4140 | int status = 0; |
4136 | 4141 | ||
4137 | be_detect_error(adapter); | 4142 | be_detect_error(adapter); |
4138 | 4143 | ||
4139 | if (adapter->hw_error && lancer_chip(adapter)) { | 4144 | if (adapter->hw_error && lancer_chip(adapter)) { |
4140 | 4145 | ||
4141 | if (adapter->eeh_error) | ||
4142 | goto out; | ||
4143 | |||
4144 | rtnl_lock(); | 4146 | rtnl_lock(); |
4145 | netif_device_detach(adapter->netdev); | 4147 | netif_device_detach(adapter->netdev); |
4146 | rtnl_unlock(); | 4148 | rtnl_unlock(); |
4147 | 4149 | ||
4148 | status = lancer_recover_func(adapter); | 4150 | status = lancer_recover_func(adapter); |
4149 | |||
4150 | if (!status) | 4151 | if (!status) |
4151 | netif_device_attach(adapter->netdev); | 4152 | netif_device_attach(adapter->netdev); |
4152 | } | 4153 | } |
4153 | 4154 | ||
4154 | out: | 4155 | /* In Lancer, for all errors other than provisioning error (-EAGAIN), |
4155 | schedule_delayed_work(&adapter->func_recovery_work, | 4156 | * no need to attempt further recovery. |
4156 | msecs_to_jiffies(1000)); | 4157 | */ |
4158 | if (!status || status == -EAGAIN) | ||
4159 | schedule_delayed_work(&adapter->func_recovery_work, | ||
4160 | msecs_to_jiffies(1000)); | ||
4157 | } | 4161 | } |
4158 | 4162 | ||
4159 | static void be_worker(struct work_struct *work) | 4163 | static void be_worker(struct work_struct *work) |
@@ -4436,20 +4440,19 @@ static pci_ers_result_t be_eeh_err_detected(struct pci_dev *pdev, | |||
4436 | 4440 | ||
4437 | dev_err(&adapter->pdev->dev, "EEH error detected\n"); | 4441 | dev_err(&adapter->pdev->dev, "EEH error detected\n"); |
4438 | 4442 | ||
4439 | adapter->eeh_error = true; | 4443 | if (!adapter->eeh_error) { |
4440 | 4444 | adapter->eeh_error = true; | |
4441 | cancel_delayed_work_sync(&adapter->func_recovery_work); | ||
4442 | 4445 | ||
4443 | rtnl_lock(); | 4446 | cancel_delayed_work_sync(&adapter->func_recovery_work); |
4444 | netif_device_detach(netdev); | ||
4445 | rtnl_unlock(); | ||
4446 | 4447 | ||
4447 | if (netif_running(netdev)) { | ||
4448 | rtnl_lock(); | 4448 | rtnl_lock(); |
4449 | be_close(netdev); | 4449 | netif_device_detach(netdev); |
4450 | if (netif_running(netdev)) | ||
4451 | be_close(netdev); | ||
4450 | rtnl_unlock(); | 4452 | rtnl_unlock(); |
4453 | |||
4454 | be_clear(adapter); | ||
4451 | } | 4455 | } |
4452 | be_clear(adapter); | ||
4453 | 4456 | ||
4454 | if (state == pci_channel_io_perm_failure) | 4457 | if (state == pci_channel_io_perm_failure) |
4455 | return PCI_ERS_RESULT_DISCONNECT; | 4458 | return PCI_ERS_RESULT_DISCONNECT; |
@@ -4474,7 +4477,6 @@ static pci_ers_result_t be_eeh_reset(struct pci_dev *pdev) | |||
4474 | int status; | 4477 | int status; |
4475 | 4478 | ||
4476 | dev_info(&adapter->pdev->dev, "EEH reset\n"); | 4479 | dev_info(&adapter->pdev->dev, "EEH reset\n"); |
4477 | be_clear_all_error(adapter); | ||
4478 | 4480 | ||
4479 | status = pci_enable_device(pdev); | 4481 | status = pci_enable_device(pdev); |
4480 | if (status) | 4482 | if (status) |
@@ -4492,6 +4494,7 @@ static pci_ers_result_t be_eeh_reset(struct pci_dev *pdev) | |||
4492 | return PCI_ERS_RESULT_DISCONNECT; | 4494 | return PCI_ERS_RESULT_DISCONNECT; |
4493 | 4495 | ||
4494 | pci_cleanup_aer_uncorrect_error_status(pdev); | 4496 | pci_cleanup_aer_uncorrect_error_status(pdev); |
4497 | be_clear_all_error(adapter); | ||
4495 | return PCI_ERS_RESULT_RECOVERED; | 4498 | return PCI_ERS_RESULT_RECOVERED; |
4496 | } | 4499 | } |
4497 | 4500 | ||
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 85a06037b242..a667015be22a 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -1038,6 +1038,18 @@ static void fec_get_mac(struct net_device *ndev) | |||
1038 | iap = &tmpaddr[0]; | 1038 | iap = &tmpaddr[0]; |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | /* | ||
1042 | * 5) random mac address | ||
1043 | */ | ||
1044 | if (!is_valid_ether_addr(iap)) { | ||
1045 | /* Report it and use a random ethernet address instead */ | ||
1046 | netdev_err(ndev, "Invalid MAC address: %pM\n", iap); | ||
1047 | eth_hw_addr_random(ndev); | ||
1048 | netdev_info(ndev, "Using random MAC address: %pM\n", | ||
1049 | ndev->dev_addr); | ||
1050 | return; | ||
1051 | } | ||
1052 | |||
1041 | memcpy(ndev->dev_addr, iap, ETH_ALEN); | 1053 | memcpy(ndev->dev_addr, iap, ETH_ALEN); |
1042 | 1054 | ||
1043 | /* Adjust MAC if using macaddr */ | 1055 | /* Adjust MAC if using macaddr */ |
diff --git a/drivers/net/ethernet/mellanox/mlx4/cmd.c b/drivers/net/ethernet/mellanox/mlx4/cmd.c index 1df56cc50ee9..0e572a527154 100644 --- a/drivers/net/ethernet/mellanox/mlx4/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx4/cmd.c | |||
@@ -222,8 +222,6 @@ static int mlx4_comm_cmd_poll(struct mlx4_dev *dev, u8 cmd, u16 param, | |||
222 | * FLR process. The only non-zero result in the RESET command | 222 | * FLR process. The only non-zero result in the RESET command |
223 | * is MLX4_DELAY_RESET_SLAVE*/ | 223 | * is MLX4_DELAY_RESET_SLAVE*/ |
224 | if ((MLX4_COMM_CMD_RESET == cmd)) { | 224 | if ((MLX4_COMM_CMD_RESET == cmd)) { |
225 | mlx4_warn(dev, "Got slave FLRed from Communication" | ||
226 | " channel (ret:0x%x)\n", ret_from_pending); | ||
227 | err = MLX4_DELAY_RESET_SLAVE; | 225 | err = MLX4_DELAY_RESET_SLAVE; |
228 | } else { | 226 | } else { |
229 | mlx4_warn(dev, "Communication channel timed out\n"); | 227 | mlx4_warn(dev, "Communication channel timed out\n"); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index b35f94700093..89c47ea84b50 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -1323,6 +1323,7 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv) | |||
1323 | priv->last_moder_time[ring] = moder_time; | 1323 | priv->last_moder_time[ring] = moder_time; |
1324 | cq = &priv->rx_cq[ring]; | 1324 | cq = &priv->rx_cq[ring]; |
1325 | cq->moder_time = moder_time; | 1325 | cq->moder_time = moder_time; |
1326 | cq->moder_cnt = priv->rx_frames; | ||
1326 | err = mlx4_en_set_cq_moder(priv, cq); | 1327 | err = mlx4_en_set_cq_moder(priv, cq); |
1327 | if (err) | 1328 | if (err) |
1328 | en_err(priv, "Failed modifying moderation for cq:%d\n", | 1329 | en_err(priv, "Failed modifying moderation for cq:%d\n", |
@@ -2118,6 +2119,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2118 | struct mlx4_en_priv *priv; | 2119 | struct mlx4_en_priv *priv; |
2119 | int i; | 2120 | int i; |
2120 | int err; | 2121 | int err; |
2122 | u64 mac_u64; | ||
2121 | 2123 | ||
2122 | dev = alloc_etherdev_mqs(sizeof(struct mlx4_en_priv), | 2124 | dev = alloc_etherdev_mqs(sizeof(struct mlx4_en_priv), |
2123 | MAX_TX_RINGS, MAX_RX_RINGS); | 2125 | MAX_TX_RINGS, MAX_RX_RINGS); |
@@ -2191,10 +2193,17 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, | |||
2191 | dev->addr_len = ETH_ALEN; | 2193 | dev->addr_len = ETH_ALEN; |
2192 | mlx4_en_u64_to_mac(dev->dev_addr, mdev->dev->caps.def_mac[priv->port]); | 2194 | mlx4_en_u64_to_mac(dev->dev_addr, mdev->dev->caps.def_mac[priv->port]); |
2193 | if (!is_valid_ether_addr(dev->dev_addr)) { | 2195 | if (!is_valid_ether_addr(dev->dev_addr)) { |
2194 | en_err(priv, "Port: %d, invalid mac burned: %pM, quiting\n", | 2196 | if (mlx4_is_slave(priv->mdev->dev)) { |
2195 | priv->port, dev->dev_addr); | 2197 | eth_hw_addr_random(dev); |
2196 | err = -EINVAL; | 2198 | en_warn(priv, "Assigned random MAC address %pM\n", dev->dev_addr); |
2197 | goto out; | 2199 | mac_u64 = mlx4_en_mac_to_u64(dev->dev_addr); |
2200 | mdev->dev->caps.def_mac[priv->port] = mac_u64; | ||
2201 | } else { | ||
2202 | en_err(priv, "Port: %d, invalid mac burned: %pM, quiting\n", | ||
2203 | priv->port, dev->dev_addr); | ||
2204 | err = -EINVAL; | ||
2205 | goto out; | ||
2206 | } | ||
2198 | } | 2207 | } |
2199 | 2208 | ||
2200 | memcpy(priv->prev_mac, dev->dev_addr, sizeof(priv->prev_mac)); | 2209 | memcpy(priv->prev_mac, dev->dev_addr, sizeof(priv->prev_mac)); |
diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c index 58a8e535d698..2c97901c6a6d 100644 --- a/drivers/net/ethernet/mellanox/mlx4/fw.c +++ b/drivers/net/ethernet/mellanox/mlx4/fw.c | |||
@@ -840,12 +840,16 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave, | |||
840 | MLX4_CMD_NATIVE); | 840 | MLX4_CMD_NATIVE); |
841 | 841 | ||
842 | if (!err && dev->caps.function != slave) { | 842 | if (!err && dev->caps.function != slave) { |
843 | /* set slave default_mac address */ | ||
844 | MLX4_GET(def_mac, outbox->buf, QUERY_PORT_MAC_OFFSET); | ||
845 | def_mac += slave << 8; | ||
846 | /* if config MAC in DB use it */ | 843 | /* if config MAC in DB use it */ |
847 | if (priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac) | 844 | if (priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac) |
848 | def_mac = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac; | 845 | def_mac = priv->mfunc.master.vf_oper[slave].vport[vhcr->in_modifier].state.mac; |
846 | else { | ||
847 | /* set slave default_mac address */ | ||
848 | MLX4_GET(def_mac, outbox->buf, QUERY_PORT_MAC_OFFSET); | ||
849 | def_mac += slave << 8; | ||
850 | priv->mfunc.master.vf_admin[slave].vport[vhcr->in_modifier].mac = def_mac; | ||
851 | } | ||
852 | |||
849 | MLX4_PUT(outbox->buf, def_mac, QUERY_PORT_MAC_OFFSET); | 853 | MLX4_PUT(outbox->buf, def_mac, QUERY_PORT_MAC_OFFSET); |
850 | 854 | ||
851 | /* get port type - currently only eth is enabled */ | 855 | /* get port type - currently only eth is enabled */ |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 0d32a82458bf..2f4a26039e80 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -1290,7 +1290,6 @@ static int mlx4_init_slave(struct mlx4_dev *dev) | |||
1290 | { | 1290 | { |
1291 | struct mlx4_priv *priv = mlx4_priv(dev); | 1291 | struct mlx4_priv *priv = mlx4_priv(dev); |
1292 | u64 dma = (u64) priv->mfunc.vhcr_dma; | 1292 | u64 dma = (u64) priv->mfunc.vhcr_dma; |
1293 | int num_of_reset_retries = NUM_OF_RESET_RETRIES; | ||
1294 | int ret_from_reset = 0; | 1293 | int ret_from_reset = 0; |
1295 | u32 slave_read; | 1294 | u32 slave_read; |
1296 | u32 cmd_channel_ver; | 1295 | u32 cmd_channel_ver; |
@@ -1304,18 +1303,10 @@ static int mlx4_init_slave(struct mlx4_dev *dev) | |||
1304 | * NUM_OF_RESET_RETRIES times before leaving.*/ | 1303 | * NUM_OF_RESET_RETRIES times before leaving.*/ |
1305 | if (ret_from_reset) { | 1304 | if (ret_from_reset) { |
1306 | if (MLX4_DELAY_RESET_SLAVE == ret_from_reset) { | 1305 | if (MLX4_DELAY_RESET_SLAVE == ret_from_reset) { |
1307 | msleep(SLEEP_TIME_IN_RESET); | 1306 | mlx4_warn(dev, "slave is currently in the " |
1308 | while (ret_from_reset && num_of_reset_retries) { | 1307 | "middle of FLR. Deferring probe.\n"); |
1309 | mlx4_warn(dev, "slave is currently in the" | 1308 | mutex_unlock(&priv->cmd.slave_cmd_mutex); |
1310 | "middle of FLR. retrying..." | 1309 | return -EPROBE_DEFER; |
1311 | "(try num:%d)\n", | ||
1312 | (NUM_OF_RESET_RETRIES - | ||
1313 | num_of_reset_retries + 1)); | ||
1314 | ret_from_reset = | ||
1315 | mlx4_comm_cmd(dev, MLX4_COMM_CMD_RESET, | ||
1316 | 0, MLX4_COMM_TIME); | ||
1317 | num_of_reset_retries = num_of_reset_retries - 1; | ||
1318 | } | ||
1319 | } else | 1310 | } else |
1320 | goto err; | 1311 | goto err; |
1321 | } | 1312 | } |
@@ -1526,7 +1517,8 @@ static int mlx4_init_hca(struct mlx4_dev *dev) | |||
1526 | } else { | 1517 | } else { |
1527 | err = mlx4_init_slave(dev); | 1518 | err = mlx4_init_slave(dev); |
1528 | if (err) { | 1519 | if (err) { |
1529 | mlx4_err(dev, "Failed to initialize slave\n"); | 1520 | if (err != -EPROBE_DEFER) |
1521 | mlx4_err(dev, "Failed to initialize slave\n"); | ||
1530 | return err; | 1522 | return err; |
1531 | } | 1523 | } |
1532 | 1524 | ||
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 50235d201592..f87cc216045b 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -4717,6 +4717,7 @@ static int qlge_probe(struct pci_dev *pdev, | |||
4717 | dev_err(&pdev->dev, "net device registration failed.\n"); | 4717 | dev_err(&pdev->dev, "net device registration failed.\n"); |
4718 | ql_release_all(pdev); | 4718 | ql_release_all(pdev); |
4719 | pci_disable_device(pdev); | 4719 | pci_disable_device(pdev); |
4720 | free_netdev(ndev); | ||
4720 | return err; | 4721 | return err; |
4721 | } | 4722 | } |
4722 | /* Start up the timer to trigger EEH if | 4723 | /* Start up the timer to trigger EEH if |
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 919b983114e9..b7268b3dae77 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c | |||
@@ -946,7 +946,8 @@ static int xemaclite_open(struct net_device *dev) | |||
946 | phy_write(lp->phy_dev, MII_CTRL1000, 0); | 946 | phy_write(lp->phy_dev, MII_CTRL1000, 0); |
947 | 947 | ||
948 | /* Advertise only 10 and 100mbps full/half duplex speeds */ | 948 | /* Advertise only 10 and 100mbps full/half duplex speeds */ |
949 | phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL); | 949 | phy_write(lp->phy_dev, MII_ADVERTISE, ADVERTISE_ALL | |
950 | ADVERTISE_CSMA); | ||
950 | 951 | ||
951 | /* Restart auto negotiation */ | 952 | /* Restart auto negotiation */ |
952 | bmcr = phy_read(lp->phy_dev, MII_BMCR); | 953 | bmcr = phy_read(lp->phy_dev, MII_BMCR); |
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c index 088c55496191..ab2307b5d9a7 100644 --- a/drivers/net/hyperv/netvsc_drv.c +++ b/drivers/net/hyperv/netvsc_drv.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/inetdevice.h> | 31 | #include <linux/inetdevice.h> |
32 | #include <linux/etherdevice.h> | 32 | #include <linux/etherdevice.h> |
33 | #include <linux/skbuff.h> | 33 | #include <linux/skbuff.h> |
34 | #include <linux/if_vlan.h> | ||
34 | #include <linux/in.h> | 35 | #include <linux/in.h> |
35 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
36 | #include <net/arp.h> | 37 | #include <net/arp.h> |
@@ -284,7 +285,7 @@ int netvsc_recv_callback(struct hv_device *device_obj, | |||
284 | 285 | ||
285 | skb->protocol = eth_type_trans(skb, net); | 286 | skb->protocol = eth_type_trans(skb, net); |
286 | skb->ip_summed = CHECKSUM_NONE; | 287 | skb->ip_summed = CHECKSUM_NONE; |
287 | skb->vlan_tci = packet->vlan_tci; | 288 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), packet->vlan_tci); |
288 | 289 | ||
289 | net->stats.rx_packets++; | 290 | net->stats.rx_packets++; |
290 | net->stats.rx_bytes += packet->total_data_buflen; | 291 | net->stats.rx_bytes += packet->total_data_buflen; |
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index c14f14741b3f..38f0b312ff85 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c | |||
@@ -1044,7 +1044,7 @@ int phy_init_eee(struct phy_device *phydev, bool clk_stop_enable) | |||
1044 | adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv); | 1044 | adv = mmd_eee_adv_to_ethtool_adv_t(eee_adv); |
1045 | lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp); | 1045 | lp = mmd_eee_adv_to_ethtool_adv_t(eee_lp); |
1046 | idx = phy_find_setting(phydev->speed, phydev->duplex); | 1046 | idx = phy_find_setting(phydev->speed, phydev->duplex); |
1047 | if ((lp & adv & settings[idx].setting)) | 1047 | if (!(lp & adv & settings[idx].setting)) |
1048 | goto eee_exit; | 1048 | goto eee_exit; |
1049 | 1049 | ||
1050 | if (clk_stop_enable) { | 1050 | if (clk_stop_enable) { |
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 7c43261975bd..d016a76ad44b 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -2374,7 +2374,8 @@ static int team_nl_send_port_list_get(struct team *team, u32 portid, u32 seq, | |||
2374 | bool incomplete; | 2374 | bool incomplete; |
2375 | int i; | 2375 | int i; |
2376 | 2376 | ||
2377 | port = list_first_entry(&team->port_list, struct team_port, list); | 2377 | port = list_first_entry_or_null(&team->port_list, |
2378 | struct team_port, list); | ||
2378 | 2379 | ||
2379 | start_again: | 2380 | start_again: |
2380 | err = __send_and_alloc_skb(&skb, team, portid, send_func); | 2381 | err = __send_and_alloc_skb(&skb, team, portid, send_func); |
@@ -2402,8 +2403,8 @@ start_again: | |||
2402 | err = team_nl_fill_one_port_get(skb, one_port); | 2403 | err = team_nl_fill_one_port_get(skb, one_port); |
2403 | if (err) | 2404 | if (err) |
2404 | goto errout; | 2405 | goto errout; |
2405 | } else { | 2406 | } else if (port) { |
2406 | list_for_each_entry(port, &team->port_list, list) { | 2407 | list_for_each_entry_from(port, &team->port_list, list) { |
2407 | err = team_nl_fill_one_port_get(skb, port); | 2408 | err = team_nl_fill_one_port_get(skb, port); |
2408 | if (err) { | 2409 | if (err) { |
2409 | if (err == -EMSGSIZE) { | 2410 | if (err == -EMSGSIZE) { |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index f042b0373e5d..89776c592151 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1585,6 +1585,10 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
1585 | else | 1585 | else |
1586 | return -EINVAL; | 1586 | return -EINVAL; |
1587 | 1587 | ||
1588 | if (!!(ifr->ifr_flags & IFF_MULTI_QUEUE) != | ||
1589 | !!(tun->flags & TUN_TAP_MQ)) | ||
1590 | return -EINVAL; | ||
1591 | |||
1588 | if (tun_not_capable(tun)) | 1592 | if (tun_not_capable(tun)) |
1589 | return -EPERM; | 1593 | return -EPERM; |
1590 | err = security_tun_dev_open(tun->security); | 1594 | err = security_tun_dev_open(tun->security); |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 54ba42f4108a..874f6570bd1c 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | |||
@@ -68,13 +68,16 @@ | |||
68 | #define AR9300_BASE_ADDR 0x3ff | 68 | #define AR9300_BASE_ADDR 0x3ff |
69 | #define AR9300_BASE_ADDR_512 0x1ff | 69 | #define AR9300_BASE_ADDR_512 0x1ff |
70 | 70 | ||
71 | #define AR9300_OTP_BASE (AR_SREV_9340(ah) ? 0x30000 : 0x14000) | 71 | #define AR9300_OTP_BASE \ |
72 | #define AR9300_OTP_STATUS (AR_SREV_9340(ah) ? 0x30018 : 0x15f18) | 72 | ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) |
73 | #define AR9300_OTP_STATUS \ | ||
74 | ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30018 : 0x15f18) | ||
73 | #define AR9300_OTP_STATUS_TYPE 0x7 | 75 | #define AR9300_OTP_STATUS_TYPE 0x7 |
74 | #define AR9300_OTP_STATUS_VALID 0x4 | 76 | #define AR9300_OTP_STATUS_VALID 0x4 |
75 | #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 | 77 | #define AR9300_OTP_STATUS_ACCESS_BUSY 0x2 |
76 | #define AR9300_OTP_STATUS_SM_BUSY 0x1 | 78 | #define AR9300_OTP_STATUS_SM_BUSY 0x1 |
77 | #define AR9300_OTP_READ_DATA (AR_SREV_9340(ah) ? 0x3001c : 0x15f1c) | 79 | #define AR9300_OTP_READ_DATA \ |
80 | ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x3001c : 0x15f1c) | ||
78 | 81 | ||
79 | enum targetPowerHTRates { | 82 | enum targetPowerHTRates { |
80 | HT_TARGET_RATE_0_8_16, | 83 | HT_TARGET_RATE_0_8_16, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index 2bf6548dd143..e1714d7c9eeb 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -334,7 +334,8 @@ static void ar9003_hw_spur_ofdm(struct ath_hw *ah, | |||
334 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | 334 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, |
335 | AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 1); | 335 | AR_PHY_SPUR_REG_EN_VIT_SPUR_RSSI, 1); |
336 | 336 | ||
337 | if (REG_READ_FIELD(ah, AR_PHY_MODE, | 337 | if (!AR_SREV_9340(ah) && |
338 | REG_READ_FIELD(ah, AR_PHY_MODE, | ||
338 | AR_PHY_MODE_DYNAMIC) == 0x1) | 339 | AR_PHY_MODE_DYNAMIC) == 0x1) |
339 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, | 340 | REG_RMW_FIELD(ah, AR_PHY_SPUR_REG, |
340 | AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 1); | 341 | AR_PHY_SPUR_REG_ENABLE_NF_RSSI_SPUR_MIT, 1); |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 366002f266f8..42b03dc39d14 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -251,10 +251,9 @@ struct ath_atx_tid { | |||
251 | int tidno; | 251 | int tidno; |
252 | int baw_head; /* first un-acked tx buffer */ | 252 | int baw_head; /* first un-acked tx buffer */ |
253 | int baw_tail; /* next unused tx buffer slot */ | 253 | int baw_tail; /* next unused tx buffer slot */ |
254 | int sched; | 254 | bool sched; |
255 | int paused; | 255 | bool paused; |
256 | u8 state; | 256 | bool active; |
257 | bool stop_cb; | ||
258 | }; | 257 | }; |
259 | 258 | ||
260 | struct ath_node { | 259 | struct ath_node { |
@@ -275,10 +274,6 @@ struct ath_node { | |||
275 | #endif | 274 | #endif |
276 | }; | 275 | }; |
277 | 276 | ||
278 | #define AGGR_CLEANUP BIT(1) | ||
279 | #define AGGR_ADDBA_COMPLETE BIT(2) | ||
280 | #define AGGR_ADDBA_PROGRESS BIT(3) | ||
281 | |||
282 | struct ath_tx_control { | 277 | struct ath_tx_control { |
283 | struct ath_txq *txq; | 278 | struct ath_txq *txq; |
284 | struct ath_node *an; | 279 | struct ath_node *an; |
@@ -352,8 +347,7 @@ void ath_tx_tasklet(struct ath_softc *sc); | |||
352 | void ath_tx_edma_tasklet(struct ath_softc *sc); | 347 | void ath_tx_edma_tasklet(struct ath_softc *sc); |
353 | int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | 348 | int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, |
354 | u16 tid, u16 *ssn); | 349 | u16 tid, u16 *ssn); |
355 | bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid, | 350 | void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); |
356 | bool flush); | ||
357 | void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); | 351 | void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); |
358 | 352 | ||
359 | void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an); | 353 | void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an); |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 7f25da8444fe..15dfefcf2d0f 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1172,6 +1172,7 @@ u32 ath9k_regd_get_ctl(struct ath_regulatory *reg, struct ath9k_channel *chan) | |||
1172 | static inline void ath9k_hw_set_dma(struct ath_hw *ah) | 1172 | static inline void ath9k_hw_set_dma(struct ath_hw *ah) |
1173 | { | 1173 | { |
1174 | struct ath_common *common = ath9k_hw_common(ah); | 1174 | struct ath_common *common = ath9k_hw_common(ah); |
1175 | int txbuf_size; | ||
1175 | 1176 | ||
1176 | ENABLE_REGWRITE_BUFFER(ah); | 1177 | ENABLE_REGWRITE_BUFFER(ah); |
1177 | 1178 | ||
@@ -1225,13 +1226,17 @@ static inline void ath9k_hw_set_dma(struct ath_hw *ah) | |||
1225 | * So set the usable tx buf size also to half to | 1226 | * So set the usable tx buf size also to half to |
1226 | * avoid data/delimiter underruns | 1227 | * avoid data/delimiter underruns |
1227 | */ | 1228 | */ |
1228 | REG_WRITE(ah, AR_PCU_TXBUF_CTRL, | 1229 | txbuf_size = AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE; |
1229 | AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE); | 1230 | } else if (AR_SREV_9340_13_OR_LATER(ah)) { |
1230 | } else if (!AR_SREV_9271(ah)) { | 1231 | /* Uses fewer entries for AR934x v1.3+ to prevent rx overruns */ |
1231 | REG_WRITE(ah, AR_PCU_TXBUF_CTRL, | 1232 | txbuf_size = AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE; |
1232 | AR_PCU_TXBUF_CTRL_USABLE_SIZE); | 1233 | } else { |
1234 | txbuf_size = AR_PCU_TXBUF_CTRL_USABLE_SIZE; | ||
1233 | } | 1235 | } |
1234 | 1236 | ||
1237 | if (!AR_SREV_9271(ah)) | ||
1238 | REG_WRITE(ah, AR_PCU_TXBUF_CTRL, txbuf_size); | ||
1239 | |||
1235 | REGWRITE_BUFFER_FLUSH(ah); | 1240 | REGWRITE_BUFFER_FLUSH(ah); |
1236 | 1241 | ||
1237 | if (AR_SREV_9300_20_OR_LATER(ah)) | 1242 | if (AR_SREV_9300_20_OR_LATER(ah)) |
@@ -1306,9 +1311,13 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int type) | |||
1306 | AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET; | 1311 | AR_RTC_RC_COLD_RESET | AR_RTC_RC_WARM_RESET; |
1307 | } else { | 1312 | } else { |
1308 | tmpReg = REG_READ(ah, AR_INTR_SYNC_CAUSE); | 1313 | tmpReg = REG_READ(ah, AR_INTR_SYNC_CAUSE); |
1309 | if (tmpReg & | 1314 | if (AR_SREV_9340(ah)) |
1310 | (AR_INTR_SYNC_LOCAL_TIMEOUT | | 1315 | tmpReg &= AR9340_INTR_SYNC_LOCAL_TIMEOUT; |
1311 | AR_INTR_SYNC_RADM_CPL_TIMEOUT)) { | 1316 | else |
1317 | tmpReg &= AR_INTR_SYNC_LOCAL_TIMEOUT | | ||
1318 | AR_INTR_SYNC_RADM_CPL_TIMEOUT; | ||
1319 | |||
1320 | if (tmpReg) { | ||
1312 | u32 val; | 1321 | u32 val; |
1313 | REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0); | 1322 | REG_WRITE(ah, AR_INTR_SYNC_ENABLE, 0); |
1314 | 1323 | ||
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 498fee04afa0..566109a40fb3 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
@@ -410,7 +410,7 @@ bool ath9k_hw_resettxqueue(struct ath_hw *ah, u32 q) | |||
410 | 410 | ||
411 | REG_WRITE(ah, AR_QMISC(q), AR_Q_MISC_DCU_EARLY_TERM_REQ); | 411 | REG_WRITE(ah, AR_QMISC(q), AR_Q_MISC_DCU_EARLY_TERM_REQ); |
412 | 412 | ||
413 | if (AR_SREV_9340(ah)) | 413 | if (AR_SREV_9340(ah) && !AR_SREV_9340_13_OR_LATER(ah)) |
414 | REG_WRITE(ah, AR_DMISC(q), | 414 | REG_WRITE(ah, AR_DMISC(q), |
415 | AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1); | 415 | AR_D_MISC_CW_BKOFF_EN | AR_D_MISC_FRAG_WAIT_EN | 0x1); |
416 | else | 416 | else |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 2382d1262e7f..5092ecae7706 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1709,7 +1709,8 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw, | |||
1709 | flush = true; | 1709 | flush = true; |
1710 | case IEEE80211_AMPDU_TX_STOP_CONT: | 1710 | case IEEE80211_AMPDU_TX_STOP_CONT: |
1711 | ath9k_ps_wakeup(sc); | 1711 | ath9k_ps_wakeup(sc); |
1712 | if (ath_tx_aggr_stop(sc, sta, tid, flush)) | 1712 | ath_tx_aggr_stop(sc, sta, tid); |
1713 | if (!flush) | ||
1713 | ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); | 1714 | ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid); |
1714 | ath9k_ps_restore(sc); | 1715 | ath9k_ps_restore(sc); |
1715 | break; | 1716 | break; |
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c index aa4d368d8d3d..7eb1f4b458e4 100644 --- a/drivers/net/wireless/ath/ath9k/rc.c +++ b/drivers/net/wireless/ath/ath9k/rc.c | |||
@@ -1227,10 +1227,7 @@ static bool ath_tx_aggr_check(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
1227 | return false; | 1227 | return false; |
1228 | 1228 | ||
1229 | txtid = ATH_AN_2_TID(an, tidno); | 1229 | txtid = ATH_AN_2_TID(an, tidno); |
1230 | 1230 | return !txtid->active; | |
1231 | if (!(txtid->state & (AGGR_ADDBA_COMPLETE | AGGR_ADDBA_PROGRESS))) | ||
1232 | return true; | ||
1233 | return false; | ||
1234 | } | 1231 | } |
1235 | 1232 | ||
1236 | 1233 | ||
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 5c4ab5026dca..f7c90cc58d56 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -798,6 +798,10 @@ | |||
798 | #define AR_SREV_REVISION_9485_10 0 | 798 | #define AR_SREV_REVISION_9485_10 0 |
799 | #define AR_SREV_REVISION_9485_11 1 | 799 | #define AR_SREV_REVISION_9485_11 1 |
800 | #define AR_SREV_VERSION_9340 0x300 | 800 | #define AR_SREV_VERSION_9340 0x300 |
801 | #define AR_SREV_REVISION_9340_10 0 | ||
802 | #define AR_SREV_REVISION_9340_11 1 | ||
803 | #define AR_SREV_REVISION_9340_12 2 | ||
804 | #define AR_SREV_REVISION_9340_13 3 | ||
801 | #define AR_SREV_VERSION_9580 0x1C0 | 805 | #define AR_SREV_VERSION_9580 0x1C0 |
802 | #define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ | 806 | #define AR_SREV_REVISION_9580_10 4 /* AR9580 1.0 */ |
803 | #define AR_SREV_VERSION_9462 0x280 | 807 | #define AR_SREV_VERSION_9462 0x280 |
@@ -897,6 +901,10 @@ | |||
897 | #define AR_SREV_9340(_ah) \ | 901 | #define AR_SREV_9340(_ah) \ |
898 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340)) | 902 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9340)) |
899 | 903 | ||
904 | #define AR_SREV_9340_13_OR_LATER(_ah) \ | ||
905 | (AR_SREV_9340((_ah)) && \ | ||
906 | ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9340_13)) | ||
907 | |||
900 | #define AR_SREV_9285E_20(_ah) \ | 908 | #define AR_SREV_9285E_20(_ah) \ |
901 | (AR_SREV_9285_12_OR_LATER(_ah) && \ | 909 | (AR_SREV_9285_12_OR_LATER(_ah) && \ |
902 | ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) | 910 | ((REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) |
@@ -1007,6 +1015,8 @@ enum { | |||
1007 | AR_INTR_SYNC_LOCAL_TIMEOUT | | 1015 | AR_INTR_SYNC_LOCAL_TIMEOUT | |
1008 | AR_INTR_SYNC_MAC_SLEEP_ACCESS), | 1016 | AR_INTR_SYNC_MAC_SLEEP_ACCESS), |
1009 | 1017 | ||
1018 | AR9340_INTR_SYNC_LOCAL_TIMEOUT = 0x00000010, | ||
1019 | |||
1010 | AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF, | 1020 | AR_INTR_SYNC_SPURIOUS = 0xFFFFFFFF, |
1011 | 1021 | ||
1012 | }; | 1022 | }; |
@@ -1881,6 +1891,7 @@ enum { | |||
1881 | #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF | 1891 | #define AR_PCU_TXBUF_CTRL_SIZE_MASK 0x7FF |
1882 | #define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 | 1892 | #define AR_PCU_TXBUF_CTRL_USABLE_SIZE 0x700 |
1883 | #define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 | 1893 | #define AR_9285_PCU_TXBUF_CTRL_USABLE_SIZE 0x380 |
1894 | #define AR_9340_PCU_TXBUF_CTRL_USABLE_SIZE 0x500 | ||
1884 | 1895 | ||
1885 | #define AR_PCU_MISC_MODE2 0x8344 | 1896 | #define AR_PCU_MISC_MODE2 0x8344 |
1886 | #define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002 | 1897 | #define AR_PCU_MISC_MODE2_MGMT_CRYPTO_ENABLE 0x00000002 |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 14bb3354ea64..1c9b1bac8b0d 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -125,24 +125,6 @@ static void ath_tx_queue_tid(struct ath_txq *txq, struct ath_atx_tid *tid) | |||
125 | list_add_tail(&ac->list, &txq->axq_acq); | 125 | list_add_tail(&ac->list, &txq->axq_acq); |
126 | } | 126 | } |
127 | 127 | ||
128 | static void ath_tx_resume_tid(struct ath_softc *sc, struct ath_atx_tid *tid) | ||
129 | { | ||
130 | struct ath_txq *txq = tid->ac->txq; | ||
131 | |||
132 | WARN_ON(!tid->paused); | ||
133 | |||
134 | ath_txq_lock(sc, txq); | ||
135 | tid->paused = false; | ||
136 | |||
137 | if (skb_queue_empty(&tid->buf_q)) | ||
138 | goto unlock; | ||
139 | |||
140 | ath_tx_queue_tid(txq, tid); | ||
141 | ath_txq_schedule(sc, txq); | ||
142 | unlock: | ||
143 | ath_txq_unlock_complete(sc, txq); | ||
144 | } | ||
145 | |||
146 | static struct ath_frame_info *get_frame_info(struct sk_buff *skb) | 128 | static struct ath_frame_info *get_frame_info(struct sk_buff *skb) |
147 | { | 129 | { |
148 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 130 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
@@ -164,20 +146,7 @@ static void ath_set_rates(struct ieee80211_vif *vif, struct ieee80211_sta *sta, | |||
164 | ARRAY_SIZE(bf->rates)); | 146 | ARRAY_SIZE(bf->rates)); |
165 | } | 147 | } |
166 | 148 | ||
167 | static void ath_tx_clear_tid(struct ath_softc *sc, struct ath_atx_tid *tid) | 149 | static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) |
168 | { | ||
169 | tid->state &= ~AGGR_ADDBA_COMPLETE; | ||
170 | tid->state &= ~AGGR_CLEANUP; | ||
171 | if (!tid->stop_cb) | ||
172 | return; | ||
173 | |||
174 | ieee80211_start_tx_ba_cb_irqsafe(tid->an->vif, tid->an->sta->addr, | ||
175 | tid->tidno); | ||
176 | tid->stop_cb = false; | ||
177 | } | ||
178 | |||
179 | static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid, | ||
180 | bool flush_packets) | ||
181 | { | 150 | { |
182 | struct ath_txq *txq = tid->ac->txq; | 151 | struct ath_txq *txq = tid->ac->txq; |
183 | struct sk_buff *skb; | 152 | struct sk_buff *skb; |
@@ -194,15 +163,16 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid, | |||
194 | while ((skb = __skb_dequeue(&tid->buf_q))) { | 163 | while ((skb = __skb_dequeue(&tid->buf_q))) { |
195 | fi = get_frame_info(skb); | 164 | fi = get_frame_info(skb); |
196 | bf = fi->bf; | 165 | bf = fi->bf; |
197 | if (!bf && !flush_packets) | ||
198 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); | ||
199 | 166 | ||
200 | if (!bf) { | 167 | if (!bf) { |
201 | ieee80211_free_txskb(sc->hw, skb); | 168 | bf = ath_tx_setup_buffer(sc, txq, tid, skb); |
202 | continue; | 169 | if (!bf) { |
170 | ieee80211_free_txskb(sc->hw, skb); | ||
171 | continue; | ||
172 | } | ||
203 | } | 173 | } |
204 | 174 | ||
205 | if (fi->retries || flush_packets) { | 175 | if (fi->retries) { |
206 | list_add_tail(&bf->list, &bf_head); | 176 | list_add_tail(&bf->list, &bf_head); |
207 | ath_tx_update_baw(sc, tid, bf->bf_state.seqno); | 177 | ath_tx_update_baw(sc, tid, bf->bf_state.seqno); |
208 | ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); | 178 | ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); |
@@ -213,10 +183,7 @@ static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid, | |||
213 | } | 183 | } |
214 | } | 184 | } |
215 | 185 | ||
216 | if (tid->baw_head == tid->baw_tail) | 186 | if (sendbar) { |
217 | ath_tx_clear_tid(sc, tid); | ||
218 | |||
219 | if (sendbar && !flush_packets) { | ||
220 | ath_txq_unlock(sc, txq); | 187 | ath_txq_unlock(sc, txq); |
221 | ath_send_bar(tid, tid->seq_start); | 188 | ath_send_bar(tid, tid->seq_start); |
222 | ath_txq_lock(sc, txq); | 189 | ath_txq_lock(sc, txq); |
@@ -499,19 +466,19 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
499 | tx_info = IEEE80211_SKB_CB(skb); | 466 | tx_info = IEEE80211_SKB_CB(skb); |
500 | fi = get_frame_info(skb); | 467 | fi = get_frame_info(skb); |
501 | 468 | ||
502 | if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) { | 469 | if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) { |
470 | /* | ||
471 | * Outside of the current BlockAck window, | ||
472 | * maybe part of a previous session | ||
473 | */ | ||
474 | txfail = 1; | ||
475 | } else if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, seqno))) { | ||
503 | /* transmit completion, subframe is | 476 | /* transmit completion, subframe is |
504 | * acked by block ack */ | 477 | * acked by block ack */ |
505 | acked_cnt++; | 478 | acked_cnt++; |
506 | } else if (!isaggr && txok) { | 479 | } else if (!isaggr && txok) { |
507 | /* transmit completion */ | 480 | /* transmit completion */ |
508 | acked_cnt++; | 481 | acked_cnt++; |
509 | } else if (tid->state & AGGR_CLEANUP) { | ||
510 | /* | ||
511 | * cleanup in progress, just fail | ||
512 | * the un-acked sub-frames | ||
513 | */ | ||
514 | txfail = 1; | ||
515 | } else if (flush) { | 482 | } else if (flush) { |
516 | txpending = 1; | 483 | txpending = 1; |
517 | } else if (fi->retries < ATH_MAX_SW_RETRIES) { | 484 | } else if (fi->retries < ATH_MAX_SW_RETRIES) { |
@@ -535,7 +502,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
535 | if (bf_next != NULL || !bf_last->bf_stale) | 502 | if (bf_next != NULL || !bf_last->bf_stale) |
536 | list_move_tail(&bf->list, &bf_head); | 503 | list_move_tail(&bf->list, &bf_head); |
537 | 504 | ||
538 | if (!txpending || (tid->state & AGGR_CLEANUP)) { | 505 | if (!txpending) { |
539 | /* | 506 | /* |
540 | * complete the acked-ones/xretried ones; update | 507 | * complete the acked-ones/xretried ones; update |
541 | * block-ack window | 508 | * block-ack window |
@@ -609,9 +576,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, | |||
609 | ath_txq_lock(sc, txq); | 576 | ath_txq_lock(sc, txq); |
610 | } | 577 | } |
611 | 578 | ||
612 | if (tid->state & AGGR_CLEANUP) | ||
613 | ath_tx_flush_tid(sc, tid, false); | ||
614 | |||
615 | rcu_read_unlock(); | 579 | rcu_read_unlock(); |
616 | 580 | ||
617 | if (needreset) | 581 | if (needreset) |
@@ -1244,9 +1208,6 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
1244 | an = (struct ath_node *)sta->drv_priv; | 1208 | an = (struct ath_node *)sta->drv_priv; |
1245 | txtid = ATH_AN_2_TID(an, tid); | 1209 | txtid = ATH_AN_2_TID(an, tid); |
1246 | 1210 | ||
1247 | if (txtid->state & (AGGR_CLEANUP | AGGR_ADDBA_COMPLETE)) | ||
1248 | return -EAGAIN; | ||
1249 | |||
1250 | /* update ampdu factor/density, they may have changed. This may happen | 1211 | /* update ampdu factor/density, they may have changed. This may happen |
1251 | * in HT IBSS when a beacon with HT-info is received after the station | 1212 | * in HT IBSS when a beacon with HT-info is received after the station |
1252 | * has already been added. | 1213 | * has already been added. |
@@ -1258,7 +1219,7 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
1258 | an->mpdudensity = density; | 1219 | an->mpdudensity = density; |
1259 | } | 1220 | } |
1260 | 1221 | ||
1261 | txtid->state |= AGGR_ADDBA_PROGRESS; | 1222 | txtid->active = true; |
1262 | txtid->paused = true; | 1223 | txtid->paused = true; |
1263 | *ssn = txtid->seq_start = txtid->seq_next; | 1224 | *ssn = txtid->seq_start = txtid->seq_next; |
1264 | txtid->bar_index = -1; | 1225 | txtid->bar_index = -1; |
@@ -1269,45 +1230,17 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, | |||
1269 | return 0; | 1230 | return 0; |
1270 | } | 1231 | } |
1271 | 1232 | ||
1272 | bool ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid, | 1233 | void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) |
1273 | bool flush) | ||
1274 | { | 1234 | { |
1275 | struct ath_node *an = (struct ath_node *)sta->drv_priv; | 1235 | struct ath_node *an = (struct ath_node *)sta->drv_priv; |
1276 | struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); | 1236 | struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid); |
1277 | struct ath_txq *txq = txtid->ac->txq; | 1237 | struct ath_txq *txq = txtid->ac->txq; |
1278 | bool ret = !flush; | ||
1279 | |||
1280 | if (flush) | ||
1281 | txtid->stop_cb = false; | ||
1282 | |||
1283 | if (txtid->state & AGGR_CLEANUP) | ||
1284 | return false; | ||
1285 | |||
1286 | if (!(txtid->state & AGGR_ADDBA_COMPLETE)) { | ||
1287 | txtid->state &= ~AGGR_ADDBA_PROGRESS; | ||
1288 | return ret; | ||
1289 | } | ||
1290 | 1238 | ||
1291 | ath_txq_lock(sc, txq); | 1239 | ath_txq_lock(sc, txq); |
1240 | txtid->active = false; | ||
1292 | txtid->paused = true; | 1241 | txtid->paused = true; |
1293 | 1242 | ath_tx_flush_tid(sc, txtid); | |
1294 | /* | ||
1295 | * If frames are still being transmitted for this TID, they will be | ||
1296 | * cleaned up during tx completion. To prevent race conditions, this | ||
1297 | * TID can only be reused after all in-progress subframes have been | ||
1298 | * completed. | ||
1299 | */ | ||
1300 | if (txtid->baw_head != txtid->baw_tail) { | ||
1301 | txtid->state |= AGGR_CLEANUP; | ||
1302 | ret = false; | ||
1303 | txtid->stop_cb = !flush; | ||
1304 | } else { | ||
1305 | txtid->state &= ~AGGR_ADDBA_COMPLETE; | ||
1306 | } | ||
1307 | |||
1308 | ath_tx_flush_tid(sc, txtid, flush); | ||
1309 | ath_txq_unlock_complete(sc, txq); | 1243 | ath_txq_unlock_complete(sc, txq); |
1310 | return ret; | ||
1311 | } | 1244 | } |
1312 | 1245 | ||
1313 | void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, | 1246 | void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, |
@@ -1371,18 +1304,28 @@ void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an) | |||
1371 | } | 1304 | } |
1372 | } | 1305 | } |
1373 | 1306 | ||
1374 | void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) | 1307 | void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, |
1308 | u16 tidno) | ||
1375 | { | 1309 | { |
1376 | struct ath_atx_tid *txtid; | 1310 | struct ath_atx_tid *tid; |
1377 | struct ath_node *an; | 1311 | struct ath_node *an; |
1312 | struct ath_txq *txq; | ||
1378 | 1313 | ||
1379 | an = (struct ath_node *)sta->drv_priv; | 1314 | an = (struct ath_node *)sta->drv_priv; |
1315 | tid = ATH_AN_2_TID(an, tidno); | ||
1316 | txq = tid->ac->txq; | ||
1380 | 1317 | ||
1381 | txtid = ATH_AN_2_TID(an, tid); | 1318 | ath_txq_lock(sc, txq); |
1382 | txtid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; | 1319 | |
1383 | txtid->state |= AGGR_ADDBA_COMPLETE; | 1320 | tid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; |
1384 | txtid->state &= ~AGGR_ADDBA_PROGRESS; | 1321 | tid->paused = false; |
1385 | ath_tx_resume_tid(sc, txtid); | 1322 | |
1323 | if (!skb_queue_empty(&tid->buf_q)) { | ||
1324 | ath_tx_queue_tid(txq, tid); | ||
1325 | ath_txq_schedule(sc, txq); | ||
1326 | } | ||
1327 | |||
1328 | ath_txq_unlock_complete(sc, txq); | ||
1386 | } | 1329 | } |
1387 | 1330 | ||
1388 | /********************/ | 1331 | /********************/ |
@@ -2431,13 +2374,10 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) | |||
2431 | tid->baw_head = tid->baw_tail = 0; | 2374 | tid->baw_head = tid->baw_tail = 0; |
2432 | tid->sched = false; | 2375 | tid->sched = false; |
2433 | tid->paused = false; | 2376 | tid->paused = false; |
2434 | tid->state &= ~AGGR_CLEANUP; | 2377 | tid->active = false; |
2435 | __skb_queue_head_init(&tid->buf_q); | 2378 | __skb_queue_head_init(&tid->buf_q); |
2436 | acno = TID_TO_WME_AC(tidno); | 2379 | acno = TID_TO_WME_AC(tidno); |
2437 | tid->ac = &an->ac[acno]; | 2380 | tid->ac = &an->ac[acno]; |
2438 | tid->state &= ~AGGR_ADDBA_COMPLETE; | ||
2439 | tid->state &= ~AGGR_ADDBA_PROGRESS; | ||
2440 | tid->stop_cb = false; | ||
2441 | } | 2381 | } |
2442 | 2382 | ||
2443 | for (acno = 0, ac = &an->ac[acno]; | 2383 | for (acno = 0, ac = &an->ac[acno]; |
@@ -2474,7 +2414,7 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) | |||
2474 | } | 2414 | } |
2475 | 2415 | ||
2476 | ath_tid_drain(sc, txq, tid); | 2416 | ath_tid_drain(sc, txq, tid); |
2477 | ath_tx_clear_tid(sc, tid); | 2417 | tid->active = false; |
2478 | 2418 | ||
2479 | ath_txq_unlock(sc, txq); | 2419 | ath_txq_unlock(sc, txq); |
2480 | } | 2420 | } |
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c index 830bb1d1f957..b827d51c30a3 100644 --- a/drivers/net/wireless/atmel.c +++ b/drivers/net/wireless/atmel.c | |||
@@ -1624,7 +1624,7 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port, | |||
1624 | 1624 | ||
1625 | netif_carrier_off(dev); | 1625 | netif_carrier_off(dev); |
1626 | 1626 | ||
1627 | if (!proc_create_data("driver/atmel", 0, NULL, &atmel_proc_fops, priv)); | 1627 | if (!proc_create_data("driver/atmel", 0, NULL, &atmel_proc_fops, priv)) |
1628 | printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); | 1628 | printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); |
1629 | 1629 | ||
1630 | printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %pM\n", | 1630 | printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %pM\n", |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c index be0787cab24f..9431af2465f3 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c | |||
@@ -27,7 +27,6 @@ | |||
27 | #include "tracepoint.h" | 27 | #include "tracepoint.h" |
28 | 28 | ||
29 | #define PKTFILTER_BUF_SIZE 128 | 29 | #define PKTFILTER_BUF_SIZE 128 |
30 | #define BRCMF_ARPOL_MODE 0xb /* agent|snoop|peer_autoreply */ | ||
31 | #define BRCMF_DEFAULT_BCN_TIMEOUT 3 | 30 | #define BRCMF_DEFAULT_BCN_TIMEOUT 3 |
32 | #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 | 31 | #define BRCMF_DEFAULT_SCAN_CHANNEL_TIME 40 |
33 | #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40 | 32 | #define BRCMF_DEFAULT_SCAN_UNASSOC_TIME 40 |
@@ -338,23 +337,6 @@ int brcmf_c_preinit_dcmds(struct brcmf_if *ifp) | |||
338 | goto done; | 337 | goto done; |
339 | } | 338 | } |
340 | 339 | ||
341 | /* Try to set and enable ARP offload feature, this may fail */ | ||
342 | err = brcmf_fil_iovar_int_set(ifp, "arp_ol", BRCMF_ARPOL_MODE); | ||
343 | if (err) { | ||
344 | brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", | ||
345 | BRCMF_ARPOL_MODE, err); | ||
346 | err = 0; | ||
347 | } else { | ||
348 | err = brcmf_fil_iovar_int_set(ifp, "arpoe", 1); | ||
349 | if (err) { | ||
350 | brcmf_dbg(TRACE, "failed to enable ARP offload err = %d\n", | ||
351 | err); | ||
352 | err = 0; | ||
353 | } else | ||
354 | brcmf_dbg(TRACE, "successfully enabled ARP offload to 0x%x\n", | ||
355 | BRCMF_ARPOL_MODE); | ||
356 | } | ||
357 | |||
358 | /* Setup packet filter */ | 340 | /* Setup packet filter */ |
359 | brcmf_c_pktfilter_offload_set(ifp, BRCMF_DEFAULT_PACKET_FILTER); | 341 | brcmf_c_pktfilter_offload_set(ifp, BRCMF_DEFAULT_PACKET_FILTER); |
360 | brcmf_c_pktfilter_offload_enable(ifp, BRCMF_DEFAULT_PACKET_FILTER, | 342 | brcmf_c_pktfilter_offload_enable(ifp, BRCMF_DEFAULT_PACKET_FILTER, |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c index 59c25463e428..b98f2235978e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c | |||
@@ -653,10 +653,13 @@ int brcmf_net_attach(struct brcmf_if *ifp, bool rtnl_locked) | |||
653 | 653 | ||
654 | brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name); | 654 | brcmf_dbg(INFO, "%s: Broadcom Dongle Host Driver\n", ndev->name); |
655 | 655 | ||
656 | ndev->destructor = free_netdev; | ||
656 | return 0; | 657 | return 0; |
657 | 658 | ||
658 | fail: | 659 | fail: |
660 | drvr->iflist[ifp->bssidx] = NULL; | ||
659 | ndev->netdev_ops = NULL; | 661 | ndev->netdev_ops = NULL; |
662 | free_netdev(ndev); | ||
660 | return -EBADE; | 663 | return -EBADE; |
661 | } | 664 | } |
662 | 665 | ||
@@ -720,6 +723,9 @@ static int brcmf_net_p2p_attach(struct brcmf_if *ifp) | |||
720 | return 0; | 723 | return 0; |
721 | 724 | ||
722 | fail: | 725 | fail: |
726 | ifp->drvr->iflist[ifp->bssidx] = NULL; | ||
727 | ndev->netdev_ops = NULL; | ||
728 | free_netdev(ndev); | ||
723 | return -EBADE; | 729 | return -EBADE; |
724 | } | 730 | } |
725 | 731 | ||
@@ -788,6 +794,7 @@ void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx) | |||
788 | struct brcmf_if *ifp; | 794 | struct brcmf_if *ifp; |
789 | 795 | ||
790 | ifp = drvr->iflist[bssidx]; | 796 | ifp = drvr->iflist[bssidx]; |
797 | drvr->iflist[bssidx] = NULL; | ||
791 | if (!ifp) { | 798 | if (!ifp) { |
792 | brcmf_err("Null interface, idx=%d\n", bssidx); | 799 | brcmf_err("Null interface, idx=%d\n", bssidx); |
793 | return; | 800 | return; |
@@ -808,15 +815,13 @@ void brcmf_del_if(struct brcmf_pub *drvr, s32 bssidx) | |||
808 | cancel_work_sync(&ifp->setmacaddr_work); | 815 | cancel_work_sync(&ifp->setmacaddr_work); |
809 | cancel_work_sync(&ifp->multicast_work); | 816 | cancel_work_sync(&ifp->multicast_work); |
810 | } | 817 | } |
811 | 818 | /* unregister will take care of freeing it */ | |
812 | unregister_netdev(ifp->ndev); | 819 | unregister_netdev(ifp->ndev); |
813 | if (bssidx == 0) | 820 | if (bssidx == 0) |
814 | brcmf_cfg80211_detach(drvr->config); | 821 | brcmf_cfg80211_detach(drvr->config); |
815 | free_netdev(ifp->ndev); | ||
816 | } else { | 822 | } else { |
817 | kfree(ifp); | 823 | kfree(ifp); |
818 | } | 824 | } |
819 | drvr->iflist[bssidx] = NULL; | ||
820 | } | 825 | } |
821 | 826 | ||
822 | int brcmf_attach(uint bus_hdrlen, struct device *dev) | 827 | int brcmf_attach(uint bus_hdrlen, struct device *dev) |
@@ -925,8 +930,6 @@ fail: | |||
925 | brcmf_fws_del_interface(ifp); | 930 | brcmf_fws_del_interface(ifp); |
926 | brcmf_fws_deinit(drvr); | 931 | brcmf_fws_deinit(drvr); |
927 | } | 932 | } |
928 | free_netdev(ifp->ndev); | ||
929 | drvr->iflist[0] = NULL; | ||
930 | if (p2p_ifp) { | 933 | if (p2p_ifp) { |
931 | free_netdev(p2p_ifp->ndev); | 934 | free_netdev(p2p_ifp->ndev); |
932 | drvr->iflist[1] = NULL; | 935 | drvr->iflist[1] = NULL; |
@@ -934,7 +937,8 @@ fail: | |||
934 | return ret; | 937 | return ret; |
935 | } | 938 | } |
936 | if ((brcmf_p2p_enable) && (p2p_ifp)) | 939 | if ((brcmf_p2p_enable) && (p2p_ifp)) |
937 | brcmf_net_p2p_attach(p2p_ifp); | 940 | if (brcmf_net_p2p_attach(p2p_ifp) < 0) |
941 | brcmf_p2p_enable = 0; | ||
938 | 942 | ||
939 | return 0; | 943 | return 0; |
940 | } | 944 | } |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c index 5a64280e6485..83ee53a7c76e 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/fweh.c | |||
@@ -202,7 +202,8 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, | |||
202 | return; | 202 | return; |
203 | brcmf_fws_add_interface(ifp); | 203 | brcmf_fws_add_interface(ifp); |
204 | if (!drvr->fweh.evt_handler[BRCMF_E_IF]) | 204 | if (!drvr->fweh.evt_handler[BRCMF_E_IF]) |
205 | err = brcmf_net_attach(ifp, false); | 205 | if (brcmf_net_attach(ifp, false) < 0) |
206 | return; | ||
206 | } | 207 | } |
207 | 208 | ||
208 | if (ifevent->action == BRCMF_E_IF_CHANGE) | 209 | if (ifevent->action == BRCMF_E_IF_CHANGE) |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h index 0f2c83bc95dc..665ef69e974b 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/fwil_types.h | |||
@@ -23,6 +23,12 @@ | |||
23 | 23 | ||
24 | #define BRCMF_FIL_ACTION_FRAME_SIZE 1800 | 24 | #define BRCMF_FIL_ACTION_FRAME_SIZE 1800 |
25 | 25 | ||
26 | /* ARP Offload feature flags for arp_ol iovar */ | ||
27 | #define BRCMF_ARP_OL_AGENT 0x00000001 | ||
28 | #define BRCMF_ARP_OL_SNOOP 0x00000002 | ||
29 | #define BRCMF_ARP_OL_HOST_AUTO_REPLY 0x00000004 | ||
30 | #define BRCMF_ARP_OL_PEER_AUTO_REPLY 0x00000008 | ||
31 | |||
26 | 32 | ||
27 | enum brcmf_fil_p2p_if_types { | 33 | enum brcmf_fil_p2p_if_types { |
28 | BRCMF_FIL_P2P_IF_CLIENT, | 34 | BRCMF_FIL_P2P_IF_CLIENT, |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c index e7a1a4770996..79555f006d53 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/p2p.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/p2p.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #define IS_P2P_SOCIAL_CHANNEL(channel) ((channel == SOCIAL_CHAN_1) || \ | 47 | #define IS_P2P_SOCIAL_CHANNEL(channel) ((channel == SOCIAL_CHAN_1) || \ |
48 | (channel == SOCIAL_CHAN_2) || \ | 48 | (channel == SOCIAL_CHAN_2) || \ |
49 | (channel == SOCIAL_CHAN_3)) | 49 | (channel == SOCIAL_CHAN_3)) |
50 | #define BRCMF_P2P_TEMP_CHAN SOCIAL_CHAN_3 | ||
50 | #define SOCIAL_CHAN_CNT 3 | 51 | #define SOCIAL_CHAN_CNT 3 |
51 | #define AF_PEER_SEARCH_CNT 2 | 52 | #define AF_PEER_SEARCH_CNT 2 |
52 | 53 | ||
@@ -1954,21 +1955,21 @@ s32 brcmf_p2p_attach(struct brcmf_cfg80211_info *cfg) | |||
1954 | err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); | 1955 | err = brcmf_fil_iovar_int_set(pri_ifp, "p2p_disc", 1); |
1955 | if (err < 0) { | 1956 | if (err < 0) { |
1956 | brcmf_err("set p2p_disc error\n"); | 1957 | brcmf_err("set p2p_disc error\n"); |
1957 | brcmf_free_vif(p2p_vif); | 1958 | brcmf_free_vif(cfg, p2p_vif); |
1958 | goto exit; | 1959 | goto exit; |
1959 | } | 1960 | } |
1960 | /* obtain bsscfg index for P2P discovery */ | 1961 | /* obtain bsscfg index for P2P discovery */ |
1961 | err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); | 1962 | err = brcmf_fil_iovar_int_get(pri_ifp, "p2p_dev", &bssidx); |
1962 | if (err < 0) { | 1963 | if (err < 0) { |
1963 | brcmf_err("retrieving discover bsscfg index failed\n"); | 1964 | brcmf_err("retrieving discover bsscfg index failed\n"); |
1964 | brcmf_free_vif(p2p_vif); | 1965 | brcmf_free_vif(cfg, p2p_vif); |
1965 | goto exit; | 1966 | goto exit; |
1966 | } | 1967 | } |
1967 | /* Verify that firmware uses same bssidx as driver !! */ | 1968 | /* Verify that firmware uses same bssidx as driver !! */ |
1968 | if (p2p_ifp->bssidx != bssidx) { | 1969 | if (p2p_ifp->bssidx != bssidx) { |
1969 | brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n", | 1970 | brcmf_err("Incorrect bssidx=%d, compared to p2p_ifp->bssidx=%d\n", |
1970 | bssidx, p2p_ifp->bssidx); | 1971 | bssidx, p2p_ifp->bssidx); |
1971 | brcmf_free_vif(p2p_vif); | 1972 | brcmf_free_vif(cfg, p2p_vif); |
1972 | goto exit; | 1973 | goto exit; |
1973 | } | 1974 | } |
1974 | 1975 | ||
@@ -1996,7 +1997,7 @@ void brcmf_p2p_detach(struct brcmf_p2p_info *p2p) | |||
1996 | brcmf_p2p_cancel_remain_on_channel(vif->ifp); | 1997 | brcmf_p2p_cancel_remain_on_channel(vif->ifp); |
1997 | brcmf_p2p_deinit_discovery(p2p); | 1998 | brcmf_p2p_deinit_discovery(p2p); |
1998 | /* remove discovery interface */ | 1999 | /* remove discovery interface */ |
1999 | brcmf_free_vif(vif); | 2000 | brcmf_free_vif(p2p->cfg, vif); |
2000 | p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; | 2001 | p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; |
2001 | } | 2002 | } |
2002 | /* just set it all to zero */ | 2003 | /* just set it all to zero */ |
@@ -2013,17 +2014,30 @@ static void brcmf_p2p_get_current_chanspec(struct brcmf_p2p_info *p2p, | |||
2013 | u16 *chanspec) | 2014 | u16 *chanspec) |
2014 | { | 2015 | { |
2015 | struct brcmf_if *ifp; | 2016 | struct brcmf_if *ifp; |
2016 | struct brcmf_fil_chan_info_le ci; | 2017 | u8 mac_addr[ETH_ALEN]; |
2017 | struct brcmu_chan ch; | 2018 | struct brcmu_chan ch; |
2018 | s32 err; | 2019 | struct brcmf_bss_info_le *bi; |
2020 | u8 *buf; | ||
2019 | 2021 | ||
2020 | ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; | 2022 | ifp = p2p->bss_idx[P2PAPI_BSSCFG_PRIMARY].vif->ifp; |
2021 | 2023 | ||
2022 | ch.chnum = 11; | 2024 | if (brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSSID, mac_addr, |
2023 | 2025 | ETH_ALEN) == 0) { | |
2024 | err = brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_CHANNEL, &ci, sizeof(ci)); | 2026 | buf = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL); |
2025 | if (!err) | 2027 | if (buf != NULL) { |
2026 | ch.chnum = le32_to_cpu(ci.hw_channel); | 2028 | *(__le32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX); |
2029 | if (brcmf_fil_cmd_data_get(ifp, BRCMF_C_GET_BSS_INFO, | ||
2030 | buf, WL_BSS_INFO_MAX) == 0) { | ||
2031 | bi = (struct brcmf_bss_info_le *)(buf + 4); | ||
2032 | *chanspec = le16_to_cpu(bi->chanspec); | ||
2033 | kfree(buf); | ||
2034 | return; | ||
2035 | } | ||
2036 | kfree(buf); | ||
2037 | } | ||
2038 | } | ||
2039 | /* Use default channel for P2P */ | ||
2040 | ch.chnum = BRCMF_P2P_TEMP_CHAN; | ||
2027 | ch.bw = BRCMU_CHAN_BW_20; | 2041 | ch.bw = BRCMU_CHAN_BW_20; |
2028 | p2p->cfg->d11inf.encchspec(&ch); | 2042 | p2p->cfg->d11inf.encchspec(&ch); |
2029 | *chanspec = ch.chspec; | 2043 | *chanspec = ch.chspec; |
@@ -2208,7 +2222,7 @@ static struct wireless_dev *brcmf_p2p_create_p2pdev(struct brcmf_p2p_info *p2p, | |||
2208 | return &p2p_vif->wdev; | 2222 | return &p2p_vif->wdev; |
2209 | 2223 | ||
2210 | fail: | 2224 | fail: |
2211 | brcmf_free_vif(p2p_vif); | 2225 | brcmf_free_vif(p2p->cfg, p2p_vif); |
2212 | return ERR_PTR(err); | 2226 | return ERR_PTR(err); |
2213 | } | 2227 | } |
2214 | 2228 | ||
@@ -2217,13 +2231,31 @@ fail: | |||
2217 | * | 2231 | * |
2218 | * @vif: virtual interface object to delete. | 2232 | * @vif: virtual interface object to delete. |
2219 | */ | 2233 | */ |
2220 | static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_vif *vif) | 2234 | static void brcmf_p2p_delete_p2pdev(struct brcmf_cfg80211_info *cfg, |
2235 | struct brcmf_cfg80211_vif *vif) | ||
2221 | { | 2236 | { |
2222 | struct brcmf_p2p_info *p2p = &vif->ifp->drvr->config->p2p; | ||
2223 | |||
2224 | cfg80211_unregister_wdev(&vif->wdev); | 2237 | cfg80211_unregister_wdev(&vif->wdev); |
2225 | p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; | 2238 | cfg->p2p.bss_idx[P2PAPI_BSSCFG_DEVICE].vif = NULL; |
2226 | brcmf_free_vif(vif); | 2239 | brcmf_free_vif(cfg, vif); |
2240 | } | ||
2241 | |||
2242 | /** | ||
2243 | * brcmf_p2p_free_p2p_if() - free up net device related data. | ||
2244 | * | ||
2245 | * @ndev: net device that needs to be freed. | ||
2246 | */ | ||
2247 | static void brcmf_p2p_free_p2p_if(struct net_device *ndev) | ||
2248 | { | ||
2249 | struct brcmf_cfg80211_info *cfg; | ||
2250 | struct brcmf_cfg80211_vif *vif; | ||
2251 | struct brcmf_if *ifp; | ||
2252 | |||
2253 | ifp = netdev_priv(ndev); | ||
2254 | cfg = ifp->drvr->config; | ||
2255 | vif = ifp->vif; | ||
2256 | |||
2257 | brcmf_free_vif(cfg, vif); | ||
2258 | free_netdev(ifp->ndev); | ||
2227 | } | 2259 | } |
2228 | 2260 | ||
2229 | /** | 2261 | /** |
@@ -2303,6 +2335,9 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name, | |||
2303 | brcmf_err("Registering netdevice failed\n"); | 2335 | brcmf_err("Registering netdevice failed\n"); |
2304 | goto fail; | 2336 | goto fail; |
2305 | } | 2337 | } |
2338 | /* override destructor */ | ||
2339 | ifp->ndev->destructor = brcmf_p2p_free_p2p_if; | ||
2340 | |||
2306 | cfg->p2p.bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = vif; | 2341 | cfg->p2p.bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = vif; |
2307 | /* Disable firmware roaming for P2P interface */ | 2342 | /* Disable firmware roaming for P2P interface */ |
2308 | brcmf_fil_iovar_int_set(ifp, "roam_off", 1); | 2343 | brcmf_fil_iovar_int_set(ifp, "roam_off", 1); |
@@ -2314,7 +2349,7 @@ struct wireless_dev *brcmf_p2p_add_vif(struct wiphy *wiphy, const char *name, | |||
2314 | return &ifp->vif->wdev; | 2349 | return &ifp->vif->wdev; |
2315 | 2350 | ||
2316 | fail: | 2351 | fail: |
2317 | brcmf_free_vif(vif); | 2352 | brcmf_free_vif(cfg, vif); |
2318 | return ERR_PTR(err); | 2353 | return ERR_PTR(err); |
2319 | } | 2354 | } |
2320 | 2355 | ||
@@ -2350,7 +2385,7 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
2350 | break; | 2385 | break; |
2351 | 2386 | ||
2352 | case NL80211_IFTYPE_P2P_DEVICE: | 2387 | case NL80211_IFTYPE_P2P_DEVICE: |
2353 | brcmf_p2p_delete_p2pdev(vif); | 2388 | brcmf_p2p_delete_p2pdev(cfg, vif); |
2354 | return 0; | 2389 | return 0; |
2355 | default: | 2390 | default: |
2356 | return -ENOTSUPP; | 2391 | return -ENOTSUPP; |
@@ -2378,7 +2413,6 @@ int brcmf_p2p_del_vif(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
2378 | err = 0; | 2413 | err = 0; |
2379 | } | 2414 | } |
2380 | brcmf_cfg80211_arm_vif_event(cfg, NULL); | 2415 | brcmf_cfg80211_arm_vif_event(cfg, NULL); |
2381 | brcmf_free_vif(vif); | ||
2382 | p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; | 2416 | p2p->bss_idx[P2PAPI_BSSCFG_CONNECTION].vif = NULL; |
2383 | 2417 | ||
2384 | return err; | 2418 | return err; |
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c index 761f501959a9..301e572e8923 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | |||
@@ -459,6 +459,38 @@ send_key_to_dongle(struct net_device *ndev, struct brcmf_wsec_key *key) | |||
459 | return err; | 459 | return err; |
460 | } | 460 | } |
461 | 461 | ||
462 | static s32 | ||
463 | brcmf_configure_arp_offload(struct brcmf_if *ifp, bool enable) | ||
464 | { | ||
465 | s32 err; | ||
466 | u32 mode; | ||
467 | |||
468 | if (enable) | ||
469 | mode = BRCMF_ARP_OL_AGENT | BRCMF_ARP_OL_PEER_AUTO_REPLY; | ||
470 | else | ||
471 | mode = 0; | ||
472 | |||
473 | /* Try to set and enable ARP offload feature, this may fail, then it */ | ||
474 | /* is simply not supported and err 0 will be returned */ | ||
475 | err = brcmf_fil_iovar_int_set(ifp, "arp_ol", mode); | ||
476 | if (err) { | ||
477 | brcmf_dbg(TRACE, "failed to set ARP offload mode to 0x%x, err = %d\n", | ||
478 | mode, err); | ||
479 | err = 0; | ||
480 | } else { | ||
481 | err = brcmf_fil_iovar_int_set(ifp, "arpoe", enable); | ||
482 | if (err) { | ||
483 | brcmf_dbg(TRACE, "failed to configure (%d) ARP offload err = %d\n", | ||
484 | enable, err); | ||
485 | err = 0; | ||
486 | } else | ||
487 | brcmf_dbg(TRACE, "successfully configured (%d) ARP offload to 0x%x\n", | ||
488 | enable, mode); | ||
489 | } | ||
490 | |||
491 | return err; | ||
492 | } | ||
493 | |||
462 | static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy, | 494 | static struct wireless_dev *brcmf_cfg80211_add_iface(struct wiphy *wiphy, |
463 | const char *name, | 495 | const char *name, |
464 | enum nl80211_iftype type, | 496 | enum nl80211_iftype type, |
@@ -2216,6 +2248,11 @@ brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *ndev, | |||
2216 | } | 2248 | } |
2217 | 2249 | ||
2218 | pm = enabled ? PM_FAST : PM_OFF; | 2250 | pm = enabled ? PM_FAST : PM_OFF; |
2251 | /* Do not enable the power save after assoc if it is a p2p interface */ | ||
2252 | if (ifp->vif->wdev.iftype == NL80211_IFTYPE_P2P_CLIENT) { | ||
2253 | brcmf_dbg(INFO, "Do not enable power save for P2P clients\n"); | ||
2254 | pm = PM_OFF; | ||
2255 | } | ||
2219 | brcmf_dbg(INFO, "power save %s\n", (pm ? "enabled" : "disabled")); | 2256 | brcmf_dbg(INFO, "power save %s\n", (pm ? "enabled" : "disabled")); |
2220 | 2257 | ||
2221 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); | 2258 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_PM, pm); |
@@ -3640,10 +3677,28 @@ brcmf_config_ap_mgmt_ie(struct brcmf_cfg80211_vif *vif, | |||
3640 | } | 3677 | } |
3641 | 3678 | ||
3642 | static s32 | 3679 | static s32 |
3680 | brcmf_cfg80211_set_channel(struct brcmf_cfg80211_info *cfg, | ||
3681 | struct brcmf_if *ifp, | ||
3682 | struct ieee80211_channel *channel) | ||
3683 | { | ||
3684 | u16 chanspec; | ||
3685 | s32 err; | ||
3686 | |||
3687 | brcmf_dbg(TRACE, "band=%d, center_freq=%d\n", channel->band, | ||
3688 | channel->center_freq); | ||
3689 | |||
3690 | chanspec = channel_to_chanspec(&cfg->d11inf, channel); | ||
3691 | err = brcmf_fil_iovar_int_set(ifp, "chanspec", chanspec); | ||
3692 | |||
3693 | return err; | ||
3694 | } | ||
3695 | |||
3696 | static s32 | ||
3643 | brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | 3697 | brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, |
3644 | struct cfg80211_ap_settings *settings) | 3698 | struct cfg80211_ap_settings *settings) |
3645 | { | 3699 | { |
3646 | s32 ie_offset; | 3700 | s32 ie_offset; |
3701 | struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); | ||
3647 | struct brcmf_if *ifp = netdev_priv(ndev); | 3702 | struct brcmf_if *ifp = netdev_priv(ndev); |
3648 | struct brcmf_tlv *ssid_ie; | 3703 | struct brcmf_tlv *ssid_ie; |
3649 | struct brcmf_ssid_le ssid_le; | 3704 | struct brcmf_ssid_le ssid_le; |
@@ -3683,6 +3738,7 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
3683 | } | 3738 | } |
3684 | 3739 | ||
3685 | brcmf_set_mpc(ifp, 0); | 3740 | brcmf_set_mpc(ifp, 0); |
3741 | brcmf_configure_arp_offload(ifp, false); | ||
3686 | 3742 | ||
3687 | /* find the RSN_IE */ | 3743 | /* find the RSN_IE */ |
3688 | rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, | 3744 | rsn_ie = brcmf_parse_tlvs((u8 *)settings->beacon.tail, |
@@ -3713,6 +3769,12 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
3713 | 3769 | ||
3714 | brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon); | 3770 | brcmf_config_ap_mgmt_ie(ifp->vif, &settings->beacon); |
3715 | 3771 | ||
3772 | err = brcmf_cfg80211_set_channel(cfg, ifp, settings->chandef.chan); | ||
3773 | if (err < 0) { | ||
3774 | brcmf_err("Set Channel failed, %d\n", err); | ||
3775 | goto exit; | ||
3776 | } | ||
3777 | |||
3716 | if (settings->beacon_interval) { | 3778 | if (settings->beacon_interval) { |
3717 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, | 3779 | err = brcmf_fil_cmd_int_set(ifp, BRCMF_C_SET_BCNPRD, |
3718 | settings->beacon_interval); | 3780 | settings->beacon_interval); |
@@ -3789,8 +3851,10 @@ brcmf_cfg80211_start_ap(struct wiphy *wiphy, struct net_device *ndev, | |||
3789 | set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); | 3851 | set_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); |
3790 | 3852 | ||
3791 | exit: | 3853 | exit: |
3792 | if (err) | 3854 | if (err) { |
3793 | brcmf_set_mpc(ifp, 1); | 3855 | brcmf_set_mpc(ifp, 1); |
3856 | brcmf_configure_arp_offload(ifp, true); | ||
3857 | } | ||
3794 | return err; | 3858 | return err; |
3795 | } | 3859 | } |
3796 | 3860 | ||
@@ -3831,6 +3895,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev) | |||
3831 | brcmf_err("bss_enable config failed %d\n", err); | 3895 | brcmf_err("bss_enable config failed %d\n", err); |
3832 | } | 3896 | } |
3833 | brcmf_set_mpc(ifp, 1); | 3897 | brcmf_set_mpc(ifp, 1); |
3898 | brcmf_configure_arp_offload(ifp, true); | ||
3834 | set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); | 3899 | set_bit(BRCMF_VIF_STATUS_AP_CREATING, &ifp->vif->sme_state); |
3835 | clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); | 3900 | clear_bit(BRCMF_VIF_STATUS_AP_CREATED, &ifp->vif->sme_state); |
3836 | 3901 | ||
@@ -4148,7 +4213,7 @@ static const struct ieee80211_iface_limit brcmf_iface_limits[] = { | |||
4148 | static const struct ieee80211_iface_combination brcmf_iface_combos[] = { | 4213 | static const struct ieee80211_iface_combination brcmf_iface_combos[] = { |
4149 | { | 4214 | { |
4150 | .max_interfaces = BRCMF_IFACE_MAX_CNT, | 4215 | .max_interfaces = BRCMF_IFACE_MAX_CNT, |
4151 | .num_different_channels = 1, /* no multi-channel for now */ | 4216 | .num_different_channels = 2, |
4152 | .n_limits = ARRAY_SIZE(brcmf_iface_limits), | 4217 | .n_limits = ARRAY_SIZE(brcmf_iface_limits), |
4153 | .limits = brcmf_iface_limits | 4218 | .limits = brcmf_iface_limits |
4154 | } | 4219 | } |
@@ -4256,20 +4321,16 @@ struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, | |||
4256 | return vif; | 4321 | return vif; |
4257 | } | 4322 | } |
4258 | 4323 | ||
4259 | void brcmf_free_vif(struct brcmf_cfg80211_vif *vif) | 4324 | void brcmf_free_vif(struct brcmf_cfg80211_info *cfg, |
4325 | struct brcmf_cfg80211_vif *vif) | ||
4260 | { | 4326 | { |
4261 | struct brcmf_cfg80211_info *cfg; | ||
4262 | struct wiphy *wiphy; | ||
4263 | |||
4264 | wiphy = vif->wdev.wiphy; | ||
4265 | cfg = wiphy_priv(wiphy); | ||
4266 | list_del(&vif->list); | 4327 | list_del(&vif->list); |
4267 | cfg->vif_cnt--; | 4328 | cfg->vif_cnt--; |
4268 | 4329 | ||
4269 | kfree(vif); | 4330 | kfree(vif); |
4270 | if (!cfg->vif_cnt) { | 4331 | if (!cfg->vif_cnt) { |
4271 | wiphy_unregister(wiphy); | 4332 | wiphy_unregister(cfg->wiphy); |
4272 | wiphy_free(wiphy); | 4333 | wiphy_free(cfg->wiphy); |
4273 | } | 4334 | } |
4274 | } | 4335 | } |
4275 | 4336 | ||
@@ -4646,7 +4707,6 @@ static s32 brcmf_notify_vif_event(struct brcmf_if *ifp, | |||
4646 | return 0; | 4707 | return 0; |
4647 | 4708 | ||
4648 | case BRCMF_E_IF_DEL: | 4709 | case BRCMF_E_IF_DEL: |
4649 | ifp->vif = NULL; | ||
4650 | mutex_unlock(&event->vif_event_lock); | 4710 | mutex_unlock(&event->vif_event_lock); |
4651 | /* event may not be upon user request */ | 4711 | /* event may not be upon user request */ |
4652 | if (brcmf_cfg80211_vif_event_armed(cfg)) | 4712 | if (brcmf_cfg80211_vif_event_armed(cfg)) |
@@ -4852,8 +4912,7 @@ cfg80211_p2p_attach_out: | |||
4852 | wl_deinit_priv(cfg); | 4912 | wl_deinit_priv(cfg); |
4853 | 4913 | ||
4854 | cfg80211_attach_out: | 4914 | cfg80211_attach_out: |
4855 | brcmf_free_vif(vif); | 4915 | brcmf_free_vif(cfg, vif); |
4856 | wiphy_free(wiphy); | ||
4857 | return NULL; | 4916 | return NULL; |
4858 | } | 4917 | } |
4859 | 4918 | ||
@@ -4865,7 +4924,7 @@ void brcmf_cfg80211_detach(struct brcmf_cfg80211_info *cfg) | |||
4865 | wl_deinit_priv(cfg); | 4924 | wl_deinit_priv(cfg); |
4866 | brcmf_btcoex_detach(cfg); | 4925 | brcmf_btcoex_detach(cfg); |
4867 | list_for_each_entry_safe(vif, tmp, &cfg->vif_list, list) { | 4926 | list_for_each_entry_safe(vif, tmp, &cfg->vif_list, list) { |
4868 | brcmf_free_vif(vif); | 4927 | brcmf_free_vif(cfg, vif); |
4869 | } | 4928 | } |
4870 | } | 4929 | } |
4871 | 4930 | ||
@@ -5229,6 +5288,8 @@ static s32 brcmf_config_dongle(struct brcmf_cfg80211_info *cfg) | |||
5229 | if (err) | 5288 | if (err) |
5230 | goto default_conf_out; | 5289 | goto default_conf_out; |
5231 | 5290 | ||
5291 | brcmf_configure_arp_offload(ifp, true); | ||
5292 | |||
5232 | cfg->dongle_up = true; | 5293 | cfg->dongle_up = true; |
5233 | default_conf_out: | 5294 | default_conf_out: |
5234 | 5295 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h index a71cff84cdcf..d9bdaf9a72d0 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h | |||
@@ -487,7 +487,8 @@ enum nl80211_iftype brcmf_cfg80211_get_iftype(struct brcmf_if *ifp); | |||
487 | struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, | 487 | struct brcmf_cfg80211_vif *brcmf_alloc_vif(struct brcmf_cfg80211_info *cfg, |
488 | enum nl80211_iftype type, | 488 | enum nl80211_iftype type, |
489 | bool pm_block); | 489 | bool pm_block); |
490 | void brcmf_free_vif(struct brcmf_cfg80211_vif *vif); | 490 | void brcmf_free_vif(struct brcmf_cfg80211_info *cfg, |
491 | struct brcmf_cfg80211_vif *vif); | ||
491 | 492 | ||
492 | s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, | 493 | s32 brcmf_vif_set_mgmt_ie(struct brcmf_cfg80211_vif *vif, s32 pktflag, |
493 | const u8 *vndr_ie_buf, u32 vndr_ie_len); | 494 | const u8 *vndr_ie_buf, u32 vndr_ie_len); |
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c index db183b44e038..c3c13ce96eb0 100644 --- a/drivers/net/wireless/iwlwifi/dvm/sta.c +++ b/drivers/net/wireless/iwlwifi/dvm/sta.c | |||
@@ -735,7 +735,7 @@ void iwl_restore_stations(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
735 | memcpy(&lq, priv->stations[i].lq, | 735 | memcpy(&lq, priv->stations[i].lq, |
736 | sizeof(struct iwl_link_quality_cmd)); | 736 | sizeof(struct iwl_link_quality_cmd)); |
737 | 737 | ||
738 | if (!memcmp(&lq, &zero_lq, sizeof(lq))) | 738 | if (memcmp(&lq, &zero_lq, sizeof(lq))) |
739 | send_lq = true; | 739 | send_lq = true; |
740 | } | 740 | } |
741 | spin_unlock_bh(&priv->sta_lock); | 741 | spin_unlock_bh(&priv->sta_lock); |
diff --git a/drivers/nfc/Kconfig b/drivers/nfc/Kconfig index 4775d4e61b88..74a852e4e41f 100644 --- a/drivers/nfc/Kconfig +++ b/drivers/nfc/Kconfig | |||
@@ -28,7 +28,7 @@ config NFC_WILINK | |||
28 | 28 | ||
29 | config NFC_MEI_PHY | 29 | config NFC_MEI_PHY |
30 | tristate "MEI bus NFC device support" | 30 | tristate "MEI bus NFC device support" |
31 | depends on INTEL_MEI_BUS_NFC && NFC_HCI | 31 | depends on INTEL_MEI && NFC_HCI |
32 | help | 32 | help |
33 | This adds support to use an mei bus nfc device. Select this if you | 33 | This adds support to use an mei bus nfc device. Select this if you |
34 | will use an HCI NFC driver for an NFC chip connected behind an | 34 | will use an HCI NFC driver for an NFC chip connected behind an |
diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index b8f8abc422f0..1201bdbfb791 100644 --- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c | |||
@@ -64,6 +64,15 @@ int nfc_mei_phy_enable(void *phy_id) | |||
64 | return r; | 64 | return r; |
65 | } | 65 | } |
66 | 66 | ||
67 | r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy); | ||
68 | if (r) { | ||
69 | pr_err("MEY_PHY: Event cb registration failed\n"); | ||
70 | mei_cl_disable_device(phy->device); | ||
71 | phy->powered = 0; | ||
72 | |||
73 | return r; | ||
74 | } | ||
75 | |||
67 | phy->powered = 1; | 76 | phy->powered = 1; |
68 | 77 | ||
69 | return 0; | 78 | return 0; |
diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c index 1ad044dce7b6..cdf1bc53b257 100644 --- a/drivers/nfc/microread/mei.c +++ b/drivers/nfc/microread/mei.c | |||
@@ -43,24 +43,16 @@ static int microread_mei_probe(struct mei_cl_device *device, | |||
43 | return -ENOMEM; | 43 | return -ENOMEM; |
44 | } | 44 | } |
45 | 45 | ||
46 | r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); | ||
47 | if (r) { | ||
48 | pr_err(MICROREAD_DRIVER_NAME ": event cb registration failed\n"); | ||
49 | goto err_out; | ||
50 | } | ||
51 | |||
52 | r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME, | 46 | r = microread_probe(phy, &mei_phy_ops, LLC_NOP_NAME, |
53 | MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, | 47 | MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, |
54 | &phy->hdev); | 48 | &phy->hdev); |
55 | if (r < 0) | 49 | if (r < 0) { |
56 | goto err_out; | 50 | nfc_mei_phy_free(phy); |
57 | |||
58 | return 0; | ||
59 | 51 | ||
60 | err_out: | 52 | return r; |
61 | nfc_mei_phy_free(phy); | 53 | } |
62 | 54 | ||
63 | return r; | 55 | return 0; |
64 | } | 56 | } |
65 | 57 | ||
66 | static int microread_mei_remove(struct mei_cl_device *device) | 58 | static int microread_mei_remove(struct mei_cl_device *device) |
@@ -71,8 +63,6 @@ static int microread_mei_remove(struct mei_cl_device *device) | |||
71 | 63 | ||
72 | microread_remove(phy->hdev); | 64 | microread_remove(phy->hdev); |
73 | 65 | ||
74 | nfc_mei_phy_disable(phy); | ||
75 | |||
76 | nfc_mei_phy_free(phy); | 66 | nfc_mei_phy_free(phy); |
77 | 67 | ||
78 | return 0; | 68 | return 0; |
diff --git a/drivers/nfc/pn544/mei.c b/drivers/nfc/pn544/mei.c index 1eb48848a35a..b5d3d18179eb 100644 --- a/drivers/nfc/pn544/mei.c +++ b/drivers/nfc/pn544/mei.c | |||
@@ -43,24 +43,16 @@ static int pn544_mei_probe(struct mei_cl_device *device, | |||
43 | return -ENOMEM; | 43 | return -ENOMEM; |
44 | } | 44 | } |
45 | 45 | ||
46 | r = mei_cl_register_event_cb(device, nfc_mei_event_cb, phy); | ||
47 | if (r) { | ||
48 | pr_err(PN544_DRIVER_NAME ": event cb registration failed\n"); | ||
49 | goto err_out; | ||
50 | } | ||
51 | |||
52 | r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME, | 46 | r = pn544_hci_probe(phy, &mei_phy_ops, LLC_NOP_NAME, |
53 | MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, | 47 | MEI_NFC_HEADER_SIZE, 0, MEI_NFC_MAX_HCI_PAYLOAD, |
54 | &phy->hdev); | 48 | &phy->hdev); |
55 | if (r < 0) | 49 | if (r < 0) { |
56 | goto err_out; | 50 | nfc_mei_phy_free(phy); |
57 | |||
58 | return 0; | ||
59 | 51 | ||
60 | err_out: | 52 | return r; |
61 | nfc_mei_phy_free(phy); | 53 | } |
62 | 54 | ||
63 | return r; | 55 | return 0; |
64 | } | 56 | } |
65 | 57 | ||
66 | static int pn544_mei_remove(struct mei_cl_device *device) | 58 | static int pn544_mei_remove(struct mei_cl_device *device) |
@@ -71,8 +63,6 @@ static int pn544_mei_remove(struct mei_cl_device *device) | |||
71 | 63 | ||
72 | pn544_hci_remove(phy->hdev); | 64 | pn544_hci_remove(phy->hdev); |
73 | 65 | ||
74 | nfc_mei_phy_disable(phy); | ||
75 | |||
76 | nfc_mei_phy_free(phy); | 66 | nfc_mei_phy_free(phy); |
77 | 67 | ||
78 | return 0; | 68 | return 0; |
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 2ef7103270bb..1f05913ae677 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -668,7 +668,7 @@ lba_fixup_bus(struct pci_bus *bus) | |||
668 | BUG(); | 668 | BUG(); |
669 | } | 669 | } |
670 | 670 | ||
671 | if (ldev->hba.elmmio_space.start) { | 671 | if (ldev->hba.elmmio_space.flags) { |
672 | err = request_resource(&iomem_resource, | 672 | err = request_resource(&iomem_resource, |
673 | &(ldev->hba.elmmio_space)); | 673 | &(ldev->hba.elmmio_space)); |
674 | if (err < 0) { | 674 | if (err < 0) { |
@@ -993,7 +993,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) | |||
993 | 993 | ||
994 | case PAT_LMMIO: | 994 | case PAT_LMMIO: |
995 | /* used to fix up pre-initialized MEM BARs */ | 995 | /* used to fix up pre-initialized MEM BARs */ |
996 | if (!lba_dev->hba.lmmio_space.start) { | 996 | if (!lba_dev->hba.lmmio_space.flags) { |
997 | sprintf(lba_dev->hba.lmmio_name, | 997 | sprintf(lba_dev->hba.lmmio_name, |
998 | "PCI%02x LMMIO", | 998 | "PCI%02x LMMIO", |
999 | (int)lba_dev->hba.bus_num.start); | 999 | (int)lba_dev->hba.bus_num.start); |
@@ -1001,7 +1001,7 @@ lba_pat_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) | |||
1001 | io->start; | 1001 | io->start; |
1002 | r = &lba_dev->hba.lmmio_space; | 1002 | r = &lba_dev->hba.lmmio_space; |
1003 | r->name = lba_dev->hba.lmmio_name; | 1003 | r->name = lba_dev->hba.lmmio_name; |
1004 | } else if (!lba_dev->hba.elmmio_space.start) { | 1004 | } else if (!lba_dev->hba.elmmio_space.flags) { |
1005 | sprintf(lba_dev->hba.elmmio_name, | 1005 | sprintf(lba_dev->hba.elmmio_name, |
1006 | "PCI%02x ELMMIO", | 1006 | "PCI%02x ELMMIO", |
1007 | (int)lba_dev->hba.bus_num.start); | 1007 | (int)lba_dev->hba.bus_num.start); |
@@ -1096,6 +1096,7 @@ lba_legacy_resources(struct parisc_device *pa_dev, struct lba_device *lba_dev) | |||
1096 | r->name = "LBA PCI Busses"; | 1096 | r->name = "LBA PCI Busses"; |
1097 | r->start = lba_num & 0xff; | 1097 | r->start = lba_num & 0xff; |
1098 | r->end = (lba_num>>8) & 0xff; | 1098 | r->end = (lba_num>>8) & 0xff; |
1099 | r->flags = IORESOURCE_BUS; | ||
1099 | 1100 | ||
1100 | /* Set up local PCI Bus resources - we don't need them for | 1101 | /* Set up local PCI Bus resources - we don't need them for |
1101 | ** Legacy boxes but it's nice to see in /proc/iomem. | 1102 | ** Legacy boxes but it's nice to see in /proc/iomem. |
@@ -1494,7 +1495,7 @@ lba_driver_probe(struct parisc_device *dev) | |||
1494 | 1495 | ||
1495 | pci_add_resource_offset(&resources, &lba_dev->hba.io_space, | 1496 | pci_add_resource_offset(&resources, &lba_dev->hba.io_space, |
1496 | HBA_PORT_BASE(lba_dev->hba.hba_num)); | 1497 | HBA_PORT_BASE(lba_dev->hba.hba_num)); |
1497 | if (lba_dev->hba.elmmio_space.start) | 1498 | if (lba_dev->hba.elmmio_space.flags) |
1498 | pci_add_resource_offset(&resources, &lba_dev->hba.elmmio_space, | 1499 | pci_add_resource_offset(&resources, &lba_dev->hba.elmmio_space, |
1499 | lba_dev->hba.lmmio_space_offset); | 1500 | lba_dev->hba.lmmio_space_offset); |
1500 | if (lba_dev->hba.lmmio_space.flags) | 1501 | if (lba_dev->hba.lmmio_space.flags) |
diff --git a/drivers/parport/Kconfig b/drivers/parport/Kconfig index 24e12d4d1769..a50576081b34 100644 --- a/drivers/parport/Kconfig +++ b/drivers/parport/Kconfig | |||
@@ -71,7 +71,7 @@ config PARPORT_PC_FIFO | |||
71 | 71 | ||
72 | config PARPORT_PC_SUPERIO | 72 | config PARPORT_PC_SUPERIO |
73 | bool "SuperIO chipset support" | 73 | bool "SuperIO chipset support" |
74 | depends on PARPORT_PC | 74 | depends on PARPORT_PC && !PARISC |
75 | help | 75 | help |
76 | Saying Y here enables some probes for Super-IO chipsets in order to | 76 | Saying Y here enables some probes for Super-IO chipsets in order to |
77 | find out things like base addresses, IRQ lines and DMA channels. It | 77 | find out things like base addresses, IRQ lines and DMA channels. It |
diff --git a/drivers/parport/parport_gsc.c b/drivers/parport/parport_gsc.c index a5251cb5fb0c..6e3a60c78873 100644 --- a/drivers/parport/parport_gsc.c +++ b/drivers/parport/parport_gsc.c | |||
@@ -234,7 +234,7 @@ static int parport_PS2_supported(struct parport *pb) | |||
234 | 234 | ||
235 | struct parport *parport_gsc_probe_port(unsigned long base, | 235 | struct parport *parport_gsc_probe_port(unsigned long base, |
236 | unsigned long base_hi, int irq, | 236 | unsigned long base_hi, int irq, |
237 | int dma, struct pci_dev *dev) | 237 | int dma, struct parisc_device *padev) |
238 | { | 238 | { |
239 | struct parport_gsc_private *priv; | 239 | struct parport_gsc_private *priv; |
240 | struct parport_operations *ops; | 240 | struct parport_operations *ops; |
@@ -258,7 +258,6 @@ struct parport *parport_gsc_probe_port(unsigned long base, | |||
258 | priv->ctr_writable = 0xff; | 258 | priv->ctr_writable = 0xff; |
259 | priv->dma_buf = 0; | 259 | priv->dma_buf = 0; |
260 | priv->dma_handle = 0; | 260 | priv->dma_handle = 0; |
261 | priv->dev = dev; | ||
262 | p->base = base; | 261 | p->base = base; |
263 | p->base_hi = base_hi; | 262 | p->base_hi = base_hi; |
264 | p->irq = irq; | 263 | p->irq = irq; |
@@ -282,6 +281,7 @@ struct parport *parport_gsc_probe_port(unsigned long base, | |||
282 | return NULL; | 281 | return NULL; |
283 | } | 282 | } |
284 | 283 | ||
284 | p->dev = &padev->dev; | ||
285 | p->base_hi = base_hi; | 285 | p->base_hi = base_hi; |
286 | p->modes = tmp.modes; | 286 | p->modes = tmp.modes; |
287 | p->size = (p->modes & PARPORT_MODE_EPP)?8:3; | 287 | p->size = (p->modes & PARPORT_MODE_EPP)?8:3; |
@@ -373,7 +373,7 @@ static int parport_init_chip(struct parisc_device *dev) | |||
373 | } | 373 | } |
374 | 374 | ||
375 | p = parport_gsc_probe_port(port, 0, dev->irq, | 375 | p = parport_gsc_probe_port(port, 0, dev->irq, |
376 | /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, NULL); | 376 | /* PARPORT_IRQ_NONE */ PARPORT_DMA_NONE, dev); |
377 | if (p) | 377 | if (p) |
378 | parport_count++; | 378 | parport_count++; |
379 | dev_set_drvdata(&dev->dev, p); | 379 | dev_set_drvdata(&dev->dev, p); |
diff --git a/drivers/parport/parport_gsc.h b/drivers/parport/parport_gsc.h index fc9c37c54022..812214768d27 100644 --- a/drivers/parport/parport_gsc.h +++ b/drivers/parport/parport_gsc.h | |||
@@ -217,6 +217,6 @@ extern void parport_gsc_dec_use_count(void); | |||
217 | extern struct parport *parport_gsc_probe_port(unsigned long base, | 217 | extern struct parport *parport_gsc_probe_port(unsigned long base, |
218 | unsigned long base_hi, | 218 | unsigned long base_hi, |
219 | int irq, int dma, | 219 | int irq, int dma, |
220 | struct pci_dev *dev); | 220 | struct parisc_device *padev); |
221 | 221 | ||
222 | #endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */ | 222 | #endif /* __DRIVERS_PARPORT_PARPORT_GSC_H */ |
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index 8ec8b4f48560..0f4554e48cc5 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -580,6 +580,7 @@ struct aer_recover_entry | |||
580 | u8 devfn; | 580 | u8 devfn; |
581 | u16 domain; | 581 | u16 domain; |
582 | int severity; | 582 | int severity; |
583 | struct aer_capability_regs *regs; | ||
583 | }; | 584 | }; |
584 | 585 | ||
585 | static DEFINE_KFIFO(aer_recover_ring, struct aer_recover_entry, | 586 | static DEFINE_KFIFO(aer_recover_ring, struct aer_recover_entry, |
@@ -593,7 +594,7 @@ static DEFINE_SPINLOCK(aer_recover_ring_lock); | |||
593 | static DECLARE_WORK(aer_recover_work, aer_recover_work_func); | 594 | static DECLARE_WORK(aer_recover_work, aer_recover_work_func); |
594 | 595 | ||
595 | void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, | 596 | void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, |
596 | int severity) | 597 | int severity, struct aer_capability_regs *aer_regs) |
597 | { | 598 | { |
598 | unsigned long flags; | 599 | unsigned long flags; |
599 | struct aer_recover_entry entry = { | 600 | struct aer_recover_entry entry = { |
@@ -601,6 +602,7 @@ void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, | |||
601 | .devfn = devfn, | 602 | .devfn = devfn, |
602 | .domain = domain, | 603 | .domain = domain, |
603 | .severity = severity, | 604 | .severity = severity, |
605 | .regs = aer_regs, | ||
604 | }; | 606 | }; |
605 | 607 | ||
606 | spin_lock_irqsave(&aer_recover_ring_lock, flags); | 608 | spin_lock_irqsave(&aer_recover_ring_lock, flags); |
@@ -627,6 +629,7 @@ static void aer_recover_work_func(struct work_struct *work) | |||
627 | PCI_SLOT(entry.devfn), PCI_FUNC(entry.devfn)); | 629 | PCI_SLOT(entry.devfn), PCI_FUNC(entry.devfn)); |
628 | continue; | 630 | continue; |
629 | } | 631 | } |
632 | cper_print_aer(pdev, entry.severity, entry.regs); | ||
630 | do_recovery(pdev, entry.severity); | 633 | do_recovery(pdev, entry.severity); |
631 | pci_dev_put(pdev); | 634 | pci_dev_put(pdev); |
632 | } | 635 | } |
diff --git a/drivers/pci/pcie/aer/aerdrv_errprint.c b/drivers/pci/pcie/aer/aerdrv_errprint.c index 5ab14251839d..2c7c9f5f592c 100644 --- a/drivers/pci/pcie/aer/aerdrv_errprint.c +++ b/drivers/pci/pcie/aer/aerdrv_errprint.c | |||
@@ -220,7 +220,7 @@ int cper_severity_to_aer(int cper_severity) | |||
220 | } | 220 | } |
221 | EXPORT_SYMBOL_GPL(cper_severity_to_aer); | 221 | EXPORT_SYMBOL_GPL(cper_severity_to_aer); |
222 | 222 | ||
223 | void cper_print_aer(const char *prefix, struct pci_dev *dev, int cper_severity, | 223 | void cper_print_aer(struct pci_dev *dev, int cper_severity, |
224 | struct aer_capability_regs *aer) | 224 | struct aer_capability_regs *aer) |
225 | { | 225 | { |
226 | int aer_severity, layer, agent, status_strs_size, tlp_header_valid = 0; | 226 | int aer_severity, layer, agent, status_strs_size, tlp_header_valid = 0; |
@@ -244,7 +244,7 @@ void cper_print_aer(const char *prefix, struct pci_dev *dev, int cper_severity, | |||
244 | agent = AER_GET_AGENT(aer_severity, status); | 244 | agent = AER_GET_AGENT(aer_severity, status); |
245 | dev_err(&dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", | 245 | dev_err(&dev->dev, "aer_status: 0x%08x, aer_mask: 0x%08x\n", |
246 | status, mask); | 246 | status, mask); |
247 | cper_print_bits(prefix, status, status_strs, status_strs_size); | 247 | cper_print_bits("", status, status_strs, status_strs_size); |
248 | dev_err(&dev->dev, "aer_layer=%s, aer_agent=%s\n", | 248 | dev_err(&dev->dev, "aer_layer=%s, aer_agent=%s\n", |
249 | aer_error_layer[layer], aer_agent_string[agent]); | 249 | aer_error_layer[layer], aer_agent_string[agent]); |
250 | if (aer_severity != AER_CORRECTABLE) | 250 | if (aer_severity != AER_CORRECTABLE) |
diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c index c67c37e23dd7..694c3ace4520 100644 --- a/drivers/pinctrl/pinconf.c +++ b/drivers/pinctrl/pinconf.c | |||
@@ -610,7 +610,7 @@ static int pinconf_dbg_config_print(struct seq_file *s, void *d) | |||
610 | bool found = false; | 610 | bool found = false; |
611 | unsigned long config; | 611 | unsigned long config; |
612 | 612 | ||
613 | mutex_lock(&pctldev->mutex); | 613 | mutex_lock(&pinctrl_maps_mutex); |
614 | 614 | ||
615 | /* Parse the pinctrl map and look for the elected pin/state */ | 615 | /* Parse the pinctrl map and look for the elected pin/state */ |
616 | for_each_maps(maps_node, i, map) { | 616 | for_each_maps(maps_node, i, map) { |
@@ -659,7 +659,7 @@ static int pinconf_dbg_config_print(struct seq_file *s, void *d) | |||
659 | confops->pin_config_config_dbg_show(pctldev, s, config); | 659 | confops->pin_config_config_dbg_show(pctldev, s, config); |
660 | 660 | ||
661 | exit: | 661 | exit: |
662 | mutex_unlock(&pctldev->mutex); | 662 | mutex_unlock(&pinctrl_maps_mutex); |
663 | 663 | ||
664 | return 0; | 664 | return 0; |
665 | } | 665 | } |
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index a67af419f531..d6b41747d687 100644 --- a/drivers/pinctrl/pinctrl-coh901.c +++ b/drivers/pinctrl/pinctrl-coh901.c | |||
@@ -830,7 +830,8 @@ static int __init u300_gpio_probe(struct platform_device *pdev) | |||
830 | return 0; | 830 | return 0; |
831 | 831 | ||
832 | err_no_range: | 832 | err_no_range: |
833 | err = gpiochip_remove(&gpio->chip); | 833 | if (gpiochip_remove(&gpio->chip)) |
834 | dev_err(&pdev->dev, "failed to remove gpio chip\n"); | ||
834 | err_no_chip: | 835 | err_no_chip: |
835 | err_no_domain: | 836 | err_no_domain: |
836 | err_no_port: | 837 | err_no_port: |
diff --git a/drivers/pinctrl/pinctrl-exynos.c b/drivers/pinctrl/pinctrl-exynos.c index ac742817ebce..2d76f66a2e0b 100644 --- a/drivers/pinctrl/pinctrl-exynos.c +++ b/drivers/pinctrl/pinctrl-exynos.c | |||
@@ -196,6 +196,12 @@ static irqreturn_t exynos_eint_gpio_irq(int irq, void *data) | |||
196 | return IRQ_HANDLED; | 196 | return IRQ_HANDLED; |
197 | } | 197 | } |
198 | 198 | ||
199 | struct exynos_eint_gpio_save { | ||
200 | u32 eint_con; | ||
201 | u32 eint_fltcon0; | ||
202 | u32 eint_fltcon1; | ||
203 | }; | ||
204 | |||
199 | /* | 205 | /* |
200 | * exynos_eint_gpio_init() - setup handling of external gpio interrupts. | 206 | * exynos_eint_gpio_init() - setup handling of external gpio interrupts. |
201 | * @d: driver data of samsung pinctrl driver. | 207 | * @d: driver data of samsung pinctrl driver. |
@@ -204,8 +210,8 @@ static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d) | |||
204 | { | 210 | { |
205 | struct samsung_pin_bank *bank; | 211 | struct samsung_pin_bank *bank; |
206 | struct device *dev = d->dev; | 212 | struct device *dev = d->dev; |
207 | unsigned int ret; | 213 | int ret; |
208 | unsigned int i; | 214 | int i; |
209 | 215 | ||
210 | if (!d->irq) { | 216 | if (!d->irq) { |
211 | dev_err(dev, "irq number not available\n"); | 217 | dev_err(dev, "irq number not available\n"); |
@@ -227,11 +233,29 @@ static int exynos_eint_gpio_init(struct samsung_pinctrl_drv_data *d) | |||
227 | bank->nr_pins, &exynos_gpio_irqd_ops, bank); | 233 | bank->nr_pins, &exynos_gpio_irqd_ops, bank); |
228 | if (!bank->irq_domain) { | 234 | if (!bank->irq_domain) { |
229 | dev_err(dev, "gpio irq domain add failed\n"); | 235 | dev_err(dev, "gpio irq domain add failed\n"); |
230 | return -ENXIO; | 236 | ret = -ENXIO; |
237 | goto err_domains; | ||
238 | } | ||
239 | |||
240 | bank->soc_priv = devm_kzalloc(d->dev, | ||
241 | sizeof(struct exynos_eint_gpio_save), GFP_KERNEL); | ||
242 | if (!bank->soc_priv) { | ||
243 | irq_domain_remove(bank->irq_domain); | ||
244 | ret = -ENOMEM; | ||
245 | goto err_domains; | ||
231 | } | 246 | } |
232 | } | 247 | } |
233 | 248 | ||
234 | return 0; | 249 | return 0; |
250 | |||
251 | err_domains: | ||
252 | for (--i, --bank; i >= 0; --i, --bank) { | ||
253 | if (bank->eint_type != EINT_TYPE_GPIO) | ||
254 | continue; | ||
255 | irq_domain_remove(bank->irq_domain); | ||
256 | } | ||
257 | |||
258 | return ret; | ||
235 | } | 259 | } |
236 | 260 | ||
237 | static void exynos_wkup_irq_unmask(struct irq_data *irqd) | 261 | static void exynos_wkup_irq_unmask(struct irq_data *irqd) |
@@ -326,6 +350,28 @@ static int exynos_wkup_irq_set_type(struct irq_data *irqd, unsigned int type) | |||
326 | return 0; | 350 | return 0; |
327 | } | 351 | } |
328 | 352 | ||
353 | static u32 exynos_eint_wake_mask = 0xffffffff; | ||
354 | |||
355 | u32 exynos_get_eint_wake_mask(void) | ||
356 | { | ||
357 | return exynos_eint_wake_mask; | ||
358 | } | ||
359 | |||
360 | static int exynos_wkup_irq_set_wake(struct irq_data *irqd, unsigned int on) | ||
361 | { | ||
362 | struct samsung_pin_bank *bank = irq_data_get_irq_chip_data(irqd); | ||
363 | unsigned long bit = 1UL << (2 * bank->eint_offset + irqd->hwirq); | ||
364 | |||
365 | pr_info("wake %s for irq %d\n", on ? "enabled" : "disabled", irqd->irq); | ||
366 | |||
367 | if (!on) | ||
368 | exynos_eint_wake_mask |= bit; | ||
369 | else | ||
370 | exynos_eint_wake_mask &= ~bit; | ||
371 | |||
372 | return 0; | ||
373 | } | ||
374 | |||
329 | /* | 375 | /* |
330 | * irq_chip for wakeup interrupts | 376 | * irq_chip for wakeup interrupts |
331 | */ | 377 | */ |
@@ -335,6 +381,7 @@ static struct irq_chip exynos_wkup_irq_chip = { | |||
335 | .irq_mask = exynos_wkup_irq_mask, | 381 | .irq_mask = exynos_wkup_irq_mask, |
336 | .irq_ack = exynos_wkup_irq_ack, | 382 | .irq_ack = exynos_wkup_irq_ack, |
337 | .irq_set_type = exynos_wkup_irq_set_type, | 383 | .irq_set_type = exynos_wkup_irq_set_type, |
384 | .irq_set_wake = exynos_wkup_irq_set_wake, | ||
338 | }; | 385 | }; |
339 | 386 | ||
340 | /* interrupt handler for wakeup interrupts 0..15 */ | 387 | /* interrupt handler for wakeup interrupts 0..15 */ |
@@ -505,6 +552,72 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) | |||
505 | return 0; | 552 | return 0; |
506 | } | 553 | } |
507 | 554 | ||
555 | static void exynos_pinctrl_suspend_bank( | ||
556 | struct samsung_pinctrl_drv_data *drvdata, | ||
557 | struct samsung_pin_bank *bank) | ||
558 | { | ||
559 | struct exynos_eint_gpio_save *save = bank->soc_priv; | ||
560 | void __iomem *regs = drvdata->virt_base; | ||
561 | |||
562 | save->eint_con = readl(regs + EXYNOS_GPIO_ECON_OFFSET | ||
563 | + bank->eint_offset); | ||
564 | save->eint_fltcon0 = readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET | ||
565 | + 2 * bank->eint_offset); | ||
566 | save->eint_fltcon1 = readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET | ||
567 | + 2 * bank->eint_offset + 4); | ||
568 | |||
569 | pr_debug("%s: save con %#010x\n", bank->name, save->eint_con); | ||
570 | pr_debug("%s: save fltcon0 %#010x\n", bank->name, save->eint_fltcon0); | ||
571 | pr_debug("%s: save fltcon1 %#010x\n", bank->name, save->eint_fltcon1); | ||
572 | } | ||
573 | |||
574 | static void exynos_pinctrl_suspend(struct samsung_pinctrl_drv_data *drvdata) | ||
575 | { | ||
576 | struct samsung_pin_ctrl *ctrl = drvdata->ctrl; | ||
577 | struct samsung_pin_bank *bank = ctrl->pin_banks; | ||
578 | int i; | ||
579 | |||
580 | for (i = 0; i < ctrl->nr_banks; ++i, ++bank) | ||
581 | if (bank->eint_type == EINT_TYPE_GPIO) | ||
582 | exynos_pinctrl_suspend_bank(drvdata, bank); | ||
583 | } | ||
584 | |||
585 | static void exynos_pinctrl_resume_bank( | ||
586 | struct samsung_pinctrl_drv_data *drvdata, | ||
587 | struct samsung_pin_bank *bank) | ||
588 | { | ||
589 | struct exynos_eint_gpio_save *save = bank->soc_priv; | ||
590 | void __iomem *regs = drvdata->virt_base; | ||
591 | |||
592 | pr_debug("%s: con %#010x => %#010x\n", bank->name, | ||
593 | readl(regs + EXYNOS_GPIO_ECON_OFFSET | ||
594 | + bank->eint_offset), save->eint_con); | ||
595 | pr_debug("%s: fltcon0 %#010x => %#010x\n", bank->name, | ||
596 | readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET | ||
597 | + 2 * bank->eint_offset), save->eint_fltcon0); | ||
598 | pr_debug("%s: fltcon1 %#010x => %#010x\n", bank->name, | ||
599 | readl(regs + EXYNOS_GPIO_EFLTCON_OFFSET | ||
600 | + 2 * bank->eint_offset + 4), save->eint_fltcon1); | ||
601 | |||
602 | writel(save->eint_con, regs + EXYNOS_GPIO_ECON_OFFSET | ||
603 | + bank->eint_offset); | ||
604 | writel(save->eint_fltcon0, regs + EXYNOS_GPIO_EFLTCON_OFFSET | ||
605 | + 2 * bank->eint_offset); | ||
606 | writel(save->eint_fltcon1, regs + EXYNOS_GPIO_EFLTCON_OFFSET | ||
607 | + 2 * bank->eint_offset + 4); | ||
608 | } | ||
609 | |||
610 | static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) | ||
611 | { | ||
612 | struct samsung_pin_ctrl *ctrl = drvdata->ctrl; | ||
613 | struct samsung_pin_bank *bank = ctrl->pin_banks; | ||
614 | int i; | ||
615 | |||
616 | for (i = 0; i < ctrl->nr_banks; ++i, ++bank) | ||
617 | if (bank->eint_type == EINT_TYPE_GPIO) | ||
618 | exynos_pinctrl_resume_bank(drvdata, bank); | ||
619 | } | ||
620 | |||
508 | /* pin banks of exynos4210 pin-controller 0 */ | 621 | /* pin banks of exynos4210 pin-controller 0 */ |
509 | static struct samsung_pin_bank exynos4210_pin_banks0[] = { | 622 | static struct samsung_pin_bank exynos4210_pin_banks0[] = { |
510 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), | 623 | EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), |
@@ -568,6 +681,8 @@ struct samsung_pin_ctrl exynos4210_pin_ctrl[] = { | |||
568 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 681 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
569 | .svc = EXYNOS_SVC_OFFSET, | 682 | .svc = EXYNOS_SVC_OFFSET, |
570 | .eint_gpio_init = exynos_eint_gpio_init, | 683 | .eint_gpio_init = exynos_eint_gpio_init, |
684 | .suspend = exynos_pinctrl_suspend, | ||
685 | .resume = exynos_pinctrl_resume, | ||
571 | .label = "exynos4210-gpio-ctrl0", | 686 | .label = "exynos4210-gpio-ctrl0", |
572 | }, { | 687 | }, { |
573 | /* pin-controller instance 1 data */ | 688 | /* pin-controller instance 1 data */ |
@@ -582,6 +697,8 @@ struct samsung_pin_ctrl exynos4210_pin_ctrl[] = { | |||
582 | .svc = EXYNOS_SVC_OFFSET, | 697 | .svc = EXYNOS_SVC_OFFSET, |
583 | .eint_gpio_init = exynos_eint_gpio_init, | 698 | .eint_gpio_init = exynos_eint_gpio_init, |
584 | .eint_wkup_init = exynos_eint_wkup_init, | 699 | .eint_wkup_init = exynos_eint_wkup_init, |
700 | .suspend = exynos_pinctrl_suspend, | ||
701 | .resume = exynos_pinctrl_resume, | ||
585 | .label = "exynos4210-gpio-ctrl1", | 702 | .label = "exynos4210-gpio-ctrl1", |
586 | }, { | 703 | }, { |
587 | /* pin-controller instance 2 data */ | 704 | /* pin-controller instance 2 data */ |
@@ -663,6 +780,8 @@ struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = { | |||
663 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 780 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
664 | .svc = EXYNOS_SVC_OFFSET, | 781 | .svc = EXYNOS_SVC_OFFSET, |
665 | .eint_gpio_init = exynos_eint_gpio_init, | 782 | .eint_gpio_init = exynos_eint_gpio_init, |
783 | .suspend = exynos_pinctrl_suspend, | ||
784 | .resume = exynos_pinctrl_resume, | ||
666 | .label = "exynos4x12-gpio-ctrl0", | 785 | .label = "exynos4x12-gpio-ctrl0", |
667 | }, { | 786 | }, { |
668 | /* pin-controller instance 1 data */ | 787 | /* pin-controller instance 1 data */ |
@@ -677,6 +796,8 @@ struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = { | |||
677 | .svc = EXYNOS_SVC_OFFSET, | 796 | .svc = EXYNOS_SVC_OFFSET, |
678 | .eint_gpio_init = exynos_eint_gpio_init, | 797 | .eint_gpio_init = exynos_eint_gpio_init, |
679 | .eint_wkup_init = exynos_eint_wkup_init, | 798 | .eint_wkup_init = exynos_eint_wkup_init, |
799 | .suspend = exynos_pinctrl_suspend, | ||
800 | .resume = exynos_pinctrl_resume, | ||
680 | .label = "exynos4x12-gpio-ctrl1", | 801 | .label = "exynos4x12-gpio-ctrl1", |
681 | }, { | 802 | }, { |
682 | /* pin-controller instance 2 data */ | 803 | /* pin-controller instance 2 data */ |
@@ -687,6 +808,8 @@ struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = { | |||
687 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 808 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
688 | .svc = EXYNOS_SVC_OFFSET, | 809 | .svc = EXYNOS_SVC_OFFSET, |
689 | .eint_gpio_init = exynos_eint_gpio_init, | 810 | .eint_gpio_init = exynos_eint_gpio_init, |
811 | .suspend = exynos_pinctrl_suspend, | ||
812 | .resume = exynos_pinctrl_resume, | ||
690 | .label = "exynos4x12-gpio-ctrl2", | 813 | .label = "exynos4x12-gpio-ctrl2", |
691 | }, { | 814 | }, { |
692 | /* pin-controller instance 3 data */ | 815 | /* pin-controller instance 3 data */ |
@@ -697,6 +820,8 @@ struct samsung_pin_ctrl exynos4x12_pin_ctrl[] = { | |||
697 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 820 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
698 | .svc = EXYNOS_SVC_OFFSET, | 821 | .svc = EXYNOS_SVC_OFFSET, |
699 | .eint_gpio_init = exynos_eint_gpio_init, | 822 | .eint_gpio_init = exynos_eint_gpio_init, |
823 | .suspend = exynos_pinctrl_suspend, | ||
824 | .resume = exynos_pinctrl_resume, | ||
700 | .label = "exynos4x12-gpio-ctrl3", | 825 | .label = "exynos4x12-gpio-ctrl3", |
701 | }, | 826 | }, |
702 | }; | 827 | }; |
@@ -775,6 +900,8 @@ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { | |||
775 | .svc = EXYNOS_SVC_OFFSET, | 900 | .svc = EXYNOS_SVC_OFFSET, |
776 | .eint_gpio_init = exynos_eint_gpio_init, | 901 | .eint_gpio_init = exynos_eint_gpio_init, |
777 | .eint_wkup_init = exynos_eint_wkup_init, | 902 | .eint_wkup_init = exynos_eint_wkup_init, |
903 | .suspend = exynos_pinctrl_suspend, | ||
904 | .resume = exynos_pinctrl_resume, | ||
778 | .label = "exynos5250-gpio-ctrl0", | 905 | .label = "exynos5250-gpio-ctrl0", |
779 | }, { | 906 | }, { |
780 | /* pin-controller instance 1 data */ | 907 | /* pin-controller instance 1 data */ |
@@ -785,6 +912,8 @@ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { | |||
785 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 912 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
786 | .svc = EXYNOS_SVC_OFFSET, | 913 | .svc = EXYNOS_SVC_OFFSET, |
787 | .eint_gpio_init = exynos_eint_gpio_init, | 914 | .eint_gpio_init = exynos_eint_gpio_init, |
915 | .suspend = exynos_pinctrl_suspend, | ||
916 | .resume = exynos_pinctrl_resume, | ||
788 | .label = "exynos5250-gpio-ctrl1", | 917 | .label = "exynos5250-gpio-ctrl1", |
789 | }, { | 918 | }, { |
790 | /* pin-controller instance 2 data */ | 919 | /* pin-controller instance 2 data */ |
@@ -795,6 +924,8 @@ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { | |||
795 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 924 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
796 | .svc = EXYNOS_SVC_OFFSET, | 925 | .svc = EXYNOS_SVC_OFFSET, |
797 | .eint_gpio_init = exynos_eint_gpio_init, | 926 | .eint_gpio_init = exynos_eint_gpio_init, |
927 | .suspend = exynos_pinctrl_suspend, | ||
928 | .resume = exynos_pinctrl_resume, | ||
798 | .label = "exynos5250-gpio-ctrl2", | 929 | .label = "exynos5250-gpio-ctrl2", |
799 | }, { | 930 | }, { |
800 | /* pin-controller instance 3 data */ | 931 | /* pin-controller instance 3 data */ |
@@ -805,6 +936,8 @@ struct samsung_pin_ctrl exynos5250_pin_ctrl[] = { | |||
805 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, | 936 | .geint_pend = EXYNOS_GPIO_EPEND_OFFSET, |
806 | .svc = EXYNOS_SVC_OFFSET, | 937 | .svc = EXYNOS_SVC_OFFSET, |
807 | .eint_gpio_init = exynos_eint_gpio_init, | 938 | .eint_gpio_init = exynos_eint_gpio_init, |
939 | .suspend = exynos_pinctrl_suspend, | ||
940 | .resume = exynos_pinctrl_resume, | ||
808 | .label = "exynos5250-gpio-ctrl3", | 941 | .label = "exynos5250-gpio-ctrl3", |
809 | }, | 942 | }, |
810 | }; | 943 | }; |
diff --git a/drivers/pinctrl/pinctrl-exynos.h b/drivers/pinctrl/pinctrl-exynos.h index 9b1f77a5bf0f..3c91c357792f 100644 --- a/drivers/pinctrl/pinctrl-exynos.h +++ b/drivers/pinctrl/pinctrl-exynos.h | |||
@@ -19,6 +19,7 @@ | |||
19 | 19 | ||
20 | /* External GPIO and wakeup interrupt related definitions */ | 20 | /* External GPIO and wakeup interrupt related definitions */ |
21 | #define EXYNOS_GPIO_ECON_OFFSET 0x700 | 21 | #define EXYNOS_GPIO_ECON_OFFSET 0x700 |
22 | #define EXYNOS_GPIO_EFLTCON_OFFSET 0x800 | ||
22 | #define EXYNOS_GPIO_EMASK_OFFSET 0x900 | 23 | #define EXYNOS_GPIO_EMASK_OFFSET 0x900 |
23 | #define EXYNOS_GPIO_EPEND_OFFSET 0xA00 | 24 | #define EXYNOS_GPIO_EPEND_OFFSET 0xA00 |
24 | #define EXYNOS_WKUP_ECON_OFFSET 0xE00 | 25 | #define EXYNOS_WKUP_ECON_OFFSET 0xE00 |
diff --git a/drivers/pinctrl/pinctrl-samsung.c b/drivers/pinctrl/pinctrl-samsung.c index 055d0162098b..63ac22e89678 100644 --- a/drivers/pinctrl/pinctrl-samsung.c +++ b/drivers/pinctrl/pinctrl-samsung.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/gpio.h> | 28 | #include <linux/gpio.h> |
29 | #include <linux/irqdomain.h> | 29 | #include <linux/irqdomain.h> |
30 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
31 | #include <linux/syscore_ops.h> | ||
31 | 32 | ||
32 | #include "core.h" | 33 | #include "core.h" |
33 | #include "pinctrl-samsung.h" | 34 | #include "pinctrl-samsung.h" |
@@ -48,6 +49,9 @@ static struct pin_config { | |||
48 | { "samsung,pin-pud-pdn", PINCFG_TYPE_PUD_PDN }, | 49 | { "samsung,pin-pud-pdn", PINCFG_TYPE_PUD_PDN }, |
49 | }; | 50 | }; |
50 | 51 | ||
52 | /* Global list of devices (struct samsung_pinctrl_drv_data) */ | ||
53 | LIST_HEAD(drvdata_list); | ||
54 | |||
51 | static unsigned int pin_base; | 55 | static unsigned int pin_base; |
52 | 56 | ||
53 | static inline struct samsung_pin_bank *gc_to_pin_bank(struct gpio_chip *gc) | 57 | static inline struct samsung_pin_bank *gc_to_pin_bank(struct gpio_chip *gc) |
@@ -956,9 +960,151 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) | |||
956 | ctrl->eint_wkup_init(drvdata); | 960 | ctrl->eint_wkup_init(drvdata); |
957 | 961 | ||
958 | platform_set_drvdata(pdev, drvdata); | 962 | platform_set_drvdata(pdev, drvdata); |
963 | |||
964 | /* Add to the global list */ | ||
965 | list_add_tail(&drvdata->node, &drvdata_list); | ||
966 | |||
959 | return 0; | 967 | return 0; |
960 | } | 968 | } |
961 | 969 | ||
970 | #ifdef CONFIG_PM | ||
971 | |||
972 | /** | ||
973 | * samsung_pinctrl_suspend_dev - save pinctrl state for suspend for a device | ||
974 | * | ||
975 | * Save data for all banks handled by this device. | ||
976 | */ | ||
977 | static void samsung_pinctrl_suspend_dev( | ||
978 | struct samsung_pinctrl_drv_data *drvdata) | ||
979 | { | ||
980 | struct samsung_pin_ctrl *ctrl = drvdata->ctrl; | ||
981 | void __iomem *virt_base = drvdata->virt_base; | ||
982 | int i; | ||
983 | |||
984 | for (i = 0; i < ctrl->nr_banks; i++) { | ||
985 | struct samsung_pin_bank *bank = &ctrl->pin_banks[i]; | ||
986 | void __iomem *reg = virt_base + bank->pctl_offset; | ||
987 | |||
988 | u8 *offs = bank->type->reg_offset; | ||
989 | u8 *widths = bank->type->fld_width; | ||
990 | enum pincfg_type type; | ||
991 | |||
992 | /* Registers without a powerdown config aren't lost */ | ||
993 | if (!widths[PINCFG_TYPE_CON_PDN]) | ||
994 | continue; | ||
995 | |||
996 | for (type = 0; type < PINCFG_TYPE_NUM; type++) | ||
997 | if (widths[type]) | ||
998 | bank->pm_save[type] = readl(reg + offs[type]); | ||
999 | |||
1000 | if (widths[PINCFG_TYPE_FUNC] * bank->nr_pins > 32) { | ||
1001 | /* Some banks have two config registers */ | ||
1002 | bank->pm_save[PINCFG_TYPE_NUM] = | ||
1003 | readl(reg + offs[PINCFG_TYPE_FUNC] + 4); | ||
1004 | pr_debug("Save %s @ %p (con %#010x %08x)\n", | ||
1005 | bank->name, reg, | ||
1006 | bank->pm_save[PINCFG_TYPE_FUNC], | ||
1007 | bank->pm_save[PINCFG_TYPE_NUM]); | ||
1008 | } else { | ||
1009 | pr_debug("Save %s @ %p (con %#010x)\n", bank->name, | ||
1010 | reg, bank->pm_save[PINCFG_TYPE_FUNC]); | ||
1011 | } | ||
1012 | } | ||
1013 | |||
1014 | if (ctrl->suspend) | ||
1015 | ctrl->suspend(drvdata); | ||
1016 | } | ||
1017 | |||
1018 | /** | ||
1019 | * samsung_pinctrl_resume_dev - restore pinctrl state from suspend for a device | ||
1020 | * | ||
1021 | * Restore one of the banks that was saved during suspend. | ||
1022 | * | ||
1023 | * We don't bother doing anything complicated to avoid glitching lines since | ||
1024 | * we're called before pad retention is turned off. | ||
1025 | */ | ||
1026 | static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) | ||
1027 | { | ||
1028 | struct samsung_pin_ctrl *ctrl = drvdata->ctrl; | ||
1029 | void __iomem *virt_base = drvdata->virt_base; | ||
1030 | int i; | ||
1031 | |||
1032 | if (ctrl->resume) | ||
1033 | ctrl->resume(drvdata); | ||
1034 | |||
1035 | for (i = 0; i < ctrl->nr_banks; i++) { | ||
1036 | struct samsung_pin_bank *bank = &ctrl->pin_banks[i]; | ||
1037 | void __iomem *reg = virt_base + bank->pctl_offset; | ||
1038 | |||
1039 | u8 *offs = bank->type->reg_offset; | ||
1040 | u8 *widths = bank->type->fld_width; | ||
1041 | enum pincfg_type type; | ||
1042 | |||
1043 | /* Registers without a powerdown config aren't lost */ | ||
1044 | if (!widths[PINCFG_TYPE_CON_PDN]) | ||
1045 | continue; | ||
1046 | |||
1047 | if (widths[PINCFG_TYPE_FUNC] * bank->nr_pins > 32) { | ||
1048 | /* Some banks have two config registers */ | ||
1049 | pr_debug("%s @ %p (con %#010x %08x => %#010x %08x)\n", | ||
1050 | bank->name, reg, | ||
1051 | readl(reg + offs[PINCFG_TYPE_FUNC]), | ||
1052 | readl(reg + offs[PINCFG_TYPE_FUNC] + 4), | ||
1053 | bank->pm_save[PINCFG_TYPE_FUNC], | ||
1054 | bank->pm_save[PINCFG_TYPE_NUM]); | ||
1055 | writel(bank->pm_save[PINCFG_TYPE_NUM], | ||
1056 | reg + offs[PINCFG_TYPE_FUNC] + 4); | ||
1057 | } else { | ||
1058 | pr_debug("%s @ %p (con %#010x => %#010x)\n", bank->name, | ||
1059 | reg, readl(reg + offs[PINCFG_TYPE_FUNC]), | ||
1060 | bank->pm_save[PINCFG_TYPE_FUNC]); | ||
1061 | } | ||
1062 | for (type = 0; type < PINCFG_TYPE_NUM; type++) | ||
1063 | if (widths[type]) | ||
1064 | writel(bank->pm_save[type], reg + offs[type]); | ||
1065 | } | ||
1066 | } | ||
1067 | |||
1068 | /** | ||
1069 | * samsung_pinctrl_suspend - save pinctrl state for suspend | ||
1070 | * | ||
1071 | * Save data for all banks across all devices. | ||
1072 | */ | ||
1073 | static int samsung_pinctrl_suspend(void) | ||
1074 | { | ||
1075 | struct samsung_pinctrl_drv_data *drvdata; | ||
1076 | |||
1077 | list_for_each_entry(drvdata, &drvdata_list, node) { | ||
1078 | samsung_pinctrl_suspend_dev(drvdata); | ||
1079 | } | ||
1080 | |||
1081 | return 0; | ||
1082 | } | ||
1083 | |||
1084 | /** | ||
1085 | * samsung_pinctrl_resume - restore pinctrl state for suspend | ||
1086 | * | ||
1087 | * Restore data for all banks across all devices. | ||
1088 | */ | ||
1089 | static void samsung_pinctrl_resume(void) | ||
1090 | { | ||
1091 | struct samsung_pinctrl_drv_data *drvdata; | ||
1092 | |||
1093 | list_for_each_entry_reverse(drvdata, &drvdata_list, node) { | ||
1094 | samsung_pinctrl_resume_dev(drvdata); | ||
1095 | } | ||
1096 | } | ||
1097 | |||
1098 | #else | ||
1099 | #define samsung_pinctrl_suspend NULL | ||
1100 | #define samsung_pinctrl_resume NULL | ||
1101 | #endif | ||
1102 | |||
1103 | static struct syscore_ops samsung_pinctrl_syscore_ops = { | ||
1104 | .suspend = samsung_pinctrl_suspend, | ||
1105 | .resume = samsung_pinctrl_resume, | ||
1106 | }; | ||
1107 | |||
962 | static const struct of_device_id samsung_pinctrl_dt_match[] = { | 1108 | static const struct of_device_id samsung_pinctrl_dt_match[] = { |
963 | #ifdef CONFIG_PINCTRL_EXYNOS | 1109 | #ifdef CONFIG_PINCTRL_EXYNOS |
964 | { .compatible = "samsung,exynos4210-pinctrl", | 1110 | { .compatible = "samsung,exynos4210-pinctrl", |
@@ -987,6 +1133,14 @@ static struct platform_driver samsung_pinctrl_driver = { | |||
987 | 1133 | ||
988 | static int __init samsung_pinctrl_drv_register(void) | 1134 | static int __init samsung_pinctrl_drv_register(void) |
989 | { | 1135 | { |
1136 | /* | ||
1137 | * Register syscore ops for save/restore of registers across suspend. | ||
1138 | * It's important to ensure that this driver is running at an earlier | ||
1139 | * initcall level than any arch-specific init calls that install syscore | ||
1140 | * ops that turn off pad retention (like exynos_pm_resume). | ||
1141 | */ | ||
1142 | register_syscore_ops(&samsung_pinctrl_syscore_ops); | ||
1143 | |||
990 | return platform_driver_register(&samsung_pinctrl_driver); | 1144 | return platform_driver_register(&samsung_pinctrl_driver); |
991 | } | 1145 | } |
992 | postcore_initcall(samsung_pinctrl_drv_register); | 1146 | postcore_initcall(samsung_pinctrl_drv_register); |
diff --git a/drivers/pinctrl/pinctrl-samsung.h b/drivers/pinctrl/pinctrl-samsung.h index 7c7f9ebcd05b..26d3519240c9 100644 --- a/drivers/pinctrl/pinctrl-samsung.h +++ b/drivers/pinctrl/pinctrl-samsung.h | |||
@@ -127,6 +127,7 @@ struct samsung_pin_bank_type { | |||
127 | * @gpio_chip: GPIO chip of the bank. | 127 | * @gpio_chip: GPIO chip of the bank. |
128 | * @grange: linux gpio pin range supported by this bank. | 128 | * @grange: linux gpio pin range supported by this bank. |
129 | * @slock: spinlock protecting bank registers | 129 | * @slock: spinlock protecting bank registers |
130 | * @pm_save: saved register values during suspend | ||
130 | */ | 131 | */ |
131 | struct samsung_pin_bank { | 132 | struct samsung_pin_bank { |
132 | struct samsung_pin_bank_type *type; | 133 | struct samsung_pin_bank_type *type; |
@@ -138,12 +139,15 @@ struct samsung_pin_bank { | |||
138 | u32 eint_mask; | 139 | u32 eint_mask; |
139 | u32 eint_offset; | 140 | u32 eint_offset; |
140 | char *name; | 141 | char *name; |
142 | void *soc_priv; | ||
141 | struct device_node *of_node; | 143 | struct device_node *of_node; |
142 | struct samsung_pinctrl_drv_data *drvdata; | 144 | struct samsung_pinctrl_drv_data *drvdata; |
143 | struct irq_domain *irq_domain; | 145 | struct irq_domain *irq_domain; |
144 | struct gpio_chip gpio_chip; | 146 | struct gpio_chip gpio_chip; |
145 | struct pinctrl_gpio_range grange; | 147 | struct pinctrl_gpio_range grange; |
146 | spinlock_t slock; | 148 | spinlock_t slock; |
149 | |||
150 | u32 pm_save[PINCFG_TYPE_NUM + 1]; /* +1 to handle double CON registers*/ | ||
147 | }; | 151 | }; |
148 | 152 | ||
149 | /** | 153 | /** |
@@ -184,11 +188,15 @@ struct samsung_pin_ctrl { | |||
184 | 188 | ||
185 | int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); | 189 | int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); |
186 | int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); | 190 | int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); |
191 | void (*suspend)(struct samsung_pinctrl_drv_data *); | ||
192 | void (*resume)(struct samsung_pinctrl_drv_data *); | ||
193 | |||
187 | char *label; | 194 | char *label; |
188 | }; | 195 | }; |
189 | 196 | ||
190 | /** | 197 | /** |
191 | * struct samsung_pinctrl_drv_data: wrapper for holding driver data together. | 198 | * struct samsung_pinctrl_drv_data: wrapper for holding driver data together. |
199 | * @node: global list node | ||
192 | * @virt_base: register base address of the controller. | 200 | * @virt_base: register base address of the controller. |
193 | * @dev: device instance representing the controller. | 201 | * @dev: device instance representing the controller. |
194 | * @irq: interrpt number used by the controller to notify gpio interrupts. | 202 | * @irq: interrpt number used by the controller to notify gpio interrupts. |
@@ -201,6 +209,7 @@ struct samsung_pin_ctrl { | |||
201 | * @nr_function: number of such pin functions. | 209 | * @nr_function: number of such pin functions. |
202 | */ | 210 | */ |
203 | struct samsung_pinctrl_drv_data { | 211 | struct samsung_pinctrl_drv_data { |
212 | struct list_head node; | ||
204 | void __iomem *virt_base; | 213 | void __iomem *virt_base; |
205 | struct device *dev; | 214 | struct device *dev; |
206 | int irq; | 215 | int irq; |
diff --git a/drivers/pinctrl/pinctrl-sunxi.c b/drivers/pinctrl/pinctrl-sunxi.c index c52fc2c08732..b7d8c890514c 100644 --- a/drivers/pinctrl/pinctrl-sunxi.c +++ b/drivers/pinctrl/pinctrl-sunxi.c | |||
@@ -1990,8 +1990,10 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) | |||
1990 | } | 1990 | } |
1991 | 1991 | ||
1992 | clk = devm_clk_get(&pdev->dev, NULL); | 1992 | clk = devm_clk_get(&pdev->dev, NULL); |
1993 | if (IS_ERR(clk)) | 1993 | if (IS_ERR(clk)) { |
1994 | ret = PTR_ERR(clk); | ||
1994 | goto gpiochip_error; | 1995 | goto gpiochip_error; |
1996 | } | ||
1995 | 1997 | ||
1996 | clk_prepare_enable(clk); | 1998 | clk_prepare_enable(clk); |
1997 | 1999 | ||
@@ -2000,7 +2002,8 @@ static int sunxi_pinctrl_probe(struct platform_device *pdev) | |||
2000 | return 0; | 2002 | return 0; |
2001 | 2003 | ||
2002 | gpiochip_error: | 2004 | gpiochip_error: |
2003 | ret = gpiochip_remove(pctl->chip); | 2005 | if (gpiochip_remove(pctl->chip)) |
2006 | dev_err(&pdev->dev, "failed to remove gpio chip\n"); | ||
2004 | pinctrl_error: | 2007 | pinctrl_error: |
2005 | pinctrl_unregister(pctl->pctl_dev); | 2008 | pinctrl_unregister(pctl->pctl_dev); |
2006 | return ret; | 2009 | return ret; |
diff --git a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c index 791a6719d8a9..8cd90e7e945a 100644 --- a/drivers/pinctrl/sh-pfc/pfc-r8a7779.c +++ b/drivers/pinctrl/sh-pfc/pfc-r8a7779.c | |||
@@ -2357,27 +2357,48 @@ static const unsigned int sdhi3_wp_mux[] = { | |||
2357 | }; | 2357 | }; |
2358 | /* - USB0 ------------------------------------------------------------------- */ | 2358 | /* - USB0 ------------------------------------------------------------------- */ |
2359 | static const unsigned int usb0_pins[] = { | 2359 | static const unsigned int usb0_pins[] = { |
2360 | /* OVC */ | 2360 | /* PENC */ |
2361 | 150, 154, | 2361 | 154, |
2362 | }; | 2362 | }; |
2363 | static const unsigned int usb0_mux[] = { | 2363 | static const unsigned int usb0_mux[] = { |
2364 | USB_OVC0_MARK, USB_PENC0_MARK, | 2364 | USB_PENC0_MARK, |
2365 | }; | ||
2366 | static const unsigned int usb0_ovc_pins[] = { | ||
2367 | /* USB_OVC */ | ||
2368 | 150 | ||
2369 | }; | ||
2370 | static const unsigned int usb0_ovc_mux[] = { | ||
2371 | USB_OVC0_MARK, | ||
2365 | }; | 2372 | }; |
2366 | /* - USB1 ------------------------------------------------------------------- */ | 2373 | /* - USB1 ------------------------------------------------------------------- */ |
2367 | static const unsigned int usb1_pins[] = { | 2374 | static const unsigned int usb1_pins[] = { |
2368 | /* OVC */ | 2375 | /* PENC */ |
2369 | 152, 155, | 2376 | 155, |
2370 | }; | 2377 | }; |
2371 | static const unsigned int usb1_mux[] = { | 2378 | static const unsigned int usb1_mux[] = { |
2372 | USB_OVC1_MARK, USB_PENC1_MARK, | 2379 | USB_PENC1_MARK, |
2380 | }; | ||
2381 | static const unsigned int usb1_ovc_pins[] = { | ||
2382 | /* USB_OVC */ | ||
2383 | 152, | ||
2384 | }; | ||
2385 | static const unsigned int usb1_ovc_mux[] = { | ||
2386 | USB_OVC1_MARK, | ||
2373 | }; | 2387 | }; |
2374 | /* - USB2 ------------------------------------------------------------------- */ | 2388 | /* - USB2 ------------------------------------------------------------------- */ |
2375 | static const unsigned int usb2_pins[] = { | 2389 | static const unsigned int usb2_pins[] = { |
2376 | /* OVC, PENC */ | 2390 | /* PENC */ |
2377 | 125, 156, | 2391 | 156, |
2378 | }; | 2392 | }; |
2379 | static const unsigned int usb2_mux[] = { | 2393 | static const unsigned int usb2_mux[] = { |
2380 | USB_OVC2_MARK, USB_PENC2_MARK, | 2394 | USB_PENC2_MARK, |
2395 | }; | ||
2396 | static const unsigned int usb2_ovc_pins[] = { | ||
2397 | /* USB_OVC */ | ||
2398 | 125, | ||
2399 | }; | ||
2400 | static const unsigned int usb2_ovc_mux[] = { | ||
2401 | USB_OVC2_MARK, | ||
2381 | }; | 2402 | }; |
2382 | 2403 | ||
2383 | static const struct sh_pfc_pin_group pinmux_groups[] = { | 2404 | static const struct sh_pfc_pin_group pinmux_groups[] = { |
@@ -2501,8 +2522,11 @@ static const struct sh_pfc_pin_group pinmux_groups[] = { | |||
2501 | SH_PFC_PIN_GROUP(sdhi3_cd), | 2522 | SH_PFC_PIN_GROUP(sdhi3_cd), |
2502 | SH_PFC_PIN_GROUP(sdhi3_wp), | 2523 | SH_PFC_PIN_GROUP(sdhi3_wp), |
2503 | SH_PFC_PIN_GROUP(usb0), | 2524 | SH_PFC_PIN_GROUP(usb0), |
2525 | SH_PFC_PIN_GROUP(usb0_ovc), | ||
2504 | SH_PFC_PIN_GROUP(usb1), | 2526 | SH_PFC_PIN_GROUP(usb1), |
2527 | SH_PFC_PIN_GROUP(usb1_ovc), | ||
2505 | SH_PFC_PIN_GROUP(usb2), | 2528 | SH_PFC_PIN_GROUP(usb2), |
2529 | SH_PFC_PIN_GROUP(usb2_ovc), | ||
2506 | }; | 2530 | }; |
2507 | 2531 | ||
2508 | static const char * const du0_groups[] = { | 2532 | static const char * const du0_groups[] = { |
@@ -2683,14 +2707,17 @@ static const char * const sdhi3_groups[] = { | |||
2683 | 2707 | ||
2684 | static const char * const usb0_groups[] = { | 2708 | static const char * const usb0_groups[] = { |
2685 | "usb0", | 2709 | "usb0", |
2710 | "usb0_ovc", | ||
2686 | }; | 2711 | }; |
2687 | 2712 | ||
2688 | static const char * const usb1_groups[] = { | 2713 | static const char * const usb1_groups[] = { |
2689 | "usb1", | 2714 | "usb1", |
2715 | "usb1_ovc", | ||
2690 | }; | 2716 | }; |
2691 | 2717 | ||
2692 | static const char * const usb2_groups[] = { | 2718 | static const char * const usb2_groups[] = { |
2693 | "usb2", | 2719 | "usb2", |
2720 | "usb2_ovc", | ||
2694 | }; | 2721 | }; |
2695 | 2722 | ||
2696 | static const struct sh_pfc_function pinmux_functions[] = { | 2723 | static const struct sh_pfc_function pinmux_functions[] = { |
diff --git a/drivers/pinctrl/vt8500/pinctrl-wmt.c b/drivers/pinctrl/vt8500/pinctrl-wmt.c index ab63104e8dc9..70d986e04afb 100644 --- a/drivers/pinctrl/vt8500/pinctrl-wmt.c +++ b/drivers/pinctrl/vt8500/pinctrl-wmt.c | |||
@@ -609,8 +609,7 @@ int wmt_pinctrl_probe(struct platform_device *pdev, | |||
609 | return 0; | 609 | return 0; |
610 | 610 | ||
611 | fail_range: | 611 | fail_range: |
612 | err = gpiochip_remove(&data->gpio_chip); | 612 | if (gpiochip_remove(&data->gpio_chip)) |
613 | if (err) | ||
614 | dev_err(&pdev->dev, "failed to remove gpio chip\n"); | 613 | dev_err(&pdev->dev, "failed to remove gpio chip\n"); |
615 | fail_gpio: | 614 | fail_gpio: |
616 | pinctrl_unregister(data->pctl_dev); | 615 | pinctrl_unregister(data->pctl_dev); |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 8df0c5a21be2..d111c8687f9b 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -703,7 +703,7 @@ static int hp_wmi_rfkill_setup(struct platform_device *device) | |||
703 | } | 703 | } |
704 | rfkill_init_sw_state(gps_rfkill, | 704 | rfkill_init_sw_state(gps_rfkill, |
705 | hp_wmi_get_sw_state(HPWMI_GPS)); | 705 | hp_wmi_get_sw_state(HPWMI_GPS)); |
706 | rfkill_set_hw_state(bluetooth_rfkill, | 706 | rfkill_set_hw_state(gps_rfkill, |
707 | hp_wmi_get_hw_state(HPWMI_GPS)); | 707 | hp_wmi_get_hw_state(HPWMI_GPS)); |
708 | err = rfkill_register(gps_rfkill); | 708 | err = rfkill_register(gps_rfkill); |
709 | if (err) | 709 | if (err) |
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c index bea94510ad2d..71a2559278d7 100644 --- a/drivers/ptp/ptp_pch.c +++ b/drivers/ptp/ptp_pch.c | |||
@@ -628,9 +628,10 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
628 | 628 | ||
629 | chip->caps = ptp_pch_caps; | 629 | chip->caps = ptp_pch_caps; |
630 | chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev); | 630 | chip->ptp_clock = ptp_clock_register(&chip->caps, &pdev->dev); |
631 | 631 | if (IS_ERR(chip->ptp_clock)) { | |
632 | if (IS_ERR(chip->ptp_clock)) | 632 | ret = PTR_ERR(chip->ptp_clock); |
633 | return PTR_ERR(chip->ptp_clock); | 633 | goto err_ptp_clock_reg; |
634 | } | ||
634 | 635 | ||
635 | spin_lock_init(&chip->register_lock); | 636 | spin_lock_init(&chip->register_lock); |
636 | 637 | ||
@@ -669,6 +670,7 @@ pch_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
669 | 670 | ||
670 | err_req_irq: | 671 | err_req_irq: |
671 | ptp_clock_unregister(chip->ptp_clock); | 672 | ptp_clock_unregister(chip->ptp_clock); |
673 | err_ptp_clock_reg: | ||
672 | iounmap(chip->regs); | 674 | iounmap(chip->regs); |
673 | chip->regs = NULL; | 675 | chip->regs = NULL; |
674 | 676 | ||
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 6e5017841582..815d6df8bd5f 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1539,7 +1539,10 @@ static void regulator_ena_gpio_free(struct regulator_dev *rdev) | |||
1539 | } | 1539 | } |
1540 | 1540 | ||
1541 | /** | 1541 | /** |
1542 | * Balance enable_count of each GPIO and actual GPIO pin control. | 1542 | * regulator_ena_gpio_ctrl - balance enable_count of each GPIO and actual GPIO pin control |
1543 | * @rdev: regulator_dev structure | ||
1544 | * @enable: enable GPIO at initial use? | ||
1545 | * | ||
1543 | * GPIO is enabled in case of initial use. (enable_count is 0) | 1546 | * GPIO is enabled in case of initial use. (enable_count is 0) |
1544 | * GPIO is disabled when it is not shared any more. (enable_count <= 1) | 1547 | * GPIO is disabled when it is not shared any more. (enable_count <= 1) |
1545 | */ | 1548 | */ |
@@ -2702,7 +2705,7 @@ EXPORT_SYMBOL_GPL(regulator_get_voltage); | |||
2702 | /** | 2705 | /** |
2703 | * regulator_set_current_limit - set regulator output current limit | 2706 | * regulator_set_current_limit - set regulator output current limit |
2704 | * @regulator: regulator source | 2707 | * @regulator: regulator source |
2705 | * @min_uA: Minimuum supported current in uA | 2708 | * @min_uA: Minimum supported current in uA |
2706 | * @max_uA: Maximum supported current in uA | 2709 | * @max_uA: Maximum supported current in uA |
2707 | * | 2710 | * |
2708 | * Sets current sink to the desired output current. This can be set during | 2711 | * Sets current sink to the desired output current. This can be set during |
diff --git a/drivers/regulator/dbx500-prcmu.c b/drivers/regulator/dbx500-prcmu.c index 89bd2faaef8c..ce89f7848a57 100644 --- a/drivers/regulator/dbx500-prcmu.c +++ b/drivers/regulator/dbx500-prcmu.c | |||
@@ -24,18 +24,6 @@ | |||
24 | static int power_state_active_cnt; /* will initialize to zero */ | 24 | static int power_state_active_cnt; /* will initialize to zero */ |
25 | static DEFINE_SPINLOCK(power_state_active_lock); | 25 | static DEFINE_SPINLOCK(power_state_active_lock); |
26 | 26 | ||
27 | int power_state_active_get(void) | ||
28 | { | ||
29 | unsigned long flags; | ||
30 | int cnt; | ||
31 | |||
32 | spin_lock_irqsave(&power_state_active_lock, flags); | ||
33 | cnt = power_state_active_cnt; | ||
34 | spin_unlock_irqrestore(&power_state_active_lock, flags); | ||
35 | |||
36 | return cnt; | ||
37 | } | ||
38 | |||
39 | void power_state_active_enable(void) | 27 | void power_state_active_enable(void) |
40 | { | 28 | { |
41 | unsigned long flags; | 29 | unsigned long flags; |
@@ -65,6 +53,18 @@ out: | |||
65 | 53 | ||
66 | #ifdef CONFIG_REGULATOR_DEBUG | 54 | #ifdef CONFIG_REGULATOR_DEBUG |
67 | 55 | ||
56 | static int power_state_active_get(void) | ||
57 | { | ||
58 | unsigned long flags; | ||
59 | int cnt; | ||
60 | |||
61 | spin_lock_irqsave(&power_state_active_lock, flags); | ||
62 | cnt = power_state_active_cnt; | ||
63 | spin_unlock_irqrestore(&power_state_active_lock, flags); | ||
64 | |||
65 | return cnt; | ||
66 | } | ||
67 | |||
68 | static struct ux500_regulator_debug { | 68 | static struct ux500_regulator_debug { |
69 | struct dentry *dir; | 69 | struct dentry *dir; |
70 | struct dentry *status_file; | 70 | struct dentry *status_file; |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index 92ceed0fc65e..3ae44ac12a94 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -840,7 +840,7 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
840 | break; | 840 | break; |
841 | } | 841 | } |
842 | 842 | ||
843 | if ((id == PALMAS_REG_SMPS6) && (id == PALMAS_REG_SMPS8)) | 843 | if ((id == PALMAS_REG_SMPS6) || (id == PALMAS_REG_SMPS8)) |
844 | ramp_delay_support = true; | 844 | ramp_delay_support = true; |
845 | 845 | ||
846 | if (ramp_delay_support) { | 846 | if (ramp_delay_support) { |
@@ -878,7 +878,7 @@ static int palmas_regulators_probe(struct platform_device *pdev) | |||
878 | pmic->desc[id].vsel_mask = SMPS10_VSEL; | 878 | pmic->desc[id].vsel_mask = SMPS10_VSEL; |
879 | pmic->desc[id].enable_reg = | 879 | pmic->desc[id].enable_reg = |
880 | PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, | 880 | PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE, |
881 | PALMAS_SMPS10_STATUS); | 881 | PALMAS_SMPS10_CTRL); |
882 | pmic->desc[id].enable_mask = SMPS10_BOOST_EN; | 882 | pmic->desc[id].enable_mask = SMPS10_BOOST_EN; |
883 | pmic->desc[id].min_uV = 3750000; | 883 | pmic->desc[id].min_uV = 3750000; |
884 | pmic->desc[id].uV_step = 1250000; | 884 | pmic->desc[id].uV_step = 1250000; |
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 4361d9772c42..d72a9216ee2e 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -3440,8 +3440,16 @@ void dasd_generic_path_event(struct ccw_device *cdev, int *path_event) | |||
3440 | device->path_data.opm &= ~eventlpm; | 3440 | device->path_data.opm &= ~eventlpm; |
3441 | device->path_data.ppm &= ~eventlpm; | 3441 | device->path_data.ppm &= ~eventlpm; |
3442 | device->path_data.npm &= ~eventlpm; | 3442 | device->path_data.npm &= ~eventlpm; |
3443 | if (oldopm && !device->path_data.opm) | 3443 | if (oldopm && !device->path_data.opm) { |
3444 | dasd_generic_last_path_gone(device); | 3444 | dev_warn(&device->cdev->dev, |
3445 | "No verified channel paths remain " | ||
3446 | "for the device\n"); | ||
3447 | DBF_DEV_EVENT(DBF_WARNING, device, | ||
3448 | "%s", "last verified path gone"); | ||
3449 | dasd_eer_write(device, NULL, DASD_EER_NOPATH); | ||
3450 | dasd_device_set_stop_bits(device, | ||
3451 | DASD_STOPPED_DC_WAIT); | ||
3452 | } | ||
3445 | } | 3453 | } |
3446 | if (path_event[chp] & PE_PATH_AVAILABLE) { | 3454 | if (path_event[chp] & PE_PATH_AVAILABLE) { |
3447 | device->path_data.opm &= ~eventlpm; | 3455 | device->path_data.opm &= ~eventlpm; |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index d182c96e17ea..7a3870f385f6 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -1370,7 +1370,7 @@ static void tcm_qla2xxx_free_session(struct qla_tgt_sess *sess) | |||
1370 | dump_stack(); | 1370 | dump_stack(); |
1371 | return; | 1371 | return; |
1372 | } | 1372 | } |
1373 | target_wait_for_sess_cmds(se_sess, 0); | 1373 | target_wait_for_sess_cmds(se_sess); |
1374 | 1374 | ||
1375 | transport_deregister_session_configfs(sess->se_sess); | 1375 | transport_deregister_session_configfs(sess->se_sess); |
1376 | transport_deregister_session(sess->se_sess); | 1376 | transport_deregister_session(sess->se_sess); |
diff --git a/drivers/scsi/scsi_proc.c b/drivers/scsi/scsi_proc.c index db66357211ed..86f0c5d5c116 100644 --- a/drivers/scsi/scsi_proc.c +++ b/drivers/scsi/scsi_proc.c | |||
@@ -84,6 +84,7 @@ static int proc_scsi_host_open(struct inode *inode, struct file *file) | |||
84 | 84 | ||
85 | static const struct file_operations proc_scsi_fops = { | 85 | static const struct file_operations proc_scsi_fops = { |
86 | .open = proc_scsi_host_open, | 86 | .open = proc_scsi_host_open, |
87 | .release = single_release, | ||
87 | .read = seq_read, | 88 | .read = seq_read, |
88 | .llseek = seq_lseek, | 89 | .llseek = seq_lseek, |
89 | .write = proc_scsi_host_write | 90 | .write = proc_scsi_host_write |
diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c index ceb1c643753d..6dc27dac679d 100644 --- a/drivers/staging/android/alarm-dev.c +++ b/drivers/staging/android/alarm-dev.c | |||
@@ -264,6 +264,8 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
264 | } | 264 | } |
265 | 265 | ||
266 | rv = alarm_do_ioctl(file, cmd, &ts); | 266 | rv = alarm_do_ioctl(file, cmd, &ts); |
267 | if (rv) | ||
268 | return rv; | ||
267 | 269 | ||
268 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { | 270 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { |
269 | case ANDROID_ALARM_GET_TIME(0): | 271 | case ANDROID_ALARM_GET_TIME(0): |
@@ -272,7 +274,7 @@ static long alarm_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
272 | break; | 274 | break; |
273 | } | 275 | } |
274 | 276 | ||
275 | return rv; | 277 | return 0; |
276 | } | 278 | } |
277 | #ifdef CONFIG_COMPAT | 279 | #ifdef CONFIG_COMPAT |
278 | static long alarm_compat_ioctl(struct file *file, unsigned int cmd, | 280 | static long alarm_compat_ioctl(struct file *file, unsigned int cmd, |
@@ -295,6 +297,8 @@ static long alarm_compat_ioctl(struct file *file, unsigned int cmd, | |||
295 | } | 297 | } |
296 | 298 | ||
297 | rv = alarm_do_ioctl(file, cmd, &ts); | 299 | rv = alarm_do_ioctl(file, cmd, &ts); |
300 | if (rv) | ||
301 | return rv; | ||
298 | 302 | ||
299 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { | 303 | switch (ANDROID_ALARM_BASE_CMD(cmd)) { |
300 | case ANDROID_ALARM_GET_TIME(0): /* NOTE: we modified cmd above */ | 304 | case ANDROID_ALARM_GET_TIME(0): /* NOTE: we modified cmd above */ |
@@ -303,7 +307,7 @@ static long alarm_compat_ioctl(struct file *file, unsigned int cmd, | |||
303 | break; | 307 | break; |
304 | } | 308 | } |
305 | 309 | ||
306 | return rv; | 310 | return 0; |
307 | } | 311 | } |
308 | #endif | 312 | #endif |
309 | 313 | ||
diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c index 827ab781ae9b..8551ccedf037 100644 --- a/drivers/staging/dwc2/hcd.c +++ b/drivers/staging/dwc2/hcd.c | |||
@@ -2804,9 +2804,8 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq, | |||
2804 | 2804 | ||
2805 | /* Set device flags indicating whether the HCD supports DMA */ | 2805 | /* Set device flags indicating whether the HCD supports DMA */ |
2806 | if (hsotg->core_params->dma_enable > 0) { | 2806 | if (hsotg->core_params->dma_enable > 0) { |
2807 | if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) | 2807 | if (dma_set_mask(hsotg->dev, DMA_BIT_MASK(32)) < 0) |
2808 | dev_warn(hsotg->dev, | 2808 | dev_warn(hsotg->dev, "can't set DMA mask\n"); |
2809 | "can't enable workaround for >2GB RAM\n"); | ||
2810 | if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) | 2809 | if (dma_set_coherent_mask(hsotg->dev, DMA_BIT_MASK(31)) < 0) |
2811 | dev_warn(hsotg->dev, | 2810 | dev_warn(hsotg->dev, |
2812 | "can't enable workaround for >2GB RAM\n"); | 2811 | "can't enable workaround for >2GB RAM\n"); |
diff --git a/drivers/staging/imx-drm/ipuv3-crtc.c b/drivers/staging/imx-drm/ipuv3-crtc.c index ea61c869110f..ff5c63350932 100644 --- a/drivers/staging/imx-drm/ipuv3-crtc.c +++ b/drivers/staging/imx-drm/ipuv3-crtc.c | |||
@@ -316,31 +316,14 @@ static int ipu_crtc_mode_set(struct drm_crtc *crtc, | |||
316 | 316 | ||
317 | static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc) | 317 | static void ipu_crtc_handle_pageflip(struct ipu_crtc *ipu_crtc) |
318 | { | 318 | { |
319 | struct drm_pending_vblank_event *e; | ||
320 | struct timeval now; | ||
321 | unsigned long flags; | 319 | unsigned long flags; |
322 | struct drm_device *drm = ipu_crtc->base.dev; | 320 | struct drm_device *drm = ipu_crtc->base.dev; |
323 | 321 | ||
324 | spin_lock_irqsave(&drm->event_lock, flags); | 322 | spin_lock_irqsave(&drm->event_lock, flags); |
325 | 323 | if (ipu_crtc->page_flip_event) | |
326 | e = ipu_crtc->page_flip_event; | 324 | drm_send_vblank_event(drm, -1, ipu_crtc->page_flip_event); |
327 | if (!e) { | ||
328 | spin_unlock_irqrestore(&drm->event_lock, flags); | ||
329 | return; | ||
330 | } | ||
331 | |||
332 | do_gettimeofday(&now); | ||
333 | e->event.sequence = 0; | ||
334 | e->event.tv_sec = now.tv_sec; | ||
335 | e->event.tv_usec = now.tv_usec; | ||
336 | ipu_crtc->page_flip_event = NULL; | 325 | ipu_crtc->page_flip_event = NULL; |
337 | |||
338 | imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc); | 326 | imx_drm_crtc_vblank_put(ipu_crtc->imx_crtc); |
339 | |||
340 | list_add_tail(&e->base.link, &e->base.file_priv->event_list); | ||
341 | |||
342 | wake_up_interruptible(&e->base.file_priv->event_wait); | ||
343 | |||
344 | spin_unlock_irqrestore(&drm->event_lock, flags); | 327 | spin_unlock_irqrestore(&drm->event_lock, flags); |
345 | } | 328 | } |
346 | 329 | ||
diff --git a/drivers/staging/zcache/ramster.h b/drivers/staging/zcache/ramster.h index e1f91d5a0f6a..a858666eae68 100644 --- a/drivers/staging/zcache/ramster.h +++ b/drivers/staging/zcache/ramster.h | |||
@@ -11,10 +11,6 @@ | |||
11 | #ifndef _ZCACHE_RAMSTER_H_ | 11 | #ifndef _ZCACHE_RAMSTER_H_ |
12 | #define _ZCACHE_RAMSTER_H_ | 12 | #define _ZCACHE_RAMSTER_H_ |
13 | 13 | ||
14 | #ifdef CONFIG_RAMSTER_MODULE | ||
15 | #define CONFIG_RAMSTER | ||
16 | #endif | ||
17 | |||
18 | #ifdef CONFIG_RAMSTER | 14 | #ifdef CONFIG_RAMSTER |
19 | #include "ramster/ramster.h" | 15 | #include "ramster/ramster.h" |
20 | #else | 16 | #else |
diff --git a/drivers/staging/zcache/ramster/debug.c b/drivers/staging/zcache/ramster/debug.c index 327e4f0d98e1..5b26ee977c2f 100644 --- a/drivers/staging/zcache/ramster/debug.c +++ b/drivers/staging/zcache/ramster/debug.c | |||
@@ -1,6 +1,8 @@ | |||
1 | #include <linux/atomic.h> | 1 | #include <linux/atomic.h> |
2 | #include "debug.h" | 2 | #include "debug.h" |
3 | 3 | ||
4 | ssize_t ramster_foreign_eph_pages; | ||
5 | ssize_t ramster_foreign_pers_pages; | ||
4 | #ifdef CONFIG_DEBUG_FS | 6 | #ifdef CONFIG_DEBUG_FS |
5 | #include <linux/debugfs.h> | 7 | #include <linux/debugfs.h> |
6 | 8 | ||
diff --git a/drivers/staging/zcache/ramster/ramster.c b/drivers/staging/zcache/ramster/ramster.c index b18b887db79f..a937ce1fa27a 100644 --- a/drivers/staging/zcache/ramster/ramster.c +++ b/drivers/staging/zcache/ramster/ramster.c | |||
@@ -66,8 +66,6 @@ static int ramster_remote_target_nodenum __read_mostly = -1; | |||
66 | 66 | ||
67 | /* Used by this code. */ | 67 | /* Used by this code. */ |
68 | long ramster_flnodes; | 68 | long ramster_flnodes; |
69 | ssize_t ramster_foreign_eph_pages; | ||
70 | ssize_t ramster_foreign_pers_pages; | ||
71 | /* FIXME frontswap selfshrinking knobs in debugfs? */ | 69 | /* FIXME frontswap selfshrinking knobs in debugfs? */ |
72 | 70 | ||
73 | static LIST_HEAD(ramster_rem_op_list); | 71 | static LIST_HEAD(ramster_rem_op_list); |
@@ -399,14 +397,18 @@ void ramster_count_foreign_pages(bool eph, int count) | |||
399 | inc_ramster_foreign_eph_pages(); | 397 | inc_ramster_foreign_eph_pages(); |
400 | } else { | 398 | } else { |
401 | dec_ramster_foreign_eph_pages(); | 399 | dec_ramster_foreign_eph_pages(); |
400 | #ifdef CONFIG_RAMSTER_DEBUG | ||
402 | WARN_ON_ONCE(ramster_foreign_eph_pages < 0); | 401 | WARN_ON_ONCE(ramster_foreign_eph_pages < 0); |
402 | #endif | ||
403 | } | 403 | } |
404 | } else { | 404 | } else { |
405 | if (count > 0) { | 405 | if (count > 0) { |
406 | inc_ramster_foreign_pers_pages(); | 406 | inc_ramster_foreign_pers_pages(); |
407 | } else { | 407 | } else { |
408 | dec_ramster_foreign_pers_pages(); | 408 | dec_ramster_foreign_pers_pages(); |
409 | #ifdef CONFIG_RAMSTER_DEBUG | ||
409 | WARN_ON_ONCE(ramster_foreign_pers_pages < 0); | 410 | WARN_ON_ONCE(ramster_foreign_pers_pages < 0); |
411 | #endif | ||
410 | } | 412 | } |
411 | } | 413 | } |
412 | } | 414 | } |
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 262ef1f23b38..d7705e5824fb 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -651,7 +651,7 @@ static int iscsit_add_reject( | |||
651 | cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL); | 651 | cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL); |
652 | if (!cmd->buf_ptr) { | 652 | if (!cmd->buf_ptr) { |
653 | pr_err("Unable to allocate memory for cmd->buf_ptr\n"); | 653 | pr_err("Unable to allocate memory for cmd->buf_ptr\n"); |
654 | iscsit_release_cmd(cmd); | 654 | iscsit_free_cmd(cmd, false); |
655 | return -1; | 655 | return -1; |
656 | } | 656 | } |
657 | 657 | ||
@@ -697,7 +697,7 @@ int iscsit_add_reject_from_cmd( | |||
697 | cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL); | 697 | cmd->buf_ptr = kmemdup(buf, ISCSI_HDR_LEN, GFP_KERNEL); |
698 | if (!cmd->buf_ptr) { | 698 | if (!cmd->buf_ptr) { |
699 | pr_err("Unable to allocate memory for cmd->buf_ptr\n"); | 699 | pr_err("Unable to allocate memory for cmd->buf_ptr\n"); |
700 | iscsit_release_cmd(cmd); | 700 | iscsit_free_cmd(cmd, false); |
701 | return -1; | 701 | return -1; |
702 | } | 702 | } |
703 | 703 | ||
@@ -1743,7 +1743,7 @@ int iscsit_handle_nop_out(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
1743 | return 0; | 1743 | return 0; |
1744 | out: | 1744 | out: |
1745 | if (cmd) | 1745 | if (cmd) |
1746 | iscsit_release_cmd(cmd); | 1746 | iscsit_free_cmd(cmd, false); |
1747 | ping_out: | 1747 | ping_out: |
1748 | kfree(ping_data); | 1748 | kfree(ping_data); |
1749 | return ret; | 1749 | return ret; |
@@ -2251,7 +2251,7 @@ iscsit_handle_logout_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
2251 | if (conn->conn_state != TARG_CONN_STATE_LOGGED_IN) { | 2251 | if (conn->conn_state != TARG_CONN_STATE_LOGGED_IN) { |
2252 | pr_err("Received logout request on connection that" | 2252 | pr_err("Received logout request on connection that" |
2253 | " is not in logged in state, ignoring request.\n"); | 2253 | " is not in logged in state, ignoring request.\n"); |
2254 | iscsit_release_cmd(cmd); | 2254 | iscsit_free_cmd(cmd, false); |
2255 | return 0; | 2255 | return 0; |
2256 | } | 2256 | } |
2257 | 2257 | ||
@@ -3665,7 +3665,7 @@ iscsit_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state | |||
3665 | list_del(&cmd->i_conn_node); | 3665 | list_del(&cmd->i_conn_node); |
3666 | spin_unlock_bh(&conn->cmd_lock); | 3666 | spin_unlock_bh(&conn->cmd_lock); |
3667 | 3667 | ||
3668 | iscsit_free_cmd(cmd); | 3668 | iscsit_free_cmd(cmd, false); |
3669 | break; | 3669 | break; |
3670 | case ISTATE_SEND_NOPIN_WANT_RESPONSE: | 3670 | case ISTATE_SEND_NOPIN_WANT_RESPONSE: |
3671 | iscsit_mod_nopin_response_timer(conn); | 3671 | iscsit_mod_nopin_response_timer(conn); |
@@ -4122,7 +4122,7 @@ static void iscsit_release_commands_from_conn(struct iscsi_conn *conn) | |||
4122 | 4122 | ||
4123 | iscsit_increment_maxcmdsn(cmd, sess); | 4123 | iscsit_increment_maxcmdsn(cmd, sess); |
4124 | 4124 | ||
4125 | iscsit_free_cmd(cmd); | 4125 | iscsit_free_cmd(cmd, true); |
4126 | 4126 | ||
4127 | spin_lock_bh(&conn->cmd_lock); | 4127 | spin_lock_bh(&conn->cmd_lock); |
4128 | } | 4128 | } |
diff --git a/drivers/target/iscsi/iscsi_target_erl2.c b/drivers/target/iscsi/iscsi_target_erl2.c index ba6091bf93fc..45a5afd5ea13 100644 --- a/drivers/target/iscsi/iscsi_target_erl2.c +++ b/drivers/target/iscsi/iscsi_target_erl2.c | |||
@@ -143,7 +143,7 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess) | |||
143 | list_del(&cmd->i_conn_node); | 143 | list_del(&cmd->i_conn_node); |
144 | cmd->conn = NULL; | 144 | cmd->conn = NULL; |
145 | spin_unlock(&cr->conn_recovery_cmd_lock); | 145 | spin_unlock(&cr->conn_recovery_cmd_lock); |
146 | iscsit_free_cmd(cmd); | 146 | iscsit_free_cmd(cmd, true); |
147 | spin_lock(&cr->conn_recovery_cmd_lock); | 147 | spin_lock(&cr->conn_recovery_cmd_lock); |
148 | } | 148 | } |
149 | spin_unlock(&cr->conn_recovery_cmd_lock); | 149 | spin_unlock(&cr->conn_recovery_cmd_lock); |
@@ -165,7 +165,7 @@ void iscsit_free_connection_recovery_entires(struct iscsi_session *sess) | |||
165 | list_del(&cmd->i_conn_node); | 165 | list_del(&cmd->i_conn_node); |
166 | cmd->conn = NULL; | 166 | cmd->conn = NULL; |
167 | spin_unlock(&cr->conn_recovery_cmd_lock); | 167 | spin_unlock(&cr->conn_recovery_cmd_lock); |
168 | iscsit_free_cmd(cmd); | 168 | iscsit_free_cmd(cmd, true); |
169 | spin_lock(&cr->conn_recovery_cmd_lock); | 169 | spin_lock(&cr->conn_recovery_cmd_lock); |
170 | } | 170 | } |
171 | spin_unlock(&cr->conn_recovery_cmd_lock); | 171 | spin_unlock(&cr->conn_recovery_cmd_lock); |
@@ -248,7 +248,7 @@ void iscsit_discard_cr_cmds_by_expstatsn( | |||
248 | iscsit_remove_cmd_from_connection_recovery(cmd, sess); | 248 | iscsit_remove_cmd_from_connection_recovery(cmd, sess); |
249 | 249 | ||
250 | spin_unlock(&cr->conn_recovery_cmd_lock); | 250 | spin_unlock(&cr->conn_recovery_cmd_lock); |
251 | iscsit_free_cmd(cmd); | 251 | iscsit_free_cmd(cmd, true); |
252 | spin_lock(&cr->conn_recovery_cmd_lock); | 252 | spin_lock(&cr->conn_recovery_cmd_lock); |
253 | } | 253 | } |
254 | spin_unlock(&cr->conn_recovery_cmd_lock); | 254 | spin_unlock(&cr->conn_recovery_cmd_lock); |
@@ -302,7 +302,7 @@ int iscsit_discard_unacknowledged_ooo_cmdsns_for_conn(struct iscsi_conn *conn) | |||
302 | list_del(&cmd->i_conn_node); | 302 | list_del(&cmd->i_conn_node); |
303 | 303 | ||
304 | spin_unlock_bh(&conn->cmd_lock); | 304 | spin_unlock_bh(&conn->cmd_lock); |
305 | iscsit_free_cmd(cmd); | 305 | iscsit_free_cmd(cmd, true); |
306 | spin_lock_bh(&conn->cmd_lock); | 306 | spin_lock_bh(&conn->cmd_lock); |
307 | } | 307 | } |
308 | spin_unlock_bh(&conn->cmd_lock); | 308 | spin_unlock_bh(&conn->cmd_lock); |
@@ -355,7 +355,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn) | |||
355 | 355 | ||
356 | list_del(&cmd->i_conn_node); | 356 | list_del(&cmd->i_conn_node); |
357 | spin_unlock_bh(&conn->cmd_lock); | 357 | spin_unlock_bh(&conn->cmd_lock); |
358 | iscsit_free_cmd(cmd); | 358 | iscsit_free_cmd(cmd, true); |
359 | spin_lock_bh(&conn->cmd_lock); | 359 | spin_lock_bh(&conn->cmd_lock); |
360 | continue; | 360 | continue; |
361 | } | 361 | } |
@@ -375,7 +375,7 @@ int iscsit_prepare_cmds_for_realligance(struct iscsi_conn *conn) | |||
375 | iscsi_sna_gte(cmd->cmd_sn, conn->sess->exp_cmd_sn)) { | 375 | iscsi_sna_gte(cmd->cmd_sn, conn->sess->exp_cmd_sn)) { |
376 | list_del(&cmd->i_conn_node); | 376 | list_del(&cmd->i_conn_node); |
377 | spin_unlock_bh(&conn->cmd_lock); | 377 | spin_unlock_bh(&conn->cmd_lock); |
378 | iscsit_free_cmd(cmd); | 378 | iscsit_free_cmd(cmd, true); |
379 | spin_lock_bh(&conn->cmd_lock); | 379 | spin_lock_bh(&conn->cmd_lock); |
380 | continue; | 380 | continue; |
381 | } | 381 | } |
diff --git a/drivers/target/iscsi/iscsi_target_parameters.c b/drivers/target/iscsi/iscsi_target_parameters.c index c2185fc31136..e38222191a33 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.c +++ b/drivers/target/iscsi/iscsi_target_parameters.c | |||
@@ -758,9 +758,9 @@ static int iscsi_add_notunderstood_response( | |||
758 | } | 758 | } |
759 | INIT_LIST_HEAD(&extra_response->er_list); | 759 | INIT_LIST_HEAD(&extra_response->er_list); |
760 | 760 | ||
761 | strncpy(extra_response->key, key, strlen(key) + 1); | 761 | strlcpy(extra_response->key, key, sizeof(extra_response->key)); |
762 | strncpy(extra_response->value, NOTUNDERSTOOD, | 762 | strlcpy(extra_response->value, NOTUNDERSTOOD, |
763 | strlen(NOTUNDERSTOOD) + 1); | 763 | sizeof(extra_response->value)); |
764 | 764 | ||
765 | list_add_tail(&extra_response->er_list, | 765 | list_add_tail(&extra_response->er_list, |
766 | ¶m_list->extra_response_list); | 766 | ¶m_list->extra_response_list); |
@@ -1629,8 +1629,6 @@ int iscsi_decode_text_input( | |||
1629 | 1629 | ||
1630 | if (phase & PHASE_SECURITY) { | 1630 | if (phase & PHASE_SECURITY) { |
1631 | if (iscsi_check_for_auth_key(key) > 0) { | 1631 | if (iscsi_check_for_auth_key(key) > 0) { |
1632 | char *tmpptr = key + strlen(key); | ||
1633 | *tmpptr = '='; | ||
1634 | kfree(tmpbuf); | 1632 | kfree(tmpbuf); |
1635 | return 1; | 1633 | return 1; |
1636 | } | 1634 | } |
diff --git a/drivers/target/iscsi/iscsi_target_parameters.h b/drivers/target/iscsi/iscsi_target_parameters.h index 915b06798505..a47046a752aa 100644 --- a/drivers/target/iscsi/iscsi_target_parameters.h +++ b/drivers/target/iscsi/iscsi_target_parameters.h | |||
@@ -1,8 +1,10 @@ | |||
1 | #ifndef ISCSI_PARAMETERS_H | 1 | #ifndef ISCSI_PARAMETERS_H |
2 | #define ISCSI_PARAMETERS_H | 2 | #define ISCSI_PARAMETERS_H |
3 | 3 | ||
4 | #include <scsi/iscsi_proto.h> | ||
5 | |||
4 | struct iscsi_extra_response { | 6 | struct iscsi_extra_response { |
5 | char key[64]; | 7 | char key[KEY_MAXLEN]; |
6 | char value[32]; | 8 | char value[32]; |
7 | struct list_head er_list; | 9 | struct list_head er_list; |
8 | } ____cacheline_aligned; | 10 | } ____cacheline_aligned; |
diff --git a/drivers/target/iscsi/iscsi_target_util.c b/drivers/target/iscsi/iscsi_target_util.c index 2cc6c9a3ffb8..08a3bacef0c5 100644 --- a/drivers/target/iscsi/iscsi_target_util.c +++ b/drivers/target/iscsi/iscsi_target_util.c | |||
@@ -676,40 +676,56 @@ void iscsit_free_queue_reqs_for_conn(struct iscsi_conn *conn) | |||
676 | 676 | ||
677 | void iscsit_release_cmd(struct iscsi_cmd *cmd) | 677 | void iscsit_release_cmd(struct iscsi_cmd *cmd) |
678 | { | 678 | { |
679 | struct iscsi_conn *conn = cmd->conn; | ||
680 | |||
681 | iscsit_free_r2ts_from_list(cmd); | ||
682 | iscsit_free_all_datain_reqs(cmd); | ||
683 | |||
684 | kfree(cmd->buf_ptr); | 679 | kfree(cmd->buf_ptr); |
685 | kfree(cmd->pdu_list); | 680 | kfree(cmd->pdu_list); |
686 | kfree(cmd->seq_list); | 681 | kfree(cmd->seq_list); |
687 | kfree(cmd->tmr_req); | 682 | kfree(cmd->tmr_req); |
688 | kfree(cmd->iov_data); | 683 | kfree(cmd->iov_data); |
689 | 684 | ||
690 | if (conn) { | 685 | kmem_cache_free(lio_cmd_cache, cmd); |
686 | } | ||
687 | |||
688 | static void __iscsit_free_cmd(struct iscsi_cmd *cmd, bool scsi_cmd, | ||
689 | bool check_queues) | ||
690 | { | ||
691 | struct iscsi_conn *conn = cmd->conn; | ||
692 | |||
693 | if (scsi_cmd) { | ||
694 | if (cmd->data_direction == DMA_TO_DEVICE) { | ||
695 | iscsit_stop_dataout_timer(cmd); | ||
696 | iscsit_free_r2ts_from_list(cmd); | ||
697 | } | ||
698 | if (cmd->data_direction == DMA_FROM_DEVICE) | ||
699 | iscsit_free_all_datain_reqs(cmd); | ||
700 | } | ||
701 | |||
702 | if (conn && check_queues) { | ||
691 | iscsit_remove_cmd_from_immediate_queue(cmd, conn); | 703 | iscsit_remove_cmd_from_immediate_queue(cmd, conn); |
692 | iscsit_remove_cmd_from_response_queue(cmd, conn); | 704 | iscsit_remove_cmd_from_response_queue(cmd, conn); |
693 | } | 705 | } |
694 | |||
695 | kmem_cache_free(lio_cmd_cache, cmd); | ||
696 | } | 706 | } |
697 | 707 | ||
698 | void iscsit_free_cmd(struct iscsi_cmd *cmd) | 708 | void iscsit_free_cmd(struct iscsi_cmd *cmd, bool shutdown) |
699 | { | 709 | { |
710 | struct se_cmd *se_cmd = NULL; | ||
711 | int rc; | ||
700 | /* | 712 | /* |
701 | * Determine if a struct se_cmd is associated with | 713 | * Determine if a struct se_cmd is associated with |
702 | * this struct iscsi_cmd. | 714 | * this struct iscsi_cmd. |
703 | */ | 715 | */ |
704 | switch (cmd->iscsi_opcode) { | 716 | switch (cmd->iscsi_opcode) { |
705 | case ISCSI_OP_SCSI_CMD: | 717 | case ISCSI_OP_SCSI_CMD: |
706 | if (cmd->data_direction == DMA_TO_DEVICE) | 718 | se_cmd = &cmd->se_cmd; |
707 | iscsit_stop_dataout_timer(cmd); | 719 | __iscsit_free_cmd(cmd, true, shutdown); |
708 | /* | 720 | /* |
709 | * Fallthrough | 721 | * Fallthrough |
710 | */ | 722 | */ |
711 | case ISCSI_OP_SCSI_TMFUNC: | 723 | case ISCSI_OP_SCSI_TMFUNC: |
712 | transport_generic_free_cmd(&cmd->se_cmd, 1); | 724 | rc = transport_generic_free_cmd(&cmd->se_cmd, 1); |
725 | if (!rc && shutdown && se_cmd && se_cmd->se_sess) { | ||
726 | __iscsit_free_cmd(cmd, true, shutdown); | ||
727 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); | ||
728 | } | ||
713 | break; | 729 | break; |
714 | case ISCSI_OP_REJECT: | 730 | case ISCSI_OP_REJECT: |
715 | /* | 731 | /* |
@@ -718,11 +734,19 @@ void iscsit_free_cmd(struct iscsi_cmd *cmd) | |||
718 | * associated cmd->se_cmd needs to be released. | 734 | * associated cmd->se_cmd needs to be released. |
719 | */ | 735 | */ |
720 | if (cmd->se_cmd.se_tfo != NULL) { | 736 | if (cmd->se_cmd.se_tfo != NULL) { |
721 | transport_generic_free_cmd(&cmd->se_cmd, 1); | 737 | se_cmd = &cmd->se_cmd; |
738 | __iscsit_free_cmd(cmd, true, shutdown); | ||
739 | |||
740 | rc = transport_generic_free_cmd(&cmd->se_cmd, 1); | ||
741 | if (!rc && shutdown && se_cmd->se_sess) { | ||
742 | __iscsit_free_cmd(cmd, true, shutdown); | ||
743 | target_put_sess_cmd(se_cmd->se_sess, se_cmd); | ||
744 | } | ||
722 | break; | 745 | break; |
723 | } | 746 | } |
724 | /* Fall-through */ | 747 | /* Fall-through */ |
725 | default: | 748 | default: |
749 | __iscsit_free_cmd(cmd, false, shutdown); | ||
726 | cmd->release_cmd(cmd); | 750 | cmd->release_cmd(cmd); |
727 | break; | 751 | break; |
728 | } | 752 | } |
diff --git a/drivers/target/iscsi/iscsi_target_util.h b/drivers/target/iscsi/iscsi_target_util.h index 4f8e01a47081..a4422659d049 100644 --- a/drivers/target/iscsi/iscsi_target_util.h +++ b/drivers/target/iscsi/iscsi_target_util.h | |||
@@ -29,7 +29,7 @@ extern void iscsit_remove_cmd_from_tx_queues(struct iscsi_cmd *, struct iscsi_co | |||
29 | extern bool iscsit_conn_all_queues_empty(struct iscsi_conn *); | 29 | extern bool iscsit_conn_all_queues_empty(struct iscsi_conn *); |
30 | extern void iscsit_free_queue_reqs_for_conn(struct iscsi_conn *); | 30 | extern void iscsit_free_queue_reqs_for_conn(struct iscsi_conn *); |
31 | extern void iscsit_release_cmd(struct iscsi_cmd *); | 31 | extern void iscsit_release_cmd(struct iscsi_cmd *); |
32 | extern void iscsit_free_cmd(struct iscsi_cmd *); | 32 | extern void iscsit_free_cmd(struct iscsi_cmd *, bool); |
33 | extern int iscsit_check_session_usage_count(struct iscsi_session *); | 33 | extern int iscsit_check_session_usage_count(struct iscsi_session *); |
34 | extern void iscsit_dec_session_usage_count(struct iscsi_session *); | 34 | extern void iscsit_dec_session_usage_count(struct iscsi_session *); |
35 | extern void iscsit_inc_session_usage_count(struct iscsi_session *); | 35 | extern void iscsit_inc_session_usage_count(struct iscsi_session *); |
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 1b1d544e927a..b11890d85120 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -153,6 +153,7 @@ static int fd_configure_device(struct se_device *dev) | |||
153 | struct request_queue *q = bdev_get_queue(inode->i_bdev); | 153 | struct request_queue *q = bdev_get_queue(inode->i_bdev); |
154 | unsigned long long dev_size; | 154 | unsigned long long dev_size; |
155 | 155 | ||
156 | fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev); | ||
156 | /* | 157 | /* |
157 | * Determine the number of bytes from i_size_read() minus | 158 | * Determine the number of bytes from i_size_read() minus |
158 | * one (1) logical sector from underlying struct block_device | 159 | * one (1) logical sector from underlying struct block_device |
@@ -199,6 +200,7 @@ static int fd_configure_device(struct se_device *dev) | |||
199 | goto fail; | 200 | goto fail; |
200 | } | 201 | } |
201 | 202 | ||
203 | fd_dev->fd_block_size = FD_BLOCKSIZE; | ||
202 | /* | 204 | /* |
203 | * Limit UNMAP emulation to 8k Number of LBAs (NoLB) | 205 | * Limit UNMAP emulation to 8k Number of LBAs (NoLB) |
204 | */ | 206 | */ |
@@ -217,9 +219,7 @@ static int fd_configure_device(struct se_device *dev) | |||
217 | dev->dev_attrib.max_write_same_len = 0x1000; | 219 | dev->dev_attrib.max_write_same_len = 0x1000; |
218 | } | 220 | } |
219 | 221 | ||
220 | fd_dev->fd_block_size = dev->dev_attrib.hw_block_size; | 222 | dev->dev_attrib.hw_block_size = fd_dev->fd_block_size; |
221 | |||
222 | dev->dev_attrib.hw_block_size = FD_BLOCKSIZE; | ||
223 | dev->dev_attrib.hw_max_sectors = FD_MAX_SECTORS; | 223 | dev->dev_attrib.hw_max_sectors = FD_MAX_SECTORS; |
224 | dev->dev_attrib.hw_queue_depth = FD_MAX_DEVICE_QUEUE_DEPTH; | 224 | dev->dev_attrib.hw_queue_depth = FD_MAX_DEVICE_QUEUE_DEPTH; |
225 | 225 | ||
@@ -694,11 +694,12 @@ static sector_t fd_get_blocks(struct se_device *dev) | |||
694 | * to handle underlying block_device resize operations. | 694 | * to handle underlying block_device resize operations. |
695 | */ | 695 | */ |
696 | if (S_ISBLK(i->i_mode)) | 696 | if (S_ISBLK(i->i_mode)) |
697 | dev_size = (i_size_read(i) - fd_dev->fd_block_size); | 697 | dev_size = i_size_read(i); |
698 | else | 698 | else |
699 | dev_size = fd_dev->fd_dev_size; | 699 | dev_size = fd_dev->fd_dev_size; |
700 | 700 | ||
701 | return div_u64(dev_size, dev->dev_attrib.block_size); | 701 | return div_u64(dev_size - dev->dev_attrib.block_size, |
702 | dev->dev_attrib.block_size); | ||
702 | } | 703 | } |
703 | 704 | ||
704 | static struct sbc_ops fd_sbc_ops = { | 705 | static struct sbc_ops fd_sbc_ops = { |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 4a793362309d..21e315874a54 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -65,7 +65,7 @@ static void transport_complete_task_attr(struct se_cmd *cmd); | |||
65 | static void transport_handle_queue_full(struct se_cmd *cmd, | 65 | static void transport_handle_queue_full(struct se_cmd *cmd, |
66 | struct se_device *dev); | 66 | struct se_device *dev); |
67 | static int transport_generic_get_mem(struct se_cmd *cmd); | 67 | static int transport_generic_get_mem(struct se_cmd *cmd); |
68 | static void transport_put_cmd(struct se_cmd *cmd); | 68 | static int transport_put_cmd(struct se_cmd *cmd); |
69 | static void target_complete_ok_work(struct work_struct *work); | 69 | static void target_complete_ok_work(struct work_struct *work); |
70 | 70 | ||
71 | int init_se_kmem_caches(void) | 71 | int init_se_kmem_caches(void) |
@@ -221,6 +221,7 @@ struct se_session *transport_init_session(void) | |||
221 | INIT_LIST_HEAD(&se_sess->sess_list); | 221 | INIT_LIST_HEAD(&se_sess->sess_list); |
222 | INIT_LIST_HEAD(&se_sess->sess_acl_list); | 222 | INIT_LIST_HEAD(&se_sess->sess_acl_list); |
223 | INIT_LIST_HEAD(&se_sess->sess_cmd_list); | 223 | INIT_LIST_HEAD(&se_sess->sess_cmd_list); |
224 | INIT_LIST_HEAD(&se_sess->sess_wait_list); | ||
224 | spin_lock_init(&se_sess->sess_cmd_lock); | 225 | spin_lock_init(&se_sess->sess_cmd_lock); |
225 | kref_init(&se_sess->sess_kref); | 226 | kref_init(&se_sess->sess_kref); |
226 | 227 | ||
@@ -1943,7 +1944,7 @@ static inline void transport_free_pages(struct se_cmd *cmd) | |||
1943 | * This routine unconditionally frees a command, and reference counting | 1944 | * This routine unconditionally frees a command, and reference counting |
1944 | * or list removal must be done in the caller. | 1945 | * or list removal must be done in the caller. |
1945 | */ | 1946 | */ |
1946 | static void transport_release_cmd(struct se_cmd *cmd) | 1947 | static int transport_release_cmd(struct se_cmd *cmd) |
1947 | { | 1948 | { |
1948 | BUG_ON(!cmd->se_tfo); | 1949 | BUG_ON(!cmd->se_tfo); |
1949 | 1950 | ||
@@ -1955,11 +1956,11 @@ static void transport_release_cmd(struct se_cmd *cmd) | |||
1955 | * If this cmd has been setup with target_get_sess_cmd(), drop | 1956 | * If this cmd has been setup with target_get_sess_cmd(), drop |
1956 | * the kref and call ->release_cmd() in kref callback. | 1957 | * the kref and call ->release_cmd() in kref callback. |
1957 | */ | 1958 | */ |
1958 | if (cmd->check_release != 0) { | 1959 | if (cmd->check_release != 0) |
1959 | target_put_sess_cmd(cmd->se_sess, cmd); | 1960 | return target_put_sess_cmd(cmd->se_sess, cmd); |
1960 | return; | 1961 | |
1961 | } | ||
1962 | cmd->se_tfo->release_cmd(cmd); | 1962 | cmd->se_tfo->release_cmd(cmd); |
1963 | return 1; | ||
1963 | } | 1964 | } |
1964 | 1965 | ||
1965 | /** | 1966 | /** |
@@ -1968,7 +1969,7 @@ static void transport_release_cmd(struct se_cmd *cmd) | |||
1968 | * | 1969 | * |
1969 | * This routine releases our reference to the command and frees it if possible. | 1970 | * This routine releases our reference to the command and frees it if possible. |
1970 | */ | 1971 | */ |
1971 | static void transport_put_cmd(struct se_cmd *cmd) | 1972 | static int transport_put_cmd(struct se_cmd *cmd) |
1972 | { | 1973 | { |
1973 | unsigned long flags; | 1974 | unsigned long flags; |
1974 | 1975 | ||
@@ -1976,7 +1977,7 @@ static void transport_put_cmd(struct se_cmd *cmd) | |||
1976 | if (atomic_read(&cmd->t_fe_count) && | 1977 | if (atomic_read(&cmd->t_fe_count) && |
1977 | !atomic_dec_and_test(&cmd->t_fe_count)) { | 1978 | !atomic_dec_and_test(&cmd->t_fe_count)) { |
1978 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 1979 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
1979 | return; | 1980 | return 0; |
1980 | } | 1981 | } |
1981 | 1982 | ||
1982 | if (cmd->transport_state & CMD_T_DEV_ACTIVE) { | 1983 | if (cmd->transport_state & CMD_T_DEV_ACTIVE) { |
@@ -1986,8 +1987,7 @@ static void transport_put_cmd(struct se_cmd *cmd) | |||
1986 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 1987 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
1987 | 1988 | ||
1988 | transport_free_pages(cmd); | 1989 | transport_free_pages(cmd); |
1989 | transport_release_cmd(cmd); | 1990 | return transport_release_cmd(cmd); |
1990 | return; | ||
1991 | } | 1991 | } |
1992 | 1992 | ||
1993 | void *transport_kmap_data_sg(struct se_cmd *cmd) | 1993 | void *transport_kmap_data_sg(struct se_cmd *cmd) |
@@ -2152,13 +2152,15 @@ static void transport_write_pending_qf(struct se_cmd *cmd) | |||
2152 | } | 2152 | } |
2153 | } | 2153 | } |
2154 | 2154 | ||
2155 | void transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) | 2155 | int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) |
2156 | { | 2156 | { |
2157 | int ret = 0; | ||
2158 | |||
2157 | if (!(cmd->se_cmd_flags & SCF_SE_LUN_CMD)) { | 2159 | if (!(cmd->se_cmd_flags & SCF_SE_LUN_CMD)) { |
2158 | if (wait_for_tasks && (cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) | 2160 | if (wait_for_tasks && (cmd->se_cmd_flags & SCF_SCSI_TMR_CDB)) |
2159 | transport_wait_for_tasks(cmd); | 2161 | transport_wait_for_tasks(cmd); |
2160 | 2162 | ||
2161 | transport_release_cmd(cmd); | 2163 | ret = transport_release_cmd(cmd); |
2162 | } else { | 2164 | } else { |
2163 | if (wait_for_tasks) | 2165 | if (wait_for_tasks) |
2164 | transport_wait_for_tasks(cmd); | 2166 | transport_wait_for_tasks(cmd); |
@@ -2166,8 +2168,9 @@ void transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) | |||
2166 | if (cmd->se_lun) | 2168 | if (cmd->se_lun) |
2167 | transport_lun_remove_cmd(cmd); | 2169 | transport_lun_remove_cmd(cmd); |
2168 | 2170 | ||
2169 | transport_put_cmd(cmd); | 2171 | ret = transport_put_cmd(cmd); |
2170 | } | 2172 | } |
2173 | return ret; | ||
2171 | } | 2174 | } |
2172 | EXPORT_SYMBOL(transport_generic_free_cmd); | 2175 | EXPORT_SYMBOL(transport_generic_free_cmd); |
2173 | 2176 | ||
@@ -2250,11 +2253,14 @@ void target_sess_cmd_list_set_waiting(struct se_session *se_sess) | |||
2250 | unsigned long flags; | 2253 | unsigned long flags; |
2251 | 2254 | ||
2252 | spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); | 2255 | spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); |
2253 | 2256 | if (se_sess->sess_tearing_down) { | |
2254 | WARN_ON(se_sess->sess_tearing_down); | 2257 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); |
2258 | return; | ||
2259 | } | ||
2255 | se_sess->sess_tearing_down = 1; | 2260 | se_sess->sess_tearing_down = 1; |
2261 | list_splice_init(&se_sess->sess_cmd_list, &se_sess->sess_wait_list); | ||
2256 | 2262 | ||
2257 | list_for_each_entry(se_cmd, &se_sess->sess_cmd_list, se_cmd_list) | 2263 | list_for_each_entry(se_cmd, &se_sess->sess_wait_list, se_cmd_list) |
2258 | se_cmd->cmd_wait_set = 1; | 2264 | se_cmd->cmd_wait_set = 1; |
2259 | 2265 | ||
2260 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); | 2266 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); |
@@ -2263,44 +2269,32 @@ EXPORT_SYMBOL(target_sess_cmd_list_set_waiting); | |||
2263 | 2269 | ||
2264 | /* target_wait_for_sess_cmds - Wait for outstanding descriptors | 2270 | /* target_wait_for_sess_cmds - Wait for outstanding descriptors |
2265 | * @se_sess: session to wait for active I/O | 2271 | * @se_sess: session to wait for active I/O |
2266 | * @wait_for_tasks: Make extra transport_wait_for_tasks call | ||
2267 | */ | 2272 | */ |
2268 | void target_wait_for_sess_cmds( | 2273 | void target_wait_for_sess_cmds(struct se_session *se_sess) |
2269 | struct se_session *se_sess, | ||
2270 | int wait_for_tasks) | ||
2271 | { | 2274 | { |
2272 | struct se_cmd *se_cmd, *tmp_cmd; | 2275 | struct se_cmd *se_cmd, *tmp_cmd; |
2273 | bool rc = false; | 2276 | unsigned long flags; |
2274 | 2277 | ||
2275 | list_for_each_entry_safe(se_cmd, tmp_cmd, | 2278 | list_for_each_entry_safe(se_cmd, tmp_cmd, |
2276 | &se_sess->sess_cmd_list, se_cmd_list) { | 2279 | &se_sess->sess_wait_list, se_cmd_list) { |
2277 | list_del(&se_cmd->se_cmd_list); | 2280 | list_del(&se_cmd->se_cmd_list); |
2278 | 2281 | ||
2279 | pr_debug("Waiting for se_cmd: %p t_state: %d, fabric state:" | 2282 | pr_debug("Waiting for se_cmd: %p t_state: %d, fabric state:" |
2280 | " %d\n", se_cmd, se_cmd->t_state, | 2283 | " %d\n", se_cmd, se_cmd->t_state, |
2281 | se_cmd->se_tfo->get_cmd_state(se_cmd)); | 2284 | se_cmd->se_tfo->get_cmd_state(se_cmd)); |
2282 | 2285 | ||
2283 | if (wait_for_tasks) { | 2286 | wait_for_completion(&se_cmd->cmd_wait_comp); |
2284 | pr_debug("Calling transport_wait_for_tasks se_cmd: %p t_state: %d," | 2287 | pr_debug("After cmd_wait_comp: se_cmd: %p t_state: %d" |
2285 | " fabric state: %d\n", se_cmd, se_cmd->t_state, | 2288 | " fabric state: %d\n", se_cmd, se_cmd->t_state, |
2286 | se_cmd->se_tfo->get_cmd_state(se_cmd)); | 2289 | se_cmd->se_tfo->get_cmd_state(se_cmd)); |
2287 | |||
2288 | rc = transport_wait_for_tasks(se_cmd); | ||
2289 | |||
2290 | pr_debug("After transport_wait_for_tasks se_cmd: %p t_state: %d," | ||
2291 | " fabric state: %d\n", se_cmd, se_cmd->t_state, | ||
2292 | se_cmd->se_tfo->get_cmd_state(se_cmd)); | ||
2293 | } | ||
2294 | |||
2295 | if (!rc) { | ||
2296 | wait_for_completion(&se_cmd->cmd_wait_comp); | ||
2297 | pr_debug("After cmd_wait_comp: se_cmd: %p t_state: %d" | ||
2298 | " fabric state: %d\n", se_cmd, se_cmd->t_state, | ||
2299 | se_cmd->se_tfo->get_cmd_state(se_cmd)); | ||
2300 | } | ||
2301 | 2290 | ||
2302 | se_cmd->se_tfo->release_cmd(se_cmd); | 2291 | se_cmd->se_tfo->release_cmd(se_cmd); |
2303 | } | 2292 | } |
2293 | |||
2294 | spin_lock_irqsave(&se_sess->sess_cmd_lock, flags); | ||
2295 | WARN_ON(!list_empty(&se_sess->sess_cmd_list)); | ||
2296 | spin_unlock_irqrestore(&se_sess->sess_cmd_lock, flags); | ||
2297 | |||
2304 | } | 2298 | } |
2305 | EXPORT_SYMBOL(target_wait_for_sess_cmds); | 2299 | EXPORT_SYMBOL(target_wait_for_sess_cmds); |
2306 | 2300 | ||
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index 46528d57be72..86c00b1c5583 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c | |||
@@ -2755,7 +2755,7 @@ static void __init serial8250_isa_init_ports(void) | |||
2755 | if (nr_uarts > UART_NR) | 2755 | if (nr_uarts > UART_NR) |
2756 | nr_uarts = UART_NR; | 2756 | nr_uarts = UART_NR; |
2757 | 2757 | ||
2758 | for (i = 0; i < UART_NR; i++) { | 2758 | for (i = 0; i < nr_uarts; i++) { |
2759 | struct uart_8250_port *up = &serial8250_ports[i]; | 2759 | struct uart_8250_port *up = &serial8250_ports[i]; |
2760 | struct uart_port *port = &up->port; | 2760 | struct uart_port *port = &up->port; |
2761 | 2761 | ||
@@ -2916,7 +2916,7 @@ static int __init serial8250_console_setup(struct console *co, char *options) | |||
2916 | * if so, search for the first available port that does have | 2916 | * if so, search for the first available port that does have |
2917 | * console support. | 2917 | * console support. |
2918 | */ | 2918 | */ |
2919 | if (co->index >= UART_NR) | 2919 | if (co->index >= nr_uarts) |
2920 | co->index = 0; | 2920 | co->index = 0; |
2921 | port = &serial8250_ports[co->index].port; | 2921 | port = &serial8250_ports[co->index].port; |
2922 | if (!port->iobase && !port->membase) | 2922 | if (!port->iobase && !port->membase) |
@@ -2957,7 +2957,7 @@ int serial8250_find_port(struct uart_port *p) | |||
2957 | int line; | 2957 | int line; |
2958 | struct uart_port *port; | 2958 | struct uart_port *port; |
2959 | 2959 | ||
2960 | for (line = 0; line < UART_NR; line++) { | 2960 | for (line = 0; line < nr_uarts; line++) { |
2961 | port = &serial8250_ports[line].port; | 2961 | port = &serial8250_ports[line].port; |
2962 | if (uart_match_port(p, port)) | 2962 | if (uart_match_port(p, port)) |
2963 | return line; | 2963 | return line; |
@@ -3110,7 +3110,7 @@ static int serial8250_remove(struct platform_device *dev) | |||
3110 | { | 3110 | { |
3111 | int i; | 3111 | int i; |
3112 | 3112 | ||
3113 | for (i = 0; i < UART_NR; i++) { | 3113 | for (i = 0; i < nr_uarts; i++) { |
3114 | struct uart_8250_port *up = &serial8250_ports[i]; | 3114 | struct uart_8250_port *up = &serial8250_ports[i]; |
3115 | 3115 | ||
3116 | if (up->port.dev == &dev->dev) | 3116 | if (up->port.dev == &dev->dev) |
@@ -3178,7 +3178,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * | |||
3178 | /* | 3178 | /* |
3179 | * First, find a port entry which matches. | 3179 | * First, find a port entry which matches. |
3180 | */ | 3180 | */ |
3181 | for (i = 0; i < UART_NR; i++) | 3181 | for (i = 0; i < nr_uarts; i++) |
3182 | if (uart_match_port(&serial8250_ports[i].port, port)) | 3182 | if (uart_match_port(&serial8250_ports[i].port, port)) |
3183 | return &serial8250_ports[i]; | 3183 | return &serial8250_ports[i]; |
3184 | 3184 | ||
@@ -3187,7 +3187,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * | |||
3187 | * free entry. We look for one which hasn't been previously | 3187 | * free entry. We look for one which hasn't been previously |
3188 | * used (indicated by zero iobase). | 3188 | * used (indicated by zero iobase). |
3189 | */ | 3189 | */ |
3190 | for (i = 0; i < UART_NR; i++) | 3190 | for (i = 0; i < nr_uarts; i++) |
3191 | if (serial8250_ports[i].port.type == PORT_UNKNOWN && | 3191 | if (serial8250_ports[i].port.type == PORT_UNKNOWN && |
3192 | serial8250_ports[i].port.iobase == 0) | 3192 | serial8250_ports[i].port.iobase == 0) |
3193 | return &serial8250_ports[i]; | 3193 | return &serial8250_ports[i]; |
@@ -3196,7 +3196,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port * | |||
3196 | * That also failed. Last resort is to find any entry which | 3196 | * That also failed. Last resort is to find any entry which |
3197 | * doesn't have a real port associated with it. | 3197 | * doesn't have a real port associated with it. |
3198 | */ | 3198 | */ |
3199 | for (i = 0; i < UART_NR; i++) | 3199 | for (i = 0; i < nr_uarts; i++) |
3200 | if (serial8250_ports[i].port.type == PORT_UNKNOWN) | 3200 | if (serial8250_ports[i].port.type == PORT_UNKNOWN) |
3201 | return &serial8250_ports[i]; | 3201 | return &serial8250_ports[i]; |
3202 | 3202 | ||
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 147c9e193595..8cdfbd365892 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c | |||
@@ -761,6 +761,8 @@ static int imx_startup(struct uart_port *port) | |||
761 | 761 | ||
762 | temp = readl(sport->port.membase + UCR2); | 762 | temp = readl(sport->port.membase + UCR2); |
763 | temp |= (UCR2_RXEN | UCR2_TXEN); | 763 | temp |= (UCR2_RXEN | UCR2_TXEN); |
764 | if (!sport->have_rtscts) | ||
765 | temp |= UCR2_IRTS; | ||
764 | writel(temp, sport->port.membase + UCR2); | 766 | writel(temp, sport->port.membase + UCR2); |
765 | 767 | ||
766 | if (USE_IRDA(sport)) { | 768 | if (USE_IRDA(sport)) { |
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 89429410a245..0c8a9fa2be6c 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c | |||
@@ -1166,6 +1166,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, | |||
1166 | ourport->tx_irq = ret; | 1166 | ourport->tx_irq = ret; |
1167 | 1167 | ||
1168 | ourport->clk = clk_get(&platdev->dev, "uart"); | 1168 | ourport->clk = clk_get(&platdev->dev, "uart"); |
1169 | if (IS_ERR(ourport->clk)) { | ||
1170 | pr_err("%s: Controller clock not found\n", | ||
1171 | dev_name(&platdev->dev)); | ||
1172 | return PTR_ERR(ourport->clk); | ||
1173 | } | ||
1174 | |||
1175 | ret = clk_prepare_enable(ourport->clk); | ||
1176 | if (ret) { | ||
1177 | pr_err("uart: clock failed to prepare+enable: %d\n", ret); | ||
1178 | clk_put(ourport->clk); | ||
1179 | return ret; | ||
1180 | } | ||
1169 | 1181 | ||
1170 | /* Keep all interrupts masked and cleared */ | 1182 | /* Keep all interrupts masked and cleared */ |
1171 | if (s3c24xx_serial_has_interrupt_mask(port)) { | 1183 | if (s3c24xx_serial_has_interrupt_mask(port)) { |
@@ -1180,6 +1192,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, | |||
1180 | 1192 | ||
1181 | /* reset the fifos (and setup the uart) */ | 1193 | /* reset the fifos (and setup the uart) */ |
1182 | s3c24xx_serial_resetport(port, cfg); | 1194 | s3c24xx_serial_resetport(port, cfg); |
1195 | clk_disable_unprepare(ourport->clk); | ||
1183 | return 0; | 1196 | return 0; |
1184 | } | 1197 | } |
1185 | 1198 | ||
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 47ff9b1c8a37..05986507b585 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -1287,9 +1287,13 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
1287 | goto error; | 1287 | goto error; |
1288 | } | 1288 | } |
1289 | for (totlen = u = 0; u < uurb->number_of_packets; u++) { | 1289 | for (totlen = u = 0; u < uurb->number_of_packets; u++) { |
1290 | /* arbitrary limit, | 1290 | /* |
1291 | * sufficient for USB 2.0 high-bandwidth iso */ | 1291 | * arbitrary limit need for USB 3.0 |
1292 | if (isopkt[u].length > 8192) { | 1292 | * bMaxBurst (0~15 allowed, 1~16 packets) |
1293 | * bmAttributes (bit 1:0, mult 0~2, 1~3 packets) | ||
1294 | * sizemax: 1024 * 16 * 3 = 49152 | ||
1295 | */ | ||
1296 | if (isopkt[u].length > 49152) { | ||
1293 | ret = -EINVAL; | 1297 | ret = -EINVAL; |
1294 | goto error; | 1298 | goto error; |
1295 | } | 1299 | } |
diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index 929e7dd6e58b..8ce9d7fd6cfc 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c | |||
@@ -164,9 +164,9 @@ static int dwc3_exynos_remove(struct platform_device *pdev) | |||
164 | { | 164 | { |
165 | struct dwc3_exynos *exynos = platform_get_drvdata(pdev); | 165 | struct dwc3_exynos *exynos = platform_get_drvdata(pdev); |
166 | 166 | ||
167 | device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); | ||
167 | platform_device_unregister(exynos->usb2_phy); | 168 | platform_device_unregister(exynos->usb2_phy); |
168 | platform_device_unregister(exynos->usb3_phy); | 169 | platform_device_unregister(exynos->usb3_phy); |
169 | device_for_each_child(&pdev->dev, NULL, dwc3_exynos_remove_child); | ||
170 | 170 | ||
171 | clk_disable_unprepare(exynos->clk); | 171 | clk_disable_unprepare(exynos->clk); |
172 | 172 | ||
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 227d4a7acad7..eba9e2baf32b 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c | |||
@@ -196,9 +196,9 @@ static void dwc3_pci_remove(struct pci_dev *pci) | |||
196 | { | 196 | { |
197 | struct dwc3_pci *glue = pci_get_drvdata(pci); | 197 | struct dwc3_pci *glue = pci_get_drvdata(pci); |
198 | 198 | ||
199 | platform_device_unregister(glue->dwc3); | ||
199 | platform_device_unregister(glue->usb2_phy); | 200 | platform_device_unregister(glue->usb2_phy); |
200 | platform_device_unregister(glue->usb3_phy); | 201 | platform_device_unregister(glue->usb3_phy); |
201 | platform_device_unregister(glue->dwc3); | ||
202 | pci_set_drvdata(pci, NULL); | 202 | pci_set_drvdata(pci, NULL); |
203 | pci_disable_device(pci); | 203 | pci_disable_device(pci); |
204 | } | 204 | } |
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 2b6e7e001207..b5e5b35df49c 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c | |||
@@ -1706,11 +1706,19 @@ static void dwc3_gadget_free_endpoints(struct dwc3 *dwc) | |||
1706 | dep = dwc->eps[epnum]; | 1706 | dep = dwc->eps[epnum]; |
1707 | if (!dep) | 1707 | if (!dep) |
1708 | continue; | 1708 | continue; |
1709 | 1709 | /* | |
1710 | dwc3_free_trb_pool(dep); | 1710 | * Physical endpoints 0 and 1 are special; they form the |
1711 | 1711 | * bi-directional USB endpoint 0. | |
1712 | if (epnum != 0 && epnum != 1) | 1712 | * |
1713 | * For those two physical endpoints, we don't allocate a TRB | ||
1714 | * pool nor do we add them the endpoints list. Due to that, we | ||
1715 | * shouldn't do these two operations otherwise we would end up | ||
1716 | * with all sorts of bugs when removing dwc3.ko. | ||
1717 | */ | ||
1718 | if (epnum != 0 && epnum != 1) { | ||
1719 | dwc3_free_trb_pool(dep); | ||
1713 | list_del(&dep->endpoint.ep_list); | 1720 | list_del(&dep->endpoint.ep_list); |
1721 | } | ||
1714 | 1722 | ||
1715 | kfree(dep); | 1723 | kfree(dep); |
1716 | } | 1724 | } |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index acff5b8f6e89..f80d0330d548 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -213,7 +213,7 @@ static inline unsigned char tt_start_uframe(struct ehci_hcd *ehci, __hc32 mask) | |||
213 | } | 213 | } |
214 | 214 | ||
215 | static const unsigned char | 215 | static const unsigned char |
216 | max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 125, 25 }; | 216 | max_tt_usecs[] = { 125, 125, 125, 125, 125, 125, 30, 0 }; |
217 | 217 | ||
218 | /* carryover low/fullspeed bandwidth that crosses uframe boundries */ | 218 | /* carryover low/fullspeed bandwidth that crosses uframe boundries */ |
219 | static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) | 219 | static inline void carryover_tt_bandwidth(unsigned short tt_usecs[8]) |
@@ -646,6 +646,10 @@ static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
646 | /* reschedule QH iff another request is queued */ | 646 | /* reschedule QH iff another request is queued */ |
647 | if (!list_empty(&qh->qtd_list) && ehci->rh_state == EHCI_RH_RUNNING) { | 647 | if (!list_empty(&qh->qtd_list) && ehci->rh_state == EHCI_RH_RUNNING) { |
648 | rc = qh_schedule(ehci, qh); | 648 | rc = qh_schedule(ehci, qh); |
649 | if (rc == 0) { | ||
650 | qh_refresh(ehci, qh); | ||
651 | qh_link_periodic(ehci, qh); | ||
652 | } | ||
649 | 653 | ||
650 | /* An error here likely indicates handshake failure | 654 | /* An error here likely indicates handshake failure |
651 | * or no space left in the schedule. Neither fault | 655 | * or no space left in the schedule. Neither fault |
@@ -653,9 +657,10 @@ static void end_unlink_intr(struct ehci_hcd *ehci, struct ehci_qh *qh) | |||
653 | * | 657 | * |
654 | * FIXME kill the now-dysfunctional queued urbs | 658 | * FIXME kill the now-dysfunctional queued urbs |
655 | */ | 659 | */ |
656 | if (rc != 0) | 660 | else { |
657 | ehci_err(ehci, "can't reschedule qh %p, err %d\n", | 661 | ehci_err(ehci, "can't reschedule qh %p, err %d\n", |
658 | qh, rc); | 662 | qh, rc); |
663 | } | ||
659 | } | 664 | } |
660 | 665 | ||
661 | /* maybe turn off periodic schedule */ | 666 | /* maybe turn off periodic schedule */ |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 832f05ede427..8c0e119efa4e 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
@@ -1827,6 +1827,9 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1827 | } | 1827 | } |
1828 | spin_unlock_irqrestore(&xhci->lock, flags); | 1828 | spin_unlock_irqrestore(&xhci->lock, flags); |
1829 | 1829 | ||
1830 | if (!xhci->rh_bw) | ||
1831 | goto no_bw; | ||
1832 | |||
1830 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); | 1833 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); |
1831 | for (i = 0; i < num_ports; i++) { | 1834 | for (i = 0; i < num_ports; i++) { |
1832 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; | 1835 | struct xhci_interval_bw_table *bwt = &xhci->rh_bw[i].bw_table; |
@@ -1845,6 +1848,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
1845 | } | 1848 | } |
1846 | } | 1849 | } |
1847 | 1850 | ||
1851 | no_bw: | ||
1848 | xhci->num_usb2_ports = 0; | 1852 | xhci->num_usb2_ports = 0; |
1849 | xhci->num_usb3_ports = 0; | 1853 | xhci->num_usb3_ports = 0; |
1850 | xhci->num_active_eps = 0; | 1854 | xhci->num_active_eps = 0; |
@@ -2281,6 +2285,9 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2281 | u32 page_size, temp; | 2285 | u32 page_size, temp; |
2282 | int i; | 2286 | int i; |
2283 | 2287 | ||
2288 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2289 | INIT_LIST_HEAD(&xhci->cancel_cmd_list); | ||
2290 | |||
2284 | page_size = xhci_readl(xhci, &xhci->op_regs->page_size); | 2291 | page_size = xhci_readl(xhci, &xhci->op_regs->page_size); |
2285 | xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); | 2292 | xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); |
2286 | for (i = 0; i < 16; i++) { | 2293 | for (i = 0; i < 16; i++) { |
@@ -2359,7 +2366,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2359 | xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); | 2366 | xhci->cmd_ring = xhci_ring_alloc(xhci, 1, 1, TYPE_COMMAND, flags); |
2360 | if (!xhci->cmd_ring) | 2367 | if (!xhci->cmd_ring) |
2361 | goto fail; | 2368 | goto fail; |
2362 | INIT_LIST_HEAD(&xhci->cancel_cmd_list); | ||
2363 | xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); | 2369 | xhci_dbg(xhci, "Allocated command ring at %p\n", xhci->cmd_ring); |
2364 | xhci_dbg(xhci, "First segment DMA is 0x%llx\n", | 2370 | xhci_dbg(xhci, "First segment DMA is 0x%llx\n", |
2365 | (unsigned long long)xhci->cmd_ring->first_seg->dma); | 2371 | (unsigned long long)xhci->cmd_ring->first_seg->dma); |
@@ -2470,8 +2476,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
2470 | if (xhci_setup_port_arrays(xhci, flags)) | 2476 | if (xhci_setup_port_arrays(xhci, flags)) |
2471 | goto fail; | 2477 | goto fail; |
2472 | 2478 | ||
2473 | INIT_LIST_HEAD(&xhci->lpm_failed_devs); | ||
2474 | |||
2475 | /* Enable USB 3.0 device notifications for function remote wake, which | 2479 | /* Enable USB 3.0 device notifications for function remote wake, which |
2476 | * is necessary for allowing USB 3.0 devices to do remote wakeup from | 2480 | * is necessary for allowing USB 3.0 devices to do remote wakeup from |
2477 | * U3 (device suspend). | 2481 | * U3 (device suspend). |
diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 1a30c380043c..cc24e39b97d5 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c | |||
@@ -221,6 +221,14 @@ static void xhci_pci_remove(struct pci_dev *dev) | |||
221 | static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) | 221 | static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup) |
222 | { | 222 | { |
223 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); | 223 | struct xhci_hcd *xhci = hcd_to_xhci(hcd); |
224 | struct pci_dev *pdev = to_pci_dev(hcd->self.controller); | ||
225 | |||
226 | /* | ||
227 | * Systems with the TI redriver that loses port status change events | ||
228 | * need to have the registers polled during D3, so avoid D3cold. | ||
229 | */ | ||
230 | if (xhci_compliance_mode_recovery_timer_quirk_check()) | ||
231 | pdev->no_d3cold = true; | ||
224 | 232 | ||
225 | return xhci_suspend(xhci); | 233 | return xhci_suspend(xhci); |
226 | } | 234 | } |
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 8be34f838bd4..77113c1fcb96 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
@@ -466,7 +466,7 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci) | |||
466 | * Systems: | 466 | * Systems: |
467 | * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 | 467 | * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 |
468 | */ | 468 | */ |
469 | static bool compliance_mode_recovery_timer_quirk_check(void) | 469 | bool xhci_compliance_mode_recovery_timer_quirk_check(void) |
470 | { | 470 | { |
471 | const char *dmi_product_name, *dmi_sys_vendor; | 471 | const char *dmi_product_name, *dmi_sys_vendor; |
472 | 472 | ||
@@ -517,7 +517,7 @@ int xhci_init(struct usb_hcd *hcd) | |||
517 | xhci_dbg(xhci, "Finished xhci_init\n"); | 517 | xhci_dbg(xhci, "Finished xhci_init\n"); |
518 | 518 | ||
519 | /* Initializing Compliance Mode Recovery Data If Needed */ | 519 | /* Initializing Compliance Mode Recovery Data If Needed */ |
520 | if (compliance_mode_recovery_timer_quirk_check()) { | 520 | if (xhci_compliance_mode_recovery_timer_quirk_check()) { |
521 | xhci->quirks |= XHCI_COMP_MODE_QUIRK; | 521 | xhci->quirks |= XHCI_COMP_MODE_QUIRK; |
522 | compliance_mode_recovery_timer_init(xhci); | 522 | compliance_mode_recovery_timer_init(xhci); |
523 | } | 523 | } |
@@ -956,6 +956,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
956 | struct usb_hcd *hcd = xhci_to_hcd(xhci); | 956 | struct usb_hcd *hcd = xhci_to_hcd(xhci); |
957 | struct usb_hcd *secondary_hcd; | 957 | struct usb_hcd *secondary_hcd; |
958 | int retval = 0; | 958 | int retval = 0; |
959 | bool comp_timer_running = false; | ||
959 | 960 | ||
960 | /* Wait a bit if either of the roothubs need to settle from the | 961 | /* Wait a bit if either of the roothubs need to settle from the |
961 | * transition into bus suspend. | 962 | * transition into bus suspend. |
@@ -993,6 +994,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
993 | 994 | ||
994 | /* If restore operation fails, re-initialize the HC during resume */ | 995 | /* If restore operation fails, re-initialize the HC during resume */ |
995 | if ((temp & STS_SRE) || hibernated) { | 996 | if ((temp & STS_SRE) || hibernated) { |
997 | |||
998 | if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && | ||
999 | !(xhci_all_ports_seen_u0(xhci))) { | ||
1000 | del_timer_sync(&xhci->comp_mode_recovery_timer); | ||
1001 | xhci_dbg(xhci, "Compliance Mode Recovery Timer deleted!\n"); | ||
1002 | } | ||
1003 | |||
996 | /* Let the USB core know _both_ roothubs lost power. */ | 1004 | /* Let the USB core know _both_ roothubs lost power. */ |
997 | usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); | 1005 | usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); |
998 | usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); | 1006 | usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); |
@@ -1035,6 +1043,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
1035 | retval = xhci_init(hcd->primary_hcd); | 1043 | retval = xhci_init(hcd->primary_hcd); |
1036 | if (retval) | 1044 | if (retval) |
1037 | return retval; | 1045 | return retval; |
1046 | comp_timer_running = true; | ||
1047 | |||
1038 | xhci_dbg(xhci, "Start the primary HCD\n"); | 1048 | xhci_dbg(xhci, "Start the primary HCD\n"); |
1039 | retval = xhci_run(hcd->primary_hcd); | 1049 | retval = xhci_run(hcd->primary_hcd); |
1040 | if (!retval) { | 1050 | if (!retval) { |
@@ -1076,7 +1086,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) | |||
1076 | * to suffer the Compliance Mode issue again. It doesn't matter if | 1086 | * to suffer the Compliance Mode issue again. It doesn't matter if |
1077 | * ports have entered previously to U0 before system's suspension. | 1087 | * ports have entered previously to U0 before system's suspension. |
1078 | */ | 1088 | */ |
1079 | if (xhci->quirks & XHCI_COMP_MODE_QUIRK) | 1089 | if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running) |
1080 | compliance_mode_recovery_timer_init(xhci); | 1090 | compliance_mode_recovery_timer_init(xhci); |
1081 | 1091 | ||
1082 | /* Re-enable port polling. */ | 1092 | /* Re-enable port polling. */ |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index c306849eb299..c338741a675d 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
@@ -1883,4 +1883,7 @@ struct xhci_input_control_ctx *xhci_get_input_control_ctx(struct xhci_hcd *xhci, | |||
1883 | struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); | 1883 | struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx); |
1884 | struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); | 1884 | struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int ep_index); |
1885 | 1885 | ||
1886 | /* xHCI quirks */ | ||
1887 | bool xhci_compliance_mode_recovery_timer_quirk_check(void); | ||
1888 | |||
1886 | #endif /* __LINUX_XHCI_HCD_H */ | 1889 | #endif /* __LINUX_XHCI_HCD_H */ |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 85ed11e04f35..4211e5540945 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -1231,7 +1231,6 @@ void musb_host_tx(struct musb *musb, u8 epnum) | |||
1231 | void __iomem *mbase = musb->mregs; | 1231 | void __iomem *mbase = musb->mregs; |
1232 | struct dma_channel *dma; | 1232 | struct dma_channel *dma; |
1233 | bool transfer_pending = false; | 1233 | bool transfer_pending = false; |
1234 | static bool use_sg; | ||
1235 | 1234 | ||
1236 | musb_ep_select(mbase, epnum); | 1235 | musb_ep_select(mbase, epnum); |
1237 | tx_csr = musb_readw(epio, MUSB_TXCSR); | 1236 | tx_csr = musb_readw(epio, MUSB_TXCSR); |
@@ -1462,9 +1461,9 @@ done: | |||
1462 | * NULL. | 1461 | * NULL. |
1463 | */ | 1462 | */ |
1464 | if (!urb->transfer_buffer) | 1463 | if (!urb->transfer_buffer) |
1465 | use_sg = true; | 1464 | qh->use_sg = true; |
1466 | 1465 | ||
1467 | if (use_sg) { | 1466 | if (qh->use_sg) { |
1468 | /* sg_miter_start is already done in musb_ep_program */ | 1467 | /* sg_miter_start is already done in musb_ep_program */ |
1469 | if (!sg_miter_next(&qh->sg_miter)) { | 1468 | if (!sg_miter_next(&qh->sg_miter)) { |
1470 | dev_err(musb->controller, "error: sg list empty\n"); | 1469 | dev_err(musb->controller, "error: sg list empty\n"); |
@@ -1483,9 +1482,9 @@ done: | |||
1483 | 1482 | ||
1484 | qh->segsize = length; | 1483 | qh->segsize = length; |
1485 | 1484 | ||
1486 | if (use_sg) { | 1485 | if (qh->use_sg) { |
1487 | if (offset + length >= urb->transfer_buffer_length) | 1486 | if (offset + length >= urb->transfer_buffer_length) |
1488 | use_sg = false; | 1487 | qh->use_sg = false; |
1489 | } | 1488 | } |
1490 | 1489 | ||
1491 | musb_ep_select(mbase, epnum); | 1490 | musb_ep_select(mbase, epnum); |
@@ -1551,7 +1550,6 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1551 | bool done = false; | 1550 | bool done = false; |
1552 | u32 status; | 1551 | u32 status; |
1553 | struct dma_channel *dma; | 1552 | struct dma_channel *dma; |
1554 | static bool use_sg; | ||
1555 | unsigned int sg_flags = SG_MITER_ATOMIC | SG_MITER_TO_SG; | 1553 | unsigned int sg_flags = SG_MITER_ATOMIC | SG_MITER_TO_SG; |
1556 | 1554 | ||
1557 | musb_ep_select(mbase, epnum); | 1555 | musb_ep_select(mbase, epnum); |
@@ -1877,12 +1875,12 @@ void musb_host_rx(struct musb *musb, u8 epnum) | |||
1877 | * NULL. | 1875 | * NULL. |
1878 | */ | 1876 | */ |
1879 | if (!urb->transfer_buffer) { | 1877 | if (!urb->transfer_buffer) { |
1880 | use_sg = true; | 1878 | qh->use_sg = true; |
1881 | sg_miter_start(&qh->sg_miter, urb->sg, 1, | 1879 | sg_miter_start(&qh->sg_miter, urb->sg, 1, |
1882 | sg_flags); | 1880 | sg_flags); |
1883 | } | 1881 | } |
1884 | 1882 | ||
1885 | if (use_sg) { | 1883 | if (qh->use_sg) { |
1886 | if (!sg_miter_next(&qh->sg_miter)) { | 1884 | if (!sg_miter_next(&qh->sg_miter)) { |
1887 | dev_err(musb->controller, "error: sg list empty\n"); | 1885 | dev_err(musb->controller, "error: sg list empty\n"); |
1888 | sg_miter_stop(&qh->sg_miter); | 1886 | sg_miter_stop(&qh->sg_miter); |
@@ -1912,8 +1910,8 @@ finish: | |||
1912 | urb->actual_length += xfer_len; | 1910 | urb->actual_length += xfer_len; |
1913 | qh->offset += xfer_len; | 1911 | qh->offset += xfer_len; |
1914 | if (done) { | 1912 | if (done) { |
1915 | if (use_sg) | 1913 | if (qh->use_sg) |
1916 | use_sg = false; | 1914 | qh->use_sg = false; |
1917 | 1915 | ||
1918 | if (urb->status == -EINPROGRESS) | 1916 | if (urb->status == -EINPROGRESS) |
1919 | urb->status = status; | 1917 | urb->status = status; |
diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h index 5a9c8feec10c..738f7eb60df9 100644 --- a/drivers/usb/musb/musb_host.h +++ b/drivers/usb/musb/musb_host.h | |||
@@ -74,6 +74,7 @@ struct musb_qh { | |||
74 | u16 frame; /* for periodic schedule */ | 74 | u16 frame; /* for periodic schedule */ |
75 | unsigned iso_idx; /* in urb->iso_frame_desc[] */ | 75 | unsigned iso_idx; /* in urb->iso_frame_desc[] */ |
76 | struct sg_mapping_iter sg_miter; /* for highmem in PIO mode */ | 76 | struct sg_mapping_iter sg_miter; /* for highmem in PIO mode */ |
77 | bool use_sg; /* to track urb using sglist */ | ||
77 | }; | 78 | }; |
78 | 79 | ||
79 | /* map from control or bulk queue head to the first qh on that ring */ | 80 | /* map from control or bulk queue head to the first qh on that ring */ |
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c index 3b16118cbf62..40e7fd94646f 100644 --- a/drivers/usb/serial/ark3116.c +++ b/drivers/usb/serial/ark3116.c | |||
@@ -43,7 +43,7 @@ | |||
43 | #define DRIVER_NAME "ark3116" | 43 | #define DRIVER_NAME "ark3116" |
44 | 44 | ||
45 | /* usb timeout of 1 second */ | 45 | /* usb timeout of 1 second */ |
46 | #define ARK_TIMEOUT (1*HZ) | 46 | #define ARK_TIMEOUT 1000 |
47 | 47 | ||
48 | static const struct usb_device_id id_table[] = { | 48 | static const struct usb_device_id id_table[] = { |
49 | { USB_DEVICE(0x6547, 0x0232) }, | 49 | { USB_DEVICE(0x6547, 0x0232) }, |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index d341555d37d8..082120198f87 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -65,6 +65,7 @@ static const struct usb_device_id id_table_earthmate[] = { | |||
65 | static const struct usb_device_id id_table_cyphidcomrs232[] = { | 65 | static const struct usb_device_id id_table_cyphidcomrs232[] = { |
66 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | 66 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, |
67 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, | 67 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, |
68 | { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, | ||
68 | { } /* Terminating entry */ | 69 | { } /* Terminating entry */ |
69 | }; | 70 | }; |
70 | 71 | ||
@@ -78,6 +79,7 @@ static const struct usb_device_id id_table_combined[] = { | |||
78 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, | 79 | { USB_DEVICE(VENDOR_ID_DELORME, PRODUCT_ID_EARTHMATEUSB_LT20) }, |
79 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, | 80 | { USB_DEVICE(VENDOR_ID_CYPRESS, PRODUCT_ID_CYPHIDCOM) }, |
80 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, | 81 | { USB_DEVICE(VENDOR_ID_POWERCOM, PRODUCT_ID_UPS) }, |
82 | { USB_DEVICE(VENDOR_ID_FRWD, PRODUCT_ID_CYPHIDCOM_FRWD) }, | ||
81 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, | 83 | { USB_DEVICE(VENDOR_ID_DAZZLE, PRODUCT_ID_CA42) }, |
82 | { } /* Terminating entry */ | 84 | { } /* Terminating entry */ |
83 | }; | 85 | }; |
@@ -229,6 +231,12 @@ static struct usb_serial_driver * const serial_drivers[] = { | |||
229 | * Cypress serial helper functions | 231 | * Cypress serial helper functions |
230 | *****************************************************************************/ | 232 | *****************************************************************************/ |
231 | 233 | ||
234 | /* FRWD Dongle hidcom needs to skip reset and speed checks */ | ||
235 | static inline bool is_frwd(struct usb_device *dev) | ||
236 | { | ||
237 | return ((le16_to_cpu(dev->descriptor.idVendor) == VENDOR_ID_FRWD) && | ||
238 | (le16_to_cpu(dev->descriptor.idProduct) == PRODUCT_ID_CYPHIDCOM_FRWD)); | ||
239 | } | ||
232 | 240 | ||
233 | static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) | 241 | static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) |
234 | { | 242 | { |
@@ -238,6 +246,10 @@ static int analyze_baud_rate(struct usb_serial_port *port, speed_t new_rate) | |||
238 | if (unstable_bauds) | 246 | if (unstable_bauds) |
239 | return new_rate; | 247 | return new_rate; |
240 | 248 | ||
249 | /* FRWD Dongle uses 115200 bps */ | ||
250 | if (is_frwd(port->serial->dev)) | ||
251 | return new_rate; | ||
252 | |||
241 | /* | 253 | /* |
242 | * The general purpose firmware for the Cypress M8 allows for | 254 | * The general purpose firmware for the Cypress M8 allows for |
243 | * a maximum speed of 57600bps (I have no idea whether DeLorme | 255 | * a maximum speed of 57600bps (I have no idea whether DeLorme |
@@ -448,7 +460,11 @@ static int cypress_generic_port_probe(struct usb_serial_port *port) | |||
448 | return -ENOMEM; | 460 | return -ENOMEM; |
449 | } | 461 | } |
450 | 462 | ||
451 | usb_reset_configuration(serial->dev); | 463 | /* Skip reset for FRWD device. It is a workaound: |
464 | device hangs if it receives SET_CONFIGURE in Configured | ||
465 | state. */ | ||
466 | if (!is_frwd(serial->dev)) | ||
467 | usb_reset_configuration(serial->dev); | ||
452 | 468 | ||
453 | priv->cmd_ctrl = 0; | 469 | priv->cmd_ctrl = 0; |
454 | priv->line_control = 0; | 470 | priv->line_control = 0; |
diff --git a/drivers/usb/serial/cypress_m8.h b/drivers/usb/serial/cypress_m8.h index 67cf60826884..b461311a2ae7 100644 --- a/drivers/usb/serial/cypress_m8.h +++ b/drivers/usb/serial/cypress_m8.h | |||
@@ -24,6 +24,10 @@ | |||
24 | #define VENDOR_ID_CYPRESS 0x04b4 | 24 | #define VENDOR_ID_CYPRESS 0x04b4 |
25 | #define PRODUCT_ID_CYPHIDCOM 0x5500 | 25 | #define PRODUCT_ID_CYPHIDCOM 0x5500 |
26 | 26 | ||
27 | /* FRWD Dongle - a GPS sports watch */ | ||
28 | #define VENDOR_ID_FRWD 0x6737 | ||
29 | #define PRODUCT_ID_CYPHIDCOM_FRWD 0x0001 | ||
30 | |||
27 | /* Powercom UPS, chip CY7C63723 */ | 31 | /* Powercom UPS, chip CY7C63723 */ |
28 | #define VENDOR_ID_POWERCOM 0x0d9f | 32 | #define VENDOR_ID_POWERCOM 0x0d9f |
29 | #define PRODUCT_ID_UPS 0x0002 | 33 | #define PRODUCT_ID_UPS 0x0002 |
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c index 9d74c278b7b5..790673e5faa7 100644 --- a/drivers/usb/serial/iuu_phoenix.c +++ b/drivers/usb/serial/iuu_phoenix.c | |||
@@ -287,7 +287,7 @@ static int bulk_immediate(struct usb_serial_port *port, u8 *buf, u8 count) | |||
287 | usb_bulk_msg(serial->dev, | 287 | usb_bulk_msg(serial->dev, |
288 | usb_sndbulkpipe(serial->dev, | 288 | usb_sndbulkpipe(serial->dev, |
289 | port->bulk_out_endpointAddress), buf, | 289 | port->bulk_out_endpointAddress), buf, |
290 | count, &actual, HZ * 1); | 290 | count, &actual, 1000); |
291 | 291 | ||
292 | if (status != IUU_OPERATION_OK) | 292 | if (status != IUU_OPERATION_OK) |
293 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); | 293 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); |
@@ -307,7 +307,7 @@ static int read_immediate(struct usb_serial_port *port, u8 *buf, u8 count) | |||
307 | usb_bulk_msg(serial->dev, | 307 | usb_bulk_msg(serial->dev, |
308 | usb_rcvbulkpipe(serial->dev, | 308 | usb_rcvbulkpipe(serial->dev, |
309 | port->bulk_in_endpointAddress), buf, | 309 | port->bulk_in_endpointAddress), buf, |
310 | count, &actual, HZ * 1); | 310 | count, &actual, 1000); |
311 | 311 | ||
312 | if (status != IUU_OPERATION_OK) | 312 | if (status != IUU_OPERATION_OK) |
313 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); | 313 | dev_dbg(&port->dev, "%s - error = %2x\n", __func__, status); |
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 546fa904e141..28365e647168 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -1539,7 +1539,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1539 | struct keyspan_serial_private *s_priv; | 1539 | struct keyspan_serial_private *s_priv; |
1540 | struct keyspan_port_private *p_priv; | 1540 | struct keyspan_port_private *p_priv; |
1541 | const struct keyspan_device_details *d_details; | 1541 | const struct keyspan_device_details *d_details; |
1542 | int outcont_urb; | ||
1543 | struct urb *this_urb; | 1542 | struct urb *this_urb; |
1544 | int device_port, err; | 1543 | int device_port, err; |
1545 | 1544 | ||
@@ -1550,7 +1549,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1550 | d_details = s_priv->device_details; | 1549 | d_details = s_priv->device_details; |
1551 | device_port = port->number - port->serial->minor; | 1550 | device_port = port->number - port->serial->minor; |
1552 | 1551 | ||
1553 | outcont_urb = d_details->outcont_endpoints[port->number]; | ||
1554 | this_urb = p_priv->outcont_urb; | 1552 | this_urb = p_priv->outcont_urb; |
1555 | 1553 | ||
1556 | dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe)); | 1554 | dev_dbg(&port->dev, "%s - endpoint %d\n", __func__, usb_pipeendpoint(this_urb->pipe)); |
@@ -1676,14 +1674,6 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1676 | err = usb_submit_urb(this_urb, GFP_ATOMIC); | 1674 | err = usb_submit_urb(this_urb, GFP_ATOMIC); |
1677 | if (err != 0) | 1675 | if (err != 0) |
1678 | dev_dbg(&port->dev, "%s - usb_submit_urb(setup) failed (%d)\n", __func__, err); | 1676 | dev_dbg(&port->dev, "%s - usb_submit_urb(setup) failed (%d)\n", __func__, err); |
1679 | #if 0 | ||
1680 | else { | ||
1681 | dev_dbg(&port->dev, "%s - usb_submit_urb(%d) OK %d bytes (end %d)\n", __func__ | ||
1682 | outcont_urb, this_urb->transfer_buffer_length, | ||
1683 | usb_pipeendpoint(this_urb->pipe)); | ||
1684 | } | ||
1685 | #endif | ||
1686 | |||
1687 | return 0; | 1677 | return 0; |
1688 | } | 1678 | } |
1689 | 1679 | ||
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index cc0e54345df9..f27c621a9297 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -40,7 +40,7 @@ | |||
40 | #define DRIVER_DESC "Moschip USB Serial Driver" | 40 | #define DRIVER_DESC "Moschip USB Serial Driver" |
41 | 41 | ||
42 | /* default urb timeout */ | 42 | /* default urb timeout */ |
43 | #define MOS_WDR_TIMEOUT (HZ * 5) | 43 | #define MOS_WDR_TIMEOUT 5000 |
44 | 44 | ||
45 | #define MOS_MAX_PORT 0x02 | 45 | #define MOS_MAX_PORT 0x02 |
46 | #define MOS_WRITE 0x0E | 46 | #define MOS_WRITE 0x0E |
@@ -227,11 +227,22 @@ static int read_mos_reg(struct usb_serial *serial, unsigned int serial_portnum, | |||
227 | __u8 requesttype = (__u8)0xc0; | 227 | __u8 requesttype = (__u8)0xc0; |
228 | __u16 index = get_reg_index(reg); | 228 | __u16 index = get_reg_index(reg); |
229 | __u16 value = get_reg_value(reg, serial_portnum); | 229 | __u16 value = get_reg_value(reg, serial_portnum); |
230 | int status = usb_control_msg(usbdev, pipe, request, requesttype, value, | 230 | u8 *buf; |
231 | index, data, 1, MOS_WDR_TIMEOUT); | 231 | int status; |
232 | if (status < 0) | 232 | |
233 | buf = kmalloc(1, GFP_KERNEL); | ||
234 | if (!buf) | ||
235 | return -ENOMEM; | ||
236 | |||
237 | status = usb_control_msg(usbdev, pipe, request, requesttype, value, | ||
238 | index, buf, 1, MOS_WDR_TIMEOUT); | ||
239 | if (status == 1) | ||
240 | *data = *buf; | ||
241 | else if (status < 0) | ||
233 | dev_err(&usbdev->dev, | 242 | dev_err(&usbdev->dev, |
234 | "mos7720: usb_control_msg() failed: %d", status); | 243 | "mos7720: usb_control_msg() failed: %d", status); |
244 | kfree(buf); | ||
245 | |||
235 | return status; | 246 | return status; |
236 | } | 247 | } |
237 | 248 | ||
@@ -1618,7 +1629,7 @@ static void change_port_settings(struct tty_struct *tty, | |||
1618 | mos7720_port->shadowMCR |= (UART_MCR_XONANY); | 1629 | mos7720_port->shadowMCR |= (UART_MCR_XONANY); |
1619 | /* To set hardware flow control to the specified * | 1630 | /* To set hardware flow control to the specified * |
1620 | * serial port, in SP1/2_CONTROL_REG */ | 1631 | * serial port, in SP1/2_CONTROL_REG */ |
1621 | if (port->number) | 1632 | if (port_number) |
1622 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01); | 1633 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x01); |
1623 | else | 1634 | else |
1624 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02); | 1635 | write_mos_reg(serial, dummy, SP_CONTROL_REG, 0x02); |
@@ -1927,7 +1938,7 @@ static int mos7720_startup(struct usb_serial *serial) | |||
1927 | 1938 | ||
1928 | /* setting configuration feature to one */ | 1939 | /* setting configuration feature to one */ |
1929 | usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), | 1940 | usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), |
1930 | (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5*HZ); | 1941 | (__u8)0x03, 0x00, 0x01, 0x00, NULL, 0x00, 5000); |
1931 | 1942 | ||
1932 | /* start the interrupt urb */ | 1943 | /* start the interrupt urb */ |
1933 | ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL); | 1944 | ret_val = usb_submit_urb(serial->port[0]->interrupt_in_urb, GFP_KERNEL); |
@@ -1970,7 +1981,7 @@ static void mos7720_release(struct usb_serial *serial) | |||
1970 | /* wait for synchronous usb calls to return */ | 1981 | /* wait for synchronous usb calls to return */ |
1971 | if (mos_parport->msg_pending) | 1982 | if (mos_parport->msg_pending) |
1972 | wait_for_completion_timeout(&mos_parport->syncmsg_compl, | 1983 | wait_for_completion_timeout(&mos_parport->syncmsg_compl, |
1973 | MOS_WDR_TIMEOUT); | 1984 | msecs_to_jiffies(MOS_WDR_TIMEOUT)); |
1974 | 1985 | ||
1975 | parport_remove_port(mos_parport->pp); | 1986 | parport_remove_port(mos_parport->pp); |
1976 | usb_set_serial_data(serial, NULL); | 1987 | usb_set_serial_data(serial, NULL); |
diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index a0d5ea545982..7e998081e1cd 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c | |||
@@ -2142,13 +2142,21 @@ static int mos7840_ioctl(struct tty_struct *tty, | |||
2142 | static int mos7810_check(struct usb_serial *serial) | 2142 | static int mos7810_check(struct usb_serial *serial) |
2143 | { | 2143 | { |
2144 | int i, pass_count = 0; | 2144 | int i, pass_count = 0; |
2145 | u8 *buf; | ||
2145 | __u16 data = 0, mcr_data = 0; | 2146 | __u16 data = 0, mcr_data = 0; |
2146 | __u16 test_pattern = 0x55AA; | 2147 | __u16 test_pattern = 0x55AA; |
2148 | int res; | ||
2149 | |||
2150 | buf = kmalloc(VENDOR_READ_LENGTH, GFP_KERNEL); | ||
2151 | if (!buf) | ||
2152 | return 0; /* failed to identify 7810 */ | ||
2147 | 2153 | ||
2148 | /* Store MCR setting */ | 2154 | /* Store MCR setting */ |
2149 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2155 | res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), |
2150 | MCS_RDREQ, MCS_RD_RTYPE, 0x0300, MODEM_CONTROL_REGISTER, | 2156 | MCS_RDREQ, MCS_RD_RTYPE, 0x0300, MODEM_CONTROL_REGISTER, |
2151 | &mcr_data, VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2157 | buf, VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); |
2158 | if (res == VENDOR_READ_LENGTH) | ||
2159 | mcr_data = *buf; | ||
2152 | 2160 | ||
2153 | for (i = 0; i < 16; i++) { | 2161 | for (i = 0; i < 16; i++) { |
2154 | /* Send the 1-bit test pattern out to MCS7810 test pin */ | 2162 | /* Send the 1-bit test pattern out to MCS7810 test pin */ |
@@ -2158,9 +2166,12 @@ static int mos7810_check(struct usb_serial *serial) | |||
2158 | MODEM_CONTROL_REGISTER, NULL, 0, MOS_WDR_TIMEOUT); | 2166 | MODEM_CONTROL_REGISTER, NULL, 0, MOS_WDR_TIMEOUT); |
2159 | 2167 | ||
2160 | /* Read the test pattern back */ | 2168 | /* Read the test pattern back */ |
2161 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2169 | res = usb_control_msg(serial->dev, |
2162 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &data, | 2170 | usb_rcvctrlpipe(serial->dev, 0), MCS_RDREQ, |
2163 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2171 | MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, |
2172 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | ||
2173 | if (res == VENDOR_READ_LENGTH) | ||
2174 | data = *buf; | ||
2164 | 2175 | ||
2165 | /* If this is a MCS7810 device, both test patterns must match */ | 2176 | /* If this is a MCS7810 device, both test patterns must match */ |
2166 | if (((test_pattern >> i) ^ (~data >> 1)) & 0x0001) | 2177 | if (((test_pattern >> i) ^ (~data >> 1)) & 0x0001) |
@@ -2174,6 +2185,8 @@ static int mos7810_check(struct usb_serial *serial) | |||
2174 | MCS_WR_RTYPE, 0x0300 | mcr_data, MODEM_CONTROL_REGISTER, NULL, | 2185 | MCS_WR_RTYPE, 0x0300 | mcr_data, MODEM_CONTROL_REGISTER, NULL, |
2175 | 0, MOS_WDR_TIMEOUT); | 2186 | 0, MOS_WDR_TIMEOUT); |
2176 | 2187 | ||
2188 | kfree(buf); | ||
2189 | |||
2177 | if (pass_count == 16) | 2190 | if (pass_count == 16) |
2178 | return 1; | 2191 | return 1; |
2179 | 2192 | ||
@@ -2183,11 +2196,17 @@ static int mos7810_check(struct usb_serial *serial) | |||
2183 | static int mos7840_calc_num_ports(struct usb_serial *serial) | 2196 | static int mos7840_calc_num_ports(struct usb_serial *serial) |
2184 | { | 2197 | { |
2185 | __u16 data = 0x00; | 2198 | __u16 data = 0x00; |
2199 | u8 *buf; | ||
2186 | int mos7840_num_ports; | 2200 | int mos7840_num_ports; |
2187 | 2201 | ||
2188 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), | 2202 | buf = kzalloc(VENDOR_READ_LENGTH, GFP_KERNEL); |
2189 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, &data, | 2203 | if (buf) { |
2190 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | 2204 | usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), |
2205 | MCS_RDREQ, MCS_RD_RTYPE, 0, GPIO_REGISTER, buf, | ||
2206 | VENDOR_READ_LENGTH, MOS_WDR_TIMEOUT); | ||
2207 | data = *buf; | ||
2208 | kfree(buf); | ||
2209 | } | ||
2191 | 2210 | ||
2192 | if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || | 2211 | if (serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7810 || |
2193 | serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) { | 2212 | serial->dev->descriptor.idProduct == MOSCHIP_DEVICE_ID_7820) { |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index 93d02bc4eb52..bd4323ddae1a 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -250,13 +250,7 @@ static void option_instat_callback(struct urb *urb); | |||
250 | #define ZTE_PRODUCT_MF622 0x0001 | 250 | #define ZTE_PRODUCT_MF622 0x0001 |
251 | #define ZTE_PRODUCT_MF628 0x0015 | 251 | #define ZTE_PRODUCT_MF628 0x0015 |
252 | #define ZTE_PRODUCT_MF626 0x0031 | 252 | #define ZTE_PRODUCT_MF626 0x0031 |
253 | #define ZTE_PRODUCT_CDMA_TECH 0xfffe | ||
254 | #define ZTE_PRODUCT_AC8710 0xfff1 | ||
255 | #define ZTE_PRODUCT_AC2726 0xfff5 | ||
256 | #define ZTE_PRODUCT_AC8710T 0xffff | ||
257 | #define ZTE_PRODUCT_MC2718 0xffe8 | 253 | #define ZTE_PRODUCT_MC2718 0xffe8 |
258 | #define ZTE_PRODUCT_AD3812 0xffeb | ||
259 | #define ZTE_PRODUCT_MC2716 0xffed | ||
260 | 254 | ||
261 | #define BENQ_VENDOR_ID 0x04a5 | 255 | #define BENQ_VENDOR_ID 0x04a5 |
262 | #define BENQ_PRODUCT_H10 0x4068 | 256 | #define BENQ_PRODUCT_H10 0x4068 |
@@ -495,18 +489,10 @@ static const struct option_blacklist_info zte_k3765_z_blacklist = { | |||
495 | .reserved = BIT(4), | 489 | .reserved = BIT(4), |
496 | }; | 490 | }; |
497 | 491 | ||
498 | static const struct option_blacklist_info zte_ad3812_z_blacklist = { | ||
499 | .sendsetup = BIT(0) | BIT(1) | BIT(2), | ||
500 | }; | ||
501 | |||
502 | static const struct option_blacklist_info zte_mc2718_z_blacklist = { | 492 | static const struct option_blacklist_info zte_mc2718_z_blacklist = { |
503 | .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4), | 493 | .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4), |
504 | }; | 494 | }; |
505 | 495 | ||
506 | static const struct option_blacklist_info zte_mc2716_z_blacklist = { | ||
507 | .sendsetup = BIT(1) | BIT(2) | BIT(3), | ||
508 | }; | ||
509 | |||
510 | static const struct option_blacklist_info huawei_cdc12_blacklist = { | 496 | static const struct option_blacklist_info huawei_cdc12_blacklist = { |
511 | .reserved = BIT(1) | BIT(2), | 497 | .reserved = BIT(1) | BIT(2), |
512 | }; | 498 | }; |
@@ -593,6 +579,8 @@ static const struct usb_device_id option_ids[] = { | |||
593 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 579 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
594 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff), | 580 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff), |
595 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 581 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
582 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0x14ac, 0xff, 0xff, 0xff), /* Huawei E1820 */ | ||
583 | .driver_info = (kernel_ulong_t) &net_intf1_blacklist }, | ||
596 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), | 584 | { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4605, 0xff, 0xff, 0xff), |
597 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, | 585 | .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist }, |
598 | { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, | 586 | { USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, 0xff, 0xff, 0xff) }, |
@@ -797,7 +785,6 @@ static const struct usb_device_id option_ids[] = { | |||
797 | { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) }, | 785 | { USB_DEVICE_INTERFACE_CLASS(BANDRICH_VENDOR_ID, BANDRICH_PRODUCT_1012, 0xff) }, |
798 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, | 786 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC650) }, |
799 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, | 787 | { USB_DEVICE(KYOCERA_VENDOR_ID, KYOCERA_PRODUCT_KPC680) }, |
800 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6000)}, /* ZTE AC8700 */ | ||
801 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ | 788 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x6613)}, /* Onda H600/ZTE MF330 */ |
802 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ | 789 | { USB_DEVICE(QUALCOMM_VENDOR_ID, 0x9000)}, /* SIMCom SIM5218 */ |
803 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ | 790 | { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6280) }, /* BP3-USB & BP3-EXT HSDPA */ |
@@ -1199,16 +1186,9 @@ static const struct usb_device_id option_ids[] = { | |||
1199 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff), | 1186 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff), |
1200 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, | 1187 | .driver_info = (kernel_ulong_t)&net_intf3_blacklist }, |
1201 | 1188 | ||
1202 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) }, | 1189 | /* NOTE: most ZTE CDMA devices should be driven by zte_ev, not option */ |
1203 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) }, | ||
1204 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) }, | ||
1205 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) }, | ||
1206 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff), | 1190 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff), |
1207 | .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist }, | 1191 | .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist }, |
1208 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff), | ||
1209 | .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist }, | ||
1210 | { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff), | ||
1211 | .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist }, | ||
1212 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, | 1192 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) }, |
1213 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, | 1193 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) }, |
1214 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, | 1194 | { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) }, |
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c index 59b32b782126..bd794b43898c 100644 --- a/drivers/usb/serial/qcserial.c +++ b/drivers/usb/serial/qcserial.c | |||
@@ -118,6 +118,7 @@ static const struct usb_device_id id_table[] = { | |||
118 | {USB_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ | 118 | {USB_DEVICE(0x1199, 0x901b)}, /* Sierra Wireless MC7770 */ |
119 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ | 119 | {USB_DEVICE(0x12D1, 0x14F0)}, /* Sony Gobi 3000 QDL */ |
120 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ | 120 | {USB_DEVICE(0x12D1, 0x14F1)}, /* Sony Gobi 3000 Composite */ |
121 | {USB_DEVICE(0x0AF0, 0x8120)}, /* Option GTM681W */ | ||
121 | 122 | ||
122 | /* non Gobi Qualcomm serial devices */ | 123 | /* non Gobi Qualcomm serial devices */ |
123 | {USB_DEVICE_INTERFACE_NUMBER(0x0f3d, 0x68a2, 0)}, /* Sierra Wireless MC7700 Device Management */ | 124 | {USB_DEVICE_INTERFACE_NUMBER(0x0f3d, 0x68a2, 0)}, /* Sierra Wireless MC7700 Device Management */ |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 4753c005cfb6..5f6b1ff9d29e 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -408,7 +408,7 @@ static int serial_ioctl(struct tty_struct *tty, | |||
408 | unsigned int cmd, unsigned long arg) | 408 | unsigned int cmd, unsigned long arg) |
409 | { | 409 | { |
410 | struct usb_serial_port *port = tty->driver_data; | 410 | struct usb_serial_port *port = tty->driver_data; |
411 | int retval = -ENODEV; | 411 | int retval = -ENOIOCTLCMD; |
412 | 412 | ||
413 | dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd); | 413 | dev_dbg(tty->dev, "%s - cmd 0x%.4x\n", __func__, cmd); |
414 | 414 | ||
@@ -420,8 +420,6 @@ static int serial_ioctl(struct tty_struct *tty, | |||
420 | default: | 420 | default: |
421 | if (port->serial->type->ioctl) | 421 | if (port->serial->type->ioctl) |
422 | retval = port->serial->type->ioctl(tty, cmd, arg); | 422 | retval = port->serial->type->ioctl(tty, cmd, arg); |
423 | else | ||
424 | retval = -ENOIOCTLCMD; | ||
425 | } | 423 | } |
426 | 424 | ||
427 | return retval; | 425 | return retval; |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index 7573ec8a084f..9910aa2edf4b 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
@@ -560,10 +560,19 @@ static int treo_attach(struct usb_serial *serial) | |||
560 | */ | 560 | */ |
561 | #define COPY_PORT(dest, src) \ | 561 | #define COPY_PORT(dest, src) \ |
562 | do { \ | 562 | do { \ |
563 | int i; \ | ||
564 | \ | ||
565 | for (i = 0; i < ARRAY_SIZE(src->read_urbs); ++i) { \ | ||
566 | dest->read_urbs[i] = src->read_urbs[i]; \ | ||
567 | dest->read_urbs[i]->context = dest; \ | ||
568 | dest->bulk_in_buffers[i] = src->bulk_in_buffers[i]; \ | ||
569 | } \ | ||
563 | dest->read_urb = src->read_urb; \ | 570 | dest->read_urb = src->read_urb; \ |
564 | dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress;\ | 571 | dest->bulk_in_endpointAddress = src->bulk_in_endpointAddress;\ |
565 | dest->bulk_in_buffer = src->bulk_in_buffer; \ | 572 | dest->bulk_in_buffer = src->bulk_in_buffer; \ |
573 | dest->bulk_in_size = src->bulk_in_size; \ | ||
566 | dest->interrupt_in_urb = src->interrupt_in_urb; \ | 574 | dest->interrupt_in_urb = src->interrupt_in_urb; \ |
575 | dest->interrupt_in_urb->context = dest; \ | ||
567 | dest->interrupt_in_endpointAddress = \ | 576 | dest->interrupt_in_endpointAddress = \ |
568 | src->interrupt_in_endpointAddress;\ | 577 | src->interrupt_in_endpointAddress;\ |
569 | dest->interrupt_in_buffer = src->interrupt_in_buffer; \ | 578 | dest->interrupt_in_buffer = src->interrupt_in_buffer; \ |
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index b9fca3586d74..347caad47a12 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -649,7 +649,7 @@ static void firm_setup_port(struct tty_struct *tty) | |||
649 | struct whiteheat_port_settings port_settings; | 649 | struct whiteheat_port_settings port_settings; |
650 | unsigned int cflag = tty->termios.c_cflag; | 650 | unsigned int cflag = tty->termios.c_cflag; |
651 | 651 | ||
652 | port_settings.port = port->number + 1; | 652 | port_settings.port = port->number - port->serial->minor + 1; |
653 | 653 | ||
654 | /* get the byte size */ | 654 | /* get the byte size */ |
655 | switch (cflag & CSIZE) { | 655 | switch (cflag & CSIZE) { |
diff --git a/drivers/usb/serial/zte_ev.c b/drivers/usb/serial/zte_ev.c index 39ee7373b4ee..fca4c752a4ed 100644 --- a/drivers/usb/serial/zte_ev.c +++ b/drivers/usb/serial/zte_ev.c | |||
@@ -41,9 +41,6 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
41 | int len; | 41 | int len; |
42 | unsigned char *buf; | 42 | unsigned char *buf; |
43 | 43 | ||
44 | if (port->number != 0) | ||
45 | return -ENODEV; | ||
46 | |||
47 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); | 44 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); |
48 | if (!buf) | 45 | if (!buf) |
49 | return -ENOMEM; | 46 | return -ENOMEM; |
@@ -53,7 +50,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
53 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 50 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
54 | 0x22, 0x21, | 51 | 0x22, 0x21, |
55 | 0x0001, 0x0000, NULL, len, | 52 | 0x0001, 0x0000, NULL, len, |
56 | HZ * USB_CTRL_GET_TIMEOUT); | 53 | USB_CTRL_GET_TIMEOUT); |
57 | dev_dbg(dev, "result = %d\n", result); | 54 | dev_dbg(dev, "result = %d\n", result); |
58 | 55 | ||
59 | /* send 2st cmd and recieve data */ | 56 | /* send 2st cmd and recieve data */ |
@@ -65,7 +62,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
65 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 62 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
66 | 0x21, 0xa1, | 63 | 0x21, 0xa1, |
67 | 0x0000, 0x0000, buf, len, | 64 | 0x0000, 0x0000, buf, len, |
68 | HZ * USB_CTRL_GET_TIMEOUT); | 65 | USB_CTRL_GET_TIMEOUT); |
69 | debug_data(dev, __func__, len, buf, result); | 66 | debug_data(dev, __func__, len, buf, result); |
70 | 67 | ||
71 | /* send 3 cmd */ | 68 | /* send 3 cmd */ |
@@ -84,7 +81,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
84 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 81 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
85 | 0x20, 0x21, | 82 | 0x20, 0x21, |
86 | 0x0000, 0x0000, buf, len, | 83 | 0x0000, 0x0000, buf, len, |
87 | HZ * USB_CTRL_GET_TIMEOUT); | 84 | USB_CTRL_GET_TIMEOUT); |
88 | debug_data(dev, __func__, len, buf, result); | 85 | debug_data(dev, __func__, len, buf, result); |
89 | 86 | ||
90 | /* send 4 cmd */ | 87 | /* send 4 cmd */ |
@@ -95,7 +92,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
95 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 92 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
96 | 0x22, 0x21, | 93 | 0x22, 0x21, |
97 | 0x0003, 0x0000, NULL, len, | 94 | 0x0003, 0x0000, NULL, len, |
98 | HZ * USB_CTRL_GET_TIMEOUT); | 95 | USB_CTRL_GET_TIMEOUT); |
99 | dev_dbg(dev, "result = %d\n", result); | 96 | dev_dbg(dev, "result = %d\n", result); |
100 | 97 | ||
101 | /* send 5 cmd */ | 98 | /* send 5 cmd */ |
@@ -107,7 +104,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
107 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 104 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
108 | 0x21, 0xa1, | 105 | 0x21, 0xa1, |
109 | 0x0000, 0x0000, buf, len, | 106 | 0x0000, 0x0000, buf, len, |
110 | HZ * USB_CTRL_GET_TIMEOUT); | 107 | USB_CTRL_GET_TIMEOUT); |
111 | debug_data(dev, __func__, len, buf, result); | 108 | debug_data(dev, __func__, len, buf, result); |
112 | 109 | ||
113 | /* send 6 cmd */ | 110 | /* send 6 cmd */ |
@@ -126,7 +123,7 @@ static int zte_ev_usb_serial_open(struct tty_struct *tty, | |||
126 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 123 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
127 | 0x20, 0x21, | 124 | 0x20, 0x21, |
128 | 0x0000, 0x0000, buf, len, | 125 | 0x0000, 0x0000, buf, len, |
129 | HZ * USB_CTRL_GET_TIMEOUT); | 126 | USB_CTRL_GET_TIMEOUT); |
130 | debug_data(dev, __func__, len, buf, result); | 127 | debug_data(dev, __func__, len, buf, result); |
131 | kfree(buf); | 128 | kfree(buf); |
132 | 129 | ||
@@ -166,9 +163,6 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
166 | int len; | 163 | int len; |
167 | unsigned char *buf; | 164 | unsigned char *buf; |
168 | 165 | ||
169 | if (port->number != 0) | ||
170 | return; | ||
171 | |||
172 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); | 166 | buf = kmalloc(MAX_SETUP_DATA_SIZE, GFP_KERNEL); |
173 | if (!buf) | 167 | if (!buf) |
174 | return; | 168 | return; |
@@ -178,7 +172,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
178 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 172 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
179 | 0x22, 0x21, | 173 | 0x22, 0x21, |
180 | 0x0002, 0x0000, NULL, len, | 174 | 0x0002, 0x0000, NULL, len, |
181 | HZ * USB_CTRL_GET_TIMEOUT); | 175 | USB_CTRL_GET_TIMEOUT); |
182 | dev_dbg(dev, "result = %d\n", result); | 176 | dev_dbg(dev, "result = %d\n", result); |
183 | 177 | ||
184 | /* send 2st ctl cmd(CTL 21 22 03 00 00 00 00 00 ) */ | 178 | /* send 2st ctl cmd(CTL 21 22 03 00 00 00 00 00 ) */ |
@@ -186,7 +180,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
186 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 180 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
187 | 0x22, 0x21, | 181 | 0x22, 0x21, |
188 | 0x0003, 0x0000, NULL, len, | 182 | 0x0003, 0x0000, NULL, len, |
189 | HZ * USB_CTRL_GET_TIMEOUT); | 183 | USB_CTRL_GET_TIMEOUT); |
190 | dev_dbg(dev, "result = %d\n", result); | 184 | dev_dbg(dev, "result = %d\n", result); |
191 | 185 | ||
192 | /* send 3st cmd and recieve data */ | 186 | /* send 3st cmd and recieve data */ |
@@ -198,7 +192,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
198 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 192 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
199 | 0x21, 0xa1, | 193 | 0x21, 0xa1, |
200 | 0x0000, 0x0000, buf, len, | 194 | 0x0000, 0x0000, buf, len, |
201 | HZ * USB_CTRL_GET_TIMEOUT); | 195 | USB_CTRL_GET_TIMEOUT); |
202 | debug_data(dev, __func__, len, buf, result); | 196 | debug_data(dev, __func__, len, buf, result); |
203 | 197 | ||
204 | /* send 4 cmd */ | 198 | /* send 4 cmd */ |
@@ -217,7 +211,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
217 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 211 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
218 | 0x20, 0x21, | 212 | 0x20, 0x21, |
219 | 0x0000, 0x0000, buf, len, | 213 | 0x0000, 0x0000, buf, len, |
220 | HZ * USB_CTRL_GET_TIMEOUT); | 214 | USB_CTRL_GET_TIMEOUT); |
221 | debug_data(dev, __func__, len, buf, result); | 215 | debug_data(dev, __func__, len, buf, result); |
222 | 216 | ||
223 | /* send 5 cmd */ | 217 | /* send 5 cmd */ |
@@ -228,7 +222,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
228 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 222 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
229 | 0x22, 0x21, | 223 | 0x22, 0x21, |
230 | 0x0003, 0x0000, NULL, len, | 224 | 0x0003, 0x0000, NULL, len, |
231 | HZ * USB_CTRL_GET_TIMEOUT); | 225 | USB_CTRL_GET_TIMEOUT); |
232 | dev_dbg(dev, "result = %d\n", result); | 226 | dev_dbg(dev, "result = %d\n", result); |
233 | 227 | ||
234 | /* send 6 cmd */ | 228 | /* send 6 cmd */ |
@@ -240,7 +234,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
240 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 234 | result = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
241 | 0x21, 0xa1, | 235 | 0x21, 0xa1, |
242 | 0x0000, 0x0000, buf, len, | 236 | 0x0000, 0x0000, buf, len, |
243 | HZ * USB_CTRL_GET_TIMEOUT); | 237 | USB_CTRL_GET_TIMEOUT); |
244 | debug_data(dev, __func__, len, buf, result); | 238 | debug_data(dev, __func__, len, buf, result); |
245 | 239 | ||
246 | /* send 7 cmd */ | 240 | /* send 7 cmd */ |
@@ -259,7 +253,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
259 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 253 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
260 | 0x20, 0x21, | 254 | 0x20, 0x21, |
261 | 0x0000, 0x0000, buf, len, | 255 | 0x0000, 0x0000, buf, len, |
262 | HZ * USB_CTRL_GET_TIMEOUT); | 256 | USB_CTRL_GET_TIMEOUT); |
263 | debug_data(dev, __func__, len, buf, result); | 257 | debug_data(dev, __func__, len, buf, result); |
264 | 258 | ||
265 | /* send 8 cmd */ | 259 | /* send 8 cmd */ |
@@ -270,7 +264,7 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
270 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), | 264 | result = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), |
271 | 0x22, 0x21, | 265 | 0x22, 0x21, |
272 | 0x0003, 0x0000, NULL, len, | 266 | 0x0003, 0x0000, NULL, len, |
273 | HZ * USB_CTRL_GET_TIMEOUT); | 267 | USB_CTRL_GET_TIMEOUT); |
274 | dev_dbg(dev, "result = %d\n", result); | 268 | dev_dbg(dev, "result = %d\n", result); |
275 | 269 | ||
276 | kfree(buf); | 270 | kfree(buf); |
@@ -279,11 +273,29 @@ static void zte_ev_usb_serial_close(struct usb_serial_port *port) | |||
279 | } | 273 | } |
280 | 274 | ||
281 | static const struct usb_device_id id_table[] = { | 275 | static const struct usb_device_id id_table[] = { |
282 | { USB_DEVICE(0x19d2, 0xffff) }, /* AC8700 */ | 276 | /* AC8710, AC8710T */ |
283 | { USB_DEVICE(0x19d2, 0xfffe) }, | 277 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffff, 0xff, 0xff, 0xff) }, |
284 | { USB_DEVICE(0x19d2, 0xfffd) }, /* MG880 */ | 278 | /* AC8700 */ |
279 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfffe, 0xff, 0xff, 0xff) }, | ||
280 | /* MG880 */ | ||
281 | { USB_DEVICE(0x19d2, 0xfffd) }, | ||
282 | { USB_DEVICE(0x19d2, 0xfffc) }, | ||
283 | { USB_DEVICE(0x19d2, 0xfffb) }, | ||
284 | /* AC2726, AC8710_V3 */ | ||
285 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xfff1, 0xff, 0xff, 0xff) }, | ||
286 | { USB_DEVICE(0x19d2, 0xfff6) }, | ||
287 | { USB_DEVICE(0x19d2, 0xfff7) }, | ||
288 | { USB_DEVICE(0x19d2, 0xfff8) }, | ||
289 | { USB_DEVICE(0x19d2, 0xfff9) }, | ||
290 | { USB_DEVICE(0x19d2, 0xffee) }, | ||
291 | /* AC2716, MC2716 */ | ||
292 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffed, 0xff, 0xff, 0xff) }, | ||
293 | /* AD3812 */ | ||
294 | { USB_DEVICE_AND_INTERFACE_INFO(0x19d2, 0xffeb, 0xff, 0xff, 0xff) }, | ||
295 | { USB_DEVICE(0x19d2, 0xffec) }, | ||
285 | { USB_DEVICE(0x05C6, 0x3197) }, | 296 | { USB_DEVICE(0x05C6, 0x3197) }, |
286 | { USB_DEVICE(0x05C6, 0x6000) }, | 297 | { USB_DEVICE(0x05C6, 0x6000) }, |
298 | { USB_DEVICE(0x05C6, 0x9008) }, | ||
287 | { }, | 299 | { }, |
288 | }; | 300 | }; |
289 | MODULE_DEVICE_TABLE(usb, id_table); | 301 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index acb7121a9316..6d78736563de 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c | |||
@@ -1360,7 +1360,7 @@ static const struct file_operations vfio_device_fops = { | |||
1360 | */ | 1360 | */ |
1361 | static char *vfio_devnode(struct device *dev, umode_t *mode) | 1361 | static char *vfio_devnode(struct device *dev, umode_t *mode) |
1362 | { | 1362 | { |
1363 | if (MINOR(dev->devt) == 0) | 1363 | if (mode && (MINOR(dev->devt) == 0)) |
1364 | *mode = S_IRUGO | S_IWUGO; | 1364 | *mode = S_IRUGO | S_IWUGO; |
1365 | 1365 | ||
1366 | return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev)); | 1366 | return kasprintf(GFP_KERNEL, "vfio/%s", dev_name(dev)); |
diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 540909de6247..effdb373b8db 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c | |||
@@ -223,8 +223,14 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo) | |||
223 | 223 | ||
224 | static void exit_backlight(struct atmel_lcdfb_info *sinfo) | 224 | static void exit_backlight(struct atmel_lcdfb_info *sinfo) |
225 | { | 225 | { |
226 | if (sinfo->backlight) | 226 | if (!sinfo->backlight) |
227 | backlight_device_unregister(sinfo->backlight); | 227 | return; |
228 | |||
229 | if (sinfo->backlight->ops) { | ||
230 | sinfo->backlight->props.power = FB_BLANK_POWERDOWN; | ||
231 | sinfo->backlight->ops->update_status(sinfo->backlight); | ||
232 | } | ||
233 | backlight_device_unregister(sinfo->backlight); | ||
228 | } | 234 | } |
229 | 235 | ||
230 | #else | 236 | #else |
@@ -461,8 +467,11 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var, | |||
461 | if (info->fix.smem_len) { | 467 | if (info->fix.smem_len) { |
462 | unsigned int smem_len = (var->xres_virtual * var->yres_virtual | 468 | unsigned int smem_len = (var->xres_virtual * var->yres_virtual |
463 | * ((var->bits_per_pixel + 7) / 8)); | 469 | * ((var->bits_per_pixel + 7) / 8)); |
464 | if (smem_len > info->fix.smem_len) | 470 | if (smem_len > info->fix.smem_len) { |
471 | dev_err(dev, "Frame buffer is too small (%u) for screen size (need at least %u)\n", | ||
472 | info->fix.smem_len, smem_len); | ||
465 | return -EINVAL; | 473 | return -EINVAL; |
474 | } | ||
466 | } | 475 | } |
467 | 476 | ||
468 | /* Saturate vertical and horizontal timings at maximum values */ | 477 | /* Saturate vertical and horizontal timings at maximum values */ |
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 60cc6fee6548..c9c2252e3719 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c | |||
@@ -53,6 +53,8 @@ static char *def_disp_name; | |||
53 | module_param_named(def_disp, def_disp_name, charp, 0); | 53 | module_param_named(def_disp, def_disp_name, charp, 0); |
54 | MODULE_PARM_DESC(def_disp, "default display name"); | 54 | MODULE_PARM_DESC(def_disp, "default display name"); |
55 | 55 | ||
56 | static bool dss_initialized; | ||
57 | |||
56 | const char *omapdss_get_default_display_name(void) | 58 | const char *omapdss_get_default_display_name(void) |
57 | { | 59 | { |
58 | return core.default_display_name; | 60 | return core.default_display_name; |
@@ -66,6 +68,12 @@ enum omapdss_version omapdss_get_version(void) | |||
66 | } | 68 | } |
67 | EXPORT_SYMBOL(omapdss_get_version); | 69 | EXPORT_SYMBOL(omapdss_get_version); |
68 | 70 | ||
71 | bool omapdss_is_initialized(void) | ||
72 | { | ||
73 | return dss_initialized; | ||
74 | } | ||
75 | EXPORT_SYMBOL(omapdss_is_initialized); | ||
76 | |||
69 | struct platform_device *dss_get_core_pdev(void) | 77 | struct platform_device *dss_get_core_pdev(void) |
70 | { | 78 | { |
71 | return core.pdev; | 79 | return core.pdev; |
@@ -603,6 +611,8 @@ static int __init omap_dss_init(void) | |||
603 | return r; | 611 | return r; |
604 | } | 612 | } |
605 | 613 | ||
614 | dss_initialized = true; | ||
615 | |||
606 | return 0; | 616 | return 0; |
607 | } | 617 | } |
608 | 618 | ||
@@ -633,7 +643,15 @@ static int __init omap_dss_init(void) | |||
633 | 643 | ||
634 | static int __init omap_dss_init2(void) | 644 | static int __init omap_dss_init2(void) |
635 | { | 645 | { |
636 | return omap_dss_register_drivers(); | 646 | int r; |
647 | |||
648 | r = omap_dss_register_drivers(); | ||
649 | if (r) | ||
650 | return r; | ||
651 | |||
652 | dss_initialized = true; | ||
653 | |||
654 | return 0; | ||
637 | } | 655 | } |
638 | 656 | ||
639 | core_initcall(omap_dss_init); | 657 | core_initcall(omap_dss_init); |
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index c84bb8a4d0c4..856917b33616 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c | |||
@@ -2416,6 +2416,9 @@ static int omapfb_probe(struct platform_device *pdev) | |||
2416 | 2416 | ||
2417 | DBG("omapfb_probe\n"); | 2417 | DBG("omapfb_probe\n"); |
2418 | 2418 | ||
2419 | if (omapdss_is_initialized() == false) | ||
2420 | return -EPROBE_DEFER; | ||
2421 | |||
2419 | if (pdev->num_resources != 0) { | 2422 | if (pdev->num_resources != 0) { |
2420 | dev_err(&pdev->dev, "probed for an unknown device\n"); | 2423 | dev_err(&pdev->dev, "probed for an unknown device\n"); |
2421 | r = -ENODEV; | 2424 | r = -ENODEV; |
diff --git a/drivers/video/ps3fb.c b/drivers/video/ps3fb.c index d9f08c653d62..dbfe2c18a434 100644 --- a/drivers/video/ps3fb.c +++ b/drivers/video/ps3fb.c | |||
@@ -710,7 +710,7 @@ static int ps3fb_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
710 | r = vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len); | 710 | r = vm_iomap_memory(vma, info->fix.smem_start, info->fix.smem_len); |
711 | 711 | ||
712 | dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n", | 712 | dev_dbg(info->device, "ps3fb: mmap framebuffer P(%lx)->V(%lx)\n", |
713 | info->fix.smem_start + vma->vm_pgoff << PAGE_SHIFT, | 713 | info->fix.smem_start + (vma->vm_pgoff << PAGE_SHIFT), |
714 | vma->vm_start); | 714 | vma->vm_start); |
715 | 715 | ||
716 | return r; | 716 | return r; |
diff --git a/drivers/xen/tmem.c b/drivers/xen/tmem.c index 18e8bd8fa947..cc072c66c766 100644 --- a/drivers/xen/tmem.c +++ b/drivers/xen/tmem.c | |||
@@ -41,6 +41,8 @@ module_param(selfballooning, bool, S_IRUGO); | |||
41 | #ifdef CONFIG_FRONTSWAP | 41 | #ifdef CONFIG_FRONTSWAP |
42 | static bool frontswap __read_mostly = true; | 42 | static bool frontswap __read_mostly = true; |
43 | module_param(frontswap, bool, S_IRUGO); | 43 | module_param(frontswap, bool, S_IRUGO); |
44 | #else /* CONFIG_FRONTSWAP */ | ||
45 | #define frontswap (0) | ||
44 | #endif /* CONFIG_FRONTSWAP */ | 46 | #endif /* CONFIG_FRONTSWAP */ |
45 | 47 | ||
46 | #ifdef CONFIG_XEN_SELFBALLOONING | 48 | #ifdef CONFIG_XEN_SELFBALLOONING |
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index a2278ba7fb27..4e8ba38aa0c9 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c | |||
@@ -106,7 +106,7 @@ static void pcistub_device_release(struct kref *kref) | |||
106 | else | 106 | else |
107 | pci_restore_state(dev); | 107 | pci_restore_state(dev); |
108 | 108 | ||
109 | if (pci_find_capability(dev, PCI_CAP_ID_MSIX)) { | 109 | if (dev->msix_cap) { |
110 | struct physdev_pci_device ppdev = { | 110 | struct physdev_pci_device ppdev = { |
111 | .seg = pci_domain_nr(dev->bus), | 111 | .seg = pci_domain_nr(dev->bus), |
112 | .bus = dev->bus->number, | 112 | .bus = dev->bus->number, |
@@ -371,7 +371,7 @@ static int pcistub_init_device(struct pci_dev *dev) | |||
371 | if (err) | 371 | if (err) |
372 | goto config_release; | 372 | goto config_release; |
373 | 373 | ||
374 | if (pci_find_capability(dev, PCI_CAP_ID_MSIX)) { | 374 | if (dev->msix_cap) { |
375 | struct physdev_pci_device ppdev = { | 375 | struct physdev_pci_device ppdev = { |
376 | .seg = pci_domain_nr(dev->bus), | 376 | .seg = pci_domain_nr(dev->bus), |
377 | .bus = dev->bus->number, | 377 | .bus = dev->bus->number, |
diff --git a/drivers/xen/xenbus/xenbus_client.c b/drivers/xen/xenbus/xenbus_client.c index 61786be9138b..ec097d6f964d 100644 --- a/drivers/xen/xenbus/xenbus_client.c +++ b/drivers/xen/xenbus/xenbus_client.c | |||
@@ -534,7 +534,7 @@ static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev, | |||
534 | 534 | ||
535 | err = xenbus_map_ring(dev, gnt_ref, &node->handle, addr); | 535 | err = xenbus_map_ring(dev, gnt_ref, &node->handle, addr); |
536 | if (err) | 536 | if (err) |
537 | goto out_err; | 537 | goto out_err_free_ballooned_pages; |
538 | 538 | ||
539 | spin_lock(&xenbus_valloc_lock); | 539 | spin_lock(&xenbus_valloc_lock); |
540 | list_add(&node->next, &xenbus_valloc_pages); | 540 | list_add(&node->next, &xenbus_valloc_pages); |
@@ -543,8 +543,9 @@ static int xenbus_map_ring_valloc_hvm(struct xenbus_device *dev, | |||
543 | *vaddr = addr; | 543 | *vaddr = addr; |
544 | return 0; | 544 | return 0; |
545 | 545 | ||
546 | out_err: | 546 | out_err_free_ballooned_pages: |
547 | free_xenballooned_pages(1, &node->page); | 547 | free_xenballooned_pages(1, &node->page); |
548 | out_err: | ||
548 | kfree(node); | 549 | kfree(node); |
549 | return err; | 550 | return err; |
550 | } | 551 | } |
diff --git a/drivers/xen/xenbus/xenbus_comms.h b/drivers/xen/xenbus/xenbus_comms.h index c8abd3b8a6c4..e74f9c1fbd80 100644 --- a/drivers/xen/xenbus/xenbus_comms.h +++ b/drivers/xen/xenbus/xenbus_comms.h | |||
@@ -45,6 +45,7 @@ int xb_wait_for_data_to_read(void); | |||
45 | int xs_input_avail(void); | 45 | int xs_input_avail(void); |
46 | extern struct xenstore_domain_interface *xen_store_interface; | 46 | extern struct xenstore_domain_interface *xen_store_interface; |
47 | extern int xen_store_evtchn; | 47 | extern int xen_store_evtchn; |
48 | extern enum xenstore_init xen_store_domain_type; | ||
48 | 49 | ||
49 | extern const struct file_operations xen_xenbus_fops; | 50 | extern const struct file_operations xen_xenbus_fops; |
50 | 51 | ||
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 3325884c693f..56cfaaa9d006 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -69,6 +69,9 @@ EXPORT_SYMBOL_GPL(xen_store_evtchn); | |||
69 | struct xenstore_domain_interface *xen_store_interface; | 69 | struct xenstore_domain_interface *xen_store_interface; |
70 | EXPORT_SYMBOL_GPL(xen_store_interface); | 70 | EXPORT_SYMBOL_GPL(xen_store_interface); |
71 | 71 | ||
72 | enum xenstore_init xen_store_domain_type; | ||
73 | EXPORT_SYMBOL_GPL(xen_store_domain_type); | ||
74 | |||
72 | static unsigned long xen_store_mfn; | 75 | static unsigned long xen_store_mfn; |
73 | 76 | ||
74 | static BLOCKING_NOTIFIER_HEAD(xenstore_chain); | 77 | static BLOCKING_NOTIFIER_HEAD(xenstore_chain); |
@@ -719,17 +722,11 @@ static int __init xenstored_local_init(void) | |||
719 | return err; | 722 | return err; |
720 | } | 723 | } |
721 | 724 | ||
722 | enum xenstore_init { | ||
723 | UNKNOWN, | ||
724 | PV, | ||
725 | HVM, | ||
726 | LOCAL, | ||
727 | }; | ||
728 | static int __init xenbus_init(void) | 725 | static int __init xenbus_init(void) |
729 | { | 726 | { |
730 | int err = 0; | 727 | int err = 0; |
731 | enum xenstore_init usage = UNKNOWN; | ||
732 | uint64_t v = 0; | 728 | uint64_t v = 0; |
729 | xen_store_domain_type = XS_UNKNOWN; | ||
733 | 730 | ||
734 | if (!xen_domain()) | 731 | if (!xen_domain()) |
735 | return -ENODEV; | 732 | return -ENODEV; |
@@ -737,29 +734,29 @@ static int __init xenbus_init(void) | |||
737 | xenbus_ring_ops_init(); | 734 | xenbus_ring_ops_init(); |
738 | 735 | ||
739 | if (xen_pv_domain()) | 736 | if (xen_pv_domain()) |
740 | usage = PV; | 737 | xen_store_domain_type = XS_PV; |
741 | if (xen_hvm_domain()) | 738 | if (xen_hvm_domain()) |
742 | usage = HVM; | 739 | xen_store_domain_type = XS_HVM; |
743 | if (xen_hvm_domain() && xen_initial_domain()) | 740 | if (xen_hvm_domain() && xen_initial_domain()) |
744 | usage = LOCAL; | 741 | xen_store_domain_type = XS_LOCAL; |
745 | if (xen_pv_domain() && !xen_start_info->store_evtchn) | 742 | if (xen_pv_domain() && !xen_start_info->store_evtchn) |
746 | usage = LOCAL; | 743 | xen_store_domain_type = XS_LOCAL; |
747 | if (xen_pv_domain() && xen_start_info->store_evtchn) | 744 | if (xen_pv_domain() && xen_start_info->store_evtchn) |
748 | xenstored_ready = 1; | 745 | xenstored_ready = 1; |
749 | 746 | ||
750 | switch (usage) { | 747 | switch (xen_store_domain_type) { |
751 | case LOCAL: | 748 | case XS_LOCAL: |
752 | err = xenstored_local_init(); | 749 | err = xenstored_local_init(); |
753 | if (err) | 750 | if (err) |
754 | goto out_error; | 751 | goto out_error; |
755 | xen_store_interface = mfn_to_virt(xen_store_mfn); | 752 | xen_store_interface = mfn_to_virt(xen_store_mfn); |
756 | break; | 753 | break; |
757 | case PV: | 754 | case XS_PV: |
758 | xen_store_evtchn = xen_start_info->store_evtchn; | 755 | xen_store_evtchn = xen_start_info->store_evtchn; |
759 | xen_store_mfn = xen_start_info->store_mfn; | 756 | xen_store_mfn = xen_start_info->store_mfn; |
760 | xen_store_interface = mfn_to_virt(xen_store_mfn); | 757 | xen_store_interface = mfn_to_virt(xen_store_mfn); |
761 | break; | 758 | break; |
762 | case HVM: | 759 | case XS_HVM: |
763 | err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v); | 760 | err = hvm_get_parameter(HVM_PARAM_STORE_EVTCHN, &v); |
764 | if (err) | 761 | if (err) |
765 | goto out_error; | 762 | goto out_error; |
diff --git a/drivers/xen/xenbus/xenbus_probe.h b/drivers/xen/xenbus/xenbus_probe.h index bb4f92ed8730..146f857a36f8 100644 --- a/drivers/xen/xenbus/xenbus_probe.h +++ b/drivers/xen/xenbus/xenbus_probe.h | |||
@@ -47,6 +47,13 @@ struct xen_bus_type { | |||
47 | struct bus_type bus; | 47 | struct bus_type bus; |
48 | }; | 48 | }; |
49 | 49 | ||
50 | enum xenstore_init { | ||
51 | XS_UNKNOWN, | ||
52 | XS_PV, | ||
53 | XS_HVM, | ||
54 | XS_LOCAL, | ||
55 | }; | ||
56 | |||
50 | extern struct device_attribute xenbus_dev_attrs[]; | 57 | extern struct device_attribute xenbus_dev_attrs[]; |
51 | 58 | ||
52 | extern int xenbus_match(struct device *_dev, struct device_driver *_drv); | 59 | extern int xenbus_match(struct device *_dev, struct device_driver *_drv); |
diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c index 3159a37d966d..a7e25073de19 100644 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c | |||
@@ -29,6 +29,8 @@ | |||
29 | #include "xenbus_probe.h" | 29 | #include "xenbus_probe.h" |
30 | 30 | ||
31 | 31 | ||
32 | static struct workqueue_struct *xenbus_frontend_wq; | ||
33 | |||
32 | /* device/<type>/<id> => <type>-<id> */ | 34 | /* device/<type>/<id> => <type>-<id> */ |
33 | static int frontend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename) | 35 | static int frontend_bus_id(char bus_id[XEN_BUS_ID_SIZE], const char *nodename) |
34 | { | 36 | { |
@@ -89,9 +91,40 @@ static void backend_changed(struct xenbus_watch *watch, | |||
89 | xenbus_otherend_changed(watch, vec, len, 1); | 91 | xenbus_otherend_changed(watch, vec, len, 1); |
90 | } | 92 | } |
91 | 93 | ||
94 | static void xenbus_frontend_delayed_resume(struct work_struct *w) | ||
95 | { | ||
96 | struct xenbus_device *xdev = container_of(w, struct xenbus_device, work); | ||
97 | |||
98 | xenbus_dev_resume(&xdev->dev); | ||
99 | } | ||
100 | |||
101 | static int xenbus_frontend_dev_resume(struct device *dev) | ||
102 | { | ||
103 | /* | ||
104 | * If xenstored is running in this domain, we cannot access the backend | ||
105 | * state at the moment, so we need to defer xenbus_dev_resume | ||
106 | */ | ||
107 | if (xen_store_domain_type == XS_LOCAL) { | ||
108 | struct xenbus_device *xdev = to_xenbus_device(dev); | ||
109 | |||
110 | if (!xenbus_frontend_wq) { | ||
111 | pr_err("%s: no workqueue to process delayed resume\n", | ||
112 | xdev->nodename); | ||
113 | return -EFAULT; | ||
114 | } | ||
115 | |||
116 | INIT_WORK(&xdev->work, xenbus_frontend_delayed_resume); | ||
117 | queue_work(xenbus_frontend_wq, &xdev->work); | ||
118 | |||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | return xenbus_dev_resume(dev); | ||
123 | } | ||
124 | |||
92 | static const struct dev_pm_ops xenbus_pm_ops = { | 125 | static const struct dev_pm_ops xenbus_pm_ops = { |
93 | .suspend = xenbus_dev_suspend, | 126 | .suspend = xenbus_dev_suspend, |
94 | .resume = xenbus_dev_resume, | 127 | .resume = xenbus_frontend_dev_resume, |
95 | .freeze = xenbus_dev_suspend, | 128 | .freeze = xenbus_dev_suspend, |
96 | .thaw = xenbus_dev_cancel, | 129 | .thaw = xenbus_dev_cancel, |
97 | .restore = xenbus_dev_resume, | 130 | .restore = xenbus_dev_resume, |
@@ -440,6 +473,8 @@ static int __init xenbus_probe_frontend_init(void) | |||
440 | 473 | ||
441 | register_xenstore_notifier(&xenstore_notifier); | 474 | register_xenstore_notifier(&xenstore_notifier); |
442 | 475 | ||
476 | xenbus_frontend_wq = create_workqueue("xenbus_frontend"); | ||
477 | |||
443 | return 0; | 478 | return 0; |
444 | } | 479 | } |
445 | subsys_initcall(xenbus_probe_frontend_init); | 480 | subsys_initcall(xenbus_probe_frontend_init); |