mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
r8169: fix DMA being used after buffer free if WoL is enabled
commitf658b90977
upstream. IOMMU errors have been reported if WoL is enabled and interface is brought down. It turned out that the network chip triggers DMA transfers after the DMA buffers have been freed. For WoL to work we need to leave rx enabled, therefore simply stop the chip from being a DMA busmaster. Fixes:567ca57faa
("r8169: add rtl8169_up") Tested-by: Paul Blazejowski <paulb@blazebox.homeip.net> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8dc08a2962
commit
d3b5a04b8c
1 changed files with 4 additions and 2 deletions
|
@ -4726,6 +4726,9 @@ static void rtl8169_down(struct rtl8169_private *tp)
|
|||
|
||||
rtl8169_update_counters(tp);
|
||||
|
||||
pci_clear_master(tp->pci_dev);
|
||||
rtl_pci_commit(tp);
|
||||
|
||||
rtl8169_cleanup(tp, true);
|
||||
|
||||
rtl_pll_power_down(tp);
|
||||
|
@ -4733,6 +4736,7 @@ static void rtl8169_down(struct rtl8169_private *tp)
|
|||
|
||||
static void rtl8169_up(struct rtl8169_private *tp)
|
||||
{
|
||||
pci_set_master(tp->pci_dev);
|
||||
rtl_pll_power_up(tp);
|
||||
rtl8169_init_phy(tp);
|
||||
napi_enable(&tp->napi);
|
||||
|
@ -5394,8 +5398,6 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
|
||||
rtl_hw_reset(tp);
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
rc = rtl_alloc_irq(tp);
|
||||
if (rc < 0) {
|
||||
dev_err(&pdev->dev, "Can't allocate interrupt\n");
|
||||
|
|
Loading…
Reference in a new issue