[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZwkqdKUANkU-29NN@smile.fi.intel.com>
Date: Fri, 11 Oct 2024 16:39:00 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Arnd Bergmann <arnd@...db.de>, Arnd Bergmann <arnd@...nel.org>,
Len Brown <lenb@...nel.org>,
Mario Limonciello <mario.limonciello@....com>,
Jarred White <jarredwhite@...ux.microsoft.com>,
Perry Yuan <perry.yuan@....com>,
Easwar Hariharan <eahariha@...ux.microsoft.com>,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/3] acpi: allow building without CONFIG_HAS_IOPORT
On Fri, Oct 11, 2024 at 01:28:23PM +0200, Rafael J. Wysocki wrote:
> On Fri, Oct 11, 2024 at 1:12 PM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> > On Fri, Oct 11, 2024 at 09:59:46AM +0000, Arnd Bergmann wrote:
> > > On Fri, Oct 11, 2024, at 09:53, Andy Shevchenko wrote:
> > > > On Fri, Oct 11, 2024 at 06:18:18AM +0000, Arnd Bergmann wrote:
...
> > > >> + if (!IS_ENABLED(CONFIG_HAS_IOPORT)) {
> > > >> + *value = BIT_MASK(width);
> > > >> + return AE_NOT_IMPLEMENTED;
> > > >
> > > > Perhaps it has already been discussed, but why do we need to file value with
> > > > semi-garbage when we know it's invalid anyway?
> > >
> > > It's not strictly necessary, just precaution for possible callers
> > > that use the resulting data without checking the error code.
> >
> > Do you have any examples of that in the kernel?
>
> Yes, there are at least 2 cases. May not be relevant, though.
Btw, may be we even can add the error check to them, dunno...
> > > The all-ones data is what an x86 PC would see when an I/O
> > > port is read that is not connected to any device.
> >
> > Yes, but it's not what your code does.
>
> Care to elaborate?
Sure, but it seems Arnd already figured out that he set one bit only somewhere
in the returned value, not what he stated in the explanation in this email
thread.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists