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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no 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 B16ECC433E0 for ; Wed, 10 Feb 2021 09:00:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 64AB164E53 for ; Wed, 10 Feb 2021 09:00:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230064AbhBJJAE (ORCPT ); Wed, 10 Feb 2021 04:00:04 -0500 Received: from verein.lst.de ([213.95.11.211]:49933 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230091AbhBJI6M (ORCPT ); Wed, 10 Feb 2021 03:58:12 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 37B6B6736F; Wed, 10 Feb 2021 09:57:25 +0100 (CET) Date: Wed, 10 Feb 2021 09:57:24 +0100 From: Christoph Hellwig To: Thomas Bogendoerfer Cc: Christoph Hellwig , Greg Kroah-Hartman , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH 4/6] MIPS: refactor the maybe coherent DMA indicators Message-ID: <20210210085724.GA24610@lst.de> References: <20210208145024.3320420-1-hch@lst.de> <20210208145024.3320420-5-hch@lst.de> <20210209131237.GB11915@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210209131237.GB11915@alpha.franken.de> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Tue, Feb 09, 2021 at 02:12:37PM +0100, Thomas Bogendoerfer wrote: > > +#ifdef CONFIG_DMA_MAYBE_COHERENT > > +extern bool dma_default_coherent; > > static inline bool dev_is_dma_coherent(struct device *dev) > > { > > - return coherentio == IO_COHERENCE_ENABLED || > > - (coherentio == IO_COHERENCE_DEFAULT && hw_coherentio); > > + return dma_default_coherent; > > this breaks overriding of coherentio via command line. plat_mem_setup/ > plat_setup_iocoherency is called before earlyparams are handled. So > changing coherentio after that doesn't have any effect. Hmm. In that case a manual override does actually work for alchemy, as that initializes coherentio from plat_mem_setup(). But the elaborate sanity checking that malta performs in plat_setup_iocoherency is rather pointless then, as coherentio will always be set to IO_COHERENCE_DISABLED at this point.