mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 12:25:00 -04:00
pci: msm: Dump PCIe registers upon WAKE assertion
In case device asserts WAKE due to timeout in exiting L1, dump PCIe registers if link is in enabled state and drv is supported. Change-Id: I3d2edf1a42ef3a00e57418b2744a87d2693c698b Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
This commit is contained in:
parent
e8b3c55035
commit
1048d7aacc
1 changed files with 14 additions and 7 deletions
|
|
@ -721,7 +721,6 @@ struct msm_pcie_dev_t {
|
|||
bool enumerated;
|
||||
struct work_struct handle_wake_work;
|
||||
struct mutex recovery_lock;
|
||||
spinlock_t wakeup_lock;
|
||||
spinlock_t irq_lock;
|
||||
struct mutex aspm_lock;
|
||||
int prevent_l1;
|
||||
|
|
@ -767,6 +766,8 @@ struct msm_pcie_dev_t {
|
|||
int drv_disable_pc_vote;
|
||||
struct mutex drv_pc_lock;
|
||||
|
||||
bool drv_supported;
|
||||
|
||||
void (*rumi_init)(struct msm_pcie_dev_t *pcie_dev);
|
||||
};
|
||||
|
||||
|
|
@ -4796,7 +4797,7 @@ static irqreturn_t handle_wake_irq(int irq, void *data)
|
|||
unsigned long irqsave_flags;
|
||||
int i;
|
||||
|
||||
spin_lock_irqsave(&dev->wakeup_lock, irqsave_flags);
|
||||
spin_lock_irqsave(&dev->irq_lock, irqsave_flags);
|
||||
|
||||
dev->wake_counter++;
|
||||
PCIE_DBG(dev, "PCIe: No. %ld wake IRQ for RC%d\n",
|
||||
|
|
@ -4822,11 +4823,18 @@ static irqreturn_t handle_wake_irq(int irq, void *data)
|
|||
MSM_PCIE_EVENT_WAKEUP);
|
||||
}
|
||||
} else {
|
||||
if (dev->drv_supported && !dev->suspending &&
|
||||
dev->link_status == MSM_PCIE_LINK_ENABLED) {
|
||||
pcie_phy_dump(dev);
|
||||
pcie_parf_dump(dev);
|
||||
pcie_dm_core_dump(dev);
|
||||
}
|
||||
|
||||
msm_pcie_notify_client(dev, MSM_PCIE_EVENT_WAKEUP);
|
||||
}
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&dev->wakeup_lock, irqsave_flags);
|
||||
spin_unlock_irqrestore(&dev->irq_lock, irqsave_flags);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
|
@ -5546,7 +5554,6 @@ static int msm_pcie_probe(struct platform_device *pdev)
|
|||
int i, j;
|
||||
struct msm_pcie_dev_t *pcie_dev;
|
||||
struct device_node *of_node;
|
||||
bool drv_supported;
|
||||
|
||||
dev_info(&pdev->dev, "PCIe: %s\n", __func__);
|
||||
|
||||
|
|
@ -5819,8 +5826,9 @@ static int msm_pcie_probe(struct platform_device *pdev)
|
|||
goto decrease_rc_num;
|
||||
}
|
||||
|
||||
drv_supported = of_property_read_bool(of_node, "qcom,drv-supported");
|
||||
if (drv_supported) {
|
||||
pcie_dev->drv_supported = of_property_read_bool(of_node,
|
||||
"qcom,drv-supported");
|
||||
if (pcie_dev->drv_supported) {
|
||||
ret = msm_pcie_setup_drv(pcie_dev, of_node);
|
||||
if (ret)
|
||||
PCIE_ERR(pcie_dev,
|
||||
|
|
@ -6514,7 +6522,6 @@ static int __init pcie_init(void)
|
|||
mutex_init(&msm_pcie_dev[i].recovery_lock);
|
||||
mutex_init(&msm_pcie_dev[i].aspm_lock);
|
||||
mutex_init(&msm_pcie_dev[i].drv_pc_lock);
|
||||
spin_lock_init(&msm_pcie_dev[i].wakeup_lock);
|
||||
spin_lock_init(&msm_pcie_dev[i].irq_lock);
|
||||
msm_pcie_dev[i].drv_ready = false;
|
||||
msm_pcie_dev[i].l23_rdy_poll_timeout = L23_READY_POLL_TIMEOUT;
|
||||
|
|
|
|||
Loading…
Reference in a new issue