diff options
Diffstat (limited to 'drivers')
26 files changed, 169 insertions, 170 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index d5939e659cbb..d3ea7f55283c 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -101,12 +101,6 @@ int libata_noacpi = 1; | |||
101 | module_param_named(noacpi, libata_noacpi, int, 0444); | 101 | module_param_named(noacpi, libata_noacpi, int, 0444); |
102 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); | 102 | MODULE_PARM_DESC(noacpi, "Disables the use of ACPI in suspend/resume when set"); |
103 | 103 | ||
104 | int ata_spindown_compat = 1; | ||
105 | module_param_named(spindown_compat, ata_spindown_compat, int, 0644); | ||
106 | MODULE_PARM_DESC(spindown_compat, "Enable backward compatible spindown " | ||
107 | "behavior. Will be removed. More info can be found in " | ||
108 | "Documentation/feature-removal-schedule.txt\n"); | ||
109 | |||
110 | MODULE_AUTHOR("Jeff Garzik"); | 104 | MODULE_AUTHOR("Jeff Garzik"); |
111 | MODULE_DESCRIPTION("Library module for ATA devices"); | 105 | MODULE_DESCRIPTION("Library module for ATA devices"); |
112 | MODULE_LICENSE("GPL"); | 106 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index b6a1de8fad5b..242c43eef807 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -893,7 +893,7 @@ int ata_scsi_change_queue_depth(struct scsi_device *sdev, int queue_depth) | |||
893 | return queue_depth; | 893 | return queue_depth; |
894 | } | 894 | } |
895 | 895 | ||
896 | /* XXX: for ata_spindown_compat */ | 896 | /* XXX: for spindown warning */ |
897 | static void ata_delayed_done_timerfn(unsigned long arg) | 897 | static void ata_delayed_done_timerfn(unsigned long arg) |
898 | { | 898 | { |
899 | struct scsi_cmnd *scmd = (void *)arg; | 899 | struct scsi_cmnd *scmd = (void *)arg; |
@@ -901,7 +901,7 @@ static void ata_delayed_done_timerfn(unsigned long arg) | |||
901 | scmd->scsi_done(scmd); | 901 | scmd->scsi_done(scmd); |
902 | } | 902 | } |
903 | 903 | ||
904 | /* XXX: for ata_spindown_compat */ | 904 | /* XXX: for spindown warning */ |
905 | static void ata_delayed_done(struct scsi_cmnd *scmd) | 905 | static void ata_delayed_done(struct scsi_cmnd *scmd) |
906 | { | 906 | { |
907 | static struct timer_list timer; | 907 | static struct timer_list timer; |
@@ -966,8 +966,7 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) | |||
966 | * removed. Read Documentation/feature-removal-schedule.txt | 966 | * removed. Read Documentation/feature-removal-schedule.txt |
967 | * for more info. | 967 | * for more info. |
968 | */ | 968 | */ |
969 | if (ata_spindown_compat && | 969 | if ((qc->dev->flags & ATA_DFLAG_SPUNDOWN) && |
970 | (qc->dev->flags & ATA_DFLAG_SPUNDOWN) && | ||
971 | (system_state == SYSTEM_HALT || | 970 | (system_state == SYSTEM_HALT || |
972 | system_state == SYSTEM_POWER_OFF)) { | 971 | system_state == SYSTEM_POWER_OFF)) { |
973 | static unsigned long warned = 0; | 972 | static unsigned long warned = 0; |
@@ -1395,7 +1394,7 @@ static void ata_scsi_qc_complete(struct ata_queued_cmd *qc) | |||
1395 | } | 1394 | } |
1396 | } | 1395 | } |
1397 | 1396 | ||
1398 | /* XXX: track spindown state for spindown_compat */ | 1397 | /* XXX: track spindown state for spindown skipping and warning */ |
1399 | if (unlikely(qc->tf.command == ATA_CMD_STANDBY || | 1398 | if (unlikely(qc->tf.command == ATA_CMD_STANDBY || |
1400 | qc->tf.command == ATA_CMD_STANDBYNOW1)) | 1399 | qc->tf.command == ATA_CMD_STANDBYNOW1)) |
1401 | qc->dev->flags |= ATA_DFLAG_SPUNDOWN; | 1400 | qc->dev->flags |= ATA_DFLAG_SPUNDOWN; |
diff --git a/drivers/ata/libata.h b/drivers/ata/libata.h index 13cb0c9af68d..5e2466658420 100644 --- a/drivers/ata/libata.h +++ b/drivers/ata/libata.h | |||
@@ -58,7 +58,6 @@ extern int atapi_enabled; | |||
58 | extern int atapi_dmadir; | 58 | extern int atapi_dmadir; |
59 | extern int libata_fua; | 59 | extern int libata_fua; |
60 | extern int libata_noacpi; | 60 | extern int libata_noacpi; |
61 | extern int ata_spindown_compat; | ||
62 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); | 61 | extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev); |
63 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, | 62 | extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev, |
64 | u64 block, u32 n_block, unsigned int tf_flags, | 63 | u64 block, u32 n_block, unsigned int tf_flags, |
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c index 4cea3ef75226..1a49c777fa6a 100644 --- a/drivers/ata/sata_nv.c +++ b/drivers/ata/sata_nv.c | |||
@@ -229,7 +229,6 @@ struct nv_host_priv { | |||
229 | #define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT))))) | 229 | #define NV_ADMA_CHECK_INTR(GCTL, PORT) ((GCTL) & ( 1 << (19 + (12 * (PORT))))) |
230 | 230 | ||
231 | static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); | 231 | static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent); |
232 | static void nv_remove_one (struct pci_dev *pdev); | ||
233 | #ifdef CONFIG_PM | 232 | #ifdef CONFIG_PM |
234 | static int nv_pci_device_resume(struct pci_dev *pdev); | 233 | static int nv_pci_device_resume(struct pci_dev *pdev); |
235 | #endif | 234 | #endif |
@@ -288,12 +287,6 @@ static const struct pci_device_id nv_pci_tbl[] = { | |||
288 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, | 287 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA), GENERIC }, |
289 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, | 288 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2), GENERIC }, |
290 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, | 289 | { PCI_VDEVICE(NVIDIA, PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3), GENERIC }, |
291 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | ||
292 | PCI_ANY_ID, PCI_ANY_ID, | ||
293 | PCI_CLASS_STORAGE_IDE<<8, 0xffff00, GENERIC }, | ||
294 | { PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, | ||
295 | PCI_ANY_ID, PCI_ANY_ID, | ||
296 | PCI_CLASS_STORAGE_RAID<<8, 0xffff00, GENERIC }, | ||
297 | 290 | ||
298 | { } /* terminate list */ | 291 | { } /* terminate list */ |
299 | }; | 292 | }; |
@@ -306,7 +299,7 @@ static struct pci_driver nv_pci_driver = { | |||
306 | .suspend = ata_pci_device_suspend, | 299 | .suspend = ata_pci_device_suspend, |
307 | .resume = nv_pci_device_resume, | 300 | .resume = nv_pci_device_resume, |
308 | #endif | 301 | #endif |
309 | .remove = nv_remove_one, | 302 | .remove = ata_pci_remove_one, |
310 | }; | 303 | }; |
311 | 304 | ||
312 | static struct scsi_host_template nv_sht = { | 305 | static struct scsi_host_template nv_sht = { |
@@ -1613,15 +1606,6 @@ static int nv_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1613 | IRQF_SHARED, ppi[0]->sht); | 1606 | IRQF_SHARED, ppi[0]->sht); |
1614 | } | 1607 | } |
1615 | 1608 | ||
1616 | static void nv_remove_one (struct pci_dev *pdev) | ||
1617 | { | ||
1618 | struct ata_host *host = dev_get_drvdata(&pdev->dev); | ||
1619 | struct nv_host_priv *hpriv = host->private_data; | ||
1620 | |||
1621 | ata_pci_remove_one(pdev); | ||
1622 | kfree(hpriv); | ||
1623 | } | ||
1624 | |||
1625 | #ifdef CONFIG_PM | 1609 | #ifdef CONFIG_PM |
1626 | static int nv_pci_device_resume(struct pci_dev *pdev) | 1610 | static int nv_pci_device_resume(struct pci_dev *pdev) |
1627 | { | 1611 | { |
diff --git a/drivers/ata/sata_via.c b/drivers/ata/sata_via.c index d105d2c189d2..ac4f43c4993f 100644 --- a/drivers/ata/sata_via.c +++ b/drivers/ata/sata_via.c | |||
@@ -441,7 +441,7 @@ static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host) | |||
441 | return -ENOMEM; | 441 | return -ENOMEM; |
442 | } | 442 | } |
443 | 443 | ||
444 | rc = pcim_iomap_regions(pdev, 0x1f, DRV_NAME); | 444 | rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); |
445 | if (rc) { | 445 | if (rc) { |
446 | dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap " | 446 | dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap " |
447 | "PCI BARs (errno=%d)\n", rc); | 447 | "PCI BARs (errno=%d)\n", rc); |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 370dfe1c422e..5acc6c44aead 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -3469,13 +3469,39 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3469 | return -1; | 3469 | return -1; |
3470 | } | 3470 | } |
3471 | 3471 | ||
3472 | static void cciss_remove_one(struct pci_dev *pdev) | 3472 | static void cciss_shutdown(struct pci_dev *pdev) |
3473 | { | 3473 | { |
3474 | ctlr_info_t *tmp_ptr; | 3474 | ctlr_info_t *tmp_ptr; |
3475 | int i, j; | 3475 | int i; |
3476 | char flush_buf[4]; | 3476 | char flush_buf[4]; |
3477 | int return_code; | 3477 | int return_code; |
3478 | 3478 | ||
3479 | tmp_ptr = pci_get_drvdata(pdev); | ||
3480 | if (tmp_ptr == NULL) | ||
3481 | return; | ||
3482 | i = tmp_ptr->ctlr; | ||
3483 | if (hba[i] == NULL) | ||
3484 | return; | ||
3485 | |||
3486 | /* Turn board interrupts off and send the flush cache command */ | ||
3487 | /* sendcmd will turn off interrupt, and send the flush... | ||
3488 | * To write all data in the battery backed cache to disks */ | ||
3489 | memset(flush_buf, 0, 4); | ||
3490 | return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, | ||
3491 | TYPE_CMD); | ||
3492 | if (return_code == IO_OK) { | ||
3493 | printk(KERN_INFO "Completed flushing cache on controller %d\n", i); | ||
3494 | } else { | ||
3495 | printk(KERN_WARNING "Error flushing cache on controller %d\n", i); | ||
3496 | } | ||
3497 | free_irq(hba[i]->intr[2], hba[i]); | ||
3498 | } | ||
3499 | |||
3500 | static void __devexit cciss_remove_one(struct pci_dev *pdev) | ||
3501 | { | ||
3502 | ctlr_info_t *tmp_ptr; | ||
3503 | int i, j; | ||
3504 | |||
3479 | if (pci_get_drvdata(pdev) == NULL) { | 3505 | if (pci_get_drvdata(pdev) == NULL) { |
3480 | printk(KERN_ERR "cciss: Unable to remove device \n"); | 3506 | printk(KERN_ERR "cciss: Unable to remove device \n"); |
3481 | return; | 3507 | return; |
@@ -3506,18 +3532,7 @@ static void cciss_remove_one(struct pci_dev *pdev) | |||
3506 | 3532 | ||
3507 | cciss_unregister_scsi(i); /* unhook from SCSI subsystem */ | 3533 | cciss_unregister_scsi(i); /* unhook from SCSI subsystem */ |
3508 | 3534 | ||
3509 | /* Turn board interrupts off and send the flush cache command */ | 3535 | cciss_shutdown(pdev); |
3510 | /* sendcmd will turn off interrupt, and send the flush... | ||
3511 | * To write all data in the battery backed cache to disks */ | ||
3512 | memset(flush_buf, 0, 4); | ||
3513 | return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, | ||
3514 | TYPE_CMD); | ||
3515 | if (return_code == IO_OK) { | ||
3516 | printk(KERN_INFO "Completed flushing cache on controller %d\n", i); | ||
3517 | } else { | ||
3518 | printk(KERN_WARNING "Error flushing cache on controller %d\n", i); | ||
3519 | } | ||
3520 | free_irq(hba[i]->intr[2], hba[i]); | ||
3521 | 3536 | ||
3522 | #ifdef CONFIG_PCI_MSI | 3537 | #ifdef CONFIG_PCI_MSI |
3523 | if (hba[i]->msix_vector) | 3538 | if (hba[i]->msix_vector) |
@@ -3550,7 +3565,7 @@ static struct pci_driver cciss_pci_driver = { | |||
3550 | .probe = cciss_init_one, | 3565 | .probe = cciss_init_one, |
3551 | .remove = __devexit_p(cciss_remove_one), | 3566 | .remove = __devexit_p(cciss_remove_one), |
3552 | .id_table = cciss_pci_device_id, /* id_table */ | 3567 | .id_table = cciss_pci_device_id, /* id_table */ |
3553 | .shutdown = cciss_remove_one, | 3568 | .shutdown = cciss_shutdown, |
3554 | }; | 3569 | }; |
3555 | 3570 | ||
3556 | /* | 3571 | /* |
diff --git a/drivers/char/watchdog/booke_wdt.c b/drivers/char/watchdog/booke_wdt.c index 0e23f29f71ab..0f5c77ddd39d 100644 --- a/drivers/char/watchdog/booke_wdt.c +++ b/drivers/char/watchdog/booke_wdt.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
25 | #include <asm/system.h> | 25 | #include <asm/system.h> |
26 | 26 | ||
27 | /* If the kernel parameter wdt_enable=1, the watchdog will be enabled at boot. | 27 | /* If the kernel parameter wdt=1, the watchdog will be enabled at boot. |
28 | * Also, the wdt_period sets the watchdog timer period timeout. | 28 | * Also, the wdt_period sets the watchdog timer period timeout. |
29 | * For E500 cpus the wdt_period sets which bit changing from 0->1 will | 29 | * For E500 cpus the wdt_period sets which bit changing from 0->1 will |
30 | * trigger a watchog timeout. This watchdog timeout will occur 3 times, the | 30 | * trigger a watchog timeout. This watchdog timeout will occur 3 times, the |
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c index 192b26e97777..11ced17f438a 100644 --- a/drivers/macintosh/windfarm_core.c +++ b/drivers/macintosh/windfarm_core.c | |||
@@ -216,7 +216,10 @@ int wf_register_control(struct wf_control *new_ct) | |||
216 | new_ct->attr.attr.mode = 0644; | 216 | new_ct->attr.attr.mode = 0644; |
217 | new_ct->attr.show = wf_show_control; | 217 | new_ct->attr.show = wf_show_control; |
218 | new_ct->attr.store = wf_store_control; | 218 | new_ct->attr.store = wf_store_control; |
219 | device_create_file(&wf_platform_device.dev, &new_ct->attr); | 219 | if (device_create_file(&wf_platform_device.dev, &new_ct->attr)) |
220 | printk(KERN_WARNING "windfarm: device_create_file failed" | ||
221 | " for %s\n", new_ct->name); | ||
222 | /* the subsystem still does useful work without the file */ | ||
220 | 223 | ||
221 | DBG("wf: Registered control %s\n", new_ct->name); | 224 | DBG("wf: Registered control %s\n", new_ct->name); |
222 | 225 | ||
@@ -326,7 +329,10 @@ int wf_register_sensor(struct wf_sensor *new_sr) | |||
326 | new_sr->attr.attr.mode = 0444; | 329 | new_sr->attr.attr.mode = 0444; |
327 | new_sr->attr.show = wf_show_sensor; | 330 | new_sr->attr.show = wf_show_sensor; |
328 | new_sr->attr.store = NULL; | 331 | new_sr->attr.store = NULL; |
329 | device_create_file(&wf_platform_device.dev, &new_sr->attr); | 332 | if (device_create_file(&wf_platform_device.dev, &new_sr->attr)) |
333 | printk(KERN_WARNING "windfarm: device_create_file failed" | ||
334 | " for %s\n", new_sr->name); | ||
335 | /* the subsystem still does useful work without the file */ | ||
330 | 336 | ||
331 | DBG("wf: Registered sensor %s\n", new_sr->name); | 337 | DBG("wf: Registered sensor %s\n", new_sr->name); |
332 | 338 | ||
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index a9ea67e75c1b..16a6edfeba41 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -333,11 +333,9 @@ struct e1000_adapter { | |||
333 | struct e1000_tx_ring test_tx_ring; | 333 | struct e1000_tx_ring test_tx_ring; |
334 | struct e1000_rx_ring test_rx_ring; | 334 | struct e1000_rx_ring test_rx_ring; |
335 | 335 | ||
336 | |||
337 | int msg_enable; | 336 | int msg_enable; |
338 | #ifdef CONFIG_PCI_MSI | ||
339 | boolean_t have_msi; | 337 | boolean_t have_msi; |
340 | #endif | 338 | |
341 | /* to not mess up cache alignment, always add to the bottom */ | 339 | /* to not mess up cache alignment, always add to the bottom */ |
342 | boolean_t tso_force; | 340 | boolean_t tso_force; |
343 | boolean_t smart_power_down; /* phy smart power down */ | 341 | boolean_t smart_power_down; /* phy smart power down */ |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 637ae8f68791..49be393e1c1d 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -158,9 +158,7 @@ static struct net_device_stats * e1000_get_stats(struct net_device *netdev); | |||
158 | static int e1000_change_mtu(struct net_device *netdev, int new_mtu); | 158 | static int e1000_change_mtu(struct net_device *netdev, int new_mtu); |
159 | static int e1000_set_mac(struct net_device *netdev, void *p); | 159 | static int e1000_set_mac(struct net_device *netdev, void *p); |
160 | static irqreturn_t e1000_intr(int irq, void *data); | 160 | static irqreturn_t e1000_intr(int irq, void *data); |
161 | #ifdef CONFIG_PCI_MSI | ||
162 | static irqreturn_t e1000_intr_msi(int irq, void *data); | 161 | static irqreturn_t e1000_intr_msi(int irq, void *data); |
163 | #endif | ||
164 | static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter, | 162 | static boolean_t e1000_clean_tx_irq(struct e1000_adapter *adapter, |
165 | struct e1000_tx_ring *tx_ring); | 163 | struct e1000_tx_ring *tx_ring); |
166 | #ifdef CONFIG_E1000_NAPI | 164 | #ifdef CONFIG_E1000_NAPI |
@@ -300,31 +298,26 @@ module_exit(e1000_exit_module); | |||
300 | static int e1000_request_irq(struct e1000_adapter *adapter) | 298 | static int e1000_request_irq(struct e1000_adapter *adapter) |
301 | { | 299 | { |
302 | struct net_device *netdev = adapter->netdev; | 300 | struct net_device *netdev = adapter->netdev; |
303 | int flags, err = 0; | 301 | void (*handler) = &e1000_intr; |
302 | int irq_flags = IRQF_SHARED; | ||
303 | int err; | ||
304 | 304 | ||
305 | flags = IRQF_SHARED; | ||
306 | #ifdef CONFIG_PCI_MSI | ||
307 | if (adapter->hw.mac_type >= e1000_82571) { | 305 | if (adapter->hw.mac_type >= e1000_82571) { |
308 | adapter->have_msi = TRUE; | 306 | adapter->have_msi = !pci_enable_msi(adapter->pdev); |
309 | if ((err = pci_enable_msi(adapter->pdev))) { | 307 | if (adapter->have_msi) { |
310 | DPRINTK(PROBE, ERR, | 308 | handler = &e1000_intr_msi; |
311 | "Unable to allocate MSI interrupt Error: %d\n", err); | 309 | irq_flags = 0; |
312 | adapter->have_msi = FALSE; | ||
313 | } | 310 | } |
314 | } | 311 | } |
315 | if (adapter->have_msi) { | 312 | |
316 | flags &= ~IRQF_SHARED; | 313 | err = request_irq(adapter->pdev->irq, handler, irq_flags, netdev->name, |
317 | err = request_irq(adapter->pdev->irq, &e1000_intr_msi, flags, | 314 | netdev); |
318 | netdev->name, netdev); | 315 | if (err) { |
319 | if (err) | 316 | if (adapter->have_msi) |
320 | DPRINTK(PROBE, ERR, | 317 | pci_disable_msi(adapter->pdev); |
321 | "Unable to allocate interrupt Error: %d\n", err); | ||
322 | } else | ||
323 | #endif | ||
324 | if ((err = request_irq(adapter->pdev->irq, &e1000_intr, flags, | ||
325 | netdev->name, netdev))) | ||
326 | DPRINTK(PROBE, ERR, | 318 | DPRINTK(PROBE, ERR, |
327 | "Unable to allocate interrupt Error: %d\n", err); | 319 | "Unable to allocate interrupt Error: %d\n", err); |
320 | } | ||
328 | 321 | ||
329 | return err; | 322 | return err; |
330 | } | 323 | } |
@@ -335,10 +328,8 @@ static void e1000_free_irq(struct e1000_adapter *adapter) | |||
335 | 328 | ||
336 | free_irq(adapter->pdev->irq, netdev); | 329 | free_irq(adapter->pdev->irq, netdev); |
337 | 330 | ||
338 | #ifdef CONFIG_PCI_MSI | ||
339 | if (adapter->have_msi) | 331 | if (adapter->have_msi) |
340 | pci_disable_msi(adapter->pdev); | 332 | pci_disable_msi(adapter->pdev); |
341 | #endif | ||
342 | } | 333 | } |
343 | 334 | ||
344 | /** | 335 | /** |
@@ -3744,7 +3735,6 @@ e1000_update_stats(struct e1000_adapter *adapter) | |||
3744 | 3735 | ||
3745 | spin_unlock_irqrestore(&adapter->stats_lock, flags); | 3736 | spin_unlock_irqrestore(&adapter->stats_lock, flags); |
3746 | } | 3737 | } |
3747 | #ifdef CONFIG_PCI_MSI | ||
3748 | 3738 | ||
3749 | /** | 3739 | /** |
3750 | * e1000_intr_msi - Interrupt Handler | 3740 | * e1000_intr_msi - Interrupt Handler |
@@ -3810,7 +3800,6 @@ e1000_intr_msi(int irq, void *data) | |||
3810 | 3800 | ||
3811 | return IRQ_HANDLED; | 3801 | return IRQ_HANDLED; |
3812 | } | 3802 | } |
3813 | #endif | ||
3814 | 3803 | ||
3815 | /** | 3804 | /** |
3816 | * e1000_intr - Interrupt Handler | 3805 | * e1000_intr - Interrupt Handler |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index b666a0cc0642..f5b3cba23fc5 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -1025,6 +1025,15 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1025 | 1025 | ||
1026 | dev->trans_start = jiffies; | 1026 | dev->trans_start = jiffies; |
1027 | 1027 | ||
1028 | /* The powerpc-specific eieio() is used, as wmb() has too strong | ||
1029 | * semantics (it requires synchronization between cacheable and | ||
1030 | * uncacheable mappings, which eieio doesn't provide and which we | ||
1031 | * don't need), thus requiring a more expensive sync instruction. At | ||
1032 | * some point, the set of architecture-independent barrier functions | ||
1033 | * should be expanded to include weaker barriers. | ||
1034 | */ | ||
1035 | |||
1036 | eieio(); | ||
1028 | txbdp->status = status; | 1037 | txbdp->status = status; |
1029 | 1038 | ||
1030 | /* If this was the last BD in the ring, the next one */ | 1039 | /* If this was the last BD in the ring, the next one */ |
@@ -1301,6 +1310,7 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp) | |||
1301 | bdp->length = 0; | 1310 | bdp->length = 0; |
1302 | 1311 | ||
1303 | /* Mark the buffer empty */ | 1312 | /* Mark the buffer empty */ |
1313 | eieio(); | ||
1304 | bdp->status |= (RXBD_EMPTY | RXBD_INTERRUPT); | 1314 | bdp->status |= (RXBD_EMPTY | RXBD_INTERRUPT); |
1305 | 1315 | ||
1306 | return skb; | 1316 | return skb; |
@@ -1484,6 +1494,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) | |||
1484 | bdp = priv->cur_rx; | 1494 | bdp = priv->cur_rx; |
1485 | 1495 | ||
1486 | while (!((bdp->status & RXBD_EMPTY) || (--rx_work_limit < 0))) { | 1496 | while (!((bdp->status & RXBD_EMPTY) || (--rx_work_limit < 0))) { |
1497 | rmb(); | ||
1487 | skb = priv->rx_skbuff[priv->skb_currx]; | 1498 | skb = priv->rx_skbuff[priv->skb_currx]; |
1488 | 1499 | ||
1489 | if (!(bdp->status & | 1500 | if (!(bdp->status & |
diff --git a/drivers/net/ibm_emac/ibm_emac_core.c b/drivers/net/ibm_emac/ibm_emac_core.c index 50035ebd4f52..f752e5fc65ba 100644 --- a/drivers/net/ibm_emac/ibm_emac_core.c +++ b/drivers/net/ibm_emac/ibm_emac_core.c | |||
@@ -926,7 +926,7 @@ static int emac_link_differs(struct ocp_enet_private *dev) | |||
926 | int duplex = r & EMAC_MR1_FDE ? DUPLEX_FULL : DUPLEX_HALF; | 926 | int duplex = r & EMAC_MR1_FDE ? DUPLEX_FULL : DUPLEX_HALF; |
927 | int speed, pause, asym_pause; | 927 | int speed, pause, asym_pause; |
928 | 928 | ||
929 | if (r & (EMAC_MR1_MF_1000 | EMAC_MR1_MF_1000GPCS)) | 929 | if (r & EMAC_MR1_MF_1000) |
930 | speed = SPEED_1000; | 930 | speed = SPEED_1000; |
931 | else if (r & EMAC_MR1_MF_100) | 931 | else if (r & EMAC_MR1_MF_100) |
932 | speed = SPEED_100; | 932 | speed = SPEED_100; |
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.c b/drivers/net/ibm_emac/ibm_emac_mal.c index 6c0f071e4052..cabd9846a5ee 100644 --- a/drivers/net/ibm_emac/ibm_emac_mal.c +++ b/drivers/net/ibm_emac/ibm_emac_mal.c | |||
@@ -59,8 +59,7 @@ int __init mal_register_commac(struct ibm_ocp_mal *mal, | |||
59 | return 0; | 59 | return 0; |
60 | } | 60 | } |
61 | 61 | ||
62 | void __exit mal_unregister_commac(struct ibm_ocp_mal *mal, | 62 | void mal_unregister_commac(struct ibm_ocp_mal *mal, struct mal_commac *commac) |
63 | struct mal_commac *commac) | ||
64 | { | 63 | { |
65 | unsigned long flags; | 64 | unsigned long flags; |
66 | local_irq_save(flags); | 65 | local_irq_save(flags); |
diff --git a/drivers/net/ibm_emac/ibm_emac_mal.h b/drivers/net/ibm_emac/ibm_emac_mal.h index 407d2acbf7c7..64bc338acc6c 100644 --- a/drivers/net/ibm_emac/ibm_emac_mal.h +++ b/drivers/net/ibm_emac/ibm_emac_mal.h | |||
@@ -223,8 +223,7 @@ void mal_exit(void) __exit; | |||
223 | 223 | ||
224 | int mal_register_commac(struct ibm_ocp_mal *mal, | 224 | int mal_register_commac(struct ibm_ocp_mal *mal, |
225 | struct mal_commac *commac) __init; | 225 | struct mal_commac *commac) __init; |
226 | void mal_unregister_commac(struct ibm_ocp_mal *mal, | 226 | void mal_unregister_commac(struct ibm_ocp_mal *mal, struct mal_commac *commac); |
227 | struct mal_commac *commac) __exit; | ||
228 | int mal_set_rcbs(struct ibm_ocp_mal *mal, int channel, unsigned long size); | 227 | int mal_set_rcbs(struct ibm_ocp_mal *mal, int channel, unsigned long size); |
229 | 228 | ||
230 | /* Returns BD ring offset for a particular channel | 229 | /* Returns BD ring offset for a particular channel |
diff --git a/drivers/net/ibm_emac/ibm_emac_phy.c b/drivers/net/ibm_emac/ibm_emac_phy.c index 9074f76ee2bf..e57862b34cae 100644 --- a/drivers/net/ibm_emac/ibm_emac_phy.c +++ b/drivers/net/ibm_emac/ibm_emac_phy.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <asm/ocp.h> | 23 | #include <asm/ocp.h> |
24 | 24 | ||
25 | #include "ibm_emac_core.h" | ||
25 | #include "ibm_emac_phy.h" | 26 | #include "ibm_emac_phy.h" |
26 | 27 | ||
27 | static inline int phy_read(struct mii_phy *phy, int reg) | 28 | static inline int phy_read(struct mii_phy *phy, int reg) |
@@ -34,11 +35,39 @@ static inline void phy_write(struct mii_phy *phy, int reg, int val) | |||
34 | phy->mdio_write(phy->dev, phy->address, reg, val); | 35 | phy->mdio_write(phy->dev, phy->address, reg, val); |
35 | } | 36 | } |
36 | 37 | ||
37 | int mii_reset_phy(struct mii_phy *phy) | 38 | /* |
39 | * polls MII_BMCR until BMCR_RESET bit clears or operation times out. | ||
40 | * | ||
41 | * returns: | ||
42 | * >= 0 => success, value in BMCR returned to caller | ||
43 | * -EBUSY => failure, RESET bit never cleared | ||
44 | * otherwise => failure, lower level PHY read failed | ||
45 | */ | ||
46 | static int mii_spin_reset_complete(struct mii_phy *phy) | ||
38 | { | 47 | { |
39 | int val; | 48 | int val; |
40 | int limit = 10000; | 49 | int limit = 10000; |
41 | 50 | ||
51 | while (limit--) { | ||
52 | val = phy_read(phy, MII_BMCR); | ||
53 | if (val >= 0 && !(val & BMCR_RESET)) | ||
54 | return val; /* success */ | ||
55 | udelay(10); | ||
56 | } | ||
57 | if (val & BMCR_RESET) | ||
58 | val = -EBUSY; | ||
59 | |||
60 | if (net_ratelimit()) | ||
61 | printk(KERN_ERR "emac%d: PHY reset timeout (%d)\n", | ||
62 | ((struct ocp_enet_private *)phy->dev->priv)->def->index, | ||
63 | val); | ||
64 | return val; | ||
65 | } | ||
66 | |||
67 | int mii_reset_phy(struct mii_phy *phy) | ||
68 | { | ||
69 | int val; | ||
70 | |||
42 | val = phy_read(phy, MII_BMCR); | 71 | val = phy_read(phy, MII_BMCR); |
43 | val &= ~BMCR_ISOLATE; | 72 | val &= ~BMCR_ISOLATE; |
44 | val |= BMCR_RESET; | 73 | val |= BMCR_RESET; |
@@ -46,16 +75,11 @@ int mii_reset_phy(struct mii_phy *phy) | |||
46 | 75 | ||
47 | udelay(300); | 76 | udelay(300); |
48 | 77 | ||
49 | while (limit--) { | 78 | val = mii_spin_reset_complete(phy); |
50 | val = phy_read(phy, MII_BMCR); | 79 | if (val >= 0 && (val & BMCR_ISOLATE)) |
51 | if (val >= 0 && (val & BMCR_RESET) == 0) | ||
52 | break; | ||
53 | udelay(10); | ||
54 | } | ||
55 | if ((val & BMCR_ISOLATE) && limit > 0) | ||
56 | phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE); | 80 | phy_write(phy, MII_BMCR, val & ~BMCR_ISOLATE); |
57 | 81 | ||
58 | return limit <= 0; | 82 | return val < 0; |
59 | } | 83 | } |
60 | 84 | ||
61 | static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) | 85 | static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) |
@@ -102,8 +126,14 @@ static int genmii_setup_aneg(struct mii_phy *phy, u32 advertise) | |||
102 | } | 126 | } |
103 | 127 | ||
104 | /* Start/Restart aneg */ | 128 | /* Start/Restart aneg */ |
105 | ctl = phy_read(phy, MII_BMCR); | 129 | /* on some PHYs (e.g. National DP83843) a write to MII_ADVERTISE |
106 | ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); | 130 | * causes BMCR_RESET to be set on the next read of MII_BMCR, which |
131 | * if not checked for causes the PHY to be reset below */ | ||
132 | ctl = mii_spin_reset_complete(phy); | ||
133 | if (ctl < 0) | ||
134 | return ctl; | ||
135 | |||
136 | ctl |= BMCR_ANENABLE | BMCR_ANRESTART; | ||
107 | phy_write(phy, MII_BMCR, ctl); | 137 | phy_write(phy, MII_BMCR, ctl); |
108 | 138 | ||
109 | return 0; | 139 | return 0; |
@@ -118,13 +148,13 @@ static int genmii_setup_forced(struct mii_phy *phy, int speed, int fd) | |||
118 | phy->duplex = fd; | 148 | phy->duplex = fd; |
119 | phy->pause = phy->asym_pause = 0; | 149 | phy->pause = phy->asym_pause = 0; |
120 | 150 | ||
151 | /* First reset the PHY */ | ||
152 | mii_reset_phy(phy); | ||
153 | |||
121 | ctl = phy_read(phy, MII_BMCR); | 154 | ctl = phy_read(phy, MII_BMCR); |
122 | if (ctl < 0) | 155 | if (ctl < 0) |
123 | return ctl; | 156 | return ctl; |
124 | ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_ANENABLE); | 157 | ctl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_ANENABLE | BMCR_SPEED1000); |
125 | |||
126 | /* First reset the PHY */ | ||
127 | phy_write(phy, MII_BMCR, ctl | BMCR_RESET); | ||
128 | 158 | ||
129 | /* Select speed & duplex */ | 159 | /* Select speed & duplex */ |
130 | switch (speed) { | 160 | switch (speed) { |
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.c b/drivers/net/ibm_emac/ibm_emac_rgmii.c index 53d281cb9a16..9dbb5e5936c3 100644 --- a/drivers/net/ibm_emac/ibm_emac_rgmii.c +++ b/drivers/net/ibm_emac/ibm_emac_rgmii.c | |||
@@ -162,7 +162,7 @@ void rgmii_set_speed(struct ocp_device *ocpdev, int input, int speed) | |||
162 | out_be32(&dev->base->ssr, ssr); | 162 | out_be32(&dev->base->ssr, ssr); |
163 | } | 163 | } |
164 | 164 | ||
165 | void __exit __rgmii_fini(struct ocp_device *ocpdev, int input) | 165 | void __rgmii_fini(struct ocp_device *ocpdev, int input) |
166 | { | 166 | { |
167 | struct ibm_ocp_rgmii *dev = ocp_get_drvdata(ocpdev); | 167 | struct ibm_ocp_rgmii *dev = ocp_get_drvdata(ocpdev); |
168 | BUG_ON(!dev || dev->users == 0); | 168 | BUG_ON(!dev || dev->users == 0); |
diff --git a/drivers/net/ibm_emac/ibm_emac_rgmii.h b/drivers/net/ibm_emac/ibm_emac_rgmii.h index 117ea486c2ca..971e45815c6c 100644 --- a/drivers/net/ibm_emac/ibm_emac_rgmii.h +++ b/drivers/net/ibm_emac/ibm_emac_rgmii.h | |||
@@ -37,7 +37,7 @@ struct ibm_ocp_rgmii { | |||
37 | #ifdef CONFIG_IBM_EMAC_RGMII | 37 | #ifdef CONFIG_IBM_EMAC_RGMII |
38 | int rgmii_attach(void *emac) __init; | 38 | int rgmii_attach(void *emac) __init; |
39 | 39 | ||
40 | void __rgmii_fini(struct ocp_device *ocpdev, int input) __exit; | 40 | void __rgmii_fini(struct ocp_device *ocpdev, int input); |
41 | static inline void rgmii_fini(struct ocp_device *ocpdev, int input) | 41 | static inline void rgmii_fini(struct ocp_device *ocpdev, int input) |
42 | { | 42 | { |
43 | if (ocpdev) | 43 | if (ocpdev) |
diff --git a/drivers/net/ibm_emac/ibm_emac_tah.c b/drivers/net/ibm_emac/ibm_emac_tah.c index e287b451bb44..3c2d5ba522a1 100644 --- a/drivers/net/ibm_emac/ibm_emac_tah.c +++ b/drivers/net/ibm_emac/ibm_emac_tah.c | |||
@@ -63,7 +63,7 @@ int __init tah_attach(void *emac) | |||
63 | return 0; | 63 | return 0; |
64 | } | 64 | } |
65 | 65 | ||
66 | void __exit __tah_fini(struct ocp_device *ocpdev) | 66 | void __tah_fini(struct ocp_device *ocpdev) |
67 | { | 67 | { |
68 | struct tah_regs *p = ocp_get_drvdata(ocpdev); | 68 | struct tah_regs *p = ocp_get_drvdata(ocpdev); |
69 | BUG_ON(!p); | 69 | BUG_ON(!p); |
diff --git a/drivers/net/ibm_emac/ibm_emac_tah.h b/drivers/net/ibm_emac/ibm_emac_tah.h index 38153945a240..ccf64915e1e4 100644 --- a/drivers/net/ibm_emac/ibm_emac_tah.h +++ b/drivers/net/ibm_emac/ibm_emac_tah.h | |||
@@ -55,7 +55,7 @@ struct tah_regs { | |||
55 | #ifdef CONFIG_IBM_EMAC_TAH | 55 | #ifdef CONFIG_IBM_EMAC_TAH |
56 | int tah_attach(void *emac) __init; | 56 | int tah_attach(void *emac) __init; |
57 | 57 | ||
58 | void __tah_fini(struct ocp_device *ocpdev) __exit; | 58 | void __tah_fini(struct ocp_device *ocpdev); |
59 | static inline void tah_fini(struct ocp_device *ocpdev) | 59 | static inline void tah_fini(struct ocp_device *ocpdev) |
60 | { | 60 | { |
61 | if (ocpdev) | 61 | if (ocpdev) |
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.c b/drivers/net/ibm_emac/ibm_emac_zmii.c index 37dc8f342868..2c0fdb0cabff 100644 --- a/drivers/net/ibm_emac/ibm_emac_zmii.c +++ b/drivers/net/ibm_emac/ibm_emac_zmii.c | |||
@@ -215,7 +215,7 @@ void __zmii_set_speed(struct ocp_device *ocpdev, int input, int speed) | |||
215 | out_be32(&dev->base->ssr, ssr); | 215 | out_be32(&dev->base->ssr, ssr); |
216 | } | 216 | } |
217 | 217 | ||
218 | void __exit __zmii_fini(struct ocp_device *ocpdev, int input) | 218 | void __zmii_fini(struct ocp_device *ocpdev, int input) |
219 | { | 219 | { |
220 | struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev); | 220 | struct ibm_ocp_zmii *dev = ocp_get_drvdata(ocpdev); |
221 | BUG_ON(!dev || dev->users == 0); | 221 | BUG_ON(!dev || dev->users == 0); |
diff --git a/drivers/net/ibm_emac/ibm_emac_zmii.h b/drivers/net/ibm_emac/ibm_emac_zmii.h index 972e3a44a09f..fad6d8bf983a 100644 --- a/drivers/net/ibm_emac/ibm_emac_zmii.h +++ b/drivers/net/ibm_emac/ibm_emac_zmii.h | |||
@@ -40,7 +40,7 @@ struct ibm_ocp_zmii { | |||
40 | #ifdef CONFIG_IBM_EMAC_ZMII | 40 | #ifdef CONFIG_IBM_EMAC_ZMII |
41 | int zmii_attach(void *emac) __init; | 41 | int zmii_attach(void *emac) __init; |
42 | 42 | ||
43 | void __zmii_fini(struct ocp_device *ocpdev, int input) __exit; | 43 | void __zmii_fini(struct ocp_device *ocpdev, int input); |
44 | static inline void zmii_fini(struct ocp_device *ocpdev, int input) | 44 | static inline void zmii_fini(struct ocp_device *ocpdev, int input) |
45 | { | 45 | { |
46 | if (ocpdev) | 46 | if (ocpdev) |
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h index c8e90861f869..3569d5b03388 100644 --- a/drivers/net/ixgb/ixgb.h +++ b/drivers/net/ixgb/ixgb.h | |||
@@ -193,8 +193,6 @@ struct ixgb_adapter { | |||
193 | u16 msg_enable; | 193 | u16 msg_enable; |
194 | struct ixgb_hw_stats stats; | 194 | struct ixgb_hw_stats stats; |
195 | uint32_t alloc_rx_buff_failed; | 195 | uint32_t alloc_rx_buff_failed; |
196 | #ifdef CONFIG_PCI_MSI | ||
197 | boolean_t have_msi; | 196 | boolean_t have_msi; |
198 | #endif | ||
199 | }; | 197 | }; |
200 | #endif /* _IXGB_H_ */ | 198 | #endif /* _IXGB_H_ */ |
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c index 6d2b059371f1..991c8833e23c 100644 --- a/drivers/net/ixgb/ixgb_main.c +++ b/drivers/net/ixgb/ixgb_main.c | |||
@@ -227,7 +227,7 @@ int | |||
227 | ixgb_up(struct ixgb_adapter *adapter) | 227 | ixgb_up(struct ixgb_adapter *adapter) |
228 | { | 228 | { |
229 | struct net_device *netdev = adapter->netdev; | 229 | struct net_device *netdev = adapter->netdev; |
230 | int err; | 230 | int err, irq_flags = IRQF_SHARED; |
231 | int max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; | 231 | int max_frame = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; |
232 | struct ixgb_hw *hw = &adapter->hw; | 232 | struct ixgb_hw *hw = &adapter->hw; |
233 | 233 | ||
@@ -246,26 +246,21 @@ ixgb_up(struct ixgb_adapter *adapter) | |||
246 | /* disable interrupts and get the hardware into a known state */ | 246 | /* disable interrupts and get the hardware into a known state */ |
247 | IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff); | 247 | IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff); |
248 | 248 | ||
249 | #ifdef CONFIG_PCI_MSI | 249 | /* only enable MSI if bus is in PCI-X mode */ |
250 | { | 250 | if (IXGB_READ_REG(&adapter->hw, STATUS) & IXGB_STATUS_PCIX_MODE) { |
251 | boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) & | 251 | err = pci_enable_msi(adapter->pdev); |
252 | IXGB_STATUS_PCIX_MODE) ? TRUE : FALSE; | 252 | if (!err) { |
253 | adapter->have_msi = TRUE; | 253 | adapter->have_msi = 1; |
254 | 254 | irq_flags = 0; | |
255 | if (!pcix) | 255 | } |
256 | adapter->have_msi = FALSE; | ||
257 | else if((err = pci_enable_msi(adapter->pdev))) { | ||
258 | DPRINTK(PROBE, ERR, | ||
259 | "Unable to allocate MSI interrupt Error: %d\n", err); | ||
260 | adapter->have_msi = FALSE; | ||
261 | /* proceed to try to request regular interrupt */ | 256 | /* proceed to try to request regular interrupt */ |
262 | } | 257 | } |
263 | } | ||
264 | 258 | ||
265 | #endif | 259 | err = request_irq(adapter->pdev->irq, &ixgb_intr, irq_flags, |
266 | if((err = request_irq(adapter->pdev->irq, &ixgb_intr, | 260 | netdev->name, netdev); |
267 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, | 261 | if (err) { |
268 | netdev->name, netdev))) { | 262 | if (adapter->have_msi) |
263 | pci_disable_msi(adapter->pdev); | ||
269 | DPRINTK(PROBE, ERR, | 264 | DPRINTK(PROBE, ERR, |
270 | "Unable to allocate interrupt Error: %d\n", err); | 265 | "Unable to allocate interrupt Error: %d\n", err); |
271 | return err; | 266 | return err; |
@@ -307,11 +302,10 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog) | |||
307 | 302 | ||
308 | ixgb_irq_disable(adapter); | 303 | ixgb_irq_disable(adapter); |
309 | free_irq(adapter->pdev->irq, netdev); | 304 | free_irq(adapter->pdev->irq, netdev); |
310 | #ifdef CONFIG_PCI_MSI | 305 | |
311 | if(adapter->have_msi == TRUE) | 306 | if (adapter->have_msi) |
312 | pci_disable_msi(adapter->pdev); | 307 | pci_disable_msi(adapter->pdev); |
313 | 308 | ||
314 | #endif | ||
315 | if(kill_watchdog) | 309 | if(kill_watchdog) |
316 | del_timer_sync(&adapter->watchdog_timer); | 310 | del_timer_sync(&adapter->watchdog_timer); |
317 | #ifdef CONFIG_IXGB_NAPI | 311 | #ifdef CONFIG_IXGB_NAPI |
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index cf0e96adfe44..a36892457761 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -1216,7 +1216,7 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max) | |||
1216 | /* Window = 1 */ | 1216 | /* Window = 1 */ |
1217 | writel(consumer, | 1217 | writel(consumer, |
1218 | NETXEN_CRB_NORMALIZE(adapter, | 1218 | NETXEN_CRB_NORMALIZE(adapter, |
1219 | recv_crb_registers[ctxid]. | 1219 | recv_crb_registers[adapter->portnum]. |
1220 | crb_rcv_status_consumer)); | 1220 | crb_rcv_status_consumer)); |
1221 | } | 1221 | } |
1222 | 1222 | ||
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 104e20456e6f..832fd69a0e59 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <linux/if_vlan.h> | 40 | #include <linux/if_vlan.h> |
41 | #include <linux/prefetch.h> | 41 | #include <linux/prefetch.h> |
42 | #include <linux/mii.h> | 42 | #include <linux/mii.h> |
43 | #include <linux/dmi.h> | ||
44 | 43 | ||
45 | #include <asm/irq.h> | 44 | #include <asm/irq.h> |
46 | 45 | ||
@@ -151,8 +150,6 @@ static const char *yukon2_name[] = { | |||
151 | "FE", /* 0xb7 */ | 150 | "FE", /* 0xb7 */ |
152 | }; | 151 | }; |
153 | 152 | ||
154 | static int dmi_blacklisted; | ||
155 | |||
156 | /* Access to external PHY */ | 153 | /* Access to external PHY */ |
157 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) | 154 | static int gm_phy_write(struct sky2_hw *hw, unsigned port, u16 reg, u16 val) |
158 | { | 155 | { |
@@ -307,10 +304,13 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
307 | PHY_M_EC_MAC_S_MSK); | 304 | PHY_M_EC_MAC_S_MSK); |
308 | ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); | 305 | ectrl |= PHY_M_EC_MAC_S(MAC_TX_CLK_25_MHZ); |
309 | 306 | ||
307 | /* on PHY 88E1040 Rev.D0 (and newer) downshift control changed */ | ||
310 | if (hw->chip_id == CHIP_ID_YUKON_EC) | 308 | if (hw->chip_id == CHIP_ID_YUKON_EC) |
309 | /* set downshift counter to 3x and enable downshift */ | ||
311 | ectrl |= PHY_M_EC_DSC_2(2) | PHY_M_EC_DOWN_S_ENA; | 310 | ectrl |= PHY_M_EC_DSC_2(2) | PHY_M_EC_DOWN_S_ENA; |
312 | else | 311 | else |
313 | ectrl |= PHY_M_EC_M_DSC(2) | PHY_M_EC_S_DSC(3); | 312 | /* set master & slave downshift counter to 1x */ |
313 | ectrl |= PHY_M_EC_M_DSC(0) | PHY_M_EC_S_DSC(1); | ||
314 | 314 | ||
315 | gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); | 315 | gm_phy_write(hw, port, PHY_MARV_EXT_CTRL, ectrl); |
316 | } | 316 | } |
@@ -327,10 +327,12 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
327 | /* enable automatic crossover */ | 327 | /* enable automatic crossover */ |
328 | ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); | 328 | ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); |
329 | 329 | ||
330 | /* downshift on PHY 88E1112 and 88E1149 is changed */ | ||
330 | if (sky2->autoneg == AUTONEG_ENABLE | 331 | if (sky2->autoneg == AUTONEG_ENABLE |
331 | && (hw->chip_id == CHIP_ID_YUKON_XL | 332 | && (hw->chip_id == CHIP_ID_YUKON_XL |
332 | || hw->chip_id == CHIP_ID_YUKON_EC_U | 333 | || hw->chip_id == CHIP_ID_YUKON_EC_U |
333 | || hw->chip_id == CHIP_ID_YUKON_EX)) { | 334 | || hw->chip_id == CHIP_ID_YUKON_EX)) { |
335 | /* set downshift counter to 3x and enable downshift */ | ||
334 | ctrl &= ~PHY_M_PC_DSC_MSK; | 336 | ctrl &= ~PHY_M_PC_DSC_MSK; |
335 | ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; | 337 | ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; |
336 | } | 338 | } |
@@ -842,10 +844,12 @@ static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2, | |||
842 | /* Update chip's next pointer */ | 844 | /* Update chip's next pointer */ |
843 | static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx) | 845 | static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx) |
844 | { | 846 | { |
845 | q = Y2_QADDR(q, PREF_UNIT_PUT_IDX); | 847 | /* Make sure write' to descriptors are complete before we tell hardware */ |
846 | wmb(); | 848 | wmb(); |
847 | sky2_write16(hw, q, idx); | 849 | sky2_write16(hw, Y2_QADDR(q, PREF_UNIT_PUT_IDX), idx); |
848 | sky2_read16(hw, q); | 850 | |
851 | /* Synchronize I/O on since next processor may write to tail */ | ||
852 | mmiowb(); | ||
849 | } | 853 | } |
850 | 854 | ||
851 | 855 | ||
@@ -977,6 +981,7 @@ stopped: | |||
977 | 981 | ||
978 | /* reset the Rx prefetch unit */ | 982 | /* reset the Rx prefetch unit */ |
979 | sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); | 983 | sky2_write32(hw, Y2_QADDR(rxq, PREF_UNIT_CTRL), PREF_UNIT_RST_SET); |
984 | mmiowb(); | ||
980 | } | 985 | } |
981 | 986 | ||
982 | /* Clean out receive buffer area, assumes receiver hardware stopped */ | 987 | /* Clean out receive buffer area, assumes receiver hardware stopped */ |
@@ -1196,7 +1201,7 @@ static int sky2_rx_start(struct sky2_port *sky2) | |||
1196 | } | 1201 | } |
1197 | 1202 | ||
1198 | /* Tell chip about available buffers */ | 1203 | /* Tell chip about available buffers */ |
1199 | sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); | 1204 | sky2_put_idx(hw, rxq, sky2->rx_put); |
1200 | return 0; | 1205 | return 0; |
1201 | nomem: | 1206 | nomem: |
1202 | sky2_rx_clean(sky2); | 1207 | sky2_rx_clean(sky2); |
@@ -1538,6 +1543,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) | |||
1538 | } | 1543 | } |
1539 | 1544 | ||
1540 | sky2->tx_cons = idx; | 1545 | sky2->tx_cons = idx; |
1546 | smp_mb(); | ||
1547 | |||
1541 | if (tx_avail(sky2) > MAX_SKB_TX_LE + 4) | 1548 | if (tx_avail(sky2) > MAX_SKB_TX_LE + 4) |
1542 | netif_wake_queue(dev); | 1549 | netif_wake_queue(dev); |
1543 | } | 1550 | } |
@@ -1577,13 +1584,6 @@ static int sky2_down(struct net_device *dev) | |||
1577 | imask &= ~portirq_msk[port]; | 1584 | imask &= ~portirq_msk[port]; |
1578 | sky2_write32(hw, B0_IMSK, imask); | 1585 | sky2_write32(hw, B0_IMSK, imask); |
1579 | 1586 | ||
1580 | /* | ||
1581 | * Both ports share the NAPI poll on port 0, so if necessary undo the | ||
1582 | * the disable that is done in dev_close. | ||
1583 | */ | ||
1584 | if (sky2->port == 0 && hw->ports > 1) | ||
1585 | netif_poll_enable(dev); | ||
1586 | |||
1587 | sky2_gmac_reset(hw, port); | 1587 | sky2_gmac_reset(hw, port); |
1588 | 1588 | ||
1589 | /* Stop transmitter */ | 1589 | /* Stop transmitter */ |
@@ -2139,8 +2139,10 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) | |||
2139 | switch (le->opcode & ~HW_OWNER) { | 2139 | switch (le->opcode & ~HW_OWNER) { |
2140 | case OP_RXSTAT: | 2140 | case OP_RXSTAT: |
2141 | skb = sky2_receive(dev, length, status); | 2141 | skb = sky2_receive(dev, length, status); |
2142 | if (!skb) | 2142 | if (unlikely(!skb)) { |
2143 | sky2->net_stats.rx_dropped++; | ||
2143 | goto force_update; | 2144 | goto force_update; |
2145 | } | ||
2144 | 2146 | ||
2145 | skb->protocol = eth_type_trans(skb, dev); | 2147 | skb->protocol = eth_type_trans(skb, dev); |
2146 | sky2->net_stats.rx_packets++; | 2148 | sky2->net_stats.rx_packets++; |
@@ -2221,6 +2223,7 @@ force_update: | |||
2221 | 2223 | ||
2222 | /* Fully processed status ring so clear irq */ | 2224 | /* Fully processed status ring so clear irq */ |
2223 | sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); | 2225 | sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); |
2226 | mmiowb(); | ||
2224 | 2227 | ||
2225 | exit_loop: | 2228 | exit_loop: |
2226 | if (buf_write[0]) { | 2229 | if (buf_write[0]) { |
@@ -2341,6 +2344,12 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) | |||
2341 | printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n", | 2344 | printk(KERN_INFO PFX "%s: mac interrupt status 0x%x\n", |
2342 | dev->name, status); | 2345 | dev->name, status); |
2343 | 2346 | ||
2347 | if (status & GM_IS_RX_CO_OV) | ||
2348 | gma_read16(hw, port, GM_RX_IRQ_SRC); | ||
2349 | |||
2350 | if (status & GM_IS_TX_CO_OV) | ||
2351 | gma_read16(hw, port, GM_TX_IRQ_SRC); | ||
2352 | |||
2344 | if (status & GM_IS_RX_FF_OR) { | 2353 | if (status & GM_IS_RX_FF_OR) { |
2345 | ++sky2->net_stats.rx_fifo_errors; | 2354 | ++sky2->net_stats.rx_fifo_errors; |
2346 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); | 2355 | sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); |
@@ -2439,6 +2448,7 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2439 | if (work_done < work_limit) { | 2448 | if (work_done < work_limit) { |
2440 | netif_rx_complete(dev0); | 2449 | netif_rx_complete(dev0); |
2441 | 2450 | ||
2451 | /* end of interrupt, re-enables also acts as I/O synchronization */ | ||
2442 | sky2_read32(hw, B0_Y2_SP_LISR); | 2452 | sky2_read32(hw, B0_Y2_SP_LISR); |
2443 | return 0; | 2453 | return 0; |
2444 | } else { | 2454 | } else { |
@@ -2534,17 +2544,6 @@ static int __devinit sky2_init(struct sky2_hw *hw) | |||
2534 | return -EOPNOTSUPP; | 2544 | return -EOPNOTSUPP; |
2535 | } | 2545 | } |
2536 | 2546 | ||
2537 | |||
2538 | /* Some Gigabyte motherboards have 88e8056 but cause problems | ||
2539 | * There is some unresolved hardware related problem that causes | ||
2540 | * descriptor errors and receive data corruption. | ||
2541 | */ | ||
2542 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && dmi_blacklisted) { | ||
2543 | dev_err(&hw->pdev->dev, | ||
2544 | "88E8056 on this motherboard not supported\n"); | ||
2545 | return -EOPNOTSUPP; | ||
2546 | } | ||
2547 | |||
2548 | hw->pmd_type = sky2_read8(hw, B2_PMD_TYP); | 2547 | hw->pmd_type = sky2_read8(hw, B2_PMD_TYP); |
2549 | hw->ports = 1; | 2548 | hw->ports = 1; |
2550 | t8 = sky2_read8(hw, B2_Y2_HW_RES); | 2549 | t8 = sky2_read8(hw, B2_Y2_HW_RES); |
@@ -3910,24 +3909,8 @@ static struct pci_driver sky2_driver = { | |||
3910 | .shutdown = sky2_shutdown, | 3909 | .shutdown = sky2_shutdown, |
3911 | }; | 3910 | }; |
3912 | 3911 | ||
3913 | static struct dmi_system_id __initdata broken_dmi_table[] = { | ||
3914 | { | ||
3915 | .ident = "Gigabyte 965P-S3", | ||
3916 | .matches = { | ||
3917 | DMI_MATCH(DMI_SYS_VENDOR, "Gigabyte Technology Co., Ltd."), | ||
3918 | DMI_MATCH(DMI_PRODUCT_NAME, "965P-S3"), | ||
3919 | |||
3920 | }, | ||
3921 | }, | ||
3922 | { } | ||
3923 | }; | ||
3924 | |||
3925 | static int __init sky2_init_module(void) | 3912 | static int __init sky2_init_module(void) |
3926 | { | 3913 | { |
3927 | /* Look for sick motherboards */ | ||
3928 | if (dmi_check_system(broken_dmi_table)) | ||
3929 | dmi_blacklisted = 1; | ||
3930 | |||
3931 | return pci_register_driver(&sky2_driver); | 3914 | return pci_register_driver(&sky2_driver); |
3932 | } | 3915 | } |
3933 | 3916 | ||
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 108adbf5b5eb..c3964c3d89d9 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -430,7 +430,8 @@ spider_net_prepare_rx_descr(struct spider_net_card *card, | |||
430 | /* and we need to have it 128 byte aligned, therefore we allocate a | 430 | /* and we need to have it 128 byte aligned, therefore we allocate a |
431 | * bit more */ | 431 | * bit more */ |
432 | /* allocate an skb */ | 432 | /* allocate an skb */ |
433 | descr->skb = dev_alloc_skb(bufsize + SPIDER_NET_RXBUF_ALIGN - 1); | 433 | descr->skb = netdev_alloc_skb(card->netdev, |
434 | bufsize + SPIDER_NET_RXBUF_ALIGN - 1); | ||
434 | if (!descr->skb) { | 435 | if (!descr->skb) { |
435 | if (netif_msg_rx_err(card) && net_ratelimit()) | 436 | if (netif_msg_rx_err(card) && net_ratelimit()) |
436 | pr_err("Not enough memory to allocate rx buffer\n"); | 437 | pr_err("Not enough memory to allocate rx buffer\n"); |