linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: catalin.marinas@arm.com (Catalin Marinas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH resend v2] arm64: dmi: Add SMBIOS/DMI support
Date: Mon, 21 Jul 2014 11:03:05 +0100	[thread overview]
Message-ID: <20140721100304.GB12817@arm.com> (raw)
In-Reply-To: <1405079210-30044-1-git-send-email-ard.biesheuvel@linaro.org>

Ard,

I have some technical questions below before merging this patch.

On Fri, Jul 11, 2014 at 12:46:50PM +0100, Ard Biesheuvel wrote:
> --- /dev/null
> +++ b/arch/arm64/include/asm/dmi.h
> @@ -0,0 +1,41 @@
[...]
> +static inline void __iomem *dmi_remap(u64 phys, u64 size)
> +{
> +	void __iomem *p = efi_lookup_mapped_addr(phys);

When are dmi_remap/dmi_early_remap() called? A quick grep through the
kernel shows that it is at least called once from dmi_scan_machine().
The latter is a device_initcall() in this patch. However, the comments
for efi_lookup_mapped_addr() state that it should only be called between
efi_enter_virtual_mode and efi_free_boot_services. The latter is invoked
from an early_initcall(). Could you please clarify which part is wrong
here?

> +
> +	/*
> +	 * If the mapping spans multiple pages, do a minimal check to ensure
> +	 * that the mapping returned by efi_lookup_mapped_addr() covers the
> +	 * whole requested range (but ignore potential holes)
> +	 */
> +	if ((phys & ~PAGE_MASK) + size > PAGE_SIZE
> +	    && (p + size - 1) != efi_lookup_mapped_addr(phys + size - 1))
> +		return NULL;
> +	return p;
> +}
> +
> +/* Reuse existing UEFI mappings for DMI */
> +#define dmi_alloc(l)			kzalloc(l, GFP_KERNEL)
> +#define dmi_early_remap(x, l)		dmi_remap(x, l)
> +#define dmi_early_unmap(x, l)
> +#define dmi_unmap(x)

Same questions as above, when are these functions called? Can we not
just use early_ioremap/ioremap like x86?

-- 
Catalin

  parent reply	other threads:[~2014-07-21 10:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 11:46 [PATCH resend v2] arm64: dmi: Add SMBIOS/DMI support Ard Biesheuvel
2014-07-14 13:36 ` Will Deacon
2014-07-14 13:57   ` Ard Biesheuvel
2014-07-20 10:25     ` Ard Biesheuvel
2014-07-21  8:48       ` Will Deacon
2014-07-22  1:16         ` 答复: " liyi 00215672
2014-07-21 10:03 ` Catalin Marinas [this message]
2014-07-21 10:18   ` Ard Biesheuvel
2014-07-21 10:38     ` Catalin Marinas

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20140721100304.GB12817@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).