[PATCH 06/99] cw1200: Remove unnecessary reads of CONTROL reg

Dmitry Tarnyagin dmitry.tarnyagin at stericsson.com
Wed Feb 29 14:14:13 UTC 2012


From: "Ajitpal.Singh" <ajitpal.singh at stericsson.com>

cw1200 device implements a SDIO retry mechanism which requires
the HOST to do a read/write to any device reg after reading the QUEUE
reg.
Removed reading of CONTROL register after every RX/TX and replaced
it with a read of 1 byte of the CONFIG reg when no RX/TX is pending
in the cw1200_bh()

ST-Ericsson ID: 357764
ST-Ericsson FOSS-OUT ID: NA
Signed-off-by: Ajitpal.Singh <ajitpal.singh at stericsson.com>
Change-Id: Ib700807853883800fb2649e3b430c43c14e1e6d8
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32007
Reviewed-by: Bartosz MARKOWSKI <bartosz.markowski at tieto.com>
Reviewed-by: QABUILD
Reviewed-by: QATEST
Tested-by: Bartosz MARKOWSKI <bartosz.markowski at tieto.com>
---
 drivers/staging/cw1200/bh.c |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/cw1200/bh.c b/drivers/staging/cw1200/bh.c
index ff6b85e..acc1645 100644
--- a/drivers/staging/cw1200/bh.c
+++ b/drivers/staging/cw1200/bh.c
@@ -262,6 +262,7 @@ static int cw1200_bh(void *arg)
 	int tx_allowed;
 	int pending_tx = 0;
 	long status;
+	u8 dummy;
 
 	for (;;) {
 		if (!priv->hw_bufs_used
@@ -274,6 +275,12 @@ static int cw1200_bh(void *arg)
 		else
 			status = MAX_SCHEDULE_TIMEOUT;
 
+		/* Dummy Read for SDIO retry mechanism*/
+		if (((atomic_read(&priv->bh_rx) == 0) &&
+				(atomic_read(&priv->bh_tx) == 0)))
+			cw1200_reg_read(priv, ST90TDS_CONFIG_REG_ID,
+					&dummy, sizeof(dummy));
+
 		status = wait_event_interruptible_timeout(priv->bh_wq, ({
 				rx = atomic_xchg(&priv->bh_rx, 0);
 				tx = atomic_xchg(&priv->bh_tx, 0);
@@ -499,14 +506,6 @@ tx:
 			}
 		}
 
-		/* HACK!!! Device tends not to send interrupt
-		 * if this extra check is missing */
-		if (!(ctrl_reg & ST90TDS_CONT_NEXT_LEN_MASK)) {
-			if (WARN_ON(cw1200_bh_read_ctrl_reg(
-					priv, &ctrl_reg)))
-				break;
-		}
-
 		if (ctrl_reg & ST90TDS_CONT_NEXT_LEN_MASK)
 			goto rx;
 	}
-- 
1.7.8.3



More information about the kernel mailing list