From: Stanislaw Gruszka <sgruszka@redhat.com>
To: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>
Cc: "Guy, Wey-Yi W" <wey-yi.w.guy@intel.com>,
"linville@tuxdriver.com" <linville@tuxdriver.com>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH 17/34] iwlagn: fix a race in the unmapping of the TFDs
Date: Tue, 11 Oct 2011 14:36:30 +0200 [thread overview]
Message-ID: <20111011123630.GB2218@redhat.com> (raw)
In-Reply-To: <4825B8A2C4E264489E57869F0DCFB2234457A944D0@hasmsx502.ger.corp.intel.com>
On Tue, Oct 11, 2011 at 02:26:30PM +0200, Grumbach, Emmanuel wrote:
> >
> > On Mon, Oct 10, 2011 at 07:27:02AM -0700, Wey-Yi Guy wrote:
> > > While inspecting the code, I saw that iwl_tx_queue_unmap modifies
> > > the read pointer of the Tx queue without taking any locks. This means
> > > that it can race with the reclaim flow. This can possibly lead to
> > > a DMA warning complaining that we unmap the same buffer twice.
> > >
> > > This is more a W/A than a fix since it is really weird to take
> > > sta_lock inside iwl_tx_queue_unmap, but it can help until we revamp
> > > the locking model in the transport layer.
> > >
> > > Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > > Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> > > ---
> > > drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 3 +++
> > > 1 files changed, 3 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
> > b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
> > > index 60067c7..f69aecb 100644
> > > --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
> > > +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
> > > @@ -406,6 +406,7 @@ static void iwl_tx_queue_unmap(struct iwl_trans
> > *trans, int txq_id)
> > > struct iwl_tx_queue *txq = &trans_pcie->txq[txq_id];
> > > struct iwl_queue *q = &txq->q;
> > > enum dma_data_direction dma_dir;
> > > + unsigned long flags;
> > >
> > > if (!q->n_bd)
> > > return;
> > > @@ -418,12 +419,14 @@ static void iwl_tx_queue_unmap(struct iwl_trans
> > *trans, int txq_id)
> > > else
> > > dma_dir = DMA_TO_DEVICE;
> > >
> > > + spin_lock_irqsave(&trans->shrd->sta_lock, flags);
> > sta_lock does not look like right lock to use.
> >
> True. And I wrote in the commit message that this is a W/A until we revamp the locking model.
Why not simply take hcmd_lock?
next prev parent reply other threads:[~2011-10-11 12:38 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-10 14:26 [PATCH 00/34] update for 3.2 Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 01/34] iwlagn: add cmd queue pointer info when timeout Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 02/34] iwlagn: add REPLY_ECHO host command Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 03/34] iwlagn: add WARN if tx cmd complete come back late Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 04/34] iwlagn: add "echo" test when command queue stuck Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 05/34] iwlagn: check rf kill in " Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 06/34] iwlagn: add "echo test" command to debugfs Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 07/34] iwlagn: update beacon smarter Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 08/34] iwlagn: don't assign seqno to QoS Null frames Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 09/34] iwlagn: send simple LQ command for WoWLAN Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 10/34] iwlagn: kill hw_params.max_stations Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 11/34] iwlagn: eliminate bus pointer from iwl_priv structure Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 12/34] iwlagn: stop interrupts when suspending Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 13/34] iwlagn: remove un-necessary step Wey-Yi Guy
2011-10-10 14:26 ` [PATCH 14/34] iwlagn: set rts retry limit Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 15/34] iwlagn: add "_d" sku to 6005 series of devices Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 16/34] iwlagn: Add "_d" sku to 105 " Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 17/34] iwlagn: fix a race in the unmapping of the TFDs Wey-Yi Guy
2011-10-11 12:22 ` Stanislaw Gruszka
2011-10-11 12:26 ` Grumbach, Emmanuel
2011-10-11 12:36 ` Stanislaw Gruszka [this message]
2011-10-11 12:38 ` Grumbach, Emmanuel
2011-10-11 12:58 ` Stanislaw Gruszka
2011-10-11 14:43 ` Grumbach, Emmanuel
2011-10-10 14:27 ` [PATCH 18/34] iwlagn: warn only once if AGG state is wrong Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 19/34] iwlagn: separate init calib and rt calib Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 20/34] iwlagn: do nothing when disable agg in wrong state Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 21/34] iwlagn: use low retry limit for WoWLAN Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 22/34] iwlwifi: update comments on how to enable debug flag Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 23/34] iwlagn: more info on warning for shutdown agg queue Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 24/34] iwlagn: don't stop rts/cts until last aggregation queue close Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 25/34] iwlagn: add debug for mac80211 callback Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 26/34] iwlagn: rename all the mac80211 callback functions Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 27/34] iwlagn: merge station management functions Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 28/34] iwlagn: rename iwl-rx.c to iwl-agn-rx.c Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 29/34] iwlagn: remove 5000 hw header Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 30/34] iwlagn: remove 6000 " Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 32/34] iwlagn: move iwl_enable_rfkill_int and kill iwl-helpers.h Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 33/34] iwlagn: remove uneeded include to iwl-dev.h Wey-Yi Guy
2011-10-10 14:27 ` [PATCH 34/34] iwlagn: add missing include to iwl-agn-rs.h Wey-Yi Guy
2011-10-12 18:24 ` [PATCH 00/34] update for 3.2 John W. Linville
2011-10-12 18:00 ` Guy, Wey-Yi
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=20111011123630.GB2218@redhat.com \
--to=sgruszka@redhat.com \
--cc=emmanuel.grumbach@intel.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=wey-yi.w.guy@intel.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;
as well as URLs for NNTP newsgroup(s).