diff options
Diffstat (limited to 'drivers/memstick/host/tifm_ms.c')
-rw-r--r-- | drivers/memstick/host/tifm_ms.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/memstick/host/tifm_ms.c b/drivers/memstick/host/tifm_ms.c index 2b5bf52a8302..8577de4ebb0e 100644 --- a/drivers/memstick/host/tifm_ms.c +++ b/drivers/memstick/host/tifm_ms.c | |||
@@ -182,7 +182,7 @@ static unsigned int tifm_ms_transfer_data(struct tifm_ms *host) | |||
182 | struct tifm_dev *sock = host->dev; | 182 | struct tifm_dev *sock = host->dev; |
183 | unsigned int length; | 183 | unsigned int length; |
184 | unsigned int off; | 184 | unsigned int off; |
185 | unsigned int t_size, p_off, p_cnt; | 185 | unsigned int t_size, p_cnt; |
186 | unsigned char *buf; | 186 | unsigned char *buf; |
187 | struct page *pg; | 187 | struct page *pg; |
188 | unsigned long flags = 0; | 188 | unsigned long flags = 0; |
@@ -198,6 +198,8 @@ static unsigned int tifm_ms_transfer_data(struct tifm_ms *host) | |||
198 | host->block_pos); | 198 | host->block_pos); |
199 | 199 | ||
200 | while (length) { | 200 | while (length) { |
201 | unsigned int uninitialized_var(p_off); | ||
202 | |||
201 | if (host->req->long_data) { | 203 | if (host->req->long_data) { |
202 | pg = nth_page(sg_page(&host->req->sg), | 204 | pg = nth_page(sg_page(&host->req->sg), |
203 | off >> PAGE_SHIFT); | 205 | off >> PAGE_SHIFT); |
@@ -340,11 +342,20 @@ static void tifm_ms_complete_cmd(struct tifm_ms *host) | |||
340 | 342 | ||
341 | del_timer(&host->timer); | 343 | del_timer(&host->timer); |
342 | 344 | ||
343 | if (host->use_dma) | 345 | host->req->int_reg = readl(sock->addr + SOCK_MS_STATUS) & 0xff; |
346 | host->req->int_reg = (host->req->int_reg & 1) | ||
347 | | ((host->req->int_reg << 4) & 0xe0); | ||
348 | |||
349 | writel(TIFM_FIFO_INT_SETALL, | ||
350 | sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); | ||
351 | writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); | ||
352 | |||
353 | if (host->use_dma) { | ||
344 | tifm_unmap_sg(sock, &host->req->sg, 1, | 354 | tifm_unmap_sg(sock, &host->req->sg, 1, |
345 | host->req->data_dir == READ | 355 | host->req->data_dir == READ |
346 | ? PCI_DMA_FROMDEVICE | 356 | ? PCI_DMA_FROMDEVICE |
347 | : PCI_DMA_TODEVICE); | 357 | : PCI_DMA_TODEVICE); |
358 | } | ||
348 | 359 | ||
349 | writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), | 360 | writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), |
350 | sock->addr + SOCK_CONTROL); | 361 | sock->addr + SOCK_CONTROL); |
@@ -424,12 +435,6 @@ static void tifm_ms_card_event(struct tifm_dev *sock) | |||
424 | else if (host_status & TIFM_MS_STAT_CRC) | 435 | else if (host_status & TIFM_MS_STAT_CRC) |
425 | host->req->error = -EILSEQ; | 436 | host->req->error = -EILSEQ; |
426 | 437 | ||
427 | if (host->req->error) { | ||
428 | writel(TIFM_FIFO_INT_SETALL, | ||
429 | sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); | ||
430 | writel(TIFM_DMA_RESET, sock->addr + SOCK_DMA_CONTROL); | ||
431 | } | ||
432 | |||
433 | if (host_status & TIFM_MS_STAT_RDY) | 438 | if (host_status & TIFM_MS_STAT_RDY) |
434 | host->cmd_flags |= CMD_READY; | 439 | host->cmd_flags |= CMD_READY; |
435 | 440 | ||