LKML Archive on
help / color / mirror / Atom feed
From: Linus Torvalds <>
To: Will Deacon <>, Christoph Hellwig <>
Cc: Catalin Marinas <>,
	Linux ARM <>,
	Linux Kernel Mailing List <>,
	Android Kernel Team <>
Subject: Re: [GIT PULL] arm64 fix for 5.14
Date: Thu, 26 Aug 2021 11:41:34 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20210826131747.GE26318@willie-the-truck>

On Thu, Aug 26, 2021 at 6:17 AM Will Deacon <> wrote:
> Please pull this single arm64 fix for 5.14.


But adding Christoph to the cc, since I do think the eventual fix
needs to be in the DMA mapping code:

> We received a report this week
> that the generic version of pfn_valid(), which we switched to this merge
> window in 16c9afc77660 ("arm64/mm: drop HAVE_ARCH_PFN_VALID"), interacts
> badly with dma_map_resource() due to the following check:
>         /* Don't allow RAM to be mapped */
>         if (WARN_ON_ONCE(pfn_valid(PHYS_PFN(phys_addr))))
>                 return DMA_MAPPING_ERROR;
> Since the ongoing saga to determine the semantics of pfn_valid() is
> unlikely to be resolved this week (does it indicate valid memory, or
> just the presence of a struct page, or whether that struct page has been
> initialised?), just revert back to our old version of pfn_valid() for
> 5.14.

I think that's the right thing for now, but yeah, that condition for
WARN_ON_ONCE() seems very questionable.

"pfn_valid()" is more about whether you can do a "pfn_to_page()" lookup on it.

II get the feeling that the dma-mapping code should allow pages that
are PageReserved() to be mapped - they aren't "ram" in the kernel

Perhaps also make sure it's not the zero page (which is
PageReserved(), but most definitely RAM).

In a PC world that would be (for example) the legacy PCI space at
0xa0000-0xfffff, but I could easily imagine other platforms having
other situations.


  reply	other threads:[~2021-08-26 18:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-26 13:17 Will Deacon
2021-08-26 18:41 ` Linus Torvalds [this message]
2021-08-27  7:40   ` Christoph Hellwig
2021-08-27 17:03     ` Linus Torvalds
2021-08-27 17:10       ` Christoph Hellwig
2021-08-27 17:16         ` Linus Torvalds
2021-08-31 13:31           ` Will Deacon
2021-08-31 19:16             ` David Hildenbrand
2021-08-31 16:56           ` Catalin Marinas
2021-08-26 18:52 ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \ \ \ \ \ \
    --subject='Re: [GIT PULL] arm64 fix for 5.14' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).