Skip to content

Commit c3af225

Browse files
committed
Merge tag 'mmc-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "MMC core: - Apply SD quirks earlier during probe so they become relevant MMC host: - cqhci: Fix checking of CQHCI_HALT state - dw_mmc: Fix IDMAC operation with pages bigger than 4K - sdhci-of-aspeed: Fix module autoloading" * tag 'mmc-v6.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: cqhci: Fix checking of CQHCI_HALT state mmc: dw_mmc: Fix IDMAC operation with pages bigger than 4K mmc: sdhci-of-aspeed: fix module autoloading mmc: core: apply SD quirks earlier during probe
2 parents 0de82f0 + aea62c7 commit c3af225

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

drivers/mmc/core/quirks.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,19 @@
1515

1616
#include "card.h"
1717

18+
static const struct mmc_fixup __maybe_unused mmc_sd_fixups[] = {
19+
/*
20+
* Kingston Canvas Go! Plus microSD cards never finish SD cache flush.
21+
* This has so far only been observed on cards from 11/2019, while new
22+
* cards from 2023/05 do not exhibit this behavior.
23+
*/
24+
_FIXUP_EXT("SD64G", CID_MANFID_KINGSTON_SD, 0x5449, 2019, 11,
25+
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
26+
MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
27+
28+
END_FIXUP
29+
};
30+
1831
static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
1932
#define INAND_CMD38_ARG_EXT_CSD 113
2033
#define INAND_CMD38_ARG_ERASE 0x00
@@ -53,15 +66,6 @@ static const struct mmc_fixup __maybe_unused mmc_blk_fixups[] = {
5366
MMC_FIXUP("MMC32G", CID_MANFID_TOSHIBA, CID_OEMID_ANY, add_quirk_mmc,
5467
MMC_QUIRK_BLK_NO_CMD23),
5568

56-
/*
57-
* Kingston Canvas Go! Plus microSD cards never finish SD cache flush.
58-
* This has so far only been observed on cards from 11/2019, while new
59-
* cards from 2023/05 do not exhibit this behavior.
60-
*/
61-
_FIXUP_EXT("SD64G", CID_MANFID_KINGSTON_SD, 0x5449, 2019, 11,
62-
0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd,
63-
MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY),
64-
6569
/*
6670
* Some SD cards lockup while using CMD23 multiblock transfers.
6771
*/

drivers/mmc/core/sd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "host.h"
2727
#include "bus.h"
2828
#include "mmc_ops.h"
29+
#include "quirks.h"
2930
#include "sd.h"
3031
#include "sd_ops.h"
3132

@@ -1475,6 +1476,9 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
14751476
goto free_card;
14761477
}
14771478

1479+
/* Apply quirks prior to card setup */
1480+
mmc_fixup_device(card, mmc_sd_fixups);
1481+
14781482
err = mmc_sd_setup_card(host, card, oldcard != NULL);
14791483
if (err)
14801484
goto free_card;

drivers/mmc/host/cqhci-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ static int cqhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
617617
cqhci_writel(cq_host, 0, CQHCI_CTL);
618618
mmc->cqe_on = true;
619619
pr_debug("%s: cqhci: CQE on\n", mmc_hostname(mmc));
620-
if (cqhci_readl(cq_host, CQHCI_CTL) && CQHCI_HALT) {
620+
if (cqhci_readl(cq_host, CQHCI_CTL) & CQHCI_HALT) {
621621
pr_err("%s: cqhci: CQE failed to exit halt state\n",
622622
mmc_hostname(mmc));
623623
}

drivers/mmc/host/dw_mmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,8 +2957,8 @@ static int dw_mci_init_slot(struct dw_mci *host)
29572957
if (host->use_dma == TRANS_MODE_IDMAC) {
29582958
mmc->max_segs = host->ring_size;
29592959
mmc->max_blk_size = 65535;
2960-
mmc->max_seg_size = 0x1000;
2961-
mmc->max_req_size = mmc->max_seg_size * host->ring_size;
2960+
mmc->max_req_size = DW_MCI_DESC_DATA_LENGTH * host->ring_size;
2961+
mmc->max_seg_size = mmc->max_req_size;
29622962
mmc->max_blk_count = mmc->max_req_size / 512;
29632963
} else if (host->use_dma == TRANS_MODE_EDMAC) {
29642964
mmc->max_segs = 64;

drivers/mmc/host/sdhci-of-aspeed.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,7 @@ static const struct of_device_id aspeed_sdhci_of_match[] = {
510510
{ .compatible = "aspeed,ast2600-sdhci", .data = &ast2600_sdhci_pdata, },
511511
{ }
512512
};
513+
MODULE_DEVICE_TABLE(of, aspeed_sdhci_of_match);
513514

514515
static struct platform_driver aspeed_sdhci_driver = {
515516
.driver = {

0 commit comments

Comments
 (0)