From: Leon Romanovsky <leon@kernel.org>
To: Chunhao Lin <hau@realtek.com>
Cc: hkallweit1@gmail.com, netdev@vger.kernel.org, nic_swsd@realtek.com
Subject: Re: [PATCH net-next v2] r8169: add rtl_disable_rxdvgate()
Date: Wed, 28 Sep 2022 19:56:16 +0300 [thread overview]
Message-ID: <YzR8sHxXsHoenMA7@unreal> (raw)
In-Reply-To: <20220928130317.3522-1-hau@realtek.com>
On Wed, Sep 28, 2022 at 09:03:17PM +0800, Chunhao Lin wrote:
> rtl_disable_rxdvgate() is used for disable RXDV_GATE. It is opposite function
> of rtl_enable_rxdvgate().
>
> Disable RXDV_GATE does not have to delay. So in this patch, also remove the
> delay after disale RXDV_GATE.
>
> v2:
> - update commit message.
Please put changelog after --- trailing.
Thanks
>
> Signed-off-by: Chunhao Lin <hau@realtek.com>
> ---
> drivers/net/ethernet/realtek/r8169_main.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
> index 9c21894d0518..956562797496 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -2443,6 +2443,11 @@ static void rtl_wait_txrx_fifo_empty(struct rtl8169_private *tp)
> }
> }
>
> +static void rtl_disable_rxdvgate(struct rtl8169_private *tp)
> +{
> + RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
> +}
> +
> static void rtl_enable_rxdvgate(struct rtl8169_private *tp)
> {
> RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN);
> @@ -2960,7 +2965,7 @@ static void rtl_hw_start_8168g(struct rtl8169_private *tp)
> rtl_reset_packet_filter(tp);
> rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011, 0x1d8f);
>
> - RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
> + rtl_disable_rxdvgate(tp);
>
> rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000);
> rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000);
> @@ -3198,7 +3203,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
>
> rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87);
>
> - RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
> + rtl_disable_rxdvgate(tp);
>
> rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000);
> rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000);
> @@ -3249,7 +3254,7 @@ static void rtl_hw_start_8168ep(struct rtl8169_private *tp)
>
> rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87);
>
> - RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
> + rtl_disable_rxdvgate(tp);
>
> rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000);
> rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000);
> @@ -3313,7 +3318,7 @@ static void rtl_hw_start_8117(struct rtl8169_private *tp)
>
> rtl_eri_write(tp, 0x5f0, ERIAR_MASK_0011, 0x4f87);
>
> - RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
> + rtl_disable_rxdvgate(tp);
>
> rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000);
> rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000);
> @@ -3557,8 +3562,7 @@ static void rtl_hw_start_8125_common(struct rtl8169_private *tp)
> else
> rtl8125a_config_eee_mac(tp);
>
> - RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN);
> - udelay(10);
> + rtl_disable_rxdvgate(tp);
> }
>
> static void rtl_hw_start_8125a_2(struct rtl8169_private *tp)
> --
> 2.25.1
>
prev parent reply other threads:[~2022-09-28 16:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-28 13:03 [PATCH net-next v2] r8169: add rtl_disable_rxdvgate() Chunhao Lin
2022-09-28 16:56 ` Leon Romanovsky [this message]
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=YzR8sHxXsHoenMA7@unreal \
--to=leon@kernel.org \
--cc=hau@realtek.com \
--cc=hkallweit1@gmail.com \
--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