diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-02-20 19:16:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-02-20 19:16:36 +0000 |
commit | 66d83ff4bc53d9294e80b91857ce21f39c32f6a7 (patch) | |
tree | 5a46367ed6113a650d030fee771ecacc32f9db1d /sys/dev/sdmmc/sdmmc_mem.c | |
parent | ac568282f8bd7ec128aed050203eb3aaa5029f19 (diff) |
Let the sdmmc adapters tell the sdmmc layer how much sectors they can
transfer with one command. Build on this and the recent minphys() changes
in the sdmmc layer to crank transfers at the maximum possible size instead
of a sad DEV_BSIZE.
Depending on your controller, this can speed up sdmmc I/O up to 2.5 times.
Diffstat (limited to 'sys/dev/sdmmc/sdmmc_mem.c')
-rw-r--r-- | sys/dev/sdmmc/sdmmc_mem.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/dev/sdmmc/sdmmc_mem.c b/sys/dev/sdmmc/sdmmc_mem.c index 4f7246afa07..682f8e9c5bb 100644 --- a/sys/dev/sdmmc/sdmmc_mem.c +++ b/sys/dev/sdmmc/sdmmc_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sdmmc_mem.c,v 1.10 2009/01/09 10:55:22 jsg Exp $ */ +/* $OpenBSD: sdmmc_mem.c,v 1.11 2009/02/20 19:16:35 miod Exp $ */ /* * Copyright (c) 2006 Uwe Stuehler <uwe@openbsd.org> @@ -425,9 +425,8 @@ sdmmc_mem_read_block(struct sdmmc_function *sf, int blkno, u_char *data, if (error != 0) goto err; - /* XXX sdhc(4) does not need this */ -#ifdef __zaurus__ - if (cmd.c_opcode == MMC_READ_BLOCK_MULTIPLE) { + if (ISSET(sc->sc_flags, SMF_STOP_AFTER_MULTIPLE) && + cmd.c_opcode == MMC_READ_BLOCK_MULTIPLE) { bzero(&cmd, sizeof cmd); cmd.c_opcode = MMC_STOP_TRANSMISSION; cmd.c_arg = MMC_ARG_RCA(sf->rca); @@ -436,7 +435,6 @@ sdmmc_mem_read_block(struct sdmmc_function *sf, int blkno, u_char *data, if (error != 0) goto err; } -#endif do { bzero(&cmd, sizeof cmd); @@ -483,9 +481,8 @@ sdmmc_mem_write_block(struct sdmmc_function *sf, int blkno, u_char *data, if (error != 0) goto err; - /* XXX sdhc(4) does not need this */ -#ifdef __zaurus__ - if (cmd.c_opcode == MMC_WRITE_BLOCK_MULTIPLE) { + if (ISSET(sc->sc_flags, SMF_STOP_AFTER_MULTIPLE) && + cmd.c_opcode == MMC_WRITE_BLOCK_MULTIPLE) { bzero(&cmd, sizeof cmd); cmd.c_opcode = MMC_STOP_TRANSMISSION; cmd.c_flags = SCF_CMD_AC | SCF_RSP_R1B; @@ -493,7 +490,6 @@ sdmmc_mem_write_block(struct sdmmc_function *sf, int blkno, u_char *data, if (error != 0) goto err; } -#endif do { bzero(&cmd, sizeof cmd); |