All of lore.kernel.org
 help / color / mirror / Atom feed
From: vsu@altlinux.ru (Sergey Vlasov)
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Samuel Tardieu <sam@rfc1149.net>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	Jim Cromie <jim.cromie@gmail.com>,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: [lm-sensors] [PATCH] watchdog: add support for w83697hg chip
Date: Sat, 09 Sep 2006 18:02:56 +0000	[thread overview]
Message-ID: <20060909220256.d4486a4f.vsu@altlinux.ru> (raw)
In-Reply-To: <1157815525.6877.43.camel@localhost.localdomain>

On Sat, 09 Sep 2006 16:25:25 +0100 Alan Cox wrote:

> Ar Mer, 2006-09-06 am 12:29 +0200, ysgrifennodd Samuel Tardieu:
> > +static unsigned char
> > +w83697hg_get_reg(unsigned char reg)
> > +{
> > +	outb_p(reg, W83697HG_EFIR);
> > +	return inb_p(W83697HG_EFDR);
> > +}
> 
> No kernel level locking anywhere in the driver. Yet you could have two
> people accessing it at once.

Actually the situation is worse.  This driver pokes at SuperIO
configuration registers, which are shared by all logical devices of the
SuperIO chip.  There are other drivers which touch these registers -
e.g., drivers/hwmon/w83627hf.c handles the hardware monitor part of this
chip; many other hwmon drivers handle other SuperIO devices.  Hardware
monitor drivers access the SuperIO config during initialization and do
not request that port region, therefore loading hwmon drivers when
w83697hf_wdt is loaded can lead to conflicts.

More places which seem to touch SuperIO config:

  - drivers/parport/parport_pc.c
  - drivers/net/irda/nsc-ircc.c
  - drivers/net/irda/smsc-ircc2.c
  - drivers/net/irda/via-ircc.h

I can find at least two attempts to fix the SuperIO problem:

  - a SuperIO subsystem proposed by Evgeniy Polyakov (cc'd);

  - a simple SuperIO locks coordinator proposed by Jim Cromie (also
    cc'd; http://thread.gmane.org/gmane.linux.drivers.sensors/10052 -
    can't find actual patches).

However, the mainline kernel still does not have anything for proper
SuperIO access locking.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060909/b34f08ee/attachment.bin 

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Vlasov <vsu@altlinux.ru>
To: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Samuel Tardieu <sam@rfc1149.net>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	Jim Cromie <jim.cromie@gmail.com>,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: Re: [PATCH] watchdog: add support for w83697hg chip
Date: Sat, 9 Sep 2006 22:02:56 +0400	[thread overview]
Message-ID: <20060909220256.d4486a4f.vsu@altlinux.ru> (raw)
In-Reply-To: <1157815525.6877.43.camel@localhost.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

On Sat, 09 Sep 2006 16:25:25 +0100 Alan Cox wrote:

> Ar Mer, 2006-09-06 am 12:29 +0200, ysgrifennodd Samuel Tardieu:
> > +static unsigned char
> > +w83697hg_get_reg(unsigned char reg)
> > +{
> > +	outb_p(reg, W83697HG_EFIR);
> > +	return inb_p(W83697HG_EFDR);
> > +}
> 
> No kernel level locking anywhere in the driver. Yet you could have two
> people accessing it at once.

Actually the situation is worse.  This driver pokes at SuperIO
configuration registers, which are shared by all logical devices of the
SuperIO chip.  There are other drivers which touch these registers -
e.g., drivers/hwmon/w83627hf.c handles the hardware monitor part of this
chip; many other hwmon drivers handle other SuperIO devices.  Hardware
monitor drivers access the SuperIO config during initialization and do
not request that port region, therefore loading hwmon drivers when
w83697hf_wdt is loaded can lead to conflicts.

More places which seem to touch SuperIO config:

  - drivers/parport/parport_pc.c
  - drivers/net/irda/nsc-ircc.c
  - drivers/net/irda/smsc-ircc2.c
  - drivers/net/irda/via-ircc.h

I can find at least two attempts to fix the SuperIO problem:

  - a SuperIO subsystem proposed by Evgeniy Polyakov (cc'd);

  - a simple SuperIO locks coordinator proposed by Jim Cromie (also
    cc'd; http://thread.gmane.org/gmane.linux.drivers.sensors/10052 -
    can't find actual patches).

However, the mainline kernel still does not have anything for proper
SuperIO access locking.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2006-09-09 18:02 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   ` Sergey Vlasov [this message]
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
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=20060909220256.d4486a4f.vsu@altlinux.ru \
    --to=vsu@altlinux.ru \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=jim.cromie@gmail.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=sam@rfc1149.net \
    /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.