]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Data corruption fix in hpt366
authorChris Wright <chrisw@osdl.org>
Mon, 12 Sep 2005 18:43:17 +0000 (11:43 -0700)
committerChris Wright <chrisw@osdl.org>
Mon, 12 Sep 2005 18:43:17 +0000 (11:43 -0700)
queue/hpt366-write-dword-not-byte-for-ROM-resource.patch [new file with mode: 0644]
queue/series

diff --git a/queue/hpt366-write-dword-not-byte-for-ROM-resource.patch b/queue/hpt366-write-dword-not-byte-for-ROM-resource.patch
new file mode 100644 (file)
index 0000000..295192a
--- /dev/null
@@ -0,0 +1,39 @@
+From stable-bounces@linux.kernel.org  Sun Sep 11 14:07:53 2005
+Date: Sun, 11 Sep 2005 14:07:43 -0700 (PDT)
+From: Linus Torvalds <torvalds@osdl.org>
+To: stable@kernel.org
+Subject: hpt366: write the full 4 bytes of ROM address, not just low 1 byte
+
+From: Linus Torvalds <torvalds@g5.osdl.org>
+
+This is one heck of a confused driver.  It uses a byte write to a dword
+register to enable a ROM resource that it doesn't even seem to be using.
+
+"Lost and wandering in the desert of confusion"
+
+Signed-off-by: Linus Torvalds <torvalds@osdl.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+ drivers/ide/pci/hpt366.c |    8 ++++++--
+ 1 files changed, 6 insertions(+), 2 deletions(-)
+
+Index: linux-2.6.13.y/drivers/ide/pci/hpt366.c
+===================================================================
+--- linux-2.6.13.y.orig/drivers/ide/pci/hpt366.c
++++ linux-2.6.13.y/drivers/ide/pci/hpt366.c
+@@ -1334,9 +1334,13 @@ static int __devinit init_hpt366(struct 
+ static unsigned int __devinit init_chipset_hpt366(struct pci_dev *dev, const char *name)
+ {
+       int ret = 0;
+-      /* FIXME: Not portable */
++
++      /*
++       * FIXME: Not portable. Also, why do we enable the ROM in the first place?
++       * We don't seem to be using it.
++       */
+       if (dev->resource[PCI_ROM_RESOURCE].start)
+-              pci_write_config_byte(dev, PCI_ROM_ADDRESS,
++              pci_write_config_dword(dev, PCI_ROM_ADDRESS,
+                       dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE);
+       pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4));
index 68c8918e9aeec4a2889c5229321ecdec1baa2ed4..e69b17f1a4c6e63f5e720495c2e163497a2d0167 100644 (file)
@@ -1 +1,2 @@
 forcedeth-init-link-settings-in-nv_open.patch
+hpt366-write-dword-not-byte-for-ROM-resource.patch