All of lore.kernel.org
 help / color / mirror / Atom feed
From: SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH-RESEND] ath10k: add log level configuration for fw_dbglog
Date: Thu, 29 Jan 2015 18:49:49 +0530	[thread overview]
Message-ID: <20150129131947.GA12684@senthilj-ThinkPad-L430> (raw)
In-Reply-To: <87vbjp2219.fsf@kamboji.qca.qualcomm.com>

On Thu, Jan 29, 2015 at 02:40:18PM +0200, Kalle Valo wrote:
> SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com> 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 <sjegadee@qti.qualcomm.com>
> 
> 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.
>

I have looked at the changes in pending branch, it looks good.

Thanks,
SenthilJ 

WARNING: multiple messages have this Message-ID (diff)
From: SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com>
To: Kalle Valo <kvalo@qca.qualcomm.com>
Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org
Subject: Re: [PATCH-RESEND] ath10k: add log level configuration for fw_dbglog
Date: Thu, 29 Jan 2015 18:49:49 +0530	[thread overview]
Message-ID: <20150129131947.GA12684@senthilj-ThinkPad-L430> (raw)
In-Reply-To: <87vbjp2219.fsf@kamboji.qca.qualcomm.com>

On Thu, Jan 29, 2015 at 02:40:18PM +0200, Kalle Valo wrote:
> SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com> 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 <sjegadee@qti.qualcomm.com>
> 
> 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.
>

I have looked at the changes in pending branch, it looks good.

Thanks,
SenthilJ 

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

  reply	other threads:[~2015-01-29 13:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29  9:06 [PATCH-RESEND] ath10k: add log level configuration for fw_dbglog SenthilKumar Jegadeesan
2015-01-29  9:06 ` SenthilKumar Jegadeesan
2015-01-29 12:40 ` Kalle Valo
2015-01-29 12:40   ` Kalle Valo
2015-01-29 13:19   ` SenthilKumar Jegadeesan [this message]
2015-01-29 13:19     ` SenthilKumar Jegadeesan
2015-02-04  7:21 ` Kalle Valo
2015-02-04  7:21   ` 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=20150129131947.GA12684@senthilj-ThinkPad-L430 \
    --to=sjegadee@qti.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=kvalo@qca.qualcomm.com \
    --cc=linux-wireless@vger.kernel.org \
    /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 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.