Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2561264pxb; Tue, 21 Sep 2021 02:37:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxj/T8wDBnTh7XttnS9lcHAxVWt62nUAUXUXTHyab2bl0k/4Kd2/vRmXV9hm45YdLbmKtm3 X-Received: by 2002:a5d:9949:: with SMTP id v9mr9479507ios.58.1632217032573; Tue, 21 Sep 2021 02:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632217032; cv=none; d=google.com; s=arc-20160816; b=iYfkNk+oKKO/a+x3M+RvpAl6V2ftsFgddW1BqSmU4hFUgJ7DMwnfnthDtdZiK2Jybe gMIgcfh3/PWJokNfQIS4W25Ei/i4DzREzhqvhs8srcsvFeccrYSAqTUEOZ6m7MkXnv8Q HmCGhgJzS28Nd4nMPbx0tR0frYsVKLexdXMxsXYfo92uCei+5RmFVCZMpc0kwJ+O1atA GlnM+4GNs0BDnj3K0ZEwImCYmefPTn11zPuWP2dF9IGu9XLHK2ip6sLI2xJ/GBszTAnd vXJWSvQHTr0gBBYGKLZcGOhxP1dUTTje7FTfQLPqQEVnuGdRImxaFn56A8xIM7AxaNbj fOIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ObEpaUR+bW6HCPZbrROwApiTIKsvfx6yK53qJ1Qra9w=; b=PAxTIGeN78W2hxpySaNu0xs80wLTI5euCkSoUz1MmbrFHcThuGfqQxJAjKojJwQn4b AzmRdTqbved3iW2fO9wXtYP3bDIh6WT5KAztqDpOtNTSBCcmP0iB+OkVu0Q4jhtdVEAe 4QYUwyV+teG/HmluzRhbWDj5BDB1xLQBqNL49wQCN/6vtp3g7fnpksL6kv5t4E/NU4T2 IfVAk0jTkVVx1joDKGMBEtondYHbR14PmX8lgMNeB+y3m79DjMhtTKgO/fjHF9m3uk8b L14Cv6bHgG5qV6VFUgUxOXf1MqrrvKr7qC5P9Nay/D434cF433EoGwpAclaz1U8zkEUe qafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Zo2HL5/V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s124si14077546jaa.47.2021.09.21.02.37.00; Tue, 21 Sep 2021 02:37:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Zo2HL5/V"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbhIUJfq (ORCPT + 99 others); Tue, 21 Sep 2021 05:35:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:34394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbhIUJfp (ORCPT ); Tue, 21 Sep 2021 05:35:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9D68961131; Tue, 21 Sep 2021 09:34:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632216857; bh=26947zVG9riVqwftMN1dSoamNLEgoqIkp483H/vlQOo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Zo2HL5/V1BbcKSIpxSOBX/zdavkL4LAEANyknHxlliKWMePeJzZr4IeEC/oSTlAYq xMj+dgHL42dCKy96+2Wu4J+KlASIJoo7owJ5j3nG4mnqynPiESYhiWjdd49vSqqN++ 0ZCeYqjlhtTw3fLkQfHAh6iewWUS14jUeFvJupdrrV4Bo+FXTapZvJVk9VC5zxQRNv 7PaU2iomEyzPiSTKr8eQOOuM0OE9XwNEoX+ySL0No88y23eoUwj9XVk3/eIgpo48Gw X5e4Uks97yzbFv3Sdsz5bbAAFMJMKAv14aLh7zxHLMdaa1UylaD0EPl4w0+RE6gUvr oylJ1v4fD8l5w== Date: Tue, 21 Sep 2021 12:34:10 +0300 From: Mike Rapoport To: Christoph Hellwig Cc: Catalin Marinas , David Hildenbrand , Robin Murphy , Alex Bee , Will Deacon , Andrew Morton , Anshuman Khandual , Linux Kernel Mailing List , linux-mm@kvack.org, Linux ARM Subject: Re: [BUG 5.14] arm64/mm: dma memory mapping fails (in some cases) Message-ID: References: <0908ce39-7e30-91fa-68ef-11620f9596ae@arm.com> <60a11eba-2910-3b5f-ef96-97d4556c1596@redhat.com> <20210825102044.GA3420@arm.com> <20210918051843.GA16104@lst.de> <20210921082007.GA29121@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210921082007.GA29121@lst.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 21, 2021 at 10:20:07AM +0200, Christoph Hellwig wrote: > On Mon, Sep 20, 2021 at 11:57:58AM +0100, Catalin Marinas wrote: > > > As this WARN_ON(pfn_valid()) is only present in dma_map_resource() it's > > > probably safe to drop it entirely. > > > > I agree, we should drop it. IIUC dma_map_resource() does not create any > > kernel mapping to cause problems with attribute aliasing. You'd need a > > prior devm_ioremap_resource() if you want access to that range from the > > CPU side. For arm64 at least, the latter ends up with a > > pfn_is_map_memory() check. > > It doesn't create any new mappings. The only real issue is that it > does the wrong thing for RAM in a way that might not be noticed on > simple (x86/PC) platforms. But if the mapping request was rejected by devm_ioremap_resource() because of an attempt to map RAM, why we would get to dma_map_resource() at all? -- Sincerely yours, Mike.