From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: "ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v8 2/4] ath10k: provide firmware crash info via debugfs
Date: Mon, 25 Aug 2014 09:28:48 +0300 [thread overview]
Message-ID: <878umd84m7.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQk6wvXMEWnfFvASJwzj2AC0VB=Zby+zLO-tJ3NN_eA2mg@mail.gmail.com> (Michal Kazior's message of "Fri, 22 Aug 2014 08:49:35 +0200")
Michal Kazior <michal.kazior@tieto.com> writes:
> On 21 August 2014 14:49, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>
>> +static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
>> +{
>> + struct ath10k_fw_crash_data *crash_data = ar->debug.fw_crash_data;
>> + struct ath10k_dump_file_data *dump_data;
>> + struct ath10k_tlv_dump_data *dump_tlv;
>> + int hdr_len = sizeof(*dump_data);
>> + unsigned int len, sofar = 0;
>> + unsigned char *buf;
>> +
>> + lockdep_assert_held(&ar->conf_mutex);
> [...]
>> +static int ath10k_fw_crash_dump_open(struct inode *inode, struct file *file)
>> +{
>> + struct ath10k *ar = inode->i_private;
>> + struct ath10k_dump_file_data *dump;
>> + int ret;
>> +
>> + mutex_lock(&ar->conf_mutex);
>
> I don't think we need conf_mutex here at all, do we?
You are right, I removed that (diff below).
> I'm sorry, I should've spotted this earlier. Feel free to just ignore
> me :-)
Hehe, no worries. It's difficult to spot all problems in the first
review and I do that all the time :)
> Other than that this looks fine.
Great, thanks for good review!
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index bf08f026b202..442fe93d18be 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -712,8 +712,6 @@ static struct ath10k_dump_file_data *ath10k_build_dump_file(struct ath10k *ar)
unsigned int len, sofar = 0;
unsigned char *buf;
- lockdep_assert_held(&ar->conf_mutex);
-
len = hdr_len;
len += sizeof(*dump_tlv) + sizeof(crash_data->registers);
@@ -785,22 +783,14 @@ static int ath10k_fw_crash_dump_open(struct inode *inode, struct file *file)
{
struct ath10k *ar = inode->i_private;
struct ath10k_dump_file_data *dump;
- int ret;
-
- mutex_lock(&ar->conf_mutex);
dump = ath10k_build_dump_file(ar);
- if (!dump) {
- ret = -ENODATA;
- goto out;
- }
+ if (!dump)
+ return -ENODATA;
file->private_data = dump;
- ret = 0;
-out:
- mutex_unlock(&ar->conf_mutex);
- return ret;
+ return 0;
}
static ssize_t ath10k_fw_crash_dump_read(struct file *file,
--
Kalle Valo
next prev parent reply other threads:[~2014-08-25 6:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-21 12:48 [PATCH v8 0/4] ath10k: firmware crash dump Kalle Valo
2014-08-21 12:49 ` [PATCH v8 1/4] ath10k: add ath10k_pci_diag_* helpers Kalle Valo
2014-08-21 12:49 ` [PATCH v8 2/4] ath10k: provide firmware crash info via debugfs Kalle Valo
2014-08-21 13:10 ` Johannes Berg
2014-08-21 14:40 ` Kalle Valo
2014-08-22 1:19 ` Johannes Berg
2014-08-22 14:34 ` Kalle Valo
2014-08-24 9:42 ` Johannes Berg
2014-08-22 6:49 ` Michal Kazior
2014-08-25 6:28 ` Kalle Valo [this message]
2014-08-21 12:49 ` [PATCH v8 3/4] ath10k: rename ath10k_pci_hif_dump_area() to ath10k_pci_fw_crashed_dump() Kalle Valo
2014-08-21 12:49 ` [PATCH v8 4/4] ath10k: print more driver info when firmware crashes Kalle Valo
2014-08-25 8:25 ` [PATCH v8 0/4] ath10k: firmware crash dump 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=878umd84m7.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;
as well as URLs for NNTP newsgroup(s).