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 EEB9BC433EF for ; Wed, 22 Sep 2021 07:22:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB12E61178 for ; Wed, 22 Sep 2021 07:22:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233194AbhIVHYI (ORCPT ); Wed, 22 Sep 2021 03:24:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:41094 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229697AbhIVHYI (ORCPT ); Wed, 22 Sep 2021 03:24:08 -0400 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> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.