Skip to contentSkip to conversation

Origin patches, take 2

PATCH Ralf Baechle 5 participants 9 messages Nov 18, 2002 – Nov 21, 2002

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

Take two on the Origin patches. This patch pulls the broken IOC3 patches which somebody from SGI sneaked to Linus making the IO3 ethernet driver close to unusable ...

This is a fairly dirty patchkit to revive the port. I'm posting it here because these patches are quite quick'n'dirty and various people have been flooding my mailbox during the past time with requests for Origin kernels.

The serial console is still seriously missbehaving; fixing that is the last big to do item before the port is fully usable again.

Ralf

mips/kernel/traps.c 18 Nov 2002 11:43:14 -0000 renamed from mips/kernel/traps.c 4 Nov 2002 19:39:56 -0000 +6 -0
diff -u -r1.99.2.32 traps.c
@@ -909,6 +909,12 @@
 
 	cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
 	set_context(cpu << 23);
+
+	atomic_inc(&init_mm.mm_count);
+	current->active_mm = &init_mm;
+	if (current->mm)
+		BUG();
+	enter_lazy_tlb(&init_mm, current, cpu);
 }
 
 void __init trap_init(void)
mips/sgi-ip27/ip27-console.c 18 Nov 2002 11:43:15 -0000 renamed from mips/sgi-ip27/ip27-console.c 7 Nov 2002 01:47:45 -0000 +6 -5
diff -u -r1.1.2.3 ip27-console.c
@@ -9,6 +9,7 @@
 #include <linux/console.h>
 #include <linux/kdev_t.h>
 #include <linux/major.h>
+#include <asm/page.h>
 #include <asm/sn/addrs.h>
 #include <asm/sn/sn0/hub.h>
 #include <asm/sn/klconfig.h>
@@ -45,11 +46,11 @@
 }
 
 static struct console ip27_prom_console = {
-    .name	= "prom",
-    .write	= ip27prom_console_write,
-    .device	= ip27prom_console_dev,
-    .flags	= CON_PRINTBUFFER,
-    .index	= -1,
+	.name	= "prom",
+	.write	= ip27prom_console_write,
+	.device	= ip27prom_console_dev,
+	.flags	= CON_PRINTBUFFER,
+	.index	= -1,
 };
 
 __init void ip27_setup_console(void)
mips/sgi-ip27/ip27-init.c 18 Nov 2002 11:43:16 -0000 renamed from mips/sgi-ip27/ip27-init.c 28 Sep 2002 22:28:38 -0000 +76 -52

154 lines not on this page · raw message

mips/sgi-ip27/ip27-rtc.c 18 Nov 2002 11:43:17 -0000 renamed from mips/sgi-ip27/ip27-rtc.c 7 Nov 2002 01:47:45 -0000 +9 -16
diff -u -r1.1.2.3 ip27-rtc.c
@@ -61,7 +61,6 @@
 #define RTC_TIMER_ON		0x02	/* missed irq timer active	*/
 
 static unsigned char rtc_status;	/* bitmapped status byte.	*/
-static spinlock_t rtc_status_lock = SPIN_LOCK_UNLOCKED;
 static unsigned long rtc_freq;	/* Current periodic IRQ rate	*/
 static struct m48t35_rtc *rtc;
 
@@ -125,10 +124,7 @@
 		if ((yrs -= epoch) > 255)    /* They are unsigned */
 			return -EINVAL;
 
-		save_flags(flags);
-		cli();
 		if (yrs > 169) {
-			restore_flags(flags);
 			return -EINVAL;
 		}
 		if (yrs >= 100)
@@ -141,6 +137,7 @@
 		BIN_TO_BCD(mon);
 		BIN_TO_BCD(yrs);
 
+		spin_lock_irq(&rtc_lock);
 		rtc->control &= ~M48T35_RTC_SET;
 		rtc->year = yrs;
 		rtc->month = mon;
@@ -149,8 +146,8 @@
 		rtc->min = min;
 		rtc->sec = sec;
 		rtc->control &= ~M48T35_RTC_SET;
+		spin_unlock_irq(&rtc_lock);
 
-		restore_flags(flags);
 		return 0;
 	}
 	default:
@@ -167,15 +164,15 @@
 
 static int rtc_open(struct inode *inode, struct file *file)
 {
-	spin_lock(rtc_status_lock);
+	spin_lock_irq(rtc_lock);
 
 	if (rtc_status & RTC_IS_OPEN) {
-		spin_unlock(rtc_status_lock);
+		spin_unlock_irq(rtc_status_lock);
 		return -EBUSY;
 	}
 
 	rtc_status |= RTC_IS_OPEN;
-	spin_unlock(rtc_status_lock);
+	spin_unlock_irq(rtc_lock);
 
 	return 0;
 }
@@ -187,9 +184,9 @@
 	 * in use, and clear the data.
 	 */
 
-	spin_lock(rtc_status_lock);
+	spin_lock_irq(rtc_lock);
 	rtc_status &= ~RTC_IS_OPEN;
-	spin_unlock(rtc_status_lock);
+	spin_unlock_irq(rtc_lock);
 
 	return 0;
 }
@@ -226,9 +223,6 @@
 		return -ENODEV;
 	create_proc_read_entry ("rtc", 0, NULL, rtc_read_proc, NULL);
 
-	save_flags(flags);
-	cli();
-	restore_flags(flags);
 	rtc_freq = 1024;
 	return 0;
 }
@@ -304,8 +298,7 @@
 	 * RTC has RTC_DAY_OF_WEEK, we ignore it, as it is only updated
 	 * by the RTC when initially set to a non-zero value.
 	 */
-	save_flags(flags);
-	cli();
+	spin_lock_irq(&rtc_lock);
         rtc->control |= M48T35_RTC_READ;
 	rtc_tm->tm_sec = rtc->sec;
 	rtc_tm->tm_min = rtc->min;
@@ -314,7 +307,7 @@
 	rtc_tm->tm_mon = rtc->month;
 	rtc_tm->tm_year = rtc->year;
 	rtc->control &= ~M48T35_RTC_READ;
-	restore_flags(flags);
+	spin_unlock_irq(&rtc_lock);
 
 	BCD_TO_BIN(rtc_tm->tm_sec);
 	BCD_TO_BIN(rtc_tm->tm_min);
mips/sgi-ip27/ip27-setup.c 18 Nov 2002 11:43:17 -0000 renamed from mips/sgi-ip27/ip27-setup.c 21 Sep 2002 21:15:23 -0000 +1 -1
diff -u -r1.1.2.3 ip27-setup.c
@@ -311,6 +311,6 @@
 	ioc3_eth_init();
 	per_cpu_init();
 
-	mips_io_port_base = IO_BASE;
+	set_io_port_base(IO_BASE);
 	board_time_init = ip27_time_init;
 }
mips/sgi-ip27/ip27-timer.c 18 Nov 2002 11:43:21 -0000 renamed from mips/sgi-ip27/ip27-timer.c 5 Aug 2002 23:53:35 -0000 +29 -11
diff -u -r1.1.2.2 ip27-timer.c
@@ -1,5 +1,5 @@
 /*
- * Copytight (C) 1999, 2000 Ralf Baechle ([email protected])
+ * Copytight (C) 1999, 2000, 2002 Ralf Baechle ([email protected])
  * Copytight (C) 1999, 2000 Silicon Graphics, Inc.
  */
 #include <linux/config.h>
@@ -55,6 +55,7 @@
 	rtc = (struct m48t35_rtc *)(KL_CONFIG_CH_CONS_INFO(nid)->memory_base +
 							IOC3_BYTEBUS_DEV0);
 
+	spin_lock(&rtc_lock);
 	rtc->control |= M48T35_RTC_READ;
 	cmos_minutes = rtc->min;
 	BCD_TO_BIN(cmos_minutes);
@@ -84,15 +85,18 @@
 		       cmos_minutes, real_minutes);
 		retval = -1;
 	}
+	spin_unlock(&rtc_lock);
 
 	return retval;
 }
 
+#define IP27_TIMER_IRQ	9			/* XXX Assign number */
+
 void rt_timer_interrupt(struct pt_regs *regs)
 {
 	int cpu = smp_processor_id();
 	int cpuA = ((cputoslice(cpu)) == 0);
-	int irq = 9;				/* XXX Assign number */
+	int irq = IP27_TIMER_IRQ;
 
 	irq_enter(cpu, irq);
 	write_lock(&xtime_lock);
@@ -157,7 +161,7 @@
 
 static __init unsigned long get_m48t35_time(void)
 {
-        unsigned int year, month, date, hour, min, sec;
+	unsigned int year, month, date, hour, min, sec;
 	struct m48t35_rtc *rtc;
 	nasid_t nid;
 
@@ -165,6 +169,7 @@
 	rtc = (struct m48t35_rtc *)(KL_CONFIG_CH_CONS_INFO(nid)->memory_base +
 							IOC3_BYTEBUS_DEV0);
 
+	spin_lock(&rtc_lock);
 	rtc->control |= M48T35_RTC_READ;
 	sec = rtc->sec;
 	min = rtc->min;
@@ -173,17 +178,27 @@
 	month = rtc->month;
 	year = rtc->year;
 	rtc->control &= ~M48T35_RTC_READ;
+	spin_unlock(&rtc_lock);
+
+	BCD_TO_BIN(sec);
+	BCD_TO_BIN(min);
+	BCD_TO_BIN(hour);
+	BCD_TO_BIN(date);
+	BCD_TO_BIN(month);
+	BCD_TO_BIN(year);
+
+	year += 1970;
 
-        BCD_TO_BIN(sec);
-        BCD_TO_BIN(min);
-        BCD_TO_BIN(hour);
-        BCD_TO_BIN(date);
-        BCD_TO_BIN(month);
-        BCD_TO_BIN(year);
+	return mktime(year, month, date, hour, min, sec);
+}
 
-        year += 1970;
+static void ip27_timer_setup(struct irqaction *irq)
+{
+	/* over-write the handler, we use our own way */
+	irq->handler = no_action;
 
-        return mktime(year, month, date, hour, min, sec);
+	/* setup irqaction */
+//	setup_irq(IP27_TIMER_IRQ, irq);		/* XXX Can't do this yet.  */
 }
 
 void __init ip27_time_init(void)
@@ -192,6 +207,9 @@
 	xtime.tv_usec = 0;
 
 	do_gettimeoffset = ip27_do_gettimeoffset;
+
+	// board_time_init = ip27_time_init;
+	board_timer_setup = ip27_timer_setup;
 }
 
 void __init cpu_time_init(void)
mips/sibyte/sb1250/smp.c 18 Nov 2002 11:43:21 -0000 renamed from mips/sibyte/sb1250/smp.c 28 Sep 2002 22:28:38 -0000 +0 -3
diff -u -r1.2.2.5 smp.c
@@ -129,9 +129,6 @@
 		p->processor = i;
 		p->cpus_runnable = 1 << i; /* we schedule the first task manually */
 
-		/* Attach to the address space of init_task. */
-		atomic_inc(&init_mm.mm_count);
-		p->active_mm = &init_mm;
 		init_tasks[i] = p;
 
 		del_from_runqueue(p);
mips64/Makefile 18 Nov 2002 11:43:21 -0000 renamed from mips64/Makefile 12 Nov 2002 02:14:50 -0000 +5 -5
diff -u -r1.22.2.19 Makefile
@@ -215,7 +215,7 @@
 # ELF files from 32-bit files by conversion.
 #
 ifdef CONFIG_BOOT_ELF64
-GCCFLAGS += -Wa,-32 $(shell if $(CC) $(1) -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi)
+GCCFLAGS += -Wa,-32 $(shell if $(CC) -Wa,-mgp64 -c -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "-Wa,-mgp64"; fi)
 LINKFLAGS += -T arch/mips64/ld.script.elf32
 #AS += -64
 #LD += -m elf64bmip
@@ -238,9 +238,9 @@
 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
-64bit-bfd = elf64-littlemips
+64bit-bfd = elf64-tradlittlemips
 else
-64bit-bfd = elf64-bigmips
+64bit-bfd = elf64-tradbigmips
 endif
 
 vmlinux: arch/mips64/ld.script.elf32
@@ -249,10 +249,10 @@
 
 ifdef CONFIG_MAPPED_KERNEL
 vmlinux.64: vmlinux
-	$(OBJCOPY) -O $(64bit-bfd) --change-addresses=0xbfffffff40000000 $< $@
+	$(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo --change-addresses=0xbfffffff40000000 $< $@
 else
 vmlinux.64: vmlinux
-	$(OBJCOPY) -O $(64bit-bfd) --change-addresses=0xa7ffffff80000000 $< $@
+	$(OBJCOPY) -O $(64bit-bfd) --remove-section=.reginfo --change-addresses=0xa800000080000000 $< $@
 endif
 
 zImage: vmlinux
mips64/defconfig 18 Nov 2002 11:43:21 -0000 renamed from mips64/defconfig 8 Nov 2002 01:39:44 -0000 +4 -4
diff -u -r1.73.2.22 defconfig
@@ -49,8 +49,8 @@
 # CONFIG_SGI_IP22 is not set
 CONFIG_SGI_IP27=y
 # CONFIG_SGI_SN0_N_MODE is not set
-CONFIG_DISCONTIGMEM=y
-CONFIG_NUMA=y
+# CONFIG_DISCONTIGMEM is not set
+# CONFIG_NUMA is not set
 # CONFIG_MAPPED_KERNEL is not set
 # CONFIG_REPLICATE_KTEXT is not set
 # CONFIG_REPLICATE_EXHANDLERS is not set
@@ -473,8 +473,8 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BEFS_DEBUG is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
mips64/defconfig-ip27 18 Nov 2002 11:43:21 -0000 renamed from mips64/defconfig-ip27 8 Nov 2002 01:39:44 -0000 +4 -4
diff -u -r1.67.2.22 defconfig-ip27
@@ -49,8 +49,8 @@
 # CONFIG_SGI_IP22 is not set
 CONFIG_SGI_IP27=y
 # CONFIG_SGI_SN0_N_MODE is not set
-CONFIG_DISCONTIGMEM=y
-CONFIG_NUMA=y
+# CONFIG_DISCONTIGMEM is not set
+# CONFIG_NUMA is not set
 # CONFIG_MAPPED_KERNEL is not set
 # CONFIG_REPLICATE_KTEXT is not set
 # CONFIG_REPLICATE_EXHANDLERS is not set
@@ -473,8 +473,8 @@
 # CONFIG_BEFS_FS is not set
 # CONFIG_BEFS_DEBUG is not set
 # CONFIG_BFS_FS is not set
-# CONFIG_EXT3_FS is not set
-# CONFIG_JBD is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
 # CONFIG_JBD_DEBUG is not set
 # CONFIG_FAT_FS is not set
 # CONFIG_MSDOS_FS is not set
mips64/kernel/Makefile 18 Nov 2002 11:43:21 -0000 renamed from mips64/kernel/Makefile 7 Nov 2002 18:01:32 -0000 +1 -1
diff -u -r1.11.2.12 Makefile
@@ -12,7 +12,7 @@
 
 O_TARGET := kernel.o
 
-export-objs	= irq.o mips64_ksyms.o pci-dma.o setup.o smp.o
+export-objs	= irq.o mips64_ksyms.o pci-dma.o setup.o smp.o time.o
 
 obj-y		:= branch.o cpu-probe.o entry.o irq.o proc.o process.o \
 		   ptrace.o r4k_cache.o r4k_fpu.o r4k_genex.o r4k_switch.o \
mips64/kernel/setup.c 18 Nov 2002 11:43:21 -0000 renamed from mips64/kernel/setup.c 25 Oct 2002 23:01:17 -0000 +2 -0
diff -u -r1.31.2.21 setup.c
@@ -278,6 +278,7 @@
 	start_pfn = PFN_UP(CPHYSADDR(&_end));
 #endif	/* CONFIG_BLK_DEV_INITRD */
 
+#ifndef CONFIG_SGI_IP27
 	/* Find the highest page frame number we have available.  */
 	max_pfn = 0;
 	for (i = 0; i < boot_mem_map.nr_map; i++) {
@@ -342,6 +343,7 @@
 
 	/* Reserve the bootmap memory.  */
 	reserve_bootmem(PFN_PHYS(start_pfn), bootmap_size);
+#endif
 
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* Board specific code should have set up initrd_start and initrd_end */
mips64/kernel/time.c 18 Nov 2002 11:43:28 -0000 renamed from mips64/kernel/time.c 31 Oct 2002 19:50:14 -0000 +5 -0
diff -u -r1.1.2.6 time.c
@@ -21,6 +21,7 @@
 #include <linux/kernel_stat.h>
 #include <linux/spinlock.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
 
 #include <asm/bootinfo.h>
 #include <asm/cpu.h>
@@ -38,6 +39,8 @@
 extern rwlock_t xtime_lock;
 extern volatile unsigned long wall_jiffies;
 
+spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
+
 /*
  * whether we emulate local_timer_interrupts for SMP machines.
  */
@@ -580,3 +583,5 @@
 	 */
 	tm->tm_wday = (gday + 4) % 7; /* 1970/1/1 was Thursday */
 }
+
+EXPORT_SYMBOL(rtc_lock);
mips64/kernel/traps.c 18 Nov 2002 11:43:28 -0000 renamed from mips64/kernel/traps.c 4 Nov 2002 19:39:56 -0000 +6 -0
diff -u -r1.30.2.35 traps.c
@@ -686,6 +686,12 @@
 	cpu_data[cpu].asid_cache = ASID_FIRST_VERSION;
 	set_context(((long)(&pgd_current[cpu])) << 23);
 	set_wired(0);
+
+	atomic_inc(&init_mm.mm_count);
+	current->active_mm = &init_mm;
+	if (current->mm)
+		BUG();
+	enter_lazy_tlb(&init_mm, current, cpu);
 }
 
 void __init trap_init(void)
net/ioc3-eth.c 18 Nov 2002 11:43:39 -0000 renamed from net/ioc3-eth.c 7 Nov 2002 01:47:46 -0000 +41 -145

287 lines not on this page · raw message

asm-mips64/io.h 18 Nov 2002 11:44:01 -0000 renamed from asm-mips64/io.h 28 Sep 2002 22:28:38 -0000 +4 -4
diff -u -r1.25.2.14 io.h
@@ -330,7 +330,7 @@
 
 #define outw(val,port)							\
 do {									\
-	*(volatile u16 *)(mips_io_port_base + (port)) = __ioswab16(val);\
+	*(volatile u16 *)(mips_io_port_base + (port ^ 2)) = __ioswab16(val);\
 } while(0)
 
 #define outl(val,port)							\
@@ -346,7 +346,7 @@
 
 #define outw_p(val,port)						\
 do {									\
-	*(volatile u16 *)(mips_io_port_base + (port)) = __ioswab16(val);\
+	*(volatile u16 *)(mips_io_port_base + (port ^ 2)) = __ioswab16(val);\
 	SLOW_DOWN_IO;							\
 } while(0)
 
@@ -363,7 +363,7 @@
 
 static inline unsigned short inw(unsigned long port)
 {
-	return __ioswab16(*(volatile u16 *)(mips_io_port_base + port));
+	return __ioswab16(*(volatile u16 *)(mips_io_port_base + (port ^ 2)));
 }
 
 static inline unsigned int inl(unsigned long port)
@@ -385,7 +385,7 @@
 {
 	u16 __val;
 
-	__val = *(volatile u16 *)(mips_io_port_base + port);
+	__val = *(volatile u16 *)(mips_io_port_base + (port ^ 2));
 	SLOW_DOWN_IO;
 
 	return __ioswab16(__val);
asm-mips64/m48t35.h 18 Nov 2002 11:44:01 -0000 renamed from asm-mips64/m48t35.h 18 Feb 2000 09:54:39 -0000 +20 -22

52 lines not on this page · raw message

asm-mips64/page.h 18 Nov 2002 11:44:02 -0000 renamed from asm-mips64/page.h 30 Sep 2002 17:00:03 -0000 +1 -1
diff -u -r1.10.2.14 page.h
@@ -115,7 +115,7 @@
 #endif
 #if defined(CONFIG_SGI_IP27)
 #define PAGE_OFFSET	0xa800000000000000UL
-#define UNCAC_BASE	0x9000000000000000UL
+#define UNCAC_BASE	0x9600000000000000UL
 #endif
 #if defined(CONFIG_SIBYTE_SB1250)
 #define PAGE_OFFSET	0xa800000000000000UL
asm-mips64/sn/sn0/addrs.h 18 Nov 2002 11:44:06 -0000 renamed from asm-mips64/sn/sn0/addrs.h 27 Jun 2002 14:21:24 -0000 +2 -2
diff -u -r1.2.2.1 addrs.h
@@ -45,11 +45,11 @@
 #define HSPEC_BASE		0x9000000000000000
 #define IO_BASE			0x9200000000000000
 #define MSPEC_BASE		0x9400000000000000
-#define UNCAC_BASE		0x9600000000000000
+#define __UNCAC_BASE		0x9600000000000000
 
 #define TO_PHYS(x)		(	      ((x) & TO_PHYS_MASK))
 #define TO_CAC(x)		(CAC_BASE   | ((x) & TO_PHYS_MASK))
-#define TO_UNCAC(x)		(UNCAC_BASE | ((x) & TO_PHYS_MASK))
+#define TO_UNCAC(x)		(__UNCAC_BASE | ((x) & TO_PHYS_MASK))
 #define TO_MSPEC(x)		(MSPEC_BASE | ((x) & TO_PHYS_MASK))
 #define TO_HSPEC(x)		(HSPEC_BASE | ((x) & TO_PHYS_MASK))
 
#2 lore raw

Re: usb hotplug function with linux mips kernel

Hello double questionmark ;-)

Quoted 3 lines · ??

anyone successfully using usb hotplug function with linux mips kernel?

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=102954820511328&w=2

There is nothing in the USB code that should be MIPS specific. Despite what Tom suspects everything is fine. 32-bit kernel symbols always start with 0xffffffff and the value of usbdevfs_cleanup is an artefact of the function having been discarded by the linker.

Ralf

#3 lore raw

Re: usb hotplug function with linux mips kernel

Quoted 4 lines · Ralf Baechle

Hello double questionmark ;-)

On Tue, Nov 19, 2002 at 08:09:07PM +0800, ?? wrote:

Quoted 9 lines
Quoted 3 lines

anyone successfully using usb hotplug function with linux mips kernel?

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=102954820511328&w=2

There is nothing in the USB code that should be MIPS specific. Despite what Tom suspects everything is fine. 32-bit kernel symbols always start with 0xffffffff and the value of usbdevfs_cleanup is an artefact of the function having been discarded by the linker.

Additional info:

USB has been working on MIPS for well over a year now. There was a problem early on due to non-coherent MIPS cache, but it was solved back then.

We have been using USB on global span IVR successfully. Maybe there are still some patches missing in linux-mips tree. I will take a look later.

Jun

#4 lore raw

Re: usb hotplug function with linux mips kernel

Quoted 15 lines · Jun Sun
Quoted 4 lines · Ralf Baechle

Hello double questionmark ;-)

On Tue, Nov 19, 2002 at 08:09:07PM +0800, ?? wrote:

Quoted 9 lines
Quoted 3 lines

anyone successfully using usb hotplug function with linux mips kernel?

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=102954820511328&w=2

There is nothing in the USB code that should be MIPS specific. Despite what Tom suspects everything is fine. 32-bit kernel symbols always start with 0xffffffff and the value of usbdevfs_cleanup is an artefact of the function having been discarded by the linker.

Quoted 6 lines

Additional info:

USB has been working on MIPS for well over a year now. There was a problem early on due to non-coherent MIPS cache, but it was solved back then.

We have been using USB on global span IVR successfully.

... among many other mips boards.

Quoted 2 lines

Maybe there are still some patches missing in linux-mips tree. I will take a look later.

Pete

#5 lore raw

Re: usb hotplug function with linux mips kernel

Hi,

Quoted 16 lines · On 19 Nov 2002 10:03:47 -0800 Pete Popov <[email protected]> wrote:
Quoted 15 lines · Jun Sun
Quoted 13 lines · Ralf Baechle

Hello double questionmark ;-)

Quoted 3 lines · ??

anyone successfully using usb hotplug function with linux mips kernel?

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=102954820511328&w=2

There is nothing in the USB code that should be MIPS specific. Despite what Tom suspects everything is fine. 32-bit kernel symbols always start with 0xffffffff and the value of usbdevfs_cleanup is an artefact of the function having been discarded by the linker.

Quoted 11 lines
Quoted 6 lines

Additional info:

USB has been working on MIPS for well over a year now. There was a problem early on due to non-coherent MIPS cache, but it was solved back then.

We have been using USB on global span IVR successfully.

... among many other mips boards.

Quoted 2 lines

Maybe there are still some patches missing in linux-mips tree. I will take a look later.

I don't have a problem with current CVS tree(linux_2_4 tag) and a small patch.

I tested by the following system.
Hot plug is fine.

NEC VR4122(Eagle)
USB OCHI Controller
SanDisk SDDR-31
128MB CF

I attached a small patch.

Yoichi

drivers/usb/hub.c +0 -6
@@ -698,12 +698,6 @@
 		return;
 	}
 
-	if (usb_hub_port_debounce(hub, port)) {
-		err("connect-debounce failed, port %d disabled", port+1);
-		usb_hub_port_disable(hub, port);
-		return;
-	}
-
 	down(&usb_address0_sem);
 
 	tempstr = kmalloc(1024, GFP_KERNEL);
#6 lore raw

Re: usb hotplug function with linux mips kernel

dear Yoichi,

thanks for your reply & patch
we are using kernel 2.4.18, after reading your patch,

we found there is no following section:
- if (usb_hub_port_debounce(hub, port)) {

-  err("connect-debounce failed, port %d disabled", port+1);
-  usb_hub_port_disable(hub, port);
-  return;

- }

but a following section: (mentioned redhat bug #23670)

Quoted 6 lines
       /* Some low speed devices have problems with the quick delay, so */
       /*  be a bit pessimistic with those devices. RHbug #23670 */
      if (portstatus & USB_PORT_STAT_LOW_SPEED) {
               wait_ms(400);
               delay = HUB_LONG_RESET_TIME;
       }

can we safely remove the above section?

best regards,

----- Original Message -----
From: "Yoichi Yuasa" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>; <[email protected]>; <[email protected]>; <[email protected]>
Sent: Wednesday, November 20, 2002 10:49 AM
Subject: Re: usb hotplug function with linux mips kernel

Quoted 12 lines

Hi,

Quoted 7 lines · On 19 Nov 2002 10:03:47 -0800 Pete Popov <[email protected]> wrote:
Quoted 6 lines · Jun Sun
Quoted 5 lines · Ralf Baechle

Hello double questionmark ;-)

Quoted 1 line · ??

anyone successfully using usb hotplug function with linux mips

kernel?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=102954820511328&w=2

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

There is nothing in the USB code that should be MIPS specific.

Despite

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

what Tom suspects everything is fine. 32-bit kernel symbols always

start

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

with 0xffffffff and the value of usbdevfs_cleanup is an artefact of

the

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines

function having been discarded by the linker.

Additional info:

USB has been working on MIPS for well over a year now. There was a

problem

Quoted 10 lines
Quoted 8 lines
Quoted 3 lines

early on due to non-coherent MIPS cache, but it was solved back then.

We have been using USB on global span IVR successfully.

... among many other mips boards.

Quoted 2 lines

Maybe there are still some patches missing in linux-mips tree. I will take a look later.

I don't have a problem with current CVS tree(linux_2_4 tag) and a small

patch.

Quoted 12 lines

I tested by the following system.
Hot plug is fine.

NEC VR4122(Eagle)
USB OCHI Controller
SanDisk SDDR-31
128MB CF

I attached a small patch.

Yoichi

#7 lore raw

Re: usb hotplug function with linux mips kernel

In reply to Yoichi Yuasa
Quoted 5 lines · Yoichi Yuasa
drivers/usb/hub.c +0 -0
@@ -698,12 +698,6 @@
 		return;
 	}

drivers/usb/hub.c line 703

Quoted 10 lines
drivers/usb/hub.c +0 -6
 
-	if (usb_hub_port_debounce(hub, port)) {
-		err("connect-debounce failed, port %d disabled", port+1);
-		usb_hub_port_disable(hub, port);
-		return;
-	}
-
 	down(&usb_address0_sem);
 
 	tempstr = kmalloc(1024, GFP_KERNEL);

Looks like a total hack, don't expect me to apply this ...

Ralf

#8 lore raw

Re: usb hotplug function with linux mips kernel

In reply to Jun Sun

dear jun,
do you have the patch to fix "non-coherent MIPS cache"? thanks in advanced!:)

and thanks you all who reply to this so quickly:)
btw, i don't mean usb not function with linux mips kernel
i mean using the "hotplug"-usb support(http://linux-hotplug.sourceforge.net/?selected=usb) with linux mips kernel

for example, after we plug in usb cable with a mips board, the mips kernel try to execute "/sbin/hotplug" shell script, then kernel wait_for_complete() for "/sbin/hotplug" with spin_lock_irq(), the do_execve() of "/sbin/hotplug" return 0(successfully), however, wait_for_complete() never return,
then kernel is reseted by hardware watchdog(timeout 3 secs)

we already trace this problem over a month,
but still can't figure out is it a userland
problem(cross-compiler/shell(bash))
or a problem with linux mips kernel

best regards,

----- Original Message -----
From: "Jun Sun" <[email protected]>
To: "Ralf Baechle" <[email protected]>
Cc: "??" <[email protected]>; <[email protected]>; <[email protected]>
Sent: Wednesday, November 20, 2002 1:54 AM
Subject: Re: usb hotplug function with linux mips kernel

Quoted 8 lines · Ralf Baechle
Quoted 7 lines

Hello double questionmark ;-)

Quoted 3 lines · ??

anyone successfully using usb hotplug function with linux mips kernel?

http://marc.theaimsgroup.com/?l=linux-hotplug-devel&m=102954820511328&w=2

Quoted 3 lines
Quoted 3 lines

There is nothing in the USB code that should be MIPS specific. Despite what Tom suspects everything is fine. 32-bit kernel symbols always

start

Quoted 7 lines
Quoted 3 lines

with 0xffffffff and the value of usbdevfs_cleanup is an artefact of the function having been discarded by the linker.

Additional info:

USB has been working on MIPS for well over a year now. There was a

problem

Quoted 6 lines

early on due to non-coherent MIPS cache, but it was solved back then.

We have been using USB on global span IVR successfully. Maybe there are still some patches missing in linux-mips tree. I will take a look later.

Jun