Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI: Add .assert_perst() to control PCIe PERST#

Controller driver probes first, enables link training and scans the bus.
When the PCI bridge is found, its child DT nodes will be scanned and
pwrctrl devices will be created if needed. By the time pwrctrl driver probe
gets called, link training is already enabled by controller driver.

Certain devices like TC9563, which uses the PCI pwrctl framework, need to
configure the device before the PCIe link is up.

As the controller driver already enables link training as part of its
probe, the moment device is powered on, controller and device participate
in link training and link can come up immediately and may not have time to
configure the device.

So we need to stop the link training by using assert_perst() by asserting
PERST# and de-asserting PERST# after device is configured.

Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Manivannan Sadhasivam <mani@kernel.org>
Link: https://patch.msgid.link/20251101-tc9563-v9-2-de3429f7787a@oss.qualcomm.com

authored by

Krishna Chaitanya Chundru and committed by
Bjorn Helgaas
01ba8270 26f3ac88

+1
+1
include/linux/pci.h
··· 829 829 void __iomem *(*map_bus)(struct pci_bus *bus, unsigned int devfn, int where); 830 830 int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); 831 831 int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); 832 + int (*assert_perst)(struct pci_bus *bus, bool assert); 832 833 }; 833 834 834 835 /*