qcacld-3.0: Add pld api to get PCI reg dump on SSR

Add pld api to get PCI register dump on FW crash due
to PCI bus failure.

Change-Id: Ie30edbe2c60b0e71912667491c9fadbbe92373c4
This commit is contained in:
Mohammed Siddiq 2020-11-25 17:41:36 +05:30 • committed by snandini
commit bda2c4be27
3 changed files with 50 additions and 0 deletions

View file

@ -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);

View file

@ -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

View file

@ -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;
@ -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);