* [PATCH 1/5] sky2: receive error handling fix
2006-12-01 22:29 [PATCH 0/5] sky2: driver update Stephen Hemminger
@ 2006-12-01 22:29 ` Stephen Hemminger
2006-12-01 22:29 ` [PATCH 2/5] sky2: add Dlink 560SX id Stephen Hemminger
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2006-12-01 22:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
[-- Attachment #1: sky2-rcv-err.patch --]
[-- Type: text/plain, Size: 1036 bytes --]
If sky2 detects out of memory, or gets a bad frame, it reuses the same receive
buffer, but forgets to poke the hardware. This could lead to the receiver
getting stuck if there were lots of errors.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
drivers/net/sky2.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- netdev-2.6.orig/drivers/net/sky2.c 2006-12-01 14:19:32.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.c 2006-12-01 14:23:21.000000000 -0800
@@ -2065,7 +2065,7 @@
case OP_RXSTAT:
skb = sky2_receive(dev, length, status);
if (!skb)
- break;
+ goto force_update;
skb->protocol = eth_type_trans(skb, dev);
dev->last_rx = jiffies;
@@ -2081,8 +2081,8 @@
/* Update receiver after 16 frames */
if (++buf_write[le->link] == RX_BUF_WRITE) {
- sky2_put_idx(hw, rxqaddr[le->link],
- sky2->rx_put);
+force_update:
+ sky2_put_idx(hw, rxqaddr[le->link], sky2->rx_put);
buf_write[le->link] = 0;
}
--
Stephen Hemminger <shemminger@osdl.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 2/5] sky2: add Dlink 560SX id
2006-12-01 22:29 [PATCH 0/5] sky2: driver update Stephen Hemminger
2006-12-01 22:29 ` [PATCH 1/5] sky2: receive error handling fix Stephen Hemminger
@ 2006-12-01 22:29 ` Stephen Hemminger
2006-12-01 22:29 ` [PATCH 3/5] sky2: fixes for Yukon EC_U chip revisions Stephen Hemminger
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2006-12-01 22:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
[-- Attachment #1: sky2-dlink.patch --]
[-- Type: text/plain, Size: 815 bytes --]
Add new PCI ID for DLink 560SX.
This from the latest SysKonnect vendor driver (version 8.41).
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
drivers/net/sky2.c | 1 +
1 file changed, 1 insertion(+)
--- netdev-2.6.orig/drivers/net/sky2.c 2006-12-01 14:23:21.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.c 2006-12-01 14:23:27.000000000 -0800
@@ -104,6 +104,7 @@
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) },
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, /* DGE-560T */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4001) }, /* DGE-550SX */
+ { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4B02) }, /* DGE-560SX */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) },
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) },
--
Stephen Hemminger <shemminger@osdl.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 3/5] sky2: fixes for Yukon EC_U chip revisions
2006-12-01 22:29 [PATCH 0/5] sky2: driver update Stephen Hemminger
2006-12-01 22:29 ` [PATCH 1/5] sky2: receive error handling fix Stephen Hemminger
2006-12-01 22:29 ` [PATCH 2/5] sky2: add Dlink 560SX id Stephen Hemminger
@ 2006-12-01 22:29 ` Stephen Hemminger
2006-12-01 22:29 ` [PATCH 4/5] sky2: kfree_skb_any needed Stephen Hemminger
2006-12-01 22:29 ` [PATCH 5/5] sky2: msi enhancements Stephen Hemminger
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2006-12-01 22:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
[-- Attachment #1: sky2-ec-u-rev.patch --]
[-- Type: text/plain, Size: 2727 bytes --]
Update workarounds for 88E803X based on the latest SysKonnect vendor
driver version (8.41). Tested on EC_U rev A1, only.
These up the receive performance.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
drivers/net/sky2.c | 13 ++++++-------
drivers/net/sky2.h | 9 +++++++--
2 files changed, 13 insertions(+), 9 deletions(-)
--- netdev-2.6.orig/drivers/net/sky2.c 2006-12-01 14:23:27.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.c 2006-12-01 14:23:30.000000000 -0800
@@ -677,17 +677,15 @@
/* Flush Rx MAC FIFO on any flow control or error */
sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR);
- /* Set threshold to 0xa (64 bytes)
- * ASF disabled so no need to do WA dev #4.30
- */
- sky2_write16(hw, SK_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF);
+ /* Set threshold to 0xa (64 bytes) + 1 to workaround pause bug */
+ sky2_write16(hw, SK_REG(port, RX_GMF_FL_THR), RX_GMF_FL_THR_DEF+1);
/* Configure Tx MAC FIFO */
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR);
sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
if (hw->chip_id == CHIP_ID_YUKON_EC_U) {
- sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 512/8);
+ sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8);
sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8);
if (hw->dev[port]->mtu > ETH_DATA_LEN) {
/* set Tx GMAC FIFO Almost Empty Threshold */
@@ -1061,7 +1059,8 @@
sky2->rx_put = sky2->rx_next = 0;
sky2_qset(hw, rxq);
- if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev >= 2) {
+ if (hw->chip_id == CHIP_ID_YUKON_EC_U &&
+ (hw->chip_rev == CHIP_REV_YU_EC_U_A1 || hw->chip_rev == CHIP_REV_YU_EC_U_B0)) {
/* MAC Rx RAM Read is controlled by hardware */
sky2_write32(hw, Q_ADDR(rxq, Q_F), F_M_RX_RAM_DIS);
}
@@ -1510,7 +1509,7 @@
/* WA for dev. #4.209 */
if (hw->chip_id == CHIP_ID_YUKON_EC_U
- && hw->chip_rev == CHIP_REV_YU_EC_U_A1)
+ && (hw->chip_rev == CHIP_REV_YU_EC_U_A1 || hw->chip_rev == CHIP_REV_YU_EC_U_B0))
sky2_write32(hw, SK_REG(port, TX_GMF_CTRL_T),
sky2->speed != SPEED_1000 ?
TX_STFW_ENA : TX_STFW_DIS);
--- netdev-2.6.orig/drivers/net/sky2.h 2006-12-01 14:19:32.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.h 2006-12-01 14:23:30.000000000 -0800
@@ -383,8 +383,13 @@
CHIP_REV_YU_EC_A2 = 1, /* Chip Rev. for Yukon-EC A2 */
CHIP_REV_YU_EC_A3 = 2, /* Chip Rev. for Yukon-EC A3 */
- CHIP_REV_YU_EC_U_A0 = 0,
- CHIP_REV_YU_EC_U_A1 = 1,
+ CHIP_REV_YU_EC_U_A0 = 1,
+ CHIP_REV_YU_EC_U_A1 = 2,
+ CHIP_REV_YU_EC_U_B0 = 3,
+
+ CHIP_REV_YU_FE_A1 = 1,
+ CHIP_REV_YU_FE_A2 = 2,
+
};
/* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */
--
Stephen Hemminger <shemminger@osdl.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 4/5] sky2: kfree_skb_any needed
2006-12-01 22:29 [PATCH 0/5] sky2: driver update Stephen Hemminger
` (2 preceding siblings ...)
2006-12-01 22:29 ` [PATCH 3/5] sky2: fixes for Yukon EC_U chip revisions Stephen Hemminger
@ 2006-12-01 22:29 ` Stephen Hemminger
2006-12-01 22:29 ` [PATCH 5/5] sky2: msi enhancements Stephen Hemminger
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2006-12-01 22:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
[-- Attachment #1: sky2-napi-free.patch --]
[-- Type: text/plain, Size: 848 bytes --]
It is possible for the sky2 driver NAPI poll routine to be called with
IRQ's disabled if netpoll is trying to make space in the tx queue. This
is an obscure path, but if it happens, the kfree_skb needs to happen
via softirq. Calling kfree_skb with IRQ's disabled is a not allowed.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
drivers/net/sky2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- netdev-2.6.orig/drivers/net/sky2.c 2006-12-01 14:23:30.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.c 2006-12-01 14:23:33.000000000 -0800
@@ -1453,7 +1453,7 @@
if (unlikely(netif_msg_tx_done(sky2)))
printk(KERN_DEBUG "%s: tx done %u\n",
dev->name, idx);
- dev_kfree_skb(re->skb);
+ dev_kfree_skb_any(re->skb);
}
le->opcode = 0; /* paranoia */
--
Stephen Hemminger <shemminger@osdl.org>
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 5/5] sky2: msi enhancements.
2006-12-01 22:29 [PATCH 0/5] sky2: driver update Stephen Hemminger
` (3 preceding siblings ...)
2006-12-01 22:29 ` [PATCH 4/5] sky2: kfree_skb_any needed Stephen Hemminger
@ 2006-12-01 22:29 ` Stephen Hemminger
4 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2006-12-01 22:29 UTC (permalink / raw)
To: Jeff Garzik; +Cc: netdev
[-- Attachment #1: sky2-msi2.patch --]
[-- Type: text/plain, Size: 2512 bytes --]
If using Message Signaled Interrupts (MSI) then the IRQ will never
be shared. Don't call pci_disable_msi() unless using MSI.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
---
drivers/net/sky2.c | 17 ++++++++++-------
drivers/net/sky2.h | 2 +-
2 files changed, 11 insertions(+), 8 deletions(-)
--- netdev-2.6.orig/drivers/net/sky2.c 2006-12-01 14:23:33.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.c 2006-12-01 14:23:36.000000000 -0800
@@ -3311,7 +3311,7 @@
return IRQ_NONE;
if (status & Y2_IS_IRQ_SW) {
- hw->msi_detected = 1;
+ hw->msi = 1;
wake_up(&hw->msi_wait);
sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ);
}
@@ -3330,7 +3330,7 @@
sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW);
- err = request_irq(pdev->irq, sky2_test_intr, IRQF_SHARED, DRV_NAME, hw);
+ err = request_irq(pdev->irq, sky2_test_intr, 0, DRV_NAME, hw);
if (err) {
printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
pci_name(pdev), pdev->irq);
@@ -3340,9 +3340,9 @@
sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ);
sky2_read8(hw, B0_CTST);
- wait_event_timeout(hw->msi_wait, hw->msi_detected, HZ/10);
+ wait_event_timeout(hw->msi_wait, hw->msi, HZ/10);
- if (!hw->msi_detected) {
+ if (!hw->msi) {
/* MSI test failed, go back to INTx mode */
printk(KERN_INFO PFX "%s: No interrupt generated using MSI, "
"switching to INTx mode.\n",
@@ -3475,7 +3475,8 @@
goto err_out_free_netdev;
}
- err = request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw);
+ err = request_irq(pdev->irq, sky2_intr, hw->msi ? 0 : IRQF_SHARED,
+ dev->name, hw);
if (err) {
printk(KERN_ERR PFX "%s: cannot assign irq %d\n",
pci_name(pdev), pdev->irq);
@@ -3505,7 +3506,8 @@
return 0;
err_out_unregister:
- pci_disable_msi(pdev);
+ if (hw->msi)
+ pci_disable_msi(pdev);
unregister_netdev(dev);
err_out_free_netdev:
free_netdev(dev);
@@ -3548,7 +3550,8 @@
sky2_read8(hw, B0_CTST);
free_irq(pdev->irq, hw);
- pci_disable_msi(pdev);
+ if (hw->msi)
+ pci_disable_msi(pdev);
pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma);
pci_release_regions(pdev);
pci_disable_device(pdev);
--- netdev-2.6.orig/drivers/net/sky2.h 2006-12-01 14:23:30.000000000 -0800
+++ netdev-2.6/drivers/net/sky2.h 2006-12-01 14:23:36.000000000 -0800
@@ -1900,7 +1900,7 @@
dma_addr_t st_dma;
struct timer_list idle_timer;
- int msi_detected;
+ int msi;
wait_queue_head_t msi_wait;
};
--
Stephen Hemminger <shemminger@osdl.org>
^ permalink raw reply [flat|nested] 6+ messages in thread