Skip to content

Commit e39cedc

Browse files
FROMLIST: PCI: qcom: Add .get_ltssm() helper
For older targets like sc7280, we see reading DBI after sending PME turn off message is causing NOC error. To avoid unsafe DBI accesses, introduce qcom_pcie_get_ltssm(), which retrieves the LTSSM state from the PARF_LTSSM register instead. Link: https://lore.kernel.org/r/20260217-d3cold-v2-3-89b322864043@oss.qualcomm.com Signed-off-by: Krishna Chaitanya Chundru <krishna.chundru@oss.qualcomm.com>
1 parent 1cefa86 commit e39cedc

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

drivers/pci/controller/dwc/pcie-qcom.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@
135135

136136
/* PARF_LTSSM register fields */
137137
#define LTSSM_EN BIT(8)
138+
#define PARF_LTSSM_STATE_MASK GENMASK(5, 0)
138139

139140
/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
140141
#define PARF_INT_ALL_LINK_UP BIT(13)
@@ -1260,6 +1261,15 @@ static bool qcom_pcie_link_up(struct dw_pcie *pci)
12601261
return val & PCI_EXP_LNKSTA_DLLLA;
12611262
}
12621263

1264+
static enum dw_pcie_ltssm qcom_pcie_get_ltssm(struct dw_pcie *pci)
1265+
{
1266+
struct qcom_pcie *pcie = to_qcom_pcie(pci);
1267+
u32 val;
1268+
1269+
val = readl(pcie->parf + PARF_LTSSM);
1270+
return (enum dw_pcie_ltssm)FIELD_GET(PARF_LTSSM_STATE_MASK, val);
1271+
}
1272+
12631273
static void qcom_pcie_phy_power_off(struct qcom_pcie *pcie)
12641274
{
12651275
struct qcom_pcie_port *port;
@@ -1515,6 +1525,7 @@ static const struct qcom_pcie_cfg cfg_fw_managed = {
15151525
static const struct dw_pcie_ops dw_pcie_ops = {
15161526
.link_up = qcom_pcie_link_up,
15171527
.start_link = qcom_pcie_start_link,
1528+
.get_ltssm = qcom_pcie_get_ltssm,
15181529
};
15191530

15201531
static int qcom_pcie_icc_init(struct qcom_pcie *pcie)

0 commit comments

Comments
 (0)