Commit 5111dd3e authored by Larry Finger's avatar Larry Finger Committed by John W. Linville

rtlwifi: rtl8192se: Use write barrier when assigning ownership

As noted by Mike McCormack <mikem@ring3k.org> for rtl8192ce, make sure
all updates to a descriptor are flushed to memory before assigning ownship
to hardware.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4a7f5db1
...@@ -873,6 +873,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, ...@@ -873,6 +873,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len));
SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping));
wmb();
SET_TX_DESC_OWN(pdesc, 1); SET_TX_DESC_OWN(pdesc, 1);
} else { /* H2C Command Desc format (Host TXCMD) */ } else { /* H2C Command Desc format (Host TXCMD) */
/* 92SE must set as 1 for firmware download HW DMA error */ /* 92SE must set as 1 for firmware download HW DMA error */
...@@ -891,6 +892,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc, ...@@ -891,6 +892,7 @@ void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len)); SET_TX_DESC_TX_BUFFER_SIZE(pdesc, (u16)(skb->len));
SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping)); SET_TX_DESC_TX_BUFFER_ADDRESS(pdesc, cpu_to_le32(mapping));
wmb();
SET_TX_DESC_OWN(pdesc, 1); SET_TX_DESC_OWN(pdesc, 1);
} }
...@@ -901,6 +903,7 @@ void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val) ...@@ -901,6 +903,7 @@ void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val)
if (istx == true) { if (istx == true) {
switch (desc_name) { switch (desc_name) {
case HW_DESC_OWN: case HW_DESC_OWN:
wmb();
SET_TX_DESC_OWN(pdesc, 1); SET_TX_DESC_OWN(pdesc, 1);
break; break;
case HW_DESC_TX_NEXTDESC_ADDR: case HW_DESC_TX_NEXTDESC_ADDR:
...@@ -914,6 +917,7 @@ void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val) ...@@ -914,6 +917,7 @@ void rtl92se_set_desc(u8 *pdesc, bool istx, u8 desc_name, u8 *val)
} else { } else {
switch (desc_name) { switch (desc_name) {
case HW_DESC_RXOWN: case HW_DESC_RXOWN:
wmb();
SET_RX_STATUS_DESC_OWN(pdesc, 1); SET_RX_STATUS_DESC_OWN(pdesc, 1);
break; break;
case HW_DESC_RXBUFF_ADDR: case HW_DESC_RXBUFF_ADDR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment