[parisc-linux-cvs] Re: DIFF 2.4.18-pa28

Grant Grundler grundler@dsl2.external.hp.com
Tue, 28 May 2002 00:24:24 -0600


Grant Grundler wrote:
> 2.4.18-pa28
> minor cleanups of -pa27 based on feedback from Helge Deller.
> o remove unneeded CONFIG_SMP around smp_call_function in irq.c
> o use "static" flag instead of global external for FDC/SYNC test in sba

The "why" part of these two changes:
o Besides removing the CONFIG_SMP, also re ordered set_eiem() to
  make sure there is no local side-effect that might prevent the
  updates from happening on other CPUs.

o helge thought using a static would allow code to be pulled
  out of the outside loop. That didn't seem to happen though the resulting
  code uses one less instruction. Maybe a future compiler or hppa linker
  will be smart enough to make this optimization. The asm() statements
  might make this too complicated for the compiler.

grant

Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.298
diff -u -p -r1.298 Makefile
--- Makefile	2002/05/27 22:15:53	1.298
+++ Makefile	2002/05/28 05:37:16
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 18
-EXTRAVERSION = -pa27
+EXTRAVERSION = -pa28
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: arch/parisc/kernel/irq.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/irq.c,v
retrieving revision 1.55
diff -u -p -r1.55 irq.c
--- arch/parisc/kernel/irq.c	2002/05/27 22:15:53	1.55
+++ arch/parisc/kernel/irq.c	2002/05/28 05:37:16
@@ -74,9 +74,7 @@ static inline void disable_cpu_irq(void 
 
 	cpu_eiem &= ~eirr_bit;
 	set_eiem(cpu_eiem);
-#ifdef CONFIG_SMP
         smp_call_function(cpu_set_eiem, (void *) cpu_eiem, 1, 1);
-#endif
 }
 
 static void enable_cpu_irq(void *unused, int irq)
@@ -85,10 +83,8 @@ static void enable_cpu_irq(void *unused,
 
 	mtctl(eirr_bit, 23);	/* clear EIRR bit before unmasking */
 	cpu_eiem |= eirr_bit;
-	set_eiem(cpu_eiem);
-#ifdef CONFIG_SMP
         smp_call_function(cpu_set_eiem, (void *) cpu_eiem, 1, 1);
-#endif
+	set_eiem(cpu_eiem);
 }
 
 /* mask and disable are the same at the CPU level
@@ -100,14 +96,12 @@ static inline void unmask_cpu_irq(void *
 {
 	unsigned long eirr_bit = EIEM_MASK(irq);
 	cpu_eiem |= eirr_bit;
-	set_eiem(cpu_eiem);
-#ifdef CONFIG_SMP
 	/* NOTE: sending an IPI will cause do_cpu_irq_mask() to
 	** handle *any* unmasked pending interrupts.
 	** ie We don't need to check for pending interrupts here.
 	*/
         smp_call_function(cpu_set_eiem, (void *) cpu_eiem, 1, 1);
-#endif
+	set_eiem(cpu_eiem);
 }
 
 static struct irqaction cpu_irq_actions[IRQ_PER_REGION] = {
Index: arch/parisc/kernel/sba_iommu.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/sba_iommu.c,v
retrieving revision 1.68
diff -u -p -r1.68 sba_iommu.c
--- arch/parisc/kernel/sba_iommu.c	2002/05/27 22:15:53	1.68
+++ arch/parisc/kernel/sba_iommu.c	2002/05/28 05:37:17
@@ -255,6 +255,8 @@ struct sba_device {
 
 static struct sba_device *sba_list;
 
+static unsigned long ioc_needs_fdc = 0;
+
 /* Ratio of Host MEM to IOV Space size */
 static unsigned long sba_mem_ratio = 8;
 
@@ -718,7 +720,7 @@ sba_io_pdir_entry(u64 *pdir_ptr, space_t
 	 * (bit #61, big endian), we have to flush and sync every time
 	 * IO-PDIR is changed in Ike/Astro.
 	 */
-	if (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC) {
+	if (ioc_needs_fdc) {
 		asm volatile("fdc 0(%%sr1,%0)\n\tsync" : : "r" (pdir_ptr));
 	}
 }
@@ -1805,6 +1807,7 @@ sba_common_init(struct sba_device *sba_d
 	}
 
 	sba_dev->sba_lock = SPIN_LOCK_UNLOCKED;
+	ioc_needs_fdc = boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC;
 
 #ifdef DEBUG_SBA_INIT
 	/*