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

Commit dee26de9 authored by Tao,Zhang's avatar Tao,Zhang
Browse files

coresight: Doesn't save and restore ETMs state while CPU hot-plug



Doesn't save and restore ETMs state while CPU being offline and
online hot-plug. Since ETM driver can save and restore ETMs state
in hot-plug process. If JTAG driver save and restore ETMs state
as well, there could be some conflicts with ETM driver.

Change-Id: Ib4de3c0e3d0abb4cb15946fc444e0c1fc9188fd1
Signed-off-by: default avatarTao,Zhang <taozha@codeaurora.org>
parent 7af2b002
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2020, The Linux Foundation. All rights reserved.
 *
 */

@@ -865,7 +865,7 @@ static void dbg_init_arch_data(void)
 *
 * In all cases we will run on the same cpu for the entire duration.
 */
void msm_jtag_save_state(void)
void msm_jtag_save_state(bool is_hotcpu_cb)
{
	int cpu;

@@ -875,13 +875,14 @@ void msm_jtag_save_state(void)
	/* ensure counter is updated before moving forward */
	mb();

	if (!is_hotcpu_cb)
		msm_jtag_etm_save_state();
	if (dbg.save_restore_enabled)
		dbg_save_state(cpu);
}
EXPORT_SYMBOL(msm_jtag_save_state);

void msm_jtag_restore_state(void)
void msm_jtag_restore_state(bool is_hotcpu_cb)
{
	int cpu;

@@ -907,6 +908,7 @@ void msm_jtag_restore_state(void)

	if (dbg.save_restore_enabled)
		dbg_restore_state(cpu);
	if (!is_hotcpu_cb)
		msm_jtag_etm_restore_state();
}
EXPORT_SYMBOL(msm_jtag_restore_state);
@@ -925,13 +927,13 @@ static inline bool dbg_arch_supported(uint8_t arch)

static int jtag_hotcpu_save_callback(unsigned int cpu)
{
	msm_jtag_save_state();
	msm_jtag_save_state(true);
	return 0;
}

static int jtag_hotcpu_restore_callback(unsigned int cpu)
{
	msm_jtag_restore_state();
	msm_jtag_restore_state(true);
	return 0;
}

@@ -940,11 +942,11 @@ static int jtag_cpu_pm_callback(struct notifier_block *nfb,
{
	switch (action) {
	case CPU_PM_ENTER:
		msm_jtag_save_state();
		msm_jtag_save_state(false);
		break;
	case CPU_PM_ENTER_FAILED:
	case CPU_PM_EXIT:
		msm_jtag_restore_state();
		msm_jtag_restore_state(false);
		break;
	}
	return NOTIFY_OK;
+2 −2
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@ struct notifier_block;

#if defined(CONFIG_MSM_JTAG) || defined(CONFIG_MSM_JTAG_MM) || \
	defined(CONFIG_MSM_JTAGV8)
extern void msm_jtag_save_state(void);
extern void msm_jtag_restore_state(void);
extern void msm_jtag_save_state(bool is_hotcpu_cb);
extern void msm_jtag_restore_state(bool is_hotcpu_cb);
extern void msm_jtag_etm_save_state(void);
extern void msm_jtag_etm_restore_state(void);
extern bool msm_jtag_fuse_apps_access_disabled(void);