Merge "defconfig: Enable required defconfigs for sdxlemur target"

This commit is contained in:
qctecmdr 2020-11-15 01:08:07 -08:00 • committed by Gerrit - the friendly Code Review server
commit 8ff49d4085
4 changed files with 77 additions and 11 deletions

View file

@ -1,9 +1,9 @@
CONFIG_LOCALVERSION="-debug"
CONFIG_SERIAL_MSM=y
CONFIG_SERIAL_MSM_CONSOLE=y
CONFIG_HVC_DCC=y
CONFIG_DYNAMIC_DEBUG=y
CONFIG_DEBUG_PAGEALLOC=y
CONFIG_DEBUG_CREDENTIALS=y
CONFIG_DEBUG_KMEMLEAK=y
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y
CONFIG_DEBUG_STACK_USAGE=y
@ -20,6 +20,8 @@ CONFIG_DEBUG_USER=y
CONFIG_IPA3=y
CONFIG_IPA_WDI_UNIFIED_API=y
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_HARDENED_USERCOPY_PAGESPAN=y
CONFIG_PANIC_ON_DATA_CORRUPTION=y
CONFIG_IOMMU_DEBUG=y
CONFIG_IOMMU_TESTS=y
CONFIG_IOMMU_TLBSYNC_DEBUG=y

View file

@ -1,5 +1,6 @@
CONFIG_LOCALVERSION="-perf"
CONFIG_ARCH_SDXLEMUR=y
CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y
CONFIG_HWSPINLOCK_QCOM=y
CONFIG_MSM_BOOT_STATS=y
CONFIG_QCOM_SMEM=y
@ -8,6 +9,9 @@ CONFIG_IPC_LOGGING=y
CONFIG_IPA3=y
CONFIG_IPA_WDI_UNIFIED_API=y
# CONFIG_USB_GADGET_DEBUG_FS is not set
CONFIG_MAILBOX=y
CONFIG_MSM_QMP=y
CONFIG_PANIC_ON_RECURSIVE_FAULT=y
CONFIG_PINCTRL_SDXLEMUR=y
CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE=y
CONFIG_REGULATOR_FIXED_VOLTAGE=y
@ -170,6 +174,8 @@ CONFIG_QMP_DEBUGFS_CLIENT=y
CONFIG_QCOM_GLINK=y
CONFIG_MSM_GLINK_SSR=y
CONFIG_QCOM_APCS_IPC=y
CONFIG_SLAB_FREELIST_RANDOM=y
CONFIG_QCOM_SOCINFO=y
CONFIG_USB_DWC3=y
CONFIG_USB_DWC3_MSM=y
CONFIG_USB_QCOM_EMU_PHY=y
@ -266,6 +272,11 @@ CONFIG_MSM_SERVICE_LOCATOR=y
# CONFIG_SENSORS_SSC is not set
CONFIG_MSM_SERVICE_NOTIFIER=y
# CONFIG_MSM_ADSPRPC is not set
CONFIG_QCOM_WDT_CORE=y
CONFIG_QCOM_SOC_WATCHDOG=y
CONFIG_QCOM_FORCE_WDOG_BITE_ON_PANIC=y
CONFIG_QCOM_WDOG_BITE_EARLY_PANIC=y
# CONFIG_QCOM_WATCHDOG_USERSPACE_PET is not set
CONFIG_QCOM_SPS_DMA=y
CONFIG_I2C_MSM_V2=y
CONFIG_SPI_QUP=y

View file

@ -10,6 +10,11 @@
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/percpu.h>
#include <linux/of.h>
#include <linux/cpu_pm.h>
#include <linux/platform_device.h>
#include <linux/wait.h>
#include <linux/reboot.h>
#include <linux/qcom_scm.h>
@ -458,7 +463,15 @@ static void qcom_wdt_unregister_die_notifier(struct msm_watchdog_data *wdog_dd)
static void qcom_wdt_disable(struct msm_watchdog_data *wdog_dd)
{
wdog_dd->ops->disable_wdt(wdog_dd);
devm_free_irq(wdog_dd->dev, wdog_dd->bark_irq, wdog_dd);
if (wdog_dd->irq_ppi) {
disable_percpu_irq(wdog_dd->bark_irq);
free_percpu_irq(wdog_dd->bark_irq,
(void __percpu *)wdog_dd->wdog_cpu_dd);
} else {
devm_free_irq(wdog_dd->dev, wdog_dd->bark_irq, wdog_dd);
}
wdog_dd->enabled = false;
/*Ensure all cpus see update to enable*/
smp_mb();
@ -733,6 +746,8 @@ int qcom_wdt_remove(struct platform_device *pdev)
mutex_unlock(&wdog_dd->disable_lock);
device_remove_file(wdog_dd->dev, &dev_attr_disable);
if (wdog_dd->irq_ppi)
free_percpu((void __percpu *)wdog_dd->wdog_cpu_dd);
irq_dispose_mapping(wdog_dd->bark_irq);
dev_info(wdog_dd->dev, "QCOM Apps Watchdog Exit - Deactivated\n");
del_timer_sync(&wdog_dd->pet_timer);
@ -798,6 +813,14 @@ static irqreturn_t qcom_wdt_bark_handler(int irq, void *dev_id)
return IRQ_HANDLED;
}
static irqreturn_t qcom_wdt_ppi_bark(int irq, void *dev_id_percpu)
{
void *dev_id = raw_cpu_ptr((void __percpu *)dev_id_percpu);
struct msm_watchdog_data *wdog_dd = *((struct msm_watchdog_data **)dev_id);
return qcom_wdt_bark_handler(irq, wdog_dd);
}
static int qcom_wdt_init_sysfs(struct msm_watchdog_data *wdog_dd)
{
int error = 0;
@ -820,17 +843,35 @@ static int qcom_wdt_init(struct msm_watchdog_data *wdog_dd,
unsigned long delay_time;
uint32_t val;
int ret;
void *wdog_cpu_dd_v;
ret = devm_request_irq(wdog_dd->dev, wdog_dd->bark_irq,
qcom_wdt_bark_handler,
IRQF_TRIGGER_RISING | IRQF_NO_SUSPEND,
"apps_wdog_bark", wdog_dd);
if (ret) {
dev_err(wdog_dd->dev, "failed to request bark irq\n");
return -EINVAL;
if (wdog_dd->irq_ppi) {
wdog_dd->wdog_cpu_dd = alloc_percpu(struct msm_watchdog_data *);
if (!wdog_dd->wdog_cpu_dd) {
dev_err(wdog_dd->dev, "failed to allocate cpu data\n");
return -ENOMEM;
}
wdog_cpu_dd_v = raw_cpu_ptr((void __percpu *)wdog_dd->wdog_cpu_dd);
*((struct msm_watchdog_data **)wdog_cpu_dd_v) = wdog_dd;
ret = request_percpu_irq(wdog_dd->bark_irq, qcom_wdt_ppi_bark,
"apps_wdog_bark",
(void __percpu *)wdog_dd->wdog_cpu_dd);
if (ret) {
dev_err(wdog_dd->dev, "failed to request bark irq\n");
free_percpu((void __percpu *)wdog_dd->wdog_cpu_dd);
return ret;
}
} else {
ret = devm_request_irq(wdog_dd->dev, wdog_dd->bark_irq,
qcom_wdt_bark_handler,
IRQF_TRIGGER_RISING,
"apps_wdog_bark", wdog_dd);
if (ret) {
dev_err(wdog_dd->dev, "failed to request bark irq: %d\n", ret);
return -EINVAL;
}
}
INIT_WORK(&wdog_dd->irq_counts_work, compute_irq_stat);
atomic_set(&wdog_dd->irq_counts_running, 0);
delay_time = msecs_to_jiffies(wdog_dd->pet_time);
wdog_dd->ops->set_bark_time(wdog_dd->bark_time, wdog_dd);
wdog_dd->ops->set_bite_time(wdog_dd->bark_time + 3 * 1000, wdog_dd);
@ -863,6 +904,13 @@ static int qcom_wdt_init(struct msm_watchdog_data *wdog_dd,
&wdog_dd->panic_blk);
qcom_wdt_unregister_die_notifier(wdog_dd);
unregister_restart_handler(&wdog_dd->restart_blk);
if (wdog_dd->irq_ppi) {
free_percpu_irq(wdog_dd->bark_irq,
(void __percpu *)wdog_dd->wdog_cpu_dd);
free_percpu((void __percpu *)wdog_dd->wdog_cpu_dd);
}
del_timer_sync(&wdog_dd->pet_timer);
flush_work(&wdog_dd->irq_counts_work);
dev_err(wdog_dd->dev, "Failed Initializing QCOM Apps Watchdog\n");
@ -875,6 +923,8 @@ static int qcom_wdt_init(struct msm_watchdog_data *wdog_dd,
qcom_wdt_init_sysfs(wdog_dd);
if (wdog_dd->irq_ppi)
enable_percpu_irq(wdog_dd->bark_irq, 0);
if (!IPI_CORES_IN_LPM) {
wdog_dd->wdog_cpu_pm_nb.notifier_call = qcom_wdt_cpu_pm_notify;
cpu_pm_register_notifier(&wdog_dd->wdog_cpu_pm_nb);
@ -897,6 +947,7 @@ static void qcom_wdt_dt_to_pdata(struct platform_device *pdev,
struct msm_watchdog_data *pdata)
{
pdata->bark_irq = platform_get_irq(pdev, 0);
pdata->irq_ppi = irq_is_percpu(pdata->bark_irq);
pdata->bark_time = QCOM_WATCHDOG_BARK_TIME;
pdata->pet_time = QCOM_WATCHDOG_PET_TIME;
pdata->do_ipi_ping = QCOM_WATCHDOG_IPI_PING;

View file

@ -118,9 +118,11 @@ struct msm_watchdog_data {
bool do_ipi_ping;
bool in_panic;
bool wakeup_irq_enable;
bool irq_ppi;
unsigned long long last_pet;
cpumask_t alive_mask;
struct mutex disable_lock;
struct msm_watchdog_data * __percpu *wdog_cpu_dd;
struct notifier_block panic_blk;
struct notifier_block die_blk;
struct notifier_block wdog_cpu_pm_nb;