Received: by 10.192.165.148 with SMTP id m20csp4967031imm; Tue, 24 Apr 2018 11:20:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx499FbIdatw5jlYtjtp3ihdA/iDtAE8EJljf9Hua71PsCXcSFyHMbV1iCXJ3jYalfaLDTjhX X-Received: by 2002:a17:902:a58a:: with SMTP id az10-v6mr16995577plb.210.1524594003477; Tue, 24 Apr 2018 11:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524594003; cv=none; d=google.com; s=arc-20160816; b=SPik4/9QHswKBvGY/MRoUvzgUn8DNO76dCEWLJ/zSdUBq8vpWqN26jK5zP46HhEys9 pbvhZ8jWaUAHZkgR7fLACXO/u+W995OYDZ1DIWo01gI1MLVj7+pfPGHwsrW1c8wzkrQJ BhEja7nqFXfxDig0Z+ZbwcLN3EBDk13arCIdSULixTwJJI4mKmXKAj/cCfHb6zN/1ogD VePhbclLQQK65PW57UTQEBv64X4OC3wpCPXlUyEexa/c2Bxgsq1prvOQ2LLXFJNmymWo 0HRpISgRSKicIPusk5Go8rSiDVpLDv2Jf2L7j7Od8J8WbvFtbgwVYGQpCgH4+GVoiwlU R2wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=W/I2mxTovESZMRD8O84EDFuf7iR7AllptNfq6JX3Vqw=; b=vbLkFujgzL7jmwbRA4BtAesT8ae+dF7AmGLi3aeqKV9JaIEUMgpT8PdBni0NVrCQ4s JpHrwp2iclsjwnj1DAzrdwWs7WBltmokVBsthOGJJwiAxZociXrcT0Cz+KIESFC+n3M4 NE9T1l3qz34D+K8i3PlgP1u9gYlaZ4qwIhy2AGG14BvfPXo2ZuAPrndyrbTwAQkRWDGi aHcRFVYhfYfxUzlDXWh7E3Dfrcqac3Rj0en3FDjK7X9KskhabQmIGFufUTDNpaljgba/ NUQkVoocDC6GnjnoDJYbF5P6piiF0fxzQY+pN3SeDmJMj+Y2AZyVVQSZw0w4t4PMBFuY dR3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RosOVvaP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si6864525pgc.37.2018.04.24.11.19.49; Tue, 24 Apr 2018 11:20:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RosOVvaP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753007AbeDXSSM (ORCPT + 99 others); Tue, 24 Apr 2018 14:18:12 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:54482 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbeDXSQh (ORCPT ); Tue, 24 Apr 2018 14:16:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding: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=W/I2mxTovESZMRD8O84EDFuf7iR7AllptNfq6JX3Vqw=; b=RosOVvaPSJ5XK2HWpbwbudccS A26t7iHLKyLb1u6PU7W3tFytmD4WyRfdev33OepQyErlbzYrxfX9UsOGLyFQoOZCH7vspJZVH6iTG bCO91SGo2NOhYBO2rv9e7Jjv9S9cBywFU7rD5QliNB8niuIk6kjc7/cUKxFy01IN8w9O/fLuq1kZg gao5CC45++6lUcrmMfRlPyYe2mnod8kFng2VP1QCQ0TOB15maorNqFXr2A8kJAV87PaC4Nv2Bkj0b 3V+mLbE2t24BdKSvGH+UkJeaZgTNfl1DdhibnQfOk/ZzSqor0v1CCacWGE1GOVlbj4b35zSbDsxJB ZvcCyqCHA==; Received: from 213-225-11-78.nat.highway.a1.net ([213.225.11.78] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fB2UW-0007to-F1; Tue, 24 Apr 2018 18:16:36 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org, linux-arch@vger.kernel.org, linux-block@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, netdev@vger.kernel.org Cc: "David S. Miller" , linux-kernel@vger.kernel.org Subject: [PATCH 2/5] ide: kill ide_toggle_bounce Date: Tue, 24 Apr 2018 20:16:22 +0200 Message-Id: <20180424181625.22410-3-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180424181625.22410-1-hch@lst.de> References: <20180424181625.22410-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ide_toggle_bounce did select various strange block bounce limits, including not bouncing at all as soon as an iommu is present in the system. Given that the dma_map routines now handle any required bounce buffering except for ISA DMA, and the ide code already must handle either ISA DMA or highmem at least for iommu equipped systems we can get rid of the block layer bounce limit setting entirely. Signed-off-by: Christoph Hellwig --- drivers/ide/ide-dma.c | 2 -- drivers/ide/ide-lib.c | 26 -------------------------- drivers/ide/ide-probe.c | 3 --- include/linux/ide.h | 2 -- 4 files changed, 33 deletions(-) diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 54d4d78ca46a..6f344654ef22 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c @@ -180,7 +180,6 @@ EXPORT_SYMBOL_GPL(ide_dma_unmap_sg); void ide_dma_off_quietly(ide_drive_t *drive) { drive->dev_flags &= ~IDE_DFLAG_USING_DMA; - ide_toggle_bounce(drive, 0); drive->hwif->dma_ops->dma_host_set(drive, 0); } @@ -211,7 +210,6 @@ EXPORT_SYMBOL(ide_dma_off); void ide_dma_on(ide_drive_t *drive) { drive->dev_flags |= IDE_DFLAG_USING_DMA; - ide_toggle_bounce(drive, 1); drive->hwif->dma_ops->dma_host_set(drive, 1); } diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index e1180fa46196..78cb79eddc8b 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c @@ -6,32 +6,6 @@ #include #include -/** - * ide_toggle_bounce - handle bounce buffering - * @drive: drive to update - * @on: on/off boolean - * - * Enable or disable bounce buffering for the device. Drives move - * between PIO and DMA and that changes the rules we need. - */ - -void ide_toggle_bounce(ide_drive_t *drive, int on) -{ - u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ - - if (!PCI_DMA_BUS_IS_PHYS) { - addr = BLK_BOUNCE_ANY; - } else if (on && drive->media == ide_disk) { - struct device *dev = drive->hwif->dev; - - if (dev && dev->dma_mask) - addr = *dev->dma_mask; - } - - if (drive->queue) - blk_queue_bounce_limit(drive->queue, addr); -} - u64 ide_get_lba_addr(struct ide_cmd *cmd, int lba48) { struct ide_taskfile *tf = &cmd->tf; diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index 2019e66eada7..8d8ed036ca0a 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -805,9 +805,6 @@ static int ide_init_queue(ide_drive_t *drive) /* assign drive queue */ drive->queue = q; - /* needs drive->queue to be set */ - ide_toggle_bounce(drive, 1); - return 0; } diff --git a/include/linux/ide.h b/include/linux/ide.h index ca9d34feb572..11f0dd03a4b4 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -1508,8 +1508,6 @@ static inline void ide_set_hwifdata (ide_hwif_t * hwif, void *data) hwif->hwif_data = data; } -extern void ide_toggle_bounce(ide_drive_t *drive, int on); - u64 ide_get_lba_addr(struct ide_cmd *, int); u8 ide_dump_status(ide_drive_t *, const char *, u8); -- 2.17.0