linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] siimage: PIO1/2 taskfile transfer overclocking fix
@ 2007-01-28 20:46 Sergei Shtylyov
  2007-01-28 20:48 ` Sergei Shtylyov
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2007-01-28 20:46 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-ide, alan

Fix two typos found by SiI680A documentation check.  They caused the taskfile
transfer overclocking:

- in PIO mode 1 as 0x2283 must be used for both data and taskfile transfers;

- in PIO mode 2 as data and taskfile timings are swapped when writing to the
  MMIO regs.

Fix coding style and trailing whitespace in enclosing statements while at it...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

 drivers/ide/pci/siimage.c |   59 ++++++++++++++++++++++------------------------
 1 files changed, 29 insertions(+), 30 deletions(-)

Index: linux-2.6/drivers/ide/pci/siimage.c
===================================================================
--- linux-2.6.orig/drivers/ide/pci/siimage.c
+++ linux-2.6/drivers/ide/pci/siimage.c
@@ -1,8 +1,9 @@
 /*
- * linux/drivers/ide/pci/siimage.c		Version 1.07	Nov 30, 2003
+ * linux/drivers/ide/pci/siimage.c		Version 1.11	Jan 27, 2007
  *
  * Copyright (C) 2001-2002	Andre Hedrick <andre@linux-ide.org>
  * Copyright (C) 2003		Red Hat <alan@redhat.com>
+ * Copyright (C) 2007		MontaVista Software, Inc.
  *
  *  May be copied or modified under the terms of the GNU General Public License
  *
@@ -205,41 +206,39 @@ static void siimage_tuneproc (ide_drive_
 	unsigned long tfaddr	= siimage_selreg(hwif, 0x02);
 	
 	/* cheat for now and use the docs */
-	switch(mode_wanted) {
-		case 4:	
-			speedp = 0x10c1; 
-			speedt = 0x10c1;
-			break;
-		case 3:	
-			speedp = 0x10C3; 
-			speedt = 0x10C3;
-			break;
-		case 2:	
-			speedp = 0x1104; 
-			speedt = 0x1281;
-			break;
-		case 1:		
-			speedp = 0x2283; 
-			speedt = 0x1281;
-			break;
-		case 0:
-		default:
-			speedp = 0x328A; 
-			speedt = 0x328A;
-			break;
+	switch (mode_wanted) {
+	case 4:
+		speedp = 0x10c1;
+		speedt = 0x10c1;
+		break;
+	case 3:
+		speedp = 0x10c3;
+		speedt = 0x10c3;
+		break;
+	case 2:
+		speedp = 0x1104;
+		speedt = 0x1281;
+		break;
+	case 1:
+		speedp = 0x2283;
+		speedt = 0x2283;
+		break;
+	case 0:
+	default:
+		speedp = 0x328a;
+		speedt = 0x328a;
+		break;
 	}
-	if (hwif->mmio)
-	{
-		hwif->OUTW(speedt, addr);
-		hwif->OUTW(speedp, tfaddr);
+
+	if (hwif->mmio) {
+		hwif->OUTW(speedp, addr);
+		hwif->OUTW(speedt, tfaddr);
 		/* Now set up IORDY */
 		if(mode_wanted == 3 || mode_wanted == 4)
 			hwif->OUTW(hwif->INW(tfaddr-2)|0x200, tfaddr-2);
 		else
 			hwif->OUTW(hwif->INW(tfaddr-2)&~0x200, tfaddr-2);
-	}
-	else
-	{
+	} else {
 		pci_write_config_word(hwif->pci_dev, addr, speedp);
 		pci_write_config_word(hwif->pci_dev, tfaddr, speedt);
 		pci_read_config_word(hwif->pci_dev, tfaddr-2, &speedp);


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] siimage: PIO1/2 taskfile transfer overclocking fix
  2007-01-28 20:46 [PATCH] siimage: PIO1/2 taskfile transfer overclocking fix Sergei Shtylyov
@ 2007-01-28 20:48 ` Sergei Shtylyov
       [not found]   ` <58cb370e0702021327x8d7bb77uaf949ee91b26b14d@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Shtylyov @ 2007-01-28 20:48 UTC (permalink / raw)
  To: bzolnier; +Cc: linux-ide, alan

Hello, I wrote:
> Fix two typos found by SiI680A documentation check.  They caused the taskfile
> transfer overclocking:
> 
> - in PIO mode 1 as 0x2283 must be used for both data and taskfile transfers;
> 
> - in PIO mode 2 as data and taskfile timings are swapped when writing to the
>   MMIO regs.
> 
> Fix coding style and trailing whitespace in enclosing statements while at it...
> 
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

    Forgot to specify that this patch was against Linus' tree...

MBR, Sergei

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fwd: [PATCH] siimage: PIO1/2 taskfile transfer overclocking fix
       [not found]   ` <58cb370e0702021327x8d7bb77uaf949ee91b26b14d@mail.gmail.com>
@ 2007-02-02 21:46     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 3+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-02-02 21:46 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide, alan


Sergei Shtylyov wrote:
> 
> Hello, I wrote:
>> Fix two typos found by SiI680A documentation check.  They caused the taskfile
>> transfer overclocking:
>>
>> - in PIO mode 1 as 0x2283 must be used for both data and taskfile transfers;
>>
>> - in PIO mode 2 as data and taskfile timings are swapped when writing to the
>>   MMIO regs.
>>
>> Fix coding style and trailing whitespace in enclosing statements while at it...
>>
>> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> 
>    Forgot to specify that this patch was against Linus' tree...

applied


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-02 21:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-28 20:46 [PATCH] siimage: PIO1/2 taskfile transfer overclocking fix Sergei Shtylyov
2007-01-28 20:48 ` Sergei Shtylyov
     [not found]   ` <58cb370e0702021327x8d7bb77uaf949ee91b26b14d@mail.gmail.com>
2007-02-02 21:46     ` Fwd: " Bartlomiej Zolnierkiewicz

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).