For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Signed-off-by: Koba Ko <redacted>
---
drivers/net/ethernet/realtek/r8169.h | 2 +
drivers/net/ethernet/realtek/r8169_main.c | 112 ++++++++++++++++++----
2 files changed, 98 insertions(+), 16 deletions(-)
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
@@ -5436,6 +5513,9 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) if (pci_dev_run_wake(pdev)) pm_runtime_put_sync(&pdev->dev);+ if (rtl_link_chng_polling_quirk(tp))+ rtl8169_request_link_timer(dev);+ return 0; }
All this isn't needed. If you want to switch to link status polling,
why don't you simply let phylib do it? PHY_MAC_INTERRUPT -> PHY_POLL
Your timer-based code most likely would have problems if runtime pm
is enabled. Then you try to read the link status whilst NIC is in
D3hot.
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
Then runtime pm doesn't seem to be set to "auto". Else 10s after link loss
the chip runtime-suspends and is set to D3hot.
quoted
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
At least your Bugzilla report refers to VER_39. PCI device id 0x8136 is shared
by all fast ethernet chip versions.
Do you know other affected chip versions apart from VER_39 ?
In the Bugzilla report you also write the issue occurs with GBit-capable
link partners. This sounds more like an aneg problem.
The issue doesn't occur with fast ethernet link partners?
Your bug report also includes a patch that disables L1_1 only.
Not sure how this is related because the chip version we speak about
here doesn't support L1 sub-states.
quoted
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
quoted
So what you're saying is that mainline is fine and your problem is with
a downstream kernel with re-enabled ASPM? So there's nothing broken in
mainline? In mainline you have the option to re-enable ASPM states
individually via sysfs (link subdir at pci device).
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
On Fri, Jun 4, 2021 at 4:23 PM Heiner Kallweit [off-list ref] wrote:
On 04.06.2021 09:22, Koba Ko wrote:
quoted
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
Then runtime pm doesn't seem to be set to "auto". Else 10s after link loss
the chip runtime-suspends and is set to D3hot.
I will check this.
quoted
quoted
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
At least your Bugzilla report refers to VER_39. PCI device id 0x8136 is shared
by all fast ethernet chip versions.
Do you know other affected chip versions apart from VER_39 ?
In the Bugzilla report you also write the issue occurs with GBit-capable
link partners. This sounds more like an aneg problem.
The issue doesn't occur with fast ethernet link partners?
Issue wouldn't be observed when the link-partner has only FE capability.
Your bug report also includes a patch that disables L1_1 only.
Not sure how this is related because the chip version we speak about
here doesn't support L1 sub-states.
I have tried to enable L0s, L1 and don't disable L1 substate,
but still get the issue that interrupt can't be fired immediately but
the Link status is up.
quoted
quoted
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
quoted
So what you're saying is that mainline is fine and your problem is with
a downstream kernel with re-enabled ASPM? So there's nothing broken in
mainline? In mainline you have the option to re-enable ASPM states
individually via sysfs (link subdir at pci device).
If enable L1_1 on the mainline, the issue could be observed too.
Thanks
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
On Fri, Jun 4, 2021 at 4:23 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 04.06.2021 09:22, Koba Ko wrote:
quoted
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
Then runtime pm doesn't seem to be set to "auto". Else 10s after link loss
the chip runtime-suspends and is set to D3hot.
I will check this.
quoted
quoted
quoted
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
At least your Bugzilla report refers to VER_39. PCI device id 0x8136 is shared
by all fast ethernet chip versions.
Do you know other affected chip versions apart from VER_39 ?
In the Bugzilla report you also write the issue occurs with GBit-capable
link partners. This sounds more like an aneg problem.
The issue doesn't occur with fast ethernet link partners?
Issue wouldn't be observed when the link-partner has only FE capability.
Weird. I still have no clue how FE vs. GE support at link partner and
ASPM could be related. I could understand that the PHY might have a
problem with a GE link partner and aneg takes more time than usual.
But this would be completely unrelated to a potential issue with
ASPM on the PCIe link.
And it's also not clear how L1_1 can cause an issue if the NIC doesn't
support L1 sub-states. Maybe the root cause isn't with the NIC but
with some other component in the PCIe path (e.g. bridge).
quoted
Your bug report also includes a patch that disables L1_1 only.
Not sure how this is related because the chip version we speak about
here doesn't support L1 sub-states.
I have tried to enable L0s, L1 and don't disable L1 substate,
but still get the issue that interrupt can't be fired immediately but
the Link status is up.
quoted
quoted
quoted
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
quoted
So what you're saying is that mainline is fine and your problem is with
a downstream kernel with re-enabled ASPM? So there's nothing broken in
mainline? In mainline you have the option to re-enable ASPM states
individually via sysfs (link subdir at pci device).
If enable L1_1 on the mainline, the issue could be observed too.
It has a reason that ASPM is disabled per default in mainline. Different
chip versions have different types of issues with ASPM enabled.
However several chip versions work fine with ASPM (also LI sub-states),
therefore users can re-enable ASPM states at own risk.
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
On Fri, Jun 4, 2021 at 7:59 PM Heiner Kallweit [off-list ref] wrote:
On 04.06.2021 11:08, Koba Ko wrote:
quoted
On Fri, Jun 4, 2021 at 4:23 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 04.06.2021 09:22, Koba Ko wrote:
quoted
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
Then runtime pm doesn't seem to be set to "auto". Else 10s after link loss
the chip runtime-suspends and is set to D3hot.
I will check this.
quoted
quoted
quoted
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
At least your Bugzilla report refers to VER_39. PCI device id 0x8136 is shared
by all fast ethernet chip versions.
Do you know other affected chip versions apart from VER_39 ?
In the Bugzilla report you also write the issue occurs with GBit-capable
link partners. This sounds more like an aneg problem.
The issue doesn't occur with fast ethernet link partners?
Issue wouldn't be observed when the link-partner has only FE capability.
Weird. I still have no clue how FE vs. GE support at link partner and
ASPM could be related. I could understand that the PHY might have a
problem with a GE link partner and aneg takes more time than usual.
But this would be completely unrelated to a potential issue with
ASPM on the PCIe link.
And it's also not clear how L1_1 can cause an issue if the NIC doesn't
support L1 sub-states. Maybe the root cause isn't with the NIC but
with some other component in the PCIe path (e.g. bridge).
I prefer that there's a interrupt issue when aspm is enabled on RTL8106e,
quoted
quoted
Your bug report also includes a patch that disables L1_1 only.
Not sure how this is related because the chip version we speak about
here doesn't support L1 sub-states.
I have tried to enable L0s, L1 and don't disable L1 substate,
but still get the issue that interrupt can't be fired immediately but
the Link status is up.
quoted
quoted
quoted
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
quoted
So what you're saying is that mainline is fine and your problem is with
a downstream kernel with re-enabled ASPM? So there's nothing broken in
mainline? In mainline you have the option to re-enable ASPM states
individually via sysfs (link subdir at pci device).
If enable L1_1 on the mainline, the issue could be observed too.
It has a reason that ASPM is disabled per default in mainline. Different
chip versions have different types of issues with ASPM enabled.
However several chip versions work fine with ASPM (also LI sub-states),
therefore users can re-enable ASPM states at own risk.
After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
REALTEK, DEVICE 0x8136, Revision 0x7.
I would like to make PHY_POLL as default for RTL8106E on V2.
because there's no side effects besides the cpu usage rate would be a
little higher,
How do you think?
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
On Fri, Jun 4, 2021 at 7:59 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 04.06.2021 11:08, Koba Ko wrote:
quoted
On Fri, Jun 4, 2021 at 4:23 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 04.06.2021 09:22, Koba Ko wrote:
quoted
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
Then runtime pm doesn't seem to be set to "auto". Else 10s after link loss
the chip runtime-suspends and is set to D3hot.
I will check this.
quoted
quoted
quoted
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
At least your Bugzilla report refers to VER_39. PCI device id 0x8136 is shared
by all fast ethernet chip versions.
Do you know other affected chip versions apart from VER_39 ?
In the Bugzilla report you also write the issue occurs with GBit-capable
link partners. This sounds more like an aneg problem.
The issue doesn't occur with fast ethernet link partners?
Issue wouldn't be observed when the link-partner has only FE capability.
Weird. I still have no clue how FE vs. GE support at link partner and
ASPM could be related. I could understand that the PHY might have a
problem with a GE link partner and aneg takes more time than usual.
But this would be completely unrelated to a potential issue with
ASPM on the PCIe link.
And it's also not clear how L1_1 can cause an issue if the NIC doesn't
support L1 sub-states. Maybe the root cause isn't with the NIC but
with some other component in the PCIe path (e.g. bridge).
I prefer that there's a interrupt issue when aspm is enabled on RTL8106e,
quoted
quoted
quoted
Your bug report also includes a patch that disables L1_1 only.
Not sure how this is related because the chip version we speak about
here doesn't support L1 sub-states.
I have tried to enable L0s, L1 and don't disable L1 substate,
but still get the issue that interrupt can't be fired immediately but
the Link status is up.
quoted
quoted
quoted
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
quoted
So what you're saying is that mainline is fine and your problem is with
a downstream kernel with re-enabled ASPM? So there's nothing broken in
mainline? In mainline you have the option to re-enable ASPM states
individually via sysfs (link subdir at pci device).
If enable L1_1 on the mainline, the issue could be observed too.
It has a reason that ASPM is disabled per default in mainline. Different
chip versions have different types of issues with ASPM enabled.
However several chip versions work fine with ASPM (also LI sub-states),
therefore users can re-enable ASPM states at own risk.
After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
REALTEK, DEVICE 0x8136, Revision 0x7.
This wasn't the question. The identification is available already.
This chip version is RTL_GIGA_MAC_VER_39.
I would like to make PHY_POLL as default for RTL8106E on V2.
because there's no side effects besides the cpu usage rate would be a
little higher,
How do you think?
Did you check the actual question with Realtek? Did they confirm a hw
issue with this chip version? If yes, some more details would be helpful.
The dmesg log attached to your linked bugzilla issue lists a number of
ACPI errors. Overall I'm still not convinced that root cause of your
issue is a NIC hw bug.
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
On Mon, Jun 7, 2021 at 6:43 PM Heiner Kallweit [off-list ref] wrote:
On 07.06.2021 06:34, Koba Ko wrote:
quoted
On Fri, Jun 4, 2021 at 7:59 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 04.06.2021 11:08, Koba Ko wrote:
quoted
On Fri, Jun 4, 2021 at 4:23 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 04.06.2021 09:22, Koba Ko wrote:
quoted
On Thu, Jun 3, 2021 at 6:00 PM Heiner Kallweit [off-list ref] wrote:
quoted
On 03.06.2021 04:54, Koba Ko wrote:
quoted
For RTL8106E, it's a Fast-ethernet chip.
If ASPM is enabled, the link chang interrupt wouldn't be triggered
immediately and must wait a very long time to get link change interrupt.
Even the link change interrupt isn't triggered, the phy link is already
established.
At first please provide a full dmesg log and output of lspci -vv.
Do you have the firmware for the NIC loaded? Please provide "ethtool -i <if>"
output.
Does the issue affect link-down and/or link-up detection?
Do you have runtime pm enabled? Then, after 10s of link-down NIC goes to
D3hot and link-up detection triggers a PME.
Issue affect link-up.
yes, pm runtime is enabled, but rtl8106e always stays D0 even if the
cable isn't present.
Then runtime pm doesn't seem to be set to "auto". Else 10s after link loss
the chip runtime-suspends and is set to D3hot.
I will check this.
quoted
quoted
quoted
quoted
Introduce a polling method to watch the status of phy link and disable
the link change interrupt.
Also add a quirk for those realtek devices have the same issue.
Which are the affected chip versions? Did you check with Realtek?
Your patch switches to polling for all Fast Ethernet versions,
and that's not what we want.
I don't know the exact version, only the chip name 806e(pci device id 0x8165).
ok, Im asking Realtek to help how to identify the chip issue is observed.
At least your Bugzilla report refers to VER_39. PCI device id 0x8136 is shared
by all fast ethernet chip versions.
Do you know other affected chip versions apart from VER_39 ?
In the Bugzilla report you also write the issue occurs with GBit-capable
link partners. This sounds more like an aneg problem.
The issue doesn't occur with fast ethernet link partners?
Issue wouldn't be observed when the link-partner has only FE capability.
Weird. I still have no clue how FE vs. GE support at link partner and
ASPM could be related. I could understand that the PHY might have a
problem with a GE link partner and aneg takes more time than usual.
But this would be completely unrelated to a potential issue with
ASPM on the PCIe link.
And it's also not clear how L1_1 can cause an issue if the NIC doesn't
support L1 sub-states. Maybe the root cause isn't with the NIC but
with some other component in the PCIe path (e.g. bridge).
I prefer that there's a interrupt issue when aspm is enabled on RTL8106e,
quoted
quoted
quoted
Your bug report also includes a patch that disables L1_1 only.
Not sure how this is related because the chip version we speak about
here doesn't support L1 sub-states.
I have tried to enable L0s, L1 and don't disable L1 substate,
but still get the issue that interrupt can't be fired immediately but
the Link status is up.
quoted
quoted
quoted
My suspicion would be that something is system-dependent. Else I think
we would have seen such a report before.
On the mainline, the aspm is disable, so you may not observe this.
If you enable ASPM and must wait CHIP go to power-saving mode, then
you can observe the issue.
quoted
So what you're saying is that mainline is fine and your problem is with
a downstream kernel with re-enabled ASPM? So there's nothing broken in
mainline? In mainline you have the option to re-enable ASPM states
individually via sysfs (link subdir at pci device).
If enable L1_1 on the mainline, the issue could be observed too.
It has a reason that ASPM is disabled per default in mainline. Different
chip versions have different types of issues with ASPM enabled.
However several chip versions work fine with ASPM (also LI sub-states),
therefore users can re-enable ASPM states at own risk.
After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
REALTEK, DEVICE 0x8136, Revision 0x7.
This wasn't the question. The identification is available already.
This chip version is RTL_GIGA_MAC_VER_39.
quoted
I would like to make PHY_POLL as default for RTL8106E on V2.
because there's no side effects besides the cpu usage rate would be a
little higher,
How do you think?
Did you check the actual question with Realtek? Did they confirm a hw
issue with this chip version? If yes, some more details would be helpful.
yes, but Realtek said there's no issue on ASPM and AN.
They also didn't answer why disabling an unsupported L1_1 would cause
this issue.
The dmesg log attached to your linked bugzilla issue lists a number of
ACPI errors. Overall I'm still not convinced that root cause of your
issue is a NIC hw bug.
I also upgraded the BIOS to the last and still can get the issue.
@@ -11,6 +11,8 @@#include<linux/types.h>#include<linux/phy.h>+#define RTL8169_LINK_TIMEOUT (1 * HZ)+enummac_version{/* support for ancient RTL_GIGA_MAC_VER_01 has been removed */RTL_GIGA_MAC_VER_02,
From: David Laight <hidden> Date: 2021-06-07 12:32:40
From: Koba Ko
Sent: 07 June 2021 05:35
...
After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
REALTEK, DEVICE 0x8136, Revision 0x7.
I would like to make PHY_POLL as default for RTL8106E on V2.
because there's no side effects besides the cpu usage rate would be a
little higher,
How do you think?
If reading the PHY registers involves a software bit-bang
of an MII register (rather than, say, a sleep for interrupt
while the MAC unit does the bit-bang) then you can clobber
interrupt latency because of all the time spent spinning.
While this is less of a problem on multi-cpu systems I have
seen it result in ethernet packet loss on old systems.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-06-07 12:49:59
On Mon, Jun 07, 2021 at 12:32:29PM +0000, David Laight wrote:
From: Koba Ko
quoted
Sent: 07 June 2021 05:35
...
quoted
After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
REALTEK, DEVICE 0x8136, Revision 0x7.
I would like to make PHY_POLL as default for RTL8106E on V2.
because there's no side effects besides the cpu usage rate would be a
little higher,
How do you think?
If reading the PHY registers involves a software bit-bang
of an MII register (rather than, say, a sleep for interrupt
while the MAC unit does the bit-bang) then you can clobber
interrupt latency because of all the time spent spinning.
That is not what PHY IRQ/POLL means in the PHY subsystem.
Many PHYs don't actually have there interrupt output connected to a
GPIO. This is partially because 803.2 C22 and C45 standards don't
define interrupts. Each vendor which supports interrupts uses
proprietary registers. So by default, the PHY subsystem will poll the
status of the PHY once per second to see if the link has changed
state. If the combination of PHY hardware, board hardware and PHY
driver does have interrupts, the PHY subsystem will not poll, but wait
for an interrupt, and then check the status of the link.
As for MII bus masters, i only know of one which is interrupt driven,
rather than polled IO, for completion. The hardware is clocking out 64
bits at 2.5MHz. So it is done rather quickly. I profiled that one
using interrupts, and the overhead of dealing with the interrupt is
bigger than polling.
Andrew
From: David Laight <hidden> Date: 2021-06-07 13:17:18
From: Andrew Lunn
Sent: 07 June 2021 13:50
On Mon, Jun 07, 2021 at 12:32:29PM +0000, David Laight wrote:
quoted
From: Koba Ko
quoted
Sent: 07 June 2021 05:35
...
quoted
After consulting with REALTEK, I can identify RTL8106e by PCI_VENDOR
REALTEK, DEVICE 0x8136, Revision 0x7.
I would like to make PHY_POLL as default for RTL8106E on V2.
because there's no side effects besides the cpu usage rate would be a
little higher,
How do you think?
If reading the PHY registers involves a software bit-bang
of an MII register (rather than, say, a sleep for interrupt
while the MAC unit does the bit-bang) then you can clobber
interrupt latency because of all the time spent spinning.
That is not what PHY IRQ/POLL means in the PHY subsystem.
Many PHYs don't actually have there interrupt output connected to a
GPIO. This is partially because 803.2 C22 and C45 standards don't
define interrupts. Each vendor which supports interrupts uses
proprietary registers. So by default, the PHY subsystem will poll the
status of the PHY once per second to see if the link has changed
state. If the combination of PHY hardware, board hardware and PHY
driver does have interrupts, the PHY subsystem will not poll, but wait
for an interrupt, and then check the status of the link.
I know. I might be 30 years since I wrote anything to read MII
but I don't remember seeing anything that made it less horrid.
One of the MAC units (probably AMD lance based) could be configured
to repeatedly read one PHY register and generate a MAC interrupt
if it changed - but I've not seen that on some later MAC chips.
As for MII bus masters, i only know of one which is interrupt driven,
rather than polled IO, for completion. The hardware is clocking out 64
bits at 2.5MHz. So it is done rather quickly. I profiled that one
using interrupts, and the overhead of dealing with the interrupt is
bigger than polling.
64 bits at 2.5MHz is some 64000 cpu clocks - not inconsiderable.
It has to be said that I don't know how to solve the delays
associated with software bit-bang (apart from persuading the
hardware engineers it isn't a good idea).
With my 'hardware engineer' hat on (I'm currently (ir)responsible
for some FPGA internals as well as the drivers) the logic to
do things like I2C (etc) reads and writes from fpga memory
sits in a tiny corner of a modern device.
One possibility for 'slow polls' is to do them slowly!
One edge per timer tick - although 'tickless' probably
kills that.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)