Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5166949rwr; Sun, 23 Apr 2023 23:06:59 -0700 (PDT) X-Google-Smtp-Source: AKy350aLk1B5KWoihJL8t+8II3nc+M96M9g12zsg3UBxWlmLrQEvNTQcfhjlcQnru6nvOW0FQPU3 X-Received: by 2002:a17:902:bb89:b0:1a5:150f:8558 with SMTP id m9-20020a170902bb8900b001a5150f8558mr12209146pls.17.1682316419585; Sun, 23 Apr 2023 23:06:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682316419; cv=none; d=google.com; s=arc-20160816; b=up5/C4uTe/+SLgFa0NjlHhnWzgW7h8Ysn6uD9RHeEzk9tEXeWwKfpazCmX/Q/abCzF dUjR97irxSdjHWjcnKp1v+UE7oJ/9nK+0f/0DNgoKCLJKKbLN+Rp4N8i9CK3iE58GkrE 7zQbxrNUCapVIsGl65D+krKQMnaWMNS6Vg+50ffGerShBRA6ygRZTQHS7xFzlIsqH0/6 g4g4lKHa80MwAtM9HhqAJLFQAxTXskkOmJ963gONH9KE7j6wksaM2uvQ2ykLqJJNV/mh orUhvvvuNEQEJ/v4kl7ocMz2qLaKACTnpZ85Uy4isNW/h/t11ZIbi0QO+5Y+Rdizm1sQ sZOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=qtdjuDqp2emkA44dquxZx9xS28QXN7+0D7jlepGByxI=; b=nMJqQa1LqcItn71CGOSljzoMZIUt/cLwRdNcJlMWoBYpb6yz5VNtaL8MSUb9THwoQj 7T6Gy1kxvh5rQjxsBO5ACzK0a31Xc3YmIPreAV34rJLWKqQCpyhF9dMH98a8bQyrR/r+ zD6awYGfFb4lSZE4j+mA3g9UPv8Uj4hOiyHQVrJLHZumrzMiZJ9SwEqPn+5yDdSdoWTX nbY1H+iOMOUPqcdMwRz8AaeOSKtmtOTGNMb4I19IDae7Gyu058wuZjS/uCXY4L46YjqV cFFUF/boe2cEVEkJCnnhPbuDOP/8cCTTDMhDt30XPTh24oR+4OrKI8+OifIMdJaZFNEi dj3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c17-20020a170903235100b001a216e882f0si3782965plh.558.2023.04.23.23.06.48; Sun, 23 Apr 2023 23:06:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231320AbjDXGFU (ORCPT + 99 others); Mon, 24 Apr 2023 02:05:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231178AbjDXGEv (ORCPT ); Mon, 24 Apr 2023 02:04:51 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F3784EE0; Sun, 23 Apr 2023 23:03:23 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id C5E5D67373; Mon, 24 Apr 2023 08:03:13 +0200 (CEST) Date: Mon, 24 Apr 2023 08:03:13 +0200 From: Christoph Hellwig To: Petr =?utf-8?B?VGVzYcWZw61r?= Cc: Robin Murphy , Christoph Hellwig , Petr Tesarik , Jonathan Corbet , Marek Szyprowski , Borislav Petkov , "Paul E. McKenney" , Andrew Morton , Randy Dunlap , Damien Le Moal , Kim Phillips , "Steven Rostedt (Google)" , "open list:DOCUMENTATION" , open list , "open list:DMA MAPPING HELPERS" , Roberto Sassu , Alexander Graf Subject: Re: [RFC v1 3/4] swiotlb: Allow dynamic allocation of bounce buffers Message-ID: <20230424060313.GB9805@lst.de> References: <0334a54332ab75312c9de825548b616439dcc9f5.1679309810.git.petr.tesarik.ext@huawei.com> <20230328040724.GB25506@lst.de> <4268fa4e-4f0f-a2f6-a2a5-5b78ca4a073d@huaweicloud.com> <8cf7c515-9ce6-a2ed-0643-972aa3eba2fb@huaweicloud.com> <20230407055704.GD6803@lst.de> <20230407121555.4290a011@meshulam.tesarici.cz> <20230421150349.35966e0b@meshulam.tesarici.cz> <4bd8ce51-5874-0aa3-bc82-fec0cee9b8f1@arm.com> <20230421170934.185a03a0@meshulam.tesarici.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230421170934.185a03a0@meshulam.tesarici.cz> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 21, 2023 at 05:09:34PM +0200, Petr Tesařík wrote: > > > A. Only grouping those fields in their own struct? > > > B. Or move the definition to another include file (cf. MAINTAINERS)? > > > C. Or store a pointer in struct device? > > > > dev->dma_parms is already this, and IIRC still has some very old > > comments somewhere about consolidating the other DMA-related fields in > > there. > > Thank you for the hint! I have actually seen dma_parms, but since it > can be NULL and was initialized from various drivers, it did not occur > to me that NULL simply means not DMA-capable. Yes, dma_parms are still optional. A much better hint is the dma_mask itself, which for historic reasons is implemented in a completely awfull way as a pointer to something stored in the containing struture, which all kinds of platform devices or minor buses doing nasty hacks there.