ali14xx fix (patch)

Andrzej Krzysztofowicz (ankry@green.mif.pg.gda.pl)
Sun, 15 Feb 1998 13:19:11 +0100 (CET)


Hi,
Forcing kernel to probe for ali14xx chipset (via kernel option) cause
a "division by zero" error and system hangs with Intel Triton motherboards.
As probing port 0x34 is guilty the following little patch fixes this
problem.
Do you know if this chipset family has been applied to anything else
than 486 MBs ?
Even if it hasn't, this patch simplifies start from removable disks on
different machines (eg. one using this chipset and one 586). This may be
necessary to boot if one uses "ide0=ali14xx" option in lilo.conf as there's
no way to disable the probing latar :(

With regards
Andrzej

***************************************************************************
--- ali14xx.c.old Sat Feb 14 01:21:02 1998
+++ ali14xx.c Sat Feb 14 01:26:59 1998
@@ -51,6 +51,8 @@
#include "ide.h"
#include "ide_modes.h"

+extern struct cpuinfo_x86 boot_cpu_data;
+
/* port addresses for auto-detection */
#define ALI_NUM_PORTS 4
static int ports[ALI_NUM_PORTS] = {0x074, 0x0f4, 0x034, 0x0e4};
@@ -156,6 +158,9 @@
cli();
for (i = 0; i < ALI_NUM_PORTS; ++i) {
basePort = ports[i];
+ if (boot_cpu_data.x86 >= 5 && basePort == 0x34)
+ /* probing this port cause hangs with 586 boards */
+ continue;
regOff = inb(basePort);
for (regOn = 0x30; regOn <= 0x33; ++regOn) {
outb_p(regOn, basePort);

-- 
=======================================================================
  Andrzej M. Krzysztofowicz               ankry@mif.pg.gda.pl
  phone (48)(58) 347 14 61
Faculty of Applied Phys. & Math.,   Technical University of Gdansk

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu