PCI: mediatek-gen3: Print LTSSM state when PCIe link down
PATCH v2 1/1 PCI: mediatek-gen3: Print LTSSM state when PCIe link down
Print current LTSSM state when PCIe link down instead of the register value, make it easier to get the link status.
---
Changes in v2:
Print both of the register value and the LTSSM state.
--- drivers/pci/controller/pcie-mediatek-gen3.c | 41 ++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)
drivers/pci/controller/pcie-mediatek-gen3.c +40 -1
@@ -153,6 +153,37 @@ struct mtk_gen3_pcie {DECLARE_BITMAP (msi_irq_in_use,PCIE_MSI_IRQS_NUM ); }; +/* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */ +static const char *const ltssm_str[] = { +"detect.quiet" ,/* 0x00 */ +"detect.active" ,/* 0x01 */ +"polling.active" ,/* 0x02 */ +"polling.compliance" ,/* 0x03 */ +"polling.configuration" ,/* 0x04 */ +"config.linkwidthstart" ,/* 0x05 */ +"config.linkwidthaccept" ,/* 0x06 */ +"config.lanenumwait" ,/* 0x07 */ +"config.lanenumaccept" ,/* 0x08 */ +"config.complete" ,/* 0x09 */ +"config.idle" ,/* 0x0A */ +"recovery.receiverlock" ,/* 0x0B */ +"recovery.equalization" ,/* 0x0C */ +"recovery.speed" ,/* 0x0D */ +"recovery.receiverconfig" ,/* 0x0E */ +"recovery.idle" ,/* 0x0F */ +"L0" ,/* 0x10 */ +"L0s" ,/* 0x11 */ +"L1.entry" ,/* 0x12 */ +"L1.idle" ,/* 0x13 */ +"L2.idle" ,/* 0x14 */ +"L2.transmitwake" ,/* 0x15 */ +"disable" ,/* 0x16 */ +"loopback.entry" ,/* 0x17 */ +"loopback.active" ,/* 0x18 */ +"loopback.exit" ,/* 0x19 */ +"hotreset" ,/* 0x1A */ +}; +/** * mtk_pcie_config_tlp_header() - Configure a configuration TLP header * @bus: PCI bus to query
@@ -327,8 +358,16 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) !!(val &PCIE_PORT_LINKUP ),20 , PCI_PM_D3COLD_WAIT * USEC_PER_MSEC);if (err) { +const char *ltssm_state; +int ltssm_index; + val =readl_relaxed (pcie->base +PCIE_LTSSM_STATUS_REG ); -dev_err (pcie->dev,"PCIe link down, ltssm reg val: %#x\n" , val); + ltssm_index =PCIE_LTSSM_STATE (val); + ltssm_state = ltssm_index >=ARRAY_SIZE (ltssm_str) ? +"Unknown state" : ltssm_str[ltssm_index]; +dev_err (pcie->dev, +"PCIe link down, current ltssm state: %s (%#x)\n" , + ltssm_state, val);return err; }
Signature · 1 line
2.18.0
Hi Maintainers,
Just gentle ping for this patch, if there is anything I can do to get this patch merged, please let me know.
Thanks.
Quoted 80 lines · Jianjun Wang
Print current LTSSM state when PCIe link down instead of the register value, make it easier to get the link status.
Signed-off-by Jianjun Wang <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]>
---
Changes in v2:
Print both of the register value and the LTSSM state.--- drivers/pci/controller/pcie-mediatek-gen3.c | 41 ++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)drivers/pci/controller/pcie-mediatek-gen3.c +31
-0@@ -153,6 +153,37 @@ struct mtk_gen3_pcie {DECLARE_BITMAP (msi_irq_in_use,PCIE_MSI_IRQS_NUM ); }; +/* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */ +static const char *const ltssm_str[] = { +"detect.quiet" ,/* 0x00 */ +"detect.active" ,/* 0x01 */ +"polling.active" ,/* 0x02 */ +"polling.compliance" ,/* 0x03 */ +"polling.configuration" ,/* 0x04 */ +"config.linkwidthstart" ,/* 0x05 */ +"config.linkwidthaccept" ,/* 0x06 */ +"config.lanenumwait" ,/* 0x07 */ +"config.lanenumaccept" ,/* 0x08 */ +"config.complete" ,/* 0x09 */ +"config.idle" ,/* 0x0A */ +"recovery.receiverlock" ,/* 0x0B */ +"recovery.equalization" ,/* 0x0C */ +"recovery.speed" ,/* 0x0D */ +"recovery.receiverconfig" ,/* 0x0E */ +"recovery.idle" ,/* 0x0F */ +"L0" ,/* 0x10 */ +"L0s" ,/* 0x11 */ +"L1.entry" ,/* 0x12 */ +"L1.idle" ,/* 0x13 */ +"L2.idle" ,/* 0x14 */ +"L2.transmitwake" ,/* 0x15 */ +"disable" ,/* 0x16 */ +"loopback.entry" ,/* 0x17 */ +"loopback.active" ,/* 0x18 */ +"loopback.exit" ,/* 0x19 */ +"hotreset" ,/* 0x1A */ +}; +/** * mtk_pcie_config_tlp_header() - Configure a configuration TLP header
* @bus: PCI bus to querydrivers/pci/controller/pcie-mediatek-gen3.c +8
-1@@ -327,8 +358,16 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) !!(val &PCIE_PORT_LINKUP ),20 , PCI_PM_D3COLD_WAIT * USEC_PER_MSEC);if (err) { +const char *ltssm_state; +int ltssm_index; + val =readl_relaxed (pcie->base +PCIE_LTSSM_STATUS_REG ); -dev_err (pcie->dev,"PCIe link down, ltssm reg val: %#x\n", val); + ltssm_index =PCIE_LTSSM_STATE (val); + ltssm_state = ltssm_index >=ARRAY_SIZE (ltssm_str) ? +"Unknown state" : ltssm_str[ltssm_index]; + dev_err(pcie->dev, + "PCIe link down, current ltssm state: %s(%#x)\n",
drivers/pci/controller/pcie-mediatek-gen3.c +1
-0+ ltssm_state, val);return err; }
Hi Maintainers,
Gentle ping for this patch, if there is anything I can do to get this patch merged, please let me know.
Thanks.
Quoted 91 lines · Jianjun Wang
Hi Maintainers,
Just gentle ping for this patch, if there is anything I can do to get this patch merged, please let me know.
Thanks.
Quoted 81 lines · Jianjun Wang
Print current LTSSM state when PCIe link down instead of the register
value, make it easier to get the link status.Signed-off-by Jianjun Wang <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]>
---
Changes in v2:
Print both of the register value and the LTSSM state.--- drivers/pci/controller/pcie-mediatek-gen3.c | 41 ++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)drivers/pci/controller/pcie-mediatek-gen3.c +31
-0@@ -153,6 +153,37 @@ struct mtk_gen3_pcie {DECLARE_BITMAP (msi_irq_in_use,PCIE_MSI_IRQS_NUM ); }; +/* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */ +static const char *const ltssm_str[] = { +"detect.quiet" ,/* 0x00 */ +"detect.active" ,/* 0x01 */ +"polling.active" ,/* 0x02 */ +"polling.compliance" ,/* 0x03 */ +"polling.configuration" ,/* 0x04 */ +"config.linkwidthstart" ,/* 0x05 */ +"config.linkwidthaccept" ,/* 0x06 */ +"config.lanenumwait" ,/* 0x07 */ +"config.lanenumaccept" ,/* 0x08 */ +"config.complete" ,/* 0x09 */ +"config.idle" ,/* 0x0A */ +"recovery.receiverlock" ,/* 0x0B */ +"recovery.equalization" ,/* 0x0C */ +"recovery.speed" ,/* 0x0D */ +"recovery.receiverconfig" ,/* 0x0E */ +"recovery.idle" ,/* 0x0F */ +"L0" ,/* 0x10 */ +"L0s" ,/* 0x11 */ +"L1.entry" ,/* 0x12 */ +"L1.idle" ,/* 0x13 */ +"L2.idle" ,/* 0x14 */ +"L2.transmitwake" ,/* 0x15 */ +"disable" ,/* 0x16 */ +"loopback.entry" ,/* 0x17 */ +"loopback.active" ,/* 0x18 */ +"loopback.exit" ,/* 0x19 */ +"hotreset" ,/* 0x1A */ +}; +/** * mtk_pcie_config_tlp_header() - Configure a configuration TLP header
* @bus: PCI bus to querydrivers/pci/controller/pcie-mediatek-gen3.c +8
-1@@ -327,8 +358,16 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) !!(val &PCIE_PORT_LINKUP ),20 , PCI_PM_D3COLD_WAIT * USEC_PER_MSEC);if (err) { +const char *ltssm_state; +int ltssm_index; + val =readl_relaxed (pcie->base +PCIE_LTSSM_STATUS_REG ); -dev_err (pcie->dev,"PCIe link down, ltssm reg val: %#x\n", val); + ltssm_index =PCIE_LTSSM_STATE (val); + ltssm_state = ltssm_index >=ARRAY_SIZE (ltssm_str) ? +"Unknown state" : ltssm_str[ltssm_index]; + dev_err(pcie->dev, + "PCIe link down, current ltssm state: %s(%#x)\n",
drivers/pci/controller/pcie-mediatek-gen3.c +1
-0+ ltssm_state, val);return err; }
Hello Maintainers,
Is there anything I can do to get this patch merged?
Thanks.
Quoted 102 lines · Jianjun Wang
Hi Maintainers,
Gentle ping for this patch, if there is anything I can do to get this patch merged, please let me know.
Thanks.
Quoted 92 lines · Jianjun Wang
Hi Maintainers,
Just gentle ping for this patch, if there is anything I can do to get
this patch merged, please let me know.Thanks.
Quoted 81 lines · Jianjun Wang
Print current LTSSM state when PCIe link down instead of the register
value, make it easier to get the link status.Signed-off-by Jianjun Wang <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]>
---
Changes in v2:
Print both of the register value and the LTSSM state.--- drivers/pci/controller/pcie-mediatek-gen3.c | 41 ++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)drivers/pci/controller/pcie-mediatek-gen3.c +31
-0@@ -153,6 +153,37 @@ struct mtk_gen3_pcie {DECLARE_BITMAP (msi_irq_in_use,PCIE_MSI_IRQS_NUM ); }; +/* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */ +static const char *const ltssm_str[] = { +"detect.quiet" ,/* 0x00 */ +"detect.active" ,/* 0x01 */ +"polling.active" ,/* 0x02 */ +"polling.compliance" ,/* 0x03 */ +"polling.configuration" ,/* 0x04 */ +"config.linkwidthstart" ,/* 0x05 */ +"config.linkwidthaccept" ,/* 0x06 */ +"config.lanenumwait" ,/* 0x07 */ +"config.lanenumaccept" ,/* 0x08 */ +"config.complete" ,/* 0x09 */ +"config.idle" ,/* 0x0A */ +"recovery.receiverlock" ,/* 0x0B */ +"recovery.equalization" ,/* 0x0C */ +"recovery.speed" ,/* 0x0D */ +"recovery.receiverconfig" ,/* 0x0E */ +"recovery.idle" ,/* 0x0F */ +"L0" ,/* 0x10 */ +"L0s" ,/* 0x11 */ +"L1.entry" ,/* 0x12 */ +"L1.idle" ,/* 0x13 */ +"L2.idle" ,/* 0x14 */ +"L2.transmitwake" ,/* 0x15 */ +"disable" ,/* 0x16 */ +"loopback.entry" ,/* 0x17 */ +"loopback.active" ,/* 0x18 */ +"loopback.exit" ,/* 0x19 */ +"hotreset" ,/* 0x1A */ +}; +/** * mtk_pcie_config_tlp_header() - Configure a configuration TLP header
* @bus: PCI bus to querydrivers/pci/controller/pcie-mediatek-gen3.c +8
-1@@ -327,8 +358,16 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) !!(val &PCIE_PORT_LINKUP ),20 , PCI_PM_D3COLD_WAIT * USEC_PER_MSEC);if (err) { +const char *ltssm_state; +int ltssm_index; + val =readl_relaxed (pcie->base +PCIE_LTSSM_STATUS_REG ); -dev_err (pcie->dev,"PCIe link down, ltssm reg val: %#x\n", val); + ltssm_index =PCIE_LTSSM_STATE (val); + ltssm_state = ltssm_index >=ARRAY_SIZE (ltssm_str) ? +"Unknown state" : ltssm_str[ltssm_index]; + dev_err(pcie->dev, + "PCIe link down, current ltssm state: %s(%#x)\n",
drivers/pci/controller/pcie-mediatek-gen3.c +1
-0+ ltssm_state, val);return err; }
Hi Maintainers,
Just gentle ping for this patch, is there anything I can to do to get this patch merged?
Thanks.
Quoted 119 lines · Jianjun Wang
Hello Maintainers,
Is there anything I can do to get this patch merged?
Thanks.
Quoted 110 lines · Jianjun Wang
Hi Maintainers,
Gentle ping for this patch, if there is anything I can do to get this
patch merged, please let me know.Thanks.
Quoted 99 lines · Jianjun Wang
Hi Maintainers,
Just gentle ping for this patch, if there is anything I can do to get
this patch merged, please let me know.Thanks.
Quoted 88 lines · Jianjun Wang
Print current LTSSM state when PCIe link down instead of the register
value, make it easier to get the link status.Signed-off-by Jianjun Wang <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]>
---
Changes in v2:
Print both of the register value and the LTSSM state.--- drivers/pci/controller/pcie-mediatek-gen3.c | 41 ++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)drivers/pci/controller/pcie-mediatek-gen3.c +31
-0@@ -153,6 +153,37 @@ struct mtk_gen3_pcie {DECLARE_BITMAP (msi_irq_in_use,PCIE_MSI_IRQS_NUM ); }; +/* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */ +static const char *const ltssm_str[] = { +"detect.quiet" ,/* 0x00 */ +"detect.active" ,/* 0x01 */ +"polling.active" ,/* 0x02 */ +"polling.compliance" ,/* 0x03 */ +"polling.configuration" ,/* 0x04 */ +"config.linkwidthstart" ,/* 0x05 */ +"config.linkwidthaccept" ,/* 0x06 */ +"config.lanenumwait" ,/* 0x07 */ +"config.lanenumaccept" ,/* 0x08 */ +"config.complete" ,/* 0x09 */ +"config.idle" ,/* 0x0A */ +"recovery.receiverlock" ,/* 0x0B */ +"recovery.equalization" ,/* 0x0C */ +"recovery.speed" ,/* 0x0D */ +"recovery.receiverconfig" ,/* 0x0E */ +"recovery.idle" ,/* 0x0F */ +"L0" ,/* 0x10 */ +"L0s" ,/* 0x11 */ +"L1.entry" ,/* 0x12 */ +"L1.idle" ,/* 0x13 */ +"L2.idle" ,/* 0x14 */ +"L2.transmitwake" ,/* 0x15 */ +"disable" ,/* 0x16 */ +"loopback.entry" ,/* 0x17 */ +"loopback.active" ,/* 0x18 */ +"loopback.exit" ,/* 0x19 */ +"hotreset" ,/* 0x1A */ +}; +/** * mtk_pcie_config_tlp_header() - Configure a configuration TLP
header
* @bus: PCI bus to querydrivers/pci/controller/pcie-mediatek-gen3.c +3
-1@@ -327,8 +358,16 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) !!(val &PCIE_PORT_LINKUP ),20 ,PCI_PM_D3COLD_WAIT * USEC_PER_MSEC);if (err) { +const char *ltssm_state; +int ltssm_index; + val =readl_relaxed (pcie->base +PCIE_LTSSM_STATUS_REG ); - dev_err(pcie->dev, "PCIe link down, ltssm regval:
%#x\n", val);drivers/pci/controller/pcie-mediatek-gen3.c +2
-0+ ltssm_index =PCIE_LTSSM_STATE (val); + ltssm_state = ltssm_index >=
ARRAY_SIZE(ltssm_str)?drivers/pci/controller/pcie-mediatek-gen3.c +1
-0+ "Unknown state" :ltssm_str[ltssm_index];
drivers/pci/controller/pcie-mediatek-gen3.c +2
-0+ dev_err(pcie->dev, + "PCIe link down, current ltssm state:%s
(%#x)\n",drivers/pci/controller/pcie-mediatek-gen3.c +1
-0+ ltssm_state, val);return err; }
_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
Bjorn Helgaas
AppliedQuoted 8 lines · Jianjun Wang
Print current LTSSM state when PCIe link down instead of the register value, make it easier to get the link status.
Signed-off-by Jianjun Wang <[email protected]>Reviewed-by AngeloGioacchino Del Regno <[email protected]>---
Changes in v2:
Print both of the register value and the LTSSM state.
Applied to pci/ctrl/mediatek-gen3 for v5.20, thanks!
Quoted 72 lines
--- drivers/pci/controller/pcie-mediatek-gen3.c | 41 ++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-)drivers/pci/controller/pcie-mediatek-gen3.c +40
-1@@ -153,6 +153,37 @@ struct mtk_gen3_pcie {DECLARE_BITMAP (msi_irq_in_use,PCIE_MSI_IRQS_NUM ); }; +/* LTSSM state in PCIE_LTSSM_STATUS_REG bit[28:24] */ +static const char *const ltssm_str[] = { +"detect.quiet" ,/* 0x00 */ +"detect.active" ,/* 0x01 */ +"polling.active" ,/* 0x02 */ +"polling.compliance" ,/* 0x03 */ +"polling.configuration" ,/* 0x04 */ +"config.linkwidthstart" ,/* 0x05 */ +"config.linkwidthaccept" ,/* 0x06 */ +"config.lanenumwait" ,/* 0x07 */ +"config.lanenumaccept" ,/* 0x08 */ +"config.complete" ,/* 0x09 */ +"config.idle" ,/* 0x0A */ +"recovery.receiverlock" ,/* 0x0B */ +"recovery.equalization" ,/* 0x0C */ +"recovery.speed" ,/* 0x0D */ +"recovery.receiverconfig" ,/* 0x0E */ +"recovery.idle" ,/* 0x0F */ +"L0" ,/* 0x10 */ +"L0s" ,/* 0x11 */ +"L1.entry" ,/* 0x12 */ +"L1.idle" ,/* 0x13 */ +"L2.idle" ,/* 0x14 */ +"L2.transmitwake" ,/* 0x15 */ +"disable" ,/* 0x16 */ +"loopback.entry" ,/* 0x17 */ +"loopback.active" ,/* 0x18 */ +"loopback.exit" ,/* 0x19 */ +"hotreset" ,/* 0x1A */ +}; +/** * mtk_pcie_config_tlp_header() - Configure a configuration TLP header * @bus: PCI bus to query @@ -327,8 +358,16 @@ static int mtk_pcie_startup_port(struct mtk_gen3_pcie *pcie) !!(val &PCIE_PORT_LINKUP ),20 , PCI_PM_D3COLD_WAIT * USEC_PER_MSEC);if (err) { +const char *ltssm_state; +int ltssm_index; + val =readl_relaxed (pcie->base +PCIE_LTSSM_STATUS_REG ); -dev_err (pcie->dev,"PCIe link down, ltssm reg val: %#x\n" , val); + ltssm_index =PCIE_LTSSM_STATE (val); + ltssm_state = ltssm_index >=ARRAY_SIZE (ltssm_str) ? +"Unknown state" : ltssm_str[ltssm_index]; +dev_err (pcie->dev, +"PCIe link down, current ltssm state: %s (%#x)\n" , + ltssm_state, val);return err; }Signature · 7 lines
2.18.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel