PATCH: ncr/sym drivers and bridges

Gerard Roudier (groudier@club-internet.fr)
Sun, 25 Jul 1999 19:57:50 +0200 (MET DST)


I can propose a small preliminary patch that may be useful for ensuring
that the ncr/sym drivers will not lose completions with some not PCI
compliant bridges regarding flushing of posted write transactions.

For now, the changes consist in the following:

- Intel and IBM bridges are assumed fine.

- Alpha bridges (21172 and friends) is ok for the sym53c8xx driver by just
adding a dummy read in the interrupt handler. (The ncr53c8xx requires
a minor change in the SCRIPTS in order to be ok for the 21172 and I will
provide such a change after my vacations).

- For other cases (ncr53c8xx under alpha included), the drivers may have
to reap completions from its timer (ncr_timeout) handler.
For the history, the original FreeBSD ncr.c still run such an handler
and I donnot know of any other driver reaping interrupts this way.:)

By the way, I cannot beleive some other drivers I know a bit to be really
100% sure of not losing completions with some bridges I read about.

The patch should apply to everything as ncr53c8xx-3.2* + sym53c8xx-1.3*
up to latest.

I am in vacation for the first half of August. Will refine the change
as necessary after my vacation.

I cannot test the patch since I only have x86 boxes, assumed ok.
You may want to let me know asap if the patch makes problems.

Here it is:

--- linux/drivers/scsi/sym53c8xx_defs.h.1.3g Sun Jul 25 18:37:08 1999
+++ linux/drivers/scsi/sym53c8xx_defs.h Sun Jul 25 18:39:33 1999
@@ -268,7 +268,11 @@
#define SCSI_NCR_CMD_PER_LUN (SCSI_NCR_MAX_TAGS)
#define SCSI_NCR_SG_TABLESIZE (SCSI_NCR_MAX_SCATTER)

+#ifdef SCSI_NCR_BROKEN_INTR
+#define SCSI_NCR_TIMER_INTERVAL ((HZ+9)/10)
+#else
#define SCSI_NCR_TIMER_INTERVAL (HZ)
+#endif

#if 1 /* defined CONFIG_SCSI_MULTI_LUN */
#define SCSI_NCR_MAX_LUN (16)
--- linux/drivers/scsi/sym53c8xx.h.1.3g Sun Jul 25 18:49:09 1999
+++ linux/drivers/scsi/sym53c8xx.h Sun Jul 25 18:56:07 1999
@@ -57,6 +57,14 @@
#ifndef SYM53C8XX_H
#define SYM53C8XX_H

+/*
+** We may have to reap completions on some architectures because
+** of the host-pci bridge not following PCI ordering rules.
+*/
+#if !defined(__i386__) && !defined(__powerpc__) && !defined(__alpha__)
+#define SCSI_NCR_BROKEN_INTR
+#endif
+
#include "sym53c8xx_defs.h"

/*
--- linux/drivers/scsi/sym53c8xx.c.1.3g Sun Jul 25 18:40:01 1999
+++ linux/drivers/scsi/sym53c8xx.c Sun Jul 25 18:45:59 1999
@@ -7091,6 +7091,9 @@
if (istat & INTF) {
OUTB (nc_istat, (istat & SIGP) | INTF);
if (DEBUG_FLAGS & DEBUG_TINY) printk ("F ");
+#ifdef __alpha__
+ istat = INB (nc_istat);/* Dummy read to flush the write if PW */
+#endif
(void)ncr_wakeup_done (np);
#ifdef SCSI_NCR_PROFILE_SUPPORT
++np->profile.num_fly;
--- linux/drivers/scsi/ncr53c8xx.h.1.3g Sun Jul 25 18:55:09 1999
+++ linux/drivers/scsi/ncr53c8xx.h Sun Jul 25 18:57:24 1999
@@ -42,6 +42,14 @@
#ifndef NCR53C8XX_H
#define NCR53C8XX_H

+/*
+** We may have to reap completions on some architectures because
+** of the host-pci bridge not following PCI ordering rules.
+*/
+#if !defined(__i386__) && !defined(__powerpc__)
+#define SCSI_NCR_BROKEN_INTR
+#endif
+
#include "sym53c8xx_defs.h"

/*
-------------------------- CUT HERE -----------------------

Gérard.

-
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/