Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102174
b: refs/heads/master
c: 5385edc
h: refs/heads/master
v: v3
  • Loading branch information
Ville Syrjala authored and Pierre Ossman committed Jul 15, 2008
1 parent 3a942c8 commit a9f6e67
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 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: fa1fe010c126ee69f2f75e3a4efc2f6252281ff8
refs/heads/master: 5385edc50063a2175383ef5e90aa67fb6ab1beae
21 changes: 17 additions & 4 deletions trunk/drivers/mmc/host/at91_mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,14 @@ static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data
unsigned int len, i, size;
unsigned *dmabuf = host->buffer;

size = host->total_length;
size = data->blksz * data->blocks;
len = data->sg_len;

/* AT91SAM926[0/3] Data Write Operation and number of bytes erratum */
if (cpu_is_at91sam9260() || cpu_is_at91sam9263())
if (host->total_length == 12)
memset(dmabuf, 0, 12);

/*
* Just loop through all entries. Size might not
* be the entire list though so make sure that
Expand All @@ -222,9 +227,10 @@ static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data

for (index = 0; index < (amount / 4); index++)
*dmabuf++ = swab32(sgbuffer[index]);
}
else
} else {
memcpy(dmabuf, sgbuffer, amount);
dmabuf += amount;
}

kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);

Expand Down Expand Up @@ -417,7 +423,7 @@ static void at91_mci_update_bytes_xfered(struct at91mci_host *host)
/* card is in IDLE mode now */
pr_debug("-> bytes_xfered %d, total_length = %d\n",
data->bytes_xfered, host->total_length);
data->bytes_xfered = host->total_length;
data->bytes_xfered = data->blksz * data->blocks;
}
}
}
Expand Down Expand Up @@ -600,6 +606,13 @@ static void at91_mci_send_command(struct at91mci_host *host, struct mmc_command
* Handle a write
*/
host->total_length = block_length * blocks;
/*
* AT91SAM926[0/3] Data Write Operation and
* number of bytes erratum
*/
if (cpu_is_at91sam9260 () || cpu_is_at91sam9263())
if (host->total_length < 12)
host->total_length = 12;
host->buffer = dma_alloc_coherent(NULL,
host->total_length,
&host->physical_address, GFP_KERNEL);
Expand Down

0 comments on commit a9f6e67

Please sign in to comment.