Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1510947ybz; Thu, 16 Apr 2020 10:25:00 -0700 (PDT) X-Google-Smtp-Source: APiQypKhoAhjQatXWDymcFiT9km2w2X8LsOVOmNOY6T8YQFbMQuQgoszW+9vu4wh96bpmMYm9ghu X-Received: by 2002:a50:e8cb:: with SMTP id l11mr2575360edn.174.1587057899964; Thu, 16 Apr 2020 10:24:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587057899; cv=none; d=google.com; s=arc-20160816; b=U41Z9IBgYd22XM9H42ejOIQqof7ig8pclr2T0akk6cHJInTulezMzAy8SSpZS8xnvO vil6QFRe5i8W/KmAw8KkpXm2SYMPJFX1ZZr9VK1z6qatZpEsi3CaFsomHcn3PIQzX9RP R+weLDMwc9Q1KKdyj229NQA6qXWxyyZMX1hBjK4/mtZoSB8ht5ho1CQsoaa+dxSs6uUv UpxG+z6SLlQ1/ogtAtuk5W0w7/6MtUC5N+u1Hzzs8vhmIm5gFITqygJE+iniw/8n/e5m ZY+2w6eguY6+d6p/ORaf/iLQVTKgXhhsSdl+9yWjEFhfzSkE2HC8j/sSlQ23TDpmbtHn qzlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=p/NQn3x2dQrPgmua+MkXZ2CPgsicQ89yPGaFimgDCmY=; b=P8kr7DCFtD8MLXdMUASKc8XD/QnEKA85EhC4f5Hl3PurfNQ5JRPExBeEpNc/pNc+cF 6qlem4faDxBr4JfiH3t0VmMQ7a/1eGCJVtlAuLtbBNvj5AoQpKJRU9kPpy02QkFQRbs3 HSMLeaxnixMnfugjx1bVJ6NEvxALyEVZLpQZs0seDHsVa5I+ShORsI+Hq3UNYtfgT6+a PqD47/riNpzKsGtD8MK8vAN54GkIUMqH1uHeovBv6vXxijkM2tf/VJxc1KV8vBEbiRub vFgFU2dRFZTKYOIiJASVgHKnn077lUb1YnesIj2EcrxRH/sXfMr0c01UuS1S6l0tDt88 iZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H1PRjyup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d17si728463ejh.334.2020.04.16.10.24.36; Thu, 16 Apr 2020 10:24:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H1PRjyup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505923AbgDPLju (ORCPT + 99 others); Thu, 16 Apr 2020 07:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505925AbgDPK7n (ORCPT ); Thu, 16 Apr 2020 06:59:43 -0400 Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 615BDC025481 for ; Thu, 16 Apr 2020 03:59:43 -0700 (PDT) Received: by mail-ua1-x941.google.com with SMTP id c24so2031686uap.13 for ; Thu, 16 Apr 2020 03:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=p/NQn3x2dQrPgmua+MkXZ2CPgsicQ89yPGaFimgDCmY=; b=H1PRjyupkz+ecVblYlD5uZ6r4HV5zKCOh+pkNDaV9amQ+qoxu3nkqACQli5ciwIiPE RZYTRcRro5ZMqNbQf4/M1vESYaAobmD4nNuC0g72XoFTuHA9BzE6oyn5+UZPvtNAlJEW ie/Lt169KGZ57WHaUv2tfQZD62uiHLfBim1YFbVgseXfc9JvQkfriTgSS7/0211ybdZR vY785wUltPwG3+Y3GOoKYBsPOR6lhKm25CiMM1z+OitCgs5fCmLii0es72sWXK7AhmWu v4PzLn8cVZR22flguxUivk/kqmXVeFMLyegDsuJNhiW5y+CWuztKa+zfIYH2w41QuLYZ TDog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=p/NQn3x2dQrPgmua+MkXZ2CPgsicQ89yPGaFimgDCmY=; b=oyYQub1GCeMFupvvUYOBynyk2ie9dEIOLXFvLBsGhNiHTvHExPs+9oJcg/6PMBbgZ+ Hc6pUGLcIjQrs0prdYZ/z0TwNMUq/LYPVdT0Z0SjmeGFgzEIPeh43cQUqwwAOppBQR6f TH32EN00T0xCjbrw5MnhHbbXtyIUzmddOE06wwcyOZtrN+q6vMR9Z2eoplAMLnT0fuVE 35P0UvxKcP187L+KavMwB2kJoNxlXSStTNtJgvDOSSZFLkNMm/eYhrWf9ZM6RsjwHBxj vYpfw1TyIdpM7MdhiPwf5kwH+FrCOoTIf4eXJ1JWokzvA3vTqFq7xEpJYd06fxJTzygZ AxRg== X-Gm-Message-State: AGi0PuYqzgzbhpcHuMbviI87PUOI97Lmlk5hpOK4stmF85nrxuAV8+hR cEqfXJylNNtd4RJJgvrfc3h9070ZdJZNNKBACd1b+A== X-Received: by 2002:ab0:2ea:: with SMTP id 97mr8516870uah.129.1587034782283; Thu, 16 Apr 2020 03:59:42 -0700 (PDT) MIME-Version: 1.0 References: <1583886030-11339-1-git-send-email-skomatineni@nvidia.com> In-Reply-To: From: Ulf Hansson Date: Thu, 16 Apr 2020 12:59:06 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] sdhci: tegra: Implement Tegra specific set_timeout callback To: Naresh Kamboju , Greg Kroah-Hartman , Sasha Levin , Sowjanya Komatineni Cc: Adrian Hunter , "(Exiting) Baolin Wang" , Kate Stewart , Thomas Gleixner , Bradley Bolen , Thierry Reding , Jon Hunter , Aniruddha Tvs Rao , linux-tegra , open list , "linux-mmc@vger.kernel.org" , lkft-triage@lists.linaro.org, linux- stable Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Apr 2020 at 19:55, Naresh Kamboju wrote: > > On Fri, 13 Mar 2020 at 06:41, Sowjanya Komatineni > wrote: > > > > Tegra host supports HW busy detection and timeouts based on the > > count programmed in SDHCI_TIMEOUT_CONTROL register and max busy > > timeout it supports is 11s in finite busy wait mode. > > > > Some operations like SLEEP_AWAKE, ERASE and flush cache through > > SWITCH commands take longer than 11s and Tegra host supports > > infinite HW busy wait mode where HW waits forever till the card > > is busy without HW timeout. > > > > This patch implements Tegra specific set_timeout sdhci_ops to allow > > switching between finite and infinite HW busy detection wait modes > > based on the device command expected operation time. > > > > Signed-off-by: Sowjanya Komatineni > > --- > > drivers/mmc/host/sdhci-tegra.c | 31 +++++++++++++++++++++++++++++++ > > 1 file changed, 31 insertions(+) > > > > diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c > > index a25c3a4..fa8f6a4 100644 > > --- a/drivers/mmc/host/sdhci-tegra.c > > +++ b/drivers/mmc/host/sdhci-tegra.c > > @@ -45,6 +45,7 @@ > > #define SDHCI_TEGRA_CAP_OVERRIDES_DQS_TRIM_SHIFT 8 > > > > #define SDHCI_TEGRA_VENDOR_MISC_CTRL 0x120 > > +#define SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT BIT(0) > > #define SDHCI_MISC_CTRL_ENABLE_SDR104 0x8 > > > #define SDHCI_MISC_CTRL_ENABLE_SDR50 0x10 > > #define SDHCI_MISC_CTRL_ENABLE_SDHCI_SPEC_300 0x20 > > @@ -1227,6 +1228,34 @@ static u32 sdhci_tegra_cqhci_irq(struct sdhci_host *host, u32 intmask) > > return 0; > > } > > > > +static void tegra_sdhci_set_timeout(struct sdhci_host *host, > > + struct mmc_command *cmd) > > +{ > > + u32 val; > > + > > + /* > > + * HW busy detection timeout is based on programmed data timeout > > + * counter and maximum supported timeout is 11s which may not be > > + * enough for long operations like cache flush, sleep awake, erase. > > + * > > + * ERASE_TIMEOUT_LIMIT bit of VENDOR_MISC_CTRL register allows > > + * host controller to wait for busy state until the card is busy > > + * without HW timeout. > > + * > > + * So, use infinite busy wait mode for operations that may take > > + * more than maximum HW busy timeout of 11s otherwise use finite > > + * busy wait mode. > > + */ > > + val = sdhci_readl(host, SDHCI_TEGRA_VENDOR_MISC_CTRL); > > + if (cmd && cmd->busy_timeout >= 11 * HZ) > > + val |= SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT; > > + else > > + val &= ~SDHCI_MISC_CTRL_ERASE_TIMEOUT_LIMIT; > > + sdhci_writel(host, val, SDHCI_TEGRA_VENDOR_MISC_CTRL); > > + > > + __sdhci_set_timeout(host, cmd); > > kernel build on arm and arm64 architecture failed on stable-rc 4.19 > (arm), 5.4 (arm64) and 5.5 (arm64) > > drivers/mmc/host/sdhci-tegra.c: In function 'tegra_sdhci_set_timeout': > drivers/mmc/host/sdhci-tegra.c:1256:2: error: implicit declaration of > function '__sdhci_set_timeout'; did you mean > 'tegra_sdhci_set_timeout'? [-Werror=implicit-function-declaration] > __sdhci_set_timeout(host, cmd); > ^~~~~~~~~~~~~~~~~~~ > tegra_sdhci_set_timeout > > Full build log, > https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.5/DISTRO=lkft,MACHINE=am57xx-evm,label=docker-lkft/83/consoleText > https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-5.4/DISTRO=lkft,MACHINE=juno,label=docker-lkft/158/consoleText > https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-4.19/DISTRO=lkft,MACHINE=am57xx-evm,label=docker-lkft/511/consoleText > > - Naresh Thanks for reporting! What a mess. It turns out that the commit that was queued for stable that is causing the above errors, also requires another commit. The commit that was queued: 5e958e4aacf4 ("sdhci: tegra: Implement Tegra specific set_timeout callback") The additional commit needed (which was added in v5.6-rc1): 7d76ed77cfbd ("mmc: sdhci: Refactor sdhci_set_timeout()") However, the above commit needs a manual backport (quite trivial, but still) for the relevant stable kernels, to allow it to solve the build problems. Greg, Sasha - I suggest you to drop the offending commit from the stable kernels, for now. I think it's better to let Sowjanya deal with the backports, then send them in small series instead. Kind regards Uffe