We received several Supermicro servers — AS-1115CS-TNR (https://www.supermicro.com/en/products/system/clouddc/1u/as%20-1115cs-tnr) They are based on the H13SSW motherboard with the latest BIOS, Turin 9355 CPU, and so on. Since local storage is only needed for system startup, and we have a stock of SATA SSDs, the chosen storage type is SATA. However, when trying to boot FreeBSD CURRENT 15-ALPHA2/ALPHA3 and 14.4-STABLE from an install source, we receive a kernel error when attempting to attach ahci0. ahci0: <AMD KERNCZ AHCI SATA controller> mem 0xc5201000-0xc52017ff irq 37 at device 0.0 numa-domain 0 on pci2 device_attach: ahci0 attach returned 6 ahci0: <AMD KERNCZ AHCI SATA controller> mem 0xc5200000-0xc52007ff irq 38 at device 0.1 numa-domain 0 on pci2 device_attach: ahci0 attach returned 6 output of pciconf -lv none3@pci0:226:0:0: class=0x010601 rev=0x93 hdr=0x00 vendor=0x1022 device=0x7901 subvendor=0x15d9 subdevice=0x1c85 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH SATA Controller [AHCI mode]' class = mass storage subclass = SATA none4@pci0:226:0:1: class=0x010601 rev=0x93 hdr=0x00 vendor=0x1022 device=0x7901 subvendor=0x15d9 subdevice=0x1c85 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH SATA Controller [AHCI mode]' class = mass storage subclass = SATA And of course, we don't see any devices — except the virtual CD-ROM via IPMI. We tried booting with verbose mode, but found no additional messages related to the issue. The situation is further complicated by the fact that we don’t have direct physical access to the machines, so preparing an installation medium on another system and deploying it to the target server is a time-consuming process. Could you please advise on what additional diagnostics we can perform, and generally help us resolve this issue? Thank you in advance.
(In reply to Vitalij Satanivskij from comment #0) Could you please provide output of pciconf -lvbBccV pci0:226:0:0 ? Please also attach full outputs of pciconf -lv and devinfo -vr.
Created attachment 263982 [details] pciconf
Created attachment 263983 [details] devinfo
Created attachment 263984 [details] pciconf -lvbBccV pci0:226:0:0
(In reply to Vitalij Satanivskij from comment #4) Not an expert in this area, but this looks fishy to me: cap 11[c0] = MSI-X supports 1 message Table in map 0x10[0x0], PBA in map 0x10[0x0] Because BAR 0x10 is not configured. Looks like the corresponding capability is all zeroes. Try to disable MSI-X as an experiment (hw.pci.enable_msix=0).
(In reply to Andriy Gapon from comment #5) Yes, I disable msix on boot and driver attached, sata devices visible. Of cause another hardware such as mellanox network and so on become unvisible (no drivers attached)
(In reply to Vitalij Satanivskij from comment #6) I think that it is a firmware issue that MSI-X is configured like that for AHCI controllers. Perhaps, there is a way to fix it up using some PCI magic configuration. I would ask jhb@ about that. Meanwhile, if you can build an image from source you can AHCI_Q_NOMSIX to the line that matches the controller in sys/dev/ahci/ahci_pci.c.
Regarding potential code improvements. It seems that ahci_pci code uses some low level accesses for MSI-X information. Those probably originate from early days of MSI-X support in FreeBSD. I think that, e.g., a function like ahci_pci_read_msix_bars() could be replaced with or re-implemented in terms of standard pci bus methods like pci_msix_table_bar. But that's a minor point. I think that a failure to allocate one of those BARs should not translate to a failure to attach. It should simply disable MSI-X for the device and proceed with other interrupt modes. BTW, I wonder if pci_msix_table_bar_method and pci_msix_pba_bar_method, or even pci_read_cap before them, could do some verification of the MSI-X BARs.
(In reply to Vitalij Satanivskij from comment #4) Could you please also add output of pciconf -r pci0:226:0:0 0x10 command?
(In reply to Vitalij Satanivskij from comment #4) Just for easier reading, copying this from the attachment: none0@pci0:226:0:0: class=0x010601 rev=0x93 hdr=0x00 vendor=0x1022 device=0x7901 subvendor=0x15d9 subdevice=0x1c85 vendor = 'Advanced Micro Devices, Inc. [AMD]' device = 'FCH SATA Controller [AHCI mode]' class = mass storage subclass = SATA bar [24] = type Memory, range 32, base rxc5201000, size 2048, enabled cap 09[48] = vendor (length 8) cap 01[50] = powerspec 3 supports D0 D3 current D0 cap 10[64] = PCI-Express 2 endpoint max data 128(256) RO NS max read 512 link x16(x16) speed 32.0(32.0) ASPM disabled(L0s/L1) cap 05[a0] = MSI supports 16 messages, 64 bit cap 11[c0] = MSI-X supports 1 message Table in map 0x10[0x0], PBA in map 0x10[0x0] cap 12[d0] = SATA Index-Data Pair ecap 000b[100] = Vendor [1] ID 0001 Rev 1 Length 16 0b 00 01 15 01 00 01 01 00 00 00 00 00 00 00 00 ecap 0001[150] = AER 2 0 fatal 0 non-fatal 1 corrected ecap 0019[270] = PCIe Sec 1 lane errors 0 ecap 0026[410] = Physical Layer 16.0 GT/s 1 ecap 0027[450] = Lane Margining at Receiver 1 ecap 002a[500] = Physical Layer 32.0 GT/s 1
(In reply to Andriy Gapon from comment #9) Command return just 00000000 and nothing more...
(In reply to Vitalij Satanivskij from comment #11) Thanks. That's what I expected but wanted to double-check.
(In reply to Andriy Gapon from comment #7) Yes. I boot installation with hw.pci.enable_msix=0 than install system. Reboot with same variable and rebuild kernel with changed diff --git a/sys/dev/ahci/ahci_pci.c b/sys/dev/ahci/ahci_pci.c index 7451cc387011..b4e61a9f77fd 100644 --- a/sys/dev/ahci/ahci_pci.c +++ b/sys/dev/ahci/ahci_pci.c @@ -82,7 +82,7 @@ static const struct { {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, {0x79001022, 0x00, "AMD KERNCZ", 0}, - {0x79011022, 0x00, "AMD KERNCZ", 0}, + {0x79011022, 0x00, "AMD KERNCZ", AHCI_Q_NOMSIX}, This workaround work for me. At least we can continue to setup new servers for our services.
Probably the ahci driver needs to not treat the failure to bus_alloc_resource the BAR for the MSI-X table as fatal, and instead just fallback to using MSI or INTx in that case instead of reporting attach failure. I'm attaching an alternate patch to try. It also uses stock methods to query the BAR IDs.
Created attachment 264268 [details] msix_nonfatal.patch
(In reply to John Baldwin from comment #15) Just in case, the patch looks good to me. Hopefully, Vitalij would be able to test it.
The patch doesn't actually compile (need to remove some unused variables). I've split it into two commits for review: https://reviews.freebsd.org/D52888 https://reviews.freebsd.org/D52889 Testing would certainly be appreciated. Thanks for the report!
(In reply to Andriy Gapon from comment #16) Thank you for the proposed patch, I will have the opportunity to test it next week when we will be setting up the next batch of the same servers.
(In reply to John Baldwin from comment #17) I have already tested this patch on 14.3-STABLE on a server that had this issue — everything works perfectly. Thank you for you help!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b658158e9396848d3963e9555d356d0f4ca6900a commit b658158e9396848d3963e9555d356d0f4ca6900a Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-10-06 17:56:47 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-10-06 17:56:47 +0000 ahci: Don't fail attach if the MSI-X BARs cannot be allocated If the MSI-X table and/or PBA live in separate BAR(s) and those BAR(s) cannot be allocated, fall back to using MSI or INTx instead of failing attach. PR: 289748 Reported by: Vitalij Satanivskij <satan@Ukr.net> Reviewed by: avg, imp Differential Revision: https://reviews.freebsd.org/D52889 sys/dev/ahci/ahci_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
A commit in branch stable/15 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=fb939e88ba192fc75ebcbc863bcf1523e65a756b commit fb939e88ba192fc75ebcbc863bcf1523e65a756b Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-10-06 17:56:47 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-10-10 21:04:31 +0000 ahci: Don't fail attach if the MSI-X BARs cannot be allocated If the MSI-X table and/or PBA live in separate BAR(s) and those BAR(s) cannot be allocated, fall back to using MSI or INTx instead of failing attach. PR: 289748 Reported by: Vitalij Satanivskij <satan@Ukr.net> Reviewed by: avg, imp Differential Revision: https://reviews.freebsd.org/D52889 (cherry picked from commit b658158e9396848d3963e9555d356d0f4ca6900a) sys/dev/ahci/ahci_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=07f4fa7a0db931c47cc78c711e05d5d51a4e2448 commit 07f4fa7a0db931c47cc78c711e05d5d51a4e2448 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-10-06 17:56:47 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-10-10 21:04:35 +0000 ahci: Don't fail attach if the MSI-X BARs cannot be allocated If the MSI-X table and/or PBA live in separate BAR(s) and those BAR(s) cannot be allocated, fall back to using MSI or INTx instead of failing attach. PR: 289748 Reported by: Vitalij Satanivskij <satan@Ukr.net> Reviewed by: avg, imp Differential Revision: https://reviews.freebsd.org/D52889 (cherry picked from commit b658158e9396848d3963e9555d356d0f4ca6900a) sys/dev/ahci/ahci_pci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
is there any chance of or an eta when this might hit errata for releng 14.3? ran into this with my new system around a Gigabyte MH53-G40 motherboard. Was able to disable MISX to transfer from spinning rust to new nvme based pool, but would like to re-use the old drives for backups and additional storage. as I need MISX for bnxt drivers, and some other hardware running with it disabled is something I want to avoid on my new workstation. not sure if https://reviews.freebsd.org/D52888 is needed too. Would like to avoid running on hacked source by manually applying the patch as I'm not in an immediate rush, just don't want to hit it again when going to 14.4 or 15.0 when those release.
I had not planned on pushing for an EN for 14.3, in part because we do not build new install images for ENs, only binary updates, so an EN wouldn't let you install onto disks behind an affected AHCI controller. Both 14.4 and 15.0 will include this fix.