Skip to content

Commit

Permalink
rtlwifi: Assign rx buffer ownership to hardware last
Browse files Browse the repository at this point in the history
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Mike McCormack authored and John W. Linville committed Jun 3, 2011
1 parent 312d547 commit febc9fe
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/rtlwifi/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,8 +784,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
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);
Expand All @@ -795,6 +793,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
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;
}

Expand Down

0 comments on commit febc9fe

Please sign in to comment.