summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/pci-host-generic.c
diff options
context:
space:
mode:
authorMarek Behún <marek.behun@nic.cz>2021-11-25 01:25:58 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-12-01 09:23:29 +0100
commit0ad291db2d01e44f56d64e8b84e7b3cb80515f2c (patch)
treeee9193a266474aa7772ab34e4e3510ee76969aa2 /drivers/pci/controller/pci-host-generic.c
parent063a98c00528c706ea2a71a752f42a83eb93f2f9 (diff)
PCI: aardvark: Improve link training
commit 43fc679ced18006b12d918d7a8a4af392b7fbfe7 upstream. Currently the aardvark driver trains link in PCIe gen2 mode. This may cause some buggy gen1 cards (such as Compex WLE900VX) to be unstable or even not detected. Moreover when ASPM code tries to retrain link second time, these cards may stop responding and link goes down. If gen1 is used this does not happen. Unconditionally forcing gen1 is not a good solution since it may have performance impact on gen2 cards. To overcome this, read 'max-link-speed' property (as defined in PCI device tree bindings) and use this as max gen mode. Then iteratively try link training at this mode or lower until successful. After successful link training choose final controller gen based on Negotiated Link Speed from Link Status register, which should match card speed. Link: https://lore.kernel.org/r/20200430080625.26070-5-pali@kernel.org Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com> Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/pci/controller/pci-host-generic.c')
0 files changed, 0 insertions, 0 deletions