* [PATCH 0/6] sky2 patches for net-2.6
@ 2007-10-12 1:19 Stephen Hemminger
2007-10-12 1:19 ` [PATCH 1/6] sky2: status polling loop Stephen Hemminger
` (5 more replies)
0 siblings, 6 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Includes:
* fix for new NAPI status loop
* use internal net_stats
* fixes for fiber PHY power
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/6] sky2: status polling loop
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
@ 2007-10-12 1:19 ` Stephen Hemminger
2007-10-12 1:23 ` David Miller
2007-10-12 1:19 ` [PATCH 2/6] sky2: ethtool register reserved area blackout Stephen Hemminger
` (4 subsequent siblings)
5 siblings, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: sky2-status-loop.patch --]
[-- Type: text/plain, Size: 2477 bytes --]
Handle the corner case where budget is exhausted correctly.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:11:44.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:12:50.000000000 -0700
@@ -2245,15 +2245,13 @@ static inline void sky2_tx_done(struct n
}
/* Process status response ring */
-static int sky2_status_intr(struct sky2_hw *hw, int to_do)
+static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
{
int work_done = 0;
unsigned rx[2] = { 0, 0 };
- u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
rmb();
-
- while (hw->st_idx != hwidx) {
+ do {
struct sky2_port *sky2;
struct sky2_status_le *le = hw->st_le + hw->st_idx;
unsigned port = le->css & CSS_LINK_BIT;
@@ -2364,7 +2362,7 @@ static int sky2_status_intr(struct sky2_
printk(KERN_WARNING PFX
"unknown status opcode 0x%x\n", le->opcode);
}
- }
+ } while (hw->st_idx != idx);
/* Fully processed status ring so clear irq */
sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
@@ -2606,7 +2604,8 @@ static int sky2_poll(struct napi_struct
{
struct sky2_hw *hw = container_of(napi, struct sky2_hw, napi);
u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
- int work_done;
+ int work_done = 0;
+ u16 idx;
if (unlikely(status & Y2_IS_ERROR))
sky2_err_intr(hw, status);
@@ -2617,21 +2616,24 @@ static int sky2_poll(struct napi_struct
if (status & Y2_IS_IRQ_PHY2)
sky2_phy_intr(hw, 1);
- work_done = sky2_status_intr(hw, work_limit);
+ while ((idx = sky2_read16(hw, STAT_PUT_IDX)) != hw->st_idx) {
+ work_done += sky2_status_intr(hw, work_limit - work_done, idx);
- /* More work? */
- if (hw->st_idx == sky2_read16(hw, STAT_PUT_IDX)) {
- /* Bug/Errata workaround?
- * Need to kick the TX irq moderation timer.
- */
- if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
- }
+ if (work_done >= work_limit)
+ goto done;
+ }
- napi_complete(napi);
- sky2_read32(hw, B0_Y2_SP_LISR);
+ /* Bug/Errata workaround?
+ * Need to kick the TX irq moderation timer.
+ */
+ if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
+ sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
+ sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
}
+ napi_complete(napi);
+ sky2_read32(hw, B0_Y2_SP_LISR);
+done:
+
return work_done;
}
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/6] sky2: ethtool register reserved area blackout
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
2007-10-12 1:19 ` [PATCH 1/6] sky2: status polling loop Stephen Hemminger
@ 2007-10-12 1:19 ` Stephen Hemminger
2007-10-12 1:19 ` [PATCH 3/6] sky2: fix power settings on Yukon XL Stephen Hemminger
` (3 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: sky2-ethdump.patch --]
[-- Type: text/plain, Size: 2760 bytes --]
Make sure and not dump reserved areas of device space.
Touching some of these causes machine check exceptions on boards
like D-Link DGE-550SX.
Coding note, used a complex switch statement rather than bitmap
because it is easier to relate the block values to the documentation
rather than looking at a encoded bitmask.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:12:50.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:12:56.000000000 -0700
@@ -3569,20 +3569,64 @@ static void sky2_get_regs(struct net_dev
{
const struct sky2_port *sky2 = netdev_priv(dev);
const void __iomem *io = sky2->hw->regs;
+ unsigned int b;
regs->version = 1;
- memset(p, 0, regs->len);
- memcpy_fromio(p, io, B3_RAM_ADDR);
-
- /* skip diagnostic ram region */
- memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - B3_RI_WTO_R1);
+ for (b = 0; b < 128; b++) {
+ /* This complicated switch statement is to make sure and
+ * only access regions that are unreserved.
+ * Some blocks are only valid on dual port cards.
+ * and block 3 has some special diagnostic registers that
+ * are poison.
+ */
+ switch (b) {
+ case 3:
+ /* skip diagnostic ram region */
+ memcpy_fromio(p + 0x10, io + 0x10, 128 - 0x10);
+ break;
- /* copy GMAC registers */
- memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000);
- if (sky2->hw->ports > 1)
- memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000);
+ /* dual port cards only */
+ case 5: /* Tx Arbiter 2 */
+ case 9: /* RX2 */
+ case 14 ... 15: /* TX2 */
+ case 17: case 19: /* Ram Buffer 2 */
+ case 22 ... 23: /* Tx Ram Buffer 2 */
+ case 25: /* Rx MAC Fifo 1 */
+ case 27: /* Tx MAC Fifo 2 */
+ case 31: /* GPHY 2 */
+ case 40 ... 47: /* Pattern Ram 2 */
+ case 52: case 54: /* TCP Segmentation 2 */
+ case 112 ... 116: /* GMAC 2 */
+ if (sky2->hw->ports == 1)
+ goto reserved;
+ /* fall through */
+ case 0: /* Control */
+ case 2: /* Mac address */
+ case 4: /* Tx Arbiter 1 */
+ case 7: /* PCI express reg */
+ case 8: /* RX1 */
+ case 12 ... 13: /* TX1 */
+ case 16: case 18:/* Rx Ram Buffer 1 */
+ case 20 ... 21: /* Tx Ram Buffer 1 */
+ case 24: /* Rx MAC Fifo 1 */
+ case 26: /* Tx MAC Fifo 1 */
+ case 28 ... 29: /* Descriptor and status unit */
+ case 30: /* GPHY 1*/
+ case 32 ... 39: /* Pattern Ram 1 */
+ case 48: case 50: /* TCP Segmentation 1 */
+ case 56 ... 60: /* PCI space */
+ case 80 ... 84: /* GMAC 1 */
+ memcpy_fromio(p, io, 128);
+ break;
+ default:
+reserved:
+ memset(p, 0, 128);
+ }
+ p += 128;
+ io += 128;
+ }
}
/* In order to do Jumbo packets on these chips, need to turn off the
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 3/6] sky2: fix power settings on Yukon XL
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
2007-10-12 1:19 ` [PATCH 1/6] sky2: status polling loop Stephen Hemminger
2007-10-12 1:19 ` [PATCH 2/6] sky2: ethtool register reserved area blackout Stephen Hemminger
@ 2007-10-12 1:19 ` Stephen Hemminger
2007-10-12 1:19 ` [PATCH 4/6] sky2: fiber advertise bits initialization (trivial) Stephen Hemminger
` (2 subsequent siblings)
5 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: sky2-phy-power.patch --]
[-- Type: text/plain, Size: 1178 bytes --]
Make sure PCI register for PHY power gets set correctly.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:12:56.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:13:00.000000000 -0700
@@ -606,20 +606,19 @@ static void sky2_phy_power(struct sky2_h
{
struct pci_dev *pdev = hw->pdev;
u32 reg1;
- static const u32 phy_power[]
- = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
-
- /* looks like this XL is back asswards .. */
- if (hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
- onoff = !onoff;
+ static const u32 phy_power[] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
+ static const u32 coma_mode[] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA };
pci_read_config_dword(pdev, PCI_DEV_REG1, ®1);
+ /* Turn on/off phy power saving */
if (onoff)
- /* Turn off phy power saving */
reg1 &= ~phy_power[port];
else
reg1 |= phy_power[port];
+ if (onoff && hw->chip_id == CHIP_ID_YUKON_XL && hw->chip_rev > 1)
+ reg1 |= coma_mode[port];
+
pci_write_config_dword(pdev, PCI_DEV_REG1, reg1);
pci_read_config_dword(pdev, PCI_DEV_REG1, ®1);
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 4/6] sky2: fiber advertise bits initialization (trivial)
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
` (2 preceding siblings ...)
2007-10-12 1:19 ` [PATCH 3/6] sky2: fix power settings on Yukon XL Stephen Hemminger
@ 2007-10-12 1:19 ` Stephen Hemminger
2007-10-12 1:19 ` [PATCH 5/6] sky2: use netdevice stats struct Stephen Hemminger
2007-10-12 1:19 ` [PATCH 6/6] sky2: version 1.19 Stephen Hemminger
5 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: fiber-mode-reorder.patch --]
[-- Type: text/plain, Size: 717 bytes --]
Put initialization in sequential order (same as other constants).
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:13:00.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:13:01.000000000 -0700
@@ -296,10 +296,10 @@ static const u16 copper_fc_adv[] = {
/* flow control to advertise bits when using 1000BaseX */
static const u16 fiber_fc_adv[] = {
- [FC_BOTH] = PHY_M_P_BOTH_MD_X,
+ [FC_NONE] = PHY_M_P_NO_PAUSE_X,
[FC_TX] = PHY_M_P_ASYM_MD_X,
[FC_RX] = PHY_M_P_SYM_MD_X,
- [FC_NONE] = PHY_M_P_NO_PAUSE_X,
+ [FC_BOTH] = PHY_M_P_BOTH_MD_X,
};
/* flow control to GMA disable bits */
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 5/6] sky2: use netdevice stats struct
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
` (3 preceding siblings ...)
2007-10-12 1:19 ` [PATCH 4/6] sky2: fiber advertise bits initialization (trivial) Stephen Hemminger
@ 2007-10-12 1:19 ` Stephen Hemminger
2007-10-12 1:19 ` [PATCH 6/6] sky2: version 1.19 Stephen Hemminger
5 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: sky2-net-stats.patch --]
[-- Type: text/plain, Size: 3607 bytes --]
Use builtin statistics structure from net device.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:13:01.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:13:02.000000000 -0700
@@ -1635,8 +1635,8 @@ static void sky2_tx_complete(struct sky2
printk(KERN_DEBUG "%s: tx done %u\n",
dev->name, idx);
- sky2->net_stats.tx_packets++;
- sky2->net_stats.tx_bytes += re->skb->len;
+ dev->stats.tx_packets++;
+ dev->stats.tx_bytes += re->skb->len;
dev_kfree_skb_any(re->skb);
sky2->tx_next = RING_NEXT(idx, TX_RING_SIZE);
@@ -2204,16 +2204,16 @@ resubmit:
len_error:
/* Truncation of overlength packets
causes PHY length to not match MAC length */
- ++sky2->net_stats.rx_length_errors;
+ ++dev->stats.rx_length_errors;
if (netif_msg_rx_err(sky2) && net_ratelimit())
pr_info(PFX "%s: rx length error: status %#x length %d\n",
dev->name, status, length);
goto resubmit;
error:
- ++sky2->net_stats.rx_errors;
+ ++dev->stats.rx_errors;
if (status & GMR_FS_RX_FF_OV) {
- sky2->net_stats.rx_over_errors++;
+ dev->stats.rx_over_errors++;
goto resubmit;
}
@@ -2222,11 +2222,11 @@ error:
dev->name, status, length);
if (status & (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE))
- sky2->net_stats.rx_length_errors++;
+ dev->stats.rx_length_errors++;
if (status & GMR_FS_FRAGMENT)
- sky2->net_stats.rx_frame_errors++;
+ dev->stats.rx_frame_errors++;
if (status & GMR_FS_CRC_ERR)
- sky2->net_stats.rx_crc_errors++;
+ dev->stats.rx_crc_errors++;
goto resubmit;
}
@@ -2271,7 +2271,7 @@ static int sky2_status_intr(struct sky2_
++rx[port];
skb = sky2_receive(dev, length, status);
if (unlikely(!skb)) {
- sky2->net_stats.rx_dropped++;
+ dev->stats.rx_dropped++;
break;
}
@@ -2286,8 +2286,8 @@ static int sky2_status_intr(struct sky2_
}
skb->protocol = eth_type_trans(skb, dev);
- sky2->net_stats.rx_packets++;
- sky2->net_stats.rx_bytes += skb->len;
+ dev->stats.rx_packets++;
+ dev->stats.rx_bytes += skb->len;
dev->last_rx = jiffies;
#ifdef SKY2_VLAN_TAG_USED
@@ -2478,12 +2478,12 @@ static void sky2_mac_intr(struct sky2_hw
gma_read16(hw, port, GM_TX_IRQ_SRC);
if (status & GM_IS_RX_FF_OR) {
- ++sky2->net_stats.rx_fifo_errors;
+ ++dev->stats.rx_fifo_errors;
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO);
}
if (status & GM_IS_TX_FF_UR) {
- ++sky2->net_stats.tx_fifo_errors;
+ ++dev->stats.tx_fifo_errors;
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU);
}
}
@@ -3222,12 +3222,6 @@ static void sky2_get_strings(struct net_
}
}
-static struct net_device_stats *sky2_get_stats(struct net_device *dev)
-{
- struct sky2_port *sky2 = netdev_priv(dev);
- return &sky2->net_stats;
-}
-
static int sky2_set_mac_address(struct net_device *dev, void *p)
{
struct sky2_port *sky2 = netdev_priv(dev);
@@ -3977,7 +3971,6 @@ static __devinit struct net_device *sky2
dev->stop = sky2_down;
dev->do_ioctl = sky2_ioctl;
dev->hard_start_xmit = sky2_xmit_frame;
- dev->get_stats = sky2_get_stats;
dev->set_multicast_list = sky2_set_multicast;
dev->set_mac_address = sky2_set_mac_address;
dev->change_mtu = sky2_change_mtu;
--- a/drivers/net/sky2.h 2007-10-11 18:11:44.000000000 -0700
+++ b/drivers/net/sky2.h 2007-10-11 18:13:02.000000000 -0700
@@ -2031,8 +2031,6 @@ struct sky2_port {
#ifdef CONFIG_SKY2_DEBUG
struct dentry *debugfs;
#endif
- struct net_device_stats net_stats;
-
};
struct sky2_hw {
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 6/6] sky2: version 1.19
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
` (4 preceding siblings ...)
2007-10-12 1:19 ` [PATCH 5/6] sky2: use netdevice stats struct Stephen Hemminger
@ 2007-10-12 1:19 ` Stephen Hemminger
5 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:19 UTC (permalink / raw)
To: David Miller; +Cc: netdev
[-- Attachment #1: sky2-1.19 --]
[-- Type: text/plain, Size: 451 bytes --]
Update version to keep track of new changes.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:13:02.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:14:25.000000000 -0700
@@ -52,7 +52,7 @@
#include "sky2.h"
#define DRV_NAME "sky2"
-#define DRV_VERSION "1.18"
+#define DRV_VERSION "1.19"
#define PFX DRV_NAME " "
/*
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/6] sky2: status polling loop
2007-10-12 1:19 ` [PATCH 1/6] sky2: status polling loop Stephen Hemminger
@ 2007-10-12 1:23 ` David Miller
2007-10-12 1:25 ` Stephen Hemminger
2007-10-12 1:29 ` [PATCH 1/6] sky2: status polling loop (post merge) Stephen Hemminger
0 siblings, 2 replies; 12+ messages in thread
From: David Miller @ 2007-10-12 1:23 UTC (permalink / raw)
To: shemminger; +Cc: netdev
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Thu, 11 Oct 2007 18:19:52 -0700
> Handle the corner case where budget is exhausted correctly.
>
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Doesn't apply, I checked in my fixed version of your original patch
already.
You had to have some idea I would apply that fix, so this patch series
seems a bit premature since it's almost guarenteed to not apply any
more.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/6] sky2: status polling loop
2007-10-12 1:23 ` David Miller
@ 2007-10-12 1:25 ` Stephen Hemminger
2007-10-12 1:29 ` [PATCH 1/6] sky2: status polling loop (post merge) Stephen Hemminger
1 sibling, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:25 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Thu, 11 Oct 2007 18:23:58 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Thu, 11 Oct 2007 18:19:52 -0700
>
> > Handle the corner case where budget is exhausted correctly.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
>
> Doesn't apply, I checked in my fixed version of your original patch
> already.
>
> You had to have some idea I would apply that fix, so this patch series
> seems a bit premature since it's almost guarenteed to not apply any
> more.
I like to test my signed patches before applying... And if possible
send them out from the kernel running the actual code.
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/6] sky2: status polling loop (post merge)
2007-10-12 1:23 ` David Miller
2007-10-12 1:25 ` Stephen Hemminger
@ 2007-10-12 1:29 ` Stephen Hemminger
2007-10-12 1:31 ` David Miller
1 sibling, 1 reply; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:29 UTC (permalink / raw)
To: David Miller; +Cc: netdev
Handle the corner case where budget is exhausted correctly.
And save unnecessary read of index register.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
--- a/drivers/net/sky2.c 2007-10-11 18:26:56.000000000 -0700
+++ b/drivers/net/sky2.c 2007-10-11 18:27:12.000000000 -0700
@@ -2245,15 +2245,13 @@ static inline void sky2_tx_done(struct n
}
/* Process status response ring */
-static int sky2_status_intr(struct sky2_hw *hw, int to_do)
+static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
{
int work_done = 0;
unsigned rx[2] = { 0, 0 };
- u16 hwidx = sky2_read16(hw, STAT_PUT_IDX);
rmb();
-
- while (hw->st_idx != hwidx) {
+ do {
struct sky2_port *sky2;
struct sky2_status_le *le = hw->st_le + hw->st_idx;
unsigned port = le->css & CSS_LINK_BIT;
@@ -2364,7 +2362,7 @@ static int sky2_status_intr(struct sky2_
printk(KERN_WARNING PFX
"unknown status opcode 0x%x\n", le->opcode);
}
- }
+ } while (hw->st_idx != idx);
/* Fully processed status ring so clear irq */
sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ);
@@ -2607,6 +2605,7 @@ static int sky2_poll(struct napi_struct
struct sky2_hw *hw = container_of(napi, struct sky2_hw, napi);
u32 status = sky2_read32(hw, B0_Y2_SP_EISR);
int work_done = 0;
+ u16 idx;
if (unlikely(status & Y2_IS_ERROR))
sky2_err_intr(hw, status);
@@ -2617,29 +2616,23 @@ static int sky2_poll(struct napi_struct
if (status & Y2_IS_IRQ_PHY2)
sky2_phy_intr(hw, 1);
- for(;;) {
- work_done += sky2_status_intr(hw, work_limit);
+ while ((idx = sky2_read16(hw, STAT_PUT_IDX)) != hw->st_idx) {
+ work_done += sky2_status_intr(hw, work_limit - work_done, idx);
if (work_done >= work_limit)
- break;
-
- /* More work? */
- if (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX))
- continue;
-
- /* Bug/Errata workaround?
- * Need to kick the TX irq moderation timer.
- */
- if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
- sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
- }
-
- napi_complete(napi);
- sky2_read32(hw, B0_Y2_SP_LISR);
- break;
+ goto done;
+ }
+ /* Bug/Errata workaround?
+ * Need to kick the TX irq moderation timer.
+ */
+ if (sky2_read8(hw, STAT_TX_TIMER_CTRL) == TIM_START) {
+ sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
+ sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
}
+ napi_complete(napi);
+ sky2_read32(hw, B0_Y2_SP_LISR);
+done:
return work_done;
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/6] sky2: status polling loop (post merge)
2007-10-12 1:29 ` [PATCH 1/6] sky2: status polling loop (post merge) Stephen Hemminger
@ 2007-10-12 1:31 ` David Miller
2007-10-12 1:36 ` Stephen Hemminger
0 siblings, 1 reply; 12+ messages in thread
From: David Miller @ 2007-10-12 1:31 UTC (permalink / raw)
To: shemminger; +Cc: netdev
From: Stephen Hemminger <shemminger@linux-foundation.org>
Date: Thu, 11 Oct 2007 18:29:21 -0700
> Handle the corner case where budget is exhausted correctly.
> And save unnecessary read of index register.
>
> Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Applied.
You can submit the rest later, I deleted them since they
likely depend upon line offsets and other things in this
patch.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 1/6] sky2: status polling loop (post merge)
2007-10-12 1:31 ` David Miller
@ 2007-10-12 1:36 ` Stephen Hemminger
0 siblings, 0 replies; 12+ messages in thread
From: Stephen Hemminger @ 2007-10-12 1:36 UTC (permalink / raw)
To: David Miller; +Cc: netdev
On Thu, 11 Oct 2007 18:31:46 -0700 (PDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <shemminger@linux-foundation.org>
> Date: Thu, 11 Oct 2007 18:29:21 -0700
>
> > Handle the corner case where budget is exhausted correctly.
> > And save unnecessary read of index register.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
>
> Applied.
>
> You can submit the rest later, I deleted them since they
> likely depend upon line offsets and other things in this
> patch.
Actually, they are exactly the same...
--
Stephen Hemminger <shemminger@linux-foundation.org>
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2007-10-12 1:36 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-12 1:19 [PATCH 0/6] sky2 patches for net-2.6 Stephen Hemminger
2007-10-12 1:19 ` [PATCH 1/6] sky2: status polling loop Stephen Hemminger
2007-10-12 1:23 ` David Miller
2007-10-12 1:25 ` Stephen Hemminger
2007-10-12 1:29 ` [PATCH 1/6] sky2: status polling loop (post merge) Stephen Hemminger
2007-10-12 1:31 ` David Miller
2007-10-12 1:36 ` Stephen Hemminger
2007-10-12 1:19 ` [PATCH 2/6] sky2: ethtool register reserved area blackout Stephen Hemminger
2007-10-12 1:19 ` [PATCH 3/6] sky2: fix power settings on Yukon XL Stephen Hemminger
2007-10-12 1:19 ` [PATCH 4/6] sky2: fiber advertise bits initialization (trivial) Stephen Hemminger
2007-10-12 1:19 ` [PATCH 5/6] sky2: use netdevice stats struct Stephen Hemminger
2007-10-12 1:19 ` [PATCH 6/6] sky2: version 1.19 Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).