Skip to contentSkip to conversation

SCSI patches

parisc-linux Matthew Wilcox 3 participants 5 messages Nov 1, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

In the continuing mission to send our patches upstream... here's the sum total of our SCSI patches. As you can see there's not _much_ compared to what we used to have ... but some of it looks a little fishy (did MIPS really add support for PA-RISC? ;-)

Anyway, I don't feel confident sending this upstream myself -- I don't understand most of the changes, and wouldn't feel happy defending them. Can I have a volunteer who does grok these scsi changes to send them upstream?

drivers/scsi/Kconfig +17 -7
diff -urpNX build-tools/dontdiff linus-2.5/drivers/scsi/Kconfig parisc-2.5/drivers/scsi/Kconfig
@@ -993,6 +993,16 @@ config SCSI_SYM53C8XX_2
 	  Please read <file:drivers/scsi/sym53c8xx_2/Documentation.txt> for more
 	  information.
 
+config SCSI_ZALON
+	tristate "Zalon SCSI support"
+	depends on GSC && SCSI && SCSI_SYM53C8XX_2!=y
+	help
+	  The Zalon is a GSC/HSC bus interface chip that sits between the
+	  PA-RISC processor and the NCR 53c720 SCSI controller on C100,
+	  C110, J200, J210 and some D, K & R-class machines.  It's also
+	  used on the add-in Bluefish, Barracuda & Shrike SCSI cards.
+	  Say Y here if you have one of these machines or cards.
+
 config SCSI_SYM53C8XX_DMA_ADDRESSING_MODE
 	int "DMA addressing mode"
 	depends on SCSI_SYM53C8XX_2
@@ -1097,7 +1107,7 @@ config SCSI_SYM53C8XX
 
 config SCSI_NCR53C8XX_DEFAULT_TAGS
 	int "default tagged command queue depth"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX)
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
 	default "8"
 	---help---
 	  "Tagged command queuing" is a feature of SCSI-2 which improves
@@ -1123,7 +1133,7 @@ config SCSI_NCR53C8XX_DEFAULT_TAGS
 
 config SCSI_NCR53C8XX_MAX_TAGS
 	int "maximum number of queued commands"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX)
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
 	default "32"
 	---help---
 	  This option allows you to specify the maximum number of commands
@@ -1140,7 +1150,7 @@ config SCSI_NCR53C8XX_MAX_TAGS
 
 config SCSI_NCR53C8XX_SYNC
 	int "synchronous transfers frequency in MHz"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX)
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
 	default "20"
 	---help---
 	  The SCSI Parallel Interface-2 Standard defines 5 classes of transfer
@@ -1174,7 +1184,7 @@ config SCSI_NCR53C8XX_SYNC
 
 config SCSI_NCR53C8XX_PROFILE
 	bool "enable profiling"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX)
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON)
 	help
 	  This option allows you to enable profiling information gathering.
 	  These statistics are not very accurate due to the low frequency
@@ -1185,7 +1195,7 @@ config SCSI_NCR53C8XX_PROFILE
 
 config SCSI_NCR53C8XX_IOMAPPED
 	bool "use normal IO"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX)
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX) && !SCSI_ZALON
 	help
 	  If you say Y here, the driver will use normal IO, as opposed to
 	  memory mapped IO. Memory mapped IO has less latency than normal IO
@@ -1210,7 +1220,7 @@ config SCSI_NCR53C8XX_PQS_PDS
 
 config SCSI_NCR53C8XX_NO_DISCONNECT
 	bool "not allow targets to disconnect"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX) && SCSI_NCR53C8XX_DEFAULT_TAGS=0
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON) && SCSI_NCR53C8XX_DEFAULT_TAGS=0
 	help
 	  This option is only provided for safety if you suspect some SCSI
 	  device of yours to not support properly the target-disconnect
@@ -1220,7 +1230,7 @@ config SCSI_NCR53C8XX_NO_DISCONNECT
 
 config SCSI_NCR53C8XX_SYMBIOS_COMPAT
 	bool "assume boards are SYMBIOS compatible (EXPERIMENTAL)"
-	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX) && EXPERIMENTAL
+	depends on PCI && SCSI_SYM53C8XX_2!=y && (SCSI_NCR53C8XX || SCSI_SYM53C8XX || SCSI_ZALON) && EXPERIMENTAL
 	---help---
 	  This option allows you to enable some features depending on GPIO
 	  wiring. These General Purpose Input/Output pins can be used for
drivers/scsi/lasi700.c +0 -1
diff -urpNX build-tools/dontdiff linus-2.5/drivers/scsi/lasi700.c parisc-2.5/drivers/scsi/lasi700.c
@@ -51,7 +51,6 @@
 #include <asm/irq.h>
 #include <asm/hardware.h>
 #include <asm/delay.h>
-#include <asm/gsc.h>
 
 #include <linux/module.h>
 
drivers/scsi/sym53c8xx.c +33 -2
diff -urpNX build-tools/dontdiff linus-2.5/drivers/scsi/sym53c8xx.c parisc-2.5/drivers/scsi/sym53c8xx.c
@@ -4901,6 +4901,11 @@ static int __init ncr_prepare_setting(nc
 	u_long	period;
 	int i;
 
+#ifdef CONFIG_PARISC
+	char scsi_mode = -1;
+	struct hardware_path hwpath;
+#endif
+
 	/*
 	**	Wide ?
 	*/
@@ -4972,6 +4977,31 @@ static int __init ncr_prepare_setting(nc
 	 */
 
 	period = (4 * div_10M[0] + np->clock_khz - 1) / np->clock_khz;
+
+#if defined(CONFIG_PARISC)
+	/* Host firmware (PDC) keeps a table for crippling SCSI capabilities.
+	 * Many newer machines export one channel of 53c896 chip
+	 * as SE, 50-pin HD.  Also used for Multi-initiator SCSI clusters
+	 * to set the SCSI Initiator ID.
+	 */
+	get_pci_node_path(np->pdev, &hwpath);
+	if (pdc_get_initiator(&hwpath, &np->myaddr, &period, &np->maxwide, &scsi_mode))
+	{
+		if (np->maxwide) 
+			np->features |= FE_WIDE;
+		if (scsi_mode >= 0) {
+			/* C3000 PDC reports period/mode */
+			driver_setup.diff_support = 0;
+			switch(scsi_mode) {
+			case 0:	np->scsi_mode = SMODE_SE; break;
+			case 1:	np->scsi_mode = SMODE_HVD; break;
+			case 2:	np->scsi_mode = SMODE_LVD; break;
+			default:	break;
+			}
+		}
+	}
+#endif
+
 	if	(period <= 250)		np->minsync = 10;
 	else if	(period <= 303)		np->minsync = 11;
 	else if	(period <= 500)		np->minsync = 12;
@@ -12958,6 +12988,7 @@ if (sym53c8xx)
 		}
 		if (i != count)	/* Ignore this device if we already have it */
 			continue;
+		pci_set_master(pcidev);
 		devp = &devtbl[count];
 		devp->host_id = driver_setup.host_id;
 		devp->attach_done = 0;
@@ -13201,9 +13232,9 @@ sym53c8xx_pci_init(Scsi_Host_Template *t
 		return -1;
 	}
 
-#ifdef __powerpc__
+#if defined(__powerpc__) || defined(__hppa__)
 	/*
-	**	Fix-up for power/pc.
+	**	Fix-up for power/pc and hppa.
 	**	Should not be performed by the driver.
 	*/
 	if ((command & (PCI_COMMAND_IO | PCI_COMMAND_MEMORY))
drivers/scsi/sym53c8xx_2/sym_glue.c +1 -1
diff -urpNX build-tools/dontdiff linus-2.5/drivers/scsi/sym53c8xx_2/sym_glue.c parisc-2.5/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -1876,7 +1876,7 @@ static int sym_setup_bus_dma_mask(hcb_p 
 					sym_name(np));
 		}
 		else {
-			if (!pci_set_dma_mask(np->s.device, 0xffffffffUL))
+			if (pci_set_dma_mask(np->s.device, 0xffffffffUL))
 				goto out_err32;
 		}
 	}
drivers/scsi/sym53c8xx_2/sym_malloc.c +5 -2
diff -urpNX build-tools/dontdiff linus-2.5/drivers/scsi/sym53c8xx_2/sym_malloc.c parisc-2.5/drivers/scsi/sym53c8xx_2/sym_malloc.c
@@ -143,12 +143,15 @@ static void ___sym_mfree(m_pool_p mp, vo
 	a = (m_addr_t) ptr;
 
 	while (1) {
-#ifdef SYM_MEM_FREE_UNUSED
 		if (s == SYM_MEM_CLUSTER_SIZE) {
+#ifdef SYM_MEM_FREE_UNUSED
 			M_FREE_MEM_CLUSTER(a);
+#else
+			((m_link_p) a)->next = h[i].next;
+			h[i].next = (m_link_p) a;
+#endif
 			break;
 		}
-#endif
 		b = a ^ s;
 		q = &h[i];
 		while (q->next && q->next != (m_link_p) b) {
drivers/scsi/sym53c8xx_defs.h +64 -8

179 lines not on this page · raw message

Signature · 1 line
Revolutions do not require corporate support.
#1 lore raw
Quoted 4 lines · Matthew Wilcox

In the continuing mission to send our patches upstream... here's the sum total of our SCSI patches. As you can see there's not _much_ compared to what we used to have ... but some of it looks a little fishy (did MIPS really add support for PA-RISC? ;-)

heh - that's obviously oversight.

Quoted 4 lines

Anyway, I don't feel confident sending this upstream myself -- I don't understand most of the changes, and wouldn't feel happy defending them. Can I have a volunteer who does grok these scsi changes to send them upstream?

I can. Half of the changes are mine. I don't entirely grok ZALON related changes but I trust whoever made them (Richard?) can clarify if needed.

Please let me know who I should send them to and when.

grant

#2 lore raw
Quoted 2 lines · Grant Grundler
Quoted 1 line · Matthew Wilcox

MIPS really add support for PA-RISC? ;-)

Guess that's my screwup.

Quoted 9 lines
Quoted 4 lines

Anyway, I don't feel confident sending this upstream myself -- I don't understand most of the changes, and wouldn't feel happy defending them. Can I have a volunteer who does grok these scsi changes to send them upstream?

I can. Half of the changes are mine. I don't entirely grok ZALON related changes but I trust whoever made them (Richard?) can clarify if needed.

Please let me know who I should send them to and when.

I presume that with the exception of the #include removal from lasi700.c this lot should go to Gérard Roudier <[email protected]>. So far as the zalon bits are concerned, I first sent them to him in August 2000, and exchanged a few mails, and then chased on and off until Feb 2001. Looks like I ran out of patience after that. Anyway, from Feb 2001:

Quoted 1 line · Richard

No news on my 53c720 patch, I suppose?

Quoted 7 lines · Gérard

Your NCR720 patch is not dead, but I apologize to you for the huge retard. Anyway, if|when sym-2 driver will be accepted, I will not kill ncr53c8xx immediately.
...
The NCR720 patch is too large for ncr-3.4.3, but will fit some further ncr-3.4.x (x >3). ncr53c8xx can coexist with either sym-1 and sym-2. Btw, one can build a kernel that link sym-2 + ncr.

So I take that to mean he was happy with the code.

NOTE though, that not all the zalon changes are in the diff willy posted; it doesn't include ncr53c8xx.c changes, at least.

Richard

#3 lore raw
Quoted 2 lines · Richard Hirst

NOTE though, that not all the zalon changes are in the diff willy posted; it doesn't include ncr53c8xx.c changes, at least.

Yeah, I noticed that after I posted it .. hence my recent commit that brings those changes forward from 2.4. I'm not sure I got everything right, so please check it over. I don't have access to a Zalon card right now.

Signature · 1 line
Revolutions do not require corporate support.
#4 lore raw
Quoted 8 lines · Matthew Wilcox
Quoted 2 lines · Richard Hirst

NOTE though, that not all the zalon changes are in the diff willy posted; it doesn't include ncr53c8xx.c changes, at least.

Yeah, I noticed that after I posted it .. hence my recent commit that brings those changes forward from 2.4. I'm not sure I got everything right, so please check it over. I don't have access to a Zalon card right now.

Me neither, given the current state of my house ;( Things are set to improve over the next couple of weeks though.

Richard