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
This commit is contained in:
commit
3ce4af1def
@ -1883,9 +1883,7 @@ config FEC2
|
||||
|
||||
config FEC_MPC52xx
|
||||
tristate "MPC52xx FEC driver"
|
||||
depends on PPC_MPC52xx
|
||||
select PPC_BESTCOMM
|
||||
select PPC_BESTCOMM_FEC
|
||||
depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC
|
||||
select CRC32
|
||||
select PHYLIB
|
||||
---help---
|
||||
|
@ -879,9 +879,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
|
||||
"Error while parsing device node resource\n" );
|
||||
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
|
||||
" - 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));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -1151,7 +1151,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
|
||||
u16 length;
|
||||
__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);
|
||||
rx_done->entry[idx].length = 0;
|
||||
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)
|
||||
rx_bytes += rx_ok * (unsigned long)length;
|
||||
cnt++;
|
||||
idx = cnt & (myri10ge_max_intr_slots - 1);
|
||||
work_done++;
|
||||
}
|
||||
rx_done->idx = idx;
|
||||
rx_done->cnt = cnt;
|
||||
@ -1233,13 +1234,12 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
|
||||
struct myri10ge_priv *mgp =
|
||||
container_of(napi, struct myri10ge_priv, napi);
|
||||
struct net_device *netdev = mgp->dev;
|
||||
struct myri10ge_rx_done *rx_done = &mgp->rx_done;
|
||||
int work_done;
|
||||
|
||||
/* process as many rx events as NAPI will allow */
|
||||
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);
|
||||
put_be32(htonl(3), mgp->irq_claim);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user