Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3630826imm; Tue, 17 Jul 2018 07:55:41 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcC2J9uqra4hZGg+ecGNIm7S8XyaV18XA63shv09ihcJuiPWXYvSJ8LNH3CZTNR6H067xIs X-Received: by 2002:a17:902:b612:: with SMTP id b18-v6mr1927566pls.131.1531839341418; Tue, 17 Jul 2018 07:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531839341; cv=none; d=google.com; s=arc-20160816; b=eX3LPuCb8N5G8QAAPTtOqmyHYCAVlIwcxYAPCcx5MjUuvkCEVxFrL7CJ6Ogx8Gqnmx TgO3Bsf9ORqkoBRblnkJ5tPXPsaOgp1OqNdBfxFxDw+b0leocuBlfKzpn0rK3lSJkoQH lQvhDdwVDjJ7nNqwJWWhY4wTyeHxnYIDyTpQ4Ocn4GHnFroqMVq4U6qvy1oNexXLl8P4 xJrR4aT0CCQ+pneEeD5l+UWnA1iLP8l6CzhX6XRd8mYrO8SgO4FNPyQrthqwsGhm4cZL gbNA7wtth9GliSVRyudTbxGxxAEbPJnrNzYaCL88bBSFVl7fzN+oi/eueh+bkET5bEOi AU3w== 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:arc-authentication-results; bh=jyX5trBKrS8J9bw847sR9xlHB1soyruDqXfQu7iJ3ew=; b=vI3Wsdn7srtScyDluuIAyg+A0kqsYW+zbJZGtGTNHMsa8DJSW9xx1nlNGPqQMKcYFW BCd/sDIwazM/S5ugfDa+5s5XBWqcaGHafcthHx1EljsDzkIJKPWUAfmSen51XqHLjgh+ UdH43fEq0Wx9hSmWRnXt5jNhWhgnq5yxZ3pTQ18mnenj06Pmd+W17X1FNq2OhW07a554 llzlz+X6jvhqlbTQKdQpFuYz0Ab1aK73nB0ZSx7vrmYQYsd7Kpv1TN6lSVqRw7DiV3Xl rw+bxZrHy+/RgQH3INbC3iN6MmT4IreViMr1CdlIWqjjWr0gbEL9EHEWdECwkuq0hCyk hBBw== 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 o2-v6si1057177pgm.288.2018.07.17.07.55.25; Tue, 17 Jul 2018 07:55:41 -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 S1731727AbeGQP1y (ORCPT + 99 others); Tue, 17 Jul 2018 11:27:54 -0400 Received: from verein.lst.de ([213.95.11.211]:51848 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731429AbeGQP1y (ORCPT ); Tue, 17 Jul 2018 11:27:54 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 315A96FC87; Tue, 17 Jul 2018 16:57:25 +0200 (CEST) Date: Tue, 17 Jul 2018 16:57:25 +0200 From: Christoph Hellwig To: Fredrik Noring Cc: Christoph Hellwig , Robin Murphy , m.szyprowski@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, JuergenUrban@gmx.de Subject: Re: [PATCH] dma-mapping: Relax warnings for per-device areas Message-ID: <20180717145725.GA22109@lst.de> References: <1f8262d206c6886072d04cc93454f6e3f812bd20.1530623284.git.robin.murphy@arm.com> <20180705193613.GA28905@lst.de> <20180715122826.GB2342@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180715122826.GB2342@localhost.localdomain> 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 Sun, Jul 15, 2018 at 02:28:27PM +0200, Fredrik Noring wrote: > Hi Christoph, Robin, > > On Thu, Jul 05, 2018 at 09:36:13PM +0200, Christoph Hellwig wrote: > > > - BUG_ON(!ops); > > > - WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > > - > > > if (dma_alloc_from_dev_coherent(dev, size, dma_handle, &cpu_addr)) > > > return cpu_addr; > > > > > > + BUG_ON(!ops); > > > + WARN_ON_ONCE(dev && !dev->coherent_dma_mask); > > > > I think doing dma on a device without ops is completely broken no matter > > what you think of it, so I very much disagree with that part of the change. > > > > Also while I don't think not having a dma mask is a good idea even for > > a driver purely using dma coherent pools. If the pools really are on > > the device itself I can see why it might not matter, but for the case > > commonly used on some ARM SOCs where we just reserve memory for certain > > devices from a system pool it very much does matter. > > > > There really is no good excuse to not set a coherent mask in the drivers. > > Here are three other regressions related to the coherent mask WARN_ON_ONCE: They are a pretty strong indication that yes, you should really set the coherent mask if you ever do coherent allocations..