Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
* fix controller busy issue and add 24bits segment support 
@ 2019-08-22  6:47 Chaotian Jing
  2019-08-22  6:47 ` [PATCH 1/2] mmc: mediatek: fix controller busy when plug out SD Chaotian Jing
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chaotian Jing @ 2019-08-22  6:47 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: srv_heupstream, linux-mmc, linux-kernel, linux-mediatek,
	Chaotian Jing, Matthias Brugger, linux-arm-kernel

the below 2 patches fix controller busy issue when plug out SD card
and add 24bits segment size support.

Chaotian Jing (2):
  mmc: mediatek: fix controller busy when plug out SD
  mmc: mediatek: support 24bits segment size

 drivers/mmc/host/mtk-sd.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

-- 
2.18.0



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] mmc: mediatek: fix controller busy when plug out SD
  2019-08-22  6:47 fix controller busy issue and add 24bits segment support Chaotian Jing
@ 2019-08-22  6:47 ` Chaotian Jing
  2019-08-22  6:47 ` [PATCH 2/2] mmc: mediatek: support 24bits segment size Chaotian Jing
  2019-08-22 12:13 ` fix controller busy issue and add 24bits segment support Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Chaotian Jing @ 2019-08-22  6:47 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: srv_heupstream, linux-mmc, linux-kernel, linux-mediatek,
	Chaotian Jing, Matthias Brugger, linux-arm-kernel

when plug out SD card, may get data CRC error, the MMC core will issue
CMD13 to get card status, then CMD13 timeout(due to card plug out) will
trigger CMD19 tuning, first CMD19 timeout has not call msdc_reset_hw()
and cause the next CMD19 gets controller busy.

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
---
 drivers/mmc/host/mtk-sd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 33f4b6387ef7..5cc422e5db69 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -1071,11 +1071,13 @@ static bool msdc_cmd_done(struct msdc_host *host, int events,
 	}
 
 	if (!sbc_error && !(events & MSDC_INT_CMDRDY)) {
-		if (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
-		    cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200)
+		if (events & MSDC_INT_CMDTMO ||
+		    (cmd->opcode != MMC_SEND_TUNING_BLOCK &&
+		     cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200))
 			/*
 			 * should not clear fifo/interrupt as the tune data
-			 * may have alreay come.
+			 * may have alreay come when cmd19/cmd21 gets response
+			 * CRC error.
 			 */
 			msdc_reset_hw(host);
 		if (events & MSDC_INT_RSPCRCERR) {
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] mmc: mediatek: support 24bits segment size
  2019-08-22  6:47 fix controller busy issue and add 24bits segment support Chaotian Jing
  2019-08-22  6:47 ` [PATCH 1/2] mmc: mediatek: fix controller busy when plug out SD Chaotian Jing
@ 2019-08-22  6:47 ` Chaotian Jing
  2019-08-22 12:13 ` fix controller busy issue and add 24bits segment support Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Chaotian Jing @ 2019-08-22  6:47 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: srv_heupstream, linux-mmc, linux-kernel, linux-mediatek,
	Chaotian Jing, Matthias Brugger, linux-arm-kernel

MSDC IP which support 64G DRAM will support 24bits BDMA buffer length,
so add support it.

Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
---
 drivers/mmc/host/mtk-sd.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 5cc422e5db69..4c72c5b73e87 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -328,6 +328,7 @@ struct mt_bdma_desc {
 	u32 ptr;
 	u32 bd_data_len;
 #define BDMA_DESC_BUFLEN	(0xffff) /* bit0 ~ bit15 */
+#define BDMA_DESC_BUFLEN_EXT	(0xffffff) /* bit0 ~ bit23 */
 };
 
 struct msdc_dma {
@@ -641,8 +642,14 @@ static inline void msdc_dma_setup(struct msdc_host *host, struct msdc_dma *dma,
 			bd[j].bd_info |= (upper_32_bits(dma_address) & 0xf)
 					 << 28;
 		}
-		bd[j].bd_data_len &= ~BDMA_DESC_BUFLEN;
-		bd[j].bd_data_len |= (dma_len & BDMA_DESC_BUFLEN);
+
+		if (host->dev_comp->support_64g) {
+			bd[j].bd_data_len &= ~BDMA_DESC_BUFLEN_EXT;
+			bd[j].bd_data_len |= (dma_len & BDMA_DESC_BUFLEN_EXT);
+		} else {
+			bd[j].bd_data_len &= ~BDMA_DESC_BUFLEN;
+			bd[j].bd_data_len |= (dma_len & BDMA_DESC_BUFLEN);
+		}
 
 		if (j == data->sg_count - 1) /* the last bd */
 			bd[j].bd_info |= BDMA_DESC_EOL;
@@ -2277,7 +2284,10 @@ static int msdc_drv_probe(struct platform_device *pdev)
 	mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23;
 	/* MMC core transfer sizes tunable parameters */
 	mmc->max_segs = MAX_BD_NUM;
-	mmc->max_seg_size = BDMA_DESC_BUFLEN;
+	if (host->dev_comp->support_64g)
+		mmc->max_seg_size = BDMA_DESC_BUFLEN_EXT;
+	else
+		mmc->max_seg_size = BDMA_DESC_BUFLEN;
 	mmc->max_blk_size = 2048;
 	mmc->max_req_size = 512 * 1024;
 	mmc->max_blk_count = mmc->max_req_size / 512;
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fix controller busy issue and add 24bits segment support
  2019-08-22  6:47 fix controller busy issue and add 24bits segment support Chaotian Jing
  2019-08-22  6:47 ` [PATCH 1/2] mmc: mediatek: fix controller busy when plug out SD Chaotian Jing
  2019-08-22  6:47 ` [PATCH 2/2] mmc: mediatek: support 24bits segment size Chaotian Jing
@ 2019-08-22 12:13 ` Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2019-08-22 12:13 UTC (permalink / raw)
  To: Chaotian Jing
  Cc: srv_heupstream, linux-mmc, Linux Kernel Mailing List,
	linux-mediatek, Matthias Brugger, Linux ARM

On Thu, 22 Aug 2019 at 08:47, Chaotian Jing <chaotian.jing@mediatek.com> wrote:
>
> the below 2 patches fix controller busy issue when plug out SD card
> and add 24bits segment size support.
>
> Chaotian Jing (2):
>   mmc: mediatek: fix controller busy when plug out SD
>   mmc: mediatek: support 24bits segment size
>
>  drivers/mmc/host/mtk-sd.c | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)

Applied for next, thanks!

Kind regards
Uffe

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fix controller busy issue and add 24bits segment support
  2019-06-02  1:23 ` Chaotian Jing
@ 2019-08-21 15:07   ` Ulf Hansson
  0 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2019-08-21 15:07 UTC (permalink / raw)
  To: Chaotian Jing
  Cc: srv_heupstream, linux-mmc, Linux Kernel Mailing List,
	linux-mediatek, Matthias Brugger, Linux ARM

On Sun, 2 Jun 2019 at 03:23, Chaotian Jing <chaotian.jing@mediatek.com> wrote:
>
> Hi Ulf,
>
> Gentle ping for this patch.

For some reason these patches didn't reach the patchtracker, hence I
have just not seen them.

Could you please re-post this so we can get this merged?

Kind regards
Uffe

>
> On Sun, 2019-05-19 at 15:57 +0800, Chaotian Jing wrote:
> > the below 2 patches fix controller busy issue when plug out SD card
> > and add 24bits segment size support.
> >
> > Chaotian Jing (2):
> >   mmc: mediatek: fix controller busy when plug out SD
> >   mmc: mediatek: support 24bits segment size
> >
> >  drivers/mmc/host/mtk-sd.c | 24 ++++++++++++++++++------
> >  1 file changed, 18 insertions(+), 6 deletions(-)
> >
>
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fix controller busy issue and add 24bits segment support
  2019-05-19  7:57 Chaotian Jing
@ 2019-06-02  1:23 ` Chaotian Jing
  2019-08-21 15:07   ` Ulf Hansson
  0 siblings, 1 reply; 7+ messages in thread
From: Chaotian Jing @ 2019-06-02  1:23 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: srv_heupstream, linux-mmc, linux-kernel, linux-mediatek,
	Matthias Brugger, linux-arm-kernel

Hi Ulf,

Gentle ping for this patch.

On Sun, 2019-05-19 at 15:57 +0800, Chaotian Jing wrote:
> the below 2 patches fix controller busy issue when plug out SD card
> and add 24bits segment size support.
> 
> Chaotian Jing (2):
>   mmc: mediatek: fix controller busy when plug out SD
>   mmc: mediatek: support 24bits segment size
> 
>  drivers/mmc/host/mtk-sd.c | 24 ++++++++++++++++++------
>  1 file changed, 18 insertions(+), 6 deletions(-)
> 



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

* fix controller busy issue and add 24bits segment support 
@ 2019-05-19  7:57 Chaotian Jing
  2019-06-02  1:23 ` Chaotian Jing
  0 siblings, 1 reply; 7+ messages in thread
From: Chaotian Jing @ 2019-05-19  7:57 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: srv_heupstream, linux-mmc, linux-kernel, linux-mediatek,
	Matthias Brugger, linux-arm-kernel

the below 2 patches fix controller busy issue when plug out SD card
and add 24bits segment size support.

Chaotian Jing (2):
  mmc: mediatek: fix controller busy when plug out SD
  mmc: mediatek: support 24bits segment size

 drivers/mmc/host/mtk-sd.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

-- 
1.8.1.1.dirty


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-22  6:47 fix controller busy issue and add 24bits segment support Chaotian Jing
2019-08-22  6:47 ` [PATCH 1/2] mmc: mediatek: fix controller busy when plug out SD Chaotian Jing
2019-08-22  6:47 ` [PATCH 2/2] mmc: mediatek: support 24bits segment size Chaotian Jing
2019-08-22 12:13 ` fix controller busy issue and add 24bits segment support Ulf Hansson
  -- strict thread matches above, loose matches on Subject: below --
2019-05-19  7:57 Chaotian Jing
2019-06-02  1:23 ` Chaotian Jing
2019-08-21 15:07   ` Ulf Hansson

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox