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

Commit47b7de2

Browse files
EvgeniiDidinstorulf
authored andcommitted
mmc: dw_mmc: fix falling from idmac to PIO mode when dw_mci_reset occurs
It was found that in IDMAC mode after soft-reset driver switchesto PIO mode.That's what happens in case of DTO timeout overflow calculation failure:1. soft-reset is called2. driver restarts dma3. descriptors states are checked, one of descriptor is owned by the IDMAC.4. driver can't use DMA and then switches to PIO mode.Failure was already fixed in:https://www.spinics.net/lists/linux-mmc/msg48125.html.Behaviour while soft-reset is not something we except oreven want to happen. So we switch from dw_mci_idmac_resetto dw_mci_idmac_init, so descriptors are cleaned before starting dma.And while at it explicitly zero des0 which otherwise mightcontain garbage as being allocated by dmam_alloc_coherent().Signed-off-by: Evgeniy Didin <Evgeniy.Didin@synopsys.com>Cc: Jaehoon Chung <jh80.chung@samsung.com>Cc: Ulf Hansson <ulf.hansson@linaro.org>Cc: Andy Shevchenko <andy.shevchenko@gmail.com>Cc: Jisheng Zhang <Jisheng.Zhang@synaptics.com>Cc: Shawn Lin <shawn.lin@rock-chips.com>Cc: Alexey Brodkin <abrodkin@synopsys.com>Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>Cc: linux-snps-arc@lists.infradead.orgCc: <stable@vger.kernel.org> # 4.4+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parentc658dc5 commit47b7de2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎drivers/mmc/host/dw_mmc.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ static int dw_mci_idmac_init(struct dw_mci *host)
564564
(sizeof(structidmac_desc_64addr)*
565565
(i+1))) >>32;
566566
/* Initialize reserved and buffer size fields to "0" */
567+
p->des0=0;
567568
p->des1=0;
568569
p->des2=0;
569570
p->des3=0;
@@ -586,6 +587,7 @@ static int dw_mci_idmac_init(struct dw_mci *host)
586587
i++,p++) {
587588
p->des3=cpu_to_le32(host->sg_dma+
588589
(sizeof(structidmac_desc)* (i+1)));
590+
p->des0=0;
589591
p->des1=0;
590592
}
591593

@@ -1801,8 +1803,8 @@ static bool dw_mci_reset(struct dw_mci *host)
18011803
}
18021804

18031805
if (host->use_dma==TRANS_MODE_IDMAC)
1804-
/* It is alsorecommended that wereset and reprogram idmac */
1805-
dw_mci_idmac_reset(host);
1806+
/* It is alsorequired that wereinit idmac */
1807+
dw_mci_idmac_init(host);
18061808

18071809
ret= true;
18081810

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp