Re: [PATCH] PCDP: use early_ioremap/early_iounmap to access pcdptable

From: Khalid Aziz
Date: Thu Jul 19 2012 - 11:33:16 EST


On Wed, 2012-07-18 at 16:19 -0600, Greg Pearson wrote:
> --- a/drivers/firmware/pcdp.c
> +++ b/drivers/firmware/pcdp.c
> @@ -95,7 +95,7 @@ efi_setup_pcdp_console(char *cmdline)
> if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
> return -ENODEV;
>
> - pcdp = ioremap(efi.hcdp, 4096);
> + pcdp = early_ioremap(efi.hcdp, 4096);

While we are fixing this code up, mapping 4K blindly just does not feel
right to me. Trouble here is that the length of PCDP table is buried in
the header for PCDP table and we can not read it unless we map the table
in. We get the address for PCDP table from the EFI system table which
was mapped in earlier and pointers to various tables were extracted at
that point. So this is a chicken and egg problem. Any ideas if we can do
better than blindly mapping 4K?

--
Khalid Aziz <khalid.aziz@xxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/