diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-01 18:07:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-01 18:07:29 -0400 |
commit | 3ce4af1defe55591925362ca1ef8363ba04e0feb (patch) | |
tree | 05b334a4d011ac1e8ff40daf03ee46bdee293093 | |
parent | 54866f032307063776b4eff7eadb131d47f9f9b4 (diff) | |
parent | c956a24018819bd903fad0cd275a63c089cdba53 (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:
Fix myri10ge NAPI oops & warnings
Fix region size check in mpc5200 FEC driver
mpc5200: Fix Kconfig dependancies on MPC5200 FEC device driver
-rw-r--r-- | drivers/net/Kconfig | 4 | ||||
-rw-r--r-- | drivers/net/fec_mpc52xx.c | 4 | ||||
-rw-r--r-- | drivers/net/myri10ge/myri10ge.c | 6 |
3 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 867cb7345b5f..5f800a6dd978 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1883,9 +1883,7 @@ config FEC2 | |||
1883 | 1883 | ||
1884 | config FEC_MPC52xx | 1884 | config FEC_MPC52xx |
1885 | tristate "MPC52xx FEC driver" | 1885 | tristate "MPC52xx FEC driver" |
1886 | depends on PPC_MPC52xx | 1886 | depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC |
1887 | select PPC_BESTCOMM | ||
1888 | select PPC_BESTCOMM_FEC | ||
1889 | select CRC32 | 1887 | select CRC32 |
1890 | select PHYLIB | 1888 | select PHYLIB |
1891 | ---help--- | 1889 | ---help--- |
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index fc1cf0b742b0..a8a0ee220da6 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c | |||
@@ -879,9 +879,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match) | |||
879 | "Error while parsing device node resource\n" ); | 879 | "Error while parsing device node resource\n" ); |
880 | return rv; | 880 | return rv; |
881 | } | 881 | } |
882 | if ((mem.end - mem.start + 1) != sizeof(struct mpc52xx_fec)) { | 882 | if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) { |
883 | printk(KERN_ERR DRIVER_NAME | 883 | printk(KERN_ERR DRIVER_NAME |
884 | " - invalid resource size (%lx != %x), check mpc52xx_devices.c\n", | 884 | " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n", |
885 | (unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec)); | 885 | (unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec)); |
886 | return -EINVAL; | 886 | return -EINVAL; |
887 | } | 887 | } |
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c index 366e62a2b1e5..0f306ddb5630 100644 --- a/drivers/net/myri10ge/myri10ge.c +++ b/drivers/net/myri10ge/myri10ge.c | |||
@@ -1151,7 +1151,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget) | |||
1151 | u16 length; | 1151 | u16 length; |
1152 | __wsum checksum; | 1152 | __wsum checksum; |
1153 | 1153 | ||
1154 | while (rx_done->entry[idx].length != 0 && work_done++ < budget) { | 1154 | while (rx_done->entry[idx].length != 0 && work_done < budget) { |
1155 | length = ntohs(rx_done->entry[idx].length); | 1155 | length = ntohs(rx_done->entry[idx].length); |
1156 | rx_done->entry[idx].length = 0; | 1156 | rx_done->entry[idx].length = 0; |
1157 | checksum = csum_unfold(rx_done->entry[idx].checksum); | 1157 | checksum = csum_unfold(rx_done->entry[idx].checksum); |
@@ -1167,6 +1167,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget) | |||
1167 | rx_bytes += rx_ok * (unsigned long)length; | 1167 | rx_bytes += rx_ok * (unsigned long)length; |
1168 | cnt++; | 1168 | cnt++; |
1169 | idx = cnt & (myri10ge_max_intr_slots - 1); | 1169 | idx = cnt & (myri10ge_max_intr_slots - 1); |
1170 | work_done++; | ||
1170 | } | 1171 | } |
1171 | rx_done->idx = idx; | 1172 | rx_done->idx = idx; |
1172 | rx_done->cnt = cnt; | 1173 | rx_done->cnt = cnt; |
@@ -1233,13 +1234,12 @@ static int myri10ge_poll(struct napi_struct *napi, int budget) | |||
1233 | struct myri10ge_priv *mgp = | 1234 | struct myri10ge_priv *mgp = |
1234 | container_of(napi, struct myri10ge_priv, napi); | 1235 | container_of(napi, struct myri10ge_priv, napi); |
1235 | struct net_device *netdev = mgp->dev; | 1236 | struct net_device *netdev = mgp->dev; |
1236 | struct myri10ge_rx_done *rx_done = &mgp->rx_done; | ||
1237 | int work_done; | 1237 | int work_done; |
1238 | 1238 | ||
1239 | /* process as many rx events as NAPI will allow */ | 1239 | /* process as many rx events as NAPI will allow */ |
1240 | work_done = myri10ge_clean_rx_done(mgp, budget); | 1240 | work_done = myri10ge_clean_rx_done(mgp, budget); |
1241 | 1241 | ||
1242 | if (rx_done->entry[rx_done->idx].length == 0 || !netif_running(netdev)) { | 1242 | if (work_done < budget || !netif_running(netdev)) { |
1243 | netif_rx_complete(netdev, napi); | 1243 | netif_rx_complete(netdev, napi); |
1244 | put_be32(htonl(3), mgp->irq_claim); | 1244 | put_be32(htonl(3), mgp->irq_claim); |
1245 | } | 1245 | } |