Re: [PATCH net-next 3/3] r8169: disable RTL8126 ZRX-DC timeout

From: Heiner Kallweit
Date: Fri Feb 21 2025 - 15:11:31 EST


On 21.02.2025 21:01, Bjorn Helgaas wrote:
> On Fri, Feb 21, 2025 at 03:18:28PM +0800, ChunHao Lin wrote:
>> Disable it due to it dose not meet ZRX-DC specification. If it is enabled,
>> device will exit L1 substate every 100ms. Disable it for saving more power
>> in L1 substate.
>
> s/dose/does/
>
> Is ZRX-DC a PCIe spec? A Google search suggests that it might not be
> completely Realtek-specific?
>
ZRX-DC is the receiver DC impedance as specified in the PCIe Base Specification.
>From what I've found after a quick search ASPM restrictions apply if this impedance
isn't in the range 40-60 ohm.

>> +static void rtl_disable_zrxdc_timeout(struct rtl8169_private *tp)
>> +{
>> + struct pci_dev *pdev = tp->pci_dev;
>> + u8 val;
>> +
>> + if (pdev->cfg_size > 0x0890 &&
>> + pci_read_config_byte(pdev, 0x0890, &val) == PCIBIOS_SUCCESSFUL &&
>> + pci_write_config_byte(pdev, 0x0890, val & ~BIT(0)) == PCIBIOS_SUCCESSFUL)
>
> Is this a standard PCIe extended capability? If so, it would be nice
> to search for it with pci_find_ext_capability() and use standard
> #defines.
>
> Bjorn