Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4865065imm; Tue, 9 Oct 2018 06:28:23 -0700 (PDT) X-Google-Smtp-Source: ACcGV62SEK83UKeewsZnBOTgc9/BgL06MRfTaq09+TzT4ILVSURZzY90xIn2RPFatoCWemhlPM0s X-Received: by 2002:a63:6d83:: with SMTP id i125-v6mr24872176pgc.215.1539091703759; Tue, 09 Oct 2018 06:28:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539091703; cv=none; d=google.com; s=arc-20160816; b=YCRZsrPqw9VAbjILTnV+KsXeiREvApHR971NA8zMslbHQuwQ3dzdR8ltqralaSyll1 6Z23DmzPoAUYaBHg6GT8qBQtL9m9ONOPzEYSjKBfogLHmcfwMuz9WFoU7Jd0h9srjFHL zdK0QUBFmVJZoln1VIpiSuu1s6uSrq5BqzQRLF1q05LAFGv/JF/sraioMcv0k1EZhbCk oCMQZdKKk4Z5jgKthNj8F0nllWw9udHbjsGU1Vy0wZoYZ4qdJYex8P8+uCkbNGEJTIHt lYvSsn1J3TRyE+SsJ2OTv4TORZ2JZWgbggZ3Imwz1Aw3BBUqbQfDLpQz1Lib/JJQt8W/ vb2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rhvZ9hpGPuuxCEIVPRN0AfR1n9umfTu+Rj50rDnMvn0=; b=EfJ7l2Yz293jNOORN2dUr2JL5TCWbwuNgsW+qVuS9N9GdjdPh6iNKhi200ZGjRw4Gb ym4P9fnPtZTX62l03t12IKvfaplMOzzLDYJdJTSFEh0ochYbR4JGPEd9HuSyWsLfz9x9 ONL+y1ptgUXYbnIA5i+vDwXtsE/N/21jXgyo0+IntndjsWw4nrSio5I+eQx8AJfu14gz TeQmlZSgMrmQQhLMXlO/0/zASl6sI3Np+e/AK4RrgakqyeZJ4ZFuDh1aA0gGBx7FIdM+ Fn/QkOHm3T10NQ7lZOU47PIl9x5DXLW796K3vR+YMR3NbyI8DvroHeYMAZwaxkyJyJvg 750w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=tIPTZV00; 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 o9-v6si20325800plk.4.2018.10.09.06.28.09; Tue, 09 Oct 2018 06:28:23 -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=tIPTZV00; 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 S1727977AbeJIUnh (ORCPT + 99 others); Tue, 9 Oct 2018 16:43:37 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50584 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727965AbeJIUnh (ORCPT ); Tue, 9 Oct 2018 16:43:37 -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=rhvZ9hpGPuuxCEIVPRN0AfR1n9umfTu+Rj50rDnMvn0=; b=tIPTZV00fcQtIlC3PL5dfu7G1m s5PDg5sM2GO4v6FDj1h95I9EvzJjKhy78N1Yhl963NGJ4q8l7M87quNsuK6TAcgA0FnZkGF7L6M3R sCXfhaSIG9gmRbeTC/mrYMcjNtOU4MquxVUF8qEcF7ld+tvHiWlAt9EXHLeCdfpKQHo9oI1uQk7sW 1QwOxcMBAVRSMC8O5QBWT9AMk5Dow2eUCHWUHIlPtgFmKULPrfJzl8dIGklp5FLEcm9HmMcOp8vFM foaJpKDlE/sSsnoiUr0dtaoS8rtZpJeSOljP95oiUU5jlbFYNSjqQFIZTYuFsR56h+0aGs1p+g0Fp Fa6712tg==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9s1Y-0001VV-M9; Tue, 09 Oct 2018 13:26:09 +0000 From: Christoph Hellwig To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 26/33] powerpc/fsl_pci: simplify fsl_pci_dma_set_mask Date: Tue, 9 Oct 2018 15:24:53 +0200 Message-Id: <20181009132500.17643-27-hch@lst.de> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181009132500.17643-1-hch@lst.de> References: <20181009132500.17643-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org swiotlb will only bounce buffer the effectice dma address for the device is smaller than the actual DMA range. Instead of flipping between the swiotlb and nommu ops for FSL SOCs that have the second outbound window just don't set the bus dma_mask in this case. Signed-off-by: Christoph Hellwig --- arch/powerpc/sysdev/fsl_pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c index f136567a5ed5..296ffabc9386 100644 --- a/arch/powerpc/sysdev/fsl_pci.c +++ b/arch/powerpc/sysdev/fsl_pci.c @@ -143,7 +143,7 @@ static int fsl_pci_dma_set_mask(struct device *dev, u64 dma_mask) * mapping that allows addressing any RAM address from across PCI. */ if (dev_is_pci(dev) && dma_mask >= pci64_dma_offset * 2 - 1) { - set_dma_ops(dev, &dma_nommu_ops); + dev->bus_dma_mask = 0; set_dma_offset(dev, pci64_dma_offset); } @@ -403,10 +403,6 @@ static void setup_pci_atmu(struct pci_controller *hose) out_be32(&pci->piw[win_idx].piwar, piwar); } - /* - * install our own dma_set_mask handler to fixup dma_ops - * and dma_offset - */ ppc_md.dma_set_mask = fsl_pci_dma_set_mask; pr_info("%pOF: Setup 64-bit PCI DMA window\n", hose->dn); -- 2.19.0