Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 299100
b: refs/heads/master
c: 0d05568
h: refs/heads/master
v: v3
  • Loading branch information
wwang authored and Greg Kroah-Hartman committed Apr 10, 2012
1 parent 94c202b commit b7ffee7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ca5218e3939685c2325fc0a0a1ac8150272c93f
refs/heads/master: 0d05568ac79bfc595f1eadc3e0fd7a20a45f7b69
11 changes: 6 additions & 5 deletions trunk/drivers/staging/rts_pstor/rtsx_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
int sg_cnt, i, resid;
int err = 0;
long timeleft;
struct scatterlist *sg_ptr;
u32 val = TRIG_DMA;

if ((sg == NULL) || (num_sg <= 0) || !offset || !index)
Expand Down Expand Up @@ -371,22 +372,22 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
sg_cnt = dma_map_sg(&(rtsx->pci->dev), sg, num_sg, dma_dir);

resid = size;

sg_ptr = sg;
chip->sgi = 0;
/* Usually the next entry will be @sg@ + 1, but if this sg element
* is part of a chained scatterlist, it could jump to the start of
* a new scatterlist array. So here we use sg_next to move to
* the proper sg
*/
for (i = 0; i < *index; i++)
sg = sg_next(sg);
sg_ptr = sg_next(sg_ptr);
for (i = *index; i < sg_cnt; i++) {
dma_addr_t addr;
unsigned int len;
u8 option;

addr = sg_dma_address(sg);
len = sg_dma_len(sg);
addr = sg_dma_address(sg_ptr);
len = sg_dma_len(sg_ptr);

RTSX_DEBUGP("DMA addr: 0x%x, Len: 0x%x\n",
(unsigned int)addr, len);
Expand Down Expand Up @@ -415,7 +416,7 @@ static int rtsx_transfer_sglist_adma_partial(struct rtsx_chip *chip, u8 card,
if (!resid)
break;

sg = sg_next(sg);
sg_ptr = sg_next(sg_ptr);
}

RTSX_DEBUGP("SG table count = %d\n", chip->sgi);
Expand Down

0 comments on commit b7ffee7

Please sign in to comment.