From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6FE7C28CC6 for ; Wed, 5 Jun 2019 19:10:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A16A820717 for ; Wed, 5 Jun 2019 19:10:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="W0COMIoN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfFETIy (ORCPT ); Wed, 5 Jun 2019 15:08:54 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:44440 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726461AbfFETIy (ORCPT ); Wed, 5 Jun 2019 15:08:54 -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=2ex9Z2d7jbc5bnEXbMR2ptptCi3L56lPOpUN37M2uJs=; b=W0COMIoNl6a4jD0EeZ9GxwcAzE kGjAz0/uc4Yl0BkxnZ3awiHAA0zMlOywp/SgN4c05/W4ytpafDOMsF4VMqDBbgaJjrzMliLTiB0SH rY1LipvtRvSYmQhq64DFd1mGIbBshLikmieNysNbAIanhWhF+gxblbkQ4M/C78dt9P6viv0SVtimo o+N1OPF62BmZjkopD3TQjJQemjIZjoLNhksAHsedYsBKWsCuks/ywUtGB4EXax4+OVvzu38hDdAi9 xFsjdBhcI7I0eIeVJC9HrGH4KLi7FOShQIlqLHmbxeYldvNmN4TF5UZpI5EcdhXmoUv5DC/XMj5gf TgL4v39Q==; Received: from 089144193064.atnat0002.highway.a1.net ([89.144.193.64] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYbH8-0005D5-E5; Wed, 05 Jun 2019 19:08:42 +0000 From: Christoph Hellwig To: Jens Axboe Cc: Sebastian Ott , Sagi Grimberg , Max Gurtovoy , Bart Van Assche , Ulf Hansson , Alan Stern , Oliver Neukum , linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, linux-mmc@vger.kernel.org, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, megaraidlinux.pdl@broadcom.com, MPT-FusionLinux.pdl@broadcom.com, linux-hyperv@vger.kernel.org, linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net, linux-kernel@vger.kernel.org Subject: [PATCH 01/13] nvme-pci: don't limit DMA segement size Date: Wed, 5 Jun 2019 21:08:24 +0200 Message-Id: <20190605190836.32354-2-hch@lst.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190605190836.32354-1-hch@lst.de> References: <20190605190836.32354-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-hyperv-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hyperv@vger.kernel.org NVMe uses PRPs (or optionally unlimited SGLs) for data transfers and has no specific limit for a single DMA segement. Limiting the size will cause problems because the block layer assumes PRP-ish devices using a virt boundary mask don't have a segment limit. And while this is true, we also really need to tell the DMA mapping layer about it, otherwise dma-debug will trip over it. Signed-off-by: Christoph Hellwig Reported-by: Sebastian Ott --- drivers/nvme/host/pci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index f562154551ce..524d6bd6d095 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -2513,6 +2513,12 @@ static void nvme_reset_work(struct work_struct *work) */ dev->ctrl.max_hw_sectors = NVME_MAX_KB_SZ << 1; dev->ctrl.max_segments = NVME_MAX_SEGS; + + /* + * Don't limit the IOMMU merged segment size. + */ + dma_set_max_seg_size(dev->dev, 0xffffffff); + mutex_unlock(&dev->shutdown_lock); /* -- 2.20.1