Loading core/pld/inc/pld_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,7 @@ void pld_allow_l1(struct device *dev); int pld_set_pcie_gen_speed(struct device *dev, u8 pcie_gen_speed); void pld_is_pci_link_down(struct device *dev); void pld_get_bus_reg_dump(struct device *dev, uint8_t *buf, uint32_t len); int pld_shadow_control(struct device *dev, bool enable); void pld_schedule_recovery_work(struct device *dev, enum pld_recovery_reason reason); Loading core/pld/src/pld_common.c +29 −0 Original line number Diff line number Diff line Loading @@ -693,6 +693,35 @@ void pld_is_pci_link_down(struct device *dev) } } /** * pld_get_bus_reg_dump() - Get bus reg dump * @dev: device * @buffer: buffer for hang data * @len: len of hang data * * Get pci reg dump for hang data. * * Return: void */ void pld_get_bus_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_PCIE_FW_SIM: case PLD_BUS_TYPE_IPCI_FW_SIM: break; case PLD_BUS_TYPE_PCIE: pld_pcie_get_reg_dump(dev, buf, len); break; case PLD_BUS_TYPE_SNOC_FW_SIM: case PLD_BUS_TYPE_SNOC: case PLD_BUS_TYPE_IPCI: break; default: pr_err("Invalid device type\n"); break; } } /** * pld_schedule_recovery_work() - Schedule recovery work * @dev: device Loading core/pld/src/pld_pcie.h +20 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,12 @@ static inline void pld_pcie_link_down(struct device *dev) { } static inline int pld_pcie_get_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { return 0; } static inline int pld_pcie_is_fw_down(struct device *dev) { return 0; Loading Loading @@ -500,6 +506,20 @@ static inline void pld_pcie_link_down(struct device *dev) cnss_pci_link_down(dev); } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) static inline int pld_pcie_get_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { return cnss_pci_get_reg_dump(dev, buf, len); } #else static inline int pld_pcie_get_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { return 0; } #endif static inline int pld_pcie_is_fw_down(struct device *dev) { return cnss_pci_is_device_down(dev); Loading Loading
core/pld/inc/pld_common.h +1 −0 Original line number Diff line number Diff line Loading @@ -470,6 +470,7 @@ void pld_allow_l1(struct device *dev); int pld_set_pcie_gen_speed(struct device *dev, u8 pcie_gen_speed); void pld_is_pci_link_down(struct device *dev); void pld_get_bus_reg_dump(struct device *dev, uint8_t *buf, uint32_t len); int pld_shadow_control(struct device *dev, bool enable); void pld_schedule_recovery_work(struct device *dev, enum pld_recovery_reason reason); Loading
core/pld/src/pld_common.c +29 −0 Original line number Diff line number Diff line Loading @@ -693,6 +693,35 @@ void pld_is_pci_link_down(struct device *dev) } } /** * pld_get_bus_reg_dump() - Get bus reg dump * @dev: device * @buffer: buffer for hang data * @len: len of hang data * * Get pci reg dump for hang data. * * Return: void */ void pld_get_bus_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { switch (pld_get_bus_type(dev)) { case PLD_BUS_TYPE_PCIE_FW_SIM: case PLD_BUS_TYPE_IPCI_FW_SIM: break; case PLD_BUS_TYPE_PCIE: pld_pcie_get_reg_dump(dev, buf, len); break; case PLD_BUS_TYPE_SNOC_FW_SIM: case PLD_BUS_TYPE_SNOC: case PLD_BUS_TYPE_IPCI: break; default: pr_err("Invalid device type\n"); break; } } /** * pld_schedule_recovery_work() - Schedule recovery work * @dev: device Loading
core/pld/src/pld_pcie.h +20 −0 Original line number Diff line number Diff line Loading @@ -187,6 +187,12 @@ static inline void pld_pcie_link_down(struct device *dev) { } static inline int pld_pcie_get_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { return 0; } static inline int pld_pcie_is_fw_down(struct device *dev) { return 0; Loading Loading @@ -500,6 +506,20 @@ static inline void pld_pcie_link_down(struct device *dev) cnss_pci_link_down(dev); } #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0)) static inline int pld_pcie_get_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { return cnss_pci_get_reg_dump(dev, buf, len); } #else static inline int pld_pcie_get_reg_dump(struct device *dev, uint8_t *buf, uint32_t len) { return 0; } #endif static inline int pld_pcie_is_fw_down(struct device *dev) { return cnss_pci_is_device_down(dev); Loading