r8169: Keep writting on ChipCmd reg. close
PATCH 1/1 r8169: Keep writting on ChipCmd reg. close
Keep writting on ChipCmd register close and execute before
writting on any decriptors.On close the interface same rule.
Signed-off-by Corcodel Marian <[email protected]>
drivers/net/ethernet/realtek/r8169.c +7 -2
@@ -6616,7 +6616,7 @@ static void rtl_hw_start_8101(struct net_device *dev)RTL_W16 (IntrMitigate,0x0000 ); -RTL_W8 (ChipCmd, CmdTxEnb | CmdRxEnb); +//RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); rtl_set_rx_mode (dev);
@@ -7563,7 +7563,7 @@ static void rtl8169_down(struct net_device *dev)napi_disable (&tp->napi);netif_stop_queue (dev); -rtl8169_hw_reset (tp); +//rtl8169_hw_reset(tp); /* * At this point device interrupts can not be enabled in any function, * as netif_running is not true (rtl8169_interrupt, rtl8169_reset_task)
@@ -7585,12 +7585,15 @@ static int rtl8169_close(struct net_device *dev) {struct rtl8169_private *tp =netdev_priv (dev);struct pci_dev *pdev = tp->pci_dev; +void __iomem *ioaddr = tp->mmio_addr;pm_runtime_get_sync (&pdev->dev);/* Update counters before going down */ rtl8169_update_counters (dev);rtl8169_irq_mask_and_ack (tp); +rtl_hw_reset (tp); +RTL_W8 (ChipCmd, ~(CmdTxEnb | CmdRxEnb));rtl_lock_work (tp);clear_bit (RTL_FLAG_TASK_ENABLED , tp->wk.flags);
@@ -7646,6 +7649,8 @@ static int rtl_open(struct net_device *dev)if (!tp->RxDescArray) goto err_free_tx_0; +rtl_hw_reset (tp); +RTL_W8 (ChipCmd, CmdTxEnb | CmdRxEnb);rtl8169_set_feat_part2 (dev, dev->features); retval =rtl8169_init_ring (dev);if (retval <0 )
Signature · 1 line
2.1.4