Skip to content

Commit c3d53d0

Browse files
ahunter6storulf
authored andcommitted
mmc: core: Add parameter use_blk_mq
Until mmc has blk-mq support fully implemented and tested, add a parameter use_blk_mq, set to true if config option MMC_MQ_DEFAULT is selected, which it is by default. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 6d3898a commit c3d53d0

File tree

6 files changed

+26
-0
lines changed

6 files changed

+26
-0
lines changed

drivers/mmc/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,16 @@ menuconfig MMC
1212
If you want MMC/SD/SDIO support, you should say Y here and
1313
also to your specific host controller driver.
1414

15+
config MMC_MQ_DEFAULT
16+
bool "MMC: use blk-mq I/O path by default"
17+
depends on MMC && BLOCK
18+
default y
19+
---help---
20+
This option enables the new blk-mq based I/O path for MMC block
21+
devices by default. With the option the mmc_core.use_blk_mq
22+
module/boot option defaults to Y, without it to N, but it can
23+
still be overridden either way.
24+
1525
if MMC
1626

1727
source "drivers/mmc/core/Kconfig"

drivers/mmc/core/core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ static const unsigned freqs[] = { 400000, 300000, 200000, 100000 };
6666
bool use_spi_crc = 1;
6767
module_param(use_spi_crc, bool, 0);
6868

69+
#ifdef CONFIG_MMC_MQ_DEFAULT
70+
bool mmc_use_blk_mq = true;
71+
#else
72+
bool mmc_use_blk_mq = false;
73+
#endif
74+
module_param_named(use_blk_mq, mmc_use_blk_mq, bool, S_IWUSR | S_IRUGO);
75+
6976
static int mmc_schedule_delayed_work(struct delayed_work *work,
7077
unsigned long delay)
7178
{

drivers/mmc/core/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ struct mmc_bus_ops {
3535
int (*reset)(struct mmc_host *);
3636
};
3737

38+
extern bool mmc_use_blk_mq;
39+
3840
void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
3941
void mmc_detach_bus(struct mmc_host *host);
4042

drivers/mmc/core/host.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,8 @@ struct mmc_host *mmc_alloc_host(int extra, struct device *dev)
404404

405405
host->fixed_drv_type = -EINVAL;
406406

407+
host->use_blk_mq = mmc_use_blk_mq;
408+
407409
return host;
408410
}
409411

drivers/mmc/core/host.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ static inline bool mmc_card_hs400es(struct mmc_card *card)
7474
return card->host->ios.enhanced_strobe;
7575
}
7676

77+
static inline bool mmc_host_use_blk_mq(struct mmc_host *host)
78+
{
79+
return host->use_blk_mq;
80+
}
7781

7882
#endif
7983

include/linux/mmc/host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ struct mmc_host {
380380
unsigned int doing_retune:1; /* re-tuning in progress */
381381
unsigned int retune_now:1; /* do re-tuning at next req */
382382
unsigned int retune_paused:1; /* re-tuning is temporarily disabled */
383+
unsigned int use_blk_mq:1; /* use blk-mq */
383384

384385
int rescan_disable; /* disable card detection */
385386
int rescan_entered; /* used with nonremovable devices */

0 commit comments

Comments
 (0)