From patchwork Sun Aug 20 21:39:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9911461 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 925D1603F9 for ; Sun, 20 Aug 2017 21:39:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8996A2867E for ; Sun, 20 Aug 2017 21:39:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7EA23286B8; Sun, 20 Aug 2017 21:39:44 +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=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 41273286C7 for ; Sun, 20 Aug 2017 21:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753351AbdHTVjh (ORCPT ); Sun, 20 Aug 2017 17:39:37 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:35556 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753362AbdHTVjh (ORCPT ); Sun, 20 Aug 2017 17:39:37 -0400 Received: by mail-lf0-f45.google.com with SMTP id k186so4087924lfe.2 for ; Sun, 20 Aug 2017 14:39:36 -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=iI9v4tlfZJPxaZNeHIRXFr+h9DpSZg2X+cQ5NGXr0Bs=; b=P1JYD/NuSXWs8+wzCNapqWgN4gQErhoE8FvanwWSB9K/fJZUfTz1Ba/0gThccLQ9BA k9kYGRJaWaHH7ajNYuBK88a753OPElKnenrvAFZK6Z6fvDfW4H58/ahUyJKHW0EEWBAW 4bU3aidYdDRNlFswVgTASyNcCY4zfgsmyxDfc= 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=iI9v4tlfZJPxaZNeHIRXFr+h9DpSZg2X+cQ5NGXr0Bs=; b=Kc0N1dfypjdOO+Osky/GVRqIBf7pL6DMuSRaAsn2C0W1kzUiRW/abT/GuZezy1qYCD ZbD9sAxaGR1WLpLWOsmofmtz2QtzGLTS3+0byOdSZS8VxNZ6lt3sNFuw/WODJsDl9XSM +AKxSBWRR2XhR7RUPgWP1V38osGs2HU9h1yBaxGfPXyCnCSwfi3d1aoC+UJ+N87KRzf+ Tzmj4IrjMlcTGmYw0K6m5JhcC/lb6KfHJRO40En3jEjYU6gPiDDElaV1RK2vyqz73bi4 goG5ueQwRIJ4tslkcNs4fOK0uh4p5e0KHrl8j0Jdkth4FEsZEWuC8tk0y/uuRa3yvO4/ UkmA== X-Gm-Message-State: AHYfb5iwboeLJZdFv9Zt/NljbFC70Kf4u8qFfbD7qrya0bzWXqrCwVLt dyVDHF6oy6H/45JmaEw2Iw== X-Received: by 10.25.232.41 with SMTP id f41mr6189607lfh.90.1503265175491; Sun, 20 Aug 2017 14:39:35 -0700 (PDT) Received: from genomnajs.bredbandsbolaget.se (c-097b71d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.123.9]) by smtp.gmail.com with ESMTPSA id f136sm2381830lff.34.2017.08.20.14.39.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 20 Aug 2017 14:39:34 -0700 (PDT) From: Linus Walleij To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Linus Walleij Subject: [PATCH 8/8 v5] mmc: block: Delete mmc_access_rpmb() Date: Sun, 20 Aug 2017 23:39:13 +0200 Message-Id: <20170820213913.9737-9-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170820213913.9737-1-linus.walleij@linaro.org> References: <20170820213913.9737-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 --- ChangeLog v1->v5: - Renumber to keep together with the rest of the series. --- 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 27e1cf07a7a2..61ea402f2569 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -1207,18 +1207,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 affa7370ba82..3baccbf16f3d 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