From patchwork Thu Feb 9 15:33:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 93734 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp88113qgi; Thu, 9 Feb 2017 08:39:28 -0800 (PST) X-Received: by 10.98.13.18 with SMTP id v18mr4738506pfi.62.1486658368127; Thu, 09 Feb 2017 08:39:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j191si10522470pgd.132.2017.02.09.08.39.27; Thu, 09 Feb 2017 08:39:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752700AbdBIQj0 (ORCPT + 5 others); Thu, 9 Feb 2017 11:39:26 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:34917 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752929AbdBIQjZ (ORCPT ); Thu, 9 Feb 2017 11:39:25 -0500 Received: by mail-lf0-f45.google.com with SMTP id n124so5685133lfd.2 for ; Thu, 09 Feb 2017 08:37:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XW7KvRqBWr3hFy8GfNhHyJ9vA/FQrqihEf8e/iVI+bU=; b=YiSIkY4i3YEIeA+702FdsV1xU3abrDFE4icC/VD6YMjbQB4b6RnDLsnaKgn6ZiQkb8 Pmy7+J3X5LQELchaXX4UluHc29B+sCBqRMp/pIifrkoazBmcn9dSo2f3Xn+DmXCuDS/P p6Bx2waTJNCZ5wQWbDe5B2DCcJuXGIKtvPnWU= 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; bh=XW7KvRqBWr3hFy8GfNhHyJ9vA/FQrqihEf8e/iVI+bU=; b=PcYPo+3YcmdUE/2HRa8wT0IPjUpYXXzvzNFRmbj+vakLvY7O0Oi4pJf7U12bM9NzXX r8ghf+7MyhVsZB7hA4HhbCC0fS/0dLgVkJsRkdaE28GjS3bxpcWi8pJyEnETKnVt2VGK SOezvf+qjP2ZjzIJkc0mzUhAP2udLoU8JU/I2w5kdaxUJ3npvgzlkimgDNP1ycNhbTrP BFrTR/52pioKiVFD/R3FF5PeblYUnqZTWFl2MH7laT9mXy/9+gsaN8gQMmzqd2UFqf/u U4AlUNZbpMcstmk3QD7v6k4ZHFNutcVWJ/zuWD5AUkDWAi7S4MRkOaUZ/LQsNM4GjCLT IgGA== X-Gm-Message-State: AMke39kJ5aJcoYrdiIJmtZrsNpib6+Fie2vZBkbt5yxOLiYYJhvOSeDB4RUAJTT77FJduUUh X-Received: by 10.25.4.9 with SMTP id 9mr1267455lfe.45.1486654486292; Thu, 09 Feb 2017 07:34:46 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id e86sm3670614lji.32.2017.02.09.07.34.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Feb 2017 07:34:45 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter , Paolo Valente Cc: Chunyan Zhang , Baolin Wang , linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Linus Walleij Subject: [PATCH 04/16] mmc: core: move the asynchronous post-processing Date: Thu, 9 Feb 2017 16:33:51 +0100 Message-Id: <20170209153403.9730-5-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170209153403.9730-1-linus.walleij@linaro.org> References: <20170209153403.9730-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org This moves the asynchronous post-processing of a request over to the finalization function. The patch has a slight semantic change: Both places will be in the code path for if (host->areq) and in the same sequence, but before this patch, the next request was started before performing post-processing. The effect is that whereas before, the post- and preprocessing happened after starting the next request, now the preprocessing will happen after the request is done and before the next has started which would cut half of the pre/post optimizations out. The idea is to later move the finalization to a worker started by mmc_request_done() and introduce a completion where the code now has a TODO comment so that we can push in a new request as soon as the host has completed the previous one. Signed-off-by: Linus Walleij --- drivers/mmc/core/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 8dbed198750f..0972c649ea7a 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -643,6 +643,9 @@ static enum mmc_blk_status mmc_finalize_areq(struct mmc_host *host) mmc_start_bkops(host->card, true); } + /* Successfully postprocess the old request at this point */ + mmc_post_req(host, host->areq->mrq, 0); + return status; } @@ -687,10 +690,6 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host, if (status == MMC_BLK_SUCCESS && areq) start_err = __mmc_start_data_req(host, areq->mrq); - /* Postprocess the old request at this point */ - if (host->areq) - mmc_post_req(host, host->areq->mrq, 0); - /* Cancel a prepared request if it was not started. */ if ((status != MMC_BLK_SUCCESS || start_err) && areq) mmc_post_req(host, areq->mrq, -EINVAL);