From: Grazvydas Ignotas <notasas@gmail.com>
To: Dmitry Shmidt <dimitrysh@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Kalle Valo <kalle.valo@iki.fi>,
linux-mmc@vger.kernel.org
Subject: Re: [PATCH] sdio: add new function for RAW (Read after Write) operation
Date: Sat, 15 May 2010 15:16:53 +0300 [thread overview]
Message-ID: <AANLkTikSe8_KhkAzxRDizWB9o1FnCxulqvB2P3HVO7Gs@mail.gmail.com> (raw)
In-Reply-To: <AANLkTilCD2wylI_11B_S9-SbktXvUYgYB7d224XIMRt1@mail.gmail.com>
On Sat, May 15, 2010 at 3:02 AM, Dmitry Shmidt <dimitrysh@google.com> wrote:
> Hi Andrew,
>
> wl1251 has some HW problem for ELP register that demands to do
> something like "write during read" in order
> not to loose bits from this register during simple read.
> Fortunately it was enough just to add low 8 bits previous register
> value to the cmd.args during read operation
> and SD Controller will behave as needed. And it was tested on real
> wl1251 device that is used in G1 and MyTouch.
>
> However, patch author for some reason is using WRITE operation instead of READ.
>>>> ret = mmc_io_rw_direct(func->card, 1, func->num, addr, b, &val);
>>>> 1 means WRITE
>
> Maybe in case of wl1251 HW it is not important - to write during read,
> or to read during write, but the problem in wl1251 was during ELP
> register READ operation, so I do not understand why author used WRITE
> flag.
Well like you said, 'wl1251 [...] demands to do something like "write
during read"', and SDIO spec provides exactly this functionality with
the RAW flag (quoting SDIO spec):
"If this bit [RAW] is set to 1 and the R/W flag is set to 1, then the
command shall read the value of the register after the write. This is
useful to allow writing to a control register and reading the status
at the same address."
If you pass WRITE flag and a pointer for read value to
mmc_io_rw_direct(), it sets the R/W and RAW bits in the CMD52 request.
According to my tests wl1251 actually ignores both R/W and RAW flags,
but by the looks of it it is expecting the RAW request. With my patch
we can add a function that both conforms the SDIO spec and suits
wl1251 hardware.
Does that make sense to you?
next prev parent reply other threads:[~2010-05-15 12:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-27 21:18 [PATCH] sdio: add new function for RAW (Read after Write) operation Grazvydas Ignotas
2010-05-14 11:04 ` Grazvydas Ignotas
2010-05-14 22:06 ` Andrew Morton
2010-05-15 0:02 ` Dmitry Shmidt
2010-05-15 12:16 ` Grazvydas Ignotas [this message]
2010-05-15 16:25 ` Dmitry Shmidt
2010-05-15 20:46 ` Grazvydas Ignotas
2010-05-17 6:43 ` Kalle Valo
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=AANLkTikSe8_KhkAzxRDizWB9o1FnCxulqvB2P3HVO7Gs@mail.gmail.com \
--to=notasas@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=dimitrysh@google.com \
--cc=kalle.valo@iki.fi \
--cc=linux-mmc@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;
as well as URLs for NNTP newsgroup(s).