From: jim.cromie@gmail.com (Jim Cromie)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [RFC-patch 0/3] SuperIO locks coordinator
Date: Fri, 15 Sep 2006 07:23:23 +0000 [thread overview]
Message-ID: <450A54EB.1020305@gmail.com> (raw)
In-Reply-To: <4508FF2F.5020504@gmail.com>
David Hubbard wrote:
> Hi Jim,
Hi Dave,
>
>> Some SuperIO devices implement a pseudo-locking scheme which
>> turns off the port unless an activation-sequence is used 1st.
>> Once a port is 'idled', it will ignore access until it is re-activated
>> by doing a specific sequence of operations.
>>
>> Those sequences vary per-device, and generally would require a callback
>> to accomodate the variations. This implies that all drivers for a
>> superio device
>> would have to supply the (same) callbacks, with superio-locks
>> remembering
>> only the 1st (they better all be the same anyway, so this by itself isnt
>> a limitation).
>>
>> w83627ehf.c:
>> static inline void superio_enter(void)
>> {
>> outb(0x87, REG);
>> outb(0x87, REG);
>> }
>> static inline void superio_exit(void)
>> {
>> outb(0x02, REG);
>> outb(0x02, VAL);
>> }
>>
>> w83627hf.c differs from above !!!
>>
>> static inline void superio_exit(void)
>> {
>> outb(0xAA, REG);
>> }
>>
>>
>> The problem with these pseudo-locks is they dont really protect anyway;
>> if the sequences are used at all, every driver would have to unlock the
>> chip b4 doing anything else, and (I assume) activating an already
>> active port will work,
>> allowing one driver to interfere with another.
>>
>> I therefore redefined those functions: superio_enter/exit() now do
>> mutex_lock/unlock() on the reserved mutex. Perhaps the API should have
>> superio_lock/unlock() instead, and leave superio_enter/exit() for
>> drivers to
>> implement themselves if they need/want it.
>
> I'd be happy to see those changes in the w83627ehf driver. I'll apply
> the patches and see if I can get it working on my machine.
>
Thanks ! but (maybe) hold off on that.
superio-find/get wont work properly for you cuz you've got a 2-byte devid.
You could set it up to detect based on either byte of the devid, and you
could
hack in a manual check on the other byte.. Kinda kludgy though.
Ill work up another version of patch 1 that has and uses a superio_inw()
if wanted devid is > 255. I hope that no superio devices have a 2-byte
id with msb=0
Im thinking about adding something like this, to simplify superio_find's
arglist,
and get rid of the >255 cheesiness. (arguably the width bit is still
somewhat cheesy)
struct superio_port_probe {
u16 *cmd_addrs; /* null terminated */
u16 *device_ids; /* null terminated */
u16 devid_mask;
u8 width; /* 0: bytewide, 1: wordwide */
};
BTW, are the idle/activate sequences doc'd in your datasheet ?
I ask this cuz pc87360 has a superio-exit defined (and used), but no
superio-enter(),
and I couldnt find the idle/activate sequences docd in my datasheet.
With the long history of copy & modify in these drivers, its possible
that some cargo-cult features were inadvertently carried forward,
esp when drivers are written w/o actually having the hardare.
Could you disable your superio-enter(), and see if that breaks the
functionality ?
> David
>
thanks again,
jimc
next prev parent reply other threads:[~2006-09-15 7:23 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-06 10:29 [PATCH] watchdog: add support for w83697hg chip Samuel Tardieu
2006-09-06 11:14 ` Pádraig Brady
2006-09-06 11:29 ` Samuel Tardieu
2006-09-06 11:49 ` Pádraig Brady
2006-09-06 12:07 ` Samuel Tardieu
2006-09-06 12:48 ` Pádraig Brady
2006-09-06 19:41 ` Wim Van Sebroeck
2006-09-07 9:57 ` Samuel Tardieu
2006-09-07 13:24 ` Pádraig Brady
2006-09-07 16:44 ` Samuel Tardieu
2006-09-08 9:16 ` Pádraig Brady
2006-09-08 9:49 ` Samuel Tardieu
2006-09-07 17:26 ` Jim Cromie
2006-09-07 18:06 ` Samuel Tardieu
2006-09-08 12:22 ` Jean Delvare
2006-09-09 15:25 ` Alan Cox
2006-09-09 15:18 ` Samuel Tardieu
2006-09-09 15:33 ` Samuel Tardieu
2006-09-09 15:58 ` Alan Cox
2006-09-09 15:38 ` Samuel Tardieu
2006-09-09 16:28 ` Samuel Tardieu
2006-09-09 21:49 ` Alexey Dobriyan
2006-09-09 22:11 ` Samuel Tardieu
2006-09-09 22:27 ` Alexey Dobriyan
2006-09-09 18:02 ` [lm-sensors] " Sergey Vlasov
2006-09-09 18:02 ` Sergey Vlasov
2006-09-09 18:35 ` [lm-sensors] " Samuel Tardieu
2006-09-09 18:35 ` Samuel Tardieu
2006-09-11 5:50 ` [lm-sensors] " Evgeniy Polyakov
2006-09-11 5:50 ` Evgeniy Polyakov
2006-09-13 19:15 ` Wim Van Sebroeck
2006-09-14 7:15 ` Wim Van Sebroeck
2006-09-14 7:05 ` [lm-sensors] [RFC-patch 0/3] SuperIO locks coordinator (was: Jim Cromie
2006-09-14 7:05 ` [RFC-patch 0/3] SuperIO locks coordinator (was: watchdog: add support for w83697hg chip) Jim Cromie
2006-09-14 7:13 ` [lm-sensors] [RFC-patch 1/3] SuperIO locks coordinator Jim Cromie
2006-09-14 7:13 ` Jim Cromie
2006-09-17 17:23 ` [lm-sensors] " Randy.Dunlap
2006-09-17 17:23 ` Randy.Dunlap
2006-09-14 7:16 ` [lm-sensors] [RFC-patch 2/3] " Jim Cromie
2006-09-14 7:16 ` Jim Cromie
2006-09-14 7:20 ` [lm-sensors] [RFC-patch 3/3] SuperIO locks coordinator - use in Jim Cromie
2006-09-14 7:20 ` [RFC-patch 3/3] SuperIO locks coordinator - use in pc8736x_gpio Jim Cromie
2006-09-26 4:33 ` [lm-sensors] [RFC-patch 3/3] SuperIO locks coordinator - use in David Hubbard
2006-09-26 14:12 ` Jim Cromie
2006-09-14 21:58 ` [lm-sensors] [RFC-patch 0/3] SuperIO locks coordinator Jim Cromie
2006-09-14 21:58 ` Jim Cromie
2006-09-15 0:53 ` [lm-sensors] " David Hubbard
2006-09-15 7:23 ` Jim Cromie [this message]
2006-09-15 18:18 ` David Hubbard
2006-09-16 17:17 ` Jim Cromie
2006-09-16 17:17 ` Jim Cromie
2006-09-19 13:11 ` Samuel Tardieu
2006-09-19 13:11 ` Samuel Tardieu
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=450A54EB.1020305@gmail.com \
--to=jim.cromie@gmail.com \
--cc=lm-sensors@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.