From patchwork Tue Dec 31 03:29:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mingming lee X-Patchwork-Id: 1216581 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.b="m1K7kLS8"; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47n0G90ZNHz9sPK for ; Tue, 31 Dec 2019 14:31:45 +1100 (AEDT) Received: from phobos.denx.de (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8A40581683; Tue, 31 Dec 2019 04:31:24 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mediatek.com header.i=@mediatek.com header.b="m1K7kLS8"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D0972816BE; Tue, 31 Dec 2019 04:31:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HTML_MESSAGE, MIME_BASE64_TEXT, RDNS_NONE, SPF_HELO_NONE, UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from mailgw02.mediatek.com (unknown [1.203.163.81]) by phobos.denx.de (Postfix) with ESMTP id 7C7CF816A7 for ; Tue, 31 Dec 2019 04:31:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=mediatek.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mingming.lee@mediatek.com X-UUID: 51b6071eae7c46a499c37fb3da028e9d-20191231 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=TRDypTT2WQ37Ax4hQSpnorHme9gxsi1JBfCVCnlohLM=; b=m1K7kLS8gitKeR//1jkOkFyCOMCWpvk4G5uNm3TgWGvXlVYL2B/mgFDNhfhILf6mNPaROYim52btzP6DxqI8MD0dvcaZ6qBPgH9V9p41AoLXwNyDmqXiz2CGzV3sKdIRQ6iTyDGvJ8OA7lXDpW0DKNtRaB+61Oii0IJKy3dxDHc=; X-UUID: 51b6071eae7c46a499c37fb3da028e9d-20191231 Received: from mtkcas35.mediatek.inc [(172.27.4.253)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 563837163; Tue, 31 Dec 2019 11:31:03 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS32N1.mediatek.inc (172.27.4.71) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 31 Dec 2019 11:30:29 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 31 Dec 2019 11:30:30 +0800 From: mingming lee To: Tom Rini Subject: [PATCH v2 7/8] mmc: mtk-sd: fix hang when data read quickly Date: Tue, 31 Dec 2019 11:29:25 +0800 Message-ID: <20191231032926.2194-8-mingming.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20191231032926.2194-1-mingming.lee@mediatek.com> References: <20191231032926.2194-1-mingming.lee@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 6EF71B6B25FAB71CBECF467832342D34D7F665A5C8AC912CF226337C05E7C9E52000:8 X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de, GSS_MTK_Uboot_upstream Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean For CMD21 tuning data, the 128/64 bytes data may coming in very short time, before msdc_start_data(), the read data has already come, in this case, clear MSDC_INT will cause the interrupt disappear and lead to the thread hang. the solution is just clear all interrupts before command was sent. Signed-off-by: mingming lee --- drivers/mmc/mtk-sd.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mmc/mtk-sd.c b/drivers/mmc/mtk-sd.c index 23413731dc..b0365877d7 100644 --- a/drivers/mmc/mtk-sd.c +++ b/drivers/mmc/mtk-sd.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -531,6 +530,7 @@ static int msdc_start_command(struct msdc_host *host, struct mmc_cmd *cmd, blocks = data->blocks; writel(CMD_INTS_MASK, &host->base->msdc_int); + writel(DATA_INTS_MASK, &host->base->msdc_int); writel(blocks, &host->base->sdc_blk_num); writel(cmd->cmdarg, &host->base->sdc_arg); writel(rawcmd, &host->base->sdc_cmd); @@ -677,13 +677,9 @@ static int msdc_start_data(struct msdc_host *host, struct mmc_data *data) u32 size; int ret; - WATCHDOG_RESET(); - if (data->flags == MMC_DATA_WRITE) host->last_data_write = 1; - writel(DATA_INTS_MASK, &host->base->msdc_int); - size = data->blocks * data->blocksize; if (data->flags == MMC_DATA_WRITE)