Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3212866imw; Mon, 11 Jul 2022 04:26:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sZK8sC+1jen6NlGun4GhalCZYq0IWEY0Ae/AoOwbUfFl4taxYut/hFtWqBPTfkgHon2lcl X-Received: by 2002:a17:90b:3848:b0:1f0:2686:87aa with SMTP id nl8-20020a17090b384800b001f0268687aamr10740235pjb.67.1657538770375; Mon, 11 Jul 2022 04:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657538770; cv=none; d=google.com; s=arc-20160816; b=t1WoO/E7/YsqJ6Gtkf4uYypldwVicNaKPjDs2JEP3uzrxFwzaDvtGIAZhqXaXLS1Fe VqD4CN2gj8IVnFf3TmzONT5GRbljfrUNcgisdNLQ1Dm9i/qGe1DCG1C85SijcJ3b/DRD Nyt4OCxUWM3gWXJ2JrvpcylgjB2u9ksz3RET25mIHW2nuJcwt3TnU8tViBA/yb4wJ2Vf C6F2vrvDXRjfvATiG8kVHpYyPJGH7cUFbWt+VEEtLGAY3RNQQXPLfDTRgg0RCOLjHYA6 8y1j3em6XKwUujIRNmmnGEpOhKTTOK2h4HKYAznLiOU5vtqj2fvr0zc87vXmhd49/NAn 4Bjg== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=3VDRLJRfPDJODMI4PVehtlyjlxYJiO0HYmUlsB3y1Qo=; b=xgy5Mvuo4WAc3hxDFGBqN5SizUnBG8E27mDcC/Ph+VjyKu38HcTUfXjkU47d2eGvPq XYRjrTD0vYPKPG6UV5hj+Uab119W3zG5Mh/EP8OcLEuiFa7x888cTYmLWxqSM2GoZPHV sjK8w2o2FI4pGHPEx+UbIhdbRkUobBZUY3Zv2ULM8ajGrZnXvBDxW6GC0Aojsn4bJlNF x2SItpp2VkhwU6KqTdSFE+MZ6DBDj/U8rbBv5RmS+kXX9lG33UY2VsaiSdXUXvy47B+5 2IMeq7mVe8vES5gXW3uAfY7RyI/SW6nh3RYHRH2qlteDwMQthKN2T0zVGeJO1fifjO0C TbTQ== 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 y14-20020a655b0e000000b003fe494520a9si9715644pgq.357.2022.07.11.04.25.58; Mon, 11 Jul 2022 04:26:10 -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 S231128AbiGKLR3 (ORCPT + 99 others); Mon, 11 Jul 2022 07:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230325AbiGKLQ5 (ORCPT ); Mon, 11 Jul 2022 07:16:57 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BDF567C85 for ; Mon, 11 Jul 2022 03:39:25 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 8B6E468AA6; Mon, 11 Jul 2022 12:39:21 +0200 (CEST) Date: Mon, 11 Jul 2022 12:39:21 +0200 From: Christoph Hellwig To: Ben Dooks Cc: Christoph Hellwig , Robin Murphy , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, iommu@lists.linux-foundation.org, Sudip Mukherjee , Jude Onyenegecha , Marek Szyprowski Subject: Re: [PATCH] swiotlb: ensure io_tlb_default_mem spinlock always initialised Message-ID: <20220711103921.GA6542@lst.de> References: <20220708170811.270589-1-ben.dooks@sifive.com> <683344bd-dc9b-0bb5-9377-b3e9ab410a74@sifive.com> <20220711102134.GB4639@lst.de> <4fa8b709-c883-54dc-c302-20c9e55ae93a@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4fa8b709-c883-54dc-c302-20c9e55ae93a@sifive.com> 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 Mon, Jul 11, 2022 at 11:24:51AM +0100, Ben Dooks wrote: > On 11/07/2022 11:21, Christoph Hellwig wrote: >> On Mon, Jul 11, 2022 at 11:07:17AM +0100, Robin Murphy wrote: >>> If none of your peripherals should need SWIOTLB, then the fact that >>> you're ending up in swiotlb_map() at all is a clear sign that >>> something's wrong. Most likely someone's forgotten to set their DMA >>> masks correctly. >> >> Yes. > > Possibly, we had at least one driver which attempted to set a 32 bit > DMA mask which had to be removed as the DMA layer accepts this but > since there is no DMA32 memory the allocator then just fails. > > I expect the above may need to be a separate discussion(s) of how to > default the DMA mask and how to stop the implicit acceptance of setting > a 32-bit DMA mask. No. Linux simply assumes you can do 32-bit DMA and this won't change. So we'll need to fix your platform to support swiotlb eventually.