re: RZ1000 bugfix in 1.2.14?

Delman Lee (delman@mipg.upenn.edu)
Wed, 27 Sep 95 18:51:11 EDT


] From: smeets@prl.philips.nl (Mark Smeets)
]
] Maybe it's a good idea to release a 1.2.14 kernel which includes a
] reliable way to work with the RZ1000 chip?

As long as one doesn't use "hdparm -u1 /dev/hd?", things should be
safe. If you really want to disable the read-ahead of the RZ1000, the
following patch against 1.2.13's drivers/block/ide.c should do the
trick. It's taken from 1.3.x driver. (You may want to do "hdparm -c1
/dev/hd?" when read-ahead is disabled.)

Delman.
____________________________________________________________________

*** ide.c.orig Thu Jun 1 04:23:04 1995
--- ide.c Tue Sep 26 13:16:23 1995
***************
*** 144,149 ****
--- 144,151 ----
#include <linux/ioport.h>
#include <linux/interrupt.h>
#include <linux/blkdev.h>
+ #include <linux/bios32.h>
+ #include <linux/pci.h>
#include <asm/bitops.h>
#include <asm/irq.h>
#include <asm/segment.h>
***************
*** 2358,2363 ****
--- 2360,2399 ----
}
#endif /* SUPPORT_DTC2278 */

+ #ifdef CONFIG_PCI
+ static void probe_pcibios(void)
+ {
+ #define PCI_VENDOR_ID_PCTECH 0x1042
+ #define PCI_DEVICE_ID_PCTECH_RZ1000 0x1000
+
+ if(pcibios_present())
+ {
+ unsigned short reg;
+ unsigned long flags;
+ unsigned index = 0;
+ byte fn, bus;
+ int rc;
+
+ save_flags(flags);
+ cli();
+ for (index = 0; !pcibios_find_device (PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, index, &bus, &fn); ++index) {
+ unsigned short command;
+ printk("ide: PCTech RZ1000 found\n");
+ if ((rc = pcibios_read_config_word (bus, fn, PCI_COMMAND, &command))) {
+ printk("ide: pcibios access failed\n");
+ } else if (command & 1) {/* is device enabled? */
+ if ((rc = pcibios_read_config_word(bus, fn, 0x40, &reg))
+ || (rc = pcibios_write_config_word(bus, fn, 0x40, reg & 0xdfff)))
+ printk("ide: unable to disable read-ahead\n");
+ else
+ printk("ide: read-ahead disabled\n");
+ }
+ }
+ restore_flags(flags);
+ }
+ }
+ #endif /* CONFIG_PCI */
+
/*
* This is gets invoked once during initialization, to set *everything* up
*/
***************
*** 2365,2370 ****
--- 2401,2409 ----
{
byte hwif;

+ #ifdef CONFIG_PCI
+ probe_pcibios();
+ #endif CONFIG_PCI
#if SUPPORT_DTC2278
if (probe_dtc2278)
try_to_init_dtc2278();