Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp555715imd; Thu, 1 Nov 2018 01:34:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5d2ZYAkn7T3ebLeAyLerYJFRfHqMcjQTmZDtw5Q8pyLd3YwsTkbDNuFwuzOYeRN2hyPRS25 X-Received: by 2002:a17:902:b183:: with SMTP id s3-v6mr6468099plr.70.1541061279659; Thu, 01 Nov 2018 01:34:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541061279; cv=none; d=google.com; s=arc-20160816; b=mx23F9TxjpzbLSb/cTxBhaoN1ncbFJITBmagodfbVJz39mpQbSsMq8GPlxHP7NYGJ5 yt54SYp5fLudlBmMjb+XP2opgzYFhZ0V3lBpU/3ucYNYa3M2yJhbZq+TQLuz5Ds4feUg 52xFXD1yW6yWmmDFdPImovjI6r4rMjy2eM2x/YzsW3g7Q5uaD4tycfPTGslwFfWsAOwk 2+ON1ZkBDaKPDOzzlR2UIQ9eqOA+j4hxKCIyKnq5FnjXEfEdVQbVJtkJnudY5mUikHx6 JUGWvK2T0V2wc2xPPOMe6AfHG4La5IWriNZquc9NkZi5JJjgUevzQdGYvNA3/7brYvCc 49eQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=itUzJg42fImMQ//xWOh6FakXzcJHilZe14g6BMylhg0=; b=Ip0zsxWdYm4dD4QOtBLXgcgRUMR9xcCbMYmmIKJBDw9SZK6HeGAEZ/gOjdPT7GWKLz w6znMetmD6uyJZXm+EQ9Hb1c/7wPYg+EXu4pz2LExdKJ8owYC8iACV2euTSolt+XN9U8 IZp8R/xq35ulN4iYCrM2zEptvVtWF5YNh/s6cfQbDp0XcyFYvMmChJDTtXKtKg+6cyHB BT44/2uf8w2d4c/cYljwY4OC7EYFEz9Pha++o40bhaPl/DZrM/p7r1ehyMMrLi0fP54A wT/oGKG0Osola47I/Ow1pzWzua6yvppPGOCmzZhJGCDeUXkfPxG7EAfMMJdkNl9cK/IU oNVw== ARC-Authentication-Results: i=1; mx.google.com; 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 20si5661792pgg.271.2018.11.01.01.34.24; Thu, 01 Nov 2018 01:34:39 -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; 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 S1728001AbeKARfr (ORCPT + 99 others); Thu, 1 Nov 2018 13:35:47 -0400 Received: from verein.lst.de ([213.95.11.211]:43098 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727704AbeKARfr (ORCPT ); Thu, 1 Nov 2018 13:35:47 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 196CC7F1C0; Thu, 1 Nov 2018 09:33:46 +0100 (CET) Date: Thu, 1 Nov 2018 09:33:46 +0100 From: Christoph Hellwig To: "Maciej W. Rozycki" Cc: Christoph Hellwig , Paul Burton , iommu@lists.linux-foundation.org, Marek Szyprowski , Robin Murphy , Greg Kroah-Hartman , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] MIPS: Fix `dma_alloc_coherent' returning a non-coherent allocation Message-ID: <20181101083346.GA7136@lst.de> References: <20180914095808.22202-1-hch@lst.de> <20180914095808.22202-5-hch@lst.de> <20181031203206.GA28337@lst.de> <20181101051359.GA4164@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 01, 2018 at 07:54:24AM +0000, Maciej W. Rozycki wrote: > Fix a MIPS `dma_alloc_coherent' regression from commit bc3ec75de545 > ("dma-mapping: merge direct and noncoherent ops") that causes a cached > allocation to be returned on noncoherent cache systems. > > This is due to an inverted check now used in the MIPS implementation of > `arch_dma_alloc' on the result from `dma_direct_alloc_pages' before > doing the cached-to-uncached mapping of the allocation address obtained. > The mapping has to be done for a non-NULL rather than NULL result, > because a NULL result means the allocation has failed. > > Invert the check for correct operation then. > > Signed-off-by: Maciej W. Rozycki > Fixes: bc3ec75de545 ("dma-mapping: merge direct and noncoherent ops") > Cc: stable@vger.kernel.org # 4.19+ Oops, yes this looks good: Reviewed-by: Christoph Hellwig