netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hau <hau@realtek.com>
To: Heiner Kallweit <hkallweit1@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	nic_swsd <nic_swsd@realtek.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"grundler@chromium.org" <grundler@chromium.org>
Subject: RE: [PATCH net] r8169: fix rtl8125b dmar pte write access not set error
Date: Thu, 6 Oct 2022 14:23:08 +0000	[thread overview]
Message-ID: <06d5b5ab8833445691a26e238235f9a0@realtek.com> (raw)
In-Reply-To: <4d5fe96b-26ef-a9c8-f385-a3428d5562f5@gmail.com>

> 
> I think the following simple change should also fix the issue.
> DMA is enabled only after the chip has been reset in rtl_reset_work().
> This should ensure that there are no stale RX DMA descriptors any longer.
> Could you please test it?
> 
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c
> b/drivers/net/ethernet/realtek/r8169_main.c
> index 114f88497..1d72691a4 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -4610,13 +4610,13 @@ static void rtl8169_down(struct rtl8169_private
> *tp)
> 
>  static void rtl8169_up(struct rtl8169_private *tp)  {
> -	pci_set_master(tp->pci_dev);
>  	phy_init_hw(tp->phydev);
>  	phy_resume(tp->phydev);
>  	rtl8169_init_phy(tp);
>  	napi_enable(&tp->napi);
>  	set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
>  	rtl_reset_work(tp);
> +	pci_set_master(tp->pci_dev);
> 
>  	phy_start(tp->phydev);
>  }
> --
> 2.38.0
> 
This can fix the issue. But it will cause another error message " rtl_rxtx_empty_cond == 0 (loop: 42, delay: 100)".
Because if rx is enabled, packet will be move to fifo. When driver check if fifo is empty on device open,
hardware will not dma this packet because bus master is disabled, fifo will always not empty.
 So it might be better to disable txrx when close device.

------Please consider the environment before printing this e-mail.

  reply	other threads:[~2022-10-06 14:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04  8:10 [PATCH net] r8169: fix rtl8125b dmar pte write access not set error Chunhao Lin
2022-10-04 20:14 ` Heiner Kallweit
2022-10-05  5:44   ` Hau
2022-10-05 16:29 ` Heiner Kallweit
2022-10-06 14:23   ` Hau [this message]
2022-10-08 21:53 ` Heiner Kallweit
2022-10-09  7:45 ` Heiner Kallweit
2022-10-12  7:59   ` Hau
2022-10-12 19:33     ` Heiner Kallweit
2022-10-13  6:04       ` Hau
2022-10-15  8:18         ` Heiner Kallweit
2022-10-17 17:23           ` Hau
2022-10-17 19:38             ` Heiner Kallweit
2022-10-20 18:01               ` Hau
2022-10-24 18:02               ` Hau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06d5b5ab8833445691a26e238235f9a0@realtek.com \
    --to=hau@realtek.com \
    --cc=grundler@chromium.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).