Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp588502ybz; Wed, 15 Apr 2020 14:38:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJwDOobfUGkIp3MZ2uqdt70CbD8blOshoe8+hjVfkQqX6ofXvmVhViYDWFfhM7ntoZHFygn X-Received: by 2002:a17:906:add7:: with SMTP id lb23mr7275990ejb.6.1586986710872; Wed, 15 Apr 2020 14:38:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586986710; cv=none; d=google.com; s=arc-20160816; b=v6fL9B3aaYpWa+Y4fbLwX6z1+Zlcd9InDbiQ2+eE/SXqHovt4hJUNVAmiBIOjMsD+Y erqI/tzIFx0UCE4/Ho52qmfuEZYIbfHp5OZ4p/ejI+eUVcGofORWYlPv6Rc0032sWzoC 6OD9HGMfFaiFJaHo0w7o4F2KceCC3rs5tkQ0ZFkse3WuS5WYAnRXMOUXdAL/ILXIBQzr SSB+kV2KffhClX/wvQBaDQB7Tel7eCPJ92ZlcZp3LXwb+gAin9f7kz0lLdQ3oVllv7T/ O8dWbk5OfW2MENfH5Tu/iG5ZViOG2dq3Awj0xNa+0sPJh+79TzNpGO99ARXOdju4tf/D iocA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=DCfKOWstn1YUZYfSD7e9pnU3ddBPtYCPiAb01pS502U=; b=usUDG6xyYkoTQnzDixxTlRUruhaPH+2dgCCHKUkkAdWbv7h0JMtj8v//hjmdCRr3tW ghnyEGust8voKl/DtZQfhL8MOJ61CnQu/flzhzw/roxIxh9PcErXGh6GA1i2WYllYs+x 5aLMsx5CqC+aOcFwsKTNB/jtMoM52WrYDr6N30hqc9xG+Okjzvew82JA0Z0iojQZimUn hdbUKAMFWNJyIenviWwwNxI92IKhJ6bDbDhEtaU6Fq0eV40Eq/jrrIQ3KDRGbO3bd8Fp qBWsvxFiQxhPJVaW90lxxtymxN+fZPEoxqEtIboCqh44z3wz1EmsGMXxCDFQvyEA8MQD eNnQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw23si1233197ejb.423.2020.04.15.14.38.07; Wed, 15 Apr 2020 14:38:30 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732923AbgDNNui (ORCPT + 99 others); Tue, 14 Apr 2020 09:50:38 -0400 Received: from mga11.intel.com ([192.55.52.93]:16095 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732845AbgDNNuK (ORCPT ); Tue, 14 Apr 2020 09:50:10 -0400 IronPort-SDR: eQ73OGoO2B7Ol5lnEg2ELVqO+oqWRS66a+iFpY792SA6DIwHHpYqAfo3spm48Z1G2Y0Rr7MXf6 zU3G3ZdyusYg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Apr 2020 06:50:08 -0700 IronPort-SDR: DzU44UtbBXnlgcTVLfD4U2AwqPWdn9MqtzL9D4GQjno3lz/kgO0DNfIu/vm7nZg3NR83qNM/k9 UbLqMGnUvKdg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,382,1580803200"; d="scan'208";a="243817701" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.87]) ([10.237.72.87]) by fmsmga007.fm.intel.com with ESMTP; 14 Apr 2020 06:50:06 -0700 Subject: Re: [PATCH v5 3/3] mmc: host: sdhci-sprd: Implement the request_atomic() API To: Baolin Wang , ulf.hansson@linaro.org Cc: arnd@arndb.de, orsonzhai@gmail.com, zhang.lyra@gmail.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org References: <60142fe6c6c1dbba2696e775564ae2166786f0bc.1586744073.git.baolin.wang7@gmail.com> From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Tue, 14 Apr 2020 16:49:17 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <60142fe6c6c1dbba2696e775564ae2166786f0bc.1586744073.git.baolin.wang7@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/04/20 5:46 am, Baolin Wang wrote: > Implement the request_atomic() API for nonremovable cards, that means > we can submit next request in the irq hard handler context to reduce > latency. > > Moreover factor out the AUTO CMD23 checking into a separate function > to reduce duplicate code. > > Signed-off-by: Baolin Wang Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-sprd.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c > index 2ab42c59e4f8..bc7a8cb84862 100644 > --- a/drivers/mmc/host/sdhci-sprd.c > +++ b/drivers/mmc/host/sdhci-sprd.c > @@ -406,7 +406,8 @@ static struct sdhci_ops sdhci_sprd_ops = { > .request_done = sdhci_sprd_request_done, > }; > > -static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) > +static void sdhci_sprd_check_auto_cmd23(struct mmc_host *mmc, > + struct mmc_request *mrq) > { > struct sdhci_host *host = mmc_priv(mmc); > struct sdhci_sprd_host *sprd_host = TO_SPRD_HOST(host); > @@ -422,10 +423,23 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) > mrq->sbc && (mrq->sbc->arg & SDHCI_SPRD_ARG2_STUFF) && > (host->flags & SDHCI_AUTO_CMD23)) > host->flags &= ~SDHCI_AUTO_CMD23; > +} > + > +static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) > +{ > + sdhci_sprd_check_auto_cmd23(mmc, mrq); > > sdhci_request(mmc, mrq); > } > > +static int sdhci_sprd_request_atomic(struct mmc_host *mmc, > + struct mmc_request *mrq) > +{ > + sdhci_sprd_check_auto_cmd23(mmc, mrq); > + > + return sdhci_request_atomic(mmc, mrq); > +} > + > static int sdhci_sprd_voltage_switch(struct mmc_host *mmc, struct mmc_ios *ios) > { > struct sdhci_host *host = mmc_priv(mmc); > @@ -561,6 +575,11 @@ static int sdhci_sprd_probe(struct platform_device *pdev) > if (ret) > goto pltfm_free; > > + if (!mmc_card_is_removable(host->mmc)) > + host->mmc_host_ops.request_atomic = sdhci_sprd_request_atomic; > + else > + host->always_defer_done = true; > + > sprd_host = TO_SPRD_HOST(host); > sdhci_sprd_phy_param_parse(sprd_host, pdev->dev.of_node); > > @@ -654,8 +673,6 @@ static int sdhci_sprd_probe(struct platform_device *pdev) > if (ret) > goto err_cleanup_host; > > - host->always_defer_done = true; > - > ret = __sdhci_add_host(host); > if (ret) > goto err_cleanup_host; >