From patchwork Tue Jun 25 09:20:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 11015093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3FE6E6C5 for ; Tue, 25 Jun 2019 09:21:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 324FA28B7B for ; Tue, 25 Jun 2019 09:21:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26AF228B95; Tue, 25 Jun 2019 09:21:06 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 C8EF028B7B for ; Tue, 25 Jun 2019 09:21:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731322AbfFYJVE (ORCPT ); Tue, 25 Jun 2019 05:21:04 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37442 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731313AbfFYJVC (ORCPT ); Tue, 25 Jun 2019 05:21:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=b5u/6dbnjNFVPuFw6MZPknmAKjbCyVx5rSPaouLkS3U=; b=rg1rTX/qjeCwjR5rZEPw6HfjYd dhPa8iHSrxg7KVsS364oi4wqnBHReT1psNJUP9ClleZtp6P5r/PPv2FoyErWEJAbPd1CwL+REIboV f73Xade/0Mx69wBXLYmhAZIZiAKDymvjMgyiFZOGXEVVpOFYnXn46TKWcqHr/jKHBUQaJRDxVDBVI s8rJXiyQ5ip4dUQRpT7Q8C91Yzn5/XSlR4fK8mXwQ/hS/7wDtMRefzOkevkmX6ArMr8LOStyQx2QB LSfyCSwCBkY3f20ulntIUeBAPZpvhwOCoWCFt4dE3KQ3SWWHPAGl/mXOspuP/5XFcn469WuiOFcvC cxinccZA==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hfhdE-0005k3-Cs; Tue, 25 Jun 2019 09:20:52 +0000 From: Christoph Hellwig To: Ulf Hansson Cc: Russell King , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] mmc: let the dma map ops handle bouncing Date: Tue, 25 Jun 2019 11:20:41 +0200 Message-Id: <20190625092042.19320-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190625092042.19320-1-hch@lst.de> References: <20190625092042.19320-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 Just like we do for all other block drivers. Especially as the limit imposed at the moment might be way to pessimistic for iommus. Signed-off-by: Christoph Hellwig --- drivers/mmc/core/queue.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c index 3557d5c51141..e327f80ebe70 100644 --- a/drivers/mmc/core/queue.c +++ b/drivers/mmc/core/queue.c @@ -350,18 +350,15 @@ static const struct blk_mq_ops mmc_mq_ops = { static void mmc_setup_queue(struct mmc_queue *mq, struct mmc_card *card) { struct mmc_host *host = card->host; - u64 limit = BLK_BOUNCE_HIGH; unsigned block_size = 512; - if (mmc_dev(host)->dma_mask && *mmc_dev(host)->dma_mask) - limit = (u64)dma_max_pfn(mmc_dev(host)) << PAGE_SHIFT; - blk_queue_flag_set(QUEUE_FLAG_NONROT, mq->queue); blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, mq->queue); if (mmc_can_erase(card)) mmc_queue_setup_discard(mq->queue, card); - blk_queue_bounce_limit(mq->queue, limit); + if (!mmc_dev(host)->dma_mask || !*mmc_dev(host)->dma_mask) + blk_queue_bounce_limit(mq->queue, BLK_BOUNCE_HIGH); blk_queue_max_hw_sectors(mq->queue, min(host->max_blk_count, host->max_req_size / 512)); blk_queue_max_segments(mq->queue, host->max_segs);