Page MenuHomeFreeBSD

Add quirk mechanism to pci_host_generic_acpi
ClosedPublic

Authored by pdk_semihalf.com on Jun 20 2018, 4:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 11:33 PM
Unknown Object (File)
Tue, Dec 10, 7:07 AM
Unknown Object (File)
Fri, Nov 29, 6:11 AM
Unknown Object (File)
Nov 17 2024, 8:53 PM
Unknown Object (File)
Nov 17 2024, 3:07 AM
Unknown Object (File)
Nov 3 2024, 10:17 PM
Unknown Object (File)
Nov 2 2024, 11:12 PM
Unknown Object (File)
Sep 29 2024, 9:51 AM
Subscribers

Details

Summary

Add quirk mechanism to pci_host_generic_acpi

Add quirk mechanism and necesseary ThunderX2 quirks like:

  • Correct AHCI addresses

In this patch we provide blocking mechanism too, which is necesseary
if we want to avoid attaching AHCI and XHCI from second socket (they are
not exposed on board).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/dev/pci/pci_host_generic_acpi.c
126–138 ↗(On Diff #44163)

Is this ACPI specific? It doesn't seem to be, so could be in the common .c file.

Move quirks form acpi part to common part.

sys/dev/pci/pci_host_generic.c
115–116 ↗(On Diff #44204)

Why is this needed?

470–472 ↗(On Diff #44204)

Is there an erratum for this?

490 ↗(On Diff #44204)

Shouldn't you be getting this from the ACPI mcfg table?

sys/dev/pci/pci_host_generic.c
115–116 ↗(On Diff #44204)

Second socket have SATA controller on chip. It is not exposed on board, and have bad adresses (like SATA on first socket). Instead of fixing addresses we block it.

470–472 ↗(On Diff #44204)

There is no erratum. Without this quirk kernel is trying to access bad address.

490 ↗(On Diff #44204)

Yes, I should get this from MCFG, but it doesn't provide information about pci on second socket. Furthermore segment passed to acpi_enable_pcie is 0 in both cases.

sys/dev/pci/pci_host_generic.c
470–472 ↗(On Diff #44204)

Why is the kernel trying to access a bad address?

490 ↗(On Diff #44204)

Will this always be unit 16, or would it be better to look at other information to detect when it's an ecam device.

sys/dev/pci/pci_host_generic.c
470–472 ↗(On Diff #44204)

Kernel is trying to attach ahci. Look at log (without quirk of course) below it contains aforementioned bad address:

ahci0: <AHCI SATA controller> mem 0x41d4100041d30000-0x41d4100041d3ffff,0x41d20000-0x41d2ffff at device 16.0 on pci0                
PDK: virtual=0xffff000165388000 size=65536 pa=41d20000                                                                              
PDK: virtual=0xffff000165398000 size=65536 pa=41d4100041d30000                                                                      
ahci0: PDK: msix_table_bar: 24                                                                                                      
ahci0: PDK: msix_table_res: 0xfffffd0001e25180                                                                                      
ahci0: attempting to allocate 4 MSI-X vectors (4 supported)                                                                         
ahci0: using IRQs 11-14 for MSI-X                                                                                                                                                                                                                                                                                               
panic: vm_fault_hold: fault on nofault entry, addr: 0xffff000165398000
490 ↗(On Diff #44204)

It will be always unit 16. I've checked it once again and I have an idea. I will use _BBN to get ecam number. I'll update patches today so stay tuned.

pdk_semihalf.com edited the summary of this revision. (Show Details)

Remove redundant ecam quirk.

Do you have still objections to this patch?

This revision was not accepted when it landed; it landed in state Needs Review.Jul 9 2018, 9:00 AM
This revision was automatically updated to reflect the committed changes.