AHCI(4)
β¨ AHCI(4) β¨
the Serial ATA Advanced Host Controller Interface driver, bestie π
okay so like, this is the ahci driver manual page from the Kernel Interfaces Manual, and I'm gonna walk you through it because it's honestly iconic and you deserve to know β¨
πΈ NAME πΈ
ahci β Serial ATA Advanced Host Controller Interface driver
like, it's the driver that talks to your SATA stuff, no cap π«Ά
π SYNOPSIS π
so to compile this driver into the kernel (very main character energy), you put these lines in your kernel configuration file:
device pci
device scbus
device ahci
alternatively, if you wanna load it as a module at boot time (lowkey easier), you put this line in loader.conf(5):
ahci_load="YES"
the following tunables are settable from the loader(8):
β hint.ahci.X.msi
controls Message Signaled Interrupts (MSI) usage by the specified controller. the values are:
0β MSI disabled;1β single MSI vector used, if supported;2β multiple MSI vectors used, if supported (this is the default, slay);
π¦ hint.ahci.X.ccc
controls Command Completion Coalescing (CCC) usage by the specified controller. a non-zero value enables CCC and defines maximum time (in ms) a request can wait for interrupt, if there are some more requests present on controller queue. CCC reduces number of context switches on systems with many parallel requests, but ngl it can decrease disk performance on some workloads due to additional command latency. it's giving tradeoffs π
π hint.ahci.X.direct
controls whether the driver should use direct command completion from interrupt thread(s), or queue them to CAM completion threads. the default value depends on number of MSI interrupts supported and number of implemented SATA ports. iykyk
π hint.ahci.X.em
controls whether the driver should implement virtual enclosure management device on top of SGPIO or other interface. default value depends on controller capabilities. very demure, very mindful β¨
π hint.ahcich.X.pm_level
controls SATA interface Power Management for the specified channel, allowing some power to be saved at the cost of additional command latency. the possible values are:
0β interface Power Management is disabled (default);1β device is allowed to initiate PM state change, host is passive;2β host initiates PARTIAL PM state transition every time port becomes idle;3β host initiates SLUMBER PM state transition every time port becomes idle.4β driver initiates PARTIAL PM state transition 1ms after port becomes idle;5β driver initiates SLUMBER PM state transition 125ms after port becomes idle.
some controllers, such as ICH8, do not implement modes 2 and 3 with NCQ used π because of artificial entering latency, performance degradation in modes 4 and 5 is much smaller then in modes 2 and 3. fr fr.
note that interface Power Management complicates device presence detection. a manual bus reset/rescan may be needed after device hot-plug, unless hardware implements Cold Presence Detection. you've been warned bestie π
π§ hint.ahcich.X.sata_rev
setting to nonzero value limits maximum SATA revision (speed). values 1, 2 and 3 are respectively 1.5, 3 and 6Gbps. love that for us π
π hw.ahci.force
setting to nonzero value forces driver attach to some known AHCI-capable chips even if they are configured for legacy IDE emulation. default is 1. it's giving persistence π₯
π DESCRIPTION π
okay so this driver provides the CAM(4) subsystem with native access to the SATA ports of AHCI-compatible controllers. every SATA port found is represented to CAM as a separate bus with one target, or, if HBA supports Port Multipliers, 16 targets. most of the bus-management details are handled by the SATA-specific transport of CAM. connected ATA disks are handled by the ATA protocol disk peripheral driver ada(4). ATAPI devices are handled by the SCSI protocol peripheral drivers cd(4), da(4), sa(4), etc. it's literally the whole ecosystem π«Ά
driver features include support for:
- Serial ATA and ATAPI devices
- Port Multipliers (including FIS-based switching, when supported)
- hardware command queues (up to 32 commands per port)
- Native Command Queuing
- SATA interface Power Management
- device hot-plug
- Message Signaled Interrupts
that's a lot of features and honestly? we're obsessed π β¨
driver supports "LED" enclosure management messages, defined by the AHCI. when supported by hardware, it allows to control per-port activity, locate and fault LEDs via the led(4) API or emulated ses(4) device for localization and status reporting purposes. supporting AHCI controllers may transmit that information to the backplane controllers via SGPIO interface. backplane controllers interpret received statuses in some way (IBPI standard) to report them using present indicators. it's giving communication, networking, friendship π
π¦ HARDWARE π¦
the ahci driver supports AHCI compatible controllers having PCI class 1 (mass storage), subclass 6 (SATA) and programming interface 1 (AHCI).
also, in cooperation with atamarvell and atajmicron drivers of ata(4), it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, such as JMicron JMB36x and Marvell 88SE61xx. teamwork makes the dream work fr π«Ά
the ahci driver also supports AHCI devices that act as PCI bridges for nvme(4) using Intel Rapid Storage Technology (RST). to use the nvme(4) device, either one must set the SATA mode in the BIOS to AHCI (from RST), or one must accept the performance with RST enabled due to interrupt sharing. FreeBSD will automatically detect AHCI devices with this extension that are in RST mode. when that happens, ahci will attach nvme(4) children to the ahci device. it's giving family tree ππ
π FILES π
/dev/led/ahci*.*.actβ activity LED device nodes/dev/led/ahci*.*.faultβ fault LED device nodes/dev/led/ahci*.*.locateβ locate LED device nodes
the LED files, they're iconic β¨
π SYSCTL π
dev.ahcich.X.disable_phy
set to 1 to disable the phy for the drive on channel X. set to 0 to enable the phy. useful for turning off troublemakers π€ also useful for debugging when you need the ada drive to come and go. very "block and unblock" energy, we've all been there π
π SEE ALSO π
ada(4), ata(4), cam(4), cd(4), da(4), sa(4), ses(4)
go read them bestie, they're all connected π«Ά
πΈ HISTORY πΈ
the ahci driver first appeared in FreeBSD 8.0. a classic, a legend, an icon π
π¦ AUTHORS π¦
Alexander Motin <mav@FreeBSD.org>
we love a credited icon π
and that's the whole thing! this absolute slay of a manpage was brought to you by Debian, dated December 17, 2021 β like the whole page is giving vintage but make it fresh β¨ππ
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2009-2013 Alexander Motin <mav@FreeBSD.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms