public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Mark M. Hoffman" <mhoffman@lightlink.com>
To: Jean Delvare <khali@linux-fr.org>
Cc: Stefan Richter <stefanr@s5r6.in-berlin.de>,
	lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: 2.6.23-rc1 regression: hwmon/w83627ehf: wrong fan speed
Date: Sun, 12 Aug 2007 13:49:56 -0400	[thread overview]
Message-ID: <20070812174956.GA7411@jupiter.solarsys.private> (raw)
In-Reply-To: <20070811135705.0d0688d7@hyperion.delvare>

Hi Jean:

* Jean Delvare <khali@linux-fr.org> [2007-08-11 13:57:05 +0200]:
> Don't assume that the default bank is 0. For one thing, we don't even
> set it to 0 when the driver is loaded, so the initial state might be
> different. For another, something (say, the BIOS) might access the chip
> and leave with the bank set to something different, so assuming that
> the bank value is 0 is not safe.
> 
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> ---
>  drivers/hwmon/w83627ehf.c |    8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> --- linux-2.6.23-rc2.orig/drivers/hwmon/w83627ehf.c	2007-07-23 16:44:35.000000000 +0200
> +++ linux-2.6.23-rc2/drivers/hwmon/w83627ehf.c	2007-08-11 12:55:58.000000000 +0200
> @@ -309,18 +309,16 @@ static inline int is_word_sized(u16 reg)
>  	      || (reg & 0x00ff) == 0x55));
>  }
>  
> -/* We assume that the default bank is 0, thus the following two functions do
> -   nothing for registers which live in bank 0. For others, they respectively
> -   set the bank register to the correct value (before the register is
> -   accessed), and back to 0 (afterwards). */
> +/* Registers 0x50-0x5f are banked */
>  static inline void w83627ehf_set_bank(struct w83627ehf_data *data, u16 reg)
>  {
> -	if (reg & 0xff00) {
> +	if ((reg & 0x00f0) == 0x50) {
>  		outb_p(W83627EHF_REG_BANK, data->addr + ADDR_REG_OFFSET);
>  		outb_p(reg >> 8, data->addr + DATA_REG_OFFSET);
>  	}
>  }
>  
> +/* Not strictly necessary, but play it safe for now */
>  static inline void w83627ehf_reset_bank(struct w83627ehf_data *data, u16 reg)
>  {
>  	if (reg & 0xff00) {

Applied to hwmon-2.6.git/testing, thanks.

-- 
Mark M. Hoffman
mhoffman@lightlink.com


  parent reply	other threads:[~2007-08-12 17:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-05 11:20 2.6.23-rc1 regression: hwmon/w83627ehf: wrong fan speed Stefan Richter
2007-08-05 11:28 ` Stefan Richter
2007-08-05 13:55 ` Mark M. Hoffman
2007-08-05 14:51   ` Stefan Richter
2007-08-05 15:17     ` Mark M. Hoffman
2007-08-05 16:21 ` Mark M. Hoffman
2007-08-05 17:13   ` Stefan Richter
2007-08-10 21:08     ` Jean Delvare
2007-08-10 22:29       ` Stefan Richter
2007-08-10 22:39         ` Stefan Richter
2007-08-11  2:30           ` [lm-sensors] " David Hubbard
2007-08-11 11:57         ` Jean Delvare
2007-08-11 15:41           ` Stefan Richter
2007-08-11 15:48             ` Stefan Richter
2007-08-12  9:21               ` Jean Delvare
2007-08-12  9:17             ` Jean Delvare
2007-08-12 10:34               ` Stefan Richter
2007-08-12 10:43                 ` Stefan Richter
2007-08-12 17:49           ` Mark M. Hoffman [this message]
2007-08-12 16:06   ` 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=20070812174956.GA7411@jupiter.solarsys.private \
    --to=mhoffman@lightlink.com \
    --cc=khali@linux-fr.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=stefanr@s5r6.in-berlin.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