|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1 |
|
| #
a3282f84 |
| 20-Jan-2025 |
Rakesh Babu Saladi <[email protected]> |
PCI: switchtec: Add Microchip PCI100X device IDs
Add Microchip parts to the Device ID table so the driver supports PCI100x devices.
Add a new macro to quirk the Microchip Switchtec PCI100x parts to
PCI: switchtec: Add Microchip PCI100X device IDs
Add Microchip parts to the Device ID table so the driver supports PCI100x devices.
Add a new macro to quirk the Microchip Switchtec PCI100x parts to allow DMA access via NTB to work when the IOMMU is turned on.
PCI100x family has 6 variants; each variant is designed for different application usages, different port counts and lane counts:
PCI1001 has 1 x4 upstream port and 3 x4 downstream ports PCI1002 has 1 x4 upstream port and 4 x2 downstream ports PCI1003 has 2 x4 upstream ports, 2 x2 upstream ports, and 2 x2 downstream ports PCI1004 has 4 x4 upstream ports PCI1005 has 1 x4 upstream port and 6 x2 downstream ports PCI1006 has 6 x2 upstream ports and 2 x2 downstream ports
[Historical note: these parts use PCI_VENDOR_ID_EFAR (0x1055), from EFAR Microsystems, which was acquired in 1996 by Standard Microsystems Corp, which was acquired by Microchip Technology in 2012. The PCI-SIG confirms that Vendor ID 0x1055 is assigned to Microchip even though it's not visible via https://pcisig.com/membership/member-companies]
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rakesh Babu Saladi <[email protected]> [bhelgaas: Vendor ID history] Signed-off-by: Bjorn Helgaas <[email protected]> Acked-By: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4, v6.11-rc3, v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4 |
|
| #
8a74e4ea |
| 10-Jun-2024 |
Greg Kroah-Hartman <[email protected]> |
PCI: switchtec: Make switchtec_class constant
Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them in
PCI: switchtec: Make switchtec_class constant
Now that the driver core allows for struct class to be in read-only memory, we should make all 'class' structures declared at build time placing them into read-only memory, instead of having to be dynamically allocated at runtime.
Link: https://lore.kernel.org/r/2024061053-online-unwound-b173@gregkh Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-By: Logan Gunthorpe <[email protected]> Cc: Kurt Schwemmer <[email protected]> Cc: Jon Mason <[email protected]> Cc: Allen Hubbe <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3, v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8 |
|
| #
dec529b0 |
| 24-Dec-2023 |
Christophe JAILLET <[email protected]> |
PCI: switchtec: Fix an error handling path in switchtec_pci_probe()
The commit in Fixes changed the logic on how resources are released and introduced a new switchtec_exit_pci() that need to be call
PCI: switchtec: Fix an error handling path in switchtec_pci_probe()
The commit in Fixes changed the logic on how resources are released and introduced a new switchtec_exit_pci() that need to be called explicitly in order to undo a corresponding switchtec_init_pci().
This was done in the remove function, but not in the probe.
Fix the probe now.
Fixes: df25461119d9 ("PCI: switchtec: Fix stdev_release() crash after surprise hot remove") Link: https://lore.kernel.org/r/01446d2ccb91a578239915812f2b7dfbeb2882af.1703428183.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3 |
|
| #
df254611 |
| 22-Nov-2023 |
Daniel Stodden <[email protected]> |
PCI: switchtec: Fix stdev_release() crash after surprise hot remove
A PCI device hot removal may occur while stdev->cdev is held open. The call to stdev_release() then happens during close or exit,
PCI: switchtec: Fix stdev_release() crash after surprise hot remove
A PCI device hot removal may occur while stdev->cdev is held open. The call to stdev_release() then happens during close or exit, at a point way past switchtec_pci_remove(). Otherwise the last ref would vanish with the trailing put_device(), just before return.
At that later point in time, the devm cleanup has already removed the stdev->mmio_mrpc mapping. Also, the stdev->pdev reference was not a counted one. Therefore, in DMA mode, the iowrite32() in stdev_release() will cause a fatal page fault, and the subsequent dma_free_coherent(), if reached, would pass a stale &stdev->pdev->dev pointer.
Fix by moving MRPC DMA shutdown into switchtec_pci_remove(), after stdev_kill(). Counting the stdev->pdev ref is now optional, but may prevent future accidents.
Reproducible via the script at https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Stodden <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Reviewed-by: Dmitry Safonov <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4 |
|
| #
0fb53e64 |
| 24-Jun-2023 |
Kelvin Cao <[email protected]> |
PCI: switchtec: Add support for PCIe Gen5 devices
Advertise support of Gen5 devices in the driver's device ID table and add the same IDs for the switchtec quirks. Also update driver code to accommod
PCI: switchtec: Add support for PCIe Gen5 devices
Advertise support of Gen5 devices in the driver's device ID table and add the same IDs for the switchtec quirks. Also update driver code to accommodate them.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
| #
846691f5 |
| 24-Jun-2023 |
Kelvin Cao <[email protected]> |
PCI: switchtec: Use normal comment style
Use normal comment style '/* */' for device ID description.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by:
PCI: switchtec: Use normal comment style
Use normal comment style '/* */' for device ID description.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3 |
|
| #
1aaba11d |
| 13-Mar-2023 |
Greg Kroah-Hartman <[email protected]> |
driver core: class: remove module * from class_create()
The module pointer in class_create() never actually did anything, and it shouldn't have been requred to be set as a parameter even if it did s
driver core: class: remove module * from class_create()
The module pointer in class_create() never actually did anything, and it shouldn't have been requred to be set as a parameter even if it did something. So just remove it and fix up all callers of the function in the kernel tree at the same time.
Cc: "Rafael J. Wysocki" <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8, v6.2-rc7, v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2, v6.2-rc1 |
|
| #
ddc10938 |
| 16-Dec-2022 |
Bjorn Helgaas <[email protected]> |
PCI: switchtec: Return -EFAULT for copy_to_user() errors
switchtec_dev_read() didn't handle copy_to_user() errors correctly: it assigned "rc = -EFAULT", but actually returned either "size", -ENXIO,
PCI: switchtec: Return -EFAULT for copy_to_user() errors
switchtec_dev_read() didn't handle copy_to_user() errors correctly: it assigned "rc = -EFAULT", but actually returned either "size", -ENXIO, or -EBADMSG instead.
Update the failure cases to unlock mrpc_mutex and return -EFAULT directly.
Link: https://lore.kernel.org/r/[email protected] Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver") Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
| #
4e353ff4 |
| 16-Dec-2022 |
Bjorn Helgaas <[email protected]> |
PCI: switchtec: Simplify switchtec_dma_mrpc_isr()
The "ret" variable in switchtec_dma_mrpc_isr() is superfluous. Remove it and just return the value. No functional change intended.
Link: https://
PCI: switchtec: Simplify switchtec_dma_mrpc_isr()
The "ret" variable in switchtec_dma_mrpc_isr() is superfluous. Remove it and just return the value. No functional change intended.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5, v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7, v6.0-rc6, v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2, v6.0-rc1, v5.19, v5.19-rc8, v5.19-rc7, v5.19-rc6, v5.19-rc5, v5.19-rc4, v5.19-rc3, v5.19-rc2, v5.19-rc1 |
|
| #
aa195350 |
| 02-Jun-2022 |
Ke Liu <[email protected]> |
PCI: switchtec: Prefer ida_alloc()/free() over ida_simple_get()/remove()
Use ida_alloc() and ida_free() instead of deprecated ida_simple_get() and ida_simple_remove().
Link: https://lore.kernel.org
PCI: switchtec: Prefer ida_alloc()/free() over ida_simple_get()/remove()
Use ida_alloc() and ida_free() instead of deprecated ida_simple_get() and ida_simple_remove().
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ke Liu <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Acked-by: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5, v5.18-rc4, v5.18-rc3, v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2, v5.17-rc1, v5.16, v5.16-rc8, v5.16-rc7, v5.16-rc6, v5.16-rc5, v5.16-rc4, v5.16-rc3, v5.16-rc2 |
|
| #
b76521f6 |
| 19-Nov-2021 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Declare local state_names[] as static
The local state_names[] array is constant and need not be allocated and populated each time we enter stuser_set_state(). Declare it as static.
PCI/switchtec: Declare local state_names[] as static
The local state_names[] array is constant and need not be allocated and populated each time we enter stuser_set_state(). Declare it as static.
See the link below for the discussion.
https://lore.kernel.org/r/[email protected]/
[bhelgaas: simplify commit log] Suggested-by: Krzysztof Wilczyński <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
| #
bb17b158 |
| 19-Nov-2021 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Add Gen4 automotive device IDs
Advertise support of the Gen4 automotive variants in module's device ID table and add the same IDs to the list of switchtec quirks.
Link: https://lore.
PCI/switchtec: Add Gen4 automotive device IDs
Advertise support of the Gen4 automotive variants in module's device ID table and add the same IDs to the list of switchtec quirks.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v5.16-rc1, v5.15, v5.15-rc7, v5.15-rc6 |
|
| #
9f37ab04 |
| 14-Oct-2021 |
Logan Gunthorpe <[email protected]> |
PCI/switchtec: Add check of event support
Not all events are supported by every gen/variant of the Switchtec firmware. To solve this, since Gen4, a new bit in each event header is introduced to indi
PCI/switchtec: Add check of event support
Not all events are supported by every gen/variant of the Switchtec firmware. To solve this, since Gen4, a new bit in each event header is introduced to indicate if an event is supported by the firmware.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
| #
67116444 |
| 14-Oct-2021 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Replace ENOTSUPP with EOPNOTSUPP
ENOTSUPP is not a SUSV4 error code, and the following checkpatch.pl warning will be given for new patches which still use ENOTSUPP.
WARNING: ENOT
PCI/switchtec: Replace ENOTSUPP with EOPNOTSUPP
ENOTSUPP is not a SUSV4 error code, and the following checkpatch.pl warning will be given for new patches which still use ENOTSUPP.
WARNING: ENOTSUPP is not a SUSV4 error code, prefer EOPNOTSUPP
See the link below for the discussion.
https://lore.kernel.org/netdev/[email protected]/
Replace ENOTSUPP with EOPNOTSUPP to align with future patches which will be using EOPNOTSUPP.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
| #
1420ac21 |
| 14-Oct-2021 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Update the way of getting management VEP instance ID
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP) instance ID register in addtion to management EP, update the w
PCI/switchtec: Update the way of getting management VEP instance ID
Gen4 firmware adds DMA VEP and NVMe VEP support in VEP (virtual EP) instance ID register in addtion to management EP, update the way of getting management VEP instance ID.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
| #
551ec658 |
| 14-Oct-2021 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Fix a MRPC error status handling issue
If an error is encountered when executing a MRPC command, the firmware will set the status register to SWITCHTEC_MRPC_STATUS_ERROR and return th
PCI/switchtec: Fix a MRPC error status handling issue
If an error is encountered when executing a MRPC command, the firmware will set the status register to SWITCHTEC_MRPC_STATUS_ERROR and return the error code in the return value register.
Add handling of SWITCHTEC_MRPC_STATUS_ERROR on status register when completing a MRPC command.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
| #
1a323bd0 |
| 14-Oct-2021 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Error out MRPC execution when MMIO reads fail
A firmware hard reset may be initiated by various mechanisms including a UART interface, TWI sideband interface from BMC, MRPC command fr
PCI/switchtec: Error out MRPC execution when MMIO reads fail
A firmware hard reset may be initiated by various mechanisms including a UART interface, TWI sideband interface from BMC, MRPC command from userspace, etc. The switchtec management driver is unaware of these resets.
The reset clears PCI state including the BARs and Memory Space Enable bits, so the device no longer responds to the MMIO accesses the driver uses to operate it.
MMIO reads to the device will fail with a PCIe error. When the root complex handles that error, it typically fabricates ~0 data to complete the CPU read.
Check for this sort of error by reading the device ID from MMIO space. This ID can never be ~0, so if we see that value, it probably means the PCIe Memory Read failed and we should return an error indication to the application using the switchtec driver.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
|
Revision tags: v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2, v5.15-rc1, v5.14, v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4, v5.14-rc3, v5.14-rc2, v5.14-rc1, v5.13, v5.13-rc7, v5.13-rc6, v5.13-rc5 |
|
| #
f8cf6e51 |
| 03-Jun-2021 |
Krzysztof Wilczyński <[email protected]> |
PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions
The sysfs_emit() and sysfs_emit_at() functions were introduced to make it less ambiguous which function is preferred when writing
PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions
The sysfs_emit() and sysfs_emit_at() functions were introduced to make it less ambiguous which function is preferred when writing to the output buffer in a device attribute's "show" callback [1].
Convert the PCI sysfs object "show" functions from sprintf(), snprintf() and scnprintf() to sysfs_emit() and sysfs_emit_at() accordingly, as the latter is aware of the PAGE_SIZE buffer and correctly returns the number of bytes written into the buffer.
No functional change intended.
[1] Documentation/filesystems/sysfs.rst
Related commit: ad025f8e46f3 ("PCI/sysfs: Use sysfs_emit() and sysfs_emit_at() in "show" functions").
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v5.13-rc4, v5.13-rc3, v5.13-rc2, v5.13-rc1, v5.12, v5.12-rc8, v5.12-rc7, v5.12-rc6, v5.12-rc5, v5.12-rc4, v5.12-rc3, v5.12-rc2, v5.12-rc1, v5.12-rc1-dontuse, v5.11, v5.11-rc7, v5.11-rc6, v5.11-rc5, v5.11-rc4, v5.11-rc3, v5.11-rc2, v5.11-rc1, v5.10, v5.10-rc7, v5.10-rc6, v5.10-rc5, v5.10-rc4, v5.10-rc3, v5.10-rc2, v5.10-rc1, v5.9, v5.9-rc8, v5.9-rc7, v5.9-rc6, v5.9-rc5, v5.9-rc4, v5.9-rc3, v5.9-rc2, v5.9-rc1, v5.8 |
|
| #
42dae893 |
| 28-Jul-2020 |
Logan Gunthorpe <[email protected]> |
PCI: switchtec: Add missing __iomem tag to fix sparse warnings
Fix a missing __iomem tag in the init_pfn() function. This fixes a sparse warning of the form:
$ make C=2 drivers/pci/switch/ driv
PCI: switchtec: Add missing __iomem tag to fix sparse warnings
Fix a missing __iomem tag in the init_pfn() function. This fixes a sparse warning of the form:
$ make C=2 drivers/pci/switch/ drivers/pci/switch/switchtec.c:... incorrect type assignment(different address spaces)
Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
| #
5f11723b |
| 28-Jul-2020 |
Logan Gunthorpe <[email protected]> |
PCI: switchtec: Add missing __iomem and __user tags to fix sparse warnings
Fix a number of missing __iomem and __user tags in the ioctl functions of the switchtec driver. This fixes a number of spar
PCI: switchtec: Add missing __iomem and __user tags to fix sparse warnings
Fix a number of missing __iomem and __user tags in the ioctl functions of the switchtec driver. This fixes a number of sparse warnings of the form:
$ make C=2 drivers/pci/switch/ drivers/pci/switch/switchtec.c:... incorrect type in ... (different address spaces)
Fixes: 52eabba5bcdb ("switchtec: Add IOCTLs to the Switchtec driver") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
|
Revision tags: v5.8-rc7, v5.8-rc6, v5.8-rc5, v5.8-rc4, v5.8-rc3, v5.8-rc2, v5.8-rc1, v5.7, v5.7-rc7 |
|
| #
b8af8549 |
| 21-May-2020 |
Krzysztof Wilczynski <[email protected]> |
PCI/switchtec: Correct bool variable type assignment
Use "true" instead of 1 to initialize "bool use_dma_mrpc". This resolves the following Coccinelle warning:
drivers/pci/switch/switchtec.c:28:
PCI/switchtec: Correct bool variable type assignment
Use "true" instead of 1 to initialize "bool use_dma_mrpc". This resolves the following Coccinelle warning:
drivers/pci/switch/switchtec.c:28:12-24: WARNING: Assignment of 0/1 to bool variable
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Wilczynski <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]>
show more ...
|
|
Revision tags: v5.7-rc6, v5.7-rc5, v5.7-rc4, v5.7-rc3, v5.7-rc2, v5.7-rc1, v5.6, v5.6-rc7 |
|
| #
deaa0a8a |
| 21-Mar-2020 |
Sebastian Andrzej Siewior <[email protected]> |
pci/switchtec: Replace completion wait queue usage for poll
The poll callback is using the completion wait queue and sticks it into poll_wait() to wake up pollers after a command has completed.
Thi
pci/switchtec: Replace completion wait queue usage for poll
The poll callback is using the completion wait queue and sticks it into poll_wait() to wake up pollers after a command has completed.
This works to some extent, but cannot provide EPOLLEXCLUSIVE support because the waker side uses complete_all() which unconditionally wakes up all waiters. complete_all() is required because completions internally use exclusive wait and complete() only wakes up one waiter by default.
This mixes conceptually different mechanisms and relies on internal implementation details of completions, which in turn puts contraints on changing the internal implementation of completions.
Replace it with a regular wait queue and store the state in struct switchtec_user.
Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
show more ...
|
| #
efbdc769 |
| 21-Mar-2020 |
Logan Gunthorpe <[email protected]> |
PCI/switchtec: Fix init_completion race condition with poll_wait()
The call to init_completion() in mrpc_queue_cmd() can theoretically race with the call to poll_wait() in switchtec_dev_poll().
p
PCI/switchtec: Fix init_completion race condition with poll_wait()
The call to init_completion() in mrpc_queue_cmd() can theoretically race with the call to poll_wait() in switchtec_dev_poll().
poll() write() switchtec_dev_poll() switchtec_dev_write() poll_wait(&s->comp.wait); mrpc_queue_cmd() init_completion(&s->comp) init_waitqueue_head(&s->comp.wait)
To my knowledge, no one has hit this bug.
Fix this by using reinit_completion() instead of init_completion() in mrpc_queue_cmd().
Fixes: 080b47def5e5 ("MicroSemi Switchtec management interface driver")
Reported-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
show more ...
|
|
Revision tags: v5.6-rc6, v5.6-rc5, v5.6-rc4, v5.6-rc3, v5.6-rc2, v5.6-rc1, v5.5, v5.5-rc7 |
|
| #
7a30ebb9 |
| 15-Jan-2020 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Add Gen4 device IDs
Now that Gen4 is properly supported, advertise support in the module's device ID table and add the same IDs to the list of switchtec quirks.
[[email protected]:
PCI/switchtec: Add Gen4 device IDs
Now that Gen4 is properly supported, advertise support in the module's device ID table and add the same IDs to the list of switchtec quirks.
[[email protected]: add commit message and quirk IDs] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|
|
Revision tags: v5.5-rc6 |
|
| #
ce7c8860 |
| 06-Jan-2020 |
Kelvin Cao <[email protected]> |
PCI/switchtec: Add Gen4 MRPC GAS access permission check
Gen4 hardware provides new MRPC commands to read and write directly from any address in the PCI BAR (which Microsemi refers to as GAS). Since
PCI/switchtec: Add Gen4 MRPC GAS access permission check
Gen4 hardware provides new MRPC commands to read and write directly from any address in the PCI BAR (which Microsemi refers to as GAS). Since accessing BARs can be dangerous and break the driver, we don't want unprivileged users to have this ability.
Therefore, require CAP_SYS_ADMIN for the local and remote GAS access MRPC commands. Privileged processes will already have access to the BAR through the sysfs resource file so this doesn't give userspace any capabilities it didn't already have.
[[email protected]: rework commit message] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kelvin Cao <[email protected]> Signed-off-by: Logan Gunthorpe <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
show more ...
|