Re: [v4] PCI: dwc: Add the debugfs property to provide the LTSSM status of the PCIe link

From: Hans Zhang
Date: Sun Feb 23 2025 - 00:32:10 EST




On 2025/2/23 00:39, Manivannan Sadhasivam wrote:
+
+What: /sys/kernel/debug/dwc_pcie_<dev>/ltssm_status
+Date: February 2025
+Contact: Hans Zhang <18255117159@xxxxxxx>
+Description: (RO) Read will return the current value of the PCIe link status raw value and
+ string status.

'Read will return the current PCIe LTSSM state in both string and raw value.'

+char *dw_ltssm_sts_string(enum dw_pcie_ltssm ltssm)

const char *dw_pcie_ltssm_string()

+{
+ char *str;

const char *

+
+ switch (ltssm) {
+#define DW_PCIE_LTSSM_NAME(n) case n: str = #n; break
@@ -683,6 +714,8 @@ static inline enum dw_pcie_ltssm dw_pcie_get_ltssm(struct dw_pcie *pci)
return (enum dw_pcie_ltssm)FIELD_GET(PORT_LOGIC_LTSSM_STATE_MASK, val);
}
+char *dw_ltssm_sts_string(enum dw_pcie_ltssm ltssm);

const char *dw_pcie_ltssm_string()

These recommendations will be changed in the next version.

Thank you very much Mani.

Best regards
Hans