Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5990588imm; Mon, 27 Aug 2018 07:52:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYd1fjkDxSKqZxr/SLGbFcyH46tb9phbCKuu2lbVwmxCWBxi1sAwI7G0HEwoq9jSMvmfqf7 X-Received: by 2002:a17:902:28a4:: with SMTP id f33-v6mr13512080plb.297.1535381537761; Mon, 27 Aug 2018 07:52:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535381537; cv=none; d=google.com; s=arc-20160816; b=nMH+ItATI6aT7To81oYu9VGGNDvbnuGJ+RclhQnBkpqkGmfCWW7E+rvaWU3GUy5xja 0iMf3zwc561oYHo8MvHHRtXNpR7+iOvDXOOrBFCksl5P930Hff6vnfRoUj6Ttct99DuN DhFgj70870LjHGtAYSaRgdBNLLelZ/mmLtCLedMLoA24YXaMsmKVbYrInLsdThROUYVB rTP2kuUuq8SXSnfmPd9c4cCQBVHiC+0WKMoHjzKgc7wo0dLWcngYjEgJnKrs1fcP9qZQ Jt0cGED3HprOEusVUHWSonU3fq2RULbafpyeNC/Kpzdgxw1HxDWYBkVyEyJKxm78mUDm +KrQ== 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=+1q0YrFsje/c9JxM7S1GXJ+Selqn9u0h3rTaKOuMI/w=; b=QuY9judPlxHpK/C2h+p9yQh1sTHo1rm1LNVeVYe4MyKJs1zqS5KUEWkEdADRGevISd IrwLgErcg+6bn5ZLxLzmMx7Rk5MJDo4LXwJx1CXFBs13NJP+KkgMns+YABU8SG726yN1 6AOS+pzbffcw6xYyWnPDBAnf5AHbyXeqga3fYmPagni8BclWksCQtvd2VEeZmf0h9IEj aJmLh//6+iGYKoyaRs1RRHxRpuMMvUIElrpZlRnr1lNFEpuf2TYF1BymTqcI9TZH4dtd DzFPw/54Lt1GDTZRNcLLoT7hAujkabirv6vZ1ePMq7W7LFMXeTwx41hICcMhW5zKtnBn quyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Feku2z1f; 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 c128-v6si15551804pfg.347.2018.08.27.07.52.02; Mon, 27 Aug 2018 07:52:17 -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=Feku2z1f; 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 S1727337AbeH0Shp (ORCPT + 99 others); Mon, 27 Aug 2018 14:37:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:38778 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727174AbeH0Shp (ORCPT ); Mon, 27 Aug 2018 14:37:45 -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=+1q0YrFsje/c9JxM7S1GXJ+Selqn9u0h3rTaKOuMI/w=; b=Feku2z1fclxXa0Ut9Nz9geDnn maNgDvV2C2czxu0uGKCaHrPF7v+jaIvmtTCV0sbrR0wzBVLaqCME6G28pMOT70zPcqqDUDpDEIoR1 6BUZMtvnFKfXhUtEDpC0fTPlq7kYGXsw2Ag5UMme2hbPeLqtnXkqKdO8I1daJa6v/YLTtvvT5L4+h VMSRInXTKaSLPuCMCdfXftkIzT2AC1n6xTTHmakF/v2kFFJ+odLOMJgnwVjwNTg/2mVEPVDQ4WUgw wf3xyLW+ACrvnS/KMe+fzaOXvyLmhGFv4hQnMyBqk3dLNeCg8rPdmG8hGwje0f6tfL+SNgUnPsmD6 dgpx0JN6Q==; Received: from 089144202128.atnat0011.highway.a1.net ([89.144.202.128] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fuIqo-0004VR-IC; Mon, 27 Aug 2018 14:50:44 +0000 From: Christoph Hellwig To: iommu@lists.linux-foundation.org Cc: Marek Szyprowski , Robin Murphy , Paul Burton , Greg Kroah-Hartman , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] MIPS: don't select DMA_MAYBE_COHERENT from DMA_PERDEV_COHERENT Date: Mon, 27 Aug 2018 16:50:28 +0200 Message-Id: <20180827145032.9522-2-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180827145032.9522-1-hch@lst.de> References: <20180827145032.9522-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 While both option select a form of conditional dma coherence they don't actually share any code in the implementation, so untangle them. Signed-off-by: Christoph Hellwig --- arch/mips/Kconfig | 2 +- arch/mips/kernel/setup.c | 2 +- arch/mips/mm/c-r4k.c | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 35511999156a..0b25180028b8 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1111,7 +1111,7 @@ config DMA_MAYBE_COHERENT config DMA_PERDEV_COHERENT bool - select DMA_MAYBE_COHERENT + select DMA_NONCOHERENT config DMA_NONCOHERENT bool diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index c71d1eb7da59..6d840a44fa36 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -1067,7 +1067,7 @@ static int __init debugfs_mips(void) arch_initcall(debugfs_mips); #endif -#if defined(CONFIG_DMA_MAYBE_COHERENT) && !defined(CONFIG_DMA_PERDEV_COHERENT) +#ifdef CONFIG_DMA_MAYBE_COHERENT /* User defined DMA coherency from command line. */ enum coherent_io_user_state coherentio = IO_COHERENCE_DEFAULT; EXPORT_SYMBOL_GPL(coherentio); diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index a9ef057c79fe..05bd77727fb9 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -1955,22 +1955,21 @@ void r4k_cache_init(void) __flush_icache_user_range = r4k_flush_icache_user_range; __local_flush_icache_user_range = local_r4k_flush_icache_user_range; -#if defined(CONFIG_DMA_NONCOHERENT) || defined(CONFIG_DMA_MAYBE_COHERENT) -# if defined(CONFIG_DMA_PERDEV_COHERENT) - if (0) { -# else - if ((coherentio == IO_COHERENCE_ENABLED) || - ((coherentio == IO_COHERENCE_DEFAULT) && hw_coherentio)) { -# endif +#ifdef CONFIG_DMA_NONCOHERENT +#ifdef CONFIG_DMA_MAYBE_COHERENT + if (coherentio == IO_COHERENCE_ENABLED || + (coherentio == IO_COHERENCE_DEFAULT && hw_coherentio)) { _dma_cache_wback_inv = (void *)cache_noop; _dma_cache_wback = (void *)cache_noop; _dma_cache_inv = (void *)cache_noop; - } else { + } else +#endif /* CONFIG_DMA_MAYBE_COHERENT */ + { _dma_cache_wback_inv = r4k_dma_cache_wback_inv; _dma_cache_wback = r4k_dma_cache_wback_inv; _dma_cache_inv = r4k_dma_cache_inv; } -#endif +#endif /* CONFIG_DMA_NONCOHERENT */ build_clear_page(); build_copy_page(); -- 2.18.0