diff options
author | Ben Dooks <ben-linux@fluff.org> | 2008-06-30 17:40:39 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 08:14:48 -0400 |
commit | 7e9c7b64022b7faff6022df64baec8ab467d0bfd (patch) | |
tree | 53cfd0f7efbdafcb897ab8fde122c6aef1862a73 /drivers/mmc/host | |
parent | 4dde7f755211fd58105c989a99a3a9f2f1238fba (diff) |
MMC: S3C24XX: Refuse incorrectly aligned transfers
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>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r-- | drivers/mmc/host/s3cmci.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/host/s3cmci.c b/drivers/mmc/host/s3cmci.c index 2b4839536975..6a1e4994b724 100644 --- a/drivers/mmc/host/s3cmci.c +++ b/drivers/mmc/host/s3cmci.c | |||
@@ -807,6 +807,17 @@ static int s3cmci_setup_data(struct s3cmci_host *host, struct mmc_data *data) | |||
807 | return 0; | 807 | return 0; |
808 | } | 808 | } |
809 | 809 | ||
810 | if ((data->blksz & 3) != 0) { | ||
811 | /* We cannot deal with unaligned blocks with more than | ||
812 | * one block being transfered. */ | ||
813 | |||
814 | if (data->blocks > 1) | ||
815 | return -EINVAL; | ||
816 | |||
817 | /* No support yet for non-word block transfers. */ | ||
818 | return -EINVAL; | ||
819 | } | ||
820 | |||
810 | while (readl(host->base + S3C2410_SDIDSTA) & | 821 | while (readl(host->base + S3C2410_SDIDSTA) & |
811 | (S3C2410_SDIDSTA_TXDATAON | S3C2410_SDIDSTA_RXDATAON)) { | 822 | (S3C2410_SDIDSTA_TXDATAON | S3C2410_SDIDSTA_RXDATAON)) { |
812 | 823 | ||