<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mmc/host/alcor.c, branch linux-5.0.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.0.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-04-17T06:39:48Z</updated>
<entry>
<title>mmc: alcor: don't write data before command has completed</title>
<updated>2019-04-17T06:39:48Z</updated>
<author>
<name>Daniel Drake</name>
</author>
<published>2019-03-26T07:04:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13771e12fb7d82b725bd1e57220691cee75deaae'/>
<id>urn:sha1:13771e12fb7d82b725bd1e57220691cee75deaae</id>
<content type='text'>
commit 157c99c5a2956a9ab1ae12de0136a2d8a1b1a307 upstream.

The alcor driver is setting up data transfer and submitting the associated
MMC command at the same time. While this works most of the time, it
occasionally causes problems upon write.

In the working case, after setting up the data transfer and submitting
the MMC command, an interrupt comes in a moment later with CMD_END and
WRITE_BUF_RDY bits set. The data transfer then happens without problem.

However, on occasion, the interrupt that arrives at that point only
has WRITE_BUF_RDY set. The hardware notifies that it's ready to write
data, but the associated MMC command is still running. Regardless, the
driver was proceeding to write data immediately, and that would then cause
another interrupt indicating data CRC error, and the write would fail.

Additionally, the transfer setup function alcor_trigger_data_transfer()
was being called 3 times for each write operation, which was confusing
and may be contributing to this issue.

Solve this by tweaking the driver behaviour to follow the sequence observed
in the original ampe_stor vendor driver:
 1. When starting request handling, write 0 to DATA_XFER_CTRL
 2. Submit the command
 3. Wait for CMD_END interrupt and then trigger data transfer
 4. For the PIO case, trigger the next step of the data transfer only
    upon the following DATA_END interrupt, which occurs after the block has
    been written.

I confirmed that the read path still works (DMA &amp; PIO) and also now
presents more consistency with the operations performed by ampe_stor.

Signed-off-by: Daniel Drake &lt;drake@endlessm.com&gt;
Fixes: c5413ad815a6 ("mmc: add new Alcor Micro Cardreader SD/MMC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mmc: alcor: fix DMA reads</title>
<updated>2019-03-27T05:17:51Z</updated>
<author>
<name>Daniel Drake</name>
</author>
<published>2019-03-20T06:36:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7e682a01b11110f0193c5808930149d7ac2826c9'/>
<id>urn:sha1:7e682a01b11110f0193c5808930149d7ac2826c9</id>
<content type='text'>
commit 5ea47691bd99e1100707ec63364aff72324e2af4 upstream.

Setting max_blk_count to 1 here was causing the mmc block layer
to always use the MMC_READ_SINGLE_BLOCK command here, which the
driver does not DMA-accelerate.

Drop the max_blk_ settings here. The mmc host defaults suffice,
along with the max_segs and max_seg_size settings, which I have
now documented in more detail.

Now each MMC command reads 4 512-byte blocks, using DMA instead of
PIO. On my SD card, this increases read performance (measured with dd)
from 167kb/sec to 4.6mb/sec.

Link: http://lkml.kernel.org/r/CAD8Lp47L5T3jnAjBiPs1cQ+yFA3L6LJtgFvMETnBrY63-Zdi2g@mail.gmail.com
Signed-off-by: Daniel Drake &lt;drake@endlessm.com&gt;
Reviewed-by: Oleksij Rempel &lt;linux@rempel-privat.de&gt;
Fixes: c5413ad815a6 ("mmc: add new Alcor Micro Cardreader SD/MMC driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mmc: alcor: remove set but not used variables 'len, clock_out'</title>
<updated>2018-12-17T07:26:24Z</updated>
<author>
<name>YueHaibing</name>
</author>
<published>2018-12-07T06:34:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=566b60209427ed6b442b0b0cb3dba04187fba330'/>
<id>urn:sha1:566b60209427ed6b442b0b0cb3dba04187fba330</id>
<content type='text'>
Fixes gcc '-Wunused-but-set-variable' warning:

drivers/mmc/host/alcor.c: In function 'alcor_data_set_dma':
drivers/mmc/host/alcor.c:124:12: warning:
 variable 'len' set but not used [-Wunused-but-set-variable]

drivers/mmc/host/alcor.c:648:15: warning:
 variable 'clock_out' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Reviewed-by: Oleksij Rempel &lt;linux@rempel-privat.de&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: add new Alcor Micro Cardreader SD/MMC driver</title>
<updated>2018-12-17T07:26:24Z</updated>
<author>
<name>Oleksij Rempel</name>
</author>
<published>2018-12-02T10:30:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c5413ad815a675b5c98a002353d8e96b44b164e9'/>
<id>urn:sha1:c5413ad815a675b5c98a002353d8e96b44b164e9</id>
<content type='text'>
This driver provides support for Alcor Micro AU6601 and AU6621
SD/MMC controller.

Signed-off-by: Oleksij Rempel &lt;linux@rempel-privat.de&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
</feed>
