From: Emmanuel Grumbach Date: Sun, 25 Nov 2012 12:42:25 +0000 (+0200) Subject: iwlwifi: read the Rx write pointer only once X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=52e2a99eee77cc4a47e183eb7f5102301a31e282;p=~shefty%2Frdma-dev.git iwlwifi: read the Rx write pointer only once The FH (DMA engine) tells the driver the index of the last ready (closed) Rx buffer. This data is in closed_rb_num. If we read this data several times we may get inconsistencies between the code and the debug prints which can make it harder to debug issues here. Signed-off-by: Emmanuel Grumbach Signed-off-by: Johannes Berg --- diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index c81b9782d2a..787b9ca6af9 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c @@ -698,7 +698,7 @@ static void iwl_pcie_rx_handle(struct iwl_trans *trans) /* uCode's read index (stored in shared DRAM) indicates the last Rx * buffer that the driver may process (last buffer filled by ucode). */ - r = le16_to_cpu(rxq->rb_stts->closed_rb_num) & 0x0FFF; + r = le16_to_cpu(ACCESS_ONCE(rxq->rb_stts->closed_rb_num)) & 0x0FFF; i = rxq->read; /* Rx interrupt, but nothing sent from uCode */