* [PATCH] i2c-i801: Clear only status bits in HST_STS after waiting for INTR
@ 2012-06-28 8:59 Daniel Kurtz
[not found] ` <1340873970-19226-1-git-send-email-djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Kurtz @ 2012-06-28 8:59 UTC (permalink / raw)
To: Jean Delvare, Ben Dooks, Wolfram Sang, Seth Heasley
Cc: Olof Johansson, Benson Leung, linux-i2c, linux-kernel,
Daniel Kurtz
Writing back the whole status register could clear unwanted bits.
In particular, it could clear the "INUSE_STS" bit, which is a
'hardware semaphore', that might be useful to use some day.
To prepare for this, let's ban writing back the whole status to register
HST_STS, of which this is the only instance.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reported-by: Jean Delvare <khali@linux-fr.org>
---
drivers/i2c/busses/i2c-i801.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index ae2945a..7443990 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -301,7 +301,7 @@ static void i801_wait_hwpec(struct i801_priv *priv)
if (timeout > MAX_RETRIES)
dev_dbg(&priv->pci_dev->dev, "PEC Timeout!\n");
- outb_p(status, SMBHSTSTS(priv));
+ outb_p(status & STATUS_FLAGS, SMBHSTSTS(priv));
}
static int i801_block_transaction_by_block(struct i801_priv *priv,
--
1.7.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] i2c-i801: Clear only status bits in HST_STS after waiting for INTR
[not found] ` <1340873970-19226-1-git-send-email-djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
@ 2012-06-28 12:51 ` Jean Delvare
0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2012-06-28 12:51 UTC (permalink / raw)
To: Daniel Kurtz
Cc: Ben Dooks, Wolfram Sang, Seth Heasley, Olof Johansson,
Benson Leung, linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Thu, 28 Jun 2012 16:59:30 +0800, Daniel Kurtz wrote:
> Writing back the whole status register could clear unwanted bits.
> In particular, it could clear the "INUSE_STS" bit, which is a
> 'hardware semaphore', that might be useful to use some day.
> To prepare for this, let's ban writing back the whole status to register
> HST_STS, of which this is the only instance.
>
> Signed-off-by: Daniel Kurtz <djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
> Reported-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-i801.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index ae2945a..7443990 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -301,7 +301,7 @@ static void i801_wait_hwpec(struct i801_priv *priv)
> if (timeout > MAX_RETRIES)
> dev_dbg(&priv->pci_dev->dev, "PEC Timeout!\n");
>
> - outb_p(status, SMBHSTSTS(priv));
> + outb_p(status & STATUS_FLAGS, SMBHSTSTS(priv));
> }
>
> static int i801_block_transaction_by_block(struct i801_priv *priv,
Applied, thanks.
--
Jean Delvare
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-28 12:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 8:59 [PATCH] i2c-i801: Clear only status bits in HST_STS after waiting for INTR Daniel Kurtz
[not found] ` <1340873970-19226-1-git-send-email-djkurtz-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2012-06-28 12:51 ` Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).