summaryrefslogtreecommitdiff
path: root/core/pld
diff options
context:
space:
mode:
authorYuanyuan Liu <yuanliu@codeaurora.org>2018-09-05 14:57:46 -0700
committernshrivas <nshrivas@codeaurora.org>2018-09-21 14:30:29 -0700
commitb6710e15085ec9fa72a4b1bad6ea6dcba6f1d6cc (patch)
treeed15af624c8f57b9ef90776badeca8ae8725a4ef /core/pld
parent9531096de8db9487d5e3f35a033b1f9054bc3210 (diff)
downloadqcacld-b6710e15085ec9fa72a4b1bad6ea6dcba6f1d6cc.tar.gz
qcacld-3.0: Call icnss API to check if WLAN FW is down
If modem crashed during wlan driver unloading, icnss driver will call driver uevent callback to set FW down status in driver side when it receives BEFORE_SHUTDOWN notification. If wlan driver is de-initialized just before the callback is called, kernel will panic as driver's context is freed. This can be avoid by not setting FW status in host driver. Instead, icnss driver provides an API to host driver to check FW status and host driver calls this API before any timeout assert or accessing HW registers. CRs-Fixed: 2161431 Change-Id: I8331367dd41dd0cedfa65c63f1bb3ffcb535e1c9
Diffstat (limited to 'core/pld')
-rw-r--r--core/pld/inc/pld_common.h1
-rw-r--r--core/pld/src/pld_common.c29
-rw-r--r--core/pld/src/pld_snoc.h12
3 files changed, 41 insertions, 1 deletions
diff --git a/core/pld/inc/pld_common.h b/core/pld/inc/pld_common.h
index 1b9e9a9d92..216fe4556d 100644
--- a/core/pld/inc/pld_common.h
+++ b/core/pld/inc/pld_common.h
@@ -542,6 +542,7 @@ void pld_get_msi_address(struct device *dev, uint32_t *msi_addr_low,
uint32_t *msi_addr_high);
unsigned int pld_socinfo_get_serial_number(struct device *dev);
int pld_is_qmi_disable(struct device *dev);
+int pld_is_fw_down(struct device *dev);
int pld_force_assert_target(struct device *dev);
bool pld_is_fw_dump_skipped(struct device *dev);
diff --git a/core/pld/src/pld_common.c b/core/pld/src/pld_common.c
index 015c2c0ca3..9e9b68f68c 100644
--- a/core/pld/src/pld_common.c
+++ b/core/pld/src/pld_common.c
@@ -1471,6 +1471,35 @@ int pld_is_qmi_disable(struct device *dev)
}
/**
+ * pld_is_fw_down() - Check WLAN fw is down or not
+ *
+ * @dev: device
+ *
+ * This API will be called to check if WLAN FW is down or not.
+ *
+ * Return: 1 FW is down
+ * 0 FW is not down
+ * Non zero failure code for errors
+ */
+int pld_is_fw_down(struct device *dev)
+{
+ int ret = 0;
+ enum pld_bus_type type = pld_get_bus_type(dev);
+
+ switch (type) {
+ case PLD_BUS_TYPE_SNOC:
+ ret = pld_snoc_is_fw_down(dev);
+ break;
+ default:
+ pr_err("Invalid device type %d\n", type);
+ ret = -EINVAL;
+ break;
+ }
+
+ return ret;
+}
+
+/**
* pld_force_assert_target() - Send a force assert to FW.
* This can use various sideband requests available at platform to
* initiate a FW assert.
diff --git a/core/pld/src/pld_snoc.h b/core/pld/src/pld_snoc.h
index 01588ece9d..991554ab06 100644
--- a/core/pld/src/pld_snoc.h
+++ b/core/pld/src/pld_snoc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -113,6 +113,11 @@ static inline int pld_snoc_is_qmi_disable(struct device *dev)
{
return 0;
}
+
+static inline int pld_snoc_is_fw_down(struct device *dev)
+{
+ return 0;
+}
static inline int pld_snoc_set_fw_log_mode(struct device *dev, u8 fw_log_mode)
{
return 0;
@@ -251,6 +256,11 @@ unsigned int pld_snoc_socinfo_get_serial_number(struct device *dev)
return icnss_socinfo_get_serial_number(dev);
}
+static inline int pld_snoc_is_fw_down(struct device *dev)
+{
+ return icnss_is_fw_down();
+}
+
#ifdef ICNSS_API_WITH_DEV
static inline int pld_snoc_is_qmi_disable(struct device *dev)
{