lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VewfhyeoAhfFkxjWm+ch_msCeDGqumOEzbawumx7aFjdQ@mail.gmail.com>
Date:   Wed, 31 Oct 2018 14:49:23 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     peng.hao2@....com.cn
Cc:     Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Arnd Bergmann <arnd@...db.de>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andy Shevchenko <andy@...radead.org>,
        Darren Hart <dvhart@...radead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Platform Driver <platform-driver-x86@...r.kernel.org>,
        hutao@...fujitsu.com,
        Linux Documentation List <linux-doc@...r.kernel.org>
Subject: Re: [PATCH V4 3/5] misc/pvpanic: add MMIO support

On Wed, Oct 31, 2018 at 7:27 AM Peng Hao <peng.hao2@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ