From patchwork Mon Aug 25 06:28:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 4772741 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6920BC0338 for ; Mon, 25 Aug 2014 06:28:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9CF1B2010B for ; Mon, 25 Aug 2014 06:28:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8449920107 for ; Mon, 25 Aug 2014 06:28:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752865AbaHYG2y (ORCPT ); Mon, 25 Aug 2014 02:28:54 -0400 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:38098 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752640AbaHYG2y (ORCPT ); Mon, 25 Aug 2014 02:28:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1408948134; x=1440484134; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=5xAMjwxrak+Jpd7ZW2VgL2me48143yn9QWNTsCMy8e8=; b=OKt7hmCKahYhYRe6b1nRrySFtoRxkXT9chT5xgATAUivMAs2YzhNSUhY LwjDIRrYs3hgLAMCAUoad8+yysi2U2Omna80Dpj6TQtCXJ/KjeP1VInxN DE9HHlFKrNkll5OmXYhO4dO019GiJiGk6zpg4HAyFVlJb8+YBaNJqSI6C I=; X-IronPort-AV: E=McAfee;i="5600,1067,7540"; a="73444321" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by sabertooth02.qualcomm.com with ESMTP; 24 Aug 2014 23:28:53 -0700 X-IronPort-AV: E=Sophos;i="5.04,395,1406617200"; d="scan'208";a="30426940" Received: from nasanexhc07.na.qualcomm.com ([172.30.39.190]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 24 Aug 2014 23:28:53 -0700 Received: from potku.adurom.net.qca.qualcomm.com (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.190) with Microsoft SMTP Server (TLS) id 14.3.181.6; Sun, 24 Aug 2014 23:28:52 -0700 From: Kalle Valo To: Michal Kazior CC: "ath10k@lists.infradead.org" , linux-wireless Subject: Re: [PATCH v8 2/4] ath10k: provide firmware crash info via debugfs References: <20140821124705.27159.67898.stgit@potku.adurom.net> <20140821124907.27159.64620.stgit@potku.adurom.net> Date: Mon, 25 Aug 2014 09:28:48 +0300 In-Reply-To: (Michal Kazior's message of "Fri, 22 Aug 2014 08:49:35 +0200") Message-ID: <878umd84m7.fsf@kamboji.qca.qualcomm.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Michal Kazior writes: > On 21 August 2014 14:49, Kalle Valo 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,