Message ID | 20221111084214.14822-2-wenchao.chen666@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp621625wru; Fri, 11 Nov 2022 00:45:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf53/xKnNmorUJVGNGIzG7qdGcj1JNpZ/IySPio9icLautvbb3wIiaRQcqokvdJic6bO6kEz X-Received: by 2002:a05:6a00:4ac1:b0:571:8e12:3ad3 with SMTP id ds1-20020a056a004ac100b005718e123ad3mr1551549pfb.71.1668156315853; Fri, 11 Nov 2022 00:45:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668156315; cv=none; d=google.com; s=arc-20160816; b=OzrId4XEL9h+LQgVu6kHHFoBOXuTvXC7mppTDjQUBwnnbVTBmCXQDhvEI4VKLBEOul GzzBVvqoZI+tMjlLVGq+Z3oOrBsjWLhn3wjDW2N4hIPkA6a9zZhhGGyk5np2iBH3S/2g pydtj/viCdPdep1kHGV+CPOXU7Pkcs3AoTATmZBbf36XT2V0SHZBT7RPJsOsrHljpLCb wjvTAERssfS3ntg4MOL+h+IiJlVJwBVncVebIiYXYMklrlo/7bNz6xAMgdppZNKe4R4U czNZzjJYFeOAcVTN8X7zNzgegsbE5zeX5AcBGHeY4N4csLZq5ESvEVV4T7VBA3LIa0o/ 8MVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=ufORKQiDl3My/Sxu75qdEz6doPHgCGMva2vtUdxxbeA=; b=08fGSw6vcp+5AoQHwT5em5rd7JLg5XnSNI9kZ7+zKBj1ukULOHz4M+YcN6n4jK5CH0 iXZ8PFASvCe36xaY8sY/TfO3prLCftJt1ZswPSIOyrzHzWv5rRm0tRm9hg3NZB4D/xLk LpV2oV9RNuIYsAiReLkR51N121B7B3xJdBaOKnf+BuxiMn0ORu4hDJkTyfSm5gy3HQXS RBo6DooBVKZPsUhnnwsEHAmLnIUQqPi/NXnncOIr05yVp273HBHvUZV43l941MY1N7D/ Dr2RjAeef9HvOtCmg+ixeXMpGdi0g2aYhhIGI7Y36i55DBegOqR1V0CpD4sIUjWQETrE 1ScA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=W3r+pgs2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k5-20020a63ff05000000b0046b03475683si1491859pgi.831.2022.11.11.00.45.02; Fri, 11 Nov 2022 00:45:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=W3r+pgs2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233203AbiKKImk (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Fri, 11 Nov 2022 03:42:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbiKKImd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 11 Nov 2022 03:42:33 -0500 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE1787C8E0; Fri, 11 Nov 2022 00:42:31 -0800 (PST) Received: by mail-pg1-x529.google.com with SMTP id f63so3912165pgc.2; Fri, 11 Nov 2022 00:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ufORKQiDl3My/Sxu75qdEz6doPHgCGMva2vtUdxxbeA=; b=W3r+pgs2MlYxwca0+X2vjtRr3xGo9WWBLk66EM4nZszDGwA9k3X4Cx5zV0JMtCtK/x gKDp3ly99dd94fdpuNOQlwX789Sdd/Vu4gYV+dt7zvYOW6det3p5Tfiw893I8ra/YFQ1 rAbstYYE7TBuIFQjT+uKfW988qXRPCLoTUv1NG7j/1tmCX5RO8Ruqexf4zvLHD1N7j44 pYysl+s90nMEnpIZixCgj1isKAPP/EhDvrLd417NOo3p8PXrOxFl0T6nNAT1DOvk8SWV niuKCVWbB3xCUW03Sel2Vsaovs9YoksX63BCG6EaLRUiwyJdO/Z9YwPIsFA5swZGqrVt z2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ufORKQiDl3My/Sxu75qdEz6doPHgCGMva2vtUdxxbeA=; b=dsoykX853ya+nsgWVVF8KzCCJkk144FLl38fDeUjHkhhGScUeI0F1qJD+/wgcF4tYH nAzgJpa6Rfiny7Hez0os8KC91L3c/YdNGQ5WJOEE5yBW1Wh4VSIIrHHFqQBBRlXuEA1b HLFiohmf7TNq5WbAy0+X7qky9FemCVavvkJRkmX829rzzjBoVnGCRt6hy5teLA/68uIR Y3h6xxOEMPczd1WoLeQlPOpbb0Bsj+uFnHPPRYCAoIU+EVeQlzmlL5eaodRDX0wwS8Gm ljLbZKrm/VLMhLd/ACF8MfXV4lL4Y8toNmJ5hYDKpBhfcIXGkzz5/3isZ6839O/aGDf7 uYmA== X-Gm-Message-State: ANoB5pnde3Vhdx3GceEa+WFXimAFJvBgiB1VCHQB0YtxkkNF38TeZk86 2T9Po7U62gG22hdRTybKO9g= X-Received: by 2002:aa7:970d:0:b0:56b:823d:e3b5 with SMTP id a13-20020aa7970d000000b0056b823de3b5mr1544074pfg.81.1668156151494; Fri, 11 Nov 2022 00:42:31 -0800 (PST) Received: from xm06403pcu.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id l5-20020a170903244500b00186f81a074fsm1088731pls.290.2022.11.11.00.42.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 00:42:31 -0800 (PST) From: Wenchao Chen <wenchao.chen666@gmail.com> To: ulf.hansson@linaro.org, adrian.hunter@intel.com Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, megoo.tang@gmail.com, lzx.stg@gmail.com Subject: [PATCH 1/1] mmc: sdhci: Fixed too many logs being printed during tuning Date: Fri, 11 Nov 2022 16:42:14 +0800 Message-Id: <20221111084214.14822-2-wenchao.chen666@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221111084214.14822-1-wenchao.chen666@gmail.com> References: <20221111084214.14822-1-wenchao.chen666@gmail.com> X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749188677309939707?= X-GMAIL-MSGID: =?utf-8?q?1749188677309939707?= |
Series |
mmc: Reduce tuning log output
|
|
Commit Message
Wenchao Chen
Nov. 11, 2022, 8:42 a.m. UTC
From: Wenchao Chen <wenchao.chen@unisoc.com> During the HS200 tuning process, too many tuning errors are printed in the log. Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> --- drivers/mmc/host/sdhci.c | 4 ++++ 1 file changed, 4 insertions(+)
Comments
On Fri, 11 Nov 2022 at 09:42, Wenchao Chen <wenchao.chen666@gmail.com> wrote: > > From: Wenchao Chen <wenchao.chen@unisoc.com> > > During the HS200 tuning process, too many tuning errors are printed in > the log. > > Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> > --- > drivers/mmc/host/sdhci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index fef03de85b99..a503b54305eb 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > if (host->pending_reset) > return; > > + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); > + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) > + return; > + Please use mmc_op_tuning() instead of open-coding this. I also need an ack from Adrian to apply this. > pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", > mmc_hostname(host->mmc), (unsigned)intmask); > sdhci_err_stats_inc(host, UNEXPECTED_IRQ); > -- > 2.17.1 > Kind regards Uffe
On 11/11/22 10:42, Wenchao Chen wrote: > From: Wenchao Chen <wenchao.chen@unisoc.com> > > During the HS200 tuning process, too many tuning errors are printed in > the log. > > Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> > --- > drivers/mmc/host/sdhci.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index fef03de85b99..a503b54305eb 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > if (host->pending_reset) > return; > > + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); > + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) > + return; Normally we wouldn't get here even if a request got an error because then we either reset the data circuit which should stop further interrupts, or set host->pending_reset. Can you elaborate on what is going wrong? > + > pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", > mmc_hostname(host->mmc), (unsigned)intmask); > sdhci_err_stats_inc(host, UNEXPECTED_IRQ);
On Wed, Nov 16, 2022 at 11:21 PM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > On Fri, 11 Nov 2022 at 09:42, Wenchao Chen <wenchao.chen666@gmail.com> wrote: > > > > From: Wenchao Chen <wenchao.chen@unisoc.com> > > > > During the HS200 tuning process, too many tuning errors are printed in > > the log. > > > > Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> > > --- > > drivers/mmc/host/sdhci.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > > index fef03de85b99..a503b54305eb 100644 > > --- a/drivers/mmc/host/sdhci.c > > +++ b/drivers/mmc/host/sdhci.c > > @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > > if (host->pending_reset) > > return; > > > > + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); > > + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) > > + return; > > + > > Please use mmc_op_tuning() instead of open-coding this. I also need an > ack from Adrian to apply this. Thank you for your review, I will update the next version. > > > pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", > > mmc_hostname(host->mmc), (unsigned)intmask); > > sdhci_err_stats_inc(host, UNEXPECTED_IRQ); > > -- > > 2.17.1 > > > > Kind regards > Uffe
On Thu, Nov 17, 2022 at 12:00 AM Adrian Hunter <adrian.hunter@intel.com> wrote: > > On 11/11/22 10:42, Wenchao Chen wrote: > > From: Wenchao Chen <wenchao.chen@unisoc.com> > > > > During the HS200 tuning process, too many tuning errors are printed in > > the log. > > > > Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> > > --- > > drivers/mmc/host/sdhci.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > > index fef03de85b99..a503b54305eb 100644 > > --- a/drivers/mmc/host/sdhci.c > > +++ b/drivers/mmc/host/sdhci.c > > @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > > if (host->pending_reset) > > return; > > > > + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); > > + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) > > + return; > > Normally we wouldn't get here even if a request got an error because > then we either reset the data circuit which should stop further > interrupts, or set host->pending_reset. > > Can you elaborate on what is going wrong? > Hi adrian 1. In the process of tuning, not all tuning values are good, some tuning values may cause errors, and these errors print too many logs. Of course, we reset the cmdline or dataline on error. 2. use host->pending_reset = true static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) { ... if (sdhci_needs_reset(host, mrq)) host->pending_reset = true; ... } But intmask = 0x00200000 static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) { ... if (!host->data) { struct mmc_command *data_cmd = host->data_cmd; if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { if (intmask & SDHCI_INT_DATA_TIMEOUT) { //#define SDHCI_INT_DATA_TIMEOUT 0x00100000 host->data_cmd = NULL; data_cmd->error = -ETIMEDOUT; sdhci_err_stats_inc(host, CMD_TIMEOUT); __sdhci_finish_mrq(host, data_cmd->mrq);//<= return; } if (intmask & SDHCI_INT_DATA_END) { //#define SDHCI_INT_DATA_END 0x00000002 host->data_cmd = NULL; /* * Some cards handle busy-end interrupt * before the command completed, so make * sure we do things in the proper order. */ if (host->cmd == data_cmd) return; __sdhci_finish_mrq(host, data_cmd->mrq);//<= return; } } ... if (host->pending_reset) return; pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", mmc_hostname(host->mmc), (unsigned)intmask); sdhci_err_stats_inc(host, UNEXPECTED_IRQ); sdhci_dumpregs(host); return; } ... } > > + > > pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", > > mmc_hostname(host->mmc), (unsigned)intmask); > > sdhci_err_stats_inc(host, UNEXPECTED_IRQ); >
On 18/11/22 11:25, Wenchao Chen wrote: > On Thu, Nov 17, 2022 at 12:00 AM Adrian Hunter <adrian.hunter@intel.com> wrote: >> >> On 11/11/22 10:42, Wenchao Chen wrote: >>> From: Wenchao Chen <wenchao.chen@unisoc.com> >>> >>> During the HS200 tuning process, too many tuning errors are printed in >>> the log. >>> >>> Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> >>> --- >>> drivers/mmc/host/sdhci.c | 4 ++++ >>> 1 file changed, 4 insertions(+) >>> >>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >>> index fef03de85b99..a503b54305eb 100644 >>> --- a/drivers/mmc/host/sdhci.c >>> +++ b/drivers/mmc/host/sdhci.c >>> @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) >>> if (host->pending_reset) >>> return; >>> >>> + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); >>> + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) >>> + return; >> >> Normally we wouldn't get here even if a request got an error because >> then we either reset the data circuit which should stop further >> interrupts, or set host->pending_reset. >> >> Can you elaborate on what is going wrong? >> > Hi adrian > 1. In the process of tuning, not all tuning values are good, some > tuning values may cause errors, and these errors print too many logs. > Of course, we reset the cmdline or dataline on error. > 2. use host->pending_reset = true > static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) > { > ... > if (sdhci_needs_reset(host, mrq)) > host->pending_reset = true; > ... > } > > But intmask = 0x00200000 > static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > { > ... > if (!host->data) { > struct mmc_command *data_cmd = host->data_cmd; > > if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { > if (intmask & SDHCI_INT_DATA_TIMEOUT) { //#define > SDHCI_INT_DATA_TIMEOUT 0x00100000 > host->data_cmd = NULL; > data_cmd->error = -ETIMEDOUT; > sdhci_err_stats_inc(host, CMD_TIMEOUT); > __sdhci_finish_mrq(host, data_cmd->mrq);//<= > return; > } > if (intmask & SDHCI_INT_DATA_END) { //#define SDHCI_INT_DATA_END 0x00000002 > > host->data_cmd = NULL; > /* > * Some cards handle busy-end interrupt > * before the command completed, so make > * sure we do things in the proper order. > */ > if (host->cmd == data_cmd) > return; > > __sdhci_finish_mrq(host, data_cmd->mrq);//<= > return; > } > } > ... > if (host->pending_reset) > return; > > pr_err("%s: Got data interrupt 0x%08x even though no data operation > was in progress.\n", > mmc_hostname(host->mmc), (unsigned)intmask); > sdhci_err_stats_inc(host, UNEXPECTED_IRQ); > sdhci_dumpregs(host); > > return; > } > ... > } Not really following that I'm sorry. Are you saying you get a data interrupt after he data circuit is reset? > >>> + >>> pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", >>> mmc_hostname(host->mmc), (unsigned)intmask); >>> sdhci_err_stats_inc(host, UNEXPECTED_IRQ); >>
On Fri, Nov 18, 2022 at 11:57 PM Adrian Hunter <adrian.hunter@intel.com> wrote: > > On 18/11/22 11:25, Wenchao Chen wrote: > > On Thu, Nov 17, 2022 at 12:00 AM Adrian Hunter <adrian.hunter@intel.com> wrote: > >> > >> On 11/11/22 10:42, Wenchao Chen wrote: > >>> From: Wenchao Chen <wenchao.chen@unisoc.com> > >>> > >>> During the HS200 tuning process, too many tuning errors are printed in > >>> the log. > >>> > >>> Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> > >>> --- > >>> drivers/mmc/host/sdhci.c | 4 ++++ > >>> 1 file changed, 4 insertions(+) > >>> > >>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > >>> index fef03de85b99..a503b54305eb 100644 > >>> --- a/drivers/mmc/host/sdhci.c > >>> +++ b/drivers/mmc/host/sdhci.c > >>> @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > >>> if (host->pending_reset) > >>> return; > >>> > >>> + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); > >>> + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) > >>> + return; > >> > >> Normally we wouldn't get here even if a request got an error because > >> then we either reset the data circuit which should stop further > >> interrupts, or set host->pending_reset. > >> > >> Can you elaborate on what is going wrong? > >> > > Hi adrian > > 1. In the process of tuning, not all tuning values are good, some > > tuning values may cause errors, and these errors print too many logs. > > Of course, we reset the cmdline or dataline on error. > > 2. use host->pending_reset = true > > static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) > > { > > ... > > if (sdhci_needs_reset(host, mrq)) > > host->pending_reset = true; > > ... > > } > > > > But intmask = 0x00200000 > > static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) > > { > > ... > > if (!host->data) { > > struct mmc_command *data_cmd = host->data_cmd; > > > > if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { > > if (intmask & SDHCI_INT_DATA_TIMEOUT) { //#define > > SDHCI_INT_DATA_TIMEOUT 0x00100000 > > host->data_cmd = NULL; > > data_cmd->error = -ETIMEDOUT; > > sdhci_err_stats_inc(host, CMD_TIMEOUT); > > __sdhci_finish_mrq(host, data_cmd->mrq);//<= > > return; > > } > > if (intmask & SDHCI_INT_DATA_END) { //#define SDHCI_INT_DATA_END 0x00000002 > > > > host->data_cmd = NULL; > > /* > > * Some cards handle busy-end interrupt > > * before the command completed, so make > > * sure we do things in the proper order. > > */ > > if (host->cmd == data_cmd) > > return; > > > > __sdhci_finish_mrq(host, data_cmd->mrq);//<= > > return; > > } > > } > > ... > > if (host->pending_reset) > > return; > > > > pr_err("%s: Got data interrupt 0x%08x even though no data operation > > was in progress.\n", > > mmc_hostname(host->mmc), (unsigned)intmask); > > sdhci_err_stats_inc(host, UNEXPECTED_IRQ); > > sdhci_dumpregs(host); > > > > return; > > } > > ... > > } > > Not really following that I'm sorry. > > Are you saying you get a data interrupt after he data circuit is reset? > No. During the tuning process, sdhci_data_irq does not skip printing because the interrupt state is 0x00200000 (DATA CRC ERROR). > > > >>> + > >>> pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", > >>> mmc_hostname(host->mmc), (unsigned)intmask); > >>> sdhci_err_stats_inc(host, UNEXPECTED_IRQ); > >> >
On 21/11/22 05:11, Wenchao Chen wrote: > On Fri, Nov 18, 2022 at 11:57 PM Adrian Hunter <adrian.hunter@intel.com> wrote: >> >> On 18/11/22 11:25, Wenchao Chen wrote: >>> On Thu, Nov 17, 2022 at 12:00 AM Adrian Hunter <adrian.hunter@intel.com> wrote: >>>> >>>> On 11/11/22 10:42, Wenchao Chen wrote: >>>>> From: Wenchao Chen <wenchao.chen@unisoc.com> >>>>> >>>>> During the HS200 tuning process, too many tuning errors are printed in >>>>> the log. >>>>> >>>>> Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com> >>>>> --- >>>>> drivers/mmc/host/sdhci.c | 4 ++++ >>>>> 1 file changed, 4 insertions(+) >>>>> >>>>> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c >>>>> index fef03de85b99..a503b54305eb 100644 >>>>> --- a/drivers/mmc/host/sdhci.c >>>>> +++ b/drivers/mmc/host/sdhci.c >>>>> @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) >>>>> if (host->pending_reset) >>>>> return; >>>>> >>>>> + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); >>>>> + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) >>>>> + return; >>>> >>>> Normally we wouldn't get here even if a request got an error because >>>> then we either reset the data circuit which should stop further >>>> interrupts, or set host->pending_reset. >>>> >>>> Can you elaborate on what is going wrong? >>>> >>> Hi adrian >>> 1. In the process of tuning, not all tuning values are good, some >>> tuning values may cause errors, and these errors print too many logs. >>> Of course, we reset the cmdline or dataline on error. >>> 2. use host->pending_reset = true >>> static void __sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq) >>> { >>> ... >>> if (sdhci_needs_reset(host, mrq)) >>> host->pending_reset = true; >>> ... >>> } >>> >>> But intmask = 0x00200000 >>> static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) >>> { >>> ... >>> if (!host->data) { >>> struct mmc_command *data_cmd = host->data_cmd; >>> >>> if (data_cmd && (data_cmd->flags & MMC_RSP_BUSY)) { >>> if (intmask & SDHCI_INT_DATA_TIMEOUT) { //#define >>> SDHCI_INT_DATA_TIMEOUT 0x00100000 >>> host->data_cmd = NULL; >>> data_cmd->error = -ETIMEDOUT; >>> sdhci_err_stats_inc(host, CMD_TIMEOUT); >>> __sdhci_finish_mrq(host, data_cmd->mrq);//<= >>> return; >>> } >>> if (intmask & SDHCI_INT_DATA_END) { //#define SDHCI_INT_DATA_END 0x00000002 >>> >>> host->data_cmd = NULL; >>> /* >>> * Some cards handle busy-end interrupt >>> * before the command completed, so make >>> * sure we do things in the proper order. >>> */ >>> if (host->cmd == data_cmd) >>> return; >>> >>> __sdhci_finish_mrq(host, data_cmd->mrq);//<= >>> return; >>> } >>> } >>> ... >>> if (host->pending_reset) >>> return; >>> >>> pr_err("%s: Got data interrupt 0x%08x even though no data operation >>> was in progress.\n", >>> mmc_hostname(host->mmc), (unsigned)intmask); >>> sdhci_err_stats_inc(host, UNEXPECTED_IRQ); >>> sdhci_dumpregs(host); >>> >>> return; >>> } >>> ... >>> } >> >> Not really following that I'm sorry. >> >> Are you saying you get a data interrupt after he data circuit is reset? >> > > No. During the tuning process, sdhci_data_irq does not skip printing > because the interrupt state is 0x00200000 (DATA CRC ERROR). Sorry I am still confused. Which driver is this? I was assuming you were using mmc_send_tuning() because the only interrupt enabled for regular SDHCI tuning is SDHCI_INT_DATA_AVAIL (0x00000020). So are you saying you are getting status 0x00200000 even though the mask is 0x00000020 ? > >>> >>>>> + >>>>> pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", >>>>> mmc_hostname(host->mmc), (unsigned)intmask); >>>>> sdhci_err_stats_inc(host, UNEXPECTED_IRQ); >>>> >>
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index fef03de85b99..a503b54305eb 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3401,6 +3401,10 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) if (host->pending_reset) return; + command = SDHCI_GET_CMD(sdhci_readw(host, SDHCI_COMMAND)); + if (command == MMC_SEND_TUNING_BLOCK || command == MMC_SEND_TUNING_BLOCK_HS200) + return; + pr_err("%s: Got data interrupt 0x%08x even though no data operation was in progress.\n", mmc_hostname(host->mmc), (unsigned)intmask); sdhci_err_stats_inc(host, UNEXPECTED_IRQ);