From patchwork Mon Aug 27 15:13:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10577349 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2163B1803 for ; Mon, 27 Aug 2018 15:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 102FA29546 for ; Mon, 27 Aug 2018 15:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03F0F295D8; Mon, 27 Aug 2018 15:17:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DE4D29546 for ; Mon, 27 Aug 2018 15:17:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726994AbeH0TEH (ORCPT ); Mon, 27 Aug 2018 15:04:07 -0400 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:11047 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbeH0TEH (ORCPT ); Mon, 27 Aug 2018 15:04:07 -0400 X-Halon-ID: 3bcc275e-aa0c-11e8-ab18-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 3bcc275e-aa0c-11e8-ab18-005056917a89; Mon, 27 Aug 2018 17:16:56 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Wolfram Sang , Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Masaharu Hayakawa , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= Subject: [PATCH v3 1/2] mmc: renesas_sdhi: skip SCC error check when retuning Date: Mon, 27 Aug 2018 17:13:20 +0200 Message-Id: <20180827151321.18015-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827151321.18015-1-niklas.soderlund+renesas@ragnatech.se> References: <20180827151321.18015-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Masaharu Hayakawa Checking for SCC error during retuning is unnecessary. Signed-off-by: Masaharu Hayakawa [Niklas: fix small style issue] Signed-off-by: Niklas Söderlund --- * Changes since v2 - Add comment to describe why checking SCC errors when using 4 taps is not needed. * Changes since v1 - Use intermediate variable use_4tap to simplify check. --- drivers/mmc/host/renesas_sdhi_core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c index 777e32b0e410e850..4427f0e7058f3ee5 100644 --- a/drivers/mmc/host/renesas_sdhi_core.c +++ b/drivers/mmc/host/renesas_sdhi_core.c @@ -443,6 +443,19 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host) static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host) { struct renesas_sdhi *priv = host_to_priv(host); + bool use_4tap = host->pdata->flags & TMIO_MMC_HAVE_4TAP_HS400; + + /* + * Skip checking SCC errors when running on 4 taps in HS400 mode as + * any retuning would still result in the same 4 taps being used. + */ + if (!(host->mmc->ios.timing == MMC_TIMING_UHS_SDR104) && + !(host->mmc->ios.timing == MMC_TIMING_MMC_HS200) && + !(host->mmc->ios.timing == MMC_TIMING_MMC_HS400 && !use_4tap)) + return false; + + if (host->mmc->doing_retune) + return false; /* Check SCC error */ if (sd_scc_read32(host, priv, SH_MOBILE_SDHI_SCC_RVSCNTL) & From patchwork Mon Aug 27 15:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10577353 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C87A17DE for ; Mon, 27 Aug 2018 15:17:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB62D295AD for ; Mon, 27 Aug 2018 15:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFBEE29C0D; Mon, 27 Aug 2018 15:17:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C366295AD for ; Mon, 27 Aug 2018 15:17:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726942AbeH0TEI (ORCPT ); Mon, 27 Aug 2018 15:04:08 -0400 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:9230 "EHLO vsp-unauthed02.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727005AbeH0TEI (ORCPT ); Mon, 27 Aug 2018 15:04:08 -0400 X-Halon-ID: 3cfd5c8a-aa0c-11e8-ab18-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 3cfd5c8a-aa0c-11e8-ab18-005056917a89; Mon, 27 Aug 2018 17:16:57 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: Wolfram Sang , Ulf Hansson , linux-mmc@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Masaharu Hayakawa , =?utf-8?q?Niklas_S?= =?utf-8?q?=C3=B6derlund?= Subject: [PATCH v3 2/2] mmc: tmio: Fix SCC error detection Date: Mon, 27 Aug 2018 17:13:21 +0200 Message-Id: <20180827151321.18015-3-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827151321.18015-1-niklas.soderlund+renesas@ragnatech.se> References: <20180827151321.18015-1-niklas.soderlund+renesas@ragnatech.se> MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Masaharu Hayakawa SDR104 and HS200 need to check for SCC error. If SCC error is detected, retuning is necessary. Signed-off-by: Masaharu Hayakawa [Niklas: update commit message] Signed-off-by: Niklas Söderlund --- drivers/mmc/host/tmio_mmc_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index 261b4d62d2b1061f..268c4a3b728c775f 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -919,8 +919,8 @@ static void tmio_mmc_finish_request(struct tmio_mmc_host *host) if (mrq->cmd->error || (mrq->data && mrq->data->error)) tmio_mmc_abort_dma(host); - if (host->check_scc_error) - host->check_scc_error(host); + if (host->check_scc_error && host->check_scc_error(host)) + mrq->cmd->error = -EILSEQ; /* If SET_BLOCK_COUNT, continue with main command */ if (host->mrq && !mrq->cmd->error) {