2014-07-15 06:41:54

by Michel Dänzer

[permalink] [raw]
Subject: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

Without this, the ethernet port on my ASUS A88X Pro mainboard stops
working sometimes, with messages like these in dmesg:

AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0 domain=0x001e address=0x0000000000003000 flags=0x0050]
Signed-off-by: Michel Dänzer <[email protected]>
---
drivers/net/ethernet/realtek/r8169.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index be425ad..e577566 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4239,6 +4239,8 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);
break;
case RTL_GIGA_MAC_VER_40:
+ RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF);
+ break;
case RTL_GIGA_MAC_VER_41:
case RTL_GIGA_MAC_VER_42:
case RTL_GIGA_MAC_VER_43:
--
2.0.0


2014-07-15 09:30:04

by Hayes Wang

[permalink] [raw]
Subject: RE: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

Michel D?nzer [mailto:[email protected]]
> Sent: Tuesday, July 15, 2014 2:42 PM
> To: Francois Romieu; nic_swsd
> Cc: [email protected]; [email protected]
> Subject: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40
>
> Without this, the ethernet port on my ASUS A88X Pro mainboard stops
> working sometimes, with messages like these in dmesg:
>
> AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0
> domain=0x001e address=0x0000000000003000 flags=0x0050]

I search the information about your issue. It seems to be
relative to the IOMMU. I don't sure if your patch is the root
cause or a workaround.

Best Regards,
Hayes

2014-07-15 09:56:59

by Michel Dänzer

[permalink] [raw]
Subject: Re: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

On 15.07.2014 18:29, Hayes Wang wrote:
> Michel D?nzer [mailto:[email protected]]
>> Sent: Tuesday, July 15, 2014 2:42 PM
>> To: Francois Romieu; nic_swsd
>> Cc: [email protected]; [email protected]
>> Subject: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40
>>
>> Without this, the ethernet port on my ASUS A88X Pro mainboard stops
>> working sometimes, with messages like these in dmesg:
>>
>> AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0
>> domain=0x001e address=0x0000000000003000 flags=0x0050]
>
> I search the information about your issue. It seems to be
> relative to the IOMMU. I don't sure if your patch is the root
> cause or a workaround.

It's quite possibly just a workaround; I tried this based on previous
similar commits in this driver.


--
Earthling Michel D?nzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

2014-07-15 21:54:25

by Francois Romieu

[permalink] [raw]
Subject: Re: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

Hayes Wang <[email protected]> :
> Michel D?nzer [mailto:[email protected]]
[...]
> > Without this, the ethernet port on my ASUS A88X Pro mainboard stops
> > working sometimes, with messages like these in dmesg:
> >
> > AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0
> > domain=0x001e address=0x0000000000003000 flags=0x0050]
>
> I search the information about your issue. It seems to be
> relative to the IOMMU. I don't sure if your patch is the root
> cause or a workaround.

Btw, a few extra identifiers in rtl_init_rxcfg may improve consistency:

missing | included
-------------------------------+-------------------------------
RTL_GIGA_MAC_VER_36 (8168f) | RTL_GIGA_MAC_VER_35 (8168f)
RTL_GIGA_MAC_VER_38 (RTL8411) | RTL_GIGA_MAC_VER_44 (RTL8411)
RTL_GIGA_MAC_VER_39 (RTL8106e) | RTL_GIGA_MAC_VER_43 (RTL8106e)
RTL_GIGA_MAC_VER_37 (RTL8402) |

--
Ueimor

2014-07-16 22:25:20

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

From: Francois Romieu <[email protected]>
Date: Tue, 15 Jul 2014 23:54:12 +0200

> Hayes Wang <[email protected]> :
>> Michel D?nzer [mailto:[email protected]]
> [...]
>> > Without this, the ethernet port on my ASUS A88X Pro mainboard stops
>> > working sometimes, with messages like these in dmesg:
>> >
>> > AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0
>> > domain=0x001e address=0x0000000000003000 flags=0x0050]
>>
>> I search the information about your issue. It seems to be
>> relative to the IOMMU. I don't sure if your patch is the root
>> cause or a workaround.
>
> Btw, a few extra identifiers in rtl_init_rxcfg may improve consistency:
>
> missing | included
> -------------------------------+-------------------------------
> RTL_GIGA_MAC_VER_36 (8168f) | RTL_GIGA_MAC_VER_35 (8168f)
> RTL_GIGA_MAC_VER_38 (RTL8411) | RTL_GIGA_MAC_VER_44 (RTL8411)
> RTL_GIGA_MAC_VER_39 (RTL8106e) | RTL_GIGA_MAC_VER_43 (RTL8106e)
> RTL_GIGA_MAC_VER_37 (RTL8402) |

Michel please take Francois's feedback here into consideration and also
provide a more detailed commit message so other people reading the commit
can understand your reasoning for making this change, not just what the
result might be for making it.

2014-07-17 00:56:16

by Michel Dänzer

[permalink] [raw]
Subject: Re: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

On 17.07.2014 07:25, David Miller wrote:
> From: Francois Romieu <[email protected]>
> Date: Tue, 15 Jul 2014 23:54:12 +0200
>
>> Hayes Wang <[email protected]> :
>>> Michel D?nzer [mailto:[email protected]]
>> [...]
>>>> Without this, the ethernet port on my ASUS A88X Pro mainboard stops
>>>> working sometimes, with messages like these in dmesg:
>>>>
>>>> AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0
>>>> domain=0x001e address=0x0000000000003000 flags=0x0050]
>>>
>>> I search the information about your issue. It seems to be
>>> relative to the IOMMU. I don't sure if your patch is the root
>>> cause or a workaround.
>>
>> Btw, a few extra identifiers in rtl_init_rxcfg may improve consistency:
>>
>> missing | included
>> -------------------------------+-------------------------------
>> RTL_GIGA_MAC_VER_36 (8168f) | RTL_GIGA_MAC_VER_35 (8168f)
>> RTL_GIGA_MAC_VER_38 (RTL8411) | RTL_GIGA_MAC_VER_44 (RTL8411)
>> RTL_GIGA_MAC_VER_39 (RTL8106e) | RTL_GIGA_MAC_VER_43 (RTL8106e)
>> RTL_GIGA_MAC_VER_37 (RTL8402) |
>
> Michel please take Francois's feedback here into consideration and also
> provide a more detailed commit message so other people reading the commit
> can understand your reasoning for making this change, not just what the
> result might be for making it.

I'm afraid I can't do that. I don't really understand any of this stuff,
I just googled the IOMMU event message, found similar patches for other
chipsets, and adapted them for my mainboard until the problem stopped.


--
Earthling Michel D?nzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer

2014-07-17 03:29:52

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

From: Michel D?nzer <[email protected]>
Date: Thu, 17 Jul 2014 09:55:59 +0900

> On 17.07.2014 07:25, David Miller wrote:
>> From: Francois Romieu <[email protected]>
>> Date: Tue, 15 Jul 2014 23:54:12 +0200
>>
>>> Hayes Wang <[email protected]> :
>>>> Michel D?nzer [mailto:[email protected]]
>>> [...]
>>>>> Without this, the ethernet port on my ASUS A88X Pro mainboard stops
>>>>> working sometimes, with messages like these in dmesg:
>>>>>
>>>>> AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0
>>>>> domain=0x001e address=0x0000000000003000 flags=0x0050]
>>>>
>>>> I search the information about your issue. It seems to be
>>>> relative to the IOMMU. I don't sure if your patch is the root
>>>> cause or a workaround.
>>>
>>> Btw, a few extra identifiers in rtl_init_rxcfg may improve consistency:
>>>
>>> missing | included
>>> -------------------------------+-------------------------------
>>> RTL_GIGA_MAC_VER_36 (8168f) | RTL_GIGA_MAC_VER_35 (8168f)
>>> RTL_GIGA_MAC_VER_38 (RTL8411) | RTL_GIGA_MAC_VER_44 (RTL8411)
>>> RTL_GIGA_MAC_VER_39 (RTL8106e) | RTL_GIGA_MAC_VER_43 (RTL8106e)
>>> RTL_GIGA_MAC_VER_37 (RTL8402) |
>>
>> Michel please take Francois's feedback here into consideration and also
>> provide a more detailed commit message so other people reading the commit
>> can understand your reasoning for making this change, not just what the
>> result might be for making it.
>
> I'm afraid I can't do that. I don't really understand any of this stuff,
> I just googled the IOMMU event message, found similar patches for other
> chipsets, and adapted them for my mainboard until the problem stopped.

And if so, that's exactly what I want you to say in the commit message.

2014-07-17 03:55:52

by Michel Dänzer

[permalink] [raw]
Subject: [PATCH v2] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

The ethernet port on my ASUS A88X Pro mainboard stopped working
several times a day, with messages like these in dmesg:

AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0 domain=0x001e address=0x0000000000003000 flags=0x0050]

Searching the web for these messages led me to similar reports about
different hardware supported by r8169, and eventually to commits
3ced8c955e74d319f3e3997f7169c79d524dfd06 ('r8169: enforce RX_MULTI_EN
for the 8168f.') and eb2dc35d99028b698cdedba4f5522bc43e576bd2 ('r8169:
RxConfig hack for the 8168evl'). So I tried this change, and it fixes
the problem for me.

Signed-off-by: Michel Dänzer <[email protected]>
---

v2: Updated commit log, how about this?

drivers/net/ethernet/realtek/r8169.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 06bdc31..61623e9 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -4240,6 +4240,8 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST);
break;
case RTL_GIGA_MAC_VER_40:
+ RTL_W32(RxConfig, RX128_INT_EN | RX_MULTI_EN | RX_DMA_BURST | RX_EARLY_OFF);
+ break;
case RTL_GIGA_MAC_VER_41:
case RTL_GIGA_MAC_VER_42:
case RTL_GIGA_MAC_VER_43:
--
2.0.0

2014-07-17 05:24:18

by David Miller

[permalink] [raw]
Subject: Re: [PATCH v2] r8169: Enable RX_MULTI_EN for RTL_GIGA_MAC_VER_40

From: Michel D?nzer <[email protected]>
Date: Thu, 17 Jul 2014 12:55:40 +0900

> The ethernet port on my ASUS A88X Pro mainboard stopped working
> several times a day, with messages like these in dmesg:
>
> AMD-Vi: Event logged [IO_PAGE_FAULT device=05:00.0 domain=0x001e address=0x0000000000003000 flags=0x0050]
>
> Searching the web for these messages led me to similar reports about
> different hardware supported by r8169, and eventually to commits
> 3ced8c955e74d319f3e3997f7169c79d524dfd06 ('r8169: enforce RX_MULTI_EN
> for the 8168f.') and eb2dc35d99028b698cdedba4f5522bc43e576bd2 ('r8169:
> RxConfig hack for the 8168evl'). So I tried this change, and it fixes
> the problem for me.
>
> Signed-off-by: Michel D?nzer <[email protected]>
> ---
>
> v2: Updated commit log, how about this?

Works for me, applied, thanks.