Rip out samsung debugging

These fuckers really hardcoded this shit deep
fourteen
Ruchit 10 months ago committed by Jenna
parent b70caa37d3
commit 11140cf59e
  1. 13
      arch/arm64/configs/vendor/pixel_experience-a52q_defconfig
  2. 13
      arch/arm64/configs/vendor/pixel_experience-a72q_defconfig
  3. 2
      arch/arm64/kernel/traps.c
  4. 4
      drivers/cpuidle/lpm-levels.c
  5. 16
      drivers/gpu/drm/msm/msm_smmu.c
  6. 2
      drivers/gpu/drm/msm/samsung/ss_dsi_panel_debug.c
  7. 2
      drivers/gpu/drm/msm/sde/sde_kms.c
  8. 2
      drivers/gpu/drm/msm/sde/sde_plane.c
  9. 4
      drivers/input/sec_cmd.c
  10. 2
      drivers/input/sec_tsp_dumpkey.c
  11. 2
      drivers/input/touchscreen/stm/fts5cu56a/fts_sec.c
  12. 2
      drivers/input/touchscreen/stm/fts5cu56a/fts_ts.c
  13. 4
      drivers/iommu/arm-smmu.c
  14. 18
      drivers/media/platform/msm/sde/rotator/sde_rotator_smmu.c
  15. 2
      drivers/pinctrl/qcom/pinctrl-msm.c
  16. 8
      drivers/power/reset/msm-poweroff.c
  17. 5
      drivers/samsung/debug/sec_crashkey.c
  18. 16
      drivers/soc/qcom/subsystem_restart.c
  19. 2
      init/main.c
  20. 4
      kernel/panic.c
  21. 2
      kernel/time/timekeeping.c
  22. 2
      lib/bug.c

@ -2132,7 +2132,6 @@ CONFIG_INPUT_LEDS=y
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
# CONFIG_INPUT_KEYRESET is not set
CONFIG_SEC_DEBUG_TSP_LOG=y
CONFIG_INPUT_TOUCHSCREEN_SEC_CMD=y
CONFIG_INPUT_TOUCHSCREEN_TCLMV2=y
CONFIG_INPUT_SEC_SECURE_TOUCH=y
@ -5640,7 +5639,6 @@ CONFIG_SAMSUNG_PRODUCT_SHIP=y
# CONFIG_SAMSUNG_USER_TRIAL is not set
CONFIG_SEC_BSP=y
CONFIG_DRV_SAMSUNG=y
CONFIG_SEC_DEBUG=y
CONFIG_SEC_PARAM=y
# CONFIG_SEC_MPARAM is not set
CONFIG_SEC_PARAM_SIZE=0xA00000
@ -5663,38 +5661,28 @@ CONFIG_SEC_LOG_LAST_KMSG=y
CONFIG_SEC_LOG_STORE_LAST_KMSG=y
CONFIG_SEC_LOG_STORE_LPM_KMSG=y
# CONFIG_SEC_STORE_POWER_ONOFF_HISTORY is not set
CONFIG_SEC_DEBUG_SCHED_LOG=y
# CONFIG_SEC_DEBUG_SCHED_LOG_PER_CPU is not set
# CONFIG_SEC_DEBUG_SCHED_LOG_IRQ_V2 is not set
# CONFIG_SEC_DEBUG_MSG_LOG is not set
# CONFIG_SEC_DEBUG_DCVS_LOG is not set
# CONFIG_SEC_DEBUG_POWER_LOG is not set
# CONFIG_SEC_DEBUG_FUELGAUGE_LOG is not set
CONFIG_SEC_DEBUG_SUMMARY=y
# CONFIG_SEC_DEBUG_SUMMARY_DRIVER is not set
# CONFIG_SEC_DEBUG_LOW_LOG is not set
# CONFIG_SEC_DEBUG_FORCE_ERROR is not set
CONFIG_SEC_USER_RESET_DEBUG=y
# CONFIG_SEC_USER_RESET_DEBUG_TEST is not set
CONFIG_SEC_PERIPHERAL_SECURE_CHK=y
CONFIG_SEC_SSR_DEBUG_LEVEL_CHK=y
# CONFIG_SEC_DEBUG_PWDT is not set
CONFIG_SEC_DEBUG_DUMP_TASK_STACK=y
# CONFIG_SEC_DEBUG_MDM_FILE_INFO is not set
# CONFIG_SEC_DEBUG_DOUBLE_FREE is not set
# CONFIG_SEC_FILE_LEAK_DEBUG is not set
CONFIG_KERNEL_MODE_NEON_DEBUG=y
# CONFIG_SEC_SLUB_DEBUG is not set
# CONFIG_SEC_CP_SEPARATE_DEBUG is not set
CONFIG_SEC_DEBUG_MODULE_INFO=y
CONFIG_SEC_BOOTSTAT=y
# CONFIG_SEC_NOEYEINFO is not set
CONFIG_SEC_QPNP_PON_SPARE_BITS=7
# CONFIG_ARGOS is not set
CONFIG_SEC_MISC=y
CONFIG_SEC_SMEM=y
CONFIG_SEC_SMEM_VENDOR1_VERSION=5
CONFIG_SEC_DEBUG_APPS_CLK_LOGGING=y
#
# Samsung Vbus Notifier drivers
@ -6341,7 +6329,6 @@ CONFIG_DEBUG_ALIGN_RODATA=y
# PowerManagement Feature
#
CONFIG_SEC_PM=y
CONFIG_SEC_PM_DEBUG=y
#
# Security options

@ -2129,7 +2129,6 @@ CONFIG_INPUT_LEDS=y
CONFIG_INPUT_EVDEV=y
# CONFIG_INPUT_EVBUG is not set
# CONFIG_INPUT_KEYRESET is not set
CONFIG_SEC_DEBUG_TSP_LOG=y
CONFIG_INPUT_TOUCHSCREEN_SEC_CMD=y
CONFIG_INPUT_TOUCHSCREEN_TCLMV2=y
CONFIG_INPUT_SEC_SECURE_TOUCH=y
@ -5637,7 +5636,6 @@ CONFIG_SAMSUNG_PRODUCT_SHIP=y
# CONFIG_SAMSUNG_USER_TRIAL is not set
CONFIG_SEC_BSP=y
CONFIG_DRV_SAMSUNG=y
CONFIG_SEC_DEBUG=y
CONFIG_SEC_PARAM=y
# CONFIG_SEC_MPARAM is not set
CONFIG_SEC_PARAM_SIZE=0xA00000
@ -5660,38 +5658,28 @@ CONFIG_SEC_LOG_LAST_KMSG=y
CONFIG_SEC_LOG_STORE_LAST_KMSG=y
CONFIG_SEC_LOG_STORE_LPM_KMSG=y
# CONFIG_SEC_STORE_POWER_ONOFF_HISTORY is not set
CONFIG_SEC_DEBUG_SCHED_LOG=y
# CONFIG_SEC_DEBUG_SCHED_LOG_PER_CPU is not set
# CONFIG_SEC_DEBUG_SCHED_LOG_IRQ_V2 is not set
# CONFIG_SEC_DEBUG_MSG_LOG is not set
# CONFIG_SEC_DEBUG_DCVS_LOG is not set
# CONFIG_SEC_DEBUG_POWER_LOG is not set
# CONFIG_SEC_DEBUG_FUELGAUGE_LOG is not set
CONFIG_SEC_DEBUG_SUMMARY=y
# CONFIG_SEC_DEBUG_SUMMARY_DRIVER is not set
# CONFIG_SEC_DEBUG_LOW_LOG is not set
# CONFIG_SEC_DEBUG_FORCE_ERROR is not set
CONFIG_SEC_USER_RESET_DEBUG=y
# CONFIG_SEC_USER_RESET_DEBUG_TEST is not set
CONFIG_SEC_PERIPHERAL_SECURE_CHK=y
CONFIG_SEC_SSR_DEBUG_LEVEL_CHK=y
# CONFIG_SEC_DEBUG_PWDT is not set
CONFIG_SEC_DEBUG_DUMP_TASK_STACK=y
# CONFIG_SEC_DEBUG_MDM_FILE_INFO is not set
# CONFIG_SEC_DEBUG_DOUBLE_FREE is not set
# CONFIG_SEC_FILE_LEAK_DEBUG is not set
CONFIG_KERNEL_MODE_NEON_DEBUG=y
# CONFIG_SEC_SLUB_DEBUG is not set
# CONFIG_SEC_CP_SEPARATE_DEBUG is not set
CONFIG_SEC_DEBUG_MODULE_INFO=y
CONFIG_SEC_BOOTSTAT=y
# CONFIG_SEC_NOEYEINFO is not set
CONFIG_SEC_QPNP_PON_SPARE_BITS=7
# CONFIG_ARGOS is not set
CONFIG_SEC_MISC=y
CONFIG_SEC_SMEM=y
CONFIG_SEC_SMEM_VENDOR1_VERSION=5
CONFIG_SEC_DEBUG_APPS_CLK_LOGGING=y
#
# Samsung Vbus Notifier drivers
@ -6337,7 +6325,6 @@ CONFIG_DEBUG_ALIGN_RODATA=y
# PowerManagement Feature
#
CONFIG_SEC_PM=y
CONFIG_SEC_PM_DEBUG=y
#
# Security options

@ -318,8 +318,10 @@ void die(const char *str, struct pt_regs *regs, int err)
oops_enter();
#ifdef CONFIG_SEC_DEBUG
sec_debug_sched_msg("!!die!!");
sec_debug_summary_save_die_info(str, regs);
#endif
console_verbose();
bust_spinlocks(1);

@ -1745,6 +1745,8 @@ static int lpm_suspend_prepare(void)
#ifdef CONFIG_SEC_PM
regulator_showall_enabled();
#endif
#ifdef CONFIG_SEC_PM_DEBUG
sec_clock_debug_print_enabled();
#endif
@ -1765,7 +1767,7 @@ static void lpm_suspend_wake(void)
suspend_in_progress = false;
lpm_stats_suspend_exit();
#ifdef CONFIG_SEC_PM
#ifdef CONFIG_SEC_PM_DEBUG
sec_debug_print_sleep_time();
#endif
}

@ -273,11 +273,11 @@ static int msm_smmu_map_dma_buf(struct msm_mmu *mmu, struct sg_table *sgt,
dir, attrs, client->secure);
}
#if defined(CONFIG_DISPLAY_SAMSUNG)
if (sec_debug_is_enabled() && sgt && sgt->sgl)
#if defined(CONFIG_DISPLAY_SAMSUNG) && defined(CONFIG_SEC_DEBUG)
if (sgt && sgt->sgl)
ss_smmu_debug_map(SMMU_RT_DISPLAY_DEBUG, 0, NULL, sgt);
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO)
if (sec_debug_is_enabled() && sgt && sgt->sgl)
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO) && defined(CONFIG_SEC_DEBUG)
if (sgt && sgt->sgl)
ss_smmu_debug_map(SMMU_RT_DISPLAY_DEBUG, sgt);
#endif
@ -304,11 +304,11 @@ static void msm_smmu_unmap_dma_buf(struct msm_mmu *mmu, struct sg_table *sgt,
dir, client->secure);
}
#if defined(CONFIG_DISPLAY_SAMSUNG)
if (sec_debug_is_enabled() && sgt && sgt->sgl)
#if defined(CONFIG_DISPLAY_SAMSUNG) && defined(CONFIG_SEC_DEBUG)
if (sgt && sgt->sgl)
ss_smmu_debug_unmap(SMMU_RT_DISPLAY_DEBUG, sgt);
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO)
if (sec_debug_is_enabled() && sgt && sgt->sgl)
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO) && defined(CONFIG_SEC_DEBUG)
if (sgt && sgt->sgl)
ss_smmu_debug_unmap(SMMU_RT_DISPLAY_DEBUG, sgt);
#endif

@ -925,10 +925,12 @@ int ss_smmu_debug_init(struct samsung_display_driver_data *vdd)
int ret = 0;
/* This debug is available by sde_debug enabled condition */
#if defined(CONFIG_SEC_DEBUG)
if (!sec_debug_is_enabled()) {
LCD_ERR("sec_debug_is_enabled : %d\n", sec_debug_is_enabled());
goto init_fail;
}
#endif
/* Create KMEM_CACHE slab */
if (IS_ERR_OR_NULL(vdd->ss_debug_smmu_cache)) {

@ -868,7 +868,7 @@ static int _sde_kms_release_splash_buffer(unsigned int mem_addr,
#if defined(CONFIG_DISPLAY_SAMSUNG_LEGO)
SDE_INFO("release splash buffer: addr: %x, size: %x, sec_debug: %d\n",
mem_addr, splash_buffer_size, sec_debug_is_enabled());
mem_addr, splash_buffer_size);
#endif
return ret;

@ -921,7 +921,7 @@ int sde_plane_wait_input_fence(struct drm_plane *plane, uint32_t wait_ms)
psde->is_error = true;
sde_kms_timeline_status(plane->dev);
#if defined(CONFIG_DISPLAY_SAMSUNG) || defined(CONFIG_DISPLAY_SAMSUNG_LEGO)
#if defined(CONFIG_DISPLAY_SAMSUNG) && (CONFIG_SEC_DEBUG) || defined(CONFIG_DISPLAY_SAMSUNG_LEGO) && (CONFIG_SEC_DEBUG)
{
struct dma_fence *tout_fence = input_fence;

@ -336,7 +336,9 @@ static void sec_cmd_store_function(struct sec_cmd_data *data)
(unsigned long)t,
nanosec_rem / 1000);
#if IS_ENABLED(CONFIG_SEC_DEBUG_TSP_LOG)
sec_debug_tsp_command_history(tbuf);
#endif
}
}
@ -383,9 +385,11 @@ static ssize_t sec_cmd_store(struct device *dev, struct device_attribute *devatt
nanosec_rem / 1000);
snprintf(task_info, 40, "\n[%d:%s]", current->pid, current->comm);
#if IS_ENABLED(CONFIG_SEC_DEBUG_TSP_LOG)
sec_debug_tsp_command_history(task_info);
sec_debug_tsp_command_history(cmd.cmd);
sec_debug_tsp_command_history(tbuf);
#endif
}
break;

@ -241,10 +241,12 @@ static struct notifier_block nb_gpio_keys = {
static int __init sec_tsp_dumpkey_init(void)
{
#ifdef CONFIG_SEC_DEBUG
/* only work for debug level is low */
// if (unlikely(!sec_debug_is_enabled()))
sec_kn_register_notifier(&nb_gpio_keys,
used_keys, ARRAY_SIZE(used_keys));
#endif
return 0;
}

@ -886,7 +886,9 @@ static ssize_t get_lp_dump(struct device *dev, struct device_attribute *attr, ch
snprintf(ibuff, sizeof(ibuff), "%03d: %04x%04x%04x%04x%04x\n",
i + (info->sponge_dump_event * dump_area),
edata[0], edata[1], edata[2], edata[3], edata[4]);
#ifdef CONFIG_SEC_DEBUG
sec_tsp_sponge_log(ibuff);
#endif
}
}

@ -3840,7 +3840,9 @@ static void fts_sponge_dump_flush(struct fts_ts_info *info, int dump_area)
snprintf(buff, sizeof(buff), "%03d: %04x%04x%04x%04x%04x\n",
i + (info->sponge_dump_event * dump_area),
edata[0], edata[1], edata[2], edata[3], edata[4]);
#ifdef CONFIG_SEC_DEBUG
sec_tsp_sponge_log(buff);
#endif
}
}

@ -1742,7 +1742,9 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
dev_err(smmu->dev,
"Took an address size fault. Refusing to recover.\n");
#ifdef CONFIG_SEC_DEBUG
sec_debug_save_smmu_info_asf_fatal();
#endif
BUG();
}
@ -1807,7 +1809,9 @@ static irqreturn_t arm_smmu_context_fault(int irq, void *dev)
dev_err(smmu->dev,
"Unhandled arm-smmu context fault!\n");
#ifdef CONFIG_SEC_DEBUG
sec_debug_save_smmu_info_fatal();
#endif
// BUG();
panic("%s SMMU Fault - SID=0x%x", arm_smmu_get_devname(smmu_domain, frsynra), frsynra);
}

@ -392,12 +392,10 @@ int sde_smmu_map_dma_buf(struct dma_buf *dma_buf,
*iova = table->sgl->dma_address;
*size = table->sgl->dma_length;
#if defined(CONFIG_DISPLAY_SAMSUNG)
if (sec_debug_is_enabled())
ss_smmu_debug_map(SMMU_NRT_ROTATOR_DEBUG, domain, NULL, table);
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO)
if (sec_debug_is_enabled())
ss_smmu_debug_map(SMMU_NRT_ROTATOR_DEBUG, table);
#if defined(CONFIG_DISPLAY_SAMSUNG) && defined(CONFIG_SEC_DEBUG)
ss_smmu_debug_map(SMMU_NRT_ROTATOR_DEBUG, domain, NULL, table);
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO) && defined(CONFIG_SEC_DEBUG)
ss_smmu_debug_map(SMMU_NRT_ROTATOR_DEBUG, table);
#endif
return 0;
}
@ -412,12 +410,12 @@ void sde_smmu_unmap_dma_buf(struct sg_table *table, int domain,
return;
}
#ifdef CONFIG_SEC_DEBUG
#if defined(CONFIG_DISPLAY_SAMSUNG)
if (sec_debug_is_enabled())
ss_smmu_debug_unmap(SMMU_NRT_ROTATOR_DEBUG, table);
ss_smmu_debug_unmap(SMMU_NRT_ROTATOR_DEBUG, table);
#elif defined(CONFIG_DISPLAY_SAMSUNG_LEGO)
if (sec_debug_is_enabled())
ss_smmu_debug_unmap(SMMU_NRT_ROTATOR_DEBUG, table);
ss_smmu_debug_unmap(SMMU_NRT_ROTATOR_DEBUG, table);
#endif
#endif
dma_unmap_sg(sde_smmu->dev, table->sgl, table->nents,

@ -45,7 +45,7 @@
#include <linux/notifier.h>
#endif
#ifdef CONFIG_SEC_PM_DEBUG
#ifdef CONFIG_SEC_PM
#include <linux/sec-pinmux.h>
#endif

@ -382,10 +382,12 @@ static void msm_restart_prepare(const char *cmd)
qpnp_pon_set_restart_reason(
PON_RESTART_REASON_KEYS_CLEAR);
__raw_writel(0x7766550a, restart_reason);
#ifdef CONFIG_SEC_DEBUG
} else if (!strncmp(cmd, "cross_fail", 10)) {
qpnp_pon_set_restart_reason(
PON_RESTART_REASON_CROSS_FAIL);
__raw_writel(0x7766550c, restart_reason);
#endif
#ifdef CONFIG_SEC_PERIPHERAL_SECURE_CHK
} else if (!strcmp(cmd, "peripheral_hw_reset")) {
qpnp_pon_set_restart_reason(
@ -400,11 +402,7 @@ static void msm_restart_prepare(const char *cmd)
if (!ret)
__raw_writel(0x6f656d00 | (code & 0xff),
restart_reason);
#ifndef CONFIG_SEC_DEBUG
} else if (!strncmp(cmd, "edl", 3)) {
enable_emergency_dload_mode();
#endif
#if defined(CONFIG_SEC_ABC)
#if defined(CONFIG_SEC_ABC) && defined(CONFIG_SEC_DEBUG)
} else if (!strncmp(cmd, "user_dram_test", 14) && sec_abc_get_enabled()) {
qpnp_pon_set_restart_reason(PON_RESTART_REASON_USER_DRAM_TEST);
#endif

@ -256,10 +256,11 @@ static int __init sec_crashkey_init(void)
{
int err;
if (!sec_debug_is_enabled())
#ifndef CONFIG_SEC_DEBUG
key_event_state = &crashkey_user_state;
else
else
key_event_state = &crashkey_state;
#endif
__sec_crashkey_parse_dt_replace_keymap();

@ -568,8 +568,9 @@ static void notif_timeout_handler(unsigned long data)
default:
SSR_NOTIF_TIMEOUT_WARN(unknown_err_msg);
}
#ifdef CONFIG_SEC_DEBUG_SUMMARY
sec_debug_summary_set_timeout_subsys(timeout_data->source_name, timeout_data->dest_name);
#endif
}
static void _setup_timeout(struct subsys_desc *source_ss,
@ -1187,12 +1188,14 @@ static void subsystem_restart_wq_func(struct work_struct *work)
track->p_state = SUBSYS_RESTARTING;
spin_unlock_irqrestore(&track->s_lock, flags);
if (sec_debug_is_enabled()) {
#ifdef CONFIG_SEC_DEBUG
{
/* Collect ram dumps for all subsystems in order here */
pr_info("%s: collect ssr ramdump..\n", __func__);
for_each_subsys_device(list, count, NULL, subsystem_ramdump);
pr_info("%s: ..done\n", __func__);
}
#endif
for_each_subsys_device(list, count, NULL, subsystem_free_memory);
notify_each_subsys_device(list, count, SUBSYS_BEFORE_POWERUP, NULL);
@ -1304,6 +1307,7 @@ int subsystem_restart_dev(struct subsys_device *dev)
send_early_notifications(dev->early_notify);
#ifdef CONFIG_SEC_DEBUG
if ((sec_debug_summary_is_modem_separate_debug_ssr() ==
SEC_DEBUG_MODEM_SEPARATE_EN)
&& strcmp(name, "slpi")
@ -1311,13 +1315,15 @@ int subsystem_restart_dev(struct subsys_device *dev)
pr_info("SSR separated by cp magic!!\n");
ssr_enable = sec_debug_is_enabled_for_ssr();
} else
#endif
pr_info("SSR by only ap debug level!!\n");
if (!sec_debug_is_enabled() || (!ssr_enable))
#ifdef CONFIG_SEC_DEBUG
if (!ssr_enable)
dev->restart_level = RESET_SUBSYS_COUPLED;
else
#else
dev->restart_level = RESET_SOC;
#endif
if (!strncmp(name, "modem", 5)) {
if (silent_ssr) /* qcrtr ioctl force silent ssr */
dev->restart_level = RESET_SUBSYS_COUPLED;

@ -1100,7 +1100,7 @@ int __init_or_module do_one_initcall(initcall_t fn)
if (initcall_debug)
ret = do_one_initcall_debug(fn);
#ifdef CONFIG_SEC_BSP
#if defined(CONFIG_SEC_BSP) && (CONFIG_SEC_BOOTSTAT)
else if (initcall_sec_debug)
ret = do_one_initcall_sec_debug(fn);
#endif

@ -151,8 +151,10 @@ void panic(const char *fmt, ...)
#endif
trace_kernel_panic(0);
#ifdef CONFIG_SEC_DEBUG
/*To prevent watchdog reset during panic handling. */
emerg_pet_watchdog();
#endif
/*
* Disable local interrupts. This will prevent panic_smp_self_stop
@ -184,9 +186,11 @@ void panic(const char *fmt, ...)
if (old_cpu != PANIC_CPU_INVALID && old_cpu != this_cpu)
panic_smp_self_stop();
#ifdef CONFIG_SEC_DEBUG
sec_debug_sched_msg("!!panic!!");
sec_debug_sched_msg("!!panic!!");
#endif
console_verbose();
bust_spinlocks(1);

@ -1564,7 +1564,7 @@ static void __timekeeping_inject_sleeptime(struct timekeeper *tk,
tk_debug_account_sleep_time(delta);
}
#if IS_ENABLED(CONFIG_SEC_PM)
#ifdef CONFIG_SEC_PM_DEBUG
void sec_debug_print_sleep_time(void)
{
pr_info("PM: Timekeeping suspended for %lld.%03lu seconds\n",

@ -192,7 +192,9 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
return BUG_TRAP_TYPE_WARN;
}
#ifdef CONFIG_SEC_DEBUG
sec_debug_store_bug_string(file, line);
#endif
printk(KERN_DEFAULT "------------[ cut here ]------------\n");

Loading…
Cancel
Save