Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp993662imm; Thu, 5 Jul 2018 12:36:13 -0700 (PDT) X-Google-Smtp-Source: AAOMgpef2/k1cVe5NByey1IQn5Em4JHIvspjywu7AbzYQa58jG21bP3qoqQJsjpUzV207PlZQewb X-Received: by 2002:a65:66d7:: with SMTP id c23-v6mr6798383pgw.427.1530819373517; Thu, 05 Jul 2018 12:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530819373; cv=none; d=google.com; s=arc-20160816; b=xYFtuxDNSZM0f784T5KvXOYT8frEB2bPm5rrkXKXUA0puS6fyvYEP7vvyZ3y36RLMg +5JZ47I1CrvYW+q20Q2Ed6k2/xa3JyYFHt1i6mF8A5Z/BB+BMlijBGDdIQO79SojL/B8 j1sxrugQwbwOd4hnswwoe33ngT8AjYMUtZL5CuMqpNgoDDn5mM3v32sXIaSFlH4nw23S CgsMEZtE4YOOBoQo7Ce70cFwA0JlxsNogjnPGm3/lCwPh1dtEF62/bf1CKoUZAF90q2S PjfPkVvjF+9xT/TMpCb2X0jpSeIadcqz1mGE8dUbX/T3o7Pou652C/quY4uy5eOXzgxG UBfA== 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=uT2IkFhWulw+vaCZyc1tNzhIPd81pPNdatyGx8oHDd8=; b=Ca49/DVKZS4lWYYqsR52GrC+v4CsNKZ8vuQiavo6lOivjWtWz3VZuYhYVhDhKR6SeT ri6BbI46JdxSfPLjAW9sf9jd6GMqpLMTz2fF8it7m/o1tMzsLh9mW+2RF65/sQ832a/r nHQvuzx4UmHZZbReAgS/28KsBMXZbhhY6OuUlGc01Mak2J/yy840yP5E+W2zpa3vlchX KKsSIbk8ruDjkN9GdOTzZ246e7B6BF/ULPG7zBH+CWrXCjEnlcJk9Dflkpjc5WtedO9v rXdsyUCuXOlV7ojb4YONVoa4IH8OIBxb4y15Bcgm5/ASRV9oohJyqldk8PrIRMT79OHY 0YIA== 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 5-v6si6748720pls.450.2018.07.05.12.35.58; Thu, 05 Jul 2018 12:36:13 -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 S1753983AbeGETfR (ORCPT + 99 others); Thu, 5 Jul 2018 15:35:17 -0400 Received: from verein.lst.de ([213.95.11.211]:56217 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753846AbeGETfQ (ORCPT ); Thu, 5 Jul 2018 15:35:16 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 2C3B768D4B; Thu, 5 Jul 2018 21:36:13 +0200 (CEST) Date: Thu, 5 Jul 2018 21:36:13 +0200 From: Christoph Hellwig To: Robin Murphy Cc: hch@lst.de, m.szyprowski@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, noring@nocrew.org, JuergenUrban@gmx.de Subject: Re: [PATCH] dma-mapping: Relax warnings for per-device areas Message-ID: <20180705193613.GA28905@lst.de> References: <1f8262d206c6886072d04cc93454f6e3f812bd20.1530623284.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1f8262d206c6886072d04cc93454f6e3f812bd20.1530623284.git.robin.murphy@arm.com> 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 > - 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.