From patchwork Thu Jan 29 12:40:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 5742001 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7B13D9F36E for ; Thu, 29 Jan 2015 12:40:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AAE802022D for ; Thu, 29 Jan 2015 12:40:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D9BCC20222 for ; Thu, 29 Jan 2015 12:40:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGoOx-0001O5-07; Thu, 29 Jan 2015 12:40:51 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGoOv-0001Fi-RJ for ath10k@lists.infradead.org; Thu, 29 Jan 2015 12:40:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1422535251; x=1454071251; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=mbDms99461E1yj49nbGE9MT6oYm6q2TQ2ToZ3ZVUL2c=; b=aWxn81FJ2UFpR2xSE0rGAOiOJELiwaGNzhKSGHTb2/KcB+exvQJHNfQ4 jHuugU/I16NNo071B99Z8/eLIBIrHBuCCjZg34GXoj90HNI8wKTdPN+7G Yq9V7IotpzDl/WRNxXftToMWJ+UIpDMDyIYhqSOyteBKIcpYnqCfwZ9Lb c=; X-IronPort-AV: E=McAfee;i="5600,1067,7695"; a="100834570" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by wolverine01.qualcomm.com with ESMTP; 29 Jan 2015 04:40:30 -0800 X-IronPort-AV: E=Sophos;i="5.09,485,1418112000"; d="scan'208";a="31613760" Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 29 Jan 2015 04:40:29 -0800 Received: from potku.adurom.net (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.995.29; Thu, 29 Jan 2015 04:40:27 -0800 From: Kalle Valo To: SenthilKumar Jegadeesan Subject: Re: [PATCH-RESEND] ath10k: add log level configuration for fw_dbglog References: <1422522412-10441-1-git-send-email-sjegadee@qti.qualcomm.com> Date: Thu, 29 Jan 2015 14:40:18 +0200 In-Reply-To: <1422522412-10441-1-git-send-email-sjegadee@qti.qualcomm.com> (SenthilKumar Jegadeesan's message of "Thu, 29 Jan 2015 14:36:52 +0530") Message-ID: <87vbjp2219.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: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To NALASEXR01G.na.qualcomm.com (10.49.56.53) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150129_044049_954908_05E16F80 X-CRM114-Status: GOOD ( 14.12 ) X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 SenthilKumar Jegadeesan writes: > Introduce optional log level configuration for > existing debugfs fw_dbglog. > > It allow users to configure desired log level > for firmware debugs. > > To configure log level as WARN > > echo 0xffffffff 2 > /sys/kernel/debug/ieee80211/phy0/ath10k/fw_dbglog > > Loglevel Value > VERBOSE 0 > INFO 1 > WARN 2 > ERR 3 > > Signed-off-by: SenthilKumar Jegadeesan I did cosmetic changes to the log in the pending branch. > @@ -1331,19 +1331,30 @@ static ssize_t ath10k_write_fw_dbglog(struct file *file, > size_t count, loff_t *ppos) > { > struct ath10k *ar = file->private_data; > - unsigned long mask; > int ret; > + char buf[64]; > + unsigned int log_level, mask; > > - ret = kstrtoul_from_user(user_buf, count, 0, &mask); > - if (ret) > - return ret; > + simple_write_to_buffer(buf, sizeof(buf) - 1, ppos, user_buf, count); > + > + /* make sure that buf is null terminated */ > + buf[sizeof(buf) - 1] = 0; > + > + ret = sscanf(buf, "%x %u", &mask, &log_level); > + > + if (!ret) > + return -EINVAL; > > mutex_lock(&ar->conf_mutex); > > ar->debug.fw_dbglog_mask = mask; > + ar->debug.fw_dbglog_level = (ret == 1) ? ATH10K_DBGLOG_LEVEL_WARN : > + log_level; And I simplified this a bit, please review. Full patch in pending branch. --- a/drivers/net/wireless/ath/ath10k/debug.c +++ b/drivers/net/wireless/ath/ath10k/debug.c @@ -1345,12 +1345,14 @@ static ssize_t ath10k_write_fw_dbglog(struct file *file, if (!ret) return -EINVAL; + if (ret == 1) + /* default if user did not specify */ + log_level = ATH10K_DBGLOG_LEVEL_WARN; + mutex_lock(&ar->conf_mutex); ar->debug.fw_dbglog_mask = mask; - ar->debug.fw_dbglog_level = (ret == 1) ? ATH10K_DBGLOG_LEVEL_WARN : - log_level; - + ar->debug.fw_dbglog_level = log_level; if (ar->state == ATH10K_STATE_ON) { ret = ath10k_wmi_dbglog_cfg(ar, ar->debug.fw_dbglog_mask,