提交 3ce4af1d 编写于 作者: L Linus Torvalds

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
...@@ -1883,9 +1883,7 @@ config FEC2 ...@@ -1883,9 +1883,7 @@ config FEC2
config FEC_MPC52xx config FEC_MPC52xx
tristate "MPC52xx FEC driver" tristate "MPC52xx FEC driver"
depends on PPC_MPC52xx depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC
select PPC_BESTCOMM
select PPC_BESTCOMM_FEC
select CRC32 select CRC32
select PHYLIB select PHYLIB
---help--- ---help---
......
...@@ -879,9 +879,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match) ...@@ -879,9 +879,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
"Error while parsing device node resource\n" ); "Error while parsing device node resource\n" );
return rv; return rv;
} }
if ((mem.end - mem.start + 1) != sizeof(struct mpc52xx_fec)) { if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) {
printk(KERN_ERR DRIVER_NAME printk(KERN_ERR DRIVER_NAME
" - invalid resource size (%lx != %x), check mpc52xx_devices.c\n", " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
(unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec)); (unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
return -EINVAL; return -EINVAL;
} }
......
...@@ -1151,7 +1151,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget) ...@@ -1151,7 +1151,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
u16 length; u16 length;
__wsum checksum; __wsum checksum;
while (rx_done->entry[idx].length != 0 && work_done++ < budget) { while (rx_done->entry[idx].length != 0 && work_done < budget) {
length = ntohs(rx_done->entry[idx].length); length = ntohs(rx_done->entry[idx].length);
rx_done->entry[idx].length = 0; rx_done->entry[idx].length = 0;
checksum = csum_unfold(rx_done->entry[idx].checksum); 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,6 +1167,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
rx_bytes += rx_ok * (unsigned long)length; rx_bytes += rx_ok * (unsigned long)length;
cnt++; cnt++;
idx = cnt & (myri10ge_max_intr_slots - 1); idx = cnt & (myri10ge_max_intr_slots - 1);
work_done++;
} }
rx_done->idx = idx; rx_done->idx = idx;
rx_done->cnt = cnt; rx_done->cnt = cnt;
...@@ -1233,13 +1234,12 @@ static int myri10ge_poll(struct napi_struct *napi, int budget) ...@@ -1233,13 +1234,12 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
struct myri10ge_priv *mgp = struct myri10ge_priv *mgp =
container_of(napi, struct myri10ge_priv, napi); container_of(napi, struct myri10ge_priv, napi);
struct net_device *netdev = mgp->dev; struct net_device *netdev = mgp->dev;
struct myri10ge_rx_done *rx_done = &mgp->rx_done;
int work_done; int work_done;
/* process as many rx events as NAPI will allow */ /* process as many rx events as NAPI will allow */
work_done = myri10ge_clean_rx_done(mgp, budget); work_done = myri10ge_clean_rx_done(mgp, budget);
if (rx_done->entry[rx_done->idx].length == 0 || !netif_running(netdev)) { if (work_done < budget || !netif_running(netdev)) {
netif_rx_complete(netdev, napi); netif_rx_complete(netdev, napi);
put_be32(htonl(3), mgp->irq_claim); put_be32(htonl(3), mgp->irq_claim);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册