From: Ceriel Jacobs <linux-ide@crashplan.pro>
To: Francois Romieu <romieu@fr.zoreil.com>,
Hayes Wang <hayeswang@realtek.com>
Cc: nic_swsd <nic_swsd@realtek.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: r8168 is needed to enter P-state: Package State 6 (pc6)onHaswell hardware: does the patch below against current kernel make a difference?
Date: Wed, 08 Oct 2014 22:29:16 +0200 [thread overview]
Message-ID: <54359E9C.7060704@crashplan.pro> (raw)
In-Reply-To: <20141006221307.GB10936@electric-eye.fr.zoreil.com>
Sorry for the delay. As newbie I first needed to learn about depmod to
restore loading the r8169 module instead of r8168.
Now, I am struggling with applying the patch. Even with fuzz 99 applying
this patch fails for hunk #2:
~/linux-3.13.0# patch -Np1 -F99 -r - --dry-run <<'END'
> index 0921302..b4a3881 100644
...
> rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
> END
checking file drivers/net/ethernet/realtek/r8169.c
Hunk #1 succeeded at 468 with fuzz 3.
Hunk #2 FAILED at 5280.
1 out of 2 hunks FAILED
~/linux-3.13.0# grep -nA8 'rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011,
0x1d8f, ERIAR_EXGMAC)' drivers/net/ethernet/realtek/r8169.c
5274: rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011, 0x1d8f, ERIAR_EXGMAC);
5275-
5276- RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
5277- RTL_W32(MISC, RTL_R32(MISC) & ~RXDV_GATED_EN);
5278- RTL_W8(MaxTxPacketSize, EarlySize);
5279-
5280- rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
5281- rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
5282-
# ls -l $(locate drivers/net/ethernet/realtek/r8169.c)
-rw-r--r-- 1 root root 177933 Aug 12 23:42
/home/user/src/linux-3.13.0/drivers/net/ethernet/realtek/r8169.c
-rw-r--r-- 1 root root 177933 Aug 24 22:41
/root/linux-3.13.0/drivers/net/ethernet/realtek/r8169.c
# md5sum /root/linux-3.13.0/drivers/net/ethernet/realtek/r8169.c
95056b56932b375f8b65a6379009f704
/root/linux-3.13.0/drivers/net/ethernet/realtek/r8169.c
Francois, could you help me apply your patch?
Francois Romieu schreef op 07-10-14 om 00:13:
> Hayes Wang <hayeswang@realtek.com> :
>> Francois Romieu [mailto:romieu@fr.zoreil.com]
> [...]
>> I don't sure if the following information is helpful. Besides, I remember
>> the rtl_init_one() would disable it.
>>
>> http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=d64ec841517a25f6d468bde9f67e5b4cffdc67c7
>>
>> http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=4521e1a94279ce610d3f9b7945c17d581f804242
>
> Yes, I did not expect this stuff to stay in geostationary orbit for long :o/
>
> Realtek's r8168 driver defaults to CONFIG_ASPM=1 but I guess some users
> need to disable it and there's no known pattern / blacklist, right ?
>
> Ceriel, does the patch below against current kernel make a difference ?
>
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index 0921302..b4a3881 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -468,6 +468,7 @@ enum rtl8168_registers {
> #define PWM_EN (1 << 22)
> #define RXDV_GATED_EN (1 << 19)
> #define EARLY_TALLY_EN (1 << 16)
> +#define FORCE_CLK (1 << 15) /* force clock request */
> };
>
> enum rtl_register_content {
> @@ -5279,8 +5280,10 @@ static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
> rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011, 0x1d8f, ERIAR_EXGMAC);
>
> RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
> - RTL_W32(MISC, RTL_R32(MISC) & ~RXDV_GATED_EN);
> + RTL_W32(MISC, (RTL_R32(MISC) | FORCE_CLK) & ~RXDV_GATED_EN);
> RTL_W8(MaxTxPacketSize, EarlySize);
> + RTL_W8(Config5, RTL_R8(Config5) | ASPM_en);
> + RTL_W8(Config2, RTL_R8(Config2) | ClkReqEn);
>
> rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
> rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000, ERIAR_EXGMAC);
>
next prev parent reply other threads:[~2014-10-08 20:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-30 23:09 r8168 is needed to enter P-state: Package State 6 (pc6) on Haswell hardware Ceriel Jacobs
2014-10-05 16:59 ` Francois Romieu
2014-10-05 22:22 ` Ceriel Jacobs
2014-10-06 3:06 ` r8168 is needed to enter P-state: Package State 6 (pc6)onHaswell hardware Hayes Wang
2014-10-06 22:13 ` Francois Romieu
2014-10-07 2:50 ` r8168 is needed to enter P-state: Package State 6(pc6)onHaswellhardware Hayes Wang
2014-10-07 20:17 ` Francois Romieu
2014-10-08 2:35 ` r8168 is needed to enter P-state: Package State6(pc6)onHaswellhardware Hayes Wang
2014-10-08 11:40 ` Ceriel Jacobs
2014-10-07 10:40 ` r8168 is needed to enter P-state: Package State 6 (pc6)onHaswell hardware Ceriel Jacobs
2014-10-07 20:16 ` Francois Romieu
2014-10-08 20:29 ` Ceriel Jacobs [this message]
2014-10-08 22:17 ` r8168 is needed to enter P-state: Package State 6 (pc6)onHaswell hardware: does the patch below against current kernel make a difference? Francois Romieu
2014-10-08 22:46 ` Ceriel Jacobs
2014-10-08 23:26 ` Francois Romieu
2014-10-09 12:02 ` Ceriel Jacobs
2014-10-09 22:14 ` Francois Romieu
2014-10-10 11:09 ` r8168 is needed to enter P-state: Package State 6 (pc6)onHaswell hardware: does the patch below against current kernel make a difference? Yes, it does Ceriel Jacobs
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=54359E9C.7060704@crashplan.pro \
--to=linux-ide@crashplan.pro \
--cc=hayeswang@realtek.com \
--cc=netdev@vger.kernel.org \
--cc=nic_swsd@realtek.com \
--cc=romieu@fr.zoreil.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).