public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] AMD IDE oops in current 2.4-ac
@ 2003-02-12 19:48 Andreas Arens
  2003-02-12 19:49 ` Dave Jones
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Arens @ 2003-02-12 19:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: alan

Current 2.4.21-pre4-ac kernels oops in amd74xx.c with
certain chipsets due to a table order problem. The
problem is correctly detected by a BUG() in the pci probe
routine, which should trigger for all non-nforce chipsets.

Regards
Andy

The fix, tested on a 7409 Viper board, is simple:

--- linux-2.4.21-pre4-ac4/drivers/ide/pci/amd74xx.c	Wed Feb 12 00:19:56 2003
+++ linux/drivers/ide/pci/amd74xx.c	Tue Feb 11 23:26:32 2003
@@ -54,11 +54,11 @@
 	unsigned long base;
 	unsigned char flags;
 } amd_ide_chips[] = {
-	{ PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },			/* AMD-8111 */
-	{ PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },			/* AMD-768 Opus */
-	{ PCI_DEVICE_ID_AMD_VIPER_7411, 0x00, 0x40, AMD_UDMA_100 | AMD_BAD_FIFO },	/* AMD-766 Viper */
-	{ PCI_DEVICE_ID_AMD_VIPER_7409, 0x00, 0x40, AMD_UDMA_66 | AMD_CHECK_SWDMA },	/* AMD-756 Viper */
 	{ PCI_DEVICE_ID_AMD_COBRA_7401, 0x00, 0x40, AMD_UDMA_33 | AMD_BAD_SWDMA },	/* AMD-755 Cobra */
+	{ PCI_DEVICE_ID_AMD_VIPER_7409, 0x00, 0x40, AMD_UDMA_66 | AMD_CHECK_SWDMA },	/* AMD-756 Viper */
+	{ PCI_DEVICE_ID_AMD_VIPER_7411, 0x00, 0x40, AMD_UDMA_100 | AMD_BAD_FIFO },	/* AMD-766 Viper */
+	{ PCI_DEVICE_ID_AMD_OPUS_7441, 0x00, 0x40, AMD_UDMA_100 },			/* AMD-768 Opus */
+	{ PCI_DEVICE_ID_AMD_8111_IDE,  0x00, 0x40, AMD_UDMA_100 },			/* AMD-8111 */
         { PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, 0x00, 0x50, AMD_UDMA_100 },                  /* nVidia nForce */
         { PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE, 0x00, 0x50, AMD_UDMA_100 },                  /* nVidia nForce */
 



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

* Re: [PATCH] AMD IDE oops in current 2.4-ac
  2003-02-12 19:48 [PATCH] AMD IDE oops in current 2.4-ac Andreas Arens
@ 2003-02-12 19:49 ` Dave Jones
  2003-02-12 20:37   ` Andreas Arens
  2003-02-12 22:55   ` Ruslan U. Zakirov
  0 siblings, 2 replies; 4+ messages in thread
From: Dave Jones @ 2003-02-12 19:49 UTC (permalink / raw)
  To: Andreas Arens; +Cc: linux-kernel, alan

On Wed, Feb 12, 2003 at 08:48:15PM +0100, Andreas Arens wrote:
 > Current 2.4.21-pre4-ac kernels oops in amd74xx.c with
 > certain chipsets due to a table order problem. The
 > problem is correctly detected by a BUG() in the pci probe
 > routine, which should trigger for all non-nforce chipsets.

If moving entries in the table caused a bug, adding new entries
could do the same too perhaps ? This sounds quite fragile
based on your description & diff.

		Dave

-- 
| Dave Jones.        http://www.codemonkey.org.uk
| SuSE Labs

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

* [PATCH] AMD IDE oops in current 2.4-ac
  2003-02-12 19:49 ` Dave Jones
@ 2003-02-12 20:37   ` Andreas Arens
  2003-02-12 22:55   ` Ruslan U. Zakirov
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Arens @ 2003-02-12 20:37 UTC (permalink / raw)
  To: Dave Jones; +Cc: linux-kernel, alan

On Wednesday 12 February 2003 20:49, Dave Jones wrote:
>  > Current 2.4.21-pre4-ac kernels oops in amd74xx.c with
>  > certain chipsets due to a table order problem. The
>  > problem is correctly detected by a BUG() in the pci probe
>  > routine, which should trigger for all non-nforce chipsets.
>
> If moving entries in the table caused a bug, adding new entries
> could do the same too perhaps ? This sounds quite fragile
> based on your description & diff.
>
amd74xx_probe() compares the pci device ids of both the
probe table and the settings table, so should be save from
misprogramming.
To protect against using random memory after the end
of the table, a bug check on the table size could help:
        if (dev->device != d->device) BUG();
+      if (sizeof(amd_ide_chips) >= id->driver_data) BUG();
        if (dev->device != amd_config->id) BUG();

Even with this it still looks error prone, especially since
the probe table and the config table are several lines
spread across the file.

Regards
Andy


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

* Re: [PATCH] AMD IDE oops in current 2.4-ac
  2003-02-12 19:49 ` Dave Jones
  2003-02-12 20:37   ` Andreas Arens
@ 2003-02-12 22:55   ` Ruslan U. Zakirov
  1 sibling, 0 replies; 4+ messages in thread
From: Ruslan U. Zakirov @ 2003-02-12 22:55 UTC (permalink / raw)
  To: Dave Jones; +Cc: Andreas Arens, linux-kernel, alan

On Wed, 12 Feb 2003, Dave Jones wrote:

> On Wed, Feb 12, 2003 at 08:48:15PM +0100, Andreas Arens wrote:
>  > Current 2.4.21-pre4-ac kernels oops in amd74xx.c with
>  > certain chipsets due to a table order problem. The
>  > problem is correctly detected by a BUG() in the pci probe
>  > routine, which should trigger for all non-nforce chipsets.
> 
> If moving entries in the table caused a bug, adding new entries
> could do the same too perhaps ? This sounds quite fragile
> based on your description & diff.
> 
> 		Dave
	Hello, Dave and other.
Same behavior was in 2.5.5x and I've send similar patch to Linus and it
was apllied. Changeset 1.879.1.84. There is two tables and missorder of
devices cause a BUG() during init.
	Thanks, Ruslan.


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

end of thread, other threads:[~2003-02-12 22:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-02-12 19:48 [PATCH] AMD IDE oops in current 2.4-ac Andreas Arens
2003-02-12 19:49 ` Dave Jones
2003-02-12 20:37   ` Andreas Arens
2003-02-12 22:55   ` Ruslan U. Zakirov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox