Bug 216599 - i210 doesn't work and triggers netdev watchdog (Linux 5.10)
Summary: i210 doesn't work and triggers netdev watchdog (Linux 5.10)
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: PCI (show other bugs)
Hardware: ARM Linux
: P1 high
Assignee: drivers_pci@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-17 11:09 UTC by jeffreytseng
Modified: 2022-10-20 00:49 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.10.72
Subsystem:
Regression: No
Bisected commit-id:


Attachments
This is the complete dmesg log and "sudo lspci -vv" output. (100.93 KB, text/plain)
2022-10-17 11:09 UTC, jeffreytseng
Details
Expansion ROM BAR even if the Expansion ROM is disabled. (70.61 KB, text/plain)
2022-10-18 06:37 UTC, jeffreytseng
Details
attachment-5687-0.html (2.01 KB, text/html)
2022-10-19 02:26 UTC, jeffreytseng
Details

Description jeffreytseng 2022-10-17 11:09:20 UTC
Created attachment 303021 [details]
This is the complete dmesg log and "sudo lspci -vv" output.

Here is my question.
My platform : imx8mm
Ethernet Control : Intel I210
Linux version 5.10.72-lts-5.10.y+g22ec7e8cbace (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2. UTC 2011

I follow this  https://git.kernel.org/linus/500b55b05d0a
to add the patch in my platform.

The issue and problem is still there. Anyone can give me a hand ?
Comment 1 jeffreytseng 2022-10-18 06:37:09 UTC
Created attachment 303028 [details]
Expansion ROM BAR even if the Expansion ROM is disabled.
Comment 2 jeffreytseng 2022-10-18 06:40:05 UTC
hi all

Some devices don't work if the Expansion ROM has the same base address as one of the other BARs although it is disabled.
This might happen if the bootloader/BIOS enumerates the BARs in a different  way than linux. If the Expansion ROM is disabled, linux deliberately skips writing the ROM BAR if the BAR is not enabled because of some broken devices, see pci_std_update_resource(). Thus, the ROM BAR of the device will  still contain the value assigned by the booloader, which might be the same value as one of the other BARs then. As a workaround, update the Expansion ROM BAR even if the Expansion ROM is disabled.

I follow the to modify the source ccode but it is no use.

tzeng015@tzeng015:~/A100_PMIC/imx-yocto-bsp/sources/meta-gigabyte/sources/linux-imx$ git diff drivers/pci/quirks.c
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 54045af6db8d..a391cf9d231b 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -5758,3 +5758,26 @@ static void apex_pci_fixup_class(struct pci_dev *pdev)
 }
 DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a,
                               PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);
+
+static void pci_fixup_write_rom_bar(struct pci_dev *dev)
+{
+       struct resource *res = &dev->resource[PCI_ROM_RESOURCE];
+       struct pci_bus_region region;
+       u32 rom_addr;
+
+       pci_read_config_dword(dev, dev->rom_base_reg, &rom_addr);
+
+       if (rom_addr & PCI_ROM_ADDRESS_ENABLE)
+               return;
+
+       pci_info(dev, "2022/10/18 Test 1 Writing Expansion ROM BAR to avoid overlapping\n");
+
+       pcibios_resource_to_bus(dev->bus, &region, res);
+       rom_addr &= ~PCI_ROM_ADDRESS_MASK;
+       rom_addr |= region.start;
+       pci_write_config_dword(dev, dev->rom_base_reg, rom_addr);
+}
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1533, pci_fixup_write_rom_bar);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1536, pci_fixup_write_rom_bar);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1537, pci_fixup_write_rom_bar);
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x1538, pci_fixup_write_rom_bar);

You can check the attach log of Expansion ROM BAR even if the Expansion ROM is disabled

jeffrey
Comment 3 Bjorn Helgaas 2022-10-18 13:14:38 UTC
Your I210 device doesn't seem to have an Expansion ROM.  The dmesg log from comment #1 doesn't show it:

  [    2.692344] pci 0000:01:00.0: [8086:1533] type 00 class 0x020000
  [    2.698457] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x0007ffff]
  [    2.704786] pci 0000:01:00.0: reg 0x18: [io  0x0000-0x001f]
  [    2.710403] pci 0000:01:00.0: reg 0x1c: [mem 0x00000000-0x00003fff]

If it had an Expansion ROM, we would see a line for "reg 0x30".

The lspci output from comment #1 also doesn't show a ROM.
Comment 4 jeffreytseng 2022-10-19 02:26:14 UTC
Created attachment 303032 [details]
attachment-5687-0.html

Hi bugzilla

can I ask you the question? Do you mean this is the problem of linux
driver  kernel ?
thank you
jeffrey




<bugzilla-daemon@kernel.org> 於 2022年10月18日 週二 晚上9:14寫道:

> https://bugzilla.kernel.org/show_bug.cgi?id=216599
>
> Bjorn Helgaas (bjorn@helgaas.com) changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |bjorn@helgaas.com
>
> --- Comment #3 from Bjorn Helgaas (bjorn@helgaas.com) ---
> Your I210 device doesn't seem to have an Expansion ROM.  The dmesg log from
> comment #1 doesn't show it:
>
>   [    2.692344] pci 0000:01:00.0: [8086:1533] type 00 class 0x020000
>   [    2.698457] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x0007ffff]
>   [    2.704786] pci 0000:01:00.0: reg 0x18: [io  0x0000-0x001f]
>   [    2.710403] pci 0000:01:00.0: reg 0x1c: [mem 0x00000000-0x00003fff]
>
> If it had an Expansion ROM, we would see a line for "reg 0x30".
>
> The lspci output from comment #1 also doesn't show a ROM.
>
> --
> You may reply to this email to add a comment.
>
> You are receiving this mail because:
> You are on the CC list for the bug.
> You reported the bug.
Comment 5 jeffreytseng 2022-10-19 10:09:52 UTC
Hi Bjorn Helgaas 
So , I shall try to enable Expansion ROM of Intel I210 . Right ?
Comment 6 Bjorn Helgaas 2022-10-19 15:34:33 UTC
My guess is an igb driver bug.

You should not need to enable the I210 Expansion ROM.  The ROM may be an optional feature, and your card may not have one.  If a ROM is physically present and it can be enabled, Linux should see it when enumerating the I210.  If the ROM is present, Linux would print a line like "pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x00003fff]" that shows the size of the ROM, even if the ROM is currently disabled.
Comment 7 jeffreytseng 2022-10-20 00:49:06 UTC
Hi 
Thank your suggestion.
I think that I have to download the newest linux kernel driver to compare igb driver.
This is maybe the best way.
thank you

Jeffrey

Note You need to log in before you can comment on or make changes to this bug.