Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit febc9fe5 authored by Mike McCormack's avatar Mike McCormack Committed by John W. Linville
Browse files

rtlwifi: Assign rx buffer ownership to hardware last



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: default avatarMike McCormack <mikem@ring3k.org>
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 312d5479
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -784,8 +784,6 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
		rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
		rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
					    HW_DESC_RXBUFF_ADDR,
					    HW_DESC_RXBUFF_ADDR,
					    (u8 *)&bufferaddress);
					    (u8 *)&bufferaddress);
		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
					    (u8 *)&tmp_one);
		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false,
		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false,
					    HW_DESC_RXPKT_LEN,
					    HW_DESC_RXPKT_LEN,
					    (u8 *)&rtlpci->rxbuffersize);
					    (u8 *)&rtlpci->rxbuffersize);
@@ -795,6 +793,9 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
						    HW_DESC_RXERO,
						    HW_DESC_RXERO,
						    (u8 *)&tmp_one);
						    (u8 *)&tmp_one);


		rtlpriv->cfg->ops->set_desc((u8 *)pdesc, false, HW_DESC_RXOWN,
					    (u8 *)&tmp_one);

		index = (index + 1) % rtlpci->rxringcount;
		index = (index + 1) % rtlpci->rxringcount;
	}
	}