Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp729029ybz; Wed, 15 Apr 2020 17:40:15 -0700 (PDT) X-Google-Smtp-Source: APiQypI/Nz3ukky/j2af3jI6/QZd/zDV97T7S/h1e7UfA9DDosjjoN9sa8aLGTLmNYZWoWl5fNxr X-Received: by 2002:a05:6402:b17:: with SMTP id bm23mr9779634edb.137.1586997615338; Wed, 15 Apr 2020 17:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586997615; cv=none; d=google.com; s=arc-20160816; b=KQwbn6EfFqyG8ODQLEjikBMQp9iRk5iq+l2xvm6FQdVtTG3ZugE6Xd81AmdoCgFLvd TW5u+yJ6KLdQWH9HXoH7umjDEDl4Hul7hZ7qkUK1gTLFuL3EezRvH2mbK4teQgSbdMcl v9xkhltfRz/1t0nGe2urLJfJ/Y10GDLUOqILgKTnkJvB75G+CjZBV3GDHVnQzvsQWY3Y 9JeidTuRNMzXymaRWsZIz82yAohndOU/siGeH8fdsHKcx7hNmdLLMnVBU26NiqvKItY2 xpnJVgheKRR5lCvpCcuz1neqTe+Tbf9U0zfBZfRqU+OfejKxSC2qavtibaJSv0fX3+G9 TnVA== 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=wnna/6OnfA+ZY6dFpwQADy6VF1hPNJpTLuPWcjrS+9o=; b=WHnOU43wICZCHb7SSZQdGqXQn2PXcXcUWQ59rx2L8LOAoIWrwRBjhMjJ95+yXDkkS2 tYSayOY7O35y2QhZUFj3S1GsoCuD7MPupE11h3l6SILTdHllaAenGN/EWcvJvzAgGt/U Vox9IvHJjp/vFT4S+fpcWizkAU9dyE5/pw+X3jVJ6hNjNohZKmci7GxmzrWUNE51JtnF osxzWkFVy5Ojz0Dr3sQvRVckIEfdqYyXXo80z+C36yjJc+vBC45HlIZl+i4mPDA+jiDM r6pZERfZdQAzNWT2KLhiIFgz3B5gdUiG8qfz3tV/a4m/WeeHMCROS7mwGooylfBttiT+ ITAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="lT/jtIdH"; 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 bi17si11956053edb.370.2020.04.15.17.39.52; Wed, 15 Apr 2020 17:40:15 -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="lT/jtIdH"; 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 S2411590AbgDOR63 (ORCPT + 99 others); Wed, 15 Apr 2020 13:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2441096AbgDORz7 (ORCPT ); Wed, 15 Apr 2020 13:55:59 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B830C061A0F for ; Wed, 15 Apr 2020 10:55:58 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id q22so4743504ljg.0 for ; Wed, 15 Apr 2020 10:55:58 -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=wnna/6OnfA+ZY6dFpwQADy6VF1hPNJpTLuPWcjrS+9o=; b=lT/jtIdHqRmRii6Mhp0kxfUeDNI5rGqofv9QErcLovXn4eP3jZocb3Bpl2WPwsG8BE KS3mM5EpSs+Uu+Tf56iJssZM4HvTeyjXO2moUDIzsOf3sraCA477lBpkK08LxtZKFHuR M6ScyxD+ddeekgfX79R9iCS71aGqv658euPY0EYzrWu4mk1S98xVzeYIyffvlQ1RCd39 NEcluG9VClepTW+ECpxn/bGQQUo0oE2EWe9hncZ2MkRMOR/fVeT+5thwm9CPeJ+mIV2w XfcJFIzjYpuM0ZVVd+xatRdOe8sG3Vj/ANuev2T5NAzhy0SJwiNCNHeEHiRKGctan+R+ DFgg== 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=wnna/6OnfA+ZY6dFpwQADy6VF1hPNJpTLuPWcjrS+9o=; b=GoU6/a2izE84aslTAUCBlBL2hqwy8cOWCZGf/artHOtHI9t0MpdjXavYyPgxS7d46e kH6LIC9DOhOJRDHW8EmnbKvI28dMffg0iprB1LJXKZ+dB+p10MePSkyX0K0QGwMZ02B8 Q4jirCQrMy+hQHIWII9KSusv/qN9vvSQeJzk+auVNkplZgkno8FfeMsykJqB1ohFBmz1 Nd4WrmvsTFRb2gpKE+Zs1B2rtkYyvJXWoF2WDuydQXF/MnLm7ILni5pZusfv/5lu60x1 aX9oWStuzmaNfRUB+QzNm5/tQKVJGFX8pZN+a3m8U83nJaMSX6hrtVznsX0CBfwrBGay Yrng== X-Gm-Message-State: AGi0Pubrkz/dNpVZJ7ixTwEl0Nd5tEwjnbby/8Y+4+m4LLgQMOLRK1Wh K/xMhL5aB19673AU2dW7cv+x9B5N3IYWnSwAGopZjQ== X-Received: by 2002:a2e:6c05:: with SMTP id h5mr3968173ljc.217.1586973356820; Wed, 15 Apr 2020 10:55:56 -0700 (PDT) MIME-Version: 1.0 References: <1583886030-11339-1-git-send-email-skomatineni@nvidia.com> In-Reply-To: <1583886030-11339-1-git-send-email-skomatineni@nvidia.com> From: Naresh Kamboju Date: Wed, 15 Apr 2020 23:25:45 +0530 Message-ID: Subject: Re: [PATCH v2 1/2] sdhci: tegra: Implement Tegra specific set_timeout callback To: Sowjanya Komatineni , Greg Kroah-Hartman , Sasha Levin Cc: Adrian Hunter , Ulf Hansson , baolin.wang@linaro.org, Kate Stewart , Thomas Gleixner , bradleybolen@gmail.com, thierry.reding@gmail.com, Jon Hunter , anrao@nvidia.com, 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 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