lkml.org 
[lkml]   [2022]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v2 02/39] ACPI: add dependency on HAS_IOPORT
From
Date
On Wed, 2022-05-04 at 21:58 +0200, Arnd Bergmann wrote:
> On Wed, May 4, 2022 at 7:53 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Fri, Apr 29, 2022 at 03:50:00PM +0200, Niklas Schnelle wrote:
> > > In a future patch HAS_IOPORT=n will result in inb()/outb() and friends
> > > not being declared. As ACPI always uses I/O port access we simply depend
> > > on HAS_IOPORT.
> >
> > CONFIG_ACPI depends on ARCH_SUPPORTS_ACPI, which is only set by arm64,
> > ia64, and x86, all of which support I/O port access. So does this
> > actually solve a problem? I wouldn't think you'd be able to build
> > ACPI on s390 even without this patch.
> > "ACPI always uses I/O port access" is a pretty broad brush, and it
> > would be useful to know specifically what the dependencies are.
> >
> > Many ACPI hardware accesses use acpi_hw_read()/acpi_hw_write(), which
> > use either MMIO or I/O port accesses depending on what the firmware
> > told us.
>
> I think this came from my original prototype of the series where I tested it
> out on arm64 with HAS_IOPORT disabled. I would like to hide the definition
> of inb()/outb() from include/asm-generic/io.h whenever CONFIG_HAS_IOPORT
> is not set, and I was prototyping this on arm64.
>
> There are uses of inb()/outb() in drivers/acpi/ec.c and drivers/acpi/osl.c,
> which in turn are not optional in ACPI, so it seems that those are
> required.
>
> If we want to allow building arm64 without HAS_IOPORT for some reason,
> that means either force-disabling ACPI as well, or changin ACPI to not
> rely on port I/O. I think it's fine to leave that as a problem for whoever
> wants to make HAS_IOPORT optional in the future, and drop the
> dependency here.
>
> Arnd

I'll improve the commit message to make the dependency on HAS_IOPORT
more clear. I also agree with Arnd that since all architectures where
ACPI is useful have I/O ports making it work without I/O port access
compiled in is for another day.

\
 
 \ /
  Last update: 2022-05-05 10:23    [W:0.211 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site