lkml.org 
[lkml]   [2018]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH V4 3/5] misc/pvpanic: add MMIO support
On Wed, Oct 31, 2018 at 7:27 AM Peng Hao <peng.hao2@zte.com.cn> wrote:
>
> On some architectures (e.g. arm64), it's preferable to use MMIO, since
> this can be used standalone. Add MMIO support to the pvpanic driver.

> case ACPI_RESOURCE_TYPE_IO:
> - port = res->data.io.minimum;
> + if (acpi_dev_resource_io(res, &r))
> + base = (void __iomem *) ioport_map(r.start,
> + r.end - r.start + 1);
> + return AE_OK;
> +
> + case ACPI_RESOURCE_TYPE_FIXED_MEMORY32:
> + if (acpi_dev_resource_memory(res, &r))
> + base = ioremap(r.start, r.end - r.start + 1);
> return AE_OK;

You need to split this to two changes. First one converts existing
code to use acpi_dev_resource_io() and the rest does the rest.
Moreover, please, read carefully the code of those functions — hint:
they check for resource type themselves.

> + if (base)

Same question. At which conditions the base here can be NULL?

> + iounmap(base);

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2018-10-31 13:50    [W:0.068 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site