From: wwguy <wey-yi.w.guy@intel.com>
To: Stanislaw Gruszka <sgruszka@redhat.com>
Cc: Intel Linux Wireless <ilw@linux.intel.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] iwlwifi: fix possible data overwrite in hcmd callback
Date: Thu, 21 Apr 2011 07:13:45 -0700 [thread overview]
Message-ID: <1303395225.1507.3.camel@wwguy-ubuntu> (raw)
In-Reply-To: <20110421071749.GA2203@redhat.com>
On Thu, 2011-04-21 at 00:17 -0700, Stanislaw Gruszka wrote:
> > Could you elaborate a bit more, why you do not need to protect getting
> > the cmd index.
>
> get_cmd_index() is simple mathematical function of index local variable
> (provided by firmware) and globally canst q->n_window, not need to be
> protected.
>
> What need to be protected is iwl_hcdm_queue_reclaim() as is touch
> q->read_ptr and meta->flags to make assure is synchronized across
> different cpus, when new huge command come instantly.
>
> Note circular queue management could be done lock-less, but need
> trickery described in Documentation/circular-buffers.txt to synchronize
> q->read_ptr and q->write_ptr properly. What is probably too complex to
> be worth to consider instead of simply using a spin lock.
>
Thanks for the clear, explanation.
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wey
prev parent reply other threads:[~2011-04-21 14:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-20 14:02 [PATCH] iwlwifi: fix possible data overwrite in hcmd callback Stanislaw Gruszka
2011-04-20 14:05 ` Guy, Wey-Yi
2011-04-21 7:17 ` Stanislaw Gruszka
2011-04-21 14:13 ` wwguy [this message]
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=1303395225.1507.3.camel@wwguy-ubuntu \
--to=wey-yi.w.guy@intel.com \
--cc=ilw@linux.intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=sgruszka@redhat.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