From: Luciano Coelho <coelho@ti.com>
To: coelho@ti.com
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH 2/3] wl12xx: use the same SDIO block size for all different chips
Date: Thu, 3 Nov 2011 08:44:42 +0200 [thread overview]
Message-ID: <1320302683-23403-3-git-send-email-coelho@ti.com> (raw)
In-Reply-To: <1320302683-23403-1-git-send-email-coelho@ti.com>
The sdio driver uses a block size of 512 bytes by default. With our
card, this doesn't work correctly because it sets the block size FBR
in the chip too early (ie. before the chip is powered on). Thus, if
we don't set it explicitly, block mode remains disabled in the chip.
If we try to send more data than fits in one block, the sdio driver
will split it into separate blocks before sending to the chip. This
causes problems because the chip is not expecting multiple blocks.
At the moment this is not a problem, because we use chunks of 512
bytes for firmware upload and the data is always sent in byte mode.
In the next patch, we will change the chunk size to a bigger value, so
this patch is a preparation for that.
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
drivers/net/wireless/wl12xx/main.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index bddf289..0532630 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -1313,7 +1313,16 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
/* 0. read chip id from CHIP_ID */
wl->chip.id = wl1271_read32(wl, CHIP_ID_B);
- /* 1. check if chip id is valid */
+ /*
+ * For wl127x based devices we could use the default block
+ * size (512 bytes), but due to a bug in the sdio driver, we
+ * need to set it explicitly after the chip is powered on. To
+ * simplify the code and since the performance impact is
+ * negligible, we use the same block size for all different
+ * chip types.
+ */
+ if (!wl1271_set_block_size(wl))
+ wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
switch (wl->chip.id) {
case CHIP_ID_1271_PG10:
@@ -1343,9 +1352,6 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
ret = wl1271_setup(wl);
if (ret < 0)
goto out;
-
- if (!wl1271_set_block_size(wl))
- wl->quirks |= WL12XX_QUIRK_NO_BLOCKSIZE_ALIGNMENT;
break;
case CHIP_ID_1283_PG10:
default:
--
1.7.4.1
next prev parent reply other threads:[~2011-11-03 6:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-03 6:44 [PATCH 0/3] wl12xx: improve firmware transfer efficiency Luciano Coelho
2011-11-03 6:44 ` [PATCH 1/3] wl12xx: change blocksize alignment quirk to negative Luciano Coelho
2011-11-03 6:44 ` Luciano Coelho [this message]
2011-11-03 6:44 ` [PATCH 3/3] wl12xx: increase firmware upload chunk size Luciano Coelho
2011-11-08 14:13 ` [PATCH 0/3] wl12xx: improve firmware transfer efficiency Luciano Coelho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320302683-23403-3-git-send-email-coelho@ti.com \
--to=coelho@ti.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox