Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3246637ybh; Mon, 16 Mar 2020 19:07:03 -0700 (PDT) X-Google-Smtp-Source: ADFU+vug7K9EWJXj/UptgEPclMYg2s+lb1Ka8oGZ4w6LfUnK91PFhcKkviOpm5ypCPPCulv84xN0 X-Received: by 2002:aca:4ecc:: with SMTP id c195mr1707607oib.123.1584410823460; Mon, 16 Mar 2020 19:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584410823; cv=none; d=google.com; s=arc-20160816; b=FzWjRJO6DvxngYu+RacteV3/5DKAyFxgwHNcfER3cMfwPIij0SDfdUnDVsxtuwmM1W ZzXBCa3+/mnV4LgZCdHTcTY7lMaVCFvyWCVFIWztEZzkeo/HBEmAFhtwKMcx85MxX8gE jwpoiSIl6wxsXyGvOZIIzA+UU7Wjz/Y0Icc4easbKLOsSNe8JeuvPtR5Guz2/sS4siDv ShdIPdwCtkdG8bFAo8SmC22qLURXvbflOPpvjC1FDgSQTMCLF33ZLrqQGstr73/R6xR1 sYXH9JOfbOAMbfNx8jLYjKYm1v1PFlt2QGvh4ffF78yrcXV3cYGxw23cCgaJ0Nj6/oCO FrZw== 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=GfwiC+344U8psPjXqa0wm09HURQ3uUDHZEYcEibliGw=; b=lzbIeGUmUaXTcIYhQwQgBDNXiwLSX0UbXx3RjEvIBbPYIcPqKz0yYO7dUDXx4unEWR CY54JLDS623LMheszzq3+/loX1BJ08ABkDoxtkppo/mM+MLXcEWmQYqbtI7vl8AhWweu GUW9RvvYhkf2Ute3kXxCuNVKblCNqdy1lgDjERJa5pVEYWdcOwxWTe9emQDuvic0iNkR x+uRtj+tXmc5Un6W7h6Rsbh4TWH8djdeX+KTy1aegfDIA6hel/pIKIMRbWUD43W17sl9 qJslifamQTM73rbtTMrgLK9tPIph60XtGNZ4Ni0puJz0zHL+g257uTdHO1Tjtt4SOP8u vitw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IxAw1x5u; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s2si915089otd.184.2020.03.16.19.06.51; Mon, 16 Mar 2020 19:07:03 -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=@gmail.com header.s=20161025 header.b=IxAw1x5u; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726741AbgCQCCT (ORCPT + 99 others); Mon, 16 Mar 2020 22:02:19 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:46615 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbgCQCCS (ORCPT ); Mon, 16 Mar 2020 22:02:18 -0400 Received: by mail-qk1-f195.google.com with SMTP id f28so29966849qkk.13; Mon, 16 Mar 2020 19:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GfwiC+344U8psPjXqa0wm09HURQ3uUDHZEYcEibliGw=; b=IxAw1x5u4ehF5o0WeS17DGZ7kb7j9nMi2Xm1UqyutqGICGpvViUsiFRLaWVBHIhKoR 3qTn8R8TfUTFe4TZDtRCnSnm87KSStORtK7JrqpO8anmsG7qKdBonpQXhpjOMNvkYJ0F XFTRn4t+e75LWMBYxSjJ8afc36eKQ/Jjmc1dcA/avO/4qcQ3VC/KG/HrplY4OKG7L5kE 8tHZfCKMEgnGqX0Xc7LKZy8nOlFGUU8NwzZUvO+Cc+4yyw4/pP1+iUEMuC4qj+aNeyTN L4vidOkH/oOf+Ifnu6CBGU6zO0XafcysjMLAdEBSPbQT2Sww2dS57J+GCd4yKhkBLJr/ R+kA== 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=GfwiC+344U8psPjXqa0wm09HURQ3uUDHZEYcEibliGw=; b=qn/jOsLY7UyxPiaC98MeFsc6UPV7uFiEYqv+Km+Pz+PRdUzc9ZXjZJNxve5mRmxELI /4zFDujJSbLCMQebUz3yAZlnxfuCVO0u87Ty2tr7aisDwGbz74IvP1MumxmI5+uRKl46 Pg4fQ1ttL9w3BME6i/+emMrI8nUI1ZrQJmo6ZDykVCjnl/1F8sTzlhuSp07ws/dh84wE kSV/ttiv8QxBlEbemSv5DhQPYs/kiNDzNG03Po8XLmxTdYG7SJWWqpuhhSEjBwwPhQW4 rlmXop+j5MnvAX7uAgvNVkJwZRB0IXDU0Tg33O/Xr7ku8AejMJypprybvwBUDO3p877D DBOQ== X-Gm-Message-State: ANhLgQ2u1HqNZWKHYuqXs/8Ka+RkIGpejDDhp8L6oQVC3qgTEApRdIrl DZZ+o8GZa2cVTvUuvOa3wDvCf0joO+cEp6PEnhPUZZ6j X-Received: by 2002:a05:620a:539:: with SMTP id h25mr2652050qkh.395.1584410537015; Mon, 16 Mar 2020 19:02:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Baolin Wang Date: Tue, 17 Mar 2020 10:02:05 +0800 Message-ID: Subject: Re: [RESEND PATCH 2/3] mmc: host: sdhci-sprd: Implement the request_atomic() API To: Ulf Hansson 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 Mon, Mar 16, 2020 at 7:47 PM Ulf Hansson wrote: > > 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? Sure. Will do in next version. Thanks. > > > + > > + 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 -- Baolin Wang