Skip to content

Commit

Permalink
MMC: S3C24XX: Refuse incorrectly aligned transfers
Browse files Browse the repository at this point in the history
The hardware does not support any multi-block transfers
with an block-size that is not 32bit aligned. Also the driver
itself does not support single block non-32bit transfers
either.

Ensure that the s3cmci_setup_data() returns the appropriate
error if we encounter this.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Ben Dooks authored and Pierre Ossman committed Jul 15, 2008
1 parent 4dde7f7 commit 7e9c7b6
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions drivers/mmc/host/s3cmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,17 @@ static int s3cmci_setup_data(struct s3cmci_host *host, struct mmc_data *data)
return 0;
}

if ((data->blksz & 3) != 0) {
/* We cannot deal with unaligned blocks with more than
* one block being transfered. */

if (data->blocks > 1)
return -EINVAL;

/* No support yet for non-word block transfers. */
return -EINVAL;
}

while (readl(host->base + S3C2410_SDIDSTA) &
(S3C2410_SDIDSTA_TXDATAON | S3C2410_SDIDSTA_RXDATAON)) {

Expand Down

0 comments on commit 7e9c7b6

Please sign in to comment.