From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 695A1C433F5 for ; Wed, 22 Sep 2021 07:22:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D4A35611C9 for ; Wed, 22 Sep 2021 07:22:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D4A35611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 42F2B6B006C; Wed, 22 Sep 2021 03:22:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DF026B0072; Wed, 22 Sep 2021 03:22:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A6A36B0073; Wed, 22 Sep 2021 03:22:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 16AB06B006C for ; Wed, 22 Sep 2021 03:22:40 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id C20868249980 for ; Wed, 22 Sep 2021 07:22:39 +0000 (UTC) X-FDA: 78614366838.40.CEF3FD9 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf24.hostedemail.com (Postfix) with ESMTP id 6D89CB0000A1 for ; Wed, 22 Sep 2021 07:22:39 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E45AB610A0; Wed, 22 Sep 2021 07:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632295358; bh=WNKcqaMlMsH9avHQqL/8bXo1+ieMx7dN8g+lDPzOPuQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bnfR0sFXxVmWgESwlgn7ej6589e2jVsdDqcK4MCGIvf4tVB0oabLNs+pB3y4vGg8z NQqSASyDEXdPWaQ6masJpciVRvgZhJ43JfAp6MxidubFH6ZJRuahZRJlLZbyV8MtHv 38YcFV5AvfvO4KA+fkWhOmM65BJZAe7Q6gacfi9akt5GHYDtztJukRSqu4nv2FPMP3 KKW5Uv1aK/R5JsL5P3GZ5Ipse8zpnFZLirq6kJFmb5RsiGV1BovZVCOTntvCCfYOeZ a/lQ3cTpkPGaQ0vGhHtnYe+SkzMNaTxo0yS47yYYYqXs3rIrF0FVBtXmdwp/lEGjoo MHDJr4OXgJqiw== Date: Wed, 22 Sep 2021 10:22:32 +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: <60a11eba-2910-3b5f-ef96-97d4556c1596@redhat.com> <20210825102044.GA3420@arm.com> <20210918051843.GA16104@lst.de> <20210921082007.GA29121@lst.de> <20210921153805.GA29952@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210921153805.GA29952@lst.de> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6D89CB0000A1 X-Stat-Signature: oxt57qjkbcazzpfwtpjkrijwzm3trky9 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=bnfR0sFX; spf=pass (imf24.hostedemail.com: domain of rppt@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=rppt@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1632295359-436880 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Sep 21, 2021 at 05:38:05PM +0200, Christoph Hellwig wrote: > On Tue, Sep 21, 2021 at 12:34:10PM +0300, Mike Rapoport wrote: > > > 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? > > dma_map_resource takes a phys_addr_t that could come from anywhere. Right, but it's not different from, say, dma_map_page_attrs() that can get a struct page from anywhere and there is no actual memory for that struct page at all. Do you suggest add a check that that struct page is backed by memory in dma_map_page_attrs() as well? -- Sincerely yours, Mike.