Skip to contentSkip to conversation

kernel update [relative to 2.4.0-test4]

Linux-ia64 David Mosberger 3 participants 3 messages Jul 29, 2000 – Jul 31, 2000

Subsystems (8)
Network drivers VFS SCSI Kbuild +4 more subsystems
lore
Share & tools
lore
#0 lore raw

Here is the latest kernel update. Before I go on, two major caveats:

BIG CAVEAT
To run this kernel on a system with a SCSI controller that uses the PCI DMA interface (e.g, adaptec), you'll have to specific boot option mem=4G to force the kernel to ignore memory above 4GB. This is a temporary issue and will be fixed in the next version.

BIG CAVEAT
This kernel will work fine with the qla1280 SCSI driver, even if there is memory above 4GB. However, you must make sure that "64 bit addressing" is enabled in the Qlogic BIOS setup (press "Alt-Q" during system initialization to get into the SCSI controller configuration menu). If your system is unable to mount the root filesystem, chances are you forgot to do this.

OK, having said that, here are the major goodies:

- Support for software I/O TLB is in, thanks to Goutham and Asit (Intel). This support allows to DMA from 32-bit PCI devices to any place in the physical memory. However, the transfer size is currently limited to one page and this is the reason SCSI drivers such as the adaptec drivers do not work yet.

- Bumped HZ to 1024. Yeah, I still owe you guys some performance measurements, but it's the right thing to do anyhow, trust me. ;-)

- Thanks to Stephane, /proc/palinfo now sports SMP support and has been renamed to /proc/pal. There are also a couple of new entries, such as bus_info and tr_info.

- GENERIC build fixes from Kanoj and yours truly. Generic kernels should build again.

- IA-32 fixes from Don and Kanoj.

- New kernel option "mem=MEMLIMIT" to tell the kernel to ignore memory above MEMLIMIT. Note that this option does not set the memory _size_ (as is the case on x86), it sets the _limit_ (which was easier to implement---render me lazy). You can use "G", "M" or "K" to express the memory limit as giga-, mega-, or kilobytes (i.e., mem=4G ignore memory above 4gig).

- Fixed a silly typo in the ITLB handler (thanks to Asit for catching this!). It didn't really hurt much as that handler gets almost never used.

- Removed backwards compatibility for the old system call break number (0x80000). Shame on you if you're still using binaries with that very old number (none of the IA-64 Linux distributions ever did this).

- Support for making physical stacked PAL calls is in (also by Stephane).

- psr.mfh bit is now maintained more accurately, which avoids a potential problem on SMP and also should give better performance in certain cases. Dan, if you want to use the fp-based memcpy routine for libc, you could now check if psr.mfh is on and, if so, you know the fph partition is in use alrady

- Disabled the "lost timer tick" message; that message always was misleading, as no ticks are actually lost; with the newer steppings of the CPU, the whole issue of lost timer interrupts is pretty much gone anyhow.

- Some SN1 updated (Kanoj)

- eepro100 updats to make it _really_ work with the PCI DMA api (Ganesh).

- Stephane Zeisset's fix for fs/buffer.c to avoid data corruption when copying to vfat filesystem (this is already in Linus's test5)

- Added missing __raw_writel (pointed out by Bill, IIRC)

That should be it. As usual, the relative diff below shows what changed since the last IA-64 kernel update and is for informational purposes only. The full kernel diff is in linux-2.4.0-test4-ia64-000728.diff.gz at:

	ftp://ftp.kernel.org/pub/linux/kernel/ports/ia64/

Enjoy,

	--david

diff -urN linux-davidm/Documentation/DMA-mapping.txt linux-2.4.0-test4-lia/Documentation/DMA-mapping.txt --- linux-davidm/Documentation/DMA-mapping.txt Tue Apr 25 17:52:05 2000 +++ linux-2.4.0-test4-lia/Documentation/DMA-mapping.txt Fri Jul 28 22:51:03 2000 @@ -341,7 +341,7 @@ struct my_card_header *hp;

/* Examine the header to see if we wish
- * to except the data. But synchronize
+ * to accept the data. But synchronize
* the DMA transfer with the CPU first
* so that we see updated contents. */

Makefile +0 -1
diff -urN linux-davidm/Makefile linux-2.4.0-test4-lia/Makefile
@@ -365,7 +365,6 @@
 clean:	archclean
 	rm -f kernel/ksyms.lst include/linux/compile.h
 	find . -name '*.[oas]' -type f -print | grep -v lxdialog/ | xargs rm -f
-	rm -f ksym.[ch] dummy_sym.c System.map.sv map map.out
 	rm -f core `find . -type f -name 'core' -print`
 	rm -f core `find . -type f -name '.*.flags' -print`
 	rm -f vmlinux System.map
arch/ia64/config.in +2 -4
diff -urN linux-davidm/arch/ia64/config.in linux-2.4.0-test4-lia/arch/ia64/config.in
@@ -18,6 +18,7 @@
 comment 'General setup'
 
 define_bool CONFIG_IA64 y
+define_bool CONFIG_SWIOTLB y	# for now...
 
 define_bool CONFIG_ISA n
 define_bool CONFIG_SBUS n
@@ -39,15 +40,12 @@
 	define_bool CONFIG_IA64_BRL_EMU y
 	bool '  Enable Itanium A-step specific code' CONFIG_ITANIUM_ASTEP_SPECIFIC
 	bool '  Enable Itanium A1-step specific code' CONFIG_ITANIUM_A1_SPECIFIC
+	bool '  Enable Itanium B0-step specific code' CONFIG_ITANIUM_B0_SPECIFIC
 	bool '  Enable use of global TLB purge instruction (ptc.g)' CONFIG_ITANIUM_PTCG
 	bool '  Enable SoftSDV hacks' CONFIG_IA64_SOFTSDV_HACKS
 	bool '  Enable AzusA hacks' CONFIG_IA64_AZUSA_HACKS
 	bool '  Emulate PAL/SAL/EFI firmware' CONFIG_IA64_FW_EMU
 	bool '  Enable IA64 Machine Check Abort' CONFIG_IA64_MCA
-fi
-
-if [ "$CONFIG_IA64_GENERIC" = "y" ]; then
-	define_bool CONFIG_IA64_SOFTSDV_HACKS y
 fi
 
 if [ "$CONFIG_IA64_SGI_SN1_SIM" = "y" ]; then
arch/ia64/dig/iosapic.c +47 -10

88 lines not on this page · raw message

arch/ia64/dig/machvec.c +1 -3
diff -urN linux-davidm/arch/ia64/dig/machvec.c linux-2.4.0-test4-lia/arch/ia64/dig/machvec.c
@@ -1,4 +1,2 @@
+#define MACHVEC_PLATFORM_NAME	dig
 #include <asm/machvec_init.h>
-#include <asm/machvec_dig.h>
-
-MACHVEC_DEFINE(dig)
arch/ia64/hp/hpsim_machvec.c +1 -3
diff -urN linux-davidm/arch/ia64/hp/hpsim_machvec.c linux-2.4.0-test4-lia/arch/ia64/hp/hpsim_machvec.c
@@ -1,4 +1,2 @@
+#define MACHVEC_PLATFORM_NAME	hpsim
 #include <asm/machvec_init.h>
-#include <asm/machvec_hpsim.h>
-
-MACHVEC_DEFINE(hpsim)
arch/ia64/ia32/ia32_entry.S +28 -28

134 lines not on this page · raw message

arch/ia64/ia32/sys_ia32.c +192 -229

523 lines not on this page · raw message

arch/ia64/kernel/Makefile +2 -2
diff -urN linux-davidm/arch/ia64/kernel/Makefile linux-2.4.0-test4-lia/arch/ia64/kernel/Makefile
@@ -9,8 +9,8 @@
 
 all: kernel.o head.o init_task.o
 
-obj-y := acpi.o entry.o gate.o efi.o efi_stub.o irq.o irq_ia64.o irq_sapic.o ivt.o	\
-	 pal.o pci-dma.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o		\
+obj-y := acpi.o entry.o gate.o efi.o efi_stub.o irq.o irq_ia64.o irq_sapic.o ivt.o		\
+	 machvec.o pal.o pci-dma.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o	\
 	 signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
 
 obj-$(CONFIG_IA64_GENERIC) += machvec.o
arch/ia64/kernel/acpi.c +3 -43

67 lines not on this page · raw message

arch/ia64/kernel/efi.c +32 -13

87 lines not on this page · raw message

arch/ia64/kernel/entry.S +3 -13
diff -urN linux-davidm/arch/ia64/kernel/entry.S linux-2.4.0-test4-lia/arch/ia64/kernel/entry.S
@@ -106,29 +106,19 @@
 	alloc r16=ar.pfs,1,0,0,0
 	DO_SAVE_SWITCH_STACK
 	UNW(.body)
-	// disable interrupts to ensure atomicity for next few instructions:
-	mov r17=psr		// M-unit
-	;;
-	rsm psr.i		// M-unit
-	dep r18=-1,r0,0,61	// build mask 0x1fffffffffffffff
-	;;
-	srlz.d
-	;;
+
 	adds r22=IA64_TASK_THREAD_KSP_OFFSET,r13
+	dep r18=-1,r0,0,61	// build mask 0x1fffffffffffffff
 	adds r21=IA64_TASK_THREAD_KSP_OFFSET,in0
 	;;
 	st8 [r22]=sp		// save kernel stack pointer of old task
 	ld8 sp=[r21]		// load kernel stack pointer of new task
 	and r20=in0,r18		// physical address of "current"
 	;;
+	mov ar.k6=r20		// copy "current" into ar.k6
 	mov r8=r13		// return pointer to previously running task
 	mov r13=in0		// set "current" pointer
-	mov ar.k6=r20		// copy "current" into ar.k6
-	;;
-	// restore interrupts
-	mov psr.l=r17
 	;;
-	srlz.d
 	DO_LOAD_SWITCH_STACK( )
 	br.ret.sptk.few rp
 END(ia64_switch_to)
arch/ia64/kernel/irq_ia64.c +7 -0
diff -urN linux-davidm/arch/ia64/kernel/irq_ia64.c linux-2.4.0-test4-lia/arch/ia64/kernel/irq_ia64.c
@@ -117,6 +117,13 @@
 	{
 		unsigned long bsp, sp;
 
+		/*
+		 * Note: if the interrupt happened while executing in
+		 * the context switch routine (ia64_switch_to), we may
+		 * get a spurious stack overflow here.  This is
+		 * because the register and the memory stack are not
+		 * switched atomically.
+		 */
 		asm ("mov %0=ar.bsp" : "=r"(bsp));
 		asm ("mov %0=sp" : "=r"(sp));
 
arch/ia64/kernel/ivt.S +31 -34

118 lines not on this page · raw message

arch/ia64/kernel/machvec.c +9 -5
diff -urN linux-davidm/arch/ia64/kernel/machvec.c linux-2.4.0-test4-lia/arch/ia64/kernel/machvec.c
@@ -3,12 +3,9 @@
 #include <asm/page.h>
 #include <asm/machvec.h>
 
-struct ia64_machine_vector ia64_mv;
+#ifdef CONFIG_IA64_GENERIC
 
-void
-machvec_noop (void)
-{
-}
+struct ia64_machine_vector ia64_mv;
 
 /*
  * Most platforms use this routine for mapping page frame addresses
@@ -45,4 +42,11 @@
 	}
 	ia64_mv = *mv;
 	printk("booting generic kernel on platform %s\n", name);
+}
+
+#endif /* CONFIG_IA64_GENERIC */
+
+void
+machvec_noop (void)
+{
 }
arch/ia64/kernel/pal.S +54 -0

57 lines not on this page · raw message

arch/ia64/kernel/palinfo.c +327 -38

453 lines not on this page · raw message

arch/ia64/kernel/pci-dma.c +404 -14

438 lines not on this page · raw message

arch/ia64/kernel/process.c +0 -11
diff -urN linux-davidm/arch/ia64/kernel/process.c linux-2.4.0-test4-lia/arch/ia64/kernel/process.c
@@ -532,17 +532,6 @@
 	}
 }
 
-/*
- * Free remaining state associated with DEAD_TASK.  This is called
- * after the parent of DEAD_TASK has collected the exist status of the
- * task via wait().
- */
-void
-release_thread (struct task_struct *dead_task)
-{
-	/* nothing to do */
-}
-
 unsigned long
 get_wchan (struct task_struct *p)
 {
arch/ia64/kernel/ptrace.c +1 -0
diff -urN linux-davidm/arch/ia64/kernel/ptrace.c linux-2.4.0-test4-lia/arch/ia64/kernel/ptrace.c
@@ -549,6 +549,7 @@
 ia64_sync_fph (struct task_struct *child)
 {
 	if (ia64_psr(ia64_task_regs(child))->mfh && ia64_get_fpu_owner() = child) {
+		ia64_psr(ia64_task_regs(child))->mfh = 0;
 		ia64_set_fpu_owner(0);
 		ia64_save_fpu(&child->thread.fph[0]);
 		child->thread.flags |= IA64_THREAD_FPH_VALID;
arch/ia64/kernel/setup.c +16 -10
diff -urN linux-davidm/arch/ia64/kernel/setup.c linux-2.4.0-test4-lia/arch/ia64/kernel/setup.c
@@ -122,6 +122,10 @@
 	 */
 	memcpy(&ia64_boot_param, (void *) ZERO_PAGE_ADDR, sizeof(ia64_boot_param));
 
+	*cmdline_p = __va(ia64_boot_param.command_line);
+	strncpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
+	saved_command_line[COMMAND_LINE_SIZE-1] = '\0';		/* for safety */
+
 	efi_init();
 
 	max_pfn = 0;
@@ -164,27 +168,21 @@
 	/* process SAL system table: */
 	ia64_sal_init(efi.sal_systab);
 
-	*cmdline_p = __va(ia64_boot_param.command_line);
-	strncpy(saved_command_line, *cmdline_p, sizeof(saved_command_line));
-	saved_command_line[COMMAND_LINE_SIZE-1] = '\0';		/* for safety */
-
-	printk("args to kernel: %s\n", *cmdline_p);
-
 #ifdef CONFIG_SMP
 	bootstrap_processor = hard_smp_processor_id();
 	current->processor = bootstrap_processor;
 #endif
 	cpu_init();	/* initialize the bootstrap CPU */
 
+#ifdef CONFIG_IA64_GENERIC
+	machvec_init(acpi_get_sysname());
+#endif
+
 	if (efi.acpi) {
 		/* Parse the ACPI tables */
 		acpi_parse(efi.acpi);
 	}
 
-#ifdef CONFIG_IA64_GENERIC
-	machvec_init(acpi_get_sysname());
-#endif
-
 #ifdef CONFIG_VT
 # if defined(CONFIG_VGA_CONSOLE)
 	conswitchp = &vga_con;
@@ -197,8 +195,16 @@
 	/* enable IA-64 Machine Check Abort Handling */
 	ia64_mca_init();
 #endif
+
 	paging_init();
 	platform_setup(cmdline_p);
+
+#ifdef CONFIG_SWIOTLB
+	{
+		extern void setup_swiotlb (void);
+		setup_swiotlb();
+	}
+#endif
 }
 
 /*
arch/ia64/kernel/smp.c +54 -0

66 lines not on this page · raw message

arch/ia64/kernel/time.c +5 -3
diff -urN linux-davidm/arch/ia64/kernel/time.c linux-2.4.0-test4-lia/arch/ia64/kernel/time.c
@@ -150,11 +150,13 @@
 static void
 timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
-	static unsigned long last_time;
-	static unsigned char count;
 	int cpu = smp_processor_id();
 	unsigned long new_itm;
+#if 0
+	static unsigned long last_time;
+	static unsigned char count;
 	int printed = 0;
+#endif
 
 	/*
 	 * Here we are in the timer irq handler. We have irqs locally
@@ -192,7 +194,7 @@
 		if (time_after(new_itm, ia64_get_itc()))
 			break;
 
-#if !(defined(CONFIG_IA64_SOFTSDV_HACKS) && defined(CONFIG_SMP))
+#if 0
 		/*
 		 * SoftSDV in SMP mode is _slow_, so we do "lose" ticks, 
 		 * but it's really OK...
arch/ia64/kernel/traps.c +7 -0
diff -urN linux-davidm/arch/ia64/kernel/traps.c linux-2.4.0-test4-lia/arch/ia64/kernel/traps.c
@@ -204,11 +204,13 @@
 {
 	struct task_struct *fpu_owner = ia64_get_fpu_owner();
 
+	/* first, clear psr.dfh and psr.mfh: */
 	regs->cr_ipsr &= ~(IA64_PSR_DFH | IA64_PSR_MFH);
 	if (fpu_owner != current) {
 		ia64_set_fpu_owner(current);
 
 		if (fpu_owner && ia64_psr(ia64_task_regs(fpu_owner))->mfh) {
+			ia64_psr(ia64_task_regs(fpu_owner))->mfh = 0;
 			fpu_owner->thread.flags |= IA64_THREAD_FPH_VALID;
 			__ia64_save_fpu(fpu_owner->thread.fph);
 		}
@@ -216,6 +218,11 @@
 			__ia64_load_fpu(current->thread.fph);
 		} else {
 			__ia64_init_fpu();
+			/*
+			 * Set mfh because the state in thread.fph does not match
+			 * the state in the fph partition.
+			 */
+			ia64_psr(regs)->mfh = 1;
 		}
 	}
 }
arch/ia64/mm/init.c +0 -1
diff -urN linux-davidm/arch/ia64/mm/init.c linux-2.4.0-test4-lia/arch/ia64/mm/init.c
@@ -423,5 +423,4 @@
 #ifdef CONFIG_IA32_SUPPORT
 	ia32_gdt_init();
 #endif
-	return;
 }
arch/ia64/sn/sn1/irq.c +4 -10
diff -urN linux-davidm/arch/ia64/sn/sn1/irq.c linux-2.4.0-test4-lia/arch/ia64/sn/sn1/irq.c
@@ -1,9 +1,10 @@
 #include <linux/kernel.h>
+#include <linux/irq.h>
+#include <linux/sched.h>
 
-#include <asm/irq.h>
 #include <asm/ptrace.h>
 
-static int
+static unsigned int
 sn1_startup_irq(unsigned int irq)
 {
         return(0);
@@ -24,23 +25,16 @@
 {
 }
 
-static int
-sn1_handle_irq(unsigned int irq, struct pt_regs *regs)
-{
-       return(0);
-}
-
 struct hw_interrupt_type irq_type_sn1 = {
         "sn1_irq",
         sn1_startup_irq,
         sn1_shutdown_irq,
-        sn1_handle_irq,
         sn1_enable_irq,
         sn1_disable_irq
 };
 
 void
-sn1_irq_init (struct irq_desc desc[NR_IRQS])
+sn1_irq_init (void)
 {
 	int i;
 
arch/ia64/sn/sn1/machvec.c +1 -3
diff -urN linux-davidm/arch/ia64/sn/sn1/machvec.c linux-2.4.0-test4-lia/arch/ia64/sn/sn1/machvec.c
@@ -1,4 +1,2 @@
+#define MACHVEC_PLATFORM_NAME	sn1
 #include <asm/machvec_init.h>
-#include <asm/machvec_sn1.h>
-
-MACHVEC_DEFINE(sn1)
arch/ia64/sn/sn1/setup.c +1 -0
diff -urN linux-davidm/arch/ia64/sn/sn1/setup.c linux-2.4.0-test4-lia/arch/ia64/sn/sn1/setup.c
@@ -13,6 +13,7 @@
 #include <linux/console.h>
 #include <linux/timex.h>
 #include <linux/sched.h>
+#include <linux/ioport.h>
 
 #include <asm/io.h>
 #include <asm/machvec.h>
arch/ia64/vmlinux.lds.S +9 -0
diff -urN linux-davidm/arch/ia64/vmlinux.lds.S linux-2.4.0-test4-lia/arch/ia64/vmlinux.lds.S
@@ -46,6 +46,15 @@
 	{ *(__ex_table) }
   __stop___ex_table = .;
 
+#if defined(CONFIG_IA64_GENERIC)
+  /* Machine Vector */
+  . = ALIGN(16);
+  machvec_start = .;
+  .machvec : AT(ADDR(.machvec) - PAGE_OFFSET)
+	{ *(.machvec) }
+  machvec_end = .;
+#endif
+
   __start___ksymtab = .;	/* Kernel symbol table */
   __ksymtab : AT(ADDR(__ksymtab) - PAGE_OFFSET)
 	{ *(__ksymtab) }
drivers/net/eepro100.c +2 -0
diff -urN linux-davidm/drivers/net/eepro100.c linux-2.4.0-test4-lia/drivers/net/eepro100.c
@@ -23,6 +23,8 @@
 		Convert to new PCI driver interface
 	2000 Mar 24  Dragan Stancevic <[email protected]>
 		Disabled FC and ER, to avoid lockups when when we get FCP interrupts.
+	2000 Jul 17 Goutham Rao <[email protected]>
+		PCI DMA API fixes, adding pci_dma_sync_single calls where neccesary
 */
 
 static const char *version @@ -524,6 +526,7 @@

spinlock_t lock; /* Group with Tx control cache line. */
u32 tx_threshold; /* The value for txdesc.count. */
struct RxFD *last_rxf; /* Last filled RX buffer. */
+ dma_addr_t last_rxf_dma;
unsigned int cur_rx, dirty_rx; /* The next free ring entry */
long last_rx_time; /* Last Rx, in jiffies, to handle Rx hang. */
const char *product_name;
@@ -1219,19 +1222,24 @@
sp->rx_ring_dma[i] pci_map_single(sp->pdev, rxf, PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_FROMDEVICE);
skb_reserve(skb, sizeof(struct RxFD));
- if (last_rxf)
+ if (last_rxf) {
last_rxf->link = cpu_to_le32(sp->rx_ring_dma[i]);
+ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[i-1], sizeof(struct RxFD), PCI_DMA_TODEVICE);
+ }
last_rxf = rxf;
rxf->status = cpu_to_le32(0x00000001); /* '1' is flag value only. */
rxf->link = 0; /* None yet. */
/* This field unused by i82557. */ rxf->rx_buf_addr = 0xffffffff;
rxf->count = cpu_to_le32(PKT_BUF_SZ << 16);
+ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[i], sizeof(struct RxFD), PCI_DMA_TODEVICE);
}
sp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
/* Mark the last entry as end-of-list. */
last_rxf->status = cpu_to_le32(0xC0000002); /* '2' is flag value only. */
+ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[RX_RING_SIZE-1], sizeof(struct RxFD), PCI_DMA_TODEVICE);
sp->last_rxf = last_rxf;
+ sp->last_rxf_dma = sp->rx_ring_dma[RX_RING_SIZE-1];
}

static void speedo_purge_tx(struct net_device *dev)
@@ -1666,6 +1674,7 @@
skb->dev = dev;
skb_reserve(skb, sizeof(struct RxFD)); rxf->rx_buf_addr = 0xffffffff;
+ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[entry], sizeof(struct RxFD), PCI_DMA_TODEVICE);
return rxf;
}

@@ -1678,7 +1687,9 @@
rxf->count = cpu_to_le32(PKT_BUF_SZ << 16); sp->last_rxf->link = cpu_to_le32(rxf_dma); sp->last_rxf->status &= cpu_to_le32(~0xC0000000);
+ pci_dma_sync_single(sp->pdev, sp->last_rxf_dma, sizeof(struct RxFD), PCI_DMA_TODEVICE);
sp->last_rxf = rxf;
+ sp->last_rxf_dma = rxf_dma;
}

static int speedo_refill_rx_buf(struct net_device *dev, int force)
@@ -1744,9 +1755,17 @@
if (speedo_debug > 4)
printk(KERN_DEBUG " In speedo_rx().\n");
/* If we own the next entry, it's a new packet. Send it up. */
- while (sp->rx_ringp[entry] != NULL &&
- (status = le32_to_cpu(sp->rx_ringp[entry]->status)) & RxComplete) {
- int pkt_len = le32_to_cpu(sp->rx_ringp[entry]->count) & 0x3fff;
+ while (sp->rx_ringp[entry] != NULL) {
+ int pkt_len;
+
+ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[entry],
+ sizeof(struct RxFD), PCI_DMA_FROMDEVICE);
+
+ if(!((status = le32_to_cpu(sp->rx_ringp[entry]->status)) & RxComplete)) {
+ break;
+ }
+
+ pkt_len = le32_to_cpu(sp->rx_ringp[entry]->count) & 0x3fff;

if (--rx_work_limit < 0)
break;
@@ -1788,7 +1807,8 @@
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
/* 'skb_put()' points to the start of sk_buff data area. */ pci_dma_sync_single(sp->pdev, sp->rx_ring_dma[entry],
- PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_FROMDEVICE);
+ sizeof(struct RxFD) + pkt_len, PCI_DMA_FROMDEVICE);
+
#if 1 || USE_IP_CSUM
/* Packet is in one chunk -- we can copy + cksum. */ eth_copy_and_sum(skb, sp->rx_skbuff[entry]->tail, pkt_len, 0);
@@ -2171,6 +2191,8 @@
/* Set the link in the setup frame. */
mc_setup_frm->link cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
+
+ pci_dma_sync_single(sp->pdev, mc_blk->frame_dma, mc_blk->len, PCI_DMA_TODEVICE);

wait_for_cmd_done(ioaddr + SCBCmd); clear_suspend(last_cmd);

drivers/scsi/qla1280.c +1 -0
diff -urN linux-davidm/drivers/scsi/qla1280.c linux-2.4.0-test4-lia/drivers/scsi/qla1280.c
@@ -809,6 +809,7 @@
 			index++, &pci_bus, &pci_devfn)) )  {
 #endif
                 /* found a adapter */
+		template->unchecked_isa_dma = 1;
 		host = scsi_register(template, sizeof(scsi_qla_host_t));
 		ha = (scsi_qla_host_t *) host->hostdata;
 		/* Clear our data area */
fs/buffer.c +2 -2
diff -urN linux-davidm/fs/buffer.c linux-2.4.0-test4-lia/fs/buffer.c
@@ -1620,9 +1620,9 @@
 						PAGE_CACHE_SIZE, get_block);
 		if (status)
 			goto out_unmap;
-		kaddr = (char*)page_address(page);
+		kaddr = (char*)page_address(new_page);
 		memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
-		__block_commit_write(inode, new_page, zerofrom, to);
+		__block_commit_write(inode, new_page, zerofrom, PAGE_CACHE_SIZE);
 		kunmap(new_page);
 		UnlockPage(new_page);
 		page_cache_release(new_page);
include/asm-ia64/acpi-ext.h +1 -1
diff -urN linux-davidm/include/asm-ia64/acpi-ext.h linux-2.4.0-test4-lia/include/asm-ia64/acpi-ext.h
@@ -69,7 +69,7 @@
 	u8 eid;
 } acpi_entry_lsapic_t;
 
-typedef struct {
+typedef struct acpi_entry_iosapic {
 	u8 type;
 	u8 length;
 	u16 reserved;
include/asm-ia64/efi.h +1 -0
diff -urN linux-davidm/include/asm-ia64/efi.h linux-2.4.0-test4-lia/include/asm-ia64/efi.h
@@ -226,6 +226,7 @@
 }
 
 extern void efi_init (void);
+extern void efi_map_pal_code (void);
 extern void efi_memmap_walk (efi_freemem_callback_t callback, void *arg);
 extern void efi_gettimeofday (struct timeval *tv);
 extern void efi_enter_virtual_mode (void);	/* switch EFI to virtual mode, if possible */
include/asm-ia64/ia32.h +14 -5
diff -urN linux-davidm/include/asm-ia64/ia32.h linux-2.4.0-test4-lia/include/asm-ia64/ia32.h
@@ -40,7 +40,6 @@
        __kernel_off_t32 l_start;
        __kernel_off_t32 l_len;
        __kernel_pid_t32 l_pid;
-       short __unused;
 };
 
 
@@ -105,11 +104,21 @@
 } sigset32_t;
 
 struct sigaction32 {
-       unsigned int  sa_handler;       /* Really a pointer, but need to deal 
-					  with 32 bits */
+       unsigned int  sa_handler;	/* Really a pointer, but need to deal 
+					     with 32 bits */
        unsigned int sa_flags;
-       unsigned int sa_restorer;       /* Another 32 bit pointer */
-       sigset32_t sa_mask;     /* A 32 bit mask */
+       unsigned int sa_restorer;	/* Another 32 bit pointer */
+       sigset32_t sa_mask;		/* A 32 bit mask */
+};
+
+typedef unsigned int old_sigset32_t;	/* at least 32 bits */
+
+struct old_sigaction32 {
+       unsigned int  sa_handler;	/* Really a pointer, but need to deal 
+					     with 32 bits */
+       old_sigset32_t sa_mask;		/* A 32 bit mask */
+       unsigned int sa_flags;
+       unsigned int sa_restorer;	/* Another 32 bit pointer */
 };
 
 typedef struct sigaltstack_ia32 {
include/asm-ia64/io.h +5 -0
diff -urN linux-davidm/include/asm-ia64/io.h linux-2.4.0-test4-lia/include/asm-ia64/io.h
@@ -47,6 +47,10 @@
 	return (void *) (address + PAGE_OFFSET);
 }
 
+/*
+ * The following two macros are deprecated and scheduled for removal.
+ * Please use the PCI-DMA interface defined in <asm/pci.h> instead.
+ */
 #define bus_to_virt	phys_to_virt
 #define virt_to_bus	virt_to_phys
 
@@ -315,6 +319,7 @@
 #define writeq(v,a)	__writeq((v), (void *) (a))
 #define __raw_writeb	writeb
 #define __raw_writew	writew
+#define __raw_writel	writel
 #define __raw_writeq	writeq
 
 #ifndef inb_p
include/asm-ia64/machvec.h +32 -16

95 lines not on this page · raw message

include/asm-ia64/machvec_dig.h +2 -0
diff -urN linux-davidm/include/asm-ia64/machvec_dig.h linux-2.4.0-test4-lia/include/asm-ia64/machvec_dig.h
@@ -5,6 +5,7 @@
 extern ia64_mv_irq_init_t dig_irq_init;
 extern ia64_mv_pci_fixup_t dig_pci_fixup;
 extern ia64_mv_map_nr_t map_nr_dense;
+extern ia64_mv_register_iosapic_t dig_register_iosapic;
 
 /*
  * This stuff has dual use!
@@ -18,5 +19,6 @@
 #define platform_irq_init	dig_irq_init
 #define platform_pci_fixup	dig_pci_fixup
 #define platform_map_nr		map_nr_dense
+#define platform_register_iosapic dig_register_iosapic
 
 #endif /* _ASM_IA64_MACHVEC_DIG_h */
include/asm-ia64/machvec_hpsim.h +0 -1
diff -urN linux-davidm/include/asm-ia64/machvec_hpsim.h linux-2.4.0-test4-lia/include/asm-ia64/machvec_hpsim.h
@@ -15,7 +15,6 @@
 #define platform_name		"hpsim"
 #define platform_setup		hpsim_setup
 #define platform_irq_init	hpsim_irq_init
-#define platform_pci_fixup	hpsim_pci_fixup
 #define platform_map_nr		map_nr_dense
 
 #endif /* _ASM_IA64_MACHVEC_HPSIM_h */
include/asm-ia64/machvec_init.h +5 -1
diff -urN linux-davidm/include/asm-ia64/machvec_init.h linux-2.4.0-test4-lia/include/asm-ia64/machvec_init.h
@@ -1,4 +1,6 @@
-#define MACHVEC_INHIBIT_RENAMING
+#define __MACHVEC_HDR(n)		<asm/machvec_##n##.h>
+#define __MACHVEC_EXPAND(n)		__MACHVEC_HDR(n)
+#define MACHVEC_PLATFORM_HEADER		__MACHVEC_EXPAND(MACHVEC_PLATFORM_NAME)
 
 #include <asm/machvec.h>
 
@@ -7,3 +9,5 @@
 	= MACHVEC_INIT(name);
 
 #define MACHVEC_DEFINE(name)	MACHVEC_HELPER(name)
+
+MACHVEC_DEFINE(MACHVEC_PLATFORM_NAME)
include/asm-ia64/page.h +1 -0
diff -urN linux-davidm/include/asm-ia64/page.h linux-2.4.0-test4-lia/include/asm-ia64/page.h
@@ -100,6 +100,7 @@
 #define MAP_NR_SN1(addr)	(((unsigned long) (addr) - PAGE_OFFSET) >> PAGE_SHIFT)
 
 #ifdef CONFIG_IA64_GENERIC
+# include <asm/machvec.h>
 # define MAP_NR(addr)	platform_map_nr(addr)
 #elif defined (CONFIG_IA64_SN_SN1_SIM)
 # define MAP_NR(addr)	MAP_NR_SN1(addr)
include/asm-ia64/pal.h +12 -9
diff -urN linux-davidm/include/asm-ia64/pal.h linux-2.4.0-test4-lia/include/asm-ia64/pal.h
@@ -18,7 +18,8 @@
  * 00/03/07	davidm	Updated pal_cache_flush() to be in sync with PAL v2.6.
  * 00/03/23     cfleck  Modified processor min-state save area to match updated PAL & SAL info
  * 00/05/24     eranian Updated to latest PAL spec, fix structures bugs, added 
- * 00/05/25	eranian Support for stack calls, and statis physical calls
+ * 00/05/25	eranian Support for stack calls, and static physical calls
+ * 00/06/18	eranian Support for stacked physical calls
  */
 
 /*
@@ -646,10 +647,12 @@
 extern struct ia64_pal_retval ia64_pal_call_static (u64, u64, u64, u64); 
 extern struct ia64_pal_retval ia64_pal_call_stacked (u64, u64, u64, u64); 
 extern struct ia64_pal_retval ia64_pal_call_phys_static (u64, u64, u64, u64); 
+extern struct ia64_pal_retval ia64_pal_call_phys_stacked (u64, u64, u64, u64); 
 
 #define PAL_CALL(iprv,a0,a1,a2,a3)	iprv = ia64_pal_call_static(a0, a1, a2, a3)
 #define PAL_CALL_STK(iprv,a0,a1,a2,a3)	iprv = ia64_pal_call_stacked(a0, a1, a2, a3)
 #define PAL_CALL_PHYS(iprv,a0,a1,a2,a3) iprv = ia64_pal_call_phys_static(a0, a1, a2, a3)
+#define PAL_CALL_PHYS_STK(iprv,a0,a1,a2,a3) iprv = ia64_pal_call_phys_stacked(a0, a1, a2, a3)
 
 typedef int (*ia64_pal_handler) (u64, ...);
 extern ia64_pal_handler ia64_pal;
@@ -951,7 +954,7 @@
 /* Return information about processor's optional power management capabilities. */
 extern inline s64 
 ia64_pal_halt_info (pal_power_mgmt_info_u_t *power_buf) 
-{
+{	
 	struct ia64_pal_retval iprv;
 	PAL_CALL_STK(iprv, PAL_HALT_INFO, (unsigned long) power_buf, 0, 0);
 	return iprv.status; 
@@ -1370,17 +1373,17 @@
 				dirty_bit_valid		: 1,
 				mem_attr_valid		: 1,
 				reserved		: 60;
-	} pal_itr_valid_s;
-} pal_itr_valid_u_t;
+	} pal_tr_valid_s;
+} pal_tr_valid_u_t;
 
 /* Read a translation register */
 extern inline s64 
-ia64_pal_vm_tr_read (u64 reg_num, u64 tr_type, u64 tr_buffer, pal_itr_valid_u_t *itr_valid) 
-{	
+ia64_pal_tr_read (u64 reg_num, u64 tr_type, u64 *tr_buffer, pal_tr_valid_u_t *tr_valid)
+{
 	struct ia64_pal_retval iprv;
-	PAL_CALL(iprv, PAL_VM_TR_READ, reg_num, tr_type, tr_buffer);
-	if (itr_valid)
-		itr_valid->piv_val = iprv.v0;
+	PAL_CALL_PHYS_STK(iprv, PAL_VM_TR_READ, reg_num, tr_type,(u64)__pa(tr_buffer));
+	if (tr_valid)
+		tr_valid->piv_val = iprv.v0;
 	return iprv.status; 
 }
 
include/asm-ia64/param.h +2 -12
diff -urN linux-davidm/include/asm-ia64/param.h linux-2.4.0-test4-lia/include/asm-ia64/param.h
@@ -10,23 +10,13 @@
 
 #include <linux/config.h>
 
-#ifdef CONFIG_IA64_HP_SIM
+#if defined(CONFIG_IA64_HP_SIM) || defined(CONFIG_IA64_SOFTSDV_HACKS)
 /*
  * Yeah, simulating stuff is slow, so let us catch some breath between
  * timer interrupts...
  */
 # define HZ 20
-#endif
-
-#ifdef CONFIG_IA64_DIG
-# ifdef CONFIG_IA64_SOFTSDV_HACKS
-#  define HZ 20
-# else
-#  define HZ 100
-# endif
-#endif
-
-#ifndef HZ
+#else
 # define HZ	1024
 #endif
 
include/asm-ia64/pci.h +19 -53

134 lines not on this page · raw message

include/asm-ia64/processor.h +6 -2
diff -urN linux-davidm/include/asm-ia64/processor.h linux-2.4.0-test4-lia/include/asm-ia64/processor.h
@@ -338,8 +338,12 @@
 struct mm_struct;
 struct task_struct;
 
-/* Free all resources held by a thread. */
-extern void release_thread (struct task_struct *);
+/*
+ * Free all resources held by a thread. This is called after the
+ * parent of DEAD_TASK has collected the exist status of the task via
+ * wait().  This is a no-op on IA-64.
+ */
+#define release_thread(dead_task)
 
 /*
  * This is the mechanism for creating a new kernel thread.
include/asm-ia64/scatterlist.h +1 -0
diff -urN linux-davidm/include/asm-ia64/scatterlist.h linux-2.4.0-test4-lia/include/asm-ia64/scatterlist.h
@@ -13,6 +13,7 @@
 	 * indirection buffer, NULL otherwise:
 	 */
 	char *alt_address;
+	char *orig_address;	/* Save away the original buffer address (used by pci-dma.c) */
 	unsigned int length;	/* buffer length */
 };
 
include/asm-ia64/smp.h +4 -0
diff -urN linux-davidm/include/asm-ia64/smp.h linux-2.4.0-test4-lia/include/asm-ia64/smp.h
@@ -99,5 +99,9 @@
 extern void __init init_smp_config (void);
 extern void smp_do_timer (struct pt_regs *regs);
 
+extern int smp_call_function_single (int cpuid, void (*func) (void *info), void *info,
+			      int retry, int wait);
+
+
 #endif /* CONFIG_SMP */
 #endif /* _ASM_IA64_SMP_H */
include/asm-ia64/system.h +1 -0
diff -urN linux-davidm/include/asm-ia64/system.h linux-2.4.0-test4-lia/include/asm-ia64/system.h
@@ -445,6 +445,7 @@
    */
 # define switch_to(prev,next,last) do {							\
 	if (ia64_get_fpu_owner() = (prev) && ia64_psr(ia64_task_regs(prev))->mfh) {	\
+		ia64_psr(ia64_task_regs(prev))->mfh = 0;				\
 		(prev)->thread.flags |= IA64_THREAD_FPH_VALID;				\
 		__ia64_save_fpu((prev)->thread.fph);					\
 	}										\
lib/cmdline.c +9 -6
diff -urN linux-davidm/lib/cmdline.c linux-2.4.0-test4-lia/lib/cmdline.c
@@ -85,12 +85,12 @@
  *	@ptr: Where parse begins
  *	@retptr: (output) Pointer to next char after parse completes
  *
- *	Parses a string into a number.  The number stored
- *	at @ptr is potentially suffixed with %K (for
- *	kilobytes, or 1024 bytes) or suffixed with %M (for
- *	megabytes, or 1048576 bytes).  If the number is suffixed
- *	with K or M, then the return value is the number
- *	multiplied by one kilobyte, or one megabyte, respectively.
+ *	Parses a string into a number.  The number stored at @ptr is
+ *	potentially suffixed with %K (for kilobytes, or 1024 bytes),
+ *	%M (for megabytes, or 1048576 bytes), or %G (for gigabytes, or
+ *	1073741824).  If the number is suffixed with K, M, or G, then
+ *	the return value is the number multiplied by one kilobyte, one
+ *	megabyte, or one gigabyte, respectively.
  */
 
 unsigned long memparse (char *ptr, char **retptr)
@@ -98,6 +98,9 @@
 	unsigned long ret = simple_strtoul (ptr, retptr, 0);
 
 	switch (**retptr) {
+	case 'G':
+	case 'g':
+		ret <<= 10;
 	case 'M':
 	case 'm':
 		ret <<= 10;
#1 lore raw
Quoted 18 lines

Here is the latest kernel update. Before I go on, two major caveats:

BIG CAVEAT
To run this kernel on a system with a SCSI controller that uses the PCI DMA interface (e.g, adaptec), you'll have to specific boot option mem=4G to force the kernel to ignore memory above 4GB. This is a temporary issue and will be fixed in the next version.

BIG CAVEAT
This kernel will work fine with the qla1280 SCSI driver, even if there is memory above 4GB. However, you must make sure that "64 bit addressing" is enabled in the Qlogic BIOS setup (press "Alt-Q" during system initialization to get into the SCSI controller configuration menu). If your system is unable to mount the root filesystem, chances are you forgot to do this.

Quoted 7 lines

OK, having said that, here are the major goodies:

- Support for software I/O TLB is in, thanks to Goutham and Asit (Intel). This support allows to DMA from 32-bit PCI devices to any place in the physical memory. However, the transfer size is currently limited to one page and this is the reason SCSI drivers such as the adaptec drivers do not work yet

All the SCSI devices will work as long as it is a 64-bit PCI SCSI device and the dma_mask is set to 0xFFFFFFFFFFFFFFFF. We have a prototype working that supports I/O TLB mapping of more than a page size and will get the patch out as soon as possible.

Thanks,
Asit

#2 lore raw
In reply to David Mosberger

Here is a small patch for arch/ia64/config.in: fs/nls/Config.in is already sourced by fs/Config.in, no need to do it a second time.

ia64/config.in +0 -2
@@ -161,8 +161,6 @@
 
 source fs/Config.in
 
-source fs/nls/Config.in
-
 if [ "$CONFIG_VT" = "y" ]; then
   mainmenu_option next_comment
   comment 'Console drivers'

Andreas.

Signature · 4 lines
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
[email protected]
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg