From: Jean Delvare <khali@linux-fr.org>
To: Natarajan Gurumoorthy <natg@google.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
Guenter Roeck <guenter.roeck@ericsson.com>,
Wim Van Sebroeck <wim@iguana.be>,
linux-watchdog@vger.kernel.org, lm-sensors@lm-sensors.org,
linux-kernel@vger.kernel.org, Mike Waychison <mikew@google.com>
Subject: Re: [lm-sensors] [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers
Date: Wed, 13 Apr 2011 10:34:09 +0200 [thread overview]
Message-ID: <20110413103409.47638b72@endymion.delvare> (raw)
In-Reply-To: <BANLkTikfuvvujTi6i2MUGOHgNLZCqcouJQ@mail.gmail.com>
On Wed, 13 Apr 2011 01:05:33 -0700, Natarajan Gurumoorthy wrote:
> Hans,
> Comments below
>
> On Tue, Apr 12, 2011 at 11:50 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> >
> > You shouldn't (void) this, there is a reason you get a warning
> > otherwise! request_muxed_region can still fail if some other driver
> > has done a none muxed request_region on the same region, and in that
> > case you should not continue with accessing the io-ports.
> There are 3 it87 drivers and they all have to do the exact same
> sequence to put the chip into a mode where they can modify its state.
> The sequences involve non atomic sequences that write locations 0x2e
> and 0x2f. When they are done they write a different sequence to these
> 2 locations. The entry routine is superio_enter and exit is
> superio_exit. All the it87 drivers reserve these 2 locations before
> they start manipulating the chip. This macro will hold off requestors
> if the resource is busy because one of the other drivers is
> manipulating the chip. Once the an it87 driver is done it calls
> superio_exit which will release the reservation on those 2 locations
> letting any other driver on the wait queue to now gain access two
> locations.
>
> Please read code in kernel/resource.c function "__request_region".
> "request_muxed_region" turns on IORESOURCE_MUXED bit and that means
> that only way an it87 driver will get back from a call to
> "request_muxed_region" is when it gets hold of the region.
>
> The scenario you mention above can never happen.
Let me be straight clear, as apparently you have difficulties
understanding Hans's simple request:
You do not get to (void) the return of request_muxed_region(), period.
This is _not_ negotiable.
What other it87 drivers currently in the tree do or don't do is totally
irrelevant. There can be new it87 drivers added later, there can be
out-of-tree it87 drivers (including old copies of in-tree ones), and
there can be non-it87 drivers accessing the I/O ports (or at least
attempting to.) So the scenario mentioned by Hans can very well happen,
and you have to deal with it.
Thanks,
--
Jean Delvare
next prev parent reply other threads:[~2011-04-13 8:34 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 20:48 [PATCH v5 0/2] Make all it87 drivers SMP safe Nat Gurumoorthy
2011-04-12 20:49 ` [PATCH v5 1/2] Use "request_muxed_region" in it87 watchdog drivers Nat Gurumoorthy
2011-04-13 6:50 ` [lm-sensors] " Hans de Goede
2011-04-13 8:05 ` Natarajan Gurumoorthy
2011-04-13 8:34 ` Jean Delvare [this message]
2011-04-13 17:59 ` Natarajan Gurumoorthy
2011-04-13 20:34 ` Jean Delvare
2011-04-14 9:25 ` Alan Cox
2011-04-14 17:58 ` Guenter Roeck
2011-04-13 7:03 ` Wim Van Sebroeck
2011-04-13 8:15 ` Natarajan Gurumoorthy
2011-04-13 9:29 ` Alan Cox
2011-04-14 19:00 ` Mike Waychison
2011-04-14 20:41 ` Alan Cox
2011-04-12 20:50 ` [PATCH v5 2/2] Use "request_muxed_region" in it87 hwmon drivers Nat Gurumoorthy
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=20110413103409.47638b72@endymion.delvare \
--to=khali@linux-fr.org \
--cc=guenter.roeck@ericsson.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=mikew@google.com \
--cc=natg@google.com \
--cc=wim@iguana.be \
/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
Powered by JetHome