linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike McCormack <mikem@ring3k.org>
To: linville@tuxdriver.com
Cc: Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn,
	linux-wireless@vger.kernel.org
Subject: [PATCH 6/8] rtlwifi: Assign rx buffer ownership to hardware last
Date: Tue, 31 May 2011 08:49:51 +0900	[thread overview]
Message-ID: <4DE42D1F.5000107@ring3k.org> (raw)

Ownership of an rx buffer should only be given to the hardware
after all other changes are written, otherwise there's
a potential race.

Signed-off-by: Mike McCormack <mikem@ring3k.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---
 drivers/net/wireless/rtlwifi/pci.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index fd74396..4fe405a 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -782,8 +782,6 @@ done:
 		rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
 					    HW_DESC_RXBUFF_ADDR,
 					    (u8 *)&bufferaddress);
-		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
-					    (u8 *)&tmp_one);
 		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false,
 					    HW_DESC_RXPKT_LEN,
 					    (u8 *)&rtlpci->rxbuffersize);
@@ -793,6 +791,9 @@ done:
 						    HW_DESC_RXERO,
 						    (u8 *)&tmp_one);
 
+		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
+					    (u8 *)&tmp_one);
+
 		index = (index + 1) % rtlpci->rxringcount;
 	}
 
-- 
1.7.4.1



             reply	other threads:[~2011-05-30 23:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30 23:49 Mike McCormack [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-05-25  0:40 [PATCH 6/8] rtlwifi: Assign rx buffer ownership to hardware last Mike McCormack
2011-05-23 13:54 Mike McCormack
2011-05-23 19:52 ` Larry Finger

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=4DE42D1F.5000107@ring3k.org \
    --to=mikem@ring3k.org \
    --cc=Larry.Finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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).