Revision tags: v6.6.25, v6.6.24, v6.6.23, v6.6.16, v6.6.15 |
|
#
bd874092 |
| 29-Jan-2024 |
Brett Creeley <brett.creeley@amd.com> |
pds_core: Prevent health thread from running during reset/remove
[ Upstream commit d9407ff11809c6812bb84fe7be9c1367d758e5c8 ]
The PCIe reset handlers can run at the same time as the health thread.
pds_core: Prevent health thread from running during reset/remove
[ Upstream commit d9407ff11809c6812bb84fe7be9c1367d758e5c8 ]
The PCIe reset handlers can run at the same time as the health thread. This can cause the health thread to stomp on the PCIe reset. Fix this by preventing the health thread from running while a PCIe reset is happening.
As part of this use timer_shutdown_sync() during reset and remove to make sure the timer doesn't ever get rearmed.
Fixes: ffa55858330f ("pds_core: implement pci reset handlers") Signed-off-by: Brett Creeley <brett.creeley@amd.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://lore.kernel.org/r/20240129234035.69802-2-brett.creeley@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
2bbf2b1c |
| 29-Jan-2024 |
Brett Creeley <brett.creeley@amd.com> |
pds_core: Rework teardown/setup flow to be more common
[ Upstream commit bc90fbe0c3182157d2be100a2f6c2edbb1820677 ]
Currently the teardown/setup flow for driver probe/remove is quite a bit differen
pds_core: Rework teardown/setup flow to be more common
[ Upstream commit bc90fbe0c3182157d2be100a2f6c2edbb1820677 ]
Currently the teardown/setup flow for driver probe/remove is quite a bit different from the reset flows in pdsc_fw_down()/pdsc_fw_up(). One key piece that's missing are the calls to pci_alloc_irq_vectors() and pci_free_irq_vectors(). The pcie reset case is calling pci_free_irq_vectors() on reset_prepare, but not calling the corresponding pci_alloc_irq_vectors() on reset_done. This is causing unexpected/unwanted interrupt behavior due to the adminq interrupt being accidentally put into legacy interrupt mode. Also, the pci_alloc_irq_vectors()/pci_free_irq_vectors() functions are being called directly in probe/remove respectively.
Fix this inconsistency by making the following changes: 1. Always call pdsc_dev_init() in pdsc_setup(), which calls pci_alloc_irq_vectors() and get rid of the now unused pds_dev_reinit(). 2. Always free/clear the pdsc->intr_info in pdsc_teardown() since this structure will get re-alloced in pdsc_setup(). 3. Move the calls of pci_free_irq_vectors() to pdsc_teardown() since pci_alloc_irq_vectors() will always be called in pdsc_setup()->pdsc_dev_init() for both the probe/remove and reset flows. 4. Make sure to only create the debugfs "identity" entry when it doesn't already exist, which it will in the reset case because it's already been created in the initial call to pdsc_dev_init().
Fixes: ffa55858330f ("pds_core: implement pci reset handlers") Signed-off-by: Brett Creeley <brett.creeley@amd.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Link: https://lore.kernel.org/r/20240129234035.69802-7-brett.creeley@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
#
f6ec6ac9 |
| 29-Jan-2024 |
Brett Creeley <brett.creeley@amd.com> |
pds_core: Clear BARs on reset
[ Upstream commit e96094c1d11cce4deb5da3c0500d49041ab845b8 ]
During reset the BARs might be accessed when they are unmapped. This can cause unexpected issues, so fix i
pds_core: Clear BARs on reset
[ Upstream commit e96094c1d11cce4deb5da3c0500d49041ab845b8 ]
During reset the BARs might be accessed when they are unmapped. This can cause unexpected issues, so fix it by clearing the cached BAR values so they are not accessed until they are re-mapped.
Also, make sure any places that can access the BARs when they are NULL are prevented.
Fixes: 49ce92fbee0b ("pds_core: add FW update feature to devlink") Signed-off-by: Brett Creeley <brett.creeley@amd.com> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Link: https://lore.kernel.org/r/20240129234035.69802-6-brett.creeley@amd.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
Revision tags: v6.6.14, v6.6.13, v6.6.12, v6.6.11, v6.6.10, v6.6.9, v6.6.8, v6.6.7, v6.6.6, v6.6.5, v6.6.4, v6.6.3, v6.6.2, v6.5.11, v6.6.1, v6.5.10, v6.6, v6.5.9, v6.5.8, v6.5.7, v6.5.6, v6.5.5, v6.5.4 |
|
#
699f5416 |
| 14-Sep-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: implement pci reset handlers
[ Upstream commit ffa55858330f267beec995fc4f68098c91311c64 ]
Implement the callbacks for a nice PCI reset. These get called when a user is nice enough to use
pds_core: implement pci reset handlers
[ Upstream commit ffa55858330f267beec995fc4f68098c91311c64 ]
Implement the callbacks for a nice PCI reset. These get called when a user is nice enough to use the sysfs PCI reset entry, e.g. echo 1 > /sys/bus/pci/devices/0000:2b:00.0/reset
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Reviewed-by: Brett Creeley <brett.creeley@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net> Stable-dep-of: 7e82a8745b95 ("pds_core: Prevent race issues involving the adminq") Signed-off-by: Sasha Levin <sashal@kernel.org>
show more ...
|
Revision tags: v6.5.3, v6.5.2, v6.1.51, v6.5.1, v6.1.50, v6.5, v6.1.49, v6.1.48 |
|
#
2f48b1d8 |
| 16-Aug-2023 |
Yu Liao <liaoyu15@huawei.com> |
pds_core: remove redundant pci_clear_master()
do_pci_disable_device() disable PCI bus-mastering as following: static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command;
pci_read_
pds_core: remove redundant pci_clear_master()
do_pci_disable_device() disable PCI bus-mastering as following: static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command;
pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); }
pcibios_disable_device(dev); } And pci_disable_device() sets dev->is_busmaster to 0.
pci_enable_device() is called only once before calling to pci_disable_device() and such pci_clear_master() is not needed. So remove redundant pci_clear_master().
Also rename goto label 'err_out_clear_master' to 'err_out_disable_device'.
Signed-off-by: Yu Liao <liaoyu15@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Acked-by: Shannon Nelson <shannon.nelson@amd.com> Link: https://lore.kernel.org/r/20230817025709.2023553-1-liaoyu15@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
Revision tags: v6.1.46, v6.1.45, v6.1.44, v6.1.43, v6.1.42, v6.1.41, v6.1.40, v6.1.39, v6.1.38, v6.1.37, v6.1.36, v6.4, v6.1.35, v6.1.34, v6.1.33, v6.1.32, v6.1.31, v6.1.30, v6.1.29, v6.1.28 |
|
#
1e76f427 |
| 04-May-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: fix mutex double unlock in error path
Fix a double unlock in an error handling path by unlocking as soon as the error is seen and removing unlocks in the error cleanup path.
Link: https:/
pds_core: fix mutex double unlock in error path
Fix a double unlock in an error handling path by unlocking as soon as the error is seen and removing unlocks in the error cleanup path.
Link: https://lore.kernel.org/kernel-janitors/209a09f6-5ec6-40c7-a5ec-6260d8f54d25@kili.mountain/ Fixes: 523847df1b37 ("pds_core: add devcmd device interfaces") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
Revision tags: v6.1.27, v6.1.26, v6.3, v6.1.25 |
|
#
40ced894 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: devlink params for enabling VIF support
Add the devlink parameter switches so the user can enable the features supported by the VFs. The only feature supported at the moment is vDPA.
Exa
pds_core: devlink params for enabling VIF support
Add the devlink parameter switches so the user can enable the features supported by the VFs. The only feature supported at the moment is vDPA.
Example: devlink dev param set pci/0000:2b:00.0 \ name enable_vnet cmode runtime value true
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
4569cce4 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: add auxiliary_bus devices
An auxiliary_bus device is created for each vDPA type VF at VF probe and destroyed at VF remove. The aux device name comes from the driver name + VIF type + the
pds_core: add auxiliary_bus devices
An auxiliary_bus device is created for each vDPA type VF at VF probe and destroyed at VF remove. The aux device name comes from the driver name + VIF type + the unique id assigned at PCI probe. The VFs are always removed on PF remove, so there should be no issues with VFs trying to access missing PF structures.
The auxiliary_device names will look like "pds_core.vDPA.nn" where 'nn' is the VF's uid.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
f53d9311 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: add initial VF device handling
This is the initial VF PCI driver framework for the new pds_vdpa VF device, which will work in conjunction with an auxiliary_bus client of the pds_core drive
pds_core: add initial VF device handling
This is the initial VF PCI driver framework for the new pds_vdpa VF device, which will work in conjunction with an auxiliary_bus client of the pds_core driver. This does the very basics of registering for the new VF device, setting up debugfs entries, and registering with devlink.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
49ce92fb |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: add FW update feature to devlink
Add in the support for doing firmware updates. Of the two main banks available, a and b, this updates the one not in use and then selects it for the next
pds_core: add FW update feature to devlink
Add in the support for doing firmware updates. Of the two main banks available, a and b, this updates the one not in use and then selects it for the next boot.
Example: devlink dev flash pci/0000:b2:00.0 \ file pensando/dsc_fw_1.63.0-22.tar
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
45d76f49 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: set up device and adminq
Set up the basic adminq and notifyq queue structures. These are used mostly by the client drivers for feature configuration. These are essentially the same adminq
pds_core: set up device and adminq
Set up the basic adminq and notifyq queue structures. These are used mostly by the client drivers for feature configuration. These are essentially the same adminq and notifyq as in the ionic driver.
Part of this includes querying for device identity and FW information, so we can make that available to devlink dev info.
$ devlink dev info pci/0000:b5:00.0 pci/0000:b5:00.0: driver pds_core serial_number FLM18420073 versions: fixed: asic.id 0x0 asic.rev 0x0 running: fw 1.51.0-73 stored: fw.goldfw 1.15.9-C-22 fw.mainfwa 1.60.0-73 fw.mainfwb 1.60.0-57
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
25b450c0 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: add devlink health facilities
Add devlink health reporting on top of our fw watchdog.
Example: # devlink health show pci/0000:2b:00.0 reporter fw pci/0000:2b:00.0: reporter fw
pds_core: add devlink health facilities
Add devlink health reporting on top of our fw watchdog.
Example: # devlink health show pci/0000:2b:00.0 reporter fw pci/0000:2b:00.0: reporter fw state healthy error 0 recover 0 # devlink health diagnose pci/0000:2b:00.0 reporter fw Status: healthy State: 1 Generation: 0 Recoveries: 0
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
c2dbb090 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: health timer and workqueue
Add in the periodic health check and the related workqueue, as well as the handlers for when a FW reset is seen.
The firmware is polled every 5 seconds to be su
pds_core: health timer and workqueue
Add in the periodic health check and the related workqueue, as well as the handlers for when a FW reset is seen.
The firmware is polled every 5 seconds to be sure that it is still alive and that the FW generation didn't change.
The alive check looks to see that the PCI bus is still readable and the fw_status still has the RUNNING bit on. If not alive, the driver stops activity and tears things down. When the FW recovers and the alive check again succeeds, the driver sets back up for activity.
The generation check looks at the fw_generation to see if it has changed, which can happen if the FW crashed and recovered or was updated in between health checks. If changed, the driver counts that as though the alive test failed and forces the fw_down/fw_up cycle.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
523847df |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: add devcmd device interfaces
The devcmd interface is the basic connection to the device through the PCI BAR for low level identification and command services. This does the early device i
pds_core: add devcmd device interfaces
The devcmd interface is the basic connection to the device through the PCI BAR for low level identification and command services. This does the early device initialization and finds the identity data, and adds devcmd routines to be used by later driver bits.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|
#
55435ea7 |
| 19-Apr-2023 |
Shannon Nelson <shannon.nelson@amd.com> |
pds_core: initial framework for pds_core PF driver
This is the initial PCI driver framework for the new pds_core device driver and its family of devices. This does the very basics of registering fo
pds_core: initial framework for pds_core PF driver
This is the initial PCI driver framework for the new pds_core device driver and its family of devices. This does the very basics of registering for the new PF PCI device 1dd8:100c, setting up debugfs entries, and registering with devlink.
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com> Acked-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
show more ...
|