Message ID | 20240626-qps615-v1-4-2ade7bd91e02@quicinc.com (mailing list archive) |
---|---|
State | RFC |
Delegated to: | Krzysztof Wilczyński |
Headers | show |
Series | PCI: enable Power and configure the QPS615 PCIe switch | expand |
On Wed, Jun 26, 2024 at 2:38 PM Krishna chaitanya chundru <quic_krichai@quicinc.com> wrote: > > Certain devices like QPS615 which uses PCI pwrctl framework > needs to stop link training before configuring the PCIe device. > > As controller driver already enables link training, we need to > stop the link training by using stop_link and enable them back after > device is configured by using start_link. > > The stop_link() & start_link() be used to keep the link in D3cold & > D0 before turning off the power of the device. > > Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com> > --- > include/linux/pci.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/linux/pci.h b/include/linux/pci.h > index fb004fd4e889..3892ff7fd536 100644 > --- a/include/linux/pci.h > +++ b/include/linux/pci.h > @@ -803,6 +803,8 @@ struct pci_ops { > void __iomem *(*map_bus)(struct pci_bus *bus, unsigned int devfn, int where); > int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); > int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); > + int (*start_link)(struct pci_bus *bus); > + int (*stop_link)(struct pci_bus *bus); > }; > IMO stop_link() should return void. Bart
diff --git a/include/linux/pci.h b/include/linux/pci.h index fb004fd4e889..3892ff7fd536 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -803,6 +803,8 @@ struct pci_ops { void __iomem *(*map_bus)(struct pci_bus *bus, unsigned int devfn, int where); int (*read)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *val); int (*write)(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 val); + int (*start_link)(struct pci_bus *bus); + int (*stop_link)(struct pci_bus *bus); }; /*
Certain devices like QPS615 which uses PCI pwrctl framework needs to stop link training before configuring the PCIe device. As controller driver already enables link training, we need to stop the link training by using stop_link and enable them back after device is configured by using start_link. The stop_link() & start_link() be used to keep the link in D3cold & D0 before turning off the power of the device. Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com> --- include/linux/pci.h | 2 ++ 1 file changed, 2 insertions(+)