Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commit9ce2078

Browse files
committed
Merge tag 'mmc-v4.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc
Pull MMC fixes from Ulf Hansson: "A couple of MMC fixes intended for v4.16-rc7: MMC host: - dw_mmc: Fix the suspend/resume issue for Exynos5433 - dw_mmc: Fix the DTO/CTO timeout overflow calculation for 32-bit systems - dw_mmc: Make PIO mode work when failing with idmac when dw_mci_reset occurs - sdhci-acpi: Re-allow IRQ 0 to fix broken probe MMC core: - Update EXT_CSD caches to correctly switch partition for ioctl calls - Fix tracepoint print of blk_addr and blksz - Disable HPI on broken Micron (Numonyx) eMMC cards"* tag 'mmc-v4.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc: mmc: sdhci-acpi: Fix IRQ 0 mmc: dw_mmc: fix falling from idmac to PIO mode when dw_mci_reset occurs mmc: core: Fix tracepoint print of blk_addr and blksz mmc: core: Disable HPI for certain Micron (Numonyx) eMMC cards mmc: dw_mmc: exynos: fix the suspend/resume issue for exynos5433 mmc: block: fix updating ext_csd caches on ioctl call mmc: dw_mmc: Fix the DTO/CTO timeout overflow calculation for 32-bit systems
2 parents3215b9d +d58ac80 commit9ce2078

File tree

7 files changed

+46
-9
lines changed

7 files changed

+46
-9
lines changed

‎drivers/mmc/core/block.c‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ MODULE_ALIAS("mmc:block");
7272
#defineMMC_BLK_TIMEOUT_MS (10 * 1000)
7373
#defineMMC_SANITIZE_REQ_TIMEOUT 240000
7474
#defineMMC_EXTRACT_INDEX_FROM_ARG(x) ((x & 0x00FF0000) >> 16)
75+
#defineMMC_EXTRACT_VALUE_FROM_ARG(x) ((x & 0x0000FF00) >> 8)
7576

7677
#definemmc_req_rel_wr(req)((req->cmd_flags & REQ_FUA) && \
7778
(rq_data_dir(req) == WRITE))
@@ -586,6 +587,24 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
586587
returndata.error;
587588
}
588589

590+
/*
591+
* Make sure the cache of the PARTITION_CONFIG register and
592+
* PARTITION_ACCESS bits is updated in case the ioctl ext_csd write
593+
* changed it successfully.
594+
*/
595+
if ((MMC_EXTRACT_INDEX_FROM_ARG(cmd.arg)==EXT_CSD_PART_CONFIG)&&
596+
(cmd.opcode==MMC_SWITCH)) {
597+
structmmc_blk_data*main_md=dev_get_drvdata(&card->dev);
598+
u8value=MMC_EXTRACT_VALUE_FROM_ARG(cmd.arg);
599+
600+
/*
601+
* Update cache so the next mmc_blk_part_switch call operates
602+
* on up-to-date data.
603+
*/
604+
card->ext_csd.part_config=value;
605+
main_md->part_curr=value&EXT_CSD_PART_CONFIG_ACC_MASK;
606+
}
607+
589608
/*
590609
* According to the SD specs, some commands require a delay after
591610
* issuing the command.

‎drivers/mmc/core/card.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ struct mmc_fixup {
8282
#defineCID_MANFID_APACER 0x27
8383
#defineCID_MANFID_KINGSTON 0x70
8484
#defineCID_MANFID_HYNIX0x90
85+
#defineCID_MANFID_NUMONYX0xFE
8586

8687
#defineEND_FIXUP { NULL }
8788

‎drivers/mmc/core/quirks.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ static const struct mmc_fixup mmc_ext_csd_fixups[] = {
109109
*/
110110
MMC_FIXUP_EXT_CSD_REV(CID_NAME_ANY,CID_MANFID_HYNIX,
111111
0x014a,add_quirk,MMC_QUIRK_BROKEN_HPI,5),
112+
/*
113+
* Certain Micron (Numonyx) eMMC 4.5 cards might get broken when HPI
114+
* feature is used so disable the HPI feature for such buggy cards.
115+
*/
116+
MMC_FIXUP_EXT_CSD_REV(CID_NAME_ANY,CID_MANFID_NUMONYX,
117+
0x014e,add_quirk,MMC_QUIRK_BROKEN_HPI,6),
112118

113119
END_FIXUP
114120
};

‎drivers/mmc/host/dw_mmc-exynos.c‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,15 @@ static void dw_mci_exynos_set_clksel_timing(struct dw_mci *host, u32 timing)
165165
staticintdw_mci_exynos_runtime_resume(structdevice*dev)
166166
{
167167
structdw_mci*host=dev_get_drvdata(dev);
168+
intret;
169+
170+
ret=dw_mci_runtime_resume(dev);
171+
if (ret)
172+
returnret;
168173

169174
dw_mci_exynos_config_smu(host);
170-
returndw_mci_runtime_resume(dev);
175+
176+
returnret;
171177
}
172178

173179
/**

‎drivers/mmc/host/dw_mmc.c‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,9 @@ static inline void dw_mci_set_cto(struct dw_mci *host)
413413
cto_div= (mci_readl(host,CLKDIV)&0xff)*2;
414414
if (cto_div==0)
415415
cto_div=1;
416-
cto_ms=DIV_ROUND_UP(MSEC_PER_SEC*cto_clks*cto_div,host->bus_hz);
416+
417+
cto_ms=DIV_ROUND_UP_ULL((u64)MSEC_PER_SEC*cto_clks*cto_div,
418+
host->bus_hz);
417419

418420
/* add a bit spare time */
419421
cto_ms+=10;
@@ -562,6 +564,7 @@ static int dw_mci_idmac_init(struct dw_mci *host)
562564
(sizeof(structidmac_desc_64addr)*
563565
(i+1))) >>32;
564566
/* Initialize reserved and buffer size fields to "0" */
567+
p->des0=0;
565568
p->des1=0;
566569
p->des2=0;
567570
p->des3=0;
@@ -584,6 +587,7 @@ static int dw_mci_idmac_init(struct dw_mci *host)
584587
i++,p++) {
585588
p->des3=cpu_to_le32(host->sg_dma+
586589
(sizeof(structidmac_desc)* (i+1)));
590+
p->des0=0;
587591
p->des1=0;
588592
}
589593

@@ -1799,8 +1803,8 @@ static bool dw_mci_reset(struct dw_mci *host)
17991803
}
18001804

18011805
if (host->use_dma==TRANS_MODE_IDMAC)
1802-
/* It is alsorecommended that wereset and reprogram idmac */
1803-
dw_mci_idmac_reset(host);
1806+
/* It is alsorequired that wereinit idmac */
1807+
dw_mci_idmac_init(host);
18041808

18051809
ret= true;
18061810

@@ -1948,8 +1952,9 @@ static void dw_mci_set_drto(struct dw_mci *host)
19481952
drto_div= (mci_readl(host,CLKDIV)&0xff)*2;
19491953
if (drto_div==0)
19501954
drto_div=1;
1951-
drto_ms=DIV_ROUND_UP(MSEC_PER_SEC*drto_clks*drto_div,
1952-
host->bus_hz);
1955+
1956+
drto_ms=DIV_ROUND_UP_ULL((u64)MSEC_PER_SEC*drto_clks*drto_div,
1957+
host->bus_hz);
19531958

19541959
/* add a bit spare time */
19551960
drto_ms+=10;

‎drivers/mmc/host/sdhci-acpi.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
680680
host->hw_name="ACPI";
681681
host->ops=&sdhci_acpi_ops_dflt;
682682
host->irq=platform_get_irq(pdev,0);
683-
if (host->irq <=0) {
683+
if (host->irq<0) {
684684
err=-EINVAL;
685685
gotoerr_free;
686686
}

‎include/trace/events/mmc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ TRACE_EVENT(mmc_request_start,
8686
__entry->stop_flags,__entry->stop_retries,
8787
__entry->sbc_opcode,__entry->sbc_arg,
8888
__entry->sbc_flags,__entry->sbc_retries,
89-
__entry->blocks,__entry->blk_addr,
90-
__entry->blksz,__entry->data_flags,__entry->tag,
89+
__entry->blocks,__entry->blksz,
90+
__entry->blk_addr,__entry->data_flags,__entry->tag,
9191
__entry->can_retune,__entry->doing_retune,
9292
__entry->retune_now,__entry->need_retune,
9393
__entry->hold_retune,__entry->retune_period)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp