Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751608AbcKGTUZ (ORCPT ); Mon, 7 Nov 2016 14:20:25 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:32687 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbcKGTUX (ORCPT ); Mon, 7 Nov 2016 14:20:23 -0500 Date: Mon, 7 Nov 2016 14:20:12 -0500 From: Konrad Rzeszutek Wilk To: Geert Uytterhoeven Cc: Geert Uytterhoeven , Jonathan Corbet , Magnus Damm , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , iommu@lists.linux-foundation.org, Linux-Renesas Subject: Re: [PATCH 2/2] swiotlb: Add swiotlb=nobounce debug option Message-ID: <20161107192012.GB4750@char.us.oracle.com> References: <1477928704-10611-1-git-send-email-geert+renesas@glider.be> <1477928704-10611-3-git-send-email-geert+renesas@glider.be> <20161031175252.GA6952@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 32 On Mon, Nov 07, 2016 at 07:57:11PM +0100, Geert Uytterhoeven wrote: > Hi Konrad, > > On Mon, Oct 31, 2016 at 6:52 PM, Konrad Rzeszutek Wilk > wrote: > > On Mon, Oct 31, 2016 at 04:45:04PM +0100, Geert Uytterhoeven wrote: > >> On architectures like arm64, swiotlb is tied intimately to the core > >> architecture DMA support. In addition, ZONE_DMA cannot be disabled. > >> > >> To aid debugging and catch devices not supporting DMA to memory outside > >> the 32-bit address space, add a kernel command line option > >> "swiotlb=nobounce", which disables the use of bounce buffers. > >> If specified, trying to map memory that cannot be used with DMA will > >> fail, and a warning will be printed (rate-limited). > > > > I would make the 'swiotlb_force' an enum. And then instead of this > > being 'nobounce' just do the inverse of 'force', that is the > > 'noforce' would trigger this no bounce effect. > > > > So: > > > > enum { > > NORMAL, /* Default - depending on the hardware DMA mask and such. */ > > FORCE, /* swiotlb=force */ > > NO_FORCE, /* swiotlb=noforce */ > > Fine for me, but swiotlb_force is exported to platform code. Hence all users > should be updated? Yeah it would have to be moved to the swiotlb.h (the enum). Thanks!