Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp2514027ybh; Mon, 16 Mar 2020 04:48:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtmv6WPFfg5AwQBypzjWpxxfda18Z2L6pXSbNVygFoygKt+cZ5Yg8GBRm0oPdXo1XGY3IR9 X-Received: by 2002:a9d:7085:: with SMTP id l5mr21158776otj.53.1584359311356; Mon, 16 Mar 2020 04:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584359311; cv=none; d=google.com; s=arc-20160816; b=k+9qkLbJ1GOgiMIHQYidCa90fgTSpXxMuHetF7NWwY2IW2W0GdUN9eNoxJQVxYGT2i S9WCVDc7xEhCy82zAeQGuJTOf1gWLXi65+SDR+R1RLJDbaRdy6CYW4GN506qVpTfXogM d1dX8c9cuL2ITFhCxlEXiOcsWZaOZGtxR8fg0X/J40ccoo3WQYbyInX5zlBoq41G9qcG qrxFUQNtdedHMcOTqBMks2Aa7qtADftzEYsKS0ZfIP8dIVEFVlYrVrFgttnm5t/yYFqn bFEsGgFlBLFjHnDfOPCFhjTIhwp/vfK9qdRjAUzsPem6l8pBMcPCfd4ZnLDX+aL+AWbv Yfgg== 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=EpPj3BYKLx5Ky/dvjcuZk1wdfRpXvFq2BQJKd9cCG1w=; b=VxknplnmGoff/ysJGB2oGcsdXDXM4Kq3AIb+KC3NUVclxoJEcwTuktY7lNgiEM8Eo5 Y55tx+JG8jNXqBYX8gA6+Kl6fiKdXAG43DzS4L9NamBEGSRbaSwj1w2tfyxlmxIrGPGa SrZGJYX3CGK0mvQPXvzzSlN2ZRRFbD6Y6tnDrltUuCJfWQE9EFzqk4WB+cDGxKDUoYcp DvtfDP0zZgogC8M9Z/AMZ3VOi41qyNdAXrV4eUHb6kL4ocQ4LmKQPi393KrulZ/8Bn88 Qk7Gq1Co33Xad8VxbwbrEx+RaoUaW2boFGr5XQOgWzl03MPo3XFDTvfqrA+9rWYduupb Vjnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cWzWCPRW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id d125si8230584oia.86.2020.03.16.04.48.19; Mon, 16 Mar 2020 04:48:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cWzWCPRW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730883AbgCPLr6 (ORCPT + 99 others); Mon, 16 Mar 2020 07:47:58 -0400 Received: from mail-vk1-f194.google.com ([209.85.221.194]:34248 "EHLO mail-vk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730875AbgCPLr6 (ORCPT ); Mon, 16 Mar 2020 07:47:58 -0400 Received: by mail-vk1-f194.google.com with SMTP id w67so4755720vkf.1 for ; Mon, 16 Mar 2020 04:47:57 -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=EpPj3BYKLx5Ky/dvjcuZk1wdfRpXvFq2BQJKd9cCG1w=; b=cWzWCPRWtJy37DgXc5qiVV+KZXj1AeMoMsWnIV929LQWBr/B+sDeIuLyW5LedsKplY W+0dQdisBB20ETBRpVYeeSZkbygJmSWcF/TctcYHZhlgFSGIj0oKwHUWo0gpPusb5NTv JlsctpxTnnwuFjf/x22BMEiBdTiHX88+GWoHsEbMDCzlNCBvmZoxzXq53lAXlbzvEDpg yjznEPy2XyV1Fxo4Dhtn4hfuHcVQgM04EU3GNVOnjPMWyedFiAoVVh90WxQzoK+ey/TL MKtqFlFd99akE5K+fOsJroa+GCSk+AqOlhydaKXLKAHjtRRe47xOGJV+4x2S+PiXeS5b Mtww== 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=EpPj3BYKLx5Ky/dvjcuZk1wdfRpXvFq2BQJKd9cCG1w=; b=V2qzMp1ciYi+/ctPJm+cRqohL+2qoNdEUKMD9D7kxxDPCLH1V2voPRDMOlJGWEZhtX piExsNu2wIt+kmkIpVtcwjJJU5/+7O0m49xWz3UDJcbOxExulLfnAGgP8wLlgcQJEVa/ HgzXUK0J8O51W8RnEHDW3Bs/tdU4bOlUo1cKOP2HEsCeR6nywFjQugv9MRpUm1pRAQWy q7O+ThUbzNzm2tkxWp3WBTTxR0ZYSXkbw4h1dzDJtCI8xSk4GVSpBBnBEhBiErhDbV9K skmbHCb529KWzGQSHBLUMmUU8JdcrroIuASkHzQdktkmRMJUoZGl/HB3IcQ51lLrUNUJ sPxg== X-Gm-Message-State: ANhLgQ12ypMld2VSTYsVjDqW7bU3LvTQ6Vao35+vHVOeKGjOizupnmM4 HnbEnHMvk9fSgZz0DGzPzWuIDTbzluNPlCrASDkh/FoW X-Received: by 2002:a1f:b695:: with SMTP id g143mr16577058vkf.59.1584359276875; Mon, 16 Mar 2020 04:47:56 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ulf Hansson Date: Mon, 16 Mar 2020 12:47:20 +0100 Message-ID: Subject: Re: [RESEND PATCH 2/3] mmc: host: sdhci-sprd: Implement the request_atomic() API To: Baolin Wang Cc: Adrian Hunter , Orson Zhai , Chunyan Zhang , Arnd Bergmann , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List 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, 4 Mar 2020 at 08:42, 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. > > Signed-off-by: Baolin Wang > --- > drivers/mmc/host/sdhci-sprd.c | 28 ++++++++++++++++++++++++++-- > 1 file changed, 26 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c > index 2ab42c5..bddf0f3 100644 > --- a/drivers/mmc/host/sdhci-sprd.c > +++ b/drivers/mmc/host/sdhci-sprd.c > @@ -426,6 +426,27 @@ static void sdhci_sprd_request(struct mmc_host *mmc, struct mmc_request *mrq) > sdhci_request(mmc, mrq); > } > > +static void sdhci_sprd_request_atomic(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); > + > + host->flags |= sprd_host->flags & SDHCI_AUTO_CMD23; > + > + /* > + * From version 4.10 onward, ARGUMENT2 register is also as 32-bit > + * block count register which doesn't support stuff bits of > + * CMD23 argument on Spreadtrum's sd host controller. > + */ > + if (host->version >= SDHCI_SPEC_410 && > + mrq->sbc && (mrq->sbc->arg & SDHCI_SPRD_ARG2_STUFF) && > + (host->flags & SDHCI_AUTO_CMD23)) > + host->flags &= ~SDHCI_AUTO_CMD23; Looks like the above code is a copy of what is done in sdhci_sprd_request(). Perhaps add a helper function that deals with this to avoid open coding? > + > + 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 +582,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 +680,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; > -- > 1.9.1 > Kind regards Uffe