|
9 | 9 | * it under the terms of the GNU General Public License version 2 as |
10 | 10 | * published by the Free Software Foundation. |
11 | 11 | */ |
12 | | - |
| 12 | +#include <linux/moduleparam.h> |
13 | 13 | #include <linux/err.h> |
14 | 14 | #include <linux/of.h> |
15 | 15 | #include <linux/slab.h> |
@@ -65,6 +65,10 @@ static const unsigned int taac_mant[] = { |
65 | 65 | __res & __mask; \ |
66 | 66 | }) |
67 | 67 |
|
| 68 | +/* Enable / disable command queue support */ |
| 69 | +static bool mmc_cmdqueue_support = true; |
| 70 | +core_param(mmc_cmdqueue, mmc_cmdqueue_support, bool, S_IRUGO); |
| 71 | + |
68 | 72 | /* |
69 | 73 | * Given the decoded CSD structure, decode the raw CID to our CID structure. |
70 | 74 | */ |
@@ -1824,15 +1828,20 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, |
1824 | 1828 | */ |
1825 | 1829 | card->ext_csd.cmdq_en = false; |
1826 | 1830 | if (card->ext_csd.cmdq_support && host->caps2 & MMC_CAP2_CQE) { |
1827 | | - err = mmc_cmdq_enable(card); |
1828 | | - if (err && err != -EBADMSG) |
1829 | | - goto free_card; |
1830 | | - if (err) { |
1831 | | - pr_warn("%s: Enabling CMDQ failed\n", |
1832 | | - mmc_hostname(card->host)); |
1833 | | - card->ext_csd.cmdq_support = false; |
1834 | | - card->ext_csd.cmdq_depth = 0; |
1835 | | - err = 0; |
| 1831 | + if (mmc_cmdqueue_support) { |
| 1832 | + err = mmc_cmdq_enable(card); |
| 1833 | + if (err && err != -EBADMSG) |
| 1834 | + goto free_card; |
| 1835 | + if (err) { |
| 1836 | + pr_warn("%s: Enabling CMDQ failed\n", |
| 1837 | + mmc_hostname(card->host)); |
| 1838 | + card->ext_csd.cmdq_support = false; |
| 1839 | + card->ext_csd.cmdq_depth = 0; |
| 1840 | + err = 0; |
| 1841 | + } |
| 1842 | + } else { |
| 1843 | + pr_info("%s: CMDQ support disabled in kernel\n", |
| 1844 | + mmc_hostname(host)); |
1836 | 1845 | } |
1837 | 1846 | } |
1838 | 1847 | /* |
|
0 commit comments