Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp568390imm; Fri, 14 Sep 2018 03:01:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYTCS8A1y2soSSlKMPNrj4PV098fA5Sm3DpwztYLAZ9nvDsL48PA05RZKL9x8KPtW/TH3DN X-Received: by 2002:aa7:881a:: with SMTP id c26-v6mr455073pfo.82.1536919270448; Fri, 14 Sep 2018 03:01:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536919270; cv=none; d=google.com; s=arc-20160816; b=RJbrfdez357jFRb6F3+Mr+XNp6vqTjZ7IU5vuR5nvQbULwWv66U4KK/8/VFm/KUiyX 2F+tjBeiJojNmDxjH5TKfGUbs75KifnYkkhIB7C7n5v7SKq4bHFWr4t0lVgUAEP3wc6c 9bXjN4bM4igiiIdGrd6XjXs/P64uL3oEWsB84aykYNe7J6A9QDGn+N1H65omfrUynbFX rPxgGIGb+EOMxcNwg+YlSYJOolPnR+EUjri3xbXHsVQWev7UzYB2GTZ8QeCqlqdr4aLW tCai4u1k+Xf5qj9jBK5nnvlRnmBivJsDLTAZnt1fJXBu+nC0vF95v3yDcWFn3x9saue4 oJNQ== 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; bh=aYDMexnkrCtlRs/Rk2EfhjL4KIhddofkXoarJAzdIfI=; b=a1Gbq4eoWD+da3Grh3PgHv2x4Kc4OLFSf7440S3E4IOpS+7OcI2fgnY9TIqLCCBrfm BQ7MKG7ok1pyfk2edKADFeW7bmPd22XsS7IiOnW/3qmeI36IkwvlKf6SqH7NgG2xBQp5 YyQRyZzZf0FfMGsfDR6L6Ecl6XH43oh+lnbi/mQmrOu0BNofHfbR2rrQPm/Tns227OYn kFJywpfLq8+xj8EAI6kjc7aqPkILXQD0gNg1NBYrPjqwETdlUK5DmOKTD5TINXmTK+Io aZp/Lf4y/8NAmXLEKUp9k7MyEUWbBMm93CYJdE4+LFIPanr4nmMjZshbTnRySPBo0Uax pPeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=ZYiyBxkE; 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 v6-v6si6552322plo.264.2018.09.14.03.00.55; Fri, 14 Sep 2018 03:01:10 -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=ZYiyBxkE; 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 S1728076AbeINPMm (ORCPT + 99 others); Fri, 14 Sep 2018 11:12:42 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59182 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726618AbeINPML (ORCPT ); Fri, 14 Sep 2018 11:12:11 -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=aYDMexnkrCtlRs/Rk2EfhjL4KIhddofkXoarJAzdIfI=; b=ZYiyBxkEUu7Qq5pBeoBMWctVg X6pAc/QURs38uWk9Hui6rkmvQvtpMpJKiIF/wsjHsl6lyQiQWDIARLfOYKglKnolOq7pGRMKTRAoH 0rt2gEQJUcuh4nj0KRJw1Uu+bA2NBDob3Vu4wR0peOrKFuBnc/4CJvlMBDh/IlxGo5C2gYyMNN2ux ur0mP4/rRLkXnGJSiZOddErccotgd6S/ldPZBh/dnCtKsds7KJCniX6rtXVXSy1ZlzJbLKlkFCN5c 54UASZEQ2yDueWN11+dIXnq0eMGqSf6X+5I+XW7bV7Ff5ku5vZkFlF7sEl2zBjg2j4oNCUsaNLt5E K0yVAD78g==; Received: from 089144198037.atnat0007.highway.a1.net ([89.144.198.37] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0kri-0000S3-Tk; Fri, 14 Sep 2018 09:58:19 +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 2/6] MIPS: don't select DMA_MAYBE_COHERENT from DMA_PERDEV_COHERENT Date: Fri, 14 Sep 2018 11:58:04 +0200 Message-Id: <20180914095808.22202-3-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180914095808.22202-1-hch@lst.de> References: <20180914095808.22202-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 Acked-by: Paul Burton --- 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