From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH 1/4] ath10k: Add support to configure pktlog filter
Date: Thu, 2 Oct 2014 18:36:56 +0530 [thread overview]
Message-ID: <20141002130654.GA12709@qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQk-w9D=0urUTfaF6RrSYEkXAqUT+DAJZKq0bfTVFK18xA@mail.gmail.com>
On Thu, Oct 02, 2014 at 02:58:43PM +0200, Michal Kazior wrote:
> On 2 October 2014 14:53, Rajkumar Manoharan <rmanohar@qti.qualcomm.com> wrote:
> > On Thu, Oct 02, 2014 at 02:37:13PM +0200, Michal Kazior wrote:
> >> On 2 October 2014 14:12, Rajkumar Manoharan <rmanohar@qti.qualcomm.com> wrote:
> >> > Add support to configure packet log filters (tx, rx, rate control)
> >> > via debugfs. To disable htt pktlog events set the filters to 0.
> >> [...]
> >> > +static ssize_t ath10k_write_pktlog_filter(struct file *file,
> >> > + const char __user *ubuf,
> >> > + size_t count, loff_t *ppos)
> >> > +{
> >> > + struct ath10k *ar = file->private_data;
> >> > + u32 filter;
> >> > + int ret;
> >> > +
> >> > + if (kstrtouint_from_user(ubuf, count, 0, &filter))
> >> > + return -EINVAL;
> >> > +
> >> > + mutex_lock(&ar->conf_mutex);
> >> > + if (filter && (filter != ar->debug.pktlog_filter))
> >> > + ret = ath10k_wmi_pdev_pktlog_enable(ar, filter);
> >> > + else
> >> > + ret = ath10k_wmi_pdev_pktlog_disable(ar);
> >>
> >> You're not checking if ar->state is ON.
> >>
> > How about updating pktlog_filter alone and not sending WMI command when
> > state != ON. So that in the next drv_start pktlog will be either be
> > disabled or enabled based on filter value at debug_start.
>
> Sounds good to me.
>
>
> >> Even if I assume the above doesn't crash the driver/system this has
> >> strange semantics. On one hand the driver has to be after drv_start
> >> (e.g. at least one interface must be up) before it's possible to set
> >> it but on the other hand pktlog_filter is retained across
> >> drv_stop/start. I'd expect it to be possible to set the pktlog_filter
> >> regardless of driver state but maybe that's just me.
> >>
> > So pktlog should be disabed at ath10k_debug_stop. isn't it?
>
> Actually my bad. You set ar->debug.pktlog_filter regardless of wmi
> command result which is fine.
>
Thanks for your quick feedback.
-Rajkumar
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
WARNING: multiple messages have this Message-ID (diff)
From: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [PATCH 1/4] ath10k: Add support to configure pktlog filter
Date: Thu, 2 Oct 2014 18:36:56 +0530 [thread overview]
Message-ID: <20141002130654.GA12709@qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQk-w9D=0urUTfaF6RrSYEkXAqUT+DAJZKq0bfTVFK18xA@mail.gmail.com>
On Thu, Oct 02, 2014 at 02:58:43PM +0200, Michal Kazior wrote:
> On 2 October 2014 14:53, Rajkumar Manoharan <rmanohar@qti.qualcomm.com> wrote:
> > On Thu, Oct 02, 2014 at 02:37:13PM +0200, Michal Kazior wrote:
> >> On 2 October 2014 14:12, Rajkumar Manoharan <rmanohar@qti.qualcomm.com> wrote:
> >> > Add support to configure packet log filters (tx, rx, rate control)
> >> > via debugfs. To disable htt pktlog events set the filters to 0.
> >> [...]
> >> > +static ssize_t ath10k_write_pktlog_filter(struct file *file,
> >> > + const char __user *ubuf,
> >> > + size_t count, loff_t *ppos)
> >> > +{
> >> > + struct ath10k *ar = file->private_data;
> >> > + u32 filter;
> >> > + int ret;
> >> > +
> >> > + if (kstrtouint_from_user(ubuf, count, 0, &filter))
> >> > + return -EINVAL;
> >> > +
> >> > + mutex_lock(&ar->conf_mutex);
> >> > + if (filter && (filter != ar->debug.pktlog_filter))
> >> > + ret = ath10k_wmi_pdev_pktlog_enable(ar, filter);
> >> > + else
> >> > + ret = ath10k_wmi_pdev_pktlog_disable(ar);
> >>
> >> You're not checking if ar->state is ON.
> >>
> > How about updating pktlog_filter alone and not sending WMI command when
> > state != ON. So that in the next drv_start pktlog will be either be
> > disabled or enabled based on filter value at debug_start.
>
> Sounds good to me.
>
>
> >> Even if I assume the above doesn't crash the driver/system this has
> >> strange semantics. On one hand the driver has to be after drv_start
> >> (e.g. at least one interface must be up) before it's possible to set
> >> it but on the other hand pktlog_filter is retained across
> >> drv_stop/start. I'd expect it to be possible to set the pktlog_filter
> >> regardless of driver state but maybe that's just me.
> >>
> > So pktlog should be disabed at ath10k_debug_stop. isn't it?
>
> Actually my bad. You set ar->debug.pktlog_filter regardless of wmi
> command result which is fine.
>
Thanks for your quick feedback.
-Rajkumar
next prev parent reply other threads:[~2014-10-02 13:05 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-02 12:12 [PATCH 0/4] ath10k: Add pktlog support Rajkumar Manoharan
2014-10-02 12:12 ` Rajkumar Manoharan
2014-10-02 12:12 ` [PATCH 1/4] ath10k: Add support to configure pktlog filter Rajkumar Manoharan
2014-10-02 12:12 ` Rajkumar Manoharan
2014-10-02 12:37 ` Michal Kazior
2014-10-02 12:37 ` Michal Kazior
2014-10-02 12:53 ` Rajkumar Manoharan
2014-10-02 12:53 ` Rajkumar Manoharan
2014-10-02 12:58 ` Michal Kazior
2014-10-02 12:58 ` Michal Kazior
2014-10-02 13:06 ` Rajkumar Manoharan [this message]
2014-10-02 13:06 ` Rajkumar Manoharan
2014-10-02 12:12 ` [PATCH 2/4] ath10k: add tracing for ath10k_htt_pktlog Rajkumar Manoharan
2014-10-02 12:12 ` Rajkumar Manoharan
2014-10-02 12:12 ` [PATCH 3/4] ath10k: add tracing for rx descriptor Rajkumar Manoharan
2014-10-02 12:12 ` Rajkumar Manoharan
2014-10-02 12:12 ` [PATCH 4/4] ath10k: add tracing for tx msdu pktlog event Rajkumar Manoharan
2014-10-02 12:12 ` Rajkumar Manoharan
-- strict thread matches above, loose matches on Subject: below --
2014-10-02 12:06 [PATCH 0/4] ath10k: Add pktlog support Rajkumar Manoharan
2014-10-02 12:06 ` [PATCH 1/4] ath10k: Add support to configure pktlog filter Rajkumar Manoharan
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=20141002130654.GA12709@qca.qualcomm.com \
--to=rmanohar@qti.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 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.