Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db3cc330 authored by Yan He's avatar Yan He
Browse files

msm: ep_pcie: fix the bug in debugfs testing



PCIe device ID can't be got from register when the power of the
core is off. Thus, use the saved device ID so that we can turn on
link in the debugfs testing.

Change-Id: I28ec17b4fdf84b130cd32267d097b1c0d7c32aed
Signed-off-by: default avatarYan He <yanhe@codeaurora.org>
parent f9ae3707
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -293,6 +293,7 @@ struct ep_pcie_dev_t {
};

extern struct ep_pcie_dev_t ep_pcie_dev;
extern struct ep_pcie_hw hw_drv;

static inline void ep_pcie_write_mask(void __iomem *addr,
				u32 clear_mask, u32 set_mask)
+1 −1
Original line number Diff line number Diff line
@@ -1703,7 +1703,7 @@ int ep_pcie_core_config_db_routing(struct ep_pcie_db_config chdb_cfg,
	return 0;
}

static struct ep_pcie_hw hw_drv = {
struct ep_pcie_hw hw_drv = {
	.register_event	= ep_pcie_core_register_event,
	.deregister_event = ep_pcie_core_deregister_event,
	.get_linkstatus = ep_pcie_core_get_linkstatus,
+1 −5
Original line number Diff line number Diff line
@@ -296,7 +296,6 @@ static ssize_t ep_pcie_cmd_debug(struct file *file,
	unsigned int testcase = 0;
	struct ep_pcie_msi_config msi_cfg;
	int i;
	u32 device_id = 0;
	struct ep_pcie_hw *phandle = NULL;
	struct ep_pcie_iatu entries[2] = {
		{0x80000000, 0xbe7fffff, 0, 0},
@@ -305,10 +304,7 @@ static ssize_t ep_pcie_cmd_debug(struct file *file,
	struct ep_pcie_db_config chdb_cfg = {0x64, 0x6b, 0xfd4fa000};
	struct ep_pcie_db_config erdb_cfg = {0x64, 0x6b, 0xfd4fa080};

	if (dev->power_on) {
		device_id = readl_relaxed(dev->dm_core);
		phandle = ep_pcie_get_phandle(device_id);
	}
	phandle = ep_pcie_get_phandle(hw_drv.device_id);

	memset(str, 0, sizeof(str));
	ret = copy_from_user(str, buf, sizeof(str));