From patchwork Fri Nov 10 10:01:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 118516 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp7722339qgn; Fri, 10 Nov 2017 02:01:57 -0800 (PST) X-Google-Smtp-Source: ABhQp+QNCZbZ1lE8PFq6c3EXjnOlQ3lmpCPIfzMGuLC1efy/XLVo7Pcm3lNNYzavOvqUA7HDE0WC X-Received: by 10.98.35.194 with SMTP id q63mr3767395pfj.15.1510308117725; Fri, 10 Nov 2017 02:01:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510308117; cv=none; d=google.com; s=arc-20160816; b=gZKbIHXh/AwT9KMAgNM+k5+vIg0ekGh4zv8LQgbI6q8f7h0HqbhB/je5vFht7KWIsF LL6U20eIKYcqilDYnc0sD6aAhRWa2tE1yfbdezgoOPzhmGwM+EfKIuVEukq+Jem7NhY7 SRF8LxKXG1/1/yrmSAYEZJK/Qv7HUfzBJdaWGea4rIBZcwMjaVonnmkayVg2STTKtwyR gq9FN/Q8q2aVF0SFU0c77UBIog3pQzDMssrvWi8/VmqXwQ5a6gagMEg20yRoZCAydQhl cNNYpLBrOBI4wBOaGsFtsTNuGsXm7QnkjqdYuF1fdG02ZrTH5CZfQC3ls6UpFiQaFIfP TTKg== 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:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=tTZRx8/iVMUdibUJYIgbxYNIFu347WN1kZpypmIZTpU=; b=uWlkVxJMNIN170wVzHuuoK8i0aqdwHyMhqOahYVL3Xpd83R6uYHs1ouIUfA7iKubIw yn7C6R/HueMjX/3vHrQGxbs7iHrgHn5+EyTa5xHwKnCJQDvwEu6jsSS44hGaV6WXTTlu ulkKHWh8dtXZ2tILWy9+q79q+30+cIRTqZ7gvvsoxtRElDy/NAeeuW7HnoU8LdoJyBR5 adDgpybU/HnnQbb7qhVwJYA6F3kuhU0ZKCjqtNacPVfP+V3OPSVn00mwZZCCMlj1b5z8 BIOd7/TrJuM7XJad9n+7zfbbYaICmRipVR6GC5hZcJjJW0/xadWW3NpBVQfwiE8dYngb UbaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=OTWGP+Sf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si8801659plh.282.2017.11.10.02.01.57; Fri, 10 Nov 2017 02:01:57 -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 header.s=google header.b=OTWGP+Sf; 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 S1751410AbdKJKBz (ORCPT + 6 others); Fri, 10 Nov 2017 05:01:55 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:49350 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbdKJKBx (ORCPT ); Fri, 10 Nov 2017 05:01:53 -0500 Received: by mail-lf0-f67.google.com with SMTP id w21so10371677lfc.6 for ; Fri, 10 Nov 2017 02:01:53 -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=eLY5CthlX10SDAKbYnppkdu75vU0SFr1NoPLjvOzlgk=; b=OTWGP+SfmdorcnalwnBjqFovdF3eR9Qr9o27n3pFhCwZIbY77CWQoV5MWNyYuTRNfZ rlDw19myeg1bSy91dNbi2WQLvcTJgWTfg6sPlYdBMRhrfKn+7v+6IeAIElOsO31gQizg Ih/q4rgEoJHxyrgmSTCRzujGGBED3mBjoau/4= 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=eLY5CthlX10SDAKbYnppkdu75vU0SFr1NoPLjvOzlgk=; b=XWw12onDMjHMSXq2SCXRfXPhUG9E+3ZD9NkGHiuHYSmvGkKZ1aTKjHS71HqrSqZBA/ /SyMxXYxHgwPpxhLyljkAvz6wwXcGGhj7QxJsFex13YLQZLOuEOjdXfk2Py/PXj1PQ1k +tg1gHpF2K0gL8dlXq3Yc4kN1RrgRY4J40FJNjOvmVq7HYcCAkTTnk6SBtS1Xqdvh4bU Qm2JSdoUuXVcOnhpNFB6z9ESQBlXfCrG3yDWFFLErGTHgTLSJtXEbL3Ut2MlWwah2gOS r7dMZEG/MH0t01WqobBl1taLP96YeIRjrmGDfO3t+gBaY1FXrqqvNT9oOtbPdPg2tQQW AoxA== X-Gm-Message-State: AJaThX6Xob5QIDyZz8q65NTkycoJCArMtz4Rm9gRAbwehj+zhhfMOfZQ Zn5j1SHPDo23RnMaFcLLwY3cLEpCBR8= X-Received: by 10.46.85.69 with SMTP id j66mr1377729ljb.137.1510308112010; Fri, 10 Nov 2017 02:01:52 -0800 (PST) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id n36sm310843lfi.78.2017.11.10.02.01.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 10 Nov 2017 02:01:51 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: linux-block@vger.kernel.org, Jens Axboe , Christoph Hellwig , Arnd Bergmann , Bartlomiej Zolnierkiewicz , Paolo Valente , Avri Altman , Adrian Hunter , Linus Walleij Subject: [PATCH 01/12 v5] mmc: core: move the asynchronous post-processing Date: Fri, 10 Nov 2017 11:01:32 +0100 Message-Id: <20171110100143.12256-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171110100143.12256-1-linus.walleij@linaro.org> References: <20171110100143.12256-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. In the later patch named "mmc: core: replace waitqueue with worker" we move the finalization to a worker started by mmc_request_done() and in the patch named "mmc: block: issue requests in massive parallel" we introduce a forked success/failure path that can quickly complete requests when they come back from the hardware. These two later patches together restore the same optimization but in a more elegant manner that avoids the need to flush the two-stage pipleline with NULL, something we remove between these two patches in the commit named "mmc: queue: stop flushing the pipeline with NULL". Signed-off-by: Linus Walleij --- ChangeLog v1->v5: - Rebasing on the "next" branch in the MMC tree. --- drivers/mmc/core/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.13.6 -- 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 1f0f44f4dd5f..e2366a82eebe 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -746,6 +746,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; } @@ -790,10 +793,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);