diff options
Diffstat (limited to 'drivers/net/myri10ge/myri10ge.c')
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 07ca9480a6fe..9bdd43ab3573 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -177,6 +177,7 @@ struct myri10ge_priv { | |||
177 | struct work_struct watchdog_work; | 177 | struct work_struct watchdog_work; |
178 | struct timer_list watchdog_timer; | 178 | struct timer_list watchdog_timer; |
179 | int watchdog_tx_done; | 179 | int watchdog_tx_done; |
180 | int watchdog_tx_req; | ||
180 | int watchdog_resets; | 181 | int watchdog_resets; |
181 | int tx_linearized; | 182 | int tx_linearized; |
182 | int pause; | 183 | int pause; |
@@ -448,6 +449,7 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size) | |||
448 | struct mcp_gen_header *hdr; | 449 | struct mcp_gen_header *hdr; |
449 | size_t hdr_offset; | 450 | size_t hdr_offset; |
450 | int status; | 451 | int status; |
452 | unsigned i; | ||
451 | 453 | ||
452 | if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) { | 454 | if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) { |
453 | dev_err(dev, "Unable to load %s firmware image via hotplug\n", | 455 | dev_err(dev, "Unable to load %s firmware image via hotplug\n", |
@@ -479,18 +481,12 @@ static int myri10ge_load_hotplug_firmware(struct myri10ge_priv *mgp, u32 * size) | |||
479 | goto abort_with_fw; | 481 | goto abort_with_fw; |
480 | 482 | ||
481 | crc = crc32(~0, fw->data, fw->size); | 483 | crc = crc32(~0, fw->data, fw->size); |
482 | if (mgp->tx.boundary == 2048) { | 484 | for (i = 0; i < fw->size; i += 256) { |
483 | /* Avoid PCI burst on chipset with unaligned completions. */ | 485 | myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET + i, |
484 | int i; | 486 | fw->data + i, |
485 | __iomem u32 *ptr = (__iomem u32 *) (mgp->sram + | 487 | min(256U, (unsigned)(fw->size - i))); |
486 | MYRI10GE_FW_OFFSET); | 488 | mb(); |
487 | for (i = 0; i < fw->size / 4; i++) { | 489 | readb(mgp->sram); |
488 | __raw_writel(((u32 *) fw->data)[i], ptr + i); | ||
489 | wmb(); | ||
490 | } | ||
491 | } else { | ||
492 | myri10ge_pio_copy(mgp->sram + MYRI10GE_FW_OFFSET, fw->data, | ||
493 | fw->size); | ||
494 | } | 490 | } |
495 | /* corruption checking is good for parity recovery and buggy chipset */ | 491 | /* corruption checking is good for parity recovery and buggy chipset */ |
496 | memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); | 492 | memcpy_fromio(fw->data, mgp->sram + MYRI10GE_FW_OFFSET, fw->size); |
@@ -620,7 +616,7 @@ static int myri10ge_load_firmware(struct myri10ge_priv *mgp) | |||
620 | return -ENXIO; | 616 | return -ENXIO; |
621 | } | 617 | } |
622 | dev_info(&mgp->pdev->dev, "handoff confirmed\n"); | 618 | dev_info(&mgp->pdev->dev, "handoff confirmed\n"); |
623 | myri10ge_dummy_rdma(mgp, mgp->tx.boundary != 4096); | 619 | myri10ge_dummy_rdma(mgp, 1); |
624 | 620 | ||
625 | return 0; | 621 | return 0; |
626 | } | 622 | } |
@@ -2429,7 +2425,7 @@ static int myri10ge_resume(struct pci_dev *pdev) | |||
2429 | } | 2425 | } |
2430 | 2426 | ||
2431 | myri10ge_reset(mgp); | 2427 | myri10ge_reset(mgp); |
2432 | myri10ge_dummy_rdma(mgp, mgp->tx.boundary != 4096); | 2428 | myri10ge_dummy_rdma(mgp, 1); |
2433 | 2429 | ||
2434 | /* Save configuration space to be restored if the | 2430 | /* Save configuration space to be restored if the |
2435 | * nic resets due to a parity error */ | 2431 | * nic resets due to a parity error */ |
@@ -2547,7 +2543,8 @@ static void myri10ge_watchdog_timer(unsigned long arg) | |||
2547 | 2543 | ||
2548 | mgp = (struct myri10ge_priv *)arg; | 2544 | mgp = (struct myri10ge_priv *)arg; |
2549 | if (mgp->tx.req != mgp->tx.done && | 2545 | if (mgp->tx.req != mgp->tx.done && |
2550 | mgp->tx.done == mgp->watchdog_tx_done) | 2546 | mgp->tx.done == mgp->watchdog_tx_done && |
2547 | mgp->watchdog_tx_req != mgp->watchdog_tx_done) | ||
2551 | /* nic seems like it might be stuck.. */ | 2548 | /* nic seems like it might be stuck.. */ |
2552 | schedule_work(&mgp->watchdog_work); | 2549 | schedule_work(&mgp->watchdog_work); |
2553 | else | 2550 | else |
@@ -2556,6 +2553,7 @@ static void myri10ge_watchdog_timer(unsigned long arg) | |||
2556 | jiffies + myri10ge_watchdog_timeout * HZ); | 2553 | jiffies + myri10ge_watchdog_timeout * HZ); |
2557 | 2554 | ||
2558 | mgp->watchdog_tx_done = mgp->tx.done; | 2555 | mgp->watchdog_tx_done = mgp->tx.done; |
2556 | mgp->watchdog_tx_req = mgp->tx.req; | ||
2559 | } | 2557 | } |
2560 | 2558 | ||
2561 | static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | 2559 | static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |