Skip to content

Commit

Permalink
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
  [IRDA]: fix printk format
  [NETPOLL] netconsole: fix soft lockup when removing module
  [NETPOLL]: tx lock deadlock fix
  SCTP: lock_sock_nested in sctp_sock_migrate
  SCTP: Fix sctp_getsockopt_get_peer_addrs
  SCTP: update sctp_getsockopt helpers to allow oversized buffers
  • Loading branch information
Linus Torvalds committed Jun 30, 2007
2 parents fde937d + 5f02121 commit 2d408b4
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 51 deletions.
2 changes: 1 addition & 1 deletion drivers/net/irda/irport.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ static void irport_timeout(struct net_device *dev)
IRDA_DEBUG(0, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n",
__FUNCTION__, iir, lsr, iobase);

IRDA_DEBUG(0, "%s(), transmitting=%d, remain=%d, done=%d\n",
IRDA_DEBUG(0, "%s(), transmitting=%d, remain=%d, done=%td\n",
__FUNCTION__, self->transmitting, self->tx_buff.len,
self->tx_buff.data - self->tx_buff.head);

Expand Down
30 changes: 19 additions & 11 deletions net/core/netpoll.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ static void queue_process(struct work_struct *work)
netif_tx_unlock(dev);
local_irq_restore(flags);

schedule_delayed_work(&npinfo->tx_work, HZ/10);
if (atomic_read(&npinfo->refcnt))
schedule_delayed_work(&npinfo->tx_work, HZ/10);
return;
}
netif_tx_unlock(dev);
Expand Down Expand Up @@ -250,22 +251,23 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
unsigned long flags;

local_irq_save(flags);
if (netif_tx_trylock(dev)) {
/* try until next clock tick */
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
tries > 0; --tries) {
/* try until next clock tick */
for (tries = jiffies_to_usecs(1)/USEC_PER_POLL;
tries > 0; --tries) {
if (netif_tx_trylock(dev)) {
if (!netif_queue_stopped(dev))
status = dev->hard_start_xmit(skb, dev);
netif_tx_unlock(dev);

if (status == NETDEV_TX_OK)
break;

/* tickle device maybe there is some cleanup */
netpoll_poll(np);

udelay(USEC_PER_POLL);
}
netif_tx_unlock(dev);

/* tickle device maybe there is some cleanup */
netpoll_poll(np);

udelay(USEC_PER_POLL);
}
local_irq_restore(flags);
}
Expand Down Expand Up @@ -784,9 +786,15 @@ void netpoll_cleanup(struct netpoll *np)
if (atomic_dec_and_test(&npinfo->refcnt)) {
skb_queue_purge(&npinfo->arp_tx);
skb_queue_purge(&npinfo->txq);
cancel_rearming_delayed_work(&npinfo->tx_work);
cancel_delayed_work(&npinfo->tx_work);
flush_scheduled_work();

/* clean after last, unfinished work */
if (!skb_queue_empty(&npinfo->txq)) {
struct sk_buff *skb;
skb = __skb_dequeue(&npinfo->txq);
kfree_skb(skb);
}
kfree(npinfo);
}
}
Expand Down
Loading

0 comments on commit 2d408b4

Please sign in to comment.