Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp507132ybg; Thu, 19 Mar 2020 03:56:50 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv/oz2o9OhrNWkSHJLxJewdYtWsghS45fV2pp5Uaf7nTdggkAu1Zd6AcQYL2463hxGKuVjf X-Received: by 2002:a05:6830:204c:: with SMTP id f12mr1817026otp.356.1584615410799; Thu, 19 Mar 2020 03:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584615410; cv=none; d=google.com; s=arc-20160816; b=daODkTNe2wkP7i1LOMxhryCFT8XbMWN3iElmotHfUY1aCJ+bRaccFRpBeIJYDzbmoT CapzCYOsvUkTyphppANcyY1fK7SeL2de4t+hoLbLPZEAIouY/Gu0XKpWcksB5wgg8aDr Db8OsvUZs91bjCjlfsu/YEVLLZuUecKH/wvzb+S60P678OBcAzsrYeQoUTIEt0V8QEDX q7OqFuAWIOp1AOVhV5UywZ9Fi/t8Miz1fFT4L3I3iVJSwppkor3fKEt3WfYF8zx3IaO8 U4HML59uYLg93mY6+sX80jPwmFuxv7Sy34JzxL5+OxpcRl2a8k6rtgninogxKfPv7jpv /ZmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=RnuPX1r2mFAI/A72C+v2CFVMojx/n50SdvshtlGYixw=; b=Vymf388rKr+W1l93YuZL+pPodBVlqhUW+pD+Smc/I8VZhT/Rhs4/NUwPt2x4btRrnE FKFR1b7ynNIHU123j6D9QRZKpf4JxYUINUdqwIW6SSnUHt8zARt7/l5asZ3QWzf7xrdH spsaVkXBWMdtQmeyNYMvf2Xz2+KaD7rZLgU27Ij506Hu1gzvD5atUxl0aMzxqyY01ylo Ryae+W6MSO3eh5ys1oUsxoncgdeu8WLRmlDrfi9gIjfnAnDJM0Q3faefkJE3zIJOdyTh iCpC+YCWljHjLAjWJRzzcOArFuPtb37IVicjGZYi8M+KDFvY1n6J/Bmn/IBfgvoGLLku Whjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uju42OeH; 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 q13si1056751otn.141.2020.03.19.03.56.38; Thu, 19 Mar 2020 03:56:50 -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=uju42OeH; 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 S1727138AbgCSKzS (ORCPT + 99 others); Thu, 19 Mar 2020 06:55:18 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:33627 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbgCSKzR (ORCPT ); Thu, 19 Mar 2020 06:55:17 -0400 Received: by mail-pl1-f193.google.com with SMTP id g18so920516plq.0; Thu, 19 Mar 2020 03:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=RnuPX1r2mFAI/A72C+v2CFVMojx/n50SdvshtlGYixw=; b=uju42OeHSKtnyKRnPW1/YiV8qcIg56COqPIBfv6T0yM96+14MRNYNXhO15JGSNMSJQ DAXxYbt/6N1eJA1CGoaTGvUvlTfWDeH52NsRlvwn7pfVdCTHbYyAPQs3YLA0ceVHJjgD y+RUtHvZvHbCpm6wtolwaRdlQr4WdvO/CaGVZmdNzAKFsYeWikHi3OnB9xZuuzqa6ZK/ zUrYwPK9HcWfNbeEhKGn+trtatj3cjrD5lHmPGj7rVkMQ/PpcccYIq1fDgOPmC6vfY5q MglNkGGihIVKEdvJZJ9oNU8ttpsCOqv9+Aiw5uaxHJe5w2TrHJXA2hvAkGL3exWRKv3F +5EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=RnuPX1r2mFAI/A72C+v2CFVMojx/n50SdvshtlGYixw=; b=W5KeSwyi8pwjCKgp1UO0tjlJRpY3cBolLKDuaKmEqSAl3lsS3xsyaB4LnqThMF9ISr Hk+q08NKz5cMTUpxxFjUQUyCCuZ18H9z0Xs65iJtWE7BuuAOE+JUWueMhtdodqK+WfQZ 5fJmv1huaRC0eBWXfy/+nRiUhzWrMqwbBjsOlV47ZagFyXyj0SATHpWMSFZO+OjYzwc6 KebfTPSDjTblbAOeFF0zEtUkN7wi99qJorY6PhrLJUmBSb4yRg6njB8/1UMpA8RFZGQQ gkBl2BKOQDWsdREg+LHW+1GsYb3CefYbWDi0eBwOBIKYH+ceLDsxmRhuxR79rB1ScI0C VJbg== X-Gm-Message-State: ANhLgQ1bYmTxrMf3/vKEbt/qLg7HHb9dV6ND+snGmld7sNlI2eKgGFFP Fhynk9vhYpEi9cO4Qc/+r+rGRV14 X-Received: by 2002:a17:902:207:: with SMTP id 7mr3072020plc.216.1584615316285; Thu, 19 Mar 2020 03:55:16 -0700 (PDT) Received: from sh03840pcu.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id f6sm2209949pfk.99.2020.03.19.03.55.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 19 Mar 2020 03:55:15 -0700 (PDT) From: Baolin Wang To: adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang7@gmail.com, arnd@arndb.de, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/4] mmc: host: Introduce the request_atomic() for the host Date: Thu, 19 Mar 2020 18:54:19 +0800 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The SD host controller can process one request in the atomic context if the card is nonremovable, which means we can submit next request in the irq hard handler when using the MMC host software queue to reduce the latency. Thus this patch adds a new API request_atomic() for the host controller, as well as adding support for host software queue to submit a request by the new request_atomic() API. Suggested-by: Adrian Hunter Signed-off-by: Baolin Wang --- drivers/mmc/host/mmc_hsq.c | 5 ++++- include/linux/mmc/host.h | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmc_hsq.c b/drivers/mmc/host/mmc_hsq.c index 59d2776..fdbaa98 100644 --- a/drivers/mmc/host/mmc_hsq.c +++ b/drivers/mmc/host/mmc_hsq.c @@ -41,7 +41,10 @@ static void mmc_hsq_pump_requests(struct mmc_hsq *hsq) spin_unlock_irqrestore(&hsq->lock, flags); - mmc->ops->request(mmc, hsq->mrq); + if (mmc->ops->request_atomic) + mmc->ops->request_atomic(mmc, hsq->mrq); + else + mmc->ops->request(mmc, hsq->mrq); } static void mmc_hsq_update_next_tag(struct mmc_hsq *hsq, int remains) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 562ed06..787a7b5 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -92,6 +92,9 @@ struct mmc_host_ops { int err); void (*pre_req)(struct mmc_host *host, struct mmc_request *req); void (*request)(struct mmc_host *host, struct mmc_request *req); + /* Submit one request to host in atomic context. */ + int (*request_atomic)(struct mmc_host *host, + struct mmc_request *req); /* * Avoid calling the next three functions too often or in a "fast -- 1.9.1