public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: Greg KH <greg@kroah.com>, Linus Torvalds <torvalds@osdl.org>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>,
	linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org
Subject: Re: [PATCH] i2c-i801: Fix resume when PEC is used
Date: Wed, 19 Apr 2006 13:08:57 +0200	[thread overview]
Message-ID: <20060419130857.7f2db2d4.khali@linux-fr.org> (raw)
In-Reply-To: <20060418211546.fa5a76df.khali@linux-fr.org>

Quoting myself: 
> Anyway, on second thought I believe you're right, the most simple
> approach will be fine for 2.6.17 too. There's little point in trying
> to handle suspend/resume if we don't prevent it from happening in the
> middle of a transaction. Fixing that is beyond the scope of 2.6.17.
> 
> I'll send a new patch soon.

Here it is. This must go in 2.6.17.

* * * * *

Fix for bug #6395:
Fail to resume on Tecra M2 with ADM1032 and Intel 82801DBM

The BIOS of the Tecra M2 doesn't like it when it has to reboot or
resume after the i2c-i801 driver has left the SMBus in PEC mode. The
most simple fix is to clear the PEC bit after after every transaction.
That's what this driver was doing up to 2.6.15 (inclusive).

Thanks to Daniele Gaffuri for the very good report.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/i2c/busses/i2c-i801.c |    5 +++++
 1 file changed, 5 insertions(+)

--- linux-2.6.16.5.orig/drivers/i2c/busses/i2c-i801.c	2006-03-22 17:07:28.000000000 +0100
+++ linux-2.6.16.5/drivers/i2c/busses/i2c-i801.c	2006-04-17 11:11:06.000000000 +0200
@@ -478,6 +478,11 @@
 		ret = i801_transaction();
 	}
 
+	/* Some BIOSes don't like it when PEC is enabled at reboot or resume
+	   time, so we forcibly disable it after every transaction. */
+	if (hwpec)
+		outb_p(0, SMBAUXCTL);
+
 	if(block)
 		return ret;
 	if(ret)



-- 
Jean Delvare

  reply	other threads:[~2006-04-19 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-18 12:06 [PATCH] i2c-i801: Fix resume when PEC is used Jean Delvare
2006-04-18 17:03 ` [lm-sensors] " Mark M. Hoffman
2006-04-18 19:15   ` Jean Delvare
2006-04-19 11:08     ` Jean Delvare [this message]
2006-04-19 16:19       ` Linus Torvalds
2006-04-19 18:30         ` 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=20060419130857.7f2db2d4.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=mhoffman@lightlink.com \
    --cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox