Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3604470ybh; Tue, 17 Mar 2020 03:15:07 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvkRIbzNqyPut8BUdqONNmAYFyYj2AnTYdXM5eoTX7icDhVl+d1rBy52hRhwttmXx6Vz6xf X-Received: by 2002:a54:468a:: with SMTP id k10mr2904679oic.3.1584440106910; Tue, 17 Mar 2020 03:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584440106; cv=none; d=google.com; s=arc-20160816; b=pjcqB62V4OikNGJi1fH+vHjz2NmgBVfchDpK/zEHnF9biW1c56l2tJ0AYhnY0HuKnz nVJAImlSnGyewhzEj0hLoF1W1q6ErXtSwFNX4g4276G4vsta/FC7XXhXEnqPRubrAszU TMgOck46DRlcELYbeX9P+2y5YVXfn/ZoTf+7emUpUQ9IIaZ1zuZhK8tC7b5/AnEiQvMV Wo2/WnjlrR4mtapOJyUW1ff5JJp03rwhsP3gMeFSfPDv8wbkLpd0fs0ZWPEiwFmdaNgx O3UM95dkCCNMP0y3RzoeCDmG7sVQjpKCjfQ/bGpmtMq+AHg01VqWvcdBCMtwk5YFbmvv kbCQ== 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=CJ+wcXrk2AEgHUVo4xt56W56ueRIUgPFWZGnDDDncXc=; b=mA/S+wcKK5ZJLxQy0iyfiD/pdPF4ambLIqjVLjFRlxFaip0XhMLVMUgWBlTdNUw1bA jz1ikZl1fRboepd/I7LIrrmODzc+5BKxTq/K3pMnOsOd+o1lFwUwQf2k2d3tKxxhxkxy /QE4OQY9r2HR7Sn+EY7zepI1SF1bv6KiB20lYrBwcbupjHAj8FFGiO/d6Jlv8qSmWwXl Vvzz5fAvSu3isRIXQbapGaGn2llpHstE9Gbk0eljB+WT5yhyMiLE1mbnVgv1aUUrGhog kWnL4YcW3XlrtoGfNcqdIioajfjGr/UcsGo6oFcWMjvpOmykQFlZnI0BdhUzXzNAgWzq ZuIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=B2a8uuHA; 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 j185si1461661oif.36.2020.03.17.03.14.54; Tue, 17 Mar 2020 03:15:06 -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=B2a8uuHA; 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 S1726278AbgCQKO0 (ORCPT + 99 others); Tue, 17 Mar 2020 06:14:26 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:33688 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbgCQKOZ (ORCPT ); Tue, 17 Mar 2020 06:14:25 -0400 Received: by mail-pf1-f196.google.com with SMTP id n7so11699012pfn.0; Tue, 17 Mar 2020 03:14:24 -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=CJ+wcXrk2AEgHUVo4xt56W56ueRIUgPFWZGnDDDncXc=; b=B2a8uuHAXzQ6/5JN+HOZJYJ/4vaiesxeohSbKzfzIaIiwYgIN3zNkNyvHLdRGTAPtG nhwaLNwx+iz4GGkvh00uI8tRnv8Mc4mvTUcbk+3xMUaJ6axlYtnODQH6lbz/aQV0bvy8 EyIe1hx6BNEmANsOGmvXogbrEvv5PXkkimfXBBzi+cbVX4ssKMEIapTi4maDTWfe3+iy K5KeQcC5x0/o7QLP3ixpaG5t//MF1jOTd7Wg+d38W0TkOXAB4ZPHm6XgMNlI+aokmxvz acdiT55pjHNF6U0UZAuU0LLXCiUmQy9z5AjB0Z0vQipmIX5SKPu7oBo9Pd8t+5BObgdP 4/yA== 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=CJ+wcXrk2AEgHUVo4xt56W56ueRIUgPFWZGnDDDncXc=; b=NcGngEY18hLlN/817yPiYVDRfnj7bZVsDUaGa5SztOH3F9zqQIFVitVHVQU0C8Xrnv 1nMBX4MJpoCJwc/wyMqVIb3Po+Y8sqay4XDZNo0BRGmDD2/YYD/UZ9FrDIvRC1x+MPdT RnZKwJ0+2hQ5u8qj9bOcy9zqc4A7XGwhwB6dy2a8Hq4tP6B8i8wsHecFvASRMXi6phDl GXpkVKq40fOisr14LJWFggSz4zIzAcOLSNmIweISdKp5cXFbHcmW4pGAfz/UJH/jfsjJ FYVgEG20dQprA30bGubLQK/rqtGgoKMKM7ehrkom6Shdwa9KTRJKm83KGzmy9cwYjOKg 8Rhg== X-Gm-Message-State: ANhLgQ3aBpGwhTa1Igs4X+8RRn6+YJjAPvLcYhDVHocGTECYg+/oDNQU CFpAPZN1a7OC3v0G+tZ54NYhO5YRwec= X-Received: by 2002:a63:ed10:: with SMTP id d16mr4265924pgi.107.1584440063976; Tue, 17 Mar 2020 03:14:23 -0700 (PDT) Received: from sh03840pcu.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id s25sm2195487pgv.70.2020.03.17.03.14.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Mar 2020 03:14:23 -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 v2 1/3] mmc: host: Introduce the request_atomic() for the host Date: Tue, 17 Mar 2020 18:14:09 +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..db5e59c 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. */ + void (*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