Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import changes to fix lpass subsystem restart #3

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm/configs/cyanogenmod_tenderloin_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ CONFIG_MSM_MPDEC=y
# CONFIG_MSM_MPDEC_INPUTBOOST_CPUMIN is not set
CONFIG_MSM_CPU_FREQ_SET_MIN_MAX=y
CONFIG_MSM_CPU_FREQ_MAX=1512000
CONFIG_MSM_CPU_FREQ_MIN=384000
CONFIG_MSM_CPU_FREQ_MIN=192000
CONFIG_MSM_FORCE_MAX_CPU_TABLE=y
# CONFIG_MSM_AVS_HW is not set
# CONFIG_MSM_HW3D is not set
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/mach-msm/pil-q6v3.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ static int pil_q6v3_reset(struct pil_desc *pil)

q6v3_make_proxy_votes(pil->dev);

usleep(5);
/* Put Q6 into reset */
reg = readl_relaxed(LCC_Q6_FUNC);
reg |= Q6SS_SS_ARES | Q6SS_ISDB_ARES | Q6SS_ETM_ARES | STOP_CORE |
Expand All @@ -129,25 +130,30 @@ static int pil_q6v3_reset(struct pil_desc *pil)
CORE_TCM_MEM_PERPH_EN;
writel_relaxed(reg, LCC_Q6_FUNC);

usleep(5);
/* Turn on Q6 core clocks and take core out of reset */
reg &= ~(CLAMP_IO | Q6SS_SS_ARES | Q6SS_ISDB_ARES | Q6SS_ETM_ARES |
CORE_ARES);
writel_relaxed(reg, LCC_Q6_FUNC);

/* Wait for clocks to be enabled */
mb();
usleep(5);
/* Program boot address */
writel_relaxed((drv->start_addr >> 12) & 0xFFFFF,
drv->base + QDSP6SS_RST_EVB);

usleep(5);
writel_relaxed(Q6_STRAP_TCM_CONFIG | Q6_STRAP_TCM_BASE,
drv->base + QDSP6SS_STRAP_TCM);
writel_relaxed(Q6_STRAP_AHB_UPPER | Q6_STRAP_AHB_LOWER,
drv->base + QDSP6SS_STRAP_AHB);

usleep(5);
/* Wait for addresses to be programmed before starting Q6 */
mb();

usleep(5);
/* Start Q6 instruction execution */
reg &= ~STOP_CORE;
writel_relaxed(reg, LCC_Q6_FUNC);
Expand Down
11 changes: 7 additions & 4 deletions arch/arm/mach-msm/subsystem_restart.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,12 @@ static int subsystem_restart_thread(void *data)
* sequence for these subsystems. In the latter case, panic and bail
* out, since a subsystem died in its powerup sequence.
*/
if (!mutex_trylock(powerup_lock))
panic("%s[%p]: Subsystem died during powerup!",
__func__, current);
if (!mutex_trylock(powerup_lock)) {
mutex_unlock(shutdown_lock);
printk(KERN_ERR "%s: Subsystem '%s' died during powerup!?!", __func__, subsys->name);
kfree(data);
do_exit(0);
}

do_epoch_check(subsys);

Expand Down Expand Up @@ -601,7 +604,7 @@ static int __init subsys_restart_init(void)
restart_level = RESET_SUBSYS_COUPLED;
else
#endif
restart_level = RESET_SOC;
restart_level = RESET_SUBSYS_INDEPENDENT;

ret = ssr_init_soc_restart_orders();

Expand Down