linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] mwifiex: device dump enhancements
@ 2015-05-26 13:34 Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 1/6] mwifiex: fix SDIO firmware dump problem Amitkumar Karwar
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

This patch series fixes couple of bugs in device dump
code paths, makes use of devcoredump mechanism after removing
'ethtool dump' approach.

Amitkumar Karwar (6):
  mwifiex: fix SDIO firmware dump problem
  mwifiex: fix a possible double free issue
  mwifiex: dump driver information for PCIe interface
  mwifiex: minor changes in debug messages
  mwifiex: use generic name 'device dump'
  mwifiex: device dump support via devcoredump framework

 drivers/net/wireless/mwifiex/Kconfig   |   2 +
 drivers/net/wireless/mwifiex/README    |   6 +-
 drivers/net/wireless/mwifiex/cmdevt.c  |   4 +-
 drivers/net/wireless/mwifiex/debugfs.c |  20 +++----
 drivers/net/wireless/mwifiex/ethtool.c |  99 -------------------------------
 drivers/net/wireless/mwifiex/init.c    |   1 +
 drivers/net/wireless/mwifiex/main.c    | 103 +++++++++++++++++++++++++++++++--
 drivers/net/wireless/mwifiex/main.h    |   9 +--
 drivers/net/wireless/mwifiex/pcie.c    |  39 +++++++------
 drivers/net/wireless/mwifiex/sdio.c    |  38 +++++++-----
 10 files changed, 163 insertions(+), 158 deletions(-)

-- 
1.8.1.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/6] mwifiex: fix SDIO firmware dump problem
  2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
@ 2015-05-26 13:34 ` Amitkumar Karwar
  2015-06-02 20:18   ` [1/6] " Kalle Valo
  2015-05-26 13:34 ` [PATCH 2/6] mwifiex: fix a possible double free issue Amitkumar Karwar
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

It's been observed that firmware doesn't go back to normal
state when all firmware memories are dumped. As a result,
further commands are blocked. This happens due to missing
driver change of writing READ DONE to control register for
SDIO interface.

This patch adds a missing change to fix the problem.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/mwifiex/sdio.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index f4b1de7..a3d810b8 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -2241,6 +2241,13 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
 
 		if (memory_size == 0) {
 			mwifiex_dbg(adapter, DUMP, "Firmware dump Finished!\n");
+			ret = mwifiex_write_reg(adapter,
+						card->reg->fw_dump_ctrl,
+						FW_DUMP_READ_DONE);
+			if (ret) {
+				mwifiex_dbg(adapter, ERROR, "SDIO write err\n");
+				return;
+			}
 			break;
 		}
 
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/6] mwifiex: fix a possible double free issue
  2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 1/6] mwifiex: fix SDIO firmware dump problem Amitkumar Karwar
@ 2015-05-26 13:34 ` Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 3/6] mwifiex: dump driver information for PCIe interface Amitkumar Karwar
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

As drv_info_dump pointer doesn't get reset, we may end up
freeing the allocated memory twice.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/mwifiex/init.c | 1 +
 drivers/net/wireless/mwifiex/main.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/init.c b/drivers/net/wireless/mwifiex/init.c
index fdf38d0..df7fdc0 100644
--- a/drivers/net/wireless/mwifiex/init.c
+++ b/drivers/net/wireless/mwifiex/init.c
@@ -435,6 +435,7 @@ mwifiex_adapter_cleanup(struct mwifiex_adapter *adapter)
 
 	if (adapter->drv_info_dump) {
 		vfree(adapter->drv_info_dump);
+		adapter->drv_info_dump = NULL;
 		adapter->drv_info_size = 0;
 	}
 
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 138c1cc..cb009789 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -886,6 +886,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
 
 	if (adapter->drv_info_dump) {
 		vfree(adapter->drv_info_dump);
+		adapter->drv_info_dump = NULL;
 		adapter->drv_info_size = 0;
 	}
 
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/6] mwifiex: dump driver information for PCIe interface
  2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 1/6] mwifiex: fix SDIO firmware dump problem Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 2/6] mwifiex: fix a possible double free issue Amitkumar Karwar
@ 2015-05-26 13:34 ` Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 4/6] mwifiex: minor changes in debug messages Amitkumar Karwar
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

Currently we are dumping driver information only for SDIO
interface. This patch adds missing mwifiex_dump_drv_info()
call for PCIe interface.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/mwifiex/pcie.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 7219243..86ed396 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -2316,6 +2316,8 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
 	int ret;
 	static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
 
+	mwifiex_dump_drv_info(adapter);
+
 	if (!card->pcie.can_dump_fw)
 		return;
 
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/6] mwifiex: minor changes in debug messages
  2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
                   ` (2 preceding siblings ...)
  2015-05-26 13:34 ` [PATCH 3/6] mwifiex: dump driver information for PCIe interface Amitkumar Karwar
@ 2015-05-26 13:34 ` Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 5/6] mwifiex: use generic name 'device dump' Amitkumar Karwar
  2015-05-26 13:34 ` [PATCH 6/6] mwifiex: device dump support via devcoredump framework Amitkumar Karwar
  5 siblings, 0 replies; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

Small letters are used in debug messages to match coding style
at other places.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/mwifiex/main.c | 8 ++++----
 drivers/net/wireless/mwifiex/sdio.c | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index cb009789..3e7774f 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -890,7 +890,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
 		adapter->drv_info_size = 0;
 	}
 
-	mwifiex_dbg(adapter, MSG, "=== DRIVER INFO DUMP START===\n");
+	mwifiex_dbg(adapter, MSG, "===mwifiex driverinfo dump start===\n");
 
 	adapter->drv_info_dump = vzalloc(MWIFIEX_DRV_INFO_SIZE_MAX);
 
@@ -958,12 +958,12 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
 	}
 
 	if (adapter->iface_type == MWIFIEX_SDIO) {
-		p += sprintf(p, "\n=== SDIO register DUMP===\n");
+		p += sprintf(p, "\n=== SDIO register dump===\n");
 		if (adapter->if_ops.reg_dump)
 			p += adapter->if_ops.reg_dump(adapter, p);
 	}
 
-	p += sprintf(p, "\n=== MORE DEBUG INFORMATION\n");
+	p += sprintf(p, "\n=== more debug information\n");
 	debug_info = kzalloc(sizeof(*debug_info), GFP_KERNEL);
 	if (debug_info) {
 		for (i = 0; i < adapter->priv_num; i++) {
@@ -978,7 +978,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
 	}
 
 	adapter->drv_info_size = p - adapter->drv_info_dump;
-	mwifiex_dbg(adapter, MSG, "=== DRIVER INFO DUMP END===\n");
+	mwifiex_dbg(adapter, MSG, "===mwifiex driverinfo dump end===\n");
 }
 EXPORT_SYMBOL_GPL(mwifiex_dump_drv_info);
 
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index a3d810b8..467ee9a 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -2356,7 +2356,7 @@ mwifiex_sdio_reg_dump(struct mwifiex_adapter *adapter, char *drv_buf)
 	if (!p)
 		return 0;
 
-	mwifiex_dbg(adapter, MSG, "SDIO register DUMP START\n");
+	mwifiex_dbg(adapter, MSG, "SDIO register dump start\n");
 
 	mwifiex_pm_wakeup_card(adapter);
 
@@ -2428,7 +2428,7 @@ mwifiex_sdio_reg_dump(struct mwifiex_adapter *adapter, char *drv_buf)
 
 	sdio_release_host(cardp->func);
 
-	mwifiex_dbg(adapter, MSG, "SDIO register DUMP END\n");
+	mwifiex_dbg(adapter, MSG, "SDIO register dump end\n");
 
 	return p - drv_buf;
 }
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/6] mwifiex: use generic name 'device dump'
  2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
                   ` (3 preceding siblings ...)
  2015-05-26 13:34 ` [PATCH 4/6] mwifiex: minor changes in debug messages Amitkumar Karwar
@ 2015-05-26 13:34 ` Amitkumar Karwar
  2015-05-26 14:30   ` Johannes Berg
  2015-05-26 13:34 ` [PATCH 6/6] mwifiex: device dump support via devcoredump framework Amitkumar Karwar
  5 siblings, 1 reply; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

Currently we are dumping driver information also inside
firmware dump API. We will call it as device dump and
dump driver and firmware data separately.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/mwifiex/README    |  6 +++---
 drivers/net/wireless/mwifiex/cmdevt.c  |  4 ++--
 drivers/net/wireless/mwifiex/debugfs.c | 20 ++++++++++----------
 drivers/net/wireless/mwifiex/ethtool.c | 12 ++++++------
 drivers/net/wireless/mwifiex/main.c    |  4 ++--
 drivers/net/wireless/mwifiex/main.h    |  6 +++---
 drivers/net/wireless/mwifiex/pcie.c    | 22 +++++++++++++---------
 drivers/net/wireless/mwifiex/sdio.c    | 22 +++++++++++++---------
 8 files changed, 52 insertions(+), 44 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/README b/drivers/net/wireless/mwifiex/README
index 31928ca..2f0f9b5 100644
--- a/drivers/net/wireless/mwifiex/README
+++ b/drivers/net/wireless/mwifiex/README
@@ -230,9 +230,9 @@ getlog
 
 	cat getlog
 
-fw_dump
-	This command is used to dump firmware memory into files.
-	Separate file will be created for each memory segment.
+device_dump
+	This command is used to dump driver information and firmware memory
+	segments.
 	Usage:
 
 	cat fw_dump
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index ac89a1d..a1de83f 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -993,8 +993,8 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
 	if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
 		mwifiex_init_fw_complete(adapter);
 
-	if (adapter->if_ops.fw_dump)
-		adapter->if_ops.fw_dump(adapter);
+	if (adapter->if_ops.device_dump)
+		adapter->if_ops.device_dump(adapter);
 
 	if (adapter->if_ops.card_reset)
 		adapter->if_ops.card_reset(adapter);
diff --git a/drivers/net/wireless/mwifiex/debugfs.c b/drivers/net/wireless/mwifiex/debugfs.c
index 8895906..5a0636d4 100644
--- a/drivers/net/wireless/mwifiex/debugfs.c
+++ b/drivers/net/wireless/mwifiex/debugfs.c
@@ -152,24 +152,24 @@ free_and_exit:
 }
 
 /*
- * Proc firmware dump read handler.
+ * Proc device dump read handler.
  *
- * This function is called when the 'fw_dump' file is opened for
+ * This function is called when the 'device_dump' file is opened for
  * reading.
- * This function dumps firmware memory in different files
- * (ex. DTCM, ITCM, SQRAM etc.) based on the the segments for
+ * This function dumps driver information and firmware memory segments
+ * (ex. DTCM, ITCM, SQRAM etc.) for
  * debugging.
  */
 static ssize_t
-mwifiex_fw_dump_read(struct file *file, char __user *ubuf,
-		     size_t count, loff_t *ppos)
+mwifiex_device_dump_read(struct file *file, char __user *ubuf,
+			 size_t count, loff_t *ppos)
 {
 	struct mwifiex_private *priv = file->private_data;
 
-	if (!priv->adapter->if_ops.fw_dump)
+	if (!priv->adapter->if_ops.device_dump)
 		return -EIO;
 
-	priv->adapter->if_ops.fw_dump(priv->adapter);
+	priv->adapter->if_ops.device_dump(priv->adapter);
 
 	return 0;
 }
@@ -885,7 +885,7 @@ static const struct file_operations mwifiex_dfs_##name##_fops = {       \
 MWIFIEX_DFS_FILE_READ_OPS(info);
 MWIFIEX_DFS_FILE_READ_OPS(debug);
 MWIFIEX_DFS_FILE_READ_OPS(getlog);
-MWIFIEX_DFS_FILE_READ_OPS(fw_dump);
+MWIFIEX_DFS_FILE_READ_OPS(device_dump);
 MWIFIEX_DFS_FILE_OPS(regrdwr);
 MWIFIEX_DFS_FILE_OPS(rdeeprom);
 MWIFIEX_DFS_FILE_OPS(memrw);
@@ -913,7 +913,7 @@ mwifiex_dev_debugfs_init(struct mwifiex_private *priv)
 	MWIFIEX_DFS_ADD_FILE(getlog);
 	MWIFIEX_DFS_ADD_FILE(regrdwr);
 	MWIFIEX_DFS_ADD_FILE(rdeeprom);
-	MWIFIEX_DFS_ADD_FILE(fw_dump);
+	MWIFIEX_DFS_ADD_FILE(device_dump);
 	MWIFIEX_DFS_ADD_FILE(memrw);
 	MWIFIEX_DFS_ADD_FILE(hscfg);
 	MWIFIEX_DFS_ADD_FILE(histogram);
diff --git a/drivers/net/wireless/mwifiex/ethtool.c b/drivers/net/wireless/mwifiex/ethtool.c
index a6b3b41..c78bf0a 100644
--- a/drivers/net/wireless/mwifiex/ethtool.c
+++ b/drivers/net/wireless/mwifiex/ethtool.c
@@ -71,7 +71,7 @@ mwifiex_get_dump_flag(struct net_device *dev, struct ethtool_dump *dump)
 	struct mwifiex_adapter *adapter = priv->adapter;
 	struct memory_type_mapping *entry;
 
-	if (!adapter->if_ops.fw_dump)
+	if (!adapter->if_ops.device_dump)
 		return -ENOTSUPP;
 
 	dump->flag = adapter->curr_mem_idx;
@@ -97,7 +97,7 @@ mwifiex_get_dump_data(struct net_device *dev, struct ethtool_dump *dump,
 	struct mwifiex_adapter *adapter = priv->adapter;
 	struct memory_type_mapping *entry;
 
-	if (!adapter->if_ops.fw_dump)
+	if (!adapter->if_ops.device_dump)
 		return -ENOTSUPP;
 
 	if (adapter->curr_mem_idx == MWIFIEX_DRV_INFO_IDX) {
@@ -109,7 +109,7 @@ mwifiex_get_dump_data(struct net_device *dev, struct ethtool_dump *dump,
 
 	if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) {
 		mwifiex_dbg(adapter, ERROR,
-			    "firmware dump in progress!!\n");
+			    "device dump in progress!!\n");
 		return -EBUSY;
 	}
 
@@ -132,7 +132,7 @@ static int mwifiex_set_dump(struct net_device *dev, struct ethtool_dump *val)
 	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
 	struct mwifiex_adapter *adapter = priv->adapter;
 
-	if (!adapter->if_ops.fw_dump)
+	if (!adapter->if_ops.device_dump)
 		return -ENOTSUPP;
 
 	if (val->flag == MWIFIEX_DRV_INFO_IDX) {
@@ -142,13 +142,13 @@ static int mwifiex_set_dump(struct net_device *dev, struct ethtool_dump *val)
 
 	if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) {
 		mwifiex_dbg(adapter, ERROR,
-			    "firmware dump in progress!!\n");
+			    "device dump in progress!!\n");
 		return -EBUSY;
 	}
 
 	if (val->flag == MWIFIEX_FW_DUMP_IDX) {
 		adapter->curr_mem_idx = val->flag;
-		adapter->if_ops.fw_dump(adapter);
+		adapter->if_ops.device_dump(adapter);
 		return 0;
 	}
 
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index 3e7774f..b7fbc2c 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -873,7 +873,7 @@ mwifiex_tx_timeout(struct net_device *dev)
 	}
 }
 
-void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
+void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter)
 {
 	void *p;
 	char drv_version[64];
@@ -980,7 +980,7 @@ void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter)
 	adapter->drv_info_size = p - adapter->drv_info_dump;
 	mwifiex_dbg(adapter, MSG, "===mwifiex driverinfo dump end===\n");
 }
-EXPORT_SYMBOL_GPL(mwifiex_dump_drv_info);
+EXPORT_SYMBOL_GPL(mwifiex_drv_info_dump);
 
 /*
  * CFG802.11 network device handler for statistics retrieval.
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 2f55161..01111fe 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -499,7 +499,7 @@ enum rdwr_status {
 };
 
 enum mwifiex_iface_work_flags {
-	MWIFIEX_IFACE_WORK_FW_DUMP,
+	MWIFIEX_IFACE_WORK_DEVICE_DUMP,
 	MWIFIEX_IFACE_WORK_CARD_RESET,
 };
 
@@ -789,8 +789,8 @@ struct mwifiex_if_ops {
 	int (*init_fw_port) (struct mwifiex_adapter *);
 	int (*dnld_fw) (struct mwifiex_adapter *, struct mwifiex_fw_image *);
 	void (*card_reset) (struct mwifiex_adapter *);
-	void (*fw_dump)(struct mwifiex_adapter *);
 	int (*reg_dump)(struct mwifiex_adapter *, char *);
+	void (*device_dump)(struct mwifiex_adapter *);
 	int (*clean_pcie_ring) (struct mwifiex_adapter *adapter);
 	void (*iface_work)(struct work_struct *work);
 	void (*submit_rem_rx_urbs)(struct mwifiex_adapter *adapter);
@@ -1484,7 +1484,7 @@ void mwifiex_hist_data_add(struct mwifiex_private *priv,
 u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
 			    u8 rx_rate, u8 ht_info);
 
-void mwifiex_dump_drv_info(struct mwifiex_adapter *adapter);
+void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter);
 void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags);
 void mwifiex_queue_main_work(struct mwifiex_adapter *adapter);
 
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 86ed396..3a99368 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -2305,7 +2305,7 @@ mwifiex_pcie_rdwr_firmware(struct mwifiex_adapter *adapter, u8 doneflag)
 }
 
 /* This function dump firmware memory to file */
-static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
+static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 {
 	struct pcie_service_card *card = adapter->card;
 	const struct mwifiex_pcie_card_reg *creg = card->pcie.reg;
@@ -2316,8 +2316,6 @@ static void mwifiex_pcie_fw_dump_work(struct mwifiex_adapter *adapter)
 	int ret;
 	static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
 
-	mwifiex_dump_drv_info(adapter);
-
 	if (!card->pcie.can_dump_fw)
 		return;
 
@@ -2419,24 +2417,30 @@ done:
 	adapter->curr_mem_idx = 0;
 }
 
+static void mwifiex_pcie_device_dump_work(struct mwifiex_adapter *adapter)
+{
+	mwifiex_drv_info_dump(adapter);
+	mwifiex_pcie_fw_dump(adapter);
+}
+
 static unsigned long iface_work_flags;
 static struct mwifiex_adapter *save_adapter;
 static void mwifiex_pcie_work(struct work_struct *work)
 {
-	if (test_and_clear_bit(MWIFIEX_IFACE_WORK_FW_DUMP,
+	if (test_and_clear_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP,
 			       &iface_work_flags))
-		mwifiex_pcie_fw_dump_work(save_adapter);
+		mwifiex_pcie_device_dump_work(save_adapter);
 }
 
 static DECLARE_WORK(pcie_work, mwifiex_pcie_work);
 /* This function dumps FW information */
-static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
+static void mwifiex_pcie_device_dump(struct mwifiex_adapter *adapter)
 {
 	save_adapter = adapter;
-	if (test_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &iface_work_flags))
+	if (test_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &iface_work_flags))
 		return;
 
-	set_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &iface_work_flags);
+	set_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &iface_work_flags);
 
 	schedule_work(&pcie_work);
 }
@@ -2673,7 +2677,7 @@ static struct mwifiex_if_ops pcie_ops = {
 	.cleanup_mpa_buf =		NULL,
 	.init_fw_port =			mwifiex_pcie_init_fw_port,
 	.clean_pcie_ring =		mwifiex_clean_pcie_ring_buf,
-	.fw_dump =			mwifiex_pcie_fw_dump,
+	.device_dump =			mwifiex_pcie_device_dump,
 };
 
 /*
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 467ee9a..1f32c02 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -2177,7 +2177,7 @@ rdwr_status mwifiex_sdio_rdwr_firmware(struct mwifiex_adapter *adapter,
 }
 
 /* This function dump firmware memory to file */
-static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
+static void mwifiex_sdio_fw_dump(struct mwifiex_adapter *adapter)
 {
 	struct sdio_mmc_card *card = adapter->card;
 	int ret = 0;
@@ -2187,8 +2187,6 @@ static void mwifiex_sdio_fw_dump_work(struct mwifiex_adapter *adapter)
 	u32 memory_size;
 	static char *env[] = { "DRIVER=mwifiex_sdio", "EVENT=fw_dump", NULL };
 
-	mwifiex_dump_drv_info(adapter);
-
 	if (!card->can_dump_fw)
 		return;
 
@@ -2306,11 +2304,17 @@ done:
 	adapter->curr_mem_idx = 0;
 }
 
+static void mwifiex_sdio_device_dump_work(struct mwifiex_adapter *adapter)
+{
+	mwifiex_drv_info_dump(adapter);
+	mwifiex_sdio_fw_dump(adapter);
+}
+
 static void mwifiex_sdio_work(struct work_struct *work)
 {
-	if (test_and_clear_bit(MWIFIEX_IFACE_WORK_FW_DUMP,
+	if (test_and_clear_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP,
 			       &iface_work_flags))
-		mwifiex_sdio_fw_dump_work(save_adapter);
+		mwifiex_sdio_device_dump_work(save_adapter);
 	if (test_and_clear_bit(MWIFIEX_IFACE_WORK_CARD_RESET,
 			       &iface_work_flags))
 		mwifiex_sdio_card_reset_work(save_adapter);
@@ -2330,13 +2334,13 @@ static void mwifiex_sdio_card_reset(struct mwifiex_adapter *adapter)
 }
 
 /* This function dumps FW information */
-static void mwifiex_sdio_fw_dump(struct mwifiex_adapter *adapter)
+static void mwifiex_sdio_device_dump(struct mwifiex_adapter *adapter)
 {
 	save_adapter = adapter;
-	if (test_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &iface_work_flags))
+	if (test_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &iface_work_flags))
 		return;
 
-	set_bit(MWIFIEX_IFACE_WORK_FW_DUMP, &iface_work_flags);
+	set_bit(MWIFIEX_IFACE_WORK_DEVICE_DUMP, &iface_work_flags);
 	schedule_work(&sdio_work);
 }
 
@@ -2453,8 +2457,8 @@ static struct mwifiex_if_ops sdio_ops = {
 	.cmdrsp_complete = mwifiex_sdio_cmdrsp_complete,
 	.event_complete = mwifiex_sdio_event_complete,
 	.card_reset = mwifiex_sdio_card_reset,
-	.fw_dump = mwifiex_sdio_fw_dump,
 	.reg_dump = mwifiex_sdio_reg_dump,
+	.device_dump = mwifiex_sdio_device_dump,
 	.deaggr_pkt = mwifiex_deaggr_sdio_pkt,
 };
 
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 6/6] mwifiex: device dump support via devcoredump framework
  2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
                   ` (4 preceding siblings ...)
  2015-05-26 13:34 ` [PATCH 5/6] mwifiex: use generic name 'device dump' Amitkumar Karwar
@ 2015-05-26 13:34 ` Amitkumar Karwar
  5 siblings, 0 replies; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-26 13:34 UTC (permalink / raw)
  To: linux-wireless; +Cc: Cathy Luo, Avinash Patil, Amitkumar Karwar

Currently device dump generated in the driver is retrieved
using ethtool set/get dump commands. We will get rid of
ethtool approach and use devcoredump framework.

Device dump can be trigger by
cat /debugfs/mwifiex/mlanX/device_dump
and when the dump operation is completed, data can be read by
cat /sys/class/devcoredump/devcdX/data

We have prepared following script to split device dump data
into multiple files.

 [root]# cat mwifiex_split_dump_data.sh
 #!/bin/bash
 # usage: ./mwifiex_split_dump_data.sh dump_data

 fw_dump_data=$1

 mem_type="driverinfo ITCM DTCM SQRAM APU CIU ICU MAC"

 for name in ${mem_type[@]}
 do
     sed -n "/Start dump $name/,/End dump/p" $fw_dump_data  > tmp.$name.log
     if [ ! -s tmp.$name.log ]
     then
         rm -rf tmp.$name.log
     else
         #Remove the describle info "Start dump" and "End dump"
         sed '1d' tmp.$name.log | sed '$d' > /data/$name.log
         if [ -s /data/$name.log ]
         then
             echo "generate /data/$name.log"
         else
             sed '1d' tmp.$name.log | sed '$d' > /var/$name.log
             echo "generate /var/$name.log"
         fi
         rm -rf tmp.$name.log
     fi
 done

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
---
 drivers/net/wireless/mwifiex/Kconfig   |  2 +
 drivers/net/wireless/mwifiex/ethtool.c | 99 ----------------------------------
 drivers/net/wireless/mwifiex/main.c    | 90 +++++++++++++++++++++++++++++++
 drivers/net/wireless/mwifiex/main.h    |  3 +-
 drivers/net/wireless/mwifiex/pcie.c    | 21 +++-----
 drivers/net/wireless/mwifiex/sdio.c    |  5 +-
 6 files changed, 103 insertions(+), 117 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/Kconfig b/drivers/net/wireless/mwifiex/Kconfig
index aa01c9b..48edf38 100644
--- a/drivers/net/wireless/mwifiex/Kconfig
+++ b/drivers/net/wireless/mwifiex/Kconfig
@@ -12,6 +12,7 @@ config MWIFIEX_SDIO
 	tristate "Marvell WiFi-Ex Driver for SD8786/SD8787/SD8797/SD8887/SD8897"
 	depends on MWIFIEX && MMC
 	select FW_LOADER
+	select WANT_DEV_COREDUMP
 	---help---
 	  This adds support for wireless adapters based on Marvell
 	  8786/8787/8797/8887/8897 chipsets with SDIO interface.
@@ -23,6 +24,7 @@ config MWIFIEX_PCIE
 	tristate "Marvell WiFi-Ex Driver for PCIE 8766/8897"
 	depends on MWIFIEX && PCI
 	select FW_LOADER
+	select WANT_DEV_COREDUMP
 	---help---
 	  This adds support for wireless adapters based on Marvell
 	  8766/8897 chipsets with PCIe interface.
diff --git a/drivers/net/wireless/mwifiex/ethtool.c b/drivers/net/wireless/mwifiex/ethtool.c
index c78bf0a..58400c6 100644
--- a/drivers/net/wireless/mwifiex/ethtool.c
+++ b/drivers/net/wireless/mwifiex/ethtool.c
@@ -64,106 +64,7 @@ static int mwifiex_ethtool_set_wol(struct net_device *dev,
 	return 0;
 }
 
-static int
-mwifiex_get_dump_flag(struct net_device *dev, struct ethtool_dump *dump)
-{
-	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
-	struct mwifiex_adapter *adapter = priv->adapter;
-	struct memory_type_mapping *entry;
-
-	if (!adapter->if_ops.device_dump)
-		return -ENOTSUPP;
-
-	dump->flag = adapter->curr_mem_idx;
-	dump->version = 1;
-	if (adapter->curr_mem_idx == MWIFIEX_DRV_INFO_IDX) {
-		dump->len = adapter->drv_info_size;
-	} else if (adapter->curr_mem_idx != MWIFIEX_FW_DUMP_IDX) {
-		entry = &adapter->mem_type_mapping_tbl[adapter->curr_mem_idx];
-		dump->len = entry->mem_size;
-	} else {
-		dump->len = 0;
-	}
-
-	return 0;
-}
-
-static int
-mwifiex_get_dump_data(struct net_device *dev, struct ethtool_dump *dump,
-		      void *buffer)
-{
-	u8 *p = buffer;
-	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
-	struct mwifiex_adapter *adapter = priv->adapter;
-	struct memory_type_mapping *entry;
-
-	if (!adapter->if_ops.device_dump)
-		return -ENOTSUPP;
-
-	if (adapter->curr_mem_idx == MWIFIEX_DRV_INFO_IDX) {
-		if (!adapter->drv_info_dump)
-			return -EFAULT;
-		memcpy(p, adapter->drv_info_dump, adapter->drv_info_size);
-		return 0;
-	}
-
-	if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) {
-		mwifiex_dbg(adapter, ERROR,
-			    "device dump in progress!!\n");
-		return -EBUSY;
-	}
-
-	entry = &adapter->mem_type_mapping_tbl[adapter->curr_mem_idx];
-
-	if (!entry->mem_ptr)
-		return -EFAULT;
-
-	memcpy(p, entry->mem_ptr, entry->mem_size);
-
-	entry->mem_size = 0;
-	vfree(entry->mem_ptr);
-	entry->mem_ptr = NULL;
-
-	return 0;
-}
-
-static int mwifiex_set_dump(struct net_device *dev, struct ethtool_dump *val)
-{
-	struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
-	struct mwifiex_adapter *adapter = priv->adapter;
-
-	if (!adapter->if_ops.device_dump)
-		return -ENOTSUPP;
-
-	if (val->flag == MWIFIEX_DRV_INFO_IDX) {
-		adapter->curr_mem_idx = MWIFIEX_DRV_INFO_IDX;
-		return 0;
-	}
-
-	if (adapter->curr_mem_idx == MWIFIEX_FW_DUMP_IDX) {
-		mwifiex_dbg(adapter, ERROR,
-			    "device dump in progress!!\n");
-		return -EBUSY;
-	}
-
-	if (val->flag == MWIFIEX_FW_DUMP_IDX) {
-		adapter->curr_mem_idx = val->flag;
-		adapter->if_ops.device_dump(adapter);
-		return 0;
-	}
-
-	if (val->flag < 0 || val->flag >= adapter->num_mem_types)
-		return -EINVAL;
-
-	adapter->curr_mem_idx = val->flag;
-
-	return 0;
-}
-
 const struct ethtool_ops mwifiex_ethtool_ops = {
 	.get_wol = mwifiex_ethtool_get_wol,
 	.set_wol = mwifiex_ethtool_set_wol,
-	.get_dump_flag = mwifiex_get_dump_flag,
-	.get_dump_data = mwifiex_get_dump_data,
-	.set_dump = mwifiex_set_dump,
 };
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c
index b7fbc2c..3ba4e0e 100644
--- a/drivers/net/wireless/mwifiex/main.c
+++ b/drivers/net/wireless/mwifiex/main.c
@@ -982,6 +982,96 @@ void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter)
 }
 EXPORT_SYMBOL_GPL(mwifiex_drv_info_dump);
 
+void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter)
+{
+	u8 idx, *dump_data, *fw_dump_ptr;
+	u32 dump_len;
+
+	dump_len = (strlen("========Start dump driverinfo========\n") +
+		       adapter->drv_info_size +
+		       strlen("\n========End dump========\n"));
+
+	for (idx = 0; idx < adapter->num_mem_types; idx++) {
+		struct memory_type_mapping *entry =
+				&adapter->mem_type_mapping_tbl[idx];
+
+		if (entry->mem_ptr) {
+			dump_len += (strlen("========Start dump ") +
+					strlen(entry->mem_name) +
+					strlen("========\n") +
+					(entry->mem_size + 1) +
+					strlen("\n========End dump========\n"));
+		}
+	}
+
+	dump_data = vzalloc(dump_len + 1);
+	if (!dump_data)
+		goto done;
+
+	fw_dump_ptr = dump_data;
+
+	/* Dump all the memory data into single file, a userspace script will
+	 * be used to split all the memory data to multiple files
+	 */
+	mwifiex_dbg(adapter, MSG,
+		    "== mwifiex dump information to /sys/class/devcoredump start");
+
+	strcpy(fw_dump_ptr, "========Start dump driverinfo========\n");
+	fw_dump_ptr += strlen("========Start dump driverinfo========\n");
+	memcpy(fw_dump_ptr, adapter->drv_info_dump, adapter->drv_info_size);
+	fw_dump_ptr += adapter->drv_info_size;
+	strcpy(fw_dump_ptr, "\n========End dump========\n");
+	fw_dump_ptr += strlen("\n========End dump========\n");
+
+	for (idx = 0; idx < adapter->num_mem_types; idx++) {
+		struct memory_type_mapping *entry =
+					&adapter->mem_type_mapping_tbl[idx];
+
+		if (entry->mem_ptr) {
+			strcpy(fw_dump_ptr, "========Start dump ");
+			fw_dump_ptr += strlen("========Start dump ");
+
+			strcpy(fw_dump_ptr, entry->mem_name);
+			fw_dump_ptr += strlen(entry->mem_name);
+
+			strcpy(fw_dump_ptr, "========\n");
+			fw_dump_ptr += strlen("========\n");
+
+			memcpy(fw_dump_ptr, entry->mem_ptr, entry->mem_size);
+			fw_dump_ptr += entry->mem_size;
+
+			strcpy(fw_dump_ptr, "\n========End dump========\n");
+			fw_dump_ptr += strlen("\n========End dump========\n");
+		}
+	}
+
+	/* device dump data will be free in device coredump release function
+	 * after 5 min
+	 */
+	dev_coredumpv(adapter->dev, dump_data, dump_len, GFP_KERNEL);
+	mwifiex_dbg(adapter, MSG,
+		    "== mwifiex dump information to /sys/class/devcoredump end");
+
+done:
+	for (idx = 0; idx < adapter->num_mem_types; idx++) {
+		struct memory_type_mapping *entry =
+			&adapter->mem_type_mapping_tbl[idx];
+
+		if (entry->mem_ptr) {
+			vfree(entry->mem_ptr);
+			entry->mem_ptr = NULL;
+		}
+		entry->mem_size = 0;
+	}
+
+	if (adapter->drv_info_dump) {
+		vfree(adapter->drv_info_dump);
+		adapter->drv_info_dump = NULL;
+		adapter->drv_info_size = 0;
+	}
+}
+EXPORT_SYMBOL_GPL(mwifiex_upload_device_dump);
+
 /*
  * CFG802.11 network device handler for statistics retrieval.
  */
diff --git a/drivers/net/wireless/mwifiex/main.h b/drivers/net/wireless/mwifiex/main.h
index 01111fe..5a6c1c7 100644
--- a/drivers/net/wireless/mwifiex/main.h
+++ b/drivers/net/wireless/mwifiex/main.h
@@ -36,6 +36,7 @@
 #include <linux/of.h>
 #include <linux/idr.h>
 #include <linux/inetdevice.h>
+#include <linux/devcoredump.h>
 
 #include "decl.h"
 #include "ioctl.h"
@@ -950,7 +951,6 @@ struct mwifiex_adapter {
 	u8 key_api_major_ver, key_api_minor_ver;
 	struct memory_type_mapping *mem_type_mapping_tbl;
 	u8 num_mem_types;
-	u8 curr_mem_idx;
 	void *drv_info_dump;
 	u32 drv_info_size;
 	bool scan_chan_gap_enabled;
@@ -1485,6 +1485,7 @@ u8 mwifiex_adjust_data_rate(struct mwifiex_private *priv,
 			    u8 rx_rate, u8 ht_info);
 
 void mwifiex_drv_info_dump(struct mwifiex_adapter *adapter);
+void mwifiex_upload_device_dump(struct mwifiex_adapter *adapter);
 void *mwifiex_alloc_dma_align_buf(int rx_len, gfp_t flags);
 void mwifiex_queue_main_work(struct mwifiex_adapter *adapter);
 
diff --git a/drivers/net/wireless/mwifiex/pcie.c b/drivers/net/wireless/mwifiex/pcie.c
index 3a99368..77b9055 100644
--- a/drivers/net/wireless/mwifiex/pcie.c
+++ b/drivers/net/wireless/mwifiex/pcie.c
@@ -2314,7 +2314,6 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 	enum rdwr_status stat;
 	u32 memory_size;
 	int ret;
-	static char *env[] = { "DRIVER=mwifiex_pcie", "EVENT=fw_dump", NULL };
 
 	if (!card->pcie.can_dump_fw)
 		return;
@@ -2334,7 +2333,7 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 	/* Read the number of the memories which will dump */
 	stat = mwifiex_pcie_rdwr_firmware(adapter, doneflag);
 	if (stat == RDWR_STATUS_FAILURE)
-		goto done;
+		return;
 
 	reg = creg->fw_dump_start;
 	mwifiex_read_reg_byte(adapter, reg, &dump_num);
@@ -2345,7 +2344,7 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 
 		stat = mwifiex_pcie_rdwr_firmware(adapter, doneflag);
 		if (stat == RDWR_STATUS_FAILURE)
-			goto done;
+			return;
 
 		memory_size = 0;
 		reg = creg->fw_dump_start;
@@ -2361,7 +2360,7 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 						FW_DUMP_READ_DONE);
 			if (ret) {
 				mwifiex_dbg(adapter, ERROR, "PCIE write err\n");
-				goto done;
+				return;
 			}
 			break;
 		}
@@ -2373,7 +2372,7 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 		if (!entry->mem_ptr) {
 			mwifiex_dbg(adapter, ERROR,
 				    "Vmalloc %s failed\n", entry->mem_name);
-			goto done;
+			return;
 		}
 		dbg_ptr = entry->mem_ptr;
 		end_ptr = dbg_ptr + memory_size;
@@ -2385,7 +2384,7 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 		do {
 			stat = mwifiex_pcie_rdwr_firmware(adapter, doneflag);
 			if (RDWR_STATUS_FAILURE == stat)
-				goto done;
+				return;
 
 			reg_start = creg->fw_dump_start;
 			reg_end = creg->fw_dump_end;
@@ -2396,7 +2395,7 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 				} else {
 					mwifiex_dbg(adapter, ERROR,
 						    "Allocated buf not enough\n");
-					goto done;
+					return;
 				}
 			}
 
@@ -2409,18 +2408,14 @@ static void mwifiex_pcie_fw_dump(struct mwifiex_adapter *adapter)
 			break;
 		} while (true);
 	}
-	mwifiex_dbg(adapter, MSG, "== mwifiex firmware dump end ==\n");
-
-	kobject_uevent_env(&adapter->wiphy->dev.kobj, KOBJ_CHANGE, env);
-
-done:
-	adapter->curr_mem_idx = 0;
+	mwifiex_dbg(adapter, DUMP, "== mwifiex firmware dump end ==\n");
 }
 
 static void mwifiex_pcie_device_dump_work(struct mwifiex_adapter *adapter)
 {
 	mwifiex_drv_info_dump(adapter);
 	mwifiex_pcie_fw_dump(adapter);
+	mwifiex_upload_device_dump(adapter);
 }
 
 static unsigned long iface_work_flags;
diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
index 1f32c02..a0b121f 100644
--- a/drivers/net/wireless/mwifiex/sdio.c
+++ b/drivers/net/wireless/mwifiex/sdio.c
@@ -2185,7 +2185,6 @@ static void mwifiex_sdio_fw_dump(struct mwifiex_adapter *adapter)
 	u8 *dbg_ptr, *end_ptr, dump_num, idx, i, read_reg, doneflag = 0;
 	enum rdwr_status stat;
 	u32 memory_size;
-	static char *env[] = { "DRIVER=mwifiex_sdio", "EVENT=fw_dump", NULL };
 
 	if (!card->can_dump_fw)
 		return;
@@ -2297,17 +2296,15 @@ static void mwifiex_sdio_fw_dump(struct mwifiex_adapter *adapter)
 	}
 	mwifiex_dbg(adapter, MSG, "== mwifiex firmware dump end ==\n");
 
-	kobject_uevent_env(&adapter->wiphy->dev.kobj, KOBJ_CHANGE, env);
-
 done:
 	sdio_release_host(card->func);
-	adapter->curr_mem_idx = 0;
 }
 
 static void mwifiex_sdio_device_dump_work(struct mwifiex_adapter *adapter)
 {
 	mwifiex_drv_info_dump(adapter);
 	mwifiex_sdio_fw_dump(adapter);
+	mwifiex_upload_device_dump(adapter);
 }
 
 static void mwifiex_sdio_work(struct work_struct *work)
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/6] mwifiex: use generic name 'device dump'
  2015-05-26 13:34 ` [PATCH 5/6] mwifiex: use generic name 'device dump' Amitkumar Karwar
@ 2015-05-26 14:30   ` Johannes Berg
  2015-05-27  7:04     ` Amitkumar Karwar
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2015-05-26 14:30 UTC (permalink / raw)
  To: Amitkumar Karwar; +Cc: linux-wireless, Cathy Luo, Avinash Patil

On Tue, 2015-05-26 at 06:34 -0700, Amitkumar Karwar wrote:
> Currently we are dumping driver information also inside
> firmware dump API. We will call it as device dump and
> dump driver and firmware data separately.

Honestly, I don't think this matters. I called it 'devcoredump' or
'device' because there were people saying it might be used to dump
hardware state, rather than firmware state (my original thought was to
call the framework 'fwcoredump')

In your driver, it's really only dumping firmware state (as far as I can
tell), so I don't think the name matters.

If you prefer "device dump" that's surely fine, but changing all the
debugfs file names etc. just because I called the framework
"devcoredump" isn't really needed I think :)

Note that the framework is really also built to support "spontaneous"
data collection, e.g. when the driver noticed the firmware doing
something strange. You seem to support "user-triggered" only, which is
perfectly reasonable again if you want it, but not necessary.

johannes



^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: [PATCH 5/6] mwifiex: use generic name 'device dump'
  2015-05-26 14:30   ` Johannes Berg
@ 2015-05-27  7:04     ` Amitkumar Karwar
  2015-05-27  7:24       ` Johannes Berg
  0 siblings, 1 reply; 11+ messages in thread
From: Amitkumar Karwar @ 2015-05-27  7:04 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless, Cathy Luo, Avinash Patil

SGkgSm9oYW5uZXMsDQoNCj4gRnJvbTogSm9oYW5uZXMgQmVyZyBbbWFpbHRvOmpvaGFubmVzQHNp
cHNvbHV0aW9ucy5uZXRdDQo+IFNlbnQ6IFR1ZXNkYXksIE1heSAyNiwgMjAxNSA4OjAxIFBNDQo+
IFRvOiBBbWl0a3VtYXIgS2Fyd2FyDQo+IENjOiBsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5v
cmc7IENhdGh5IEx1bzsgQXZpbmFzaCBQYXRpbA0KPiBTdWJqZWN0OiBSZTogW1BBVENIIDUvNl0g
bXdpZmlleDogdXNlIGdlbmVyaWMgbmFtZSAnZGV2aWNlIGR1bXAnDQo+IA0KPiBPbiBUdWUsIDIw
MTUtMDUtMjYgYXQgMDY6MzQgLTA3MDAsIEFtaXRrdW1hciBLYXJ3YXIgd3JvdGU6DQo+ID4gQ3Vy
cmVudGx5IHdlIGFyZSBkdW1waW5nIGRyaXZlciBpbmZvcm1hdGlvbiBhbHNvIGluc2lkZSBmaXJt
d2FyZSBkdW1wDQo+ID4gQVBJLiBXZSB3aWxsIGNhbGwgaXQgYXMgZGV2aWNlIGR1bXAgYW5kIGR1
bXAgZHJpdmVyIGFuZCBmaXJtd2FyZSBkYXRhDQo+ID4gc2VwYXJhdGVseS4NCj4gDQo+IEhvbmVz
dGx5LCBJIGRvbid0IHRoaW5rIHRoaXMgbWF0dGVycy4gSSBjYWxsZWQgaXQgJ2RldmNvcmVkdW1w
JyBvcg0KPiAnZGV2aWNlJyBiZWNhdXNlIHRoZXJlIHdlcmUgcGVvcGxlIHNheWluZyBpdCBtaWdo
dCBiZSB1c2VkIHRvIGR1bXANCj4gaGFyZHdhcmUgc3RhdGUsIHJhdGhlciB0aGFuIGZpcm13YXJl
IHN0YXRlIChteSBvcmlnaW5hbCB0aG91Z2h0IHdhcyB0bw0KPiBjYWxsIHRoZSBmcmFtZXdvcmsg
J2Z3Y29yZWR1bXAnKQ0KPiANCj4gSW4geW91ciBkcml2ZXIsIGl0J3MgcmVhbGx5IG9ubHkgZHVt
cGluZyBmaXJtd2FyZSBzdGF0ZSAoYXMgZmFyIGFzIEkgY2FuDQo+IHRlbGwpLCBzbyBJIGRvbid0
IHRoaW5rIHRoZSBuYW1lIG1hdHRlcnMuDQo+IA0KDQpUaGFua3MgZm9yIHlvdXIgcmV2aWV3LiBX
ZSBhcmUgZHVtcGluZyBkcml2ZXIgZGF0YSBhcyB3ZWxsIGFsb25nIHdpdGggZmlybXdhcmUgc3Rh
dGUuIEhlbmNlIHdlIHRob3VnaHQgb2YgcmVuYW1pbmcgJ2Z3X2R1bXAnIHdpdGggJ2RldmljZV9k
dW1wJy4NCg0Kc3RhdGljIHZvaWQgbXdpZmlleF9zZGlvX2RldmljZV9kdW1wX3dvcmsoc3RydWN0
IG13aWZpZXhfYWRhcHRlciAqYWRhcHRlcikNCnsNCiAgICAgICAgbXdpZmlleF9kcnZfaW5mb19k
dW1wKGFkYXB0ZXIpOw0KICAgICAgICBtd2lmaWV4X3NkaW9fZndfZHVtcChhZGFwdGVyKTsNCiAg
ICAgICAgbXdpZmlleF91cGxvYWRfZGV2aWNlX2R1bXAoYWRhcHRlcik7DQp9DQoNCg0Kc3RhdGlj
IHZvaWQgbXdpZmlleF9wY2llX2RldmljZV9kdW1wX3dvcmsoc3RydWN0IG13aWZpZXhfYWRhcHRl
ciAqYWRhcHRlcikNCnsNCiAgICAgICAgbXdpZmlleF9kcnZfaW5mb19kdW1wKGFkYXB0ZXIpOw0K
ICAgICAgICBtd2lmaWV4X3BjaWVfZndfZHVtcChhZGFwdGVyKTsNCiAgICAgICAgbXdpZmlleF91
cGxvYWRfZGV2aWNlX2R1bXAoYWRhcHRlcik7DQp9DQoNCj4gSWYgeW91IHByZWZlciAiZGV2aWNl
IGR1bXAiIHRoYXQncyBzdXJlbHkgZmluZSwgYnV0IGNoYW5naW5nIGFsbCB0aGUNCj4gZGVidWdm
cyBmaWxlIG5hbWVzIGV0Yy4ganVzdCBiZWNhdXNlIEkgY2FsbGVkIHRoZSBmcmFtZXdvcmsNCj4g
ImRldmNvcmVkdW1wIiBpc24ndCByZWFsbHkgbmVlZGVkIEkgdGhpbmsgOikNCg0KRGVidWdmcyBm
aWxlIG5hbWUgaXMgY2hhbmdlZCBiZWNhdXNlICdkZXZpY2VfZHVtcCcgd2lsbCBub3cgdGFrZSBj
YXJlIG9mIGR1bXBpbmcgYm90aCBkcml2ZXIgZGF0YSBhbmQgZmlybXdhcmUgc3RhdGUuDQoNCj4g
DQo+IE5vdGUgdGhhdCB0aGUgZnJhbWV3b3JrIGlzIHJlYWxseSBhbHNvIGJ1aWx0IHRvIHN1cHBv
cnQgInNwb250YW5lb3VzIg0KPiBkYXRhIGNvbGxlY3Rpb24sIGUuZy4gd2hlbiB0aGUgZHJpdmVy
IG5vdGljZWQgdGhlIGZpcm13YXJlIGRvaW5nDQo+IHNvbWV0aGluZyBzdHJhbmdlLiBZb3Ugc2Vl
bSB0byBzdXBwb3J0ICJ1c2VyLXRyaWdnZXJlZCIgb25seSwgd2hpY2ggaXMNCj4gcGVyZmVjdGx5
IHJlYXNvbmFibGUgYWdhaW4gaWYgeW91IHdhbnQgaXQsIGJ1dCBub3QgbmVjZXNzYXJ5Lg0KDQpD
dXJyZW50bHkgd2UgYXJlIHRyaWdnZXJpbmcgdGhlIGR1bXAgb3BlcmF0aW9uIGluIG91ciBjb21t
YW5kIHRpbWVvdXQgaGFuZGxlciBhcyB3ZWxsLiBUaGlzIHdvdWxkIGhlbHAgdXMgZGVidWcgcG9z
c2libGUgZmlybXdhcmUgYnVnIGNhdXNpbmcgdGltZW91dC4NCg0KUmVnYXJkcywNCkFtaXRrdW1h
cg0KDQo=

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 5/6] mwifiex: use generic name 'device dump'
  2015-05-27  7:04     ` Amitkumar Karwar
@ 2015-05-27  7:24       ` Johannes Berg
  0 siblings, 0 replies; 11+ messages in thread
From: Johannes Berg @ 2015-05-27  7:24 UTC (permalink / raw)
  To: Amitkumar Karwar; +Cc: linux-wireless, Cathy Luo, Avinash Patil

On Wed, 2015-05-27 at 07:04 +0000, Amitkumar Karwar wrote:

> Thanks for your review. We are dumping driver data as well along with
> firmware state. Hence we thought of renaming 'fw_dump' with
> 'device_dump'.
[...]
> Debugfs file name is changed because 'device_dump' will now take care
> of dumping both driver data and firmware state.

Ok, great. Just wanted to make sure you weren't pointlessly renaming it
because of the framework name :)

> Currently we are triggering the dump operation in our command timeout
> handler as well. This would help us debug possible firmware bug
> causing timeout.

Cool, yeah, it's helping us a lot for sure.

johannes


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [1/6] mwifiex: fix SDIO firmware dump problem
  2015-05-26 13:34 ` [PATCH 1/6] mwifiex: fix SDIO firmware dump problem Amitkumar Karwar
@ 2015-06-02 20:18   ` Kalle Valo
  0 siblings, 0 replies; 11+ messages in thread
From: Kalle Valo @ 2015-06-02 20:18 UTC (permalink / raw)
  To: Amitkumar Karwar
  Cc: linux-wireless, Cathy Luo, Avinash Patil, Amitkumar Karwar


> It's been observed that firmware doesn't go back to normal
> state when all firmware memories are dumped. As a result,
> further commands are blocked. This happens due to missing
> driver change of writing READ DONE to control register for
> SDIO interface.
> 
> This patch adds a missing change to fix the problem.
> 
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> Signed-off-by: Cathy Luo <cluo@marvell.com>

Thanks, 6 patches applied to wireless-drivers-next.git:

e065ddb89175 mwifiex: fix SDIO firmware dump problem
0769b27739ee mwifiex: fix a possible double free issue
38b130e22e40 mwifiex: dump driver information for PCIe interface
9cc0dbf04367 mwifiex: minor changes in debug messages
fc697159ad4c mwifiex: use generic name 'device dump'
57670ee882d4 mwifiex: device dump support via devcoredump framework

Kalle Valo

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-02 20:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-26 13:34 [PATCH 0/6] mwifiex: device dump enhancements Amitkumar Karwar
2015-05-26 13:34 ` [PATCH 1/6] mwifiex: fix SDIO firmware dump problem Amitkumar Karwar
2015-06-02 20:18   ` [1/6] " Kalle Valo
2015-05-26 13:34 ` [PATCH 2/6] mwifiex: fix a possible double free issue Amitkumar Karwar
2015-05-26 13:34 ` [PATCH 3/6] mwifiex: dump driver information for PCIe interface Amitkumar Karwar
2015-05-26 13:34 ` [PATCH 4/6] mwifiex: minor changes in debug messages Amitkumar Karwar
2015-05-26 13:34 ` [PATCH 5/6] mwifiex: use generic name 'device dump' Amitkumar Karwar
2015-05-26 14:30   ` Johannes Berg
2015-05-27  7:04     ` Amitkumar Karwar
2015-05-27  7:24       ` Johannes Berg
2015-05-26 13:34 ` [PATCH 6/6] mwifiex: device dump support via devcoredump framework Amitkumar Karwar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).