Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1117692lqs; Wed, 6 Mar 2024 06:55:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW+llL6Spi6ze1QhtLxP+qzSZVBNXMQcdZ/2BijFFrfb81YxofflnQDEIFIEeRUNVAK4l57xEdHCVgBT1OAk7G0DQJjSDhEJztrjbam8Q== X-Google-Smtp-Source: AGHT+IG8gGR/FYBlS0EYKBlKeEkBB49+yD8+aO3g10mHd/1MGL13BGrSaccm8+LJarkeo3y9V42j X-Received: by 2002:a05:6a20:3d29:b0:1a1:6a7f:5c75 with SMTP id y41-20020a056a203d2900b001a16a7f5c75mr410057pzi.26.1709736908782; Wed, 06 Mar 2024 06:55:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709736908; cv=pass; d=google.com; s=arc-20160816; b=c8Xh8j7y6Zh9yGNArpskANT2ye9hT9Jlv0qK+pWwIdyqMY9yzeEzs2fIzxarNVRAx4 UvRvEs3dDSHwnrmXLoxH9RHlJMo2/IBuo4jOZM0LBNc821MFJ01wTYvzv1QIyZtZ5mM9 ifYxXe9udEidLhKyzX8WrMphWQhAERaw1X2wG3f2d9U4UQUxrtsPEriBkQnU1qrsjVmT rTMBZFFmQVBxutRQ4+jJ5FwIYkkY2O3B+A3D0FveOTXPeGqxNTRgdqu2CNbnV6JU39qz sQwNPu1AhUrF6+/Rj5E60Gl8A1MT4Xbe5b9nZ/2cwTecioVCoxqfyVEYBeYMCai5O3I0 OENg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=pPFM5+mxd7HoHCokRuMNadQyImmiV1df1zVFdv+xb64=; fh=hlDpOrCeslYrF2s1a+QVuyqmc4GIFE59bbG4NhMOZ+o=; b=gKFyPaz7FERvVIXLdi48RweDEQ6Rpq4biAEs6F+vuqKjFg1SVZ3MR9nOAD0WTKUfZr YiYRrc45luC/7bwqgceMSpHi7yTxXuowgY9IXqZ4veQ9RiyvF7+ePORxuRfK8t6nq5r9 41D6bOwz8W3Ti4CAiu6f/xaa+CwoITpYCgy8tMzI4iClL+whfQZhrB349xEy1bvmNfw/ dOFusK5VcbuVxvqHV7OEd69QJ2jsitMN8nvlTOkFEG82oJZOENPj3GcjZw05Tr/uW31w JBVvlBxBZq58uCpqLu5Or0mfAtCD2yEfM0GkBq3SW9cLtBGlpNkfwpfYcl2NemB8BMRd z08w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=Rk3SjKVa; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=rZu93xzo; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-94081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y21-20020a634b15000000b005dc4e7d879csi12210829pga.66.2024.03.06.06.55.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 06:55:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=Rk3SjKVa; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=rZu93xzo; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-94081-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94081-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 50D8DB24B19 for ; Wed, 6 Mar 2024 14:46:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4DAC51339B1; Wed, 6 Mar 2024 14:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="Rk3SjKVa"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="rZu93xzo" Received: from wfhigh1-smtp.messagingengine.com (wfhigh1-smtp.messagingengine.com [64.147.123.152]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FB7480605; Wed, 6 Mar 2024 14:45:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=64.147.123.152 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709736357; cv=none; b=HlOxKEN0eU/6Gf4Rp10dKqXSJucY5RCmMnyCUZB6b6isuLbhRCw4AcPNjMZaUGwWlRVMMxElj+2JSl2ppIgF6FikSpHR2So43ccC9WoPEnknb3A12C329nsgCmwMzwgllkTmSQbud1sVvem3pgcBpp9rHoTaDKKe7FewXo9TRlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709736357; c=relaxed/simple; bh=geOY66FgyKfJzY8mflAv3zxD6f5ML0nbM5/kw5N/7nY=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=uRk0jhMSPAolCYCgsKiW21VEvQreWCCmVE9oj2bDWrRDZAgeMpJg1yDi62f4PwlUDXkocA546pmPsD4S0kV7LcVhyvlNGoFO6uuAofHnTHfYd6QgY4CrTIyeL0hN/K7y4KfzZ5cEdoeB5ho8O1s0HALe707e6mjv6OywdsWXNKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=Rk3SjKVa; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=rZu93xzo; arc=none smtp.client-ip=64.147.123.152 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.west.internal (Postfix) with ESMTP id 55DF9180007C; Wed, 6 Mar 2024 09:45:53 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Wed, 06 Mar 2024 09:45:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1709736352; x=1709822752; bh=pPFM5+mxd7 HoHCokRuMNadQyImmiV1df1zVFdv+xb64=; b=Rk3SjKVaAoVV+4NeGsGHVwDGmt S/nAH3XtKCtg+5EU/Xz6XguarzNkx7/tLjXBs/Y/5D1iOVtG0MyrqgMkuSZmOJrv 9MXfTfBuThrIAcX1zz0sxjb2Vta+jkQVHSN22HTAltzrdTvvXTR83dSib0BFMQRa dw0oIDN2VjPKlPlleKO0jpxVRCv1xF9ksRQgYBmDcrCm8eHmCSAzCcyPgzdgwIE7 bVudav+cCpvwfj5MQpHy6ZpGtGMk5/uMQ7bdgyT1IYhRbK4beEgtn7gUM3+cwJc+ iyqN7tH6DYzcPtUqdx9aNzKkXEDwrD6QroFum/NjRZHHL5/lIDpcMslXlMhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709736352; x=1709822752; bh=pPFM5+mxd7HoHCokRuMNadQyImmi V1df1zVFdv+xb64=; b=rZu93xzo78tWHKiNSPj4YYFtQWdBTgL6obbNuRPltAoK 6CXtrPfyCSpehJSP806wFExBYnvn6CycVRGPZo14DPE5E+sgn5zzTcV+ym5LYoPj Qw1YuymJdKcbvsORb+mj+Vkb9452kxGABlHOFDbtHRmFVdjTxwHfCDWVhIVsRRb1 tmv76HgkDQCbrCW6mpVV4GnfTKI7c49KECVD3LDFaV1L4LWMd375zYCLqecNTGgW BR7yI5JabCypX1GxkMdKB5YiVdQJ2GEi5aP5RTajx3emZhxl32z32j1EnpbZIcCh bw3mvfHxhFBS45t6oQuRNiYhHNv4GOJgFD1Rrs7jnA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledriedugdeihecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 06153B6008D; Wed, 6 Mar 2024 09:45:51 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-208-g3f1d79aedb-fm-20240301.002-g3f1d79ae Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <75a4a08d-85c2-4a60-9cbd-90dd50f765a8@app.fastmail.com> In-Reply-To: References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> <20240224-sam-fix-sparc32-all-builds-v2-4-1f186603c5c4@ravnborg.org> <8d5780f5-1047-48d7-a9c9-09b95c7b5604@gaisler.com> <5648dca0-4853-4dfb-91cf-282a656beb1e@app.fastmail.com> Date: Wed, 06 Mar 2024 15:45:28 +0100 From: "Arnd Bergmann" To: "Andreas Larsson" , "Sam Ravnborg" , "Maciej W. Rozycki" , sparclinux@vger.kernel.org, "Randy Dunlap" Cc: "Miquel Raynal" , linux-parport@lists.infradead.org, "David S . Miller" , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/7] sparc32: Do not select ZONE_DMA Content-Type: text/plain On Wed, Mar 6, 2024, at 15:19, Andreas Larsson wrote: > On 2024-03-05 16:26, Arnd Bergmann wrote: >> On Tue, Mar 5, 2024, at 16:06, Andreas Larsson wrote: >>> On 2024-02-24 18:42, Sam Ravnborg via B4 Relay wrote: >> >>>> diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig >>>> index 734f23daecca..bdbde506c01e 100644 >>>> --- a/arch/sparc/Kconfig >>>> +++ b/arch/sparc/Kconfig >>>> @@ -62,7 +62,6 @@ config SPARC32 >>>> select HAVE_UID16 >>>> select LOCK_MM_AND_FIND_VMA >>>> select OLD_SIGACTION >>>> - select ZONE_DMA >>> >>> This however makes a number of PCI drivers that depend on >>> ZONE_DMA unselectable. >> >> I think that is the correct thing to do then: the only >> drivers that I see with this dependency are PCI sound cards >> that apparently rely on DMA to the 16MB ISA range, which is >> not provided by sparc. > > The ZONE_DMA dependency does not seem related to ISA per se. Commit > 80ab8eae70e5 ("ALSA: Enable CONFIG_ZONE_DMA for smaller PCI DMA masks") > that started to introduce it did were about ensuring 32-bit masks. > > Some of those sound card drivers sets a 24 bit mask, i.e. a 0-16MB > range, but some among those sets a 28, and 30 bit DMA mask with > dma_set_mask_and_coherent. Ah right, I see it now. > Testing, in a different driver, setting and > allocating under a 30-bit DMA mask (or even a 28-bit DMA mask depending > on where the physical memory resides) is possible before removing > ZONE_DMA, but not after. I still don't see how that changes anything if max_zone_pfn[ZONE_DMA] and max_zone_pfn[ZONE_NORMAL] are set to the same value. Did you test this on a mainline kernel, or do you have any patches on top that might have set up the zones differently? More specifically, what do you see in the boot log for the size of each zone? > I am also a bit concerned if removing ZONE_DMA will let DMA be allocated > in highmem and what that could lead to. It's not supposed to make a difference, but this is a bit more complex: - Any kernel allocation (kmalloc etc) by definition comes from lowmem, regardless of GFP_DMA/GFP_KERNEL. - user pages that get mapped using dma_map_sg() or dma_map_page() can be in highmem, but this should not depend on the presence of ZONE_DMA - If you have devices that can only access a subset of the RAM and there is no IOMMU, you really need to use swiotlb to make it use bounce buffers, at least for the streaming (dma_map_*) API. A driver using only the coherent (dma_alloc_*) API should use ZONE_DMA if ZONE_NORMAL goes beyond the dma mask. Arnd