Skip to contentSkip to conversation

sym2 patchset

PATCH New Matthew Wilcox 1 participant 1 message Aug 30, 2003 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sym2 patchset

A big pile of sym2-related changes. I have most of them split apart in CVS, so I can submit them as individual patches if anyone's interested.

Changelog:
- Use pci_set_mwi() instead of trying to do it ourselves.
- Rename PCI_ID_LSI53C1010 to 1010_33 and PCI_ID_LSI53C1010_2 to 1010_66.
- Turn sym_udelay and sym_mdelay into macros.
- Move the definition of sym53c8xx_lock near the functions that call it and remove the macros that wrapper it.
- SYM_LINUX_DYNAMIC_DMA_MAPPING is always defined. (Christoph Hellwig)
- Remove first_host (Christoph Hellwig)
- Support for hp C3000 (Grant Grundler)
- Switch to using pci_name()
- Remove the #if 0'd code from the pci_driver conversion.
- Remove the sym_chip typedef.
- Remove the pcifix option.
- Remove a redundant printk on driver initialisation.
- Use rmb() for __READ_BARRIER and wmb() for __WRITE_BARRIER
- Increment the version to 2.1.17a.

Index: drivers/scsi/sym53c8xx_2/sym_conf.h
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_conf.h,v retrieving revision 1.1
retrieving revision 1.2

scsi/sym53c8xx_2/sym_conf.h +0 -5
diff -u -p -r1.1 -r1.2
@@ -131,11 +131,6 @@
 /* #define SYM_CONF_IARB_SUPPORT */
 
 /*
- *  Support for some PCI fix-ups (or assumed so).
- */
-#define SYM_CONF_PCI_FIX_UP
-
-/*
  *  Number of lists for the optimization of the IO timeout handling.
  *  Not used under FreeBSD and Linux.
  */

Index: drivers/scsi/sym53c8xx_2/sym_defs.h
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_defs.h,v retrieving revision 1.1
retrieving revision 1.2

scsi/sym53c8xx_2/sym_defs.h +2 -2
diff -u -p -r1.1 -r1.2
@@ -74,8 +74,8 @@
 #define PCI_ID_SYM53C896	0xb
 #define PCI_ID_SYM53C895A	0x12
 #define PCI_ID_SYM53C875A	0x13
-#define PCI_ID_LSI53C1010	0x20
-#define PCI_ID_LSI53C1010_2	0x21
+#define PCI_ID_LSI53C1010_33	0x20
+#define PCI_ID_LSI53C1010_66	0x21
 #define PCI_ID_LSI53C1510D	0xa
 
 /*

Index: drivers/scsi/sym53c8xx_2/sym_fw.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_fw.c,v retrieving revision 1.1
retrieving revision 1.2

scsi/sym53c8xx_2/sym_fw.c +2 -2
diff -u -p -r1.1 -r1.2
@@ -270,13 +270,13 @@ sym_fw2_patch(hcb_p np)
 	 *  Remove a couple of work-arounds specific to C1010 if 
 	 *  they are not desirable. See `sym_fw2.h' for more details.
 	 */
-	if (!(np->device_id == PCI_ID_LSI53C1010_2 &&
+	if (!(np->device_id == PCI_ID_LSI53C1010_66 &&
 	      np->revision_id < 0x1 &&
 	      np->pciclk_khz < 60000)) {
 		scripta0->datao_phase[0] = cpu_to_scr(SCR_NO_OP);
 		scripta0->datao_phase[1] = cpu_to_scr(0);
 	}
-	if (!(np->device_id == PCI_ID_LSI53C1010 &&
+	if (!(np->device_id == PCI_ID_LSI53C1010_33 &&
 	      /* np->revision_id < 0xff */ 1)) {
 		scripta0->sel_done[0] = cpu_to_scr(SCR_NO_OP);
 		scripta0->sel_done[1] = cpu_to_scr(0);

Index: drivers/scsi/sym53c8xx_2/sym_glue.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_glue.c,v retrieving revision 1.3
retrieving revision 1.9

scsi/sym53c8xx_2/sym_glue.c +34 -404

686 lines not on this page · raw message

Index: drivers/scsi/sym53c8xx_2/sym_glue.h
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_glue.h,v retrieving revision 1.3
retrieving revision 1.6

scsi/sym53c8xx_2/sym_glue.h +3 -31
diff -u -p -r1.3 -r1.6
@@ -111,8 +111,6 @@ typedef	u_long	vm_offset_t;
 /*
  * Configuration addendum for Linux.
  */
-#define	SYM_LINUX_DYNAMIC_DMA_MAPPING
-
 #define	SYM_CONF_TIMER_INTERVAL		((HZ+1)/2)
 
 #define SYM_OPT_HANDLE_DIR_UNKNOWN
@@ -121,10 +119,7 @@ typedef	u_long	vm_offset_t;
 #define SYM_OPT_SNIFF_INQUIRY
 #define SYM_OPT_LIMIT_COMMAND_REORDERING
 #define	SYM_OPT_ANNOUNCE_TRANSFER_RATE
-
-#ifdef	SYM_LINUX_DYNAMIC_DMA_MAPPING
 #define	SYM_OPT_BUS_DMA_ABSTRACTION
-#endif
 
 /*
  *  Print a message with severity.
@@ -142,8 +137,8 @@ typedef	u_long	vm_offset_t;
 /*
  *  Insert a delay in micro-seconds and milli-seconds.
  */
-void sym_udelay(int us);
-void sym_mdelay(int ms);
+#define sym_udelay(us)	udelay(us)
+#define sym_mdelay(ms)	mdelay(ms)
 
 /*
  *  Let the compiler know about driver data structure names.
@@ -426,9 +421,6 @@ struct sym_shcb {
 
 	struct Scsi_Host *host;
 
-	u_char		bus;		/* PCI BUS number		*/
-	u_char		device_fn;	/* PCI BUS device and function	*/
-
 	vm_offset_t	mmio_va;	/* MMIO kernel virtual address	*/
 	vm_offset_t	ram_va;		/* RAM  kernel virtual address	*/
 	u_long		io_port;	/* IO port address cookie	*/
@@ -455,8 +447,6 @@ struct sym_shcb {
  *  used as sub-field 's' of another structure.
  */
 typedef struct {
-	int	bus;
-	u_char	device_fn;
 	u_long	base;
 	u_long	base_2;
 	u_long	base_c;
@@ -469,12 +459,11 @@ typedef struct {
 } sym_slot;
 
 typedef struct sym_nvram sym_nvram;
-typedef struct sym_pci_chip sym_chip;
 
 typedef struct {
 	struct pci_dev *pdev;
 	sym_slot  s;
-	sym_chip  chip;
+	struct sym_pci_chip chip;
 	sym_nvram *nvram;
 	u_short device_id;
 	u_char host_id;
@@ -496,9 +485,7 @@ typedef u_long m_addr_t;	/* Enough bits 
 #ifdef	MODULE
 #define SYM_MEM_FREE_UNUSED	/* Free unused pages immediately */
 #endif
-#ifdef	SYM_LINUX_DYNAMIC_DMA_MAPPING
 typedef struct pci_dev *m_pool_ident_t;
-#endif
 
 /*
  *  Include driver soft definitions.
@@ -521,19 +508,7 @@ typedef struct pci_dev *m_pool_ident_t;
 void *sym_calloc(int size, char *name);
 void sym_mfree(void *m, int size, char *name);
 
-#ifndef	SYM_LINUX_DYNAMIC_DMA_MAPPING
 /*
- *  Simple case.
- *  All the memory assummed DMAable and O/S providing virtual 
- *  to bus physical address translation.
- */
-#define __sym_calloc_dma(pool_id, size, name)	sym_calloc(size, name)
-#define __sym_mfree_dma(pool_id, m, size, name)	sym_mfree(m, size, name)
-#define __vtobus(b, p)				virt_to_bus(p)
-
-#else	/* SYM_LINUX_DYNAMIC_DMA_MAPPING */
-/*
- *  Complex case.
  *  We have to provide the driver memory allocator with methods for 
  *  it to maintain virtual to bus physical address translations.
  */
@@ -560,14 +535,11 @@ static __inline void sym_m_free_dma_mem_
 }
 
 #define sym_m_create_dma_mem_tag(mp)	(0)
-
 #define sym_m_delete_dma_mem_tag(mp)	do { ; } while (0)
 
 void *__sym_calloc_dma(m_pool_ident_t dev_dmat, int size, char *name);
 void __sym_mfree_dma(m_pool_ident_t dev_dmat, void *m, int size, char *name);
 m_addr_t __vtobus(m_pool_ident_t dev_dmat, void *m);
-
-#endif	/* SYM_LINUX_DYNAMIC_DMA_MAPPING */
 
 /*
  *  Set the status field of a CAM CCB.

Index: drivers/scsi/sym53c8xx_2/sym_hipd.c
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_hipd.c,v retrieving revision 1.5
retrieving revision 1.8

scsi/sym53c8xx_2/sym_hipd.c +39 -8

103 lines not on this page · raw message

Index: drivers/scsi/sym53c8xx_2/sym_misc.h
===================================================================
RCS file: /var/cvs/linux-2.6/drivers/scsi/sym53c8xx_2/sym_misc.h,v retrieving revision 1.1
retrieving revision 1.2

scsi/sym53c8xx_2/sym_misc.h +2 -17
diff -u -p -r1.1 -r1.2
@@ -77,23 +77,8 @@
  *  should be enough).
  */
 
-#if	defined	__i386__
-#define __READ_BARRIER()	\
-		__asm__ volatile("lock; addl $0,0(%%esp)": : :"memory")
-#define __WRITE_BARRIER()	__asm__ volatile ("": : :"memory")
-#elif	defined	__powerpc__
-#define __READ_BARRIER()	__asm__ volatile("eieio; sync" : : : "memory")
-#define __WRITE_BARRIER()	__asm__ volatile("eieio; sync" : : : "memory")
-#elif	defined	__ia64__
-#define __READ_BARRIER()	__asm__ volatile("mf.a; mf" : : : "memory")
-#define __WRITE_BARRIER()	__asm__ volatile("mf.a; mf" : : : "memory")
-#elif	defined	__alpha__
-#define __READ_BARRIER()	__asm__ volatile("mb": : :"memory")
-#define __WRITE_BARRIER()	__asm__ volatile("mb": : :"memory")
-#else
-#define __READ_BARRIER()	mb()
-#define __WRITE_BARRIER()	mb()
-#endif
+#define __READ_BARRIER()	rmb()
+#define __WRITE_BARRIER()	wmb()
 
 #ifndef MEMORY_READ_BARRIER
 #define MEMORY_READ_BARRIER()	__READ_BARRIER()
Signature · 3 lines
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk