From patchwork Wed May 9 13:59:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910872 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sfFLTns4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gygQ22WVz9s0W for ; Thu, 10 May 2018 00:00:50 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jgH0fpgBSwnjIMjCerQgtg3IPDG3C4Zzx+pFxUfKAyw=; b=sfFLTns4W/Gc9XiBk/Hw22Q0e5 GrrEcjtwp8D5G4Sej3mcKXp/6ojGv/GhbT7ITO9i7Oinm3shalXJ7R0Ph1pxHL3uHJtsS6zAjJasg HUGTrHZlVY2YnKjdJu57QU1rpBbNmOzpSKWY6NeisV84qK72ow6qhOp+oMLBA+oRXei6Z8/qIowg7 lfnxdtU/rL1lvZVduJcXt+0Zxwx/LULTyESXhJ4JnnKcJmwLtcC95oiravSQslG9okzzgmaCzy/Re pBVbDFGepugVJ06U7DcrmG1o5FBHSi0kHs1ZztRHYg3xWkWjOYauyMlya4aaOic4KV0Jax/9Ug05O wbYo1HBg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPe2-0004Qd-BZ; Wed, 09 May 2018 14:00:38 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdM-0002sP-Tl; Wed, 09 May 2018 13:59:57 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 1/7] mtip32xx: don't use block layer bounce buffers Date: Wed, 9 May 2018 15:59:42 +0200 Message-Id: <20180509135948.20329-2-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mtip32xx just sets the block bounce limit to the dma mask, which means that the iommu or swiotlb already take care of the bounce buffering, and the block bouncing can be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/mtip32xx/mtip32xx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 769c551e3d71..b03bb27dcc58 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -3862,7 +3862,6 @@ static int mtip_block_initialize(struct driver_data *dd) blk_queue_max_hw_sectors(dd->queue, 0xffff); blk_queue_max_segment_size(dd->queue, 0x400000); blk_queue_io_min(dd->queue, 4096); - blk_queue_bounce_limit(dd->queue, dd->pdev->dma_mask); /* Signal trim support */ if (dd->trim_supp == true) { From patchwork Wed May 9 13:59:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910874 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="K9oeZkP/"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gyh61LzQz9s0W for ; Thu, 10 May 2018 00:01:26 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=v4rpifhJMIRqf/ggO4BeyW/2Un/D/5x2WDAC8nrY3lI=; b=K9oeZkP/EsbxEwW9hOdzr1a7xE zg9axyurb/8JiljxDz31IRL0o+JZ4Lg/8JMz+Y0wJoYgdCqZqlKF5f9LJtm+eAPl8eWDyJ6n3LQmp 3nxamrpNRwQHDzaRDqX9wZA5ak8HoRUyJCTj5urU2cEkhEvUYdKQaJsQD9PRjtrEIt0WgHey+7/kW VXzLq07ZyzfSHQnHEgODQtG0iSy78HG0mouATzj5jDJnaQ4jECfzdls3IYa7UWvBZNEmQSkRljNvQ Y9clG3ipuBvldpp2CqSfrc+hTFcu/E3iCv0JBqGHgAIrzCRhMdocvt5xJGU8FTwkhA3xz0BwAgEKL 96/Trw/Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPed-0004iq-GU; Wed, 09 May 2018 14:01:15 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdQ-0002sz-6M; Wed, 09 May 2018 14:00:00 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 2/7] DAC960: don't use block layer bounce buffers Date: Wed, 9 May 2018 15:59:43 +0200 Message-Id: <20180509135948.20329-3-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org DAC960 just sets the block bounce limit to the dma mask, which means that the iommu or swiotlb already take care of the bounce buffering, and the block bouncing can be removed. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn --- drivers/block/DAC960.c | 9 ++------- drivers/block/DAC960.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index f781eff7d23e..c9ba48519d0f 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -1179,7 +1179,6 @@ static bool DAC960_V1_EnableMemoryMailboxInterface(DAC960_Controller_T if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) return DAC960_Failure(Controller, "DMA mask out of range"); - Controller->BounceBufferLimit = DMA_BIT_MASK(32); if ((hw_type == DAC960_PD_Controller) || (hw_type == DAC960_P_Controller)) { CommandMailboxesSize = 0; @@ -1380,11 +1379,8 @@ static bool DAC960_V2_EnableMemoryMailboxInterface(DAC960_Controller_T dma_addr_t CommandMailboxDMA; DAC960_V2_CommandStatus_T CommandStatus; - if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64))) - Controller->BounceBufferLimit = DMA_BIT_MASK(64); - else if (!pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) - Controller->BounceBufferLimit = DMA_BIT_MASK(32); - else + if (pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(64)) && + pci_set_dma_mask(Controller->PCIDevice, DMA_BIT_MASK(32))) return DAC960_Failure(Controller, "DMA mask out of range"); /* This is a temporary dma mapping, used only in the scope of this function */ @@ -2540,7 +2536,6 @@ static bool DAC960_RegisterBlockDevice(DAC960_Controller_T *Controller) continue; } Controller->RequestQueue[n] = RequestQueue; - blk_queue_bounce_limit(RequestQueue, Controller->BounceBufferLimit); RequestQueue->queuedata = Controller; blk_queue_max_segments(RequestQueue, Controller->DriverScatterGatherLimit); blk_queue_max_hw_sectors(RequestQueue, Controller->MaxBlocksPerCommand); diff --git a/drivers/block/DAC960.h b/drivers/block/DAC960.h index 21aff470d268..1439e651928b 100644 --- a/drivers/block/DAC960.h +++ b/drivers/block/DAC960.h @@ -2295,7 +2295,6 @@ typedef struct DAC960_Controller unsigned short MaxBlocksPerCommand; unsigned short ControllerScatterGatherLimit; unsigned short DriverScatterGatherLimit; - u64 BounceBufferLimit; unsigned int CombinedStatusBufferLength; unsigned int InitialStatusLength; unsigned int CurrentStatusLength; From patchwork Wed May 9 13:59:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910875 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kmg2w/Rk"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gyj73dgQz9s0W for ; Thu, 10 May 2018 00:02:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=v0CVf7PIGNz5sqWNtBckOx2m1ZiJuStAua7PepRB+vI=; b=kmg2w/Rkw8pIaOHnsl0dMsFZrI piEo9cRmt6nSSsCSUBuV5jK7DK66aCmIa33A0j+i6++8K7TM57gYJxyQ2Mmz6gTnfTGA//rRTwr0I fcT2YGjt4M7Ra/3HzgNd3HnHpMfoyCwRpQ3zRw7HyprEVQ3+XbC9rxwBR2//j+sHVUmzMeLaMaow+ uRp+pkI0ieRPNUt46v0tlj9LozCzXh2eLxtVKALSqPYF/F0xI72+SNSRVv08Ry+wWRhA85sd+zINY 4EExHk/JEoMjBupExvDZOdT/5pORHfmuGna7lSA/i8/LlWjcDGFeGhw6sYLGPJtSnAsv2/ba5kfQT LeyuEGhA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPfR-00056M-0f; Wed, 09 May 2018 14:02:05 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdT-0002uT-Jt; Wed, 09 May 2018 14:00:04 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 3/7] memstick: don't call blk_queue_bounce_limit Date: Wed, 9 May 2018 15:59:44 +0200 Message-Id: <20180509135948.20329-4-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org All in-tree host drivers set up a proper dma mask and use the dma-mapping helpers. This means they will be able to deal with any address that we are throwing at them. Signed-off-by: Christoph Hellwig --- drivers/memstick/core/ms_block.c | 5 ----- drivers/memstick/core/mspro_block.c | 5 ----- 2 files changed, 10 deletions(-) diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c index 57b13dfbd21e..b2d025f42d14 100644 --- a/drivers/memstick/core/ms_block.c +++ b/drivers/memstick/core/ms_block.c @@ -2096,12 +2096,8 @@ static int msb_init_disk(struct memstick_dev *card) struct msb_data *msb = memstick_get_drvdata(card); struct memstick_host *host = card->host; int rc; - u64 limit = BLK_BOUNCE_HIGH; unsigned long capacity; - if (host->dev.dma_mask && *(host->dev.dma_mask)) - limit = *(host->dev.dma_mask); - mutex_lock(&msb_disk_lock); msb->disk_id = idr_alloc(&msb_disk_idr, card, 0, 256, GFP_KERNEL); mutex_unlock(&msb_disk_lock); @@ -2123,7 +2119,6 @@ static int msb_init_disk(struct memstick_dev *card) msb->queue->queuedata = card; - blk_queue_bounce_limit(msb->queue, limit); blk_queue_max_hw_sectors(msb->queue, MS_BLOCK_MAX_PAGES); blk_queue_max_segments(msb->queue, MS_BLOCK_MAX_SEGS); blk_queue_max_segment_size(msb->queue, diff --git a/drivers/memstick/core/mspro_block.c b/drivers/memstick/core/mspro_block.c index 8897962781bb..a2fadc605750 100644 --- a/drivers/memstick/core/mspro_block.c +++ b/drivers/memstick/core/mspro_block.c @@ -1175,12 +1175,8 @@ static int mspro_block_init_disk(struct memstick_dev *card) struct mspro_sys_info *sys_info = NULL; struct mspro_sys_attr *s_attr = NULL; int rc, disk_id; - u64 limit = BLK_BOUNCE_HIGH; unsigned long capacity; - if (host->dev.dma_mask && *(host->dev.dma_mask)) - limit = *(host->dev.dma_mask); - for (rc = 0; msb->attr_group.attrs[rc]; ++rc) { s_attr = mspro_from_sysfs_attr(msb->attr_group.attrs[rc]); @@ -1219,7 +1215,6 @@ static int mspro_block_init_disk(struct memstick_dev *card) msb->queue->queuedata = card; - blk_queue_bounce_limit(msb->queue, limit); blk_queue_max_hw_sectors(msb->queue, MSPRO_BLOCK_MAX_PAGES); blk_queue_max_segments(msb->queue, MSPRO_BLOCK_MAX_SEGS); blk_queue_max_segment_size(msb->queue, From patchwork Wed May 9 13:59:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910877 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pyx8d19k"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gyjq4C7Pz9s0W for ; Thu, 10 May 2018 00:02:55 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=7pX42wYPQO9w+a/6zAARizRiyFMOLrGOvDnqhR2SE6M=; b=pyx8d19ksGylXg17FysLypFgh6 bGKfeU0eZhGGLHU5W/VN1gB5v7qi3BD/U4VI/BKKReCvzmVE4rcVqZQTO3XF9LddFnX9/M+4X9ViD SLBZbz7Mikh4Qe/iufB8SnTF+t6xnVHkofMj7mxIKpBx++JGgcpfXqdSo+unnX3ztl8NPUUPOtScT CB5LowAjkdo+lgJJjwr3zWdCLsJxiDwqkaB6yb3s9CQx+SZ3BtPatlqtdSfNELXIHMWYCCZdjFuak KEbM3fDBoTwH660ondRoFivu6hI8lDSU72wHGZgPD5lNKKJ3JflFM8uqwJHuGDwE6SZxwMrCIhxze rKS1rfTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPg9-0005Vl-1k; Wed, 09 May 2018 14:02:49 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdX-00031G-KW; Wed, 09 May 2018 14:00:08 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 4/7] mtd_blkdevs: handle highmem pages Date: Wed, 9 May 2018 15:59:45 +0200 Message-Id: <20180509135948.20329-5-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Just kmap the single payload page before passing it on to the FTL. Signed-off-by: Christoph Hellwig --- drivers/mtd/mtd_blkdevs.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index 16ae4ae8e8f9..29c0bfd74e8a 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -82,7 +82,6 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr, block = blk_rq_pos(req) << 9 >> tr->blkshift; nsect = blk_rq_cur_bytes(req) >> tr->blkshift; - buf = bio_data(req->bio); if (req_op(req) == REQ_OP_FLUSH) { if (tr->flush(dev)) @@ -100,9 +99,14 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr, return BLK_STS_IOERR; return BLK_STS_OK; case REQ_OP_READ: - for (; nsect > 0; nsect--, block++, buf += tr->blksize) - if (tr->readsect(dev, block, buf)) + buf = kmap(bio_page(req->bio)) + bio_offset(req->bio); + for (; nsect > 0; nsect--, block++, buf += tr->blksize) { + if (tr->readsect(dev, block, buf)) { + kunmap(bio_page(req->bio)); return BLK_STS_IOERR; + } + } + kunmap(bio_page(req->bio)); rq_flush_dcache_pages(req); return BLK_STS_OK; case REQ_OP_WRITE: @@ -110,9 +114,14 @@ static blk_status_t do_blktrans_request(struct mtd_blktrans_ops *tr, return BLK_STS_IOERR; rq_flush_dcache_pages(req); - for (; nsect > 0; nsect--, block++, buf += tr->blksize) - if (tr->writesect(dev, block, buf)) + buf = kmap(bio_page(req->bio)) + bio_offset(req->bio); + for (; nsect > 0; nsect--, block++, buf += tr->blksize) { + if (tr->writesect(dev, block, buf)) { + kunmap(bio_page(req->bio)); return BLK_STS_IOERR; + } + } + kunmap(bio_page(req->bio)); return BLK_STS_OK; default: return BLK_STS_IOERR; @@ -418,7 +427,6 @@ int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new) new->rq->queuedata = new; blk_queue_logical_block_size(new->rq, tr->blksize); - blk_queue_bounce_limit(new->rq, BLK_BOUNCE_HIGH); blk_queue_flag_set(QUEUE_FLAG_NONROT, new->rq); blk_queue_flag_clear(QUEUE_FLAG_ADD_RANDOM, new->rq); From patchwork Wed May 9 13:59:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910878 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mp+U7A0J"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gykh4Wqlz9s0W for ; Thu, 10 May 2018 00:03:40 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=OVJCKhQUaERI1VmWch1sYF1pV8onkf3LN24bB2FwEY8=; b=mp+U7A0J/QudGAKvk7JTG6uRwn QLU2QDDl70pbTQcI9XywEilk9SvgLZhMINvNadiJByRueml2dAzcP5Nb6IhYiYkQnTRFBhL7CPllE LO81VkjirVRQEAm0ZgB0SEmfuy/rdTu0cvtVwLFn8JOy0bzCLtpxk3w/XHEnaIB2hQIsnnzaucGtI BU2gywmdAnHHdzMGGaL6g87e7AWttig55vKRMVUS0MELDAAhS3GOywY7jXgU2OcLUF/2NiIXuA3Ud 68IpY5WJ7otvXLpMofHSIPfzE0h6lGh9Sbne8z3Fi7d3Ij7ZpF5PS0vb/IrEijJgqnW5nO42401SZ T3OYe+1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPgl-0005p0-RJ; Wed, 09 May 2018 14:03:27 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdc-0003CL-4E; Wed, 09 May 2018 14:00:12 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 5/7] aoe: handle highmem pages Date: Wed, 9 May 2018 15:59:46 +0200 Message-Id: <20180509135948.20329-6-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use kmap_atomic when copying out of a bio_vec. Signed-off-by: Christoph Hellwig --- drivers/block/aoe/aoeblk.c | 1 - drivers/block/aoe/aoecmd.c | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c index 6797e6c23c8a..027b876370bc 100644 --- a/drivers/block/aoe/aoeblk.c +++ b/drivers/block/aoe/aoeblk.c @@ -388,7 +388,6 @@ aoeblk_gdalloc(void *vp) d->aoemajor, d->aoeminor); goto err_mempool; } - blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); spin_lock_irqsave(&d->lock, flags); WARN_ON(!(d->flags & DEVFL_GD_NOW)); diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 540bb60cd071..096882e54095 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1032,8 +1032,9 @@ bvcpy(struct sk_buff *skb, struct bio *bio, struct bvec_iter iter, long cnt) iter.bi_size = cnt; __bio_for_each_segment(bv, bio, iter, iter) { - char *p = page_address(bv.bv_page) + bv.bv_offset; + char *p = kmap_atomic(bv.bv_page) + bv.bv_offset; skb_copy_bits(skb, soff, p, bv.bv_len); + kunmap_atomic(p); soff += bv.bv_len; } } From patchwork Wed May 9 13:59:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910883 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IQNsSMhQ"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gylN5lC1z9s0W for ; Thu, 10 May 2018 00:04:16 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=M1l3UNcbv4DDCBmCGqwbf2LHuCVXtQOHe67RsbnjfsE=; b=IQNsSMhQ59EYrumwc8twONuzJw yM1Ml9zYhe34o0vdpakOIFe37pYY0Qn2WMhJwPfQB6s4+3ZO2BWEb8xjY6pcANZm+p4BI17LImTZJ Wz5fFcVXHbImOgK3KTsfQqznj9Gebf9A+wA8df4zEv1V3TUMLKcCSIg9gF6qXW3T96TbxjAQTPiJe U/qdgVukDu43G6i+LVaw1ybmjzs0oihEIUwm+NLUJA0x1PsUsrOD81oqmVG52F8HcOcbF1320w8Cm rz/7/cz+PFiye53wH3UBPEdJ3lF8BUeItyp/PqrcSr2QJ7IIEr6w8EhdicFVaW3y0lSDdw8R7L3Z9 gJWjWWqQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPhR-00068G-IE; Wed, 09 May 2018 14:04:09 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdg-0003OB-IL; Wed, 09 May 2018 14:00:17 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 6/7] jsflash: handle highmem pages Date: Wed, 9 May 2018 15:59:47 +0200 Message-Id: <20180509135948.20329-7-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Just kmap the bio single page payload before processing it. (and yes, now highmem on sparc32 anyway, but kmap_(un)map atomic are nops, so this gives the right example) Signed-off-by: Christoph Hellwig --- drivers/sbus/char/jsflash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c index 14f377ac1280..8520587b8d09 100644 --- a/drivers/sbus/char/jsflash.c +++ b/drivers/sbus/char/jsflash.c @@ -215,6 +215,7 @@ static void jsfd_request(void) unsigned long offset = blk_rq_pos(req) << 9; size_t len = blk_rq_cur_bytes(req); blk_status_t err = BLK_STS_IOERR; + void *p; if ((offset + len) > jdp->dsize) goto end; @@ -229,7 +230,9 @@ static void jsfd_request(void) goto end; } - jsfd_read(bio_data(req->bio), jdp->dbase + offset, len); + p = kmap_atomic(bio_page(bio)) + bio_offset(bio); + jsfd_read(p, jdp->dbase + offset, len); + kunmap_atomic(p); err = BLK_STS_OK; end: if (!__blk_end_request_cur(req, err)) @@ -592,7 +595,6 @@ static int jsfd_init(void) put_disk(disk); goto out; } - blk_queue_bounce_limit(disk->queue, BLK_BOUNCE_HIGH); jsfd_disk[i] = disk; } From patchwork Wed May 9 13:59:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 910885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Y/C/HlwT"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40gymC0T93z9s3Z for ; Thu, 10 May 2018 00:04:59 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=nNPGYNe0cBIbknUeOluUZeEPO5dzIXhSoECoIvdS72E=; b=Y/C/HlwThkI2WbpoTxduVPGiUU UbbZqQKU7iXaBApkjNZQ6Qzr/VRczFO07kU4hhHfVNmXTkeem3P3xxkhC5InUV5Vc7ensVzycN7Ok haZycA9QfvYz74Q8MClhVTmhcAtkLsZzwPQHa0Kk5Q9NcdFqQRSQ/lA0RqhCuQndfp87kD/8TJk7d v4+reJtAlMGf+fAtahqhbA49seGhQhes6hKQzY7/o9gfTc88frZjISVTx5JC+oVSXe0V9qAabqBhz c3Gt02pyAyiioEDjAorKPFeyqea08bzY7VmS8gewqnSx7plLbx8UbbmT8VLwq32CdNZ9cIl+HAtXz mHb2hnzQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPi4-0006Ri-Hz; Wed, 09 May 2018 14:04:48 +0000 Received: from 213-225-15-246.nat.highway.a1.net ([213.225.15.246] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGPdl-0003iU-Gs; Wed, 09 May 2018 14:00:22 +0000 From: Christoph Hellwig To: Jens Axboe Subject: [PATCH 7/7] ps3disk: handle highmem pages Date: Wed, 9 May 2018 15:59:48 +0200 Message-Id: <20180509135948.20329-8-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180509135948.20329-1-hch@lst.de> References: <20180509135948.20329-1-hch@lst.de> X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Levitsky , Geoff Levand , "Ed L. Cashin" , linux-block@vger.kernel.org, linux-mtd@lists.infradead.org, sparclinux@vger.kernel.org, linuxppc-dev@lists.ozlabs.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The ps3disk driver already kmaps all pages when copying from/to the internal bounce buffer, so it can accept highmem pages just fine. Signed-off-by: Christoph Hellwig --- drivers/block/ps3disk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/ps3disk.c b/drivers/block/ps3disk.c index 075662f2cf46..afe1508d82c6 100644 --- a/drivers/block/ps3disk.c +++ b/drivers/block/ps3disk.c @@ -465,8 +465,6 @@ static int ps3disk_probe(struct ps3_system_bus_device *_dev) priv->queue = queue; queue->queuedata = dev; - blk_queue_bounce_limit(queue, BLK_BOUNCE_HIGH); - blk_queue_max_hw_sectors(queue, dev->bounce_size >> 9); blk_queue_segment_boundary(queue, -1UL); blk_queue_dma_alignment(queue, dev->blk_size-1);