xref: /linux/Documentation/ABI/testing/sysfs-bus-pci (revision 48d09e97876bed4bcc503d528bdba8c907e43cb3)
1What:		/sys/bus/pci/drivers/.../bind
2What:		/sys/devices/pciX/.../bind
3Date:		December 2003
4Contact:	linux-pci@vger.kernel.org
5Description:
6		Writing a device location to this file will cause
7		the driver to attempt to bind to the device found at
8		this location.	This is useful for overriding default
9		bindings.  The format for the location is: DDDD:BB:DD.F.
10		That is Domain:Bus:Device.Function and is the same as
11		found in /sys/bus/pci/devices/.  For example::
12
13		  # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/bind
14
15		(Note: kernels before 2.6.28 may require echo -n).
16
17What:		/sys/bus/pci/drivers/.../unbind
18What:		/sys/devices/pciX/.../unbind
19Date:		December 2003
20Contact:	linux-pci@vger.kernel.org
21Description:
22		Writing a device location to this file will cause the
23		driver to attempt to unbind from the device found at
24		this location.	This may be useful when overriding default
25		bindings.  The format for the location is: DDDD:BB:DD.F.
26		That is Domain:Bus:Device.Function and is the same as
27		found in /sys/bus/pci/devices/. For example::
28
29		  # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/unbind
30
31		(Note: kernels before 2.6.28 may require echo -n).
32
33What:		/sys/bus/pci/drivers/.../new_id
34What:		/sys/devices/pciX/.../new_id
35Date:		December 2003
36Contact:	linux-pci@vger.kernel.org
37Description:
38		Writing a device ID to this file will attempt to
39		dynamically add a new device ID to a PCI device driver.
40		This may allow the driver to support more hardware than
41		was included in the driver's static device ID support
42		table at compile time.  The format for the device ID is:
43		VVVV DDDD SVVV SDDD CCCC MMMM PPPP.  That is Vendor ID,
44		Device ID, Subsystem Vendor ID, Subsystem Device ID,
45		Class, Class Mask, and Private Driver Data.  The Vendor ID
46		and Device ID fields are required, the rest are optional.
47		Upon successfully adding an ID, the driver will probe
48		for the device and attempt to bind to it.  For example::
49
50		  # echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id
51
52What:		/sys/bus/pci/drivers/.../remove_id
53What:		/sys/devices/pciX/.../remove_id
54Date:		February 2009
55Contact:	Chris Wright <chrisw@sous-sol.org>
56Description:
57		Writing a device ID to this file will remove an ID
58		that was dynamically added via the new_id sysfs entry.
59		The format for the device ID is:
60		VVVV DDDD SVVV SDDD CCCC MMMM.	That is Vendor ID, Device
61		ID, Subsystem Vendor ID, Subsystem Device ID, Class,
62		and Class Mask.  The Vendor ID and Device ID fields are
63		required, the rest are optional.  After successfully
64		removing an ID, the driver will no longer support the
65		device.  This is useful to ensure auto probing won't
66		match the driver to the device.  For example::
67
68		  # echo "8086 10f5" > /sys/bus/pci/drivers/foo/remove_id
69
70What:		/sys/bus/pci/rescan
71Date:		January 2009
72Contact:	Linux PCI developers <linux-pci@vger.kernel.org>
73Description:
74		Writing a non-zero value to this attribute will
75		force a rescan of all PCI buses in the system, and
76		re-discover previously removed devices.
77
78What:		/sys/bus/pci/devices/.../msi_bus
79Date:		September 2014
80Contact:	Linux PCI developers <linux-pci@vger.kernel.org>
81Description:
82		Writing a zero value to this attribute disallows MSI and
83		MSI-X for any future drivers of the device.  If the device
84		is a bridge, MSI and MSI-X will be disallowed for future
85		drivers of all child devices under the bridge.  Drivers
86		must be reloaded for the new setting to take effect.
87
88What:		/sys/bus/pci/devices/.../msi_irqs/
89Date:		September, 2011
90Contact:	Neil Horman <nhorman@tuxdriver.com>
91Description:
92		The /sys/devices/.../msi_irqs directory contains a variable set
93		of files, with each file being named after a corresponding msi
94		irq vector allocated to that device.
95
96What:		/sys/bus/pci/devices/.../msi_irqs/<N>
97Date:		September 2011
98Contact:	Neil Horman <nhorman@tuxdriver.com>
99Description:
100		This attribute indicates the mode that the irq vector named by
101		the file is in (msi vs. msix)
102
103What:		/sys/bus/pci/devices/.../remove
104Date:		January 2009
105Contact:	Linux PCI developers <linux-pci@vger.kernel.org>
106Description:
107		Writing a non-zero value to this attribute will
108		hot-remove the PCI device and any of its children.
109
110What:		/sys/bus/pci/devices/.../pci_bus/.../rescan
111Date:		May 2011
112Contact:	Linux PCI developers <linux-pci@vger.kernel.org>
113Description:
114		Writing a non-zero value to this attribute will
115		force a rescan of the bus and all child buses,
116		and re-discover devices removed earlier from this
117		part of the device tree.
118
119What:		/sys/bus/pci/devices/.../rescan
120Date:		January 2009
121Contact:	Linux PCI developers <linux-pci@vger.kernel.org>
122Description:
123		Writing a non-zero value to this attribute will
124		force a rescan of the device's parent bus and all
125		child buses, and re-discover devices removed earlier
126		from this part of the device tree.
127
128What:		/sys/bus/pci/devices/.../reset_method
129Date:		August 2021
130Contact:	Amey Narkhede <ameynarkhede03@gmail.com>
131Description:
132		Some devices allow an individual function to be reset
133		without affecting other functions in the same slot.
134
135		For devices that have this support, a file named
136		reset_method is present in sysfs.  Reading this file
137		gives names of the supported and enabled reset methods and
138		their ordering.  Writing a space-separated list of names of
139		reset methods sets the reset methods and ordering to be
140		used when resetting the device.  Writing an empty string
141		disables the ability to reset the device.  Writing
142		"default" enables all supported reset methods in the
143		default ordering.
144
145What:		/sys/bus/pci/devices/.../reset
146Date:		July 2009
147Contact:	Michael S. Tsirkin <mst@redhat.com>
148Description:
149		Some devices allow an individual function to be reset
150		without affecting other functions in the same device.
151		For devices that have this support, a file named reset
152		will be present in sysfs.  Writing 1 to this file
153		will perform reset.
154
155What:		/sys/bus/pci/devices/.../vpd
156Date:		February 2008
157Contact:	Ben Hutchings <bwh@kernel.org>
158Description:
159		A file named vpd in a device directory will be a
160		binary file containing the Vital Product Data for the
161		device.  It should follow the VPD format defined in
162		PCI Specification 2.1 or 2.2, but users should consider
163		that some devices may have incorrectly formatted data.
164		If the underlying VPD has a writable section then the
165		corresponding section of this file will be writable.
166
167What:		/sys/bus/pci/devices/.../virtfn<N>
168Date:		March 2009
169Contact:	Yu Zhao <yu.zhao@intel.com>
170Description:
171		This symbolic link appears when hardware supports the SR-IOV
172		capability and the Physical Function driver has enabled it.
173		The symbolic link points to the PCI device sysfs entry of the
174		Virtual Function whose index is N (0...MaxVFs-1).
175
176What:		/sys/bus/pci/devices/.../dep_link
177Date:		March 2009
178Contact:	Yu Zhao <yu.zhao@intel.com>
179Description:
180		This symbolic link appears when hardware supports the SR-IOV
181		capability and the Physical Function driver has enabled it,
182		and this device has vendor specific dependencies with others.
183		The symbolic link points to the PCI device sysfs entry of
184		Physical Function this device depends on.
185
186What:		/sys/bus/pci/devices/.../physfn
187Date:		March 2009
188Contact:	Yu Zhao <yu.zhao@intel.com>
189Description:
190		This symbolic link appears when a device is a Virtual Function.
191		The symbolic link points to the PCI device sysfs entry of the
192		Physical Function this device associates with.
193
194What:		/sys/bus/pci/devices/.../modalias
195Date:		May 2005
196Contact:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
197Description:
198		This attribute indicates the PCI ID of the device object.
199
200		That is in the format:
201		pci:vXXXXXXXXdXXXXXXXXsvXXXXXXXXsdXXXXXXXXbcXXscXXiXX,
202		where:
203
204		    - vXXXXXXXX contains the vendor ID;
205		    - dXXXXXXXX contains the device ID;
206		    - svXXXXXXXX contains the sub-vendor ID;
207		    - sdXXXXXXXX contains the subsystem device ID;
208		    - bcXX contains the device class;
209		    - scXX contains the device subclass;
210		    - iXX contains the device class programming interface.
211
212What:		/sys/bus/pci/slots/.../module
213Date:		June 2009
214Contact:	linux-pci@vger.kernel.org
215Description:
216		This symbolic link points to the PCI hotplug controller driver
217		module that manages the hotplug slot.
218
219What:		/sys/bus/pci/devices/.../label
220Date:		July 2010
221Contact:	Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
222Description:
223		Reading this attribute will provide the firmware
224		given name (SMBIOS type 41 string or ACPI _DSM string) of
225		the PCI device.	The attribute will be created only
226		if the firmware	has given a name to the PCI device.
227		ACPI _DSM string name will be given priority if the
228		system firmware provides SMBIOS type 41 string also.
229Users:
230		Userspace applications interested in knowing the
231		firmware assigned name of the PCI device.
232
233What:		/sys/bus/pci/devices/.../index
234Date:		July 2010
235Contact:	Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
236Description:
237		Reading this attribute will provide the firmware given instance
238		number of the PCI device.  Depending on the platform this can
239		be for example the SMBIOS type 41 device type instance or the
240		user-defined ID (UID) on s390. The attribute will be created
241		only if the firmware has given an instance number to the PCI
242		device and that number is guaranteed to uniquely identify the
243		device in the system.
244Users:
245		Userspace applications interested in knowing the
246		firmware assigned device type instance of the PCI
247		device that can help in understanding the firmware
248		intended order of the PCI device.
249
250What:		/sys/bus/pci/devices/.../acpi_index
251Date:		July 2010
252Contact:	Narendra K <narendra_k@dell.com>, linux-bugs@dell.com
253Description:
254		Reading this attribute will provide the firmware
255		given instance (ACPI _DSM instance number) of the PCI device.
256		The attribute will be created only if the firmware has given
257		an instance number to the PCI device. ACPI _DSM instance number
258		will be given priority if the system firmware provides SMBIOS
259		type 41 device type instance also.
260Users:
261		Userspace applications interested in knowing the
262		firmware assigned instance number of the PCI
263		device that can help in understanding the firmware
264		intended order of the PCI device.
265
266What:		/sys/bus/pci/devices/.../d3cold_allowed
267Date:		July 2012
268Contact:	Huang Ying <ying.huang@intel.com>
269Description:
270		d3cold_allowed is bit to control whether the corresponding PCI
271		device can be put into D3Cold state.  If it is cleared, the
272		device will never be put into D3Cold state.  If it is set, the
273		device may be put into D3Cold state if other requirements are
274		satisfied too.  Reading this attribute will show the current
275		value of d3cold_allowed bit.  Writing this attribute will set
276		the value of d3cold_allowed bit.
277
278What:		/sys/bus/pci/devices/.../sriov_totalvfs
279Date:		November 2012
280Contact:	Donald Dutile <ddutile@redhat.com>
281Description:
282		This file appears when a physical PCIe device supports SR-IOV.
283		Userspace applications can read this file to determine the
284		maximum number of Virtual Functions (VFs) a PCIe physical
285		function (PF) can support. Typically, this is the value reported
286		in the PF's SR-IOV extended capability structure's TotalVFs
287		element.  Drivers have the ability at probe time to reduce the
288		value read from this file via the pci_sriov_set_totalvfs()
289		function.
290
291What:		/sys/bus/pci/devices/.../sriov_numvfs
292Date:		November 2012
293Contact:	Donald Dutile <ddutile@redhat.com>
294Description:
295		This file appears when a physical PCIe device supports SR-IOV.
296		Userspace applications can read and write to this file to
297		determine and control the enablement or disablement of Virtual
298		Functions (VFs) on the physical function (PF). A read of this
299		file will return the number of VFs that are enabled on this PF.
300		A number written to this file will enable the specified
301		number of VFs. A userspace application would typically read the
302		file and check that the value is zero, and then write the number
303		of VFs that should be enabled on the PF; the value written
304		should be less than or equal to the value in the sriov_totalvfs
305		file. A userspace application wanting to disable the VFs would
306		write a zero to this file. The core ensures that valid values
307		are written to this file, and returns errors when values are not
308		valid.  For example, writing a 2 to this file when sriov_numvfs
309		is not 0 and not 2 already will return an error. Writing a 10
310		when the value of sriov_totalvfs is 8 will return an error.
311
312What:		/sys/bus/pci/devices/.../driver_override
313Date:		April 2014
314Contact:	Alex Williamson <alex.williamson@redhat.com>
315Description:
316		This file allows the driver for a device to be specified which
317		will override standard static and dynamic ID matching.  When
318		specified, only a driver with a name matching the value written
319		to driver_override will have an opportunity to bind to the
320		device.  The override is specified by writing a string to the
321		driver_override file (echo pci-stub > driver_override) and
322		may be cleared with an empty string (echo > driver_override).
323		This returns the device to standard matching rules binding.
324		Writing to driver_override does not automatically unbind the
325		device from its current driver or make any attempt to
326		automatically load the specified driver.  If no driver with a
327		matching name is currently loaded in the kernel, the device
328		will not bind to any driver.  This also allows devices to
329		opt-out of driver binding using a driver_override name such as
330		"none".  Only a single driver may be specified in the override,
331		there is no support for parsing delimiters.
332
333What:		/sys/bus/pci/devices/.../numa_node
334Date:		Oct 2014
335Contact:	Prarit Bhargava <prarit@redhat.com>
336Description:
337		This file contains the NUMA node to which the PCI device is
338		attached, or -1 if the node is unknown.  The initial value
339		comes from an ACPI _PXM method or a similar firmware
340		source.  If that is missing or incorrect, this file can be
341		written to override the node.  In that case, please report
342		a firmware bug to the system vendor.  Writing to this file
343		taints the kernel with TAINT_FIRMWARE_WORKAROUND, which
344		reduces the supportability of your system.
345
346What:		/sys/bus/pci/devices/.../revision
347Date:		November 2016
348Contact:	Emil Velikov <emil.l.velikov@gmail.com>
349Description:
350		This file contains the revision field of the PCI device.
351		The value comes from device config space. The file is read only.
352
353What:		/sys/bus/pci/devices/.../sriov_drivers_autoprobe
354Date:		April 2017
355Contact:	Bodong Wang<bodong@mellanox.com>
356Description:
357		This file is associated with the PF of a device that
358		supports SR-IOV.  It determines whether newly-enabled VFs
359		are immediately bound to a driver.  It initially contains
360		1, which means the kernel automatically binds VFs to a
361		compatible driver immediately after they are enabled.  If
362		an application writes 0 to the file before enabling VFs,
363		the kernel will not bind VFs to a driver.
364
365		A typical use case is to write 0 to this file, then enable
366		VFs, then assign the newly-created VFs to virtual machines.
367		Note that changing this file does not affect already-
368		enabled VFs.  In this scenario, the user must first disable
369		the VFs, write 0 to sriov_drivers_autoprobe, then re-enable
370		the VFs.
371
372		This is similar to /sys/bus/pci/drivers_autoprobe, but
373		affects only the VFs associated with a specific PF.
374
375What:		/sys/bus/pci/devices/.../p2pmem/size
376Date:		November 2017
377Contact:	Logan Gunthorpe <logang@deltatee.com>
378Description:
379		If the device has any Peer-to-Peer memory registered, this
380	        file contains the total amount of memory that the device
381		provides (in decimal).
382
383What:		/sys/bus/pci/devices/.../p2pmem/available
384Date:		November 2017
385Contact:	Logan Gunthorpe <logang@deltatee.com>
386Description:
387		If the device has any Peer-to-Peer memory registered, this
388	        file contains the amount of memory that has not been
389		allocated (in decimal).
390
391What:		/sys/bus/pci/devices/.../p2pmem/published
392Date:		November 2017
393Contact:	Logan Gunthorpe <logang@deltatee.com>
394Description:
395		If the device has any Peer-to-Peer memory registered, this
396	        file contains a '1' if the memory has been published for
397		use outside the driver that owns the device.
398
399What:		/sys/bus/pci/devices/.../link/clkpm
400		/sys/bus/pci/devices/.../link/l0s_aspm
401		/sys/bus/pci/devices/.../link/l1_aspm
402		/sys/bus/pci/devices/.../link/l1_1_aspm
403		/sys/bus/pci/devices/.../link/l1_2_aspm
404		/sys/bus/pci/devices/.../link/l1_1_pcipm
405		/sys/bus/pci/devices/.../link/l1_2_pcipm
406Date:		October 2019
407Contact:	Heiner Kallweit <hkallweit1@gmail.com>
408Description:	If ASPM is supported for an endpoint, these files can be
409		used to disable or enable the individual power management
410		states. Write y/1/on to enable, n/0/off to disable.
411
412What:		/sys/bus/pci/devices/.../power_state
413Date:		November 2020
414Contact:	Linux PCI developers <linux-pci@vger.kernel.org>
415Description:
416		This file contains the current PCI power state of the device.
417		The value comes from the PCI kernel device state and can be one
418		of: "unknown", "error", "D0", D1", "D2", "D3hot", "D3cold".
419		The file is read only.
420
421What:		/sys/bus/pci/devices/.../sriov_vf_total_msix
422Date:		January 2021
423Contact:	Leon Romanovsky <leonro@nvidia.com>
424Description:
425		This file is associated with a SR-IOV physical function (PF).
426		It contains the total number of MSI-X vectors available for
427		assignment to all virtual functions (VFs) associated with PF.
428		The value will be zero if the device doesn't support this
429		functionality. For supported devices, the value will be
430		constant and won't be changed after MSI-X vectors assignment.
431
432What:		/sys/bus/pci/devices/.../sriov_vf_msix_count
433Date:		January 2021
434Contact:	Leon Romanovsky <leonro@nvidia.com>
435Description:
436		This file is associated with a SR-IOV virtual function (VF).
437		It allows configuration of the number of MSI-X vectors for
438		the VF. This allows devices that have a global pool of MSI-X
439		vectors to optimally divide them between VFs based on VF usage.
440
441		The values accepted are:
442		 * > 0 - this number will be reported as the Table Size in the
443			 VF's MSI-X capability
444		 * < 0 - not valid
445		 * = 0 - will reset to the device default value
446
447		The file is writable if the PF is bound to a driver that
448		implements ->sriov_set_msix_vec_count().
449