Skip to content

Commit a8a0811

Browse files
committed
Merge tag 'mmc-4.1-rc2' of git://git.linaro.org/people/ulf.hansson/mmc
Pull MMC fixes from Ulf Hansson: "MMC core: - Don't access RPMB partitions for normal read/write - Fix hibernation restore sequence MMC host: - dw_mmc: Fix card detection for non removable cards - dw_mmc: Fix sglist issue in 32-bit mode - sh_mmcif: Fix timeout value for command request" * tag 'mmc-4.1-rc2' of git://git.linaro.org/people/ulf.hansson/mmc: mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE mmc: dw_mmc: init desc in dw_mci_idmac_init mmc: card: Don't access RPMB partitions for normal read/write mmc: sh_mmcif: Fix timeout value for command request mmc: core: add missing pm event in mmc_pm_notify to fix hib restore
2 parents 26b293e + 4de3bf6 commit a8a0811

File tree

6 files changed

+22
-4
lines changed

6 files changed

+22
-4
lines changed

drivers/mmc/card/block.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,18 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type)
10291029
md->reset_done &= ~type;
10301030
}
10311031

1032+
int mmc_access_rpmb(struct mmc_queue *mq)
1033+
{
1034+
struct mmc_blk_data *md = mq->data;
1035+
/*
1036+
* If this is a RPMB partition access, return ture
1037+
*/
1038+
if (md && md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB)
1039+
return true;
1040+
1041+
return false;
1042+
}
1043+
10321044
static int mmc_blk_issue_discard_rq(struct mmc_queue *mq, struct request *req)
10331045
{
10341046
struct mmc_blk_data *md = mq->data;

drivers/mmc/card/queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req)
3838
return BLKPREP_KILL;
3939
}
4040

41-
if (mq && mmc_card_removed(mq->card))
41+
if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq)))
4242
return BLKPREP_KILL;
4343

4444
req->cmd_flags |= REQ_DONTPREP;

drivers/mmc/card/queue.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ extern void mmc_queue_bounce_post(struct mmc_queue_req *);
7373
extern int mmc_packed_init(struct mmc_queue *, struct mmc_card *);
7474
extern void mmc_packed_clean(struct mmc_queue *);
7575

76+
extern int mmc_access_rpmb(struct mmc_queue *);
77+
7678
#endif

drivers/mmc/core/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,6 +2651,7 @@ int mmc_pm_notify(struct notifier_block *notify_block,
26512651
switch (mode) {
26522652
case PM_HIBERNATION_PREPARE:
26532653
case PM_SUSPEND_PREPARE:
2654+
case PM_RESTORE_PREPARE:
26542655
spin_lock_irqsave(&host->lock, flags);
26552656
host->rescan_disable = 1;
26562657
spin_unlock_irqrestore(&host->lock, flags);

drivers/mmc/host/dw_mmc.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,9 +589,11 @@ static int dw_mci_idmac_init(struct dw_mci *host)
589589
host->ring_size = PAGE_SIZE / sizeof(struct idmac_desc);
590590

591591
/* Forward link the descriptor list */
592-
for (i = 0, p = host->sg_cpu; i < host->ring_size - 1; i++, p++)
592+
for (i = 0, p = host->sg_cpu; i < host->ring_size - 1; i++, p++) {
593593
p->des3 = cpu_to_le32(host->sg_dma +
594594
(sizeof(struct idmac_desc) * (i + 1)));
595+
p->des1 = 0;
596+
}
595597

596598
/* Set the last descriptor as the end-of-ring descriptor */
597599
p->des3 = cpu_to_le32(host->sg_dma);
@@ -1300,7 +1302,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
13001302
int gpio_cd = mmc_gpio_get_cd(mmc);
13011303

13021304
/* Use platform get_cd function, else try onboard card detect */
1303-
if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
1305+
if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
1306+
(mmc->caps & MMC_CAP_NONREMOVABLE))
13041307
present = 1;
13051308
else if (!IS_ERR_VALUE(gpio_cd))
13061309
present = gpio_cd;

drivers/mmc/host/sh_mmcif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
14081408
host = mmc_priv(mmc);
14091409
host->mmc = mmc;
14101410
host->addr = reg;
1411-
host->timeout = msecs_to_jiffies(1000);
1411+
host->timeout = msecs_to_jiffies(10000);
14121412
host->ccs_enable = !pd || !pd->ccs_unsupported;
14131413
host->clk_ctrl2_enable = pd && pd->clk_ctrl2_present;
14141414

0 commit comments

Comments
 (0)