* [PATCH 02/03] i2c-i801: Fix alignment issues
@ 2008-07-23 16:57 Ivo Manca
[not found] ` <488762E5.2030109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Ivo Manca @ 2008-07-23 16:57 UTC (permalink / raw)
To: Jean Delvare, Mark M. Hoffman; +Cc: Hans de Goede, i2c-GZX6beZjE8VD60Wz+7aTrA
[-- Attachment #1: Type: text/plain, Size: 220 bytes --]
This patch fixes alignment issues introduced by previous patch.
Signed-off-by: Ivo Manca <pinkel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
This patch depends on: [PATCH 01/03] i2c-i801: Add basic interrupt support
[-- Attachment #2: patch2.diff --]
[-- Type: text/plain, Size: 1528 bytes --]
--- i2c-i801-nolayout.c 2008-07-07 15:05:21.000000000 +0200
+++ i2c-i801.c 2008-07-07 15:04:25.000000000 +0200
@@ -210,24 +210,24 @@ static int i801_transaction(int xact)
((temp = i801_get_status(algo_data))
& I801_HST_STS_MASK_NORM), HZ/2);
} else {
- outb_p(xact | I801_START, SMBHSTCNT);
+ outb_p(xact | I801_START, SMBHSTCNT);
- /* We will always wait for a fraction of a second! */
- do {
- msleep(1);
- temp = inb_p(SMBHSTSTS);
- } while ((temp & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT));
+ /* We will always wait for a fraction of a second! */
+ do {
+ msleep(1);
+ temp = inb_p(SMBHSTSTS);
+ } while ((temp & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT));
- /* If the SMBus is still busy, we give up */
- if (timeout >= MAX_TIMEOUT) {
- dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
- result = -1;
- /* try to stop the current command */
- dev_dbg(&I801_dev->dev, "Terminating the current operation\n");
- outb_p(inb_p(SMBHSTCNT) | SMBHSTCNT_KILL, SMBHSTCNT);
- msleep(1);
- outb_p(inb_p(SMBHSTCNT) & (~SMBHSTCNT_KILL), SMBHSTCNT);
- }
+ /* If the SMBus is still busy, we give up */
+ if (timeout >= MAX_TIMEOUT) {
+ dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
+ result = -1;
+ /* try to stop the current command */
+ dev_dbg(&I801_dev->dev, "Terminating the current operation\n");
+ outb_p(inb_p(SMBHSTCNT) | SMBHSTCNT_KILL, SMBHSTCNT);
+ msleep(1);
+ outb_p(inb_p(SMBHSTCNT) & (~SMBHSTCNT_KILL), SMBHSTCNT);
+ }
}
if (temp & SMBHSTSTS_FAILED) {
[-- Attachment #3: Type: text/plain, Size: 157 bytes --]
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 02/03] i2c-i801: Fix alignment issues
[not found] ` <488762E5.2030109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2008-08-12 8:17 ` Jean Delvare
[not found] ` <20080812101753.592294a3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2008-08-12 8:17 UTC (permalink / raw)
To: Ivo Manca; +Cc: Hans de Goede, i2c-GZX6beZjE8VD60Wz+7aTrA
On Wed, 23 Jul 2008 18:57:09 +0200, Ivo Manca wrote:
> This patch fixes alignment issues introduced by previous patch.
>
> Signed-off-by: Ivo Manca <pinkel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> This patch depends on: [PATCH 01/03] i2c-i801: Add basic interrupt support
> --- i2c-i801-nolayout.c 2008-07-07 15:05:21.000000000 +0200
> +++ i2c-i801.c 2008-07-07 15:04:25.000000000 +0200
> @@ -210,24 +210,24 @@ static int i801_transaction(int xact)
> ((temp = i801_get_status(algo_data))
> & I801_HST_STS_MASK_NORM), HZ/2);
> } else {
> - outb_p(xact | I801_START, SMBHSTCNT);
> + outb_p(xact | I801_START, SMBHSTCNT);
>
> - /* We will always wait for a fraction of a second! */
> - do {
> - msleep(1);
> - temp = inb_p(SMBHSTSTS);
> - } while ((temp & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT));
> + /* We will always wait for a fraction of a second! */
> + do {
> + msleep(1);
> + temp = inb_p(SMBHSTSTS);
> + } while ((temp & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT));
>
> - /* If the SMBus is still busy, we give up */
> - if (timeout >= MAX_TIMEOUT) {
> - dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
> - result = -1;
> - /* try to stop the current command */
> - dev_dbg(&I801_dev->dev, "Terminating the current operation\n");
> - outb_p(inb_p(SMBHSTCNT) | SMBHSTCNT_KILL, SMBHSTCNT);
> - msleep(1);
> - outb_p(inb_p(SMBHSTCNT) & (~SMBHSTCNT_KILL), SMBHSTCNT);
> - }
> + /* If the SMBus is still busy, we give up */
> + if (timeout >= MAX_TIMEOUT) {
> + dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
> + result = -1;
> + /* try to stop the current command */
> + dev_dbg(&I801_dev->dev, "Terminating the current operation\n");
> + outb_p(inb_p(SMBHSTCNT) | SMBHSTCNT_KILL, SMBHSTCNT);
> + msleep(1);
> + outb_p(inb_p(SMBHSTCNT) & (~SMBHSTCNT_KILL), SMBHSTCNT);
> + }
> }
>
> if (temp & SMBHSTSTS_FAILED) {
OK. There's no real need to make this a separate patch. In fact I think
your first patch would be easier to read with these alignment issues
fixed, as it makes it easier to figure out what code paths your changes
are replacing. As a matter of fact, I applied this second patch before
reviewing the first one.
--
Jean Delvare
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 02/03] i2c-i801: Fix alignment issues
[not found] ` <20080812101753.592294a3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
@ 2008-08-12 20:43 ` Ivo Manca
0 siblings, 0 replies; 3+ messages in thread
From: Ivo Manca @ 2008-08-12 20:43 UTC (permalink / raw)
To: Jean Delvare; +Cc: Hans de Goede, i2c-GZX6beZjE8VD60Wz+7aTrA
Jean Delvare wrote:
> OK. There's no real need to make this a separate patch. In fact I think
> your first patch would be easier to read with these alignment issues
> fixed, as it makes it easier to figure out what code paths your changes
> are replacing. As a matter of fact, I applied this second patch before
> reviewing the first one.
>
>
Hey Jean,
First of all, thanks a lot for reviewing. It's very appriciated. I've
read and noted your comments, but will reply more detailed to the first
patch later. Quite busy lately (new house, graduated => new job)..
I thought it was easier (and even required) to seperate the patches this
way, but I seem to have been wrong ;p. Anyway, next time, this patch
will be incorporated with the first patch. I'll leave the third patch in
place, since it's completely unrelated.
Thanks,
Ivo
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-12 20:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 16:57 [PATCH 02/03] i2c-i801: Fix alignment issues Ivo Manca
[not found] ` <488762E5.2030109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-08-12 8:17 ` Jean Delvare
[not found] ` <20080812101753.592294a3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-08-12 20:43 ` Ivo Manca
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox