summaryrefslogtreecommitdiff
path: root/drivers/memstick/host/tifm_ms.c
diff options
context:
space:
mode:
authorAlex Dubov <oakad@yahoo.com>2008-03-20 03:01:06 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-20 04:53:37 +0300
commitead70773608a5d97f81cb492f117d20b5e9f323e (patch)
treefa71036f83c49c3b7aee99c11d152ddeb2b3599e /drivers/memstick/host/tifm_ms.c
parent9df130392fb642ecd5564163b574ce69ffda1afa (diff)
downloadlinux-ead70773608a5d97f81cb492f117d20b5e9f323e.tar.xz
memstick: automatically retrieve "INT" value from command response
MemoryStick storage cards, when in parallel mode, send several meaningful bits of their "INT" register as part of command response. This data is stored by host and can be used to spare invocation of "GET_INT" TPC on each data page transferred between host and card. Signed-off-by: Alex Dubov <oakad@yahoo.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/memstick/host/tifm_ms.c')
-rw-r--r--drivers/memstick/host/tifm_ms.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_ms.c
index 2b5bf52a8302..eb150dfb637f 100644
--- a/drivers/memstick/host/tifm_ms.c
+++ b/drivers/memstick/host/tifm_ms.c
@@ -340,11 +340,20 @@ static void tifm_ms_complete_cmd(struct tifm_ms *host)
del_timer(&host->timer);
- if (host->use_dma)
+ host->req->int_reg = readl(sock->addr + SOCK_MS_STATUS) & 0xff;
+ host->req->int_reg = (host->req->int_reg & 1)
+ | ((host->req->int_reg << 4) & 0xe0);
+
+ writel(TIFM_FIFO_INT_SETALL,
+ sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
+ writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL);
+
+ if (host->use_dma) {
tifm_unmap_sg(sock, &host->req->sg, 1,
host->req->data_dir == READ
? PCI_DMA_FROMDEVICE
: PCI_DMA_TODEVICE);
+ }
writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL),
sock->addr + SOCK_CONTROL);
@@ -424,12 +433,6 @@ static void tifm_ms_card_event(struct tifm_dev *sock)
else if (host_status & TIFM_MS_STAT_CRC)
host->req->error = -EILSEQ;
- if (host->req->error) {
- writel(TIFM_FIFO_INT_SETALL,
- sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR);
- writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL);
- }
-
if (host_status & TIFM_MS_STAT_RDY)
host->cmd_flags |= CMD_READY;