diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-25 10:59:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-08-25 10:59:59 -0400 |
commit | 36373b4450105ec8908c6c9396c8715eaafcfd6a (patch) | |
tree | bbac0eab8d2d2b0d39e86092825d35fdf2d5ec40 /drivers | |
parent | 0b887d037bf4b76eec1c960e5feecd6a5a806971 (diff) | |
parent | 2972863768cc2ef94734abb22dec6a46b0891307 (diff) |
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
myri10ge: update driver version to 1.3.2-1.269
myri10ge: use pcie_get/set_readrq
ehea: fix queue destructor
ehea: fix module parameter description
ehea: fix interface to DLPAR tools
sgiseeq: Fix return type of sgiseeq_remove
sky2 1.17
sky2: only bring up watchdog if link is active
sky2: clear PCI power control reg at startup
DM9000: fix interface hang under load
phy layer: fix genphy_setup_forced (don't reset)
Don't use GFP_DMA for zone allocation.
fix realtek phy id in forcedeth
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dm9000.c | 25 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_main.c | 8 | ||||
-rw-r--r-- | drivers/net/ehea/ehea_qmr.c | 6 | ||||
-rw-r--r-- | drivers/net/forcedeth.c | 2 | ||||
-rw-r--r-- | drivers/net/meth.c | 2 | ||||
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 34 | ||||
-rw-r--r-- | drivers/net/phy/phy_device.c | 2 | ||||
-rw-r--r-- | drivers/net/sgiseeq.c | 4 | ||||
-rw-r--r-- | drivers/net/sky2.c | 64 | ||||
-rw-r--r-- | drivers/net/sky2.h | 3 |
10 files changed, 64 insertions, 86 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c index c3de81bf090a..738aa5906514 100644 --- a/drivers/net/dm9000.c +++ b/drivers/net/dm9000.c | |||
@@ -700,6 +700,7 @@ dm9000_init_dm9000(struct net_device *dev) | |||
700 | static int | 700 | static int |
701 | dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) | 701 | dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) |
702 | { | 702 | { |
703 | unsigned long flags; | ||
703 | board_info_t *db = (board_info_t *) dev->priv; | 704 | board_info_t *db = (board_info_t *) dev->priv; |
704 | 705 | ||
705 | PRINTK3("dm9000_start_xmit\n"); | 706 | PRINTK3("dm9000_start_xmit\n"); |
@@ -707,10 +708,7 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
707 | if (db->tx_pkt_cnt > 1) | 708 | if (db->tx_pkt_cnt > 1) |
708 | return 1; | 709 | return 1; |
709 | 710 | ||
710 | netif_stop_queue(dev); | 711 | spin_lock_irqsave(&db->lock, flags); |
711 | |||
712 | /* Disable all interrupts */ | ||
713 | iow(db, DM9000_IMR, IMR_PAR); | ||
714 | 712 | ||
715 | /* Move data to DM9000 TX RAM */ | 713 | /* Move data to DM9000 TX RAM */ |
716 | writeb(DM9000_MWCMD, db->io_addr); | 714 | writeb(DM9000_MWCMD, db->io_addr); |
@@ -718,12 +716,9 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
718 | (db->outblk)(db->io_data, skb->data, skb->len); | 716 | (db->outblk)(db->io_data, skb->data, skb->len); |
719 | db->stats.tx_bytes += skb->len; | 717 | db->stats.tx_bytes += skb->len; |
720 | 718 | ||
719 | db->tx_pkt_cnt++; | ||
721 | /* TX control: First packet immediately send, second packet queue */ | 720 | /* TX control: First packet immediately send, second packet queue */ |
722 | if (db->tx_pkt_cnt == 0) { | 721 | if (db->tx_pkt_cnt == 1) { |
723 | |||
724 | /* First Packet */ | ||
725 | db->tx_pkt_cnt++; | ||
726 | |||
727 | /* Set TX length to DM9000 */ | 722 | /* Set TX length to DM9000 */ |
728 | iow(db, DM9000_TXPLL, skb->len & 0xff); | 723 | iow(db, DM9000_TXPLL, skb->len & 0xff); |
729 | iow(db, DM9000_TXPLH, (skb->len >> 8) & 0xff); | 724 | iow(db, DM9000_TXPLH, (skb->len >> 8) & 0xff); |
@@ -732,23 +727,17 @@ dm9000_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
732 | iow(db, DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */ | 727 | iow(db, DM9000_TCR, TCR_TXREQ); /* Cleared after TX complete */ |
733 | 728 | ||
734 | dev->trans_start = jiffies; /* save the time stamp */ | 729 | dev->trans_start = jiffies; /* save the time stamp */ |
735 | |||
736 | } else { | 730 | } else { |
737 | /* Second packet */ | 731 | /* Second packet */ |
738 | db->tx_pkt_cnt++; | ||
739 | db->queue_pkt_len = skb->len; | 732 | db->queue_pkt_len = skb->len; |
733 | netif_stop_queue(dev); | ||
740 | } | 734 | } |
741 | 735 | ||
736 | spin_unlock_irqrestore(&db->lock, flags); | ||
737 | |||
742 | /* free this SKB */ | 738 | /* free this SKB */ |
743 | dev_kfree_skb(skb); | 739 | dev_kfree_skb(skb); |
744 | 740 | ||
745 | /* Re-enable resource check */ | ||
746 | if (db->tx_pkt_cnt == 1) | ||
747 | netif_wake_queue(dev); | ||
748 | |||
749 | /* Re-enable interrupt */ | ||
750 | iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM); | ||
751 | |||
752 | return 0; | 741 | return 0; |
753 | } | 742 | } |
754 | 743 | ||
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 9756211e83ce..db5747490a07 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -76,7 +76,7 @@ MODULE_PARM_DESC(rq1_entries, "Number of entries for Receive Queue 1 " | |||
76 | MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue " | 76 | MODULE_PARM_DESC(sq_entries, " Number of entries for the Send Queue " |
77 | "[2^x - 1], x = [6..14]. Default = " | 77 | "[2^x - 1], x = [6..14]. Default = " |
78 | __MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ")"); | 78 | __MODULE_STRING(EHEA_DEF_ENTRIES_SQ) ")"); |
79 | MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 1 "); | 79 | MODULE_PARM_DESC(use_mcs, " 0:NAPI, 1:Multiple receive queues, Default = 0 "); |
80 | 80 | ||
81 | static int port_name_cnt = 0; | 81 | static int port_name_cnt = 0; |
82 | static LIST_HEAD(adapter_list); | 82 | static LIST_HEAD(adapter_list); |
@@ -2490,7 +2490,7 @@ static ssize_t ehea_show_port_id(struct device *dev, | |||
2490 | struct device_attribute *attr, char *buf) | 2490 | struct device_attribute *attr, char *buf) |
2491 | { | 2491 | { |
2492 | struct ehea_port *port = container_of(dev, struct ehea_port, ofdev.dev); | 2492 | struct ehea_port *port = container_of(dev, struct ehea_port, ofdev.dev); |
2493 | return sprintf(buf, "0x%X", port->logical_port_id); | 2493 | return sprintf(buf, "%d", port->logical_port_id); |
2494 | } | 2494 | } |
2495 | 2495 | ||
2496 | static DEVICE_ATTR(log_port_id, S_IRUSR | S_IRGRP | S_IROTH, ehea_show_port_id, | 2496 | static DEVICE_ATTR(log_port_id, S_IRUSR | S_IRGRP | S_IROTH, ehea_show_port_id, |
@@ -2781,7 +2781,7 @@ static ssize_t ehea_probe_port(struct device *dev, | |||
2781 | 2781 | ||
2782 | u32 logical_port_id; | 2782 | u32 logical_port_id; |
2783 | 2783 | ||
2784 | sscanf(buf, "%X", &logical_port_id); | 2784 | sscanf(buf, "%d", &logical_port_id); |
2785 | 2785 | ||
2786 | port = ehea_get_port(adapter, logical_port_id); | 2786 | port = ehea_get_port(adapter, logical_port_id); |
2787 | 2787 | ||
@@ -2834,7 +2834,7 @@ static ssize_t ehea_remove_port(struct device *dev, | |||
2834 | int i; | 2834 | int i; |
2835 | u32 logical_port_id; | 2835 | u32 logical_port_id; |
2836 | 2836 | ||
2837 | sscanf(buf, "%X", &logical_port_id); | 2837 | sscanf(buf, "%d", &logical_port_id); |
2838 | 2838 | ||
2839 | port = ehea_get_port(adapter, logical_port_id); | 2839 | port = ehea_get_port(adapter, logical_port_id); |
2840 | 2840 | ||
diff --git a/drivers/net/ehea/ehea_qmr.c b/drivers/net/ehea/ehea_qmr.c index a36fa6c23fdf..c82e24596074 100644 --- a/drivers/net/ehea/ehea_qmr.c +++ b/drivers/net/ehea/ehea_qmr.c | |||
@@ -235,6 +235,8 @@ int ehea_destroy_cq(struct ehea_cq *cq) | |||
235 | if (!cq) | 235 | if (!cq) |
236 | return 0; | 236 | return 0; |
237 | 237 | ||
238 | hcp_epas_dtor(&cq->epas); | ||
239 | |||
238 | if ((hret = ehea_destroy_cq_res(cq, NORMAL_FREE)) == H_R_STATE) { | 240 | if ((hret = ehea_destroy_cq_res(cq, NORMAL_FREE)) == H_R_STATE) { |
239 | ehea_error_data(cq->adapter, cq->fw_handle); | 241 | ehea_error_data(cq->adapter, cq->fw_handle); |
240 | hret = ehea_destroy_cq_res(cq, FORCE_FREE); | 242 | hret = ehea_destroy_cq_res(cq, FORCE_FREE); |
@@ -361,6 +363,8 @@ int ehea_destroy_eq(struct ehea_eq *eq) | |||
361 | if (!eq) | 363 | if (!eq) |
362 | return 0; | 364 | return 0; |
363 | 365 | ||
366 | hcp_epas_dtor(&eq->epas); | ||
367 | |||
364 | if ((hret = ehea_destroy_eq_res(eq, NORMAL_FREE)) == H_R_STATE) { | 368 | if ((hret = ehea_destroy_eq_res(eq, NORMAL_FREE)) == H_R_STATE) { |
365 | ehea_error_data(eq->adapter, eq->fw_handle); | 369 | ehea_error_data(eq->adapter, eq->fw_handle); |
366 | hret = ehea_destroy_eq_res(eq, FORCE_FREE); | 370 | hret = ehea_destroy_eq_res(eq, FORCE_FREE); |
@@ -541,6 +545,8 @@ int ehea_destroy_qp(struct ehea_qp *qp) | |||
541 | if (!qp) | 545 | if (!qp) |
542 | return 0; | 546 | return 0; |
543 | 547 | ||
548 | hcp_epas_dtor(&qp->epas); | ||
549 | |||
544 | if ((hret = ehea_destroy_qp_res(qp, NORMAL_FREE)) == H_R_STATE) { | 550 | if ((hret = ehea_destroy_qp_res(qp, NORMAL_FREE)) == H_R_STATE) { |
545 | ehea_error_data(qp->adapter, qp->fw_handle); | 551 | ehea_error_data(qp->adapter, qp->fw_handle); |
546 | hret = ehea_destroy_qp_res(qp, FORCE_FREE); | 552 | hret = ehea_destroy_qp_res(qp, FORCE_FREE); |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 10f4e3b55168..1938d6dfc863 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -552,7 +552,7 @@ union ring_type { | |||
552 | #define PHY_OUI_MARVELL 0x5043 | 552 | #define PHY_OUI_MARVELL 0x5043 |
553 | #define PHY_OUI_CICADA 0x03f1 | 553 | #define PHY_OUI_CICADA 0x03f1 |
554 | #define PHY_OUI_VITESSE 0x01c1 | 554 | #define PHY_OUI_VITESSE 0x01c1 |
555 | #define PHY_OUI_REALTEK 0x01c1 | 555 | #define PHY_OUI_REALTEK 0x0732 |
556 | #define PHYID1_OUI_MASK 0x03ff | 556 | #define PHYID1_OUI_MASK 0x03ff |
557 | #define PHYID1_OUI_SHFT 6 | 557 | #define PHYID1_OUI_SHFT 6 |
558 | #define PHYID2_OUI_MASK 0xfc00 | 558 | #define PHYID2_OUI_MASK 0xfc00 |
diff --git a/drivers/net/meth.c b/drivers/net/meth.c index 92b403bf38b0..32bed6bc6c06 100644 --- a/drivers/net/meth.c +++ b/drivers/net/meth.c | |||
@@ -405,7 +405,7 @@ static void meth_rx(struct net_device* dev, unsigned long int_status) | |||
405 | priv->stats.rx_length_errors++; | 405 | priv->stats.rx_length_errors++; |
406 | skb = priv->rx_skbs[priv->rx_write]; | 406 | skb = priv->rx_skbs[priv->rx_write]; |
407 | } else { | 407 | } else { |
408 | skb = alloc_skb(METH_RX_BUFF_SIZE, GFP_ATOMIC | GFP_DMA); | 408 | skb = alloc_skb(METH_RX_BUFF_SIZE, GFP_ATOMIC); |
409 | if (!skb) { | 409 | if (!skb) { |
410 | /* Ouch! No memory! Drop packet on the floor */ | 410 | /* Ouch! No memory! Drop packet on the floor */ |
411 | DPRINTK("No mem: dropping packet\n"); | 411 | DPRINTK("No mem: dropping packet\n"); |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index ae9bb7b7fd67..1c42266bf889 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -72,7 +72,7 @@ | |||
72 | #include "myri10ge_mcp.h" | 72 | #include "myri10ge_mcp.h" |
73 | #include "myri10ge_mcp_gen_header.h" | 73 | #include "myri10ge_mcp_gen_header.h" |
74 | 74 | ||
75 | #define MYRI10GE_VERSION_STR "1.3.1-1.248" | 75 | #define MYRI10GE_VERSION_STR "1.3.2-1.269" |
76 | 76 | ||
77 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); | 77 | MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); |
78 | MODULE_AUTHOR("Maintainer: help@myri.com"); | 78 | MODULE_AUTHOR("Maintainer: help@myri.com"); |
@@ -2514,26 +2514,20 @@ static void myri10ge_firmware_probe(struct myri10ge_priv *mgp) | |||
2514 | { | 2514 | { |
2515 | struct pci_dev *pdev = mgp->pdev; | 2515 | struct pci_dev *pdev = mgp->pdev; |
2516 | struct device *dev = &pdev->dev; | 2516 | struct device *dev = &pdev->dev; |
2517 | int cap, status; | 2517 | int status; |
2518 | u16 val; | ||
2519 | 2518 | ||
2520 | mgp->tx.boundary = 4096; | 2519 | mgp->tx.boundary = 4096; |
2521 | /* | 2520 | /* |
2522 | * Verify the max read request size was set to 4KB | 2521 | * Verify the max read request size was set to 4KB |
2523 | * before trying the test with 4KB. | 2522 | * before trying the test with 4KB. |
2524 | */ | 2523 | */ |
2525 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 2524 | status = pcie_get_readrq(pdev); |
2526 | if (cap < 64) { | 2525 | if (status < 0) { |
2527 | dev_err(dev, "Bad PCI_CAP_ID_EXP location %d\n", cap); | ||
2528 | goto abort; | ||
2529 | } | ||
2530 | status = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &val); | ||
2531 | if (status != 0) { | ||
2532 | dev_err(dev, "Couldn't read max read req size: %d\n", status); | 2526 | dev_err(dev, "Couldn't read max read req size: %d\n", status); |
2533 | goto abort; | 2527 | goto abort; |
2534 | } | 2528 | } |
2535 | if ((val & (5 << 12)) != (5 << 12)) { | 2529 | if (status != 4096) { |
2536 | dev_warn(dev, "Max Read Request size != 4096 (0x%x)\n", val); | 2530 | dev_warn(dev, "Max Read Request size != 4096 (%d)\n", status); |
2537 | mgp->tx.boundary = 2048; | 2531 | mgp->tx.boundary = 2048; |
2538 | } | 2532 | } |
2539 | /* | 2533 | /* |
@@ -2850,9 +2844,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2850 | size_t bytes; | 2844 | size_t bytes; |
2851 | int i; | 2845 | int i; |
2852 | int status = -ENXIO; | 2846 | int status = -ENXIO; |
2853 | int cap; | ||
2854 | int dac_enabled; | 2847 | int dac_enabled; |
2855 | u16 val; | ||
2856 | 2848 | ||
2857 | netdev = alloc_etherdev(sizeof(*mgp)); | 2849 | netdev = alloc_etherdev(sizeof(*mgp)); |
2858 | if (netdev == NULL) { | 2850 | if (netdev == NULL) { |
@@ -2884,19 +2876,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2884 | = pci_find_capability(pdev, PCI_CAP_ID_VNDR); | 2876 | = pci_find_capability(pdev, PCI_CAP_ID_VNDR); |
2885 | 2877 | ||
2886 | /* Set our max read request to 4KB */ | 2878 | /* Set our max read request to 4KB */ |
2887 | cap = pci_find_capability(pdev, PCI_CAP_ID_EXP); | 2879 | status = pcie_set_readrq(pdev, 4096); |
2888 | if (cap < 64) { | ||
2889 | dev_err(&pdev->dev, "Bad PCI_CAP_ID_EXP location %d\n", cap); | ||
2890 | goto abort_with_netdev; | ||
2891 | } | ||
2892 | status = pci_read_config_word(pdev, cap + PCI_EXP_DEVCTL, &val); | ||
2893 | if (status != 0) { | ||
2894 | dev_err(&pdev->dev, "Error %d reading PCI_EXP_DEVCTL\n", | ||
2895 | status); | ||
2896 | goto abort_with_netdev; | ||
2897 | } | ||
2898 | val = (val & ~PCI_EXP_DEVCTL_READRQ) | (5 << 12); | ||
2899 | status = pci_write_config_word(pdev, cap + PCI_EXP_DEVCTL, val); | ||
2900 | if (status != 0) { | 2880 | if (status != 0) { |
2901 | dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", | 2881 | dev_err(&pdev->dev, "Error %d writing PCI_EXP_DEVCTL\n", |
2902 | status); | 2882 | status); |
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index a8b74cdab1ea..e275df8c55bc 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c | |||
@@ -364,7 +364,7 @@ EXPORT_SYMBOL(genphy_config_advert); | |||
364 | */ | 364 | */ |
365 | int genphy_setup_forced(struct phy_device *phydev) | 365 | int genphy_setup_forced(struct phy_device *phydev) |
366 | { | 366 | { |
367 | int ctl = BMCR_RESET; | 367 | int ctl = 0; |
368 | 368 | ||
369 | phydev->pause = phydev->asym_pause = 0; | 369 | phydev->pause = phydev->asym_pause = 0; |
370 | 370 | ||
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c index 384b4685e977..0fb74cb51c4b 100644 --- a/drivers/net/sgiseeq.c +++ b/drivers/net/sgiseeq.c | |||
@@ -726,7 +726,7 @@ err_out: | |||
726 | return err; | 726 | return err; |
727 | } | 727 | } |
728 | 728 | ||
729 | static void __exit sgiseeq_remove(struct platform_device *pdev) | 729 | static int __exit sgiseeq_remove(struct platform_device *pdev) |
730 | { | 730 | { |
731 | struct net_device *dev = platform_get_drvdata(pdev); | 731 | struct net_device *dev = platform_get_drvdata(pdev); |
732 | struct sgiseeq_private *sp = netdev_priv(dev); | 732 | struct sgiseeq_private *sp = netdev_priv(dev); |
@@ -735,6 +735,8 @@ static void __exit sgiseeq_remove(struct platform_device *pdev) | |||
735 | free_page((unsigned long) sp->srings); | 735 | free_page((unsigned long) sp->srings); |
736 | free_netdev(dev); | 736 | free_netdev(dev); |
737 | platform_set_drvdata(pdev, NULL); | 737 | platform_set_drvdata(pdev, NULL); |
738 | |||
739 | return 0; | ||
738 | } | 740 | } |
739 | 741 | ||
740 | static struct platform_driver sgiseeq_driver = { | 742 | static struct platform_driver sgiseeq_driver = { |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 757592436390..e6d937ec6886 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "sky2.h" | 51 | #include "sky2.h" |
52 | 52 | ||
53 | #define DRV_NAME "sky2" | 53 | #define DRV_NAME "sky2" |
54 | #define DRV_VERSION "1.16" | 54 | #define DRV_VERSION "1.17" |
55 | #define PFX DRV_NAME " " | 55 | #define PFX DRV_NAME " " |
56 | 56 | ||
57 | /* | 57 | /* |
@@ -99,10 +99,6 @@ static int disable_msi = 0; | |||
99 | module_param(disable_msi, int, 0); | 99 | module_param(disable_msi, int, 0); |
100 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | 100 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); |
101 | 101 | ||
102 | static int idle_timeout = 100; | ||
103 | module_param(idle_timeout, int, 0); | ||
104 | MODULE_PARM_DESC(idle_timeout, "Watchdog timer for lost interrupts (ms)"); | ||
105 | |||
106 | static const struct pci_device_id sky2_id_table[] = { | 102 | static const struct pci_device_id sky2_id_table[] = { |
107 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */ | 103 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, /* SK-9Sxx */ |
108 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */ | 104 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, /* SK-9Exx */ |
@@ -219,9 +215,12 @@ static void sky2_power_on(struct sky2_hw *hw) | |||
219 | else | 215 | else |
220 | sky2_write8(hw, B2_Y2_CLK_GATE, 0); | 216 | sky2_write8(hw, B2_Y2_CLK_GATE, 0); |
221 | 217 | ||
222 | if (hw->chip_id == CHIP_ID_YUKON_EC_U || hw->chip_id == CHIP_ID_YUKON_EX) { | 218 | if (hw->chip_id == CHIP_ID_YUKON_EC_U || |
219 | hw->chip_id == CHIP_ID_YUKON_EX) { | ||
223 | u32 reg; | 220 | u32 reg; |
224 | 221 | ||
222 | sky2_pci_write32(hw, PCI_DEV_REG3, 0); | ||
223 | |||
225 | reg = sky2_pci_read32(hw, PCI_DEV_REG4); | 224 | reg = sky2_pci_read32(hw, PCI_DEV_REG4); |
226 | /* set all bits to 0 except bits 15..12 and 8 */ | 225 | /* set all bits to 0 except bits 15..12 and 8 */ |
227 | reg &= P_ASPM_CONTROL_MSK; | 226 | reg &= P_ASPM_CONTROL_MSK; |
@@ -238,6 +237,8 @@ static void sky2_power_on(struct sky2_hw *hw) | |||
238 | reg = sky2_read32(hw, B2_GP_IO); | 237 | reg = sky2_read32(hw, B2_GP_IO); |
239 | reg |= GLB_GPIO_STAT_RACE_DIS; | 238 | reg |= GLB_GPIO_STAT_RACE_DIS; |
240 | sky2_write32(hw, B2_GP_IO, reg); | 239 | sky2_write32(hw, B2_GP_IO, reg); |
240 | |||
241 | sky2_read32(hw, B2_GP_IO); | ||
241 | } | 242 | } |
242 | } | 243 | } |
243 | 244 | ||
@@ -1619,6 +1620,9 @@ static int sky2_down(struct net_device *dev) | |||
1619 | if (netif_msg_ifdown(sky2)) | 1620 | if (netif_msg_ifdown(sky2)) |
1620 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); | 1621 | printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); |
1621 | 1622 | ||
1623 | if (netif_carrier_ok(dev) && --hw->active == 0) | ||
1624 | del_timer(&hw->watchdog_timer); | ||
1625 | |||
1622 | /* Stop more packets from being queued */ | 1626 | /* Stop more packets from being queued */ |
1623 | netif_stop_queue(dev); | 1627 | netif_stop_queue(dev); |
1624 | 1628 | ||
@@ -1739,6 +1743,10 @@ static void sky2_link_up(struct sky2_port *sky2) | |||
1739 | 1743 | ||
1740 | netif_carrier_on(sky2->netdev); | 1744 | netif_carrier_on(sky2->netdev); |
1741 | 1745 | ||
1746 | if (hw->active++ == 0) | ||
1747 | mod_timer(&hw->watchdog_timer, jiffies + 1); | ||
1748 | |||
1749 | |||
1742 | /* Turn on link LED */ | 1750 | /* Turn on link LED */ |
1743 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), | 1751 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), |
1744 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); | 1752 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); |
@@ -1790,6 +1798,11 @@ static void sky2_link_down(struct sky2_port *sky2) | |||
1790 | 1798 | ||
1791 | netif_carrier_off(sky2->netdev); | 1799 | netif_carrier_off(sky2->netdev); |
1792 | 1800 | ||
1801 | /* Stop watchdog if both ports are not active */ | ||
1802 | if (--hw->active == 0) | ||
1803 | del_timer(&hw->watchdog_timer); | ||
1804 | |||
1805 | |||
1793 | /* Turn on link LED */ | 1806 | /* Turn on link LED */ |
1794 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); | 1807 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), LINKLED_OFF); |
1795 | 1808 | ||
@@ -2421,25 +2434,20 @@ static void sky2_le_error(struct sky2_hw *hw, unsigned port, | |||
2421 | sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_CLR_IRQ_CHK); | 2434 | sky2_write32(hw, Q_ADDR(q, Q_CSR), BMU_CLR_IRQ_CHK); |
2422 | } | 2435 | } |
2423 | 2436 | ||
2424 | /* If idle then force a fake soft NAPI poll once a second | 2437 | /* Check for lost IRQ once a second */ |
2425 | * to work around cases where sharing an edge triggered interrupt. | 2438 | static void sky2_watchdog(unsigned long arg) |
2426 | */ | ||
2427 | static inline void sky2_idle_start(struct sky2_hw *hw) | ||
2428 | { | ||
2429 | if (idle_timeout > 0) | ||
2430 | mod_timer(&hw->idle_timer, | ||
2431 | jiffies + msecs_to_jiffies(idle_timeout)); | ||
2432 | } | ||
2433 | |||
2434 | static void sky2_idle(unsigned long arg) | ||
2435 | { | 2439 | { |
2436 | struct sky2_hw *hw = (struct sky2_hw *) arg; | 2440 | struct sky2_hw *hw = (struct sky2_hw *) arg; |
2437 | struct net_device *dev = hw->dev[0]; | ||
2438 | 2441 | ||
2439 | if (__netif_rx_schedule_prep(dev)) | 2442 | if (sky2_read32(hw, B0_ISRC)) { |
2440 | __netif_rx_schedule(dev); | 2443 | struct net_device *dev = hw->dev[0]; |
2444 | |||
2445 | if (__netif_rx_schedule_prep(dev)) | ||
2446 | __netif_rx_schedule(dev); | ||
2447 | } | ||
2441 | 2448 | ||
2442 | mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout)); | 2449 | if (hw->active > 0) |
2450 | mod_timer(&hw->watchdog_timer, round_jiffies(jiffies + HZ)); | ||
2443 | } | 2451 | } |
2444 | 2452 | ||
2445 | /* Hardware/software error handling */ | 2453 | /* Hardware/software error handling */ |
@@ -2727,8 +2735,6 @@ static void sky2_restart(struct work_struct *work) | |||
2727 | struct net_device *dev; | 2735 | struct net_device *dev; |
2728 | int i, err; | 2736 | int i, err; |
2729 | 2737 | ||
2730 | del_timer_sync(&hw->idle_timer); | ||
2731 | |||
2732 | rtnl_lock(); | 2738 | rtnl_lock(); |
2733 | sky2_write32(hw, B0_IMSK, 0); | 2739 | sky2_write32(hw, B0_IMSK, 0); |
2734 | sky2_read32(hw, B0_IMSK); | 2740 | sky2_read32(hw, B0_IMSK); |
@@ -2757,8 +2763,6 @@ static void sky2_restart(struct work_struct *work) | |||
2757 | } | 2763 | } |
2758 | } | 2764 | } |
2759 | 2765 | ||
2760 | sky2_idle_start(hw); | ||
2761 | |||
2762 | rtnl_unlock(); | 2766 | rtnl_unlock(); |
2763 | } | 2767 | } |
2764 | 2768 | ||
@@ -4025,11 +4029,9 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
4025 | sky2_show_addr(dev1); | 4029 | sky2_show_addr(dev1); |
4026 | } | 4030 | } |
4027 | 4031 | ||
4028 | setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw); | 4032 | setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw); |
4029 | INIT_WORK(&hw->restart_work, sky2_restart); | 4033 | INIT_WORK(&hw->restart_work, sky2_restart); |
4030 | 4034 | ||
4031 | sky2_idle_start(hw); | ||
4032 | |||
4033 | pci_set_drvdata(pdev, hw); | 4035 | pci_set_drvdata(pdev, hw); |
4034 | 4036 | ||
4035 | return 0; | 4037 | return 0; |
@@ -4064,7 +4066,7 @@ static void __devexit sky2_remove(struct pci_dev *pdev) | |||
4064 | if (!hw) | 4066 | if (!hw) |
4065 | return; | 4067 | return; |
4066 | 4068 | ||
4067 | del_timer_sync(&hw->idle_timer); | 4069 | del_timer_sync(&hw->watchdog_timer); |
4068 | 4070 | ||
4069 | flush_scheduled_work(); | 4071 | flush_scheduled_work(); |
4070 | 4072 | ||
@@ -4108,7 +4110,6 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state) | |||
4108 | if (!hw) | 4110 | if (!hw) |
4109 | return 0; | 4111 | return 0; |
4110 | 4112 | ||
4111 | del_timer_sync(&hw->idle_timer); | ||
4112 | netif_poll_disable(hw->dev[0]); | 4113 | netif_poll_disable(hw->dev[0]); |
4113 | 4114 | ||
4114 | for (i = 0; i < hw->ports; i++) { | 4115 | for (i = 0; i < hw->ports; i++) { |
@@ -4174,7 +4175,7 @@ static int sky2_resume(struct pci_dev *pdev) | |||
4174 | } | 4175 | } |
4175 | 4176 | ||
4176 | netif_poll_enable(hw->dev[0]); | 4177 | netif_poll_enable(hw->dev[0]); |
4177 | sky2_idle_start(hw); | 4178 | |
4178 | return 0; | 4179 | return 0; |
4179 | out: | 4180 | out: |
4180 | dev_err(&pdev->dev, "resume failed (%d)\n", err); | 4181 | dev_err(&pdev->dev, "resume failed (%d)\n", err); |
@@ -4191,7 +4192,6 @@ static void sky2_shutdown(struct pci_dev *pdev) | |||
4191 | if (!hw) | 4192 | if (!hw) |
4192 | return; | 4193 | return; |
4193 | 4194 | ||
4194 | del_timer_sync(&hw->idle_timer); | ||
4195 | netif_poll_disable(hw->dev[0]); | 4195 | netif_poll_disable(hw->dev[0]); |
4196 | 4196 | ||
4197 | for (i = 0; i < hw->ports; i++) { | 4197 | for (i = 0; i < hw->ports; i++) { |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index dce4d276d443..72e12b7cfa40 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -2045,12 +2045,13 @@ struct sky2_hw { | |||
2045 | u8 chip_rev; | 2045 | u8 chip_rev; |
2046 | u8 pmd_type; | 2046 | u8 pmd_type; |
2047 | u8 ports; | 2047 | u8 ports; |
2048 | u8 active; | ||
2048 | 2049 | ||
2049 | struct sky2_status_le *st_le; | 2050 | struct sky2_status_le *st_le; |
2050 | u32 st_idx; | 2051 | u32 st_idx; |
2051 | dma_addr_t st_dma; | 2052 | dma_addr_t st_dma; |
2052 | 2053 | ||
2053 | struct timer_list idle_timer; | 2054 | struct timer_list watchdog_timer; |
2054 | struct work_struct restart_work; | 2055 | struct work_struct restart_work; |
2055 | int msi; | 2056 | int msi; |
2056 | wait_queue_head_t msi_wait; | 2057 | wait_queue_head_t msi_wait; |