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=-2.2 required=3.0 tests=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 C9359C433FF for ; Sat, 3 Aug 2019 10:32:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48C6E2166E for ; Sat, 3 Aug 2019 10:32:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48C6E2166E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4610j23q77zDrBh for ; Sat, 3 Aug 2019 20:32:38 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lst.de (client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4610fj2gPFzDr3f for ; Sat, 3 Aug 2019 20:30:34 +1000 (AEST) Received: by verein.lst.de (Postfix, from userid 2407) id 4321A227A81; Sat, 3 Aug 2019 12:30:24 +0200 (CEST) Date: Sat, 3 Aug 2019 12:30:24 +0200 From: Christoph Hellwig To: Takashi Iwai Subject: Re: [PATCH 5/5] dma-mapping: remove ARCH_NO_COHERENT_DMA_MMAP Message-ID: <20190803103024.GA32624@lst.de> References: <20190725063401.29904-1-hch@lst.de> <20190725063401.29904-6-hch@lst.de> <20190802070354.GA8280@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) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-xtensa@linux-xtensa.org, Michal Simek , linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-m68k@lists.linux-m68k.org, Robin Murphy , x86@kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, linuxppc-dev@lists.ozlabs.org, Christoph Hellwig , linux-arm-kernel@lists.infradead.org, Marek Szyprowski Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Fri, Aug 02, 2019 at 10:24:02AM +0200, Takashi Iwai wrote: > I wasn't careful enough to look at that change, sorry. > > The code there tries to check whether dma_mmap_coherent() would always > fail on some platforms. Then the driver clears the mmap capability > flag at the device open time and notifies user-space to fall back to > the dumb read/write mode. > > So I'm afraid that simply dropping the check would cause the behavior > regression, e.g. on PARISC. > > Is there any simple way to test whether dma_mmap_coherent() would work > or not in general on the target platform? It's not necessarily in an > ifdef at all. This isn't really a platform, but a per-device question. I can add a "bool dma_can_mmap(struct device *dev)" helper to check that. But how do I get at a suitable struct device in hw_support_mmap()?