From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Jean Delvare <jdelvare@suse.de>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
"Wolfram Sang" <wsa@the-dreams.de>,
"Jarkko Nikula" <jarkko.nikula@linux.intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"Andy Lutomirski" <luto@kernel.org>,
"Mario Limonciello" <mario_limonciello@dell.com>,
"Matt Fleming" <matt@codeblueprint.co.uk>,
linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org
Subject: Re: [v5] i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR
Date: Tue, 5 Jul 2016 13:14:55 +0300 [thread overview]
Message-ID: <20160705101455.GM23527@lahna.fi.intel.com> (raw)
In-Reply-To: <20160704102212.319cfd8e@endymion>
On Mon, Jul 04, 2016 at 10:22:12AM +0200, Jean Delvare wrote:
> Hi Mika,
>
> On Wed, 29 Jun 2016 13:39:51 +0300, Mika Westerberg wrote:
> > On Fri, Jun 24, 2016 at 04:12:38PM +0200, Jean Delvare wrote:
> > > I think Pali is correct. The only purpose of handling the region is to
> > > detect that it is being accessed so we can set priv->acpi_reserved.
> > > Once it is set, i801_acpi_io_handler becomes transparent: it forwards
> > > the requests without doing anything with them. The very same would
> > > happen if we would unregister the handler at that point, but without the
> > > extra overhead.
> > >
> > > So while the current code does work fine, unregistering the handler
> > > when we set priv->acpi_reserved would be more optimal.
> > >
> > > Unless both Pali and myself are missing something, that is.
> >
> > I'm not sure unregistering the handler actually resets back to the
> > default handler.
>
> I'm no ACPI expert. I read the code of
> acpi_remove_address_space_handler() and a few other related ACPI
> functions and can't claim I understood it all. But indeed it doesn't
> look like it restores the original behavior. Probably
> acpi_install_address_space_handler(..., ACPI_ADR_SPACE_SYSTEM_IO,
> ACPI_DEFAULT_HANDLER, ...) should be used instead.
>
> This raises another question though: if
> acpi_remove_address_space_handler() doesn't restore the previous
> behavior then we shouldn't be calling it when the driver is being
> unloaded either. As I understand it, it breaks the ACPI handling of the
> device.
>
> However I can't test it, as the installed handler is never called
> on my system. Can anyone test unloading the i2c-i801 driver on a system
> where ACPI actually accesses the device?
The whole point of this patch is that we expect that nobody never uses
that OpRegion. I'm 99% sure you don't find a single machine where it is
actually in use.
The fallback code is there just to be sure we do not blow things up if
it turns out some machine is using that.
I think the best we can do is to lock down the module (prevent it from
unloading) if we notice that the OpRegion is used.
next prev parent reply other threads:[~2016-07-05 10:14 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-23 8:04 [PATCH v5] i2c: i801: Allow ACPI SystemIO OpRegion to conflict with PCI BAR Mika Westerberg
2016-06-08 16:29 ` [v5] " Benjamin Tissoires
2016-06-09 8:15 ` Mika Westerberg
2016-06-13 9:19 ` Jean Delvare
2016-06-13 9:45 ` Pali Rohár
2016-06-13 9:46 ` Mika Westerberg
2016-06-13 9:48 ` Pali Rohár
2016-06-13 9:54 ` Mika Westerberg
2016-06-24 14:12 ` Jean Delvare
2016-06-29 7:56 ` Pali Rohár
2016-06-29 10:39 ` Mika Westerberg
2016-07-04 8:22 ` Jean Delvare
2016-07-04 14:30 ` Pali Rohár
2016-07-05 10:14 ` Mika Westerberg [this message]
2016-07-05 11:30 ` Pali Rohár
2016-07-05 11:51 ` Mika Westerberg
2016-07-05 11:56 ` Pali Rohár
2016-07-05 12:00 ` Pali Rohár
2016-07-05 14:31 ` Mika Westerberg
2016-07-24 10:08 ` Martin Vajnar
2016-07-25 10:19 ` Pali Rohár
2016-07-14 11:52 ` Pali Rohár
2016-07-14 14:20 ` Rafael J. Wysocki
2016-07-25 10:22 ` Pali Rohár
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160705101455.GM23527@lahna.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=benjamin.tissoires@redhat.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=jdelvare@suse.de \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mario_limonciello@dell.com \
--cc=matt@codeblueprint.co.uk \
--cc=pali.rohar@gmail.com \
--cc=rjw@rjwysocki.net \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).