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

Commit bd2c1e44 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "icnss: Allow recursive recovery for WLAN"

parents a1e99a84 caab5b7d
Loading
Loading
Loading
Loading
+18 −3
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -463,6 +463,7 @@ static struct icnss_priv {
	struct ramdump_device *msa0_dump_dev;
	bool bypass_s1_smmu;
	bool force_err_fatal;
	bool allow_recursive_recovery;
	u8 cause_for_rejuvenation;
	u8 requesting_sub_system;
	u16 line_number;
@@ -2230,6 +2231,7 @@ static int icnss_pd_restart_complete(struct icnss_priv *priv)
	if (ret < 0) {
		icnss_pr_err("Driver reinit failed: %d, state: 0x%lx\n",
			     ret, priv->state);
		if (!priv->allow_recursive_recovery)
			ICNSS_ASSERT(false);
		goto out_power_off;
	}
@@ -2405,6 +2407,7 @@ static int icnss_driver_event_pd_service_down(struct icnss_priv *priv,
	if (test_bit(ICNSS_PD_RESTART, &priv->state) && event_data->crashed) {
		icnss_pr_err("PD Down while recovery inprogress, crashed: %d, state: 0x%lx\n",
			     event_data->crashed, priv->state);
		if (!priv->allow_recursive_recovery)
			ICNSS_ASSERT(0);
		goto out;
	}
@@ -3725,6 +3728,15 @@ static int icnss_test_mode_fw_test(struct icnss_priv *priv,
	return ret;
}

static void icnss_allow_recursive_recovery(struct device *dev)
{
	struct icnss_priv *priv = dev_get_drvdata(dev);

	priv->allow_recursive_recovery = true;

	icnss_pr_info("Recursive recovery allowed for WLAN\n");
}

static ssize_t icnss_fw_debug_write(struct file *fp,
				    const char __user *user_buf,
				    size_t count, loff_t *off)
@@ -3773,6 +3785,9 @@ static ssize_t icnss_fw_debug_write(struct file *fp,
		case 3:
			ret = icnss_trigger_recovery(&priv->pdev->dev);
			break;
		case 4:
			icnss_allow_recursive_recovery(&priv->pdev->dev);
			break;
		default:
			return -EINVAL;
		}