1d22157b3SChris WrightWhat: /sys/bus/pci/drivers/.../bind 2d22157b3SChris WrightDate: December 2003 3d22157b3SChris WrightContact: linux-pci@vger.kernel.org 4d22157b3SChris WrightDescription: 5d22157b3SChris Wright Writing a device location to this file will cause 6d22157b3SChris Wright the driver to attempt to bind to the device found at 7d22157b3SChris Wright this location. This is useful for overriding default 8d22157b3SChris Wright bindings. The format for the location is: DDDD:BB:DD.F. 9d22157b3SChris Wright That is Domain:Bus:Device.Function and is the same as 10d22157b3SChris Wright found in /sys/bus/pci/devices/. For example: 11d22157b3SChris Wright # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/bind 12d22157b3SChris Wright (Note: kernels before 2.6.28 may require echo -n). 13d22157b3SChris Wright 14d22157b3SChris WrightWhat: /sys/bus/pci/drivers/.../unbind 15d22157b3SChris WrightDate: December 2003 16d22157b3SChris WrightContact: linux-pci@vger.kernel.org 17d22157b3SChris WrightDescription: 18d22157b3SChris Wright Writing a device location to this file will cause the 19d22157b3SChris Wright driver to attempt to unbind from the device found at 20d22157b3SChris Wright this location. This may be useful when overriding default 21d22157b3SChris Wright bindings. The format for the location is: DDDD:BB:DD.F. 22d22157b3SChris Wright That is Domain:Bus:Device.Function and is the same as 23d22157b3SChris Wright found in /sys/bus/pci/devices/. For example: 24d22157b3SChris Wright # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/unbind 25d22157b3SChris Wright (Note: kernels before 2.6.28 may require echo -n). 26d22157b3SChris Wright 27d22157b3SChris WrightWhat: /sys/bus/pci/drivers/.../new_id 28d22157b3SChris WrightDate: December 2003 29d22157b3SChris WrightContact: linux-pci@vger.kernel.org 30d22157b3SChris WrightDescription: 31d22157b3SChris Wright Writing a device ID to this file will attempt to 32d22157b3SChris Wright dynamically add a new device ID to a PCI device driver. 33d22157b3SChris Wright This may allow the driver to support more hardware than 34d22157b3SChris Wright was included in the driver's static device ID support 35d22157b3SChris Wright table at compile time. The format for the device ID is: 36d22157b3SChris Wright VVVV DDDD SVVV SDDD CCCC MMMM PPPP. That is Vendor ID, 37d22157b3SChris Wright Device ID, Subsystem Vendor ID, Subsystem Device ID, 38d22157b3SChris Wright Class, Class Mask, and Private Driver Data. The Vendor ID 39d22157b3SChris Wright and Device ID fields are required, the rest are optional. 40d22157b3SChris Wright Upon successfully adding an ID, the driver will probe 41d22157b3SChris Wright for the device and attempt to bind to it. For example: 42d22157b3SChris Wright # echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id 43d22157b3SChris Wright 440994375eSChris WrightWhat: /sys/bus/pci/drivers/.../remove_id 450994375eSChris WrightDate: February 2009 460994375eSChris WrightContact: Chris Wright <chrisw@sous-sol.org> 470994375eSChris WrightDescription: 480994375eSChris Wright Writing a device ID to this file will remove an ID 490994375eSChris Wright that was dynamically added via the new_id sysfs entry. 500994375eSChris Wright The format for the device ID is: 510994375eSChris Wright VVVV DDDD SVVV SDDD CCCC MMMM. That is Vendor ID, Device 520994375eSChris Wright ID, Subsystem Vendor ID, Subsystem Device ID, Class, 530994375eSChris Wright and Class Mask. The Vendor ID and Device ID fields are 540994375eSChris Wright required, the rest are optional. After successfully 550994375eSChris Wright removing an ID, the driver will no longer support the 560994375eSChris Wright device. This is useful to ensure auto probing won't 570994375eSChris Wright match the driver to the device. For example: 580994375eSChris Wright # echo "8086 10f5" > /sys/bus/pci/drivers/foo/remove_id 590994375eSChris Wright 60705b1aaaSAlex ChiangWhat: /sys/bus/pci/rescan 61705b1aaaSAlex ChiangDate: January 2009 62705b1aaaSAlex ChiangContact: Linux PCI developers <linux-pci@vger.kernel.org> 63705b1aaaSAlex ChiangDescription: 64705b1aaaSAlex Chiang Writing a non-zero value to this attribute will 65705b1aaaSAlex Chiang force a rescan of all PCI buses in the system, and 66705b1aaaSAlex Chiang re-discover previously removed devices. 67705b1aaaSAlex Chiang 68b50cac55SNeil HormanWhat: /sys/bus/pci/devices/.../msi_irqs/ 69b50cac55SNeil HormanDate: September, 2011 70b50cac55SNeil HormanContact: Neil Horman <nhorman@tuxdriver.com> 71b50cac55SNeil HormanDescription: 72b50cac55SNeil Horman The /sys/devices/.../msi_irqs directory contains a variable set 731c51b50cSGreg Kroah-Hartman of files, with each file being named after a corresponding msi 741c51b50cSGreg Kroah-Hartman irq vector allocated to that device. 75b50cac55SNeil Horman 761c51b50cSGreg Kroah-HartmanWhat: /sys/bus/pci/devices/.../msi_irqs/<N> 77b50cac55SNeil HormanDate: September 2011 78b50cac55SNeil HormanContact: Neil Horman <nhorman@tuxdriver.com> 79b50cac55SNeil HormanDescription: 80b50cac55SNeil Horman This attribute indicates the mode that the irq vector named by 811c51b50cSGreg Kroah-Hartman the file is in (msi vs. msix) 82b50cac55SNeil Horman 8377c27c7bSAlex ChiangWhat: /sys/bus/pci/devices/.../remove 8477c27c7bSAlex ChiangDate: January 2009 8577c27c7bSAlex ChiangContact: Linux PCI developers <linux-pci@vger.kernel.org> 8677c27c7bSAlex ChiangDescription: 8777c27c7bSAlex Chiang Writing a non-zero value to this attribute will 8877c27c7bSAlex Chiang hot-remove the PCI device and any of its children. 8977c27c7bSAlex Chiang 90b9d320fcSYinghai LuWhat: /sys/bus/pci/devices/.../pci_bus/.../rescan 91b9d320fcSYinghai LuDate: May 2011 92b9d320fcSYinghai LuContact: Linux PCI developers <linux-pci@vger.kernel.org> 93b9d320fcSYinghai LuDescription: 94b9d320fcSYinghai Lu Writing a non-zero value to this attribute will 95b9d320fcSYinghai Lu force a rescan of the bus and all child buses, 96b9d320fcSYinghai Lu and re-discover devices removed earlier from this 9740b31360SStephen Rothwell part of the device tree. 98b9d320fcSYinghai Lu 99738a6396SAlex ChiangWhat: /sys/bus/pci/devices/.../rescan 100738a6396SAlex ChiangDate: January 2009 101738a6396SAlex ChiangContact: Linux PCI developers <linux-pci@vger.kernel.org> 102738a6396SAlex ChiangDescription: 103738a6396SAlex Chiang Writing a non-zero value to this attribute will 104738a6396SAlex Chiang force a rescan of the device's parent bus and all 105738a6396SAlex Chiang child buses, and re-discover devices removed earlier 106738a6396SAlex Chiang from this part of the device tree. 107738a6396SAlex Chiang 108711d5779SMichael S. TsirkinWhat: /sys/bus/pci/devices/.../reset 109711d5779SMichael S. TsirkinDate: July 2009 110711d5779SMichael S. TsirkinContact: Michael S. Tsirkin <mst@redhat.com> 111711d5779SMichael S. TsirkinDescription: 112711d5779SMichael S. Tsirkin Some devices allow an individual function to be reset 113711d5779SMichael S. Tsirkin without affecting other functions in the same device. 114711d5779SMichael S. Tsirkin For devices that have this support, a file named reset 115711d5779SMichael S. Tsirkin will be present in sysfs. Writing 1 to this file 116711d5779SMichael S. Tsirkin will perform reset. 117711d5779SMichael S. Tsirkin 11894e61088SBen HutchingsWhat: /sys/bus/pci/devices/.../vpd 11994e61088SBen HutchingsDate: February 2008 12094e61088SBen HutchingsContact: Ben Hutchings <bhutchings@solarflare.com> 12194e61088SBen HutchingsDescription: 12294e61088SBen Hutchings A file named vpd in a device directory will be a 12394e61088SBen Hutchings binary file containing the Vital Product Data for the 12494e61088SBen Hutchings device. It should follow the VPD format defined in 12594e61088SBen Hutchings PCI Specification 2.1 or 2.2, but users should consider 12694e61088SBen Hutchings that some devices may have malformatted data. If the 12794e61088SBen Hutchings underlying VPD has a writable section then the 12894e61088SBen Hutchings corresponding section of this file will be writable. 12901db4957SYu Zhao 13001db4957SYu ZhaoWhat: /sys/bus/pci/devices/.../virtfnN 13101db4957SYu ZhaoDate: March 2009 13201db4957SYu ZhaoContact: Yu Zhao <yu.zhao@intel.com> 13301db4957SYu ZhaoDescription: 13401db4957SYu Zhao This symbolic link appears when hardware supports the SR-IOV 13501db4957SYu Zhao capability and the Physical Function driver has enabled it. 13601db4957SYu Zhao The symbolic link points to the PCI device sysfs entry of the 13701db4957SYu Zhao Virtual Function whose index is N (0...MaxVFs-1). 13801db4957SYu Zhao 13901db4957SYu ZhaoWhat: /sys/bus/pci/devices/.../dep_link 14001db4957SYu ZhaoDate: March 2009 14101db4957SYu ZhaoContact: Yu Zhao <yu.zhao@intel.com> 14201db4957SYu ZhaoDescription: 14301db4957SYu Zhao This symbolic link appears when hardware supports the SR-IOV 14401db4957SYu Zhao capability and the Physical Function driver has enabled it, 14501db4957SYu Zhao and this device has vendor specific dependencies with others. 14601db4957SYu Zhao The symbolic link points to the PCI device sysfs entry of 14701db4957SYu Zhao Physical Function this device depends on. 14801db4957SYu Zhao 14901db4957SYu ZhaoWhat: /sys/bus/pci/devices/.../physfn 15001db4957SYu ZhaoDate: March 2009 15101db4957SYu ZhaoContact: Yu Zhao <yu.zhao@intel.com> 15201db4957SYu ZhaoDescription: 15301db4957SYu Zhao This symbolic link appears when a device is a Virtual Function. 15401db4957SYu Zhao The symbolic link points to the PCI device sysfs entry of the 15501db4957SYu Zhao Physical Function this device associates with. 156c825bc94SKenji Kaneshige 157c825bc94SKenji KaneshigeWhat: /sys/bus/pci/slots/.../module 158c825bc94SKenji KaneshigeDate: June 2009 159c825bc94SKenji KaneshigeContact: linux-pci@vger.kernel.org 160c825bc94SKenji KaneshigeDescription: 161c825bc94SKenji Kaneshige This symbolic link points to the PCI hotplug controller driver 162c825bc94SKenji Kaneshige module that manages the hotplug slot. 163911e1c9bSNarendra K 164911e1c9bSNarendra KWhat: /sys/bus/pci/devices/.../label 165911e1c9bSNarendra KDate: July 2010 166911e1c9bSNarendra KContact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com 167911e1c9bSNarendra KDescription: 168911e1c9bSNarendra K Reading this attribute will provide the firmware 1696058989bSNarendra_K@Dell.com given name (SMBIOS type 41 string or ACPI _DSM string) of 1706058989bSNarendra_K@Dell.com the PCI device. The attribute will be created only 1716058989bSNarendra_K@Dell.com if the firmware has given a name to the PCI device. 1726058989bSNarendra_K@Dell.com ACPI _DSM string name will be given priority if the 1736058989bSNarendra_K@Dell.com system firmware provides SMBIOS type 41 string also. 174911e1c9bSNarendra KUsers: 175911e1c9bSNarendra K Userspace applications interested in knowing the 176911e1c9bSNarendra K firmware assigned name of the PCI device. 177911e1c9bSNarendra K 178911e1c9bSNarendra KWhat: /sys/bus/pci/devices/.../index 179911e1c9bSNarendra KDate: July 2010 180911e1c9bSNarendra KContact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com 181911e1c9bSNarendra KDescription: 182911e1c9bSNarendra K Reading this attribute will provide the firmware 1836058989bSNarendra_K@Dell.com given instance (SMBIOS type 41 device type instance) of the 1846058989bSNarendra_K@Dell.com PCI device. The attribute will be created only if the firmware 1856058989bSNarendra_K@Dell.com has given an instance number to the PCI device. 186911e1c9bSNarendra KUsers: 187911e1c9bSNarendra K Userspace applications interested in knowing the 188911e1c9bSNarendra K firmware assigned device type instance of the PCI 189911e1c9bSNarendra K device that can help in understanding the firmware 190911e1c9bSNarendra K intended order of the PCI device. 1916058989bSNarendra_K@Dell.com 1926058989bSNarendra_K@Dell.comWhat: /sys/bus/pci/devices/.../acpi_index 1936058989bSNarendra_K@Dell.comDate: July 2010 1946058989bSNarendra_K@Dell.comContact: Narendra K <narendra_k@dell.com>, linux-bugs@dell.com 1956058989bSNarendra_K@Dell.comDescription: 1966058989bSNarendra_K@Dell.com Reading this attribute will provide the firmware 1976058989bSNarendra_K@Dell.com given instance (ACPI _DSM instance number) of the PCI device. 1986058989bSNarendra_K@Dell.com The attribute will be created only if the firmware has given 1996058989bSNarendra_K@Dell.com an instance number to the PCI device. ACPI _DSM instance number 2006058989bSNarendra_K@Dell.com will be given priority if the system firmware provides SMBIOS 2016058989bSNarendra_K@Dell.com type 41 device type instance also. 2026058989bSNarendra_K@Dell.comUsers: 2036058989bSNarendra_K@Dell.com Userspace applications interested in knowing the 2046058989bSNarendra_K@Dell.com firmware assigned instance number of the PCI 2056058989bSNarendra_K@Dell.com device that can help in understanding the firmware 2066058989bSNarendra_K@Dell.com intended order of the PCI device. 207046c6531SHuang Ying 208046c6531SHuang YingWhat: /sys/bus/pci/devices/.../d3cold_allowed 209046c6531SHuang YingDate: July 2012 210046c6531SHuang YingContact: Huang Ying <ying.huang@intel.com> 211046c6531SHuang YingDescription: 212046c6531SHuang Ying d3cold_allowed is bit to control whether the corresponding PCI 213046c6531SHuang Ying device can be put into D3Cold state. If it is cleared, the 214046c6531SHuang Ying device will never be put into D3Cold state. If it is set, the 215046c6531SHuang Ying device may be put into D3Cold state if other requirements are 216046c6531SHuang Ying satisfied too. Reading this attribute will show the current 217046c6531SHuang Ying value of d3cold_allowed bit. Writing this attribute will set 218046c6531SHuang Ying the value of d3cold_allowed bit. 2192597ba76SDonald Dutile 2202597ba76SDonald DutileWhat: /sys/bus/pci/devices/.../sriov_totalvfs 2212597ba76SDonald DutileDate: November 2012 2222597ba76SDonald DutileContact: Donald Dutile <ddutile@redhat.com> 2232597ba76SDonald DutileDescription: 2242597ba76SDonald Dutile This file appears when a physical PCIe device supports SR-IOV. 2252597ba76SDonald Dutile Userspace applications can read this file to determine the 2262597ba76SDonald Dutile maximum number of Virtual Functions (VFs) a PCIe physical 2272597ba76SDonald Dutile function (PF) can support. Typically, this is the value reported 2282597ba76SDonald Dutile in the PF's SR-IOV extended capability structure's TotalVFs 2292597ba76SDonald Dutile element. Drivers have the ability at probe time to reduce the 2302597ba76SDonald Dutile value read from this file via the pci_sriov_set_totalvfs() 2312597ba76SDonald Dutile function. 2322597ba76SDonald Dutile 2332597ba76SDonald DutileWhat: /sys/bus/pci/devices/.../sriov_numvfs 2342597ba76SDonald DutileDate: November 2012 2352597ba76SDonald DutileContact: Donald Dutile <ddutile@redhat.com> 2362597ba76SDonald DutileDescription: 2372597ba76SDonald Dutile This file appears when a physical PCIe device supports SR-IOV. 2382597ba76SDonald Dutile Userspace applications can read and write to this file to 2392597ba76SDonald Dutile determine and control the enablement or disablement of Virtual 2402597ba76SDonald Dutile Functions (VFs) on the physical function (PF). A read of this 2412597ba76SDonald Dutile file will return the number of VFs that are enabled on this PF. 2422597ba76SDonald Dutile A number written to this file will enable the specified 2432597ba76SDonald Dutile number of VFs. A userspace application would typically read the 2442597ba76SDonald Dutile file and check that the value is zero, and then write the number 2452597ba76SDonald Dutile of VFs that should be enabled on the PF; the value written 2462597ba76SDonald Dutile should be less than or equal to the value in the sriov_totalvfs 2472597ba76SDonald Dutile file. A userspace application wanting to disable the VFs would 2482597ba76SDonald Dutile write a zero to this file. The core ensures that valid values 2492597ba76SDonald Dutile are written to this file, and returns errors when values are not 2502597ba76SDonald Dutile valid. For example, writing a 2 to this file when sriov_numvfs 2512597ba76SDonald Dutile is not 0 and not 2 already will return an error. Writing a 10 2522597ba76SDonald Dutile when the value of sriov_totalvfs is 8 will return an error. 253*782a985dSAlex Williamson 254*782a985dSAlex WilliamsonWhat: /sys/bus/pci/devices/.../driver_override 255*782a985dSAlex WilliamsonDate: April 2014 256*782a985dSAlex WilliamsonContact: Alex Williamson <alex.williamson@redhat.com> 257*782a985dSAlex WilliamsonDescription: 258*782a985dSAlex Williamson This file allows the driver for a device to be specified which 259*782a985dSAlex Williamson will override standard static and dynamic ID matching. When 260*782a985dSAlex Williamson specified, only a driver with a name matching the value written 261*782a985dSAlex Williamson to driver_override will have an opportunity to bind to the 262*782a985dSAlex Williamson device. The override is specified by writing a string to the 263*782a985dSAlex Williamson driver_override file (echo pci-stub > driver_override) and 264*782a985dSAlex Williamson may be cleared with an empty string (echo > driver_override). 265*782a985dSAlex Williamson This returns the device to standard matching rules binding. 266*782a985dSAlex Williamson Writing to driver_override does not automatically unbind the 267*782a985dSAlex Williamson device from its current driver or make any attempt to 268*782a985dSAlex Williamson automatically load the specified driver. If no driver with a 269*782a985dSAlex Williamson matching name is currently loaded in the kernel, the device 270*782a985dSAlex Williamson will not bind to any driver. This also allows devices to 271*782a985dSAlex Williamson opt-out of driver binding using a driver_override name such as 272*782a985dSAlex Williamson "none". Only a single driver may be specified in the override, 273*782a985dSAlex Williamson there is no support for parsing delimiters. 274