From: Mike McCormack Date: Mon, 30 May 2011 23:49:51 +0000 (+0900) Subject: rtlwifi: Assign rx buffer ownership to hardware last X-Git-Tag: Ubuntu-5.0.0-8.9~18234^2~450^2~57^2~29 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=febc9fe5387ed37cb329563ae29d21b41c71a9dd;p=mirror_ubuntu-disco-kernel.git 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: Mike McCormack Signed-off-by: Larry Finger Signed-off-by: John W. Linville --- diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index 6c1b9dffc075..e29feef002bf 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c @@ -784,8 +784,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); @@ -795,6 +793,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; }