Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp230496pxb; Wed, 22 Sep 2021 00:23:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4Lz7TnZT02WQe1a9GpIr0tBVKTX3/JieLtdF71PrYhhVN++eC1E45nEBrbUKTlvz8HeTX X-Received: by 2002:a6b:d915:: with SMTP id r21mr3264516ioc.76.1632295439519; Wed, 22 Sep 2021 00:23:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632295439; cv=none; d=google.com; s=arc-20160816; b=Nlr2xlOyiKrNE1qdQ6V/dWkYBNDcFe4ie/TgH/2yNDsEOmScIXr0HAaK8IaQT0XzS5 0MCO+RVFzTYO5pzBq0XLt9nfRfPqNnnxEK+De7JqeGbRZWUnHLnV9pufst+6RAoCRQUk 2B8sAThvfHxitBHONXwZ6hP+pzkM5USw/mq7qzvgBrZL5xLr7f5jYxNIyAao04U5W8HL dnVN5NlqL3g4Rv+EOtNmFNNhr2uSZWrvZOMxZc7M6pWGtLpD4PME/wV9cOpsQcejjZr7 742hHc7xCukORIBUwtdbHL/c1YF+ZX9RqqMSH6DpmaBmGnrxaaOnU2NHmyLsgz00FfPA 9Lxw== 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=sEAx8fiy0d0R03Pn3rJcPZXyuw8i0rntVIB/GnceKls=; b=x7KZcfwUWex6D7NYDoQgAcckLnVhoA6ylahdAeVU18s/PM5vnkfG7xz7DZd/FXODPJ PPob4ysW6VFoIzA2BPGrE4RviL9w5RiLkV3mp1bANpZgpvoDFIO1f4x5DpXfOGAN+XqE MhmnbTgyNjeFivmuDCZY/2LXu/zKV66i1JlH7+Ga6zXyogrYQvI11StjNBymt3cysNnw Dm2GKzheZ0fUeVzTYlZlEj5qyvhd461TNWkP4kKQkuWKRHQ5l7NaLu6VTPUEV3z75HF8 O6lhSnsY/dyZ9WCVtJOcP5EBkIp0RqX21ngzhzijTd7Q9z+Lr/bjwCoT8qH+zaKF2L4f /Mkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bnfR0sFX; 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 j19si1941997jat.117.2021.09.22.00.23.24; Wed, 22 Sep 2021 00:23:59 -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=bnfR0sFX; 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 S233156AbhIVHYI (ORCPT + 99 others); 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.