Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225701
b: refs/heads/master
c: 71dd910
h: refs/heads/master
i:
  225699: 766d2ec
v: v3
  • Loading branch information
Sahitya Tummala authored and David Brown committed Dec 20, 2010
1 parent e115db9 commit d5c3e74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 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: b08bb35d1a5ee5426198eb3a2861008c2e9e6fc4
refs/heads/master: 71dd9106af54de0f758875fa4b595af42a327448
8 changes: 6 additions & 2 deletions trunk/drivers/mmc/host/msm_sdcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,9 @@ msmsdcc_pio_read(struct msmsdcc_host *host, char *buffer, unsigned int remain)
uint32_t *ptr = (uint32_t *) buffer;
int count = 0;

if (remain % 4)
remain = ((remain >> 2) + 1) << 2;

while (msmsdcc_readl(host, MMCISTATUS) & MCI_RXDATAAVLBL) {
*ptr = msmsdcc_readl(host, MMCIFIFO + (count % MCI_FIFOSIZE));
ptr++;
Expand All @@ -633,13 +636,14 @@ msmsdcc_pio_write(struct msmsdcc_host *host, char *buffer,
char *ptr = buffer;

do {
unsigned int count, maxcnt;
unsigned int count, maxcnt, sz;

maxcnt = status & MCI_TXFIFOEMPTY ? MCI_FIFOSIZE :
MCI_FIFOHALFSIZE;
count = min(remain, maxcnt);

writesl(base + MMCIFIFO, ptr, count >> 2);
sz = count % 4 ? (count >> 2) + 1 : (count >> 2);
writesl(base + MMCIFIFO, ptr, sz);
ptr += count;
remain -= count;

Expand Down

0 comments on commit d5c3e74

Please sign in to comment.