All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
@ 2014-02-10 17:13 ` Marek Puzyniak
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Puzyniak @ 2014-02-10 17:13 UTC (permalink / raw)
  To: ath10k; +Cc: Marek Puzyniak, linux-wireless

Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
in firmware 10.1. In order to have firmware crash simulation
functionality also in firmware 10.1 driver can force firmware
crash by performing not allowed operation. Driver can deliberately
crash firmware when setting vdev param for vdev id out of range.

Command to trigger firmware crash:
echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 6debd28..84b79c5 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -482,11 +482,23 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file,
 	ath10k_info("simulating firmware crash\n");
 
 	ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0);
-	if (ret)
+	if (ret == 0) {
+		ret = count;
+		goto exit;
+	}
+
+	if (ret != -EOPNOTSUPP) {
 		ath10k_warn("failed to force fw hang (%d)\n", ret);
+		goto exit;
+	}
 
-	if (ret == 0)
-		ret = count;
+	/*
+	 * Firmware does not support WMI_FORCE_FW_HANG_ASSERT.
+	 * Force firmware crash by setting any vdev parameter for
+	 * not allowed vdev id.
+	 */
+	ath10k_wmi_vdev_set_param(ar, TARGET_NUM_VDEVS + 1,
+				  ar->wmi.vdev_param->rts_threshold, 0);
 
 exit:
 	mutex_unlock(&ar->conf_mutex);
-- 
1.8.1.2


_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
@ 2014-02-10 17:13 ` Marek Puzyniak
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Puzyniak @ 2014-02-10 17:13 UTC (permalink / raw)
  To: ath10k; +Cc: linux-wireless, Marek Puzyniak

Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
in firmware 10.1. In order to have firmware crash simulation
functionality also in firmware 10.1 driver can force firmware
crash by performing not allowed operation. Driver can deliberately
crash firmware when setting vdev param for vdev id out of range.

Command to trigger firmware crash:
echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
---
 drivers/net/wireless/ath/ath10k/debug.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index 6debd28..84b79c5 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -482,11 +482,23 @@ static ssize_t ath10k_write_simulate_fw_crash(struct file *file,
 	ath10k_info("simulating firmware crash\n");
 
 	ret = ath10k_wmi_force_fw_hang(ar, WMI_FORCE_FW_HANG_ASSERT, 0);
-	if (ret)
+	if (ret == 0) {
+		ret = count;
+		goto exit;
+	}
+
+	if (ret != -EOPNOTSUPP) {
 		ath10k_warn("failed to force fw hang (%d)\n", ret);
+		goto exit;
+	}
 
-	if (ret == 0)
-		ret = count;
+	/*
+	 * Firmware does not support WMI_FORCE_FW_HANG_ASSERT.
+	 * Force firmware crash by setting any vdev parameter for
+	 * not allowed vdev id.
+	 */
+	ath10k_wmi_vdev_set_param(ar, TARGET_NUM_VDEVS + 1,
+				  ar->wmi.vdev_param->rts_threshold, 0);
 
 exit:
 	mutex_unlock(&ar->conf_mutex);
-- 
1.8.1.2


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

* Re: [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
  2014-02-10 17:13 ` Marek Puzyniak
@ 2014-02-11  6:17   ` Michal Kazior
  -1 siblings, 0 replies; 8+ messages in thread
From: Michal Kazior @ 2014-02-11  6:17 UTC (permalink / raw)
  To: Marek Puzyniak; +Cc: linux-wireless, ath10k@lists.infradead.org

On 10 February 2014 18:13, Marek Puzyniak <marek.puzyniak@tieto.com> wrote:
> Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
> in firmware 10.1. In order to have firmware crash simulation
> functionality also in firmware 10.1 driver can force firmware
> crash by performing not allowed operation. Driver can deliberately
> crash firmware when setting vdev param for vdev id out of range.
>
> Command to trigger firmware crash:
> echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash
>
> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
> ---

The 'fw hang assert' crash can be recovered with a warm reset but a
real crash can't. Thus, I think the two crash methods should be
distinguishable by having either two separate debugfs files or two
separate trigger keywords.


Michał

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
@ 2014-02-11  6:17   ` Michal Kazior
  0 siblings, 0 replies; 8+ messages in thread
From: Michal Kazior @ 2014-02-11  6:17 UTC (permalink / raw)
  To: Marek Puzyniak; +Cc: ath10k@lists.infradead.org, linux-wireless

On 10 February 2014 18:13, Marek Puzyniak <marek.puzyniak@tieto.com> wrote:
> Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
> in firmware 10.1. In order to have firmware crash simulation
> functionality also in firmware 10.1 driver can force firmware
> crash by performing not allowed operation. Driver can deliberately
> crash firmware when setting vdev param for vdev id out of range.
>
> Command to trigger firmware crash:
> echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash
>
> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
> ---

The 'fw hang assert' crash can be recovered with a warm reset but a
real crash can't. Thus, I think the two crash methods should be
distinguishable by having either two separate debugfs files or two
separate trigger keywords.


Michał

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

* Re: [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
  2014-02-11  6:17   ` Michal Kazior
@ 2014-02-13 14:52     ` Kalle Valo
  -1 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2014-02-13 14:52 UTC (permalink / raw)
  To: Michal Kazior; +Cc: Marek Puzyniak, linux-wireless, ath10k@lists.infradead.org

Michal Kazior <michal.kazior@tieto.com> writes:

> On 10 February 2014 18:13, Marek Puzyniak <marek.puzyniak@tieto.com> wrote:
>> Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
>> in firmware 10.1. In order to have firmware crash simulation
>> functionality also in firmware 10.1 driver can force firmware
>> crash by performing not allowed operation. Driver can deliberately
>> crash firmware when setting vdev param for vdev id out of range.
>>
>> Command to trigger firmware crash:
>> echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash
>>
>> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
>> ---
>
> The 'fw hang assert' crash can be recovered with a warm reset but a
> real crash can't.

Oh, I didn't know that.

> Thus, I think the two crash methods should be distinguishable 

Yeah, I agree.

> by having either two separate debugfs files or two separate trigger
> keywords.

I think having a keyword would be a better to way differentiate these.
And if the firmware doesn't support WMI_FORCE_FW_HANG_ASSERT, then just
return -EOPNOTSUPP.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
@ 2014-02-13 14:52     ` Kalle Valo
  0 siblings, 0 replies; 8+ messages in thread
From: Kalle Valo @ 2014-02-13 14:52 UTC (permalink / raw)
  To: Michal Kazior; +Cc: Marek Puzyniak, linux-wireless, ath10k@lists.infradead.org

Michal Kazior <michal.kazior@tieto.com> writes:

> On 10 February 2014 18:13, Marek Puzyniak <marek.puzyniak@tieto.com> wrote:
>> Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
>> in firmware 10.1. In order to have firmware crash simulation
>> functionality also in firmware 10.1 driver can force firmware
>> crash by performing not allowed operation. Driver can deliberately
>> crash firmware when setting vdev param for vdev id out of range.
>>
>> Command to trigger firmware crash:
>> echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash
>>
>> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
>> ---
>
> The 'fw hang assert' crash can be recovered with a warm reset but a
> real crash can't.

Oh, I didn't know that.

> Thus, I think the two crash methods should be distinguishable 

Yeah, I agree.

> by having either two separate debugfs files or two separate trigger
> keywords.

I think having a keyword would be a better to way differentiate these.
And if the firmware doesn't support WMI_FORCE_FW_HANG_ASSERT, then just
return -EOPNOTSUPP.

-- 
Kalle Valo

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

* Re: [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
  2014-02-13 14:52     ` Kalle Valo
@ 2014-02-13 15:08       ` Marek Puzyniak
  -1 siblings, 0 replies; 8+ messages in thread
From: Marek Puzyniak @ 2014-02-13 15:08 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless, Michal Kazior, ath10k@lists.infradead.org

On 13 February 2014 15:52, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> On 10 February 2014 18:13, Marek Puzyniak <marek.puzyniak@tieto.com> wrote:
>>> Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
>>> in firmware 10.1. In order to have firmware crash simulation
>>> functionality also in firmware 10.1 driver can force firmware
>>> crash by performing not allowed operation. Driver can deliberately
>>> crash firmware when setting vdev param for vdev id out of range.
>>>
>>> Command to trigger firmware crash:
>>> echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash
>>>
>>> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
>>> ---
>>
>> The 'fw hang assert' crash can be recovered with a warm reset but a
>> real crash can't.
>
> Oh, I didn't know that.
>
>> Thus, I think the two crash methods should be distinguishable
>
> Yeah, I agree.
>
>> by having either two separate debugfs files or two separate trigger
>> keywords.
>
> I think having a keyword would be a better to way differentiate these.
> And if the firmware doesn't support WMI_FORCE_FW_HANG_ASSERT, then just
> return -EOPNOTSUPP.

I will send new version with different keyword for different kind of
firmware crash.

Marek

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

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

* Re: [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware
@ 2014-02-13 15:08       ` Marek Puzyniak
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Puzyniak @ 2014-02-13 15:08 UTC (permalink / raw)
  To: Kalle Valo; +Cc: Michal Kazior, linux-wireless, ath10k@lists.infradead.org

On 13 February 2014 15:52, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Michal Kazior <michal.kazior@tieto.com> writes:
>
>> On 10 February 2014 18:13, Marek Puzyniak <marek.puzyniak@tieto.com> wrote:
>>> Wmi command WMI_FORCE_FW_HANG_CMDID is not supported
>>> in firmware 10.1. In order to have firmware crash simulation
>>> functionality also in firmware 10.1 driver can force firmware
>>> crash by performing not allowed operation. Driver can deliberately
>>> crash firmware when setting vdev param for vdev id out of range.
>>>
>>> Command to trigger firmware crash:
>>> echo "crash" > /sys/kernel/debug/ieee80211/phyX/ath10k/simulate_fw_crash
>>>
>>> Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
>>> ---
>>
>> The 'fw hang assert' crash can be recovered with a warm reset but a
>> real crash can't.
>
> Oh, I didn't know that.
>
>> Thus, I think the two crash methods should be distinguishable
>
> Yeah, I agree.
>
>> by having either two separate debugfs files or two separate trigger
>> keywords.
>
> I think having a keyword would be a better to way differentiate these.
> And if the firmware doesn't support WMI_FORCE_FW_HANG_ASSERT, then just
> return -EOPNOTSUPP.

I will send new version with different keyword for different kind of
firmware crash.

Marek

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

end of thread, other threads:[~2014-02-13 15:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-10 17:13 [PATCH] ath10k: change simulate_fw_crash to work with 10.1 firmware Marek Puzyniak
2014-02-10 17:13 ` Marek Puzyniak
2014-02-11  6:17 ` Michal Kazior
2014-02-11  6:17   ` Michal Kazior
2014-02-13 14:52   ` Kalle Valo
2014-02-13 14:52     ` Kalle Valo
2014-02-13 15:08     ` Marek Puzyniak
2014-02-13 15:08       ` Marek Puzyniak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.