public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: "Moore, Robert" <robert.moore@intel.com>
Cc: "Pavel Machek" <pavel@ucw.cz>, "Brown, Len" <len.brown@intel.com>,
	"Matthew Garrett" <mjg59@srcf.ucam.org>,
	"Chuck Ebbert" <cebbert@redhat.com>,
	"Rudolf Marek" <r.marek@assembler.cz>,
	<linux-acpi@vger.kernel.org>,
	"linux-kernel" <linux-kernel@vger.kernel.org>,
	<lm-sensors@lm-sensors.org>
Subject: Re: Could the k8temp driver be interfering with ACPI?
Date: Tue, 3 Apr 2007 09:21:02 +0200	[thread overview]
Message-ID: <20070403092102.1b3d3a23.khali@linux-fr.org> (raw)
In-Reply-To: <B28E9812BAF6E2498B7EC5C427F293A40232DFA9@orsmsx415.amr.corp.intel.com>

Hi Bob,

On Mon, 2 Apr 2007 13:55:49 -0700, Moore, Robert wrote:
> The ACPI specification allows concurrent execution of control methods
> although methods cannot be preempted. The ACPICA interpreter mutex is
> used to implement this model. 
> 
> From section 5.5.2, "Control Method Execution": Interpretation of a
> Control Method is not preemptive, but it can block. When a control
> method does block, the operating software can initiate or continue the
> execution of a different control method. A control method can only
> assume that access to global objects is exclusive for any period the
> control method does not block.

Do I/O regions count as "global objects"?

> Therefore, the interpreter lock is acquired and a control method is
> allowed to execute to completion unless it blocks on one of the events
> described below. If the method blocks, the interpreter is unlocked and
> other control methods may execute.
> 
> I'm not sure what you mean by "in the middle of an SMBus transaction", I
> don't know how long such a transaction is valid. I might guess that a
> single transaction can only span a single operation region access, but
> I'm not sure of this.

Basically an SMBus transaction looks like this:
1* Prepare the transaction.
2* Start the transaction.
3* Wait for the transaction to complete, typically a few ms.
4* Read the result of the transaction.

Steps 1 and 2 require writing to the SMBus I/O region. Step 4 requires
reading from it, and so does step 3 if the wait loop is poll-based. The
transaction is only safe if we have an exclusive access to the I/O
region during all the 4 steps. My fear is that step 3 could be
implemented by ACPI using either a Sleep() or Acquire() or Wait()
opcode. If it is, we're doomed. OTOH, if it does, it is probably not
even safe for itself, unless there's an additional,
implementation-specific mutex to protect SMBus transactions. I yet have
to get my hands on the DSDT of ACPI implementations which actually
access the SMBus to see exactly how they do it.

> A user-installed operation region handler is an operation region handler
> that is installed by a device driver. This feature would probably only
> be used for custom (OEM-defined) operation region address spaces. (I
> have not seen one yet.) For the standard address spaces (memory, I/O,
> etc.), usually only the default handlers are used.

Could regular Linux device drivers install such handlers for a specific
I/O region? I'm asking because Rudolf Marek's proposal [1] to solve the
concurrent access problem involved extending struct resource with
callbacks to driver-specific routines to handle external access to an
I/O region. This sounds somewhat similar to these "user-installed
operation region handler" defined by ACPI, doesn't it? If ACPI already
has an infrastructure to handle this problem, we probably want to use
it rather than implementing our own.

[1] http://marc.info/?l=linux-kernel&m=117302946017204&w=2

-- 
Jean Delvare

  reply	other threads:[~2007-04-03  7:23 UTC|newest]

Thread overview: 96+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-16 17:31 Could the k8temp driver be interfering with ACPI? Chuck Ebbert
2007-02-16 17:57 ` Len Brown
2007-02-16 18:14   ` Chuck Ebbert
2007-02-16 19:59 ` Andi Kleen
2007-02-16 19:31   ` Chuck Ebbert
2007-02-18 17:32     ` [lm-sensors] " Jean Delvare
2007-02-18 23:22       ` Andi Kleen
2007-02-17 10:49 ` Rudolf Marek
2007-02-17 18:14   ` Chuck Ebbert
2007-02-18 17:38     ` Jean Delvare
2007-02-20 15:18       ` Matthew Garrett
2007-02-20 15:33         ` Luca Tettamanti
2007-02-21 14:59           ` Jean Delvare
2007-02-21 15:07         ` Jean Delvare
2007-02-28 21:38       ` Pavel Machek
2007-03-01 14:26         ` Jean Delvare
2007-03-01 17:48           ` Dave Jones
2007-03-02 11:27             ` Jean Delvare
2007-03-02 11:31               ` Pavel Machek
2007-03-02 13:37                 ` Jean Delvare
2007-03-02 13:47                   ` Henrique de Moraes Holschuh
2007-03-02 13:57                   ` Pavel Machek
2007-03-03  6:44                     ` Jean Delvare
2007-03-02 11:40           ` Pavel Machek
2007-03-02 11:47             ` Matthew Garrett
2007-03-02 13:58               ` Pavel Machek
2007-03-02 21:00                 ` Jean Delvare
2007-03-02 21:22                   ` Henrique de Moraes Holschuh
2007-04-01 15:39                   ` Pavel Machek
2007-04-02 15:48                     ` Jean Delvare
2007-04-02 19:22                       ` Dave Jones
2007-04-03  5:49                         ` Jean Delvare
2007-04-02 20:55                       ` Moore, Robert
2007-04-03  7:21                         ` Jean Delvare [this message]
2007-04-04 21:35                           ` Moore, Robert
2007-03-02 14:10               ` [lm-sensors] " Jean Delvare
2007-03-02 14:18                 ` Matthew Garrett
2007-03-02 21:04                   ` Jean Delvare
2007-03-02 21:12                     ` Matthew Garrett
2007-03-03  9:53                       ` Jean Delvare
2007-03-03 15:47                         ` David Hubbard
2007-03-03 15:50                           ` Matthew Garrett
2007-03-03 17:08                             ` Rudolf Marek
2007-03-04 17:29                               ` Rudolf Marek
2007-03-05 21:16                                 ` Jean Delvare
2007-03-05 21:35                                   ` David Hubbard
2007-03-06 15:10                                     ` Jean Delvare
2007-03-04 10:54                           ` Jean Delvare
2007-03-05 22:25                         ` Pavel Machek
2007-03-06  7:55                           ` Benny Amorsen
2007-03-06 15:26                           ` Jean Delvare
2007-03-06 20:07                             ` Stefan Monnier
2007-03-06 21:20                             ` Pavel Machek
2007-03-06 21:25                               ` Moore, Robert
2007-03-18 19:36                         ` richardvoigt
2007-03-19  7:08                           ` Jean Delvare
2007-03-02 22:07                     ` Moore, Robert
2007-03-09  7:18                       ` Pavel Machek
2007-03-09 10:24                         ` Jean Delvare
2007-03-09 10:39                           ` Alexey Starikovskiy
2007-03-09 11:21                             ` Pavel Machek
2007-03-09 17:23                             ` Jean Delvare
2007-03-09 17:35                               ` Alexey Starikovskiy
2007-03-09 21:03                                 ` Moore, Robert
2007-03-09 20:56                         ` Moore, Robert
2007-03-02 14:22                 ` Pavel Machek
2007-03-02 14:03             ` Jean Delvare
2007-03-02 14:24               ` Pavel Machek
2007-03-02 14:57               ` Matthew Garrett
2007-03-02 21:41                 ` Jean Delvare
2007-03-02 21:46                   ` Matthew Garrett
2007-03-06 21:28                     ` Jean Delvare
2007-04-13 18:18               ` Bjorn Helgaas
2007-04-13 20:07                 ` Pavel Machek
2007-04-13 20:59                   ` Bjorn Helgaas
2007-04-15  9:41                     ` Jean Delvare
2007-04-15 20:31                       ` Bjorn Helgaas
2007-04-15 20:59                         ` Luca Tettamanti
2007-04-16  0:57                           ` Bjorn Helgaas
2007-04-16 21:14                             ` Luca Tettamanti
2007-04-16 22:28                               ` Bjorn Helgaas
2007-04-17 23:50                                 ` Luca Tettamanti
2007-04-22 16:55                                   ` Luca Tettamanti
2007-04-17 10:03                               ` Jean Delvare
2007-02-18 22:43     ` Rudolf Marek
2007-02-20 15:08       ` Chuck Ebbert
2007-02-20 19:11         ` Dave Jones
2007-02-21 16:17           ` Jean Delvare
2007-02-21 17:37             ` Dave Jones
2007-02-21 20:19               ` Dave Jones
2007-02-22 16:37                 ` Jean Delvare
2007-02-23  7:13                   ` Hans de Goede
2007-02-23  7:47                     ` Jean Delvare
2007-02-21 14:54         ` Jean Delvare
2007-02-21 16:03           ` Chuck Ebbert
2007-02-21 16:22             ` Jean Delvare

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=20070403092102.1b3d3a23.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=cebbert@redhat.com \
    --cc=len.brown@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=pavel@ucw.cz \
    --cc=r.marek@assembler.cz \
    --cc=robert.moore@intel.com \
    /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