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

Commit 3413c8ef authored by Mukesh Kumar Savaliya's avatar Mukesh Kumar Savaliya
Browse files

i2c-msm-geni: Bypass ICC vote check for LE when dumping register



This change uses correct wrapper dev for LE instead of bypassing.
If wrapper dev or internal members are NULL, it crashes during
register dump time due to some other error.

This change fixes a crash happening to due to NULL pointer access.

[  278.999159] Call trace:
[  278.999165]  geni_se_dump_dbg_regs+0x98/0x2f0
[  278.999177]  geni_i2c_runtime_resume+0x2f4/0x4c8
[  278.999186]  pm_generic_runtime_resume+0x34/0x48
[  278.999193]  __rpm_callback+0x80/0x1a0
[  278.999198]  rpm_resume+0x4ec/0x720
[  278.999202]  __pm_runtime_resume+0x54/0x78
[  278.999211]  fts_trusted_touch_enable_store+0x1dc/0x8e0
[  278.999217]  dev_attr_store+0x40/0x58
[  278.999226]  sysfs_kf_write+0x50/0x68
[  278.999231]  kernfs_fop_write+0x150/0x1f8
[  278.999240]  __vfs_write+0x54/0x190
[  278.999247]  vfs_write+0xe4/0x1a0
[  278.999254]  __arm64_sys_pwrite64+0x80/0xc0
[  278.999263]  el0_svc_common+0x98/0x118
[  278.999270]  el0_svc_handler+0x7c/0x98
[  278.999277]  el0_svc+0x8/0xc
[  278.999286] Code: f94006a8 d0002800 9134b000 aa1603e1 (f9404d15).

Change-Id: Id764f92aab33e2e3cea2f4c276def6652231f67c
Signed-off-by: default avatarMukesh Kumar Savaliya <msavaliy@codeaurora.org>
parent a6ec4c9e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1231,6 +1231,9 @@ static int geni_i2c_probe(struct platform_device *pdev)
		dev_info(&pdev->dev, "LE-VM usecase\n");
	}

	gi2c->i2c_rsc.wrapper_dev = &wrapper_pdev->dev;
	gi2c->i2c_rsc.ctrl_dev = gi2c->dev;

	/*
	 * For LE, clocks, gpio and icb voting will be provided by
	 * by LA. The I2C operates in GSI mode only for LE usecase,
@@ -1238,8 +1241,6 @@ static int geni_i2c_probe(struct platform_device *pdev)
	 * in I2C LE dt.
	 */
	if (!gi2c->is_le_vm) {
		gi2c->i2c_rsc.wrapper_dev = &wrapper_pdev->dev;
		gi2c->i2c_rsc.ctrl_dev = gi2c->dev;
		gi2c->i2c_rsc.se_clk = devm_clk_get(&pdev->dev, "se-clk");
		if (IS_ERR(gi2c->i2c_rsc.se_clk)) {
			ret = PTR_ERR(gi2c->i2c_rsc.se_clk);