Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215397
b: refs/heads/master
c: 323bb68
h: refs/heads/master
i:
  215395: 80b72c2
v: v3
  • Loading branch information
Stanislaw Gruszka authored and David S. Miller committed Oct 21, 2010
1 parent 9c2c726 commit 551c8f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 42 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: cac4b22f3d6a2601d896e9ae5147d173342c66f8
refs/heads/master: 323bb6857533d7132e1d4fd9cc8edc599a06f5e6
47 changes: 6 additions & 41 deletions trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -3908,31 +3908,11 @@ static void rtl_hw_start_8101(struct net_device *dev)

static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
{
struct rtl8169_private *tp = netdev_priv(dev);
int ret = 0;

if (new_mtu < ETH_ZLEN || new_mtu > SafeMtu)
return -EINVAL;

dev->mtu = new_mtu;

if (!netif_running(dev))
goto out;

rtl8169_down(dev);

ret = rtl8169_init_ring(dev);
if (ret < 0)
goto out;

napi_enable(&tp->napi);

rtl_hw_start(dev);

rtl8169_request_timer(dev);

out:
return ret;
return 0;
}

static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
Expand Down Expand Up @@ -4684,19 +4664,21 @@ static void rtl8169_down(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
void __iomem *ioaddr = tp->mmio_addr;
unsigned int intrmask;

rtl8169_delete_timer(dev);

netif_stop_queue(dev);

napi_disable(&tp->napi);

core_down:
spin_lock_irq(&tp->lock);

rtl8169_asic_down(ioaddr);

/*
* At this point device interrupts can not be enabled in any function,
* as netif_running is not true (rtl8169_interrupt, rtl8169_reset_task,
* rtl8169_reinit_task) and napi is disabled (rtl8169_poll).
*/
rtl8169_rx_missed(dev, ioaddr);

spin_unlock_irq(&tp->lock);
Expand All @@ -4706,23 +4688,6 @@ static void rtl8169_down(struct net_device *dev)
/* Give a racing hard_start_xmit a few cycles to complete. */
synchronize_sched(); /* FIXME: should this be synchronize_irq()? */

/*
* And now for the 50k$ question: are IRQ disabled or not ?
*
* Two paths lead here:
* 1) dev->close
* -> netif_running() is available to sync the current code and the
* IRQ handler. See rtl8169_interrupt for details.
* 2) dev->change_mtu
* -> rtl8169_poll can not be issued again and re-enable the
* interruptions. Let's simply issue the IRQ down sequence again.
*
* No loop if hotpluged or major error (0xffff).
*/
intrmask = RTL_R16(IntrMask);
if (intrmask && (intrmask != 0xffff))
goto core_down;

rtl8169_tx_clear(tp);

rtl8169_rx_clear(tp);
Expand Down

0 comments on commit 551c8f9

Please sign in to comment.