Bug 211873

Summary: ASM1166: too many SATA ports detected
Product: IO/Storage Reporter: Christian Boxdörfer (christian.boxdoerfer)
Component: Serial ATAAssignee: Tejun Heo (tj)
Status: NEW ---    
Severity: normal CC: andrebrait, ck+kernelbugzilla
Priority: P1    
Hardware: All   
OS: Linux   
Kernel Version: 5.10.13 Subsystem:
Regression: No Bisected commit-id:
Attachments: dmesg output (shortened)

Description Christian Boxdörfer 2021-02-21 10:17:58 UTC
Created attachment 295377 [details]
dmesg output (shortened)

I've got a 6 port SATA PCI card with an ASMedia ASM1166 controller, however the kernel detects 32 SATA ports instead. This significantly delays the boot process when the kernel tries to scan all those ports for devices.

lspci:
06:00.0 SATA controller: ASMedia Technology Inc. Device 1166 (rev 02)
 
dmesg:
[    1.331934] debian-workstation kernel: ahci 0000:06:00.0: SSS flag set, parallel bus scan disabled
[    1.334903] debian-workstation kernel: r8169 0000:03:00.0 enp3s0: renamed from eth0
[    1.342297] debian-workstation kernel: ahci 0000:06:00.0: AHCI 0001.0301 32 slots 32 ports 6 Gbps 0xffffff3f impl SATA mode
[    1.342299] debian-workstation kernel: ahci 0000:06:00.0: flags: 64bit ncq sntf stag pm led only pio sxs deso sadm sds apst


I was able to fix the slow boot time with a small patch that sets force_port_map to 0x3f for this controller, but I have no idea if that's the proper way to handle this issue.

If there's any debug information missing just let me know.

Thank you!
Comment 1 Andre Brait 2024-01-09 07:17:02 UTC
I'm running into the same issue. Could you help me reproduce your own fix? I have two of these cards. It seems to be something that could be included in a patche as a quirk.
Comment 2 Conrad Kostecki 2024-01-23 19:07:55 UTC
See my patch: https://bugzilla.kernel.org/show_bug.cgi?id=218346
Comment 3 Conrad Kostecki 2024-01-24 19:59:34 UTC
Can be closed here, patch got applied by upstream: https://git.kernel.org/pub/scm/linux/kernel/git/libata/linux.git/commit/?h=for-6.8-fixes&id=0077a504e1a4468669fd2e011108db49133db56e
Comment 4 Conrad Kostecki 2024-01-29 08:29:04 UTC
Merged in 6.8rc2