Re: NCR53C8XX 3.0g fixes.

Hans Eric =?ISO-8859-1?Q?Sandstr=F6m (hes@xinit.se)
Sun, 04 Oct 1998 15:35:09 +0200


I am at work but If I get home at a decent time I will test this patch.

At home I have a file server with an ncr810 scsi controller. I had to patch the ncr driver to
be able to use it on this machine because my bios does not set the master bit. This is an x86
machine.

In the AM53C974 driver I fould the following comment:
/* PCI Spec 2.1 states that it is either the driver's or the PCI card's
responsibility
to set the PCI Master Enable Bit if needed.
(from Mark Stockton <marks@schooner.sys.hou.compaq.com>) */

So you can probably just remove the ifdef _powerpc_ around that piece of code since it does
not seem to be architecture dependent at all and remove the code from ifdef _sparc_. This is
not to much of a change for 2.2 is it?
I am attaching that patch (diff -c).

Earlier in the linux-kernel newsgroup we had a discussion around architecture dependant stuff
in drivers and came to some conclusion that such code should probably go into
drivers/pci/pci.c. This is of course a change for 2.3.

Is it feasibe to move the code architecture dependent code from the ncr driver and into
pci.c. Code for setting master bit is already present in drivers/pci/pci.c: pci_set_master.

The other stuff could be implemented as drivers/pci/pci.c: pci_set_io() pci_set_memory()

The wacky ibm stuff should probably be inside some ifdef_powerpc_ fix section.

The latency fix for sparc is probebly generic.

Well, I am no expert on the pci spec and I am sure hardware vendors break it all the time but
since we have the generic drivers/pci/pci.c code we should probably use it and try to fix all
architecture dependant stuff there. I know 2.0 does not have pci.c but I am still talking
about 2.3 development and we could probably drop 2.0 support in new versions of the drivers
when 2.2 is out.

The precense of pci.c probably calls for cleanup in lots of other drivers as well. We
probably have lots of duplicated code trying to deal with generic pci specific stuff in more
drivers.

Hans Eric

Here is the minor PCI_COMMAND_MASTER patch:
>diff -c ncr53c8xx.orig ncr53c8xx.c
*** ncr53c8xx.orig Sun Oct 4 14:31:04 1998
--- ncr53c8xx.c Sun Oct 4 15:22:07 1998
***************
*** 9732,9742 ****
return -1;
}

- #ifdef __powerpc__
- /*
- * Several fix-up for power/pc.
- * Should not be performed by the driver.
- */
if (!(command & PCI_COMMAND_MASTER)) {
printk("ncr53c8xx: attempting to force PCI_COMMAND_MASTER...");
command |= PCI_COMMAND_MASTER;
--- 9732,9737 ----
***************
*** 9749,9754 ****
--- 9744,9754 ----
}
}

+ #ifdef __powerpc__
+ /*
+ * Several fix-up for power/pc.
+ * Should not be performed by the driver.
+ */
if (!(command & PCI_COMMAND_IO)) {
printk("ncr53c8xx: attempting to force PCI_COMMAND_IO...");
command |= PCI_COMMAND_IO;
***************
*** 9802,9815 ****

base = __pa(base);
base_2 = __pa(base_2);
-
- if (!(command & PCI_COMMAND_MASTER)) {
- if (initverbose >= 2)
- printk("ncr53c8xx: setting PCI_COMMAND_MASTER bit (fixup)\n");
- command |= PCI_COMMAND_MASTER;
- pcibios_write_config_word(bus, device_fn, PCI_COMMAND, command);
- pcibios_read_config_word(bus, device_fn, PCI_COMMAND, &command);
- }

if ((chip->features & FE_WRIE) && !(command & PCI_COMMAND_INVALIDATE)) {
if (initverbose >= 2)
--- 9802,9807 ----

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/