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

Commit 95469db4 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss: Add cnss_get_restart_level() support"

parents fe6f9689 e67e76d6
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -274,7 +274,7 @@ static int cnss_put_hw_resources(struct device *dev)

	info->cnss_hw_state = false;

	return ret;
	return 0;
}

static int cnss_get_hw_resources(struct device *dev)
@@ -678,9 +678,9 @@ int cnss_get_restart_level(void)
	ssr_info = &cnss_pdata->ssr_info;
	if (!ssr_info->subsys)
		return CNSS_RESET_SOC;
#ifdef CNSS_COMPLIE_ISSUE_FIX_LATER_IFNEEDED

	level = subsys_get_restart_level(ssr_info->subsys);
#endif

	switch (level) {
	case RESET_SOC:
		return CNSS_RESET_SOC;
+6 −0
Original line number Diff line number Diff line
@@ -328,6 +328,12 @@ static ssize_t system_debug_store(struct device *dev,
}
static DEVICE_ATTR_RW(system_debug);

int subsys_get_restart_level(struct subsys_device *dev)
{
	return dev->restart_level;
}
EXPORT_SYMBOL(subsys_get_restart_level);

static void subsys_set_state(struct subsys_device *subsys,
			     enum subsys_state state)
{
+7 −1
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-2019 2021, The Linux Foundation. All rights reserved.
 */

#ifndef __SUBSYS_RESTART_H
@@ -132,6 +132,7 @@ struct notif_data {

#if IS_ENABLED(CONFIG_MSM_SUBSYSTEM_RESTART)

extern int subsys_get_restart_level(struct subsys_device *dev);
extern int subsystem_restart_dev(struct subsys_device *dev);
extern int subsystem_restart(const char *name);
extern int subsystem_crashed(const char *name);
@@ -157,6 +158,11 @@ static inline void complete_shutdown_ack(struct subsys_desc *desc)
struct subsys_device *find_subsys_device(const char *str);
#else

static inline int subsys_get_restart_level(struct subsys_device *dev)
{
	return 0;
}

static inline int subsystem_restart_dev(struct subsys_device *dev)
{
	return 0;