Bug 256730 - linsysfs adds duplicate pathnames on Ampere
Summary: linsysfs adds duplicate pathnames on Ampere
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.0-STABLE
Hardware: arm64 Any
: --- Affects Only Me
Assignee: freebsd-emulation (Nobody)
Depends on:
Reported: 2021-06-20 14:18 UTC by John F. Carr
Modified: 2021-06-22 13:52 UTC (History)
3 users (show)

See Also:

dmesg output (12.46 KB, text/plain)
2021-06-20 14:18 UTC, John F. Carr
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description John F. Carr 2021-06-20 14:18:31 UTC
Created attachment 225948 [details]
dmesg output

On my Ampere arm64 server (but not on a Raspberry Pi 3B) I get a panic trying to load linsysfs with INVARIANTS defined.  The panic message is "pfs_add_node(): homonymous siblings".  With a debugging printf instead of a panic I see linsysfs_run_bus is trying to add several instances of "0000:00:00.0".

# ls /usr/jail/0/linux/sys/devices/pci0000:00
0000:00:00.0    0000:00:00.0    0000:00:00.0    0000:00:00.0
0000:00:00.0    0000:00:00.0    0000:00:00.0

There might be two bugs here -- bad PCI enumeration code for the Ampere server and a lack of defensive programming in the linsysfs kernel module.

I see some warnings from PCI code in attached dmesg output which might be related.
Comment 1 Ed Maste freebsd_committer 2021-06-22 00:16:47 UTC
Can you add the firmware version installed on the eMAG system?
Comment 2 John F. Carr 2021-06-22 13:52:16 UTC
(In reply to Ed Maste from comment #1)
The following is from the AMI boot screen.  Can I get it from the OS?

Version 2.19.1268
BIOS Version: 1.12 HVE104N(11/29/2019)
BMC firmware: 11.05.111