Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145280
b: refs/heads/master
c: e069c0c
h: refs/heads/master
v: v3
  • Loading branch information
Inaky Perez-Gonzalez committed May 22, 2009
1 parent c6cdc61 commit 295e7f1
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 101 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f11a377b3f4e897d11f0e8d1fc688667e2f19708
refs/heads/master: e069c0cf7c169ae5a8bfdc8d083a5d66fbef73d8
2 changes: 1 addition & 1 deletion trunk/drivers/isdn/gigaset/isocdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ int gigaset_isowbuf_getbytes(struct isowbuf_t *iwb, int size)
return -EINVAL;
}
src = iwb->read;
if (unlikely(limit >= BAS_OUTBUFSIZE + BAS_OUTBUFPAD ||
if (unlikely(limit > BAS_OUTBUFSIZE + BAS_OUTBUFPAD ||
(read < src && limit >= src))) {
pr_err("isoc write buffer frame reservation violated\n");
return -EFAULT;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ obj-$(CONFIG_HAMACHI) += hamachi.o
obj-$(CONFIG_NET) += Space.o loopback.o
obj-$(CONFIG_SEEQ8005) += seeq8005.o
obj-$(CONFIG_NET_SB1000) += sb1000.o
obj-$(CONFIG_MAC8390) += mac8390.o
obj-$(CONFIG_MAC8390) += mac8390.o 8390.o
obj-$(CONFIG_APNE) += apne.o 8390.o
obj-$(CONFIG_PCMCIA_PCNET) += 8390.o
obj-$(CONFIG_HP100) += hp100.o
Expand Down
11 changes: 1 addition & 10 deletions trunk/drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1885,17 +1885,8 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)

if (unlikely(!newskb))
newskb = skb;
else if (skb) {
/*
* We need to reset ->data to what it
* was before gfar_new_skb() re-aligned
* it to an RXBUF_ALIGNMENT boundary
* before we put the skb back on the
* recycle list.
*/
skb->data = skb->head + NET_SKB_PAD;
else if (skb)
__skb_queue_head(&priv->rx_recycle, skb);
}
} else {
/* Increment the number of packets */
dev->stats.rx_packets++;
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/net/mac8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ struct net_device * __init mac8390_probe(int unit)
if (!MACH_IS_MAC)
return ERR_PTR(-ENODEV);

dev = ____alloc_ei_netdev(0);
dev = alloc_ei_netdev();
if (!dev)
return ERR_PTR(-ENOMEM);

Expand Down Expand Up @@ -481,10 +481,10 @@ void cleanup_module(void)
static const struct net_device_ops mac8390_netdev_ops = {
.ndo_open = mac8390_open,
.ndo_stop = mac8390_close,
.ndo_start_xmit = __ei_start_xmit,
.ndo_tx_timeout = __ei_tx_timeout,
.ndo_get_stats = __ei_get_stats,
.ndo_set_multicast_list = __ei_set_multicast_list,
.ndo_start_xmit = ei_start_xmit,
.ndo_tx_timeout = ei_tx_timeout,
.ndo_get_stats = ei_get_stats,
.ndo_set_multicast_list = ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
Expand Down
102 changes: 45 additions & 57 deletions trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -3554,64 +3554,54 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
int handled = 0;
int status;

/* loop handling interrupts until we have no new ones or
* we hit a invalid/hotplug case.
*/
status = RTL_R16(IntrStatus);
while (status && status != 0xffff) {
handled = 1;

/* Handle all of the error cases first. These will reset
* the chip, so just exit the loop.
*/
if (unlikely(!netif_running(dev))) {
rtl8169_asic_down(ioaddr);
break;
}
/* hotplug/major error/no more work/shared irq */
if ((status == 0xffff) || !status)
goto out;

/* Work around for rx fifo overflow */
if (unlikely(status & RxFIFOOver) &&
(tp->mac_version == RTL_GIGA_MAC_VER_11)) {
netif_stop_queue(dev);
rtl8169_tx_timeout(dev);
break;
}
handled = 1;

if (unlikely(status & SYSErr)) {
rtl8169_pcierr_interrupt(dev);
break;
}
if (unlikely(!netif_running(dev))) {
rtl8169_asic_down(ioaddr);
goto out;
}

if (status & LinkChg)
rtl8169_check_link_status(dev, tp, ioaddr);
status &= tp->intr_mask;
RTL_W16(IntrStatus,
(status & RxFIFOOver) ? (status | RxOverflow) : status);

/* We need to see the lastest version of tp->intr_mask to
* avoid ignoring an MSI interrupt and having to wait for
* another event which may never come.
*/
smp_rmb();
if (status & tp->intr_mask & tp->napi_event) {
RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
tp->intr_mask = ~tp->napi_event;

if (likely(napi_schedule_prep(&tp->napi)))
__napi_schedule(&tp->napi);
else if (netif_msg_intr(tp)) {
printk(KERN_INFO "%s: interrupt %04x in poll\n",
dev->name, status);
}
}
if (!(status & tp->intr_event))
goto out;

/* We only get a new MSI interrupt when all active irq
* sources on the chip have been acknowledged. So, ack
* everything we've seen and check if new sources have become
* active to avoid blocking all interrupts from the chip.
*/
RTL_W16(IntrStatus,
(status & RxFIFOOver) ? (status | RxOverflow) : status);
status = RTL_R16(IntrStatus);
/* Work around for rx fifo overflow */
if (unlikely(status & RxFIFOOver) &&
(tp->mac_version == RTL_GIGA_MAC_VER_11)) {
netif_stop_queue(dev);
rtl8169_tx_timeout(dev);
goto out;
}

if (unlikely(status & SYSErr)) {
rtl8169_pcierr_interrupt(dev);
goto out;
}

if (status & LinkChg)
rtl8169_check_link_status(dev, tp, ioaddr);

if (status & tp->napi_event) {
RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
tp->intr_mask = ~tp->napi_event;

if (likely(napi_schedule_prep(&tp->napi)))
__napi_schedule(&tp->napi);
else if (netif_msg_intr(tp)) {
printk(KERN_INFO "%s: interrupt %04x in poll\n",
dev->name, status);
}
}
out:
return IRQ_RETVAL(handled);
}

Expand All @@ -3627,15 +3617,13 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)

if (work_done < budget) {
napi_complete(napi);

/* We need for force the visibility of tp->intr_mask
* for other CPUs, as we can loose an MSI interrupt
* and potentially wait for a retransmit timeout if we don't.
* The posted write to IntrMask is safe, as it will
* eventually make it to the chip and we won't loose anything
* until it does.
*/
tp->intr_mask = 0xffff;
/*
* 20040426: the barrier is not strictly required but the
* behavior of the irq handler could be less predictable
* without it. Btw, the lack of flush for the posted pci
* write is safe - FR
*/
smp_wmb();
RTL_W16(IntrMask, tp->intr_event);
}
Expand Down
35 changes: 30 additions & 5 deletions trunk/drivers/net/wimax/i2400m/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,27 +505,52 @@ int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
#ifdef CONFIG_PM
struct usb_device *usb_dev = i2400mu->usb_dev;
#endif
unsigned is_autosuspend = 0;
struct i2400m *i2400m = &i2400mu->i2400m;

#ifdef CONFIG_PM
if (usb_dev->auto_pm > 0)
is_autosuspend = 1;
#endif

d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event);
if (i2400m->updown == 0)
goto no_firmware;
d_printf(1, dev, "fw up, requesting standby\n");
if (i2400m->state == I2400M_SS_DATA_PATH_CONNECTED && is_autosuspend) {
/* ugh -- the device is connected and this suspend
* request is an autosuspend one (not a system standby
* / hibernate).
*
* The only way the device can go to standby is if the
* link with the base station is in IDLE mode; that
* were the case, we'd be in status
* I2400M_SS_CONNECTED_IDLE. But we are not.
*
* If we *tell* him to go power save now, it'll reset
* as a precautionary measure, so if this is an
* autosuspend thing, say no and it'll come back
* later, when the link is IDLE
*/
result = -EBADF;
d_printf(1, dev, "fw up, link up, not-idle, autosuspend: "
"not entering powersave\n");
goto error_not_now;
}
d_printf(1, dev, "fw up: entering powersave\n");
atomic_dec(&i2400mu->do_autopm);
result = i2400m_cmd_enter_powersave(i2400m);
atomic_inc(&i2400mu->do_autopm);
#ifdef CONFIG_PM
if (result < 0 && usb_dev->auto_pm == 0) {
if (result < 0 && !is_autosuspend) {
/* System suspend, can't fail */
dev_err(dev, "failed to suspend, will reset on resume\n");
result = 0;
}
#endif
if (result < 0)
goto error_enter_powersave;
i2400mu_notification_release(i2400mu);
d_printf(1, dev, "fw up, got standby\n");
d_printf(1, dev, "powersave requested\n");
error_enter_powersave:
error_not_now:
no_firmware:
d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n",
iface, pm_msg.event, result);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2447,7 +2447,7 @@ static inline void free_SAs(struct pktgen_dev *pkt_dev)
if (pkt_dev->cflows) {
/* let go of the SAs if we have them */
int i = 0;
for (; i < pkt_dev->cflows; i++) {
for (; i < pkt_dev->nflows; i++){
struct xfrm_state *x = pkt_dev->flows[i].x;
if (x) {
xfrm_state_put(x);
Expand Down
6 changes: 1 addition & 5 deletions trunk/net/ipv4/fib_trie.c
Original file line number Diff line number Diff line change
Expand Up @@ -986,12 +986,9 @@ fib_find_node(struct trie *t, u32 key)
static struct node *trie_rebalance(struct trie *t, struct tnode *tn)
{
int wasfull;
t_key cindex, key;
t_key cindex, key = tn->key;
struct tnode *tp;

preempt_disable();
key = tn->key;

while (tn != NULL && (tp = node_parent((struct node *)tn)) != NULL) {
cindex = tkey_extract_bits(key, tp->pos, tp->bits);
wasfull = tnode_full(tp, tnode_get_child(tp, cindex));
Expand All @@ -1010,7 +1007,6 @@ static struct node *trie_rebalance(struct trie *t, struct tnode *tn)
if (IS_TNODE(tn))
tn = (struct tnode *)resize(t, (struct tnode *)tn);

preempt_enable();
return (struct node *)tn;
}

Expand Down
11 changes: 2 additions & 9 deletions trunk/net/ipv4/tcp_vegas.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,6 @@ void tcp_vegas_cwnd_event(struct sock *sk, enum tcp_ca_event event)
}
EXPORT_SYMBOL_GPL(tcp_vegas_cwnd_event);

static inline u32 tcp_vegas_ssthresh(struct tcp_sock *tp)
{
return min(tp->snd_ssthresh, tp->snd_cwnd-1);
}

static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
{
struct tcp_sock *tp = tcp_sk(sk);
Expand Down Expand Up @@ -226,10 +221,11 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
*/
diff = tp->snd_cwnd * (rtt-vegas->baseRTT) / vegas->baseRTT;

if (diff > gamma && tp->snd_cwnd <= tp->snd_ssthresh) {
if (diff > gamma && tp->snd_ssthresh > 2 ) {
/* Going too fast. Time to slow down
* and switch to congestion avoidance.
*/
tp->snd_ssthresh = 2;

/* Set cwnd to match the actual rate
* exactly:
Expand All @@ -239,7 +235,6 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
* utilization.
*/
tp->snd_cwnd = min(tp->snd_cwnd, (u32)target_cwnd+1);
tp->snd_ssthresh = tcp_vegas_ssthresh(tp);

} else if (tp->snd_cwnd <= tp->snd_ssthresh) {
/* Slow start. */
Expand All @@ -255,8 +250,6 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack, u32 in_flight)
* we slow down.
*/
tp->snd_cwnd--;
tp->snd_ssthresh
= tcp_vegas_ssthresh(tp);
} else if (diff < alpha) {
/* We don't have enough extra packets
* in the network, so speed up.
Expand Down
12 changes: 6 additions & 6 deletions trunk/net/rxrpc/ar-connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ static int rxrpc_connect_exclusive(struct rxrpc_sock *rx,
/* not yet present - create a candidate for a new connection
* and then redo the check */
conn = rxrpc_alloc_connection(gfp);
if (!conn) {
_leave(" = -ENOMEM");
return -ENOMEM;
if (IS_ERR(conn)) {
_leave(" = %ld", PTR_ERR(conn));
return PTR_ERR(conn);
}

conn->trans = trans;
Expand Down Expand Up @@ -508,9 +508,9 @@ int rxrpc_connect_call(struct rxrpc_sock *rx,
/* not yet present - create a candidate for a new connection and then
* redo the check */
candidate = rxrpc_alloc_connection(gfp);
if (!candidate) {
_leave(" = -ENOMEM");
return -ENOMEM;
if (IS_ERR(candidate)) {
_leave(" = %ld", PTR_ERR(candidate));
return PTR_ERR(candidate);
}

candidate->trans = trans;
Expand Down

0 comments on commit 295e7f1

Please sign in to comment.