Skip to content

Commit

Permalink
drivers/mmc/core- Add better CRC control
Browse files Browse the repository at this point in the history
  • Loading branch information
Pafcholini authored and Angheloaia Victor committed Mar 26, 2020
1 parent 573e9b9 commit e1e637c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions drivers/mmc/core/core.c
Expand Up @@ -68,9 +68,27 @@ static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
* Enabling software CRCs on the data blocks can be a significant (30%)
* performance cost, and for other reasons may not always be desired.
* So we allow it it to be disabled.
*
* SysFs interface :
*
* /sys/module/mmc_core/parameters/crc
*
* Enable / Disable CRC
*
* echo N > /sys/module/mmc_core/parameters/crc (Disabled) or
* echo 0 > /sys/module/mmc_core/parameters/crc (Disabled)
*
* echo Y > /sys/module/mmc_core/parameters/crc (Enlabled) or
* echo 1 > /sys/module/mmc_core/parameters/crc (Enabled)
*/
bool use_spi_crc = 1;
module_param(use_spi_crc, bool, 0);

int use_spi_crc = 0;
EXPORT_SYMBOL(use_spi_crc);
module_param_named(crc, use_spi_crc, int, 0644);
MODULE_PARM_DESC(
crc,
"Enable/disable CRC");

static int mmc_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
Expand Down
2 changes: 1 addition & 1 deletion drivers/mmc/core/core.h
Expand Up @@ -81,7 +81,7 @@ int mmc_attach_sd(struct mmc_host *host);
int mmc_attach_sdio(struct mmc_host *host);

/* Module parameters */
extern bool use_spi_crc;
extern int use_spi_crc;

/* Debugfs information for hosts and cards */
void mmc_add_host_debugfs(struct mmc_host *host);
Expand Down

0 comments on commit e1e637c

Please sign in to comment.