Linux wireless drivers development
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] ath10k: create debugfs interface to trigger fw crash
Date: Fri, 19 Jul 2013 13:29:46 +0300	[thread overview]
Message-ID: <87zjti4zc5.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1373961277-14784-4-git-send-email-michal.kazior@tieto.com> (Michal Kazior's message of "Tue, 16 Jul 2013 09:54:37 +0200")

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

> This can be useful for testing. To perform a
> forced firmware crash write 'crash' to
> 'simulate_fw_crash' debugfs file. E.g.
>
>   echo crash > /sys/kernel/debug/ieee80211/phy1/ath10k/simulate_fw_crash
>
> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>

[...]

> +static ssize_t ath10k_write_simulate_fw_crash(struct file *file,
> +					      const char __user *user_buf,
> +					      size_t count, loff_t *ppos)
> +{
> +	struct ath10k *ar = file->private_data;
> +	char buf[32] = {};
> +	int ret;
> +
> +	mutex_lock(&ar->conf_mutex);
> +
> +	simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count);
> +	if (strcmp(buf, "crash") && strcmp(buf, "crash\n")) {
> +		ath10k_warn("write keyword `crash` to simulate firmware crash\n");
> +		goto exit;
> +	}

Better to just return an error here.

> +	if (ar->state != ATH10K_STATE_ON &&
> +	    ar->state != ATH10K_STATE_RESTARTED) {
> +		ath10k_warn("firmware isn't loaded yet, nothing to crash\n");
> +		goto exit;
> +	}

Ditto.

-- 
Kalle Valo

  reply	other threads:[~2013-07-19 10:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1372148011-28234-1-git-send-email-michal.kazior@tieto.com>
2013-07-16  7:54 ` [PATCH v3 0/3] ath10k: hardware recovery Michal Kazior
2013-07-16  7:54   ` [PATCH v3 1/3] ath10k: implement device recovery Michal Kazior
2013-07-16  7:54   ` [PATCH v3 2/3] ath10k: implement fw crash simulation command Michal Kazior
2013-07-16  7:54   ` [PATCH v3 3/3] ath10k: create debugfs interface to trigger fw crash Michal Kazior
2013-07-19 10:29     ` Kalle Valo [this message]
2013-07-20  6:01       ` Kalle Valo
2013-07-22 12:08         ` [PATCH v4] " Michal Kazior
2013-07-23  8:02           ` Kalle Valo
2013-07-19 10:32   ` [PATCH v3 0/3] ath10k: hardware recovery Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjti4zc5.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=michal.kazior@tieto.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox