Skip to content

Commit 2a67ece

Browse files
authored
Merge pull request #304 from krishnachaitanya-linux/pcie_crash_fix
FROMLIST: PCI: qcom: Add .get_ltssm() helper
2 parents 2cd560f + e39cedc commit 2a67ece

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)
@@ -1259,6 +1260,15 @@ static bool qcom_pcie_link_up(struct dw_pcie *pci)
12591260
return val & PCI_EXP_LNKSTA_DLLLA;
12601261
}
12611262

1263+
static enum dw_pcie_ltssm qcom_pcie_get_ltssm(struct dw_pcie *pci)
1264+
{
1265+
struct qcom_pcie *pcie = to_qcom_pcie(pci);
1266+
u32 val;
1267+
1268+
val = readl(pcie->parf + PARF_LTSSM);
1269+
return (enum dw_pcie_ltssm)FIELD_GET(PARF_LTSSM_STATE_MASK, val);
1270+
}
1271+
12621272
static void qcom_pcie_phy_power_off(struct qcom_pcie *pcie)
12631273
{
12641274
struct qcom_pcie_port *port;
@@ -1517,6 +1527,7 @@ static const struct qcom_pcie_cfg cfg_fw_managed = {
15171527
static const struct dw_pcie_ops dw_pcie_ops = {
15181528
.link_up = qcom_pcie_link_up,
15191529
.start_link = qcom_pcie_start_link,
1530+
.get_ltssm = qcom_pcie_get_ltssm,
15201531
};
15211532

15221533
static int qcom_pcie_icc_init(struct qcom_pcie *pcie)

0 commit comments

Comments
 (0)