From patchwork Thu Jun 15 12:12:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9788759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 581F060384 for ; Thu, 15 Jun 2017 12:13:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45D95285EA for ; Thu, 15 Jun 2017 12:13:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AA37285EF; Thu, 15 Jun 2017 12:13:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CBF9285EA for ; Thu, 15 Jun 2017 12:13:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752423AbdFOMNa (ORCPT ); Thu, 15 Jun 2017 08:13:30 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:34118 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752520AbdFOMNU (ORCPT ); Thu, 15 Jun 2017 08:13:20 -0400 Received: by mail-lf0-f50.google.com with SMTP id v20so7985518lfa.1 for ; Thu, 15 Jun 2017 05:13:20 -0700 (PDT) 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=6q6I3xJhWga1oMui928GQbok6fmtkANH/+gYZOt5sd0=; b=GLOJxd79OXTtCbJaE/X4kZYFuA7it+XVSHSF4G4Y45LaLU9bYjF/fRjUkTzuc2UtNy 456n4OZORlhNkTrBlqpY6DPa24s9RsKOEfv2pUvOUreWGiTBztyYj/Ur+IvDL/0cGfVT +E8Naq7hLoDrhgpAIYnUPPDGMhqUI39sfQCJQ= 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=6q6I3xJhWga1oMui928GQbok6fmtkANH/+gYZOt5sd0=; b=NEMhm4kyhr+G0hALDbpHEm7DifZSy7+MdZp4uPZ5nmDKvpgC83qnMscwG+GptDiKkN HQn1eeSDXm7NMh64zFajxETGZmswsGfyIwqxQAdk8cXGjY+wQxRQJxVuSRSDiG/PMKKx mahAT1j8FQ8AtyEb4spiVGysWBZzlkQpD0h+nmiSHRbXR+yiq/POGWamtBhKIDaB0GhK ZqGaK6L6T8qO3IEZTznDAUe/iMk3x3MBDb8KTk/qP5m/JB57zrd0YQT+ghtbg0HTFfSr KzWGRtwiwSLLmLo+ql391W0DMzoNp+QplyhnrV7rgPjP8qmFHcQ5ly6t3WGtRitGn+U9 H7lQ== X-Gm-Message-State: AKS2vOw477rVAljqpQ19Gg9iRyBRUe1TAStuoyRL2bc8M3qKKltsfZkJ w5MoXwe9dnVmHq3L6XO4Yg== X-Received: by 10.25.205.80 with SMTP id d77mr1740085lfg.131.1497528799201; Thu, 15 Jun 2017 05:13:19 -0700 (PDT) Received: from genomnajs.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id v1sm597574lja.18.2017.06.15.05.13.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 05:13:18 -0700 (PDT) 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 5/5] mmc: block: Delete mmc_access_rpmb() Date: Thu, 15 Jun 2017 14:12:59 +0200 Message-Id: <20170615121259.8281-6-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170615121259.8281-1-linus.walleij@linaro.org> References: <20170615121259.8281-1-linus.walleij@linaro.org> Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function is used by the block layer queue to bail out of requests if the current request is an RPMB request. However this makes no sense: RPMB is only used from ioctl():s, there are no RPMB accesses coming from the block layer. An RPMB ioctl() always switches to the RPMB partition and then back to the main partition before completing. The only (possible) use of this check must have been to duct-tape over a race between RPMB ioctl()s colliding with concurrent non-RPMB accesses to the same device. This could happen in the past because the RPMB device was created as a separate block device/disk with its own submit queue competing with the main partition, and submitting requests in parallel. This is now gone as we removed the offending RPMB block device in another patch. Signed-off-by: Linus Walleij --- This patch is not an RFC since it is a logical consequence of the RFC patch, not really much to discuss about it. --- drivers/mmc/core/block.c | 12 ------------ drivers/mmc/core/queue.c | 2 +- drivers/mmc/core/queue.h | 2 -- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 0a226bc23429..8bb97ac3be08 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1196,18 +1196,6 @@ static inline void mmc_blk_reset_success(struct mmc_blk_data *md, int type) md->reset_done &= ~type; } -int mmc_access_rpmb(struct mmc_queue *mq) -{ - struct mmc_blk_data *md = mq->blkdata; - /* - * If this is a RPMB partition access, return ture - */ - if (md && md->part_type == EXT_CSD_PART_CONFIG_ACC_RPMB) - return true; - - return false; -} - /* * The non-block commands come back from the block layer after it queued it and * processed it with all other requests and then they get issued in this diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index ba689a2ffc51..9d3de2859c33 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -32,7 +32,7 @@ static int mmc_prep_request(struct request_queue *q, struct request *req) { struct mmc_queue *mq = q->queuedata; - if (mq && (mmc_card_removed(mq->card) || mmc_access_rpmb(mq))) + if (mq && mmc_card_removed(mq->card)) return BLKPREP_KILL; req->rq_flags |= RQF_DONTPREP; diff --git a/drivers/mmc/core/queue.h b/drivers/mmc/core/queue.h index a2b6a9fcab01..7649ed6cbef7 100644 --- a/drivers/mmc/core/queue.h +++ b/drivers/mmc/core/queue.h @@ -89,6 +89,4 @@ extern unsigned int mmc_queue_map_sg(struct mmc_queue *, extern void mmc_queue_bounce_pre(struct mmc_queue_req *); extern void mmc_queue_bounce_post(struct mmc_queue_req *); -extern int mmc_access_rpmb(struct mmc_queue *); - #endif