Reset individual functions without affecting other functions or the link
FLR (Function Level Reset) resets a single PCIe function to its initial state without affecting other functions in the same device or the PCIe link. Essential for virtualization and error recovery.
| Reset Type | Scope | Link Impact |
|---|---|---|
| Fundamental Reset | Entire device | Link down (LTSSM to Detect) |
| Hot Reset | Entire device | TS1 with Hot Reset bit |
| FLR | Single function | No link impact |
Device Capabilities Register (Offset 04h in PCIe Capability):
┌──────────────────────────────────────────────────────────────┐
│ Bit 28: FLR Capable │
│ 0 = Function does not support FLR │
│ 1 = Function supports FLR │
└──────────────────────────────────────────────────────────────┘
Device Control Register (Offset 08h in PCIe Capability):
┌──────────────────────────────────────────────────────────────┐
│ Bit 15: Initiate Function Level Reset │
│ Write 1 to initiate FLR │
│ Self-clearing (reads as 0) │
└──────────────────────────────────────────────────────────────┘
1. Software quiesces function (stop I/O)
│
2. Disable Bus Master Enable
│
3. Wait for outstanding transactions (Completion Timeout)
│
4. Write 1 to Initiate FLR bit
│
5. Wait 100ms (or per Readiness Time Reporting)
│
6. Check for FRS message (if supported)
│
7. Reconfigure function
# Check FLR capability
lspci -vvv -s 03:00.0 | grep "FLReset"
# Trigger FLR via sysfs
echo 1 > /sys/bus/pci/devices/0000:03:00.0/reset
# Using setpci
# Read Device Control, set bit 15, write back