From f5b9fa6168b27d8ca4664d9a211e6269d3b58736 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Sat, 5 May 2007 09:27:45 +0000 Subject: linux-ezx 2.6.21: Sync with openezx svn NOTE: the defconfig needs some tweaking --- packages/linux/linux-ezx-2.6.21/ezx-core.patch | 40 +-- packages/linux/linux-ezx-2.6.21/ezx-emu.patch | 16 +- packages/linux/linux-ezx-2.6.21/ezx-pcap.patch | 70 ++-- packages/linux/linux-ezx-2.6.21/ezx-pm.patch | 8 +- packages/linux/linux-ezx-2.6.21/pcap-ts.patch | 450 +++++++++++++++++++++++++ packages/linux/linux-ezx_2.6.21.bb | 8 +- 6 files changed, 527 insertions(+), 65 deletions(-) create mode 100644 packages/linux/linux-ezx-2.6.21/pcap-ts.patch (limited to 'packages/linux') diff --git a/packages/linux/linux-ezx-2.6.21/ezx-core.patch b/packages/linux/linux-ezx-2.6.21/ezx-core.patch index f62d89a408..8e89afff53 100644 --- a/packages/linux/linux-ezx-2.6.21/ezx-core.patch +++ b/packages/linux/linux-ezx-2.6.21/ezx-core.patch @@ -1,7 +1,7 @@ Index: linux-2.6.21/arch/arm/boot/compressed/head-xscale.S =================================================================== ---- linux-2.6.21.orig/arch/arm/boot/compressed/head-xscale.S 2007-05-01 14:00:25.000000000 -0300 -+++ linux-2.6.21/arch/arm/boot/compressed/head-xscale.S 2007-05-01 14:00:48.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/boot/compressed/head-xscale.S 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/arch/arm/boot/compressed/head-xscale.S 2007-05-03 17:42:02.000000000 -0300 @@ -53,3 +53,6 @@ str r1, [r0, #0x18] #endif @@ -11,8 +11,8 @@ Index: linux-2.6.21/arch/arm/boot/compressed/head-xscale.S +#endif Index: linux-2.6.21/arch/arm/mach-pxa/Kconfig =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/Kconfig 2007-05-01 14:00:25.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/Kconfig 2007-05-01 23:02:56.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/Kconfig 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Kconfig 2007-05-04 04:17:33.000000000 -0300 @@ -37,6 +37,10 @@ bool "Keith und Koep Trizeps4 DIMM-Module" select PXA27x @@ -60,8 +60,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/Kconfig endif Index: linux-2.6.21/arch/arm/mach-pxa/Makefile =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-01 14:00:25.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-01 23:03:58.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-04 04:17:42.000000000 -0300 @@ -18,6 +18,7 @@ obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o @@ -73,7 +73,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/Makefile Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-01 23:03:58.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-04 04:17:42.000000000 -0300 @@ -0,0 +1,378 @@ +/* + * linux/arch/arm/mach-ezx/a780.c @@ -456,7 +456,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c Index: linux-2.6.21/include/asm-arm/arch-pxa/ezx.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/include/asm-arm/arch-pxa/ezx.h 2007-05-01 14:00:48.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/ezx.h 2007-05-03 17:42:02.000000000 -0300 @@ -0,0 +1,225 @@ +/* + * linux/include/asm-arm/arch-pxa/ezx.h @@ -685,8 +685,8 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/ezx.h + Index: linux-2.6.21/include/asm-arm/arch-pxa/pxa-regs.h =================================================================== ---- linux-2.6.21.orig/include/asm-arm/arch-pxa/pxa-regs.h 2007-05-01 14:00:24.000000000 -0300 -+++ linux-2.6.21/include/asm-arm/arch-pxa/pxa-regs.h 2007-05-01 23:02:53.000000000 -0300 +--- linux-2.6.21.orig/include/asm-arm/arch-pxa/pxa-regs.h 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/pxa-regs.h 2007-05-04 04:17:32.000000000 -0300 @@ -849,6 +849,8 @@ #define UP2OCR_HXOE (1 << 17) /* Host Port 2 Transceiver Output Enable */ #define UP2OCR_SEOS (1 << 24) /* Single-Ended Output Select */ @@ -802,8 +802,8 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/pxa-regs.h #define PGSR2 __REG(0x40F00028) /* Power Manager GPIO Sleep State Register for GP[84-64] */ Index: linux-2.6.21/arch/arm/boot/compressed/head.S =================================================================== ---- linux-2.6.21.orig/arch/arm/boot/compressed/head.S 2007-05-01 14:00:25.000000000 -0300 -+++ linux-2.6.21/arch/arm/boot/compressed/head.S 2007-05-01 14:00:48.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/boot/compressed/head.S 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/arch/arm/boot/compressed/head.S 2007-05-03 17:42:02.000000000 -0300 @@ -117,6 +117,9 @@ mov r0, r0 .endr @@ -816,8 +816,8 @@ Index: linux-2.6.21/arch/arm/boot/compressed/head.S .word start @ absolute load/run zImage address Index: linux-2.6.21/include/asm-arm/arch-pxa/uncompress.h =================================================================== ---- linux-2.6.21.orig/include/asm-arm/arch-pxa/uncompress.h 2007-05-01 14:00:24.000000000 -0300 -+++ linux-2.6.21/include/asm-arm/arch-pxa/uncompress.h 2007-05-01 14:00:48.000000000 -0300 +--- linux-2.6.21.orig/include/asm-arm/arch-pxa/uncompress.h 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/uncompress.h 2007-05-03 17:42:02.000000000 -0300 @@ -14,14 +14,14 @@ #define STUART ((volatile unsigned long *)0x40700000) #define HWUART ((volatile unsigned long *)0x41600000) @@ -839,7 +839,7 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/uncompress.h Index: linux-2.6.21/arch/arm/mach-pxa/ezx_ssp.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx_ssp.c 2007-05-01 14:00:48.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx_ssp.c 2007-05-03 17:42:02.000000000 -0300 @@ -0,0 +1,126 @@ +/* + * SSP control code for Motorola EZX phones @@ -970,7 +970,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx_ssp.c Index: linux-2.6.21/arch/arm/mach-pxa/ezx.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx.h 2007-05-01 14:00:48.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx.h 2007-05-03 17:42:02.000000000 -0300 @@ -0,0 +1,9 @@ +#include + @@ -984,7 +984,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx.h Index: linux-2.6.21/arch/arm/mach-pxa/ezx_lcd.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx_lcd.c 2007-05-01 22:53:54.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx_lcd.c 2007-05-03 17:42:02.000000000 -0300 @@ -0,0 +1,113 @@ +/* + * linux/arch/arm/mach-ezx/a780.c @@ -1101,13 +1101,13 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx_lcd.c +arch_initcall(__ezx_lcd_init); Index: linux-2.6.21/arch/arm/mm/init.c =================================================================== ---- linux-2.6.21.orig/arch/arm/mm/init.c 2007-05-01 14:00:25.000000000 -0300 -+++ linux-2.6.21/arch/arm/mm/init.c 2007-05-01 14:00:48.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mm/init.c 2007-05-03 17:41:57.000000000 -0300 ++++ linux-2.6.21/arch/arm/mm/init.c 2007-05-04 03:48:30.000000000 -0300 @@ -241,6 +241,10 @@ */ reserve_bootmem_node(pgdat, boot_pfn << PAGE_SHIFT, boot_pages << PAGE_SHIFT); -+#ifdef CONFIG_ARCH_EZX ++#ifdef CONFIG_PXA_EZX + /* reserve the first page memory for exiting sleep and user off */ + reserve_bootmem_node(pgdat, PHYS_OFFSET, PAGE_SIZE); +#endif diff --git a/packages/linux/linux-ezx-2.6.21/ezx-emu.patch b/packages/linux/linux-ezx-2.6.21/ezx-emu.patch index 95fdd96fc1..91d99ee17b 100644 --- a/packages/linux/linux-ezx-2.6.21/ezx-emu.patch +++ b/packages/linux/linux-ezx-2.6.21/ezx-emu.patch @@ -1,7 +1,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-emu.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx-emu.c 2007-05-01 03:58:42.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-emu.c 2007-05-02 23:30:15.000000000 -0300 @@ -0,0 +1,215 @@ +/* + * EMU Driver for Motorola EZX phones @@ -151,7 +151,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-emu.c + return 0; +} + -+static int ezx_emu_suspend(struct platform_device *dev) ++static int ezx_emu_suspend(struct platform_device *dev, pm_message_t state) +{ + emu_switch_to_nothing(); + return 0; @@ -220,8 +220,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-emu.c +MODULE_LICENSE("GPL"); Index: linux-2.6.21/arch/arm/mach-pxa/Kconfig =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/Kconfig 2007-05-01 01:39:12.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/Kconfig 2007-05-01 02:07:23.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/Kconfig 2007-05-02 21:31:22.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Kconfig 2007-05-02 23:26:53.000000000 -0300 @@ -94,6 +94,27 @@ endchoice @@ -252,8 +252,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/Kconfig endmenu Index: linux-2.6.21/arch/arm/mach-pxa/Makefile =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-01 02:07:23.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-01 04:10:48.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-02 23:26:52.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-03 17:41:40.000000000 -0300 @@ -19,6 +19,7 @@ obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o obj-$(CONFIG_MACH_TOSA) += tosa.o @@ -264,8 +264,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/Makefile led-y := leds.o Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-01 02:07:23.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-01 02:07:23.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-02 23:26:52.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-03 17:25:08.000000000 -0300 @@ -35,6 +35,7 @@ #include #include diff --git a/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch b/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch index de64d722e9..a077ad5ffb 100644 --- a/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch +++ b/packages/linux/linux-ezx-2.6.21/ezx-pcap.patch @@ -1,8 +1,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c 2007-05-01 14:00:50.000000000 -0300 -@@ -0,0 +1,411 @@ ++++ linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c 2007-05-04 03:07:37.000000000 -0300 +@@ -0,0 +1,425 @@ +/* Driver for Motorola PCAP2 as present in EZX phones + * + * This is both a SPI device driver for PCAP itself, as well as @@ -51,7 +51,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + ezx_ssp_pcap_putget(value); + local_irq_enable(); + -+ DEBUGP("pcap write r%x: 0x%08x\n", reg_num, value); ++// DEBUGP("pcap write r%x: 0x%08x\n", reg_num, value); + return 0; +} +EXPORT_SYMBOL_GPL(ezx_pcap_write); @@ -65,7 +65,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + *value = ezx_ssp_pcap_putget(frame); + local_irq_enable(); + -+ DEBUGP("pcap read r%x: 0x%08x\n", reg_num, *value); ++// DEBUGP("pcap read r%x: 0x%08x\n", reg_num, *value); + return 0; +} +EXPORT_SYMBOL_GPL(ezx_pcap_read); @@ -121,12 +121,14 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + /* FIXME: this should be board-level, not chip-level */ + /* implement a per board pcap init reg array? */ + -+ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ISR_USB4VI, 1); -+ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_USB4VM, 0); -+ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ISR_USB1VI, 1); -+ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_USB1VM, 0); ++// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ISR_USB4VI, 1); ++// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_USB4VM, 0); ++// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ISR_USB1VI, 1); ++// ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_USB1VM, 0); + // disable all interrupts -+ //ezx_pcap_write(SSP_PCAP_ADJ_MSR_REGISTER, 0x03ffffff); ++ ezx_pcap_write(SSP_PCAP_ADJ_MSR_REGISTER, PCAP_MASK_ALL_INTERRUPT); ++ // clear all interrupts ++ ezx_pcap_write(SSP_PCAP_ADJ_ISR_REGISTER, PCAP_MASK_ALL_INTERRUPT); + + ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_AUD_RX_AMPS_A1CTRL, 1); + ezx_pcap_vibrator_level(PCAP_VIBRATOR_VOLTAGE_LEVEL3); @@ -288,12 +290,12 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c +{ + int i; + const unsigned int cpu = smp_processor_id(); -+ u_int32_t reg; -+ -+ DEBUGP("pcap_irq_demux_handler(%u,,) entered\n", irq); ++ u_int32_t reg, mask; + + spin_lock(&desc->lock); + ++ DEBUGP("pcap_irq_demux_handler(%u,,) entered\n", irq); ++ + desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); + + if (unlikely(desc->status & IRQ_INPROGRESS)) { @@ -305,6 +307,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + } + + kstat_cpu(cpu).irqs[irq]++; ++ desc->chip->ack(irq); + desc->status |= IRQ_INPROGRESS; + + do { @@ -317,30 +320,27 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + } + + desc->status &= ~IRQ_PENDING; -+ spin_unlock(&desc->lock); + -+ ezx_pcap_read(SSP_PCAP_ADJ_ISR_REGISTER, ®); -+ DEBUGP("pcap_irq_demux_handler: ISR=0x%08x\n", reg); ++ ezx_pcap_read(SSP_PCAP_ADJ_ISR_REGISTER, ®); ++ ezx_pcap_read(SSP_PCAP_ADJ_MSR_REGISTER, &mask); ++ DEBUGP("pcap_irq_demux_handler: ISR=0x%08x MSR=0x%08x\n", reg, mask); + + for (i = ARRAY_SIZE(pcap2irq)-1; i >= 0; i--) { + unsigned int pirq = pcap2irq[i]; + if (pirq == 0) + continue; + -+ if (reg & (1 << i)) { ++ if ((reg & (1 << i)) && !(mask & (1 << i))) { + struct irq_desc *subdesc; + DEBUGP("found irq %u\n", pirq); + subdesc = irq_desc + pirq; -+ -+ // acknowledge pcap irq -+ // do just one pcap irq each time + subdesc->chip->ack(pirq); -+ i = 0; + ++ spin_unlock(&desc->lock); + handle_IRQ_event(pirq, subdesc->action); ++ spin_lock(&desc->lock); + } + } -+ spin_lock(&desc->lock); + + } while ((desc->status & (IRQ_PENDING | IRQ_DISABLED)) == IRQ_PENDING); + @@ -387,9 +387,23 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c + return 0; +} + ++static int ezx_pcap_suspend(struct platform_device *dev, pm_message_t state) ++{ ++ DEBUGP("pcap suspend!\n"); ++ return 0; ++} ++ ++static int ezx_pcap_resume(struct platform_device *dev) ++{ ++ DEBUGP("pcap resume!\n"); ++ return 0; ++} ++ +static struct platform_driver ezxpcap_driver = { + .probe = ezx_pcap_probe, + .remove = ezx_pcap_remove, ++ .suspend = ezx_pcap_suspend, ++ .resume = ezx_pcap_resume, + .driver = { + .name = "ezx-pcap", + .owner = THIS_MODULE, @@ -417,7 +431,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/ezx-pcap.c Index: linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h 2007-05-01 14:00:50.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h 2007-05-03 17:43:48.000000000 -0300 @@ -0,0 +1,665 @@ +/* (c) Copyright Motorola Beijing 2002 all rights reserved. + @@ -1086,8 +1100,8 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/ezx-pcap.h +#endif Index: linux-2.6.21/include/asm-arm/arch-pxa/irqs.h =================================================================== ---- linux-2.6.21.orig/include/asm-arm/arch-pxa/irqs.h 2007-05-01 14:00:24.000000000 -0300 -+++ linux-2.6.21/include/asm-arm/arch-pxa/irqs.h 2007-05-01 14:00:50.000000000 -0300 +--- linux-2.6.21.orig/include/asm-arm/arch-pxa/irqs.h 2007-05-03 17:41:55.000000000 -0300 ++++ linux-2.6.21/include/asm-arm/arch-pxa/irqs.h 2007-05-03 17:43:48.000000000 -0300 @@ -176,7 +176,8 @@ #define NR_IRQS (IRQ_LOCOMO_SPI_TEND + 1) #elif defined(CONFIG_ARCH_LUBBOCK) || \ @@ -1117,8 +1131,8 @@ Index: linux-2.6.21/include/asm-arm/arch-pxa/irqs.h + Index: linux-2.6.21/arch/arm/mach-pxa/Makefile =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-01 14:00:48.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-01 14:00:50.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/Makefile 2007-05-03 17:42:02.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/Makefile 2007-05-04 04:17:33.000000000 -0300 @@ -18,7 +18,7 @@ obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o obj-$(CONFIG_MACH_POODLE) += poodle.o corgi_ssp.o @@ -1130,8 +1144,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/Makefile led-y := leds.o Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-01 14:00:48.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-01 14:00:50.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-03 17:42:02.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-04 04:17:33.000000000 -0300 @@ -72,6 +72,24 @@ .clk_pcap = 1, }; diff --git a/packages/linux/linux-ezx-2.6.21/ezx-pm.patch b/packages/linux/linux-ezx-2.6.21/ezx-pm.patch index 2b498c8b8c..4ad66936c9 100644 --- a/packages/linux/linux-ezx-2.6.21/ezx-pm.patch +++ b/packages/linux/linux-ezx-2.6.21/ezx-pm.patch @@ -1,7 +1,7 @@ Index: linux-2.6.21/arch/arm/mach-pxa/pxa27x.c =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/pxa27x.c 2007-04-26 00:08:32.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/pxa27x.c 2007-04-30 18:29:49.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/pxa27x.c 2007-05-03 17:41:39.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/pxa27x.c 2007-05-03 17:43:42.000000000 -0300 @@ -22,6 +22,10 @@ #include #include @@ -29,8 +29,8 @@ Index: linux-2.6.21/arch/arm/mach-pxa/pxa27x.c } Index: linux-2.6.21/arch/arm/mach-pxa/pm.c =================================================================== ---- linux-2.6.21.orig/arch/arm/mach-pxa/pm.c 2007-04-26 00:08:32.000000000 -0300 -+++ linux-2.6.21/arch/arm/mach-pxa/pm.c 2007-04-30 18:29:49.000000000 -0300 +--- linux-2.6.21.orig/arch/arm/mach-pxa/pm.c 2007-05-03 17:41:39.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/pm.c 2007-05-04 03:51:15.000000000 -0300 @@ -24,6 +24,10 @@ #include #include diff --git a/packages/linux/linux-ezx-2.6.21/pcap-ts.patch b/packages/linux/linux-ezx-2.6.21/pcap-ts.patch new file mode 100644 index 0000000000..a07ec1abe9 --- /dev/null +++ b/packages/linux/linux-ezx-2.6.21/pcap-ts.patch @@ -0,0 +1,450 @@ +Index: linux-2.6.21/drivers/input/touchscreen/Kconfig +=================================================================== +--- linux-2.6.21.orig/drivers/input/touchscreen/Kconfig 2007-05-03 17:39:18.000000000 -0300 ++++ linux-2.6.21/drivers/input/touchscreen/Kconfig 2007-05-03 17:44:12.000000000 -0300 +@@ -164,4 +164,13 @@ + To compile this driver as a module, choose M here: the + module will be called ucb1400_ts. + ++config TOUCHSCREEN_PCAP ++ tristate "Motorola PCAP touchscreen" ++ depends on PXA_EZX ++ help ++ Say Y here if you have a Motorola EZX telephone and ++ want to support the built-in touchscreen. ++ ++ If unsure, say N. ++ + endif +Index: linux-2.6.21/drivers/input/touchscreen/pcap_ts.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.21/drivers/input/touchscreen/pcap_ts.c 2007-05-04 04:17:22.000000000 -0300 +@@ -0,0 +1,372 @@ ++/* ++ * pcap_ts.c - Touchscreen driver for Motorola PCAP2 based touchscreen as found ++ * in the EZX phone platform. ++ * ++ * Copyright (C) 2006 Harald Welte ++ * ++ * Based on information found in the original Motorola 2.4.x ezx-ts.c driver. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * May 3, 2007 - Daniel Ribeiro ++ * Major cleanup ++ * PM Callbacks ++ * ++ * TODO: ++ * split this in a hardirq handler and a tasklet/bh ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#if 0 ++#define DEBUGP(x, args ...) printk(x, ## args) ++#else ++#define DEBUGP(x, args ...) ++#endif ++ ++#define PRESSURE 1 ++#define COORDINATE 2 ++#define STANDBY 3 ++ ++struct pcap_ts { ++ int irq_xy; ++ int irq_touch; ++ struct input_dev *input; ++ struct timer_list timer; ++ ++ u_int16_t x, y; ++ u_int16_t pressure; ++ ++ u_int8_t read_state; ++}; ++ ++#define X_AXIS_MIN 0 ++#define X_AXIS_MAX 1023 ++ ++#define Y_AXIS_MAX X_AXIS_MAX ++#define Y_AXIS_MIN X_AXIS_MIN ++ ++#define PRESSURE_MAX X_AXIS_MAX ++#define PRESSURE_MIN X_AXIS_MIN ++ ++/* if we try to read faster, pressure reading becomes unreliable */ ++#define SAMPLE_INTERVAL (HZ/50) ++ ++ ++static void pcap_ts_mode(u_int32_t mode) ++{ ++ u_int32_t tmp; ++ ++ ezx_pcap_read(SSP_PCAP_ADJ_ADC1_REGISTER, &tmp); ++ tmp &= ~SSP_PCAP_TOUCH_PANEL_POSITION_DETECT_MODE_MASK; ++ tmp |= mode; ++ ezx_pcap_write(SSP_PCAP_ADJ_ADC1_REGISTER, tmp); ++} ++ ++/* issue a XY read command to the ADC of PCAP2. Well get an ADCDONE2 interrupt ++ * once the result of the conversion is available */ ++static void pcap_ts_start_xy_read(struct pcap_ts *pcap_ts) ++{ ++ u_int32_t tmp; ++ ++ ezx_pcap_read(SSP_PCAP_ADJ_ADC1_REGISTER, &tmp); ++ tmp &= SSP_PCAP_ADC_START_VALUE_SET_MASK; ++ tmp |= SSP_PCAP_ADC_START_VALUE; ++ ezx_pcap_write(SSP_PCAP_ADJ_ADC1_REGISTER, tmp); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ADC2_ASC, 1); ++} ++ ++/* read the XY result from the ADC of PCAP2 */ ++static void pcap_ts_get_xy_value(struct pcap_ts *pcap_ts) ++{ ++ u_int32_t tmp; ++ ++ ezx_pcap_read(SSP_PCAP_ADJ_ADC2_REGISTER, &tmp); ++ ++ if (pcap_ts->read_state == COORDINATE && !(tmp & 0x00400000)) { ++ pcap_ts->x = (tmp & SSP_PCAP_ADD1_VALUE_MASK); ++ pcap_ts->y = (tmp & SSP_PCAP_ADD2_VALUE_MASK) ++ >>SSP_PCAP_ADD2_VALUE_SHIFT; ++ } else { ++ pcap_ts->pressure = (tmp & SSP_PCAP_ADD2_VALUE_MASK) ++ >>SSP_PCAP_ADD2_VALUE_SHIFT; ++ } ++ ++} ++ ++/* PCAP2 interrupts us when ADC conversion result is available */ ++static irqreturn_t pcap_ts_irq_xy(int irq, void *dev_id) ++{ ++ struct pcap_ts *pcap_ts = dev_id; ++ ++ pcap_ts_get_xy_value(pcap_ts); ++ DEBUGP(KERN_DEBUG "%s X=%4d, Y=%4d Z=%4d ", ++ pcap_ts->read_state == COORDINATE ? "COORD" : "PRESS", ++ pcap_ts->x, pcap_ts->y, pcap_ts->pressure); ++ ++ switch (pcap_ts->read_state) { ++ case PRESSURE: ++ if (pcap_ts->pressure >= PRESSURE_MAX || ++ pcap_ts->pressure <= PRESSURE_MIN ) { ++ /* pen has been released (or cant read pressure - WM)*/ ++ DEBUGP("UP\n"); ++ /* do nothing */ ++ } else { ++ /* pen has been touched down */ ++ DEBUGP("DOWN\n"); ++ input_report_key(pcap_ts->input, BTN_TOUCH, 1); ++ input_report_abs(pcap_ts->input, ABS_PRESSURE, pcap_ts->pressure); ++ } ++ /* switch state machine into coordinate read mode */ ++ pcap_ts->read_state = COORDINATE; ++ pcap_ts_mode(PCAP_TS_POSITION_XY_MEASUREMENT); ++ pcap_ts_start_xy_read(pcap_ts); ++ break; ++ case COORDINATE: ++ if (pcap_ts->x <= X_AXIS_MIN || pcap_ts->x >= X_AXIS_MAX || ++ pcap_ts->y <= Y_AXIS_MIN || pcap_ts->y >= Y_AXIS_MAX) { ++ /* pen has been released */ ++ DEBUGP("UP END\n"); ++ ++ input_report_key(pcap_ts->input, BTN_TOUCH, 0); ++ input_report_abs(pcap_ts->input, ABS_PRESSURE, 0); ++ ++ /* no need for timer, we'll get interrupted with ++ * next touch down event */ ++ del_timer(&pcap_ts->timer); ++ ++ /* ask PCAP2 to interrupt us if touch event happens ++ * again */ ++ pcap_ts->read_state = STANDBY; ++ pcap_ts_mode(PCAP_TS_STANDBY_MODE); ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_TSM, 0); ++ } else { ++ DEBUGP("DOWN\n"); ++ input_report_abs(pcap_ts->input, ABS_X, pcap_ts->x); ++ input_report_abs(pcap_ts->input, ABS_Y, pcap_ts->y); ++ ++ /* switch back to pressure read mode */ ++ pcap_ts->read_state = PRESSURE; ++ pcap_ts_mode(PCAP_TS_PRESSURE_MEASUREMENT); ++ mod_timer(&pcap_ts->timer, jiffies + SAMPLE_INTERVAL); ++ } ++ input_sync(pcap_ts->input); ++ break; ++ default: ++ DEBUGP("ERROR\n"); ++ break; ++ } ++ ++ return IRQ_HANDLED; ++} ++ ++/* PCAP2 interrupts us if the pen touches down (interrupts also on pen up - WM)*/ ++static irqreturn_t pcap_ts_irq_touch(int irq, void *dev_id) ++{ ++ struct pcap_ts *pcap_ts = dev_id; ++ ++ /* mask Touchscreen interrupt bit, prevents further touch events ++ * from being reported to us until we're finished with reading ++ * both pressure and x/y from ADC */ ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_TSM, 1); ++ ++ DEBUGP("touched!!\n"); ++ pcap_ts_mode(PCAP_TS_PRESSURE_MEASUREMENT); ++ pcap_ts->read_state = PRESSURE; ++ pcap_ts_start_xy_read(pcap_ts); ++ ++ return IRQ_HANDLED; ++} ++ ++static void pcap_ts_timer_fn(unsigned long data) ++{ ++ struct pcap_ts *pcap_ts = (struct pcap_ts *) data; ++ ++ pcap_ts_start_xy_read(pcap_ts); ++} ++ ++static int __init ezxts_probe(struct platform_device *pdev) ++{ ++ int ret; ++ u_int32_t tmp; ++ struct pcap_ts *pcap_ts; ++ struct input_dev *input_dev; ++ int err = -ENOMEM; ++ ++ pcap_ts = kzalloc(sizeof(*pcap_ts), GFP_KERNEL); ++ input_dev = input_allocate_device(); ++ if (!pcap_ts || !input_dev) ++ goto fail; ++ ++ pcap_ts->irq_xy = platform_get_irq(pdev, 0); ++ if (pcap_ts->irq_xy < 0) { ++ err = pcap_ts->irq_xy; ++ goto fail; ++ } ++ ++ pcap_ts->irq_touch = platform_get_irq(pdev, 1); ++ if (pcap_ts->irq_touch < 0) { ++ err = pcap_ts->irq_touch; ++ goto fail; ++ } ++ ++ // Some initialization before done in ssp_pcap_open() ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_TS_REFENB, 0); ++ // ack interrupts ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ISR_ADCDONE2I, 1); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ISR_TSI, 1); ++ // unmask interrupts ++ // ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_MSR_TSM, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_MSR_ADCDONE2M, 0); ++ // set adc bits? FIXME I dont think its necessary - WM ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC2_ADINC1, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC2_ADINC2, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_ATO0, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_ATO1, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_ATO2, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_ATO3, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_ATOX, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_MTR1, 0); ++ ezx_pcap_bit_set( SSP_PCAP_ADJ_BIT_ADC1_MTR2, 0); ++ ++ ret = ezx_pcap_read(SSP_PCAP_ADJ_ADC1_REGISTER, &tmp); ++ if (ret < 0) ++ return ret; ++ ++ tmp &= (~SSP_PCAP_TOUCH_PANEL_POSITION_DETECT_MODE_MASK); ++ tmp |= PCAP_TS_STANDBY_MODE; ++ ++ ret = ezx_pcap_write(SSP_PCAP_ADJ_ADC1_REGISTER, tmp); ++ if (ret < 0) ++ return ret; ++ ++ err = request_irq(pcap_ts->irq_xy, pcap_ts_irq_xy, SA_INTERRUPT, ++ "PCAP Touchscreen XY", pcap_ts); ++ if (err < 0) { ++ printk(KERN_ERR "pcap_ts: can't grab xy irq %d: %d\n", ++ pcap_ts->irq_xy, err); ++ goto fail; ++ } ++ ++ err = request_irq(pcap_ts->irq_touch, pcap_ts_irq_touch, SA_INTERRUPT, ++ "PCAP Touchscreen Touch", pcap_ts); ++ if (err < 0) { ++ printk(KERN_ERR "pcap_ts: can't grab touch irq %d: %d\n", ++ pcap_ts->irq_touch, err); ++ goto fail_xy; ++ } ++ ++ pcap_ts->input = input_dev; ++ init_timer(&pcap_ts->timer); ++ pcap_ts->timer.data = (unsigned long) pcap_ts; ++ pcap_ts->timer.function = &pcap_ts_timer_fn; ++ ++ platform_set_drvdata(pdev, pcap_ts); ++ ++ pcap_ts->read_state = STANDBY; ++ pcap_ts_mode(PCAP_TS_STANDBY_MODE); ++ ++ /* enable pressure interrupt */ ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_TSM, 0); ++ ++ input_dev->name = "EZX PCAP2 Touchscreen"; ++ input_dev->phys = "ezxts/input0"; ++ input_dev->id.bustype = BUS_HOST; ++ input_dev->id.vendor = 0x0001; ++ input_dev->id.product = 0x0002; ++ input_dev->id.version = 0x0100; ++ input_dev->cdev.dev = &pdev->dev; ++ input_dev->private = pcap_ts; ++ ++ input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); ++ input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); ++ input_set_abs_params(input_dev, ABS_X, X_AXIS_MIN, X_AXIS_MAX, 0, 0); ++ input_set_abs_params(input_dev, ABS_Y, Y_AXIS_MIN, Y_AXIS_MAX, 0, 0); ++ input_set_abs_params(input_dev, ABS_PRESSURE, PRESSURE_MIN, ++ PRESSURE_MAX, 0, 0); ++ ++ input_register_device(pcap_ts->input); ++ ++ return 0; ++ ++fail_xy: ++ free_irq(pcap_ts->irq_xy, pcap_ts); ++fail: ++ input_free_device(input_dev); ++ kfree(pcap_ts); ++ ++ return err; ++} ++ ++static int ezxts_remove(struct platform_device *pdev) ++{ ++ struct pcap_ts *pcap_ts = platform_get_drvdata(pdev); ++ ++ del_timer_sync(&pcap_ts->timer); ++ ++ free_irq(pcap_ts->irq_touch, pcap_ts); ++ free_irq(pcap_ts->irq_xy, pcap_ts); ++ ++ input_unregister_device(pcap_ts->input); ++ kfree(pcap_ts); ++ ++ return 0; ++} ++ ++static int ezxts_suspend(struct platform_device *dev, pm_message_t state) ++{ ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ADC1_TS_REF_LOWPWR, 1); ++ return 0; ++} ++ ++static int ezxts_resume(struct platform_device *dev) ++{ ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_ADC1_TS_REF_LOWPWR, 0); ++ /* just in case we suspend with TSI masked. */ ++ ezx_pcap_bit_set(SSP_PCAP_ADJ_BIT_MSR_TSM, 0); ++ return 0; ++} ++ ++ ++static struct platform_driver ezxts_driver = { ++ .probe = ezxts_probe, ++ .remove = ezxts_remove, ++ .suspend = ezxts_suspend, ++ .resume = ezxts_resume, ++ .driver = { ++ .name = "pcap-ts", ++ .owner = THIS_MODULE, ++ }, ++}; ++ ++static int __init ezxts_init(void) ++{ ++ return platform_driver_register(&ezxts_driver); ++} ++ ++static void __exit ezxts_exit(void) ++{ ++ platform_driver_unregister(&ezxts_driver); ++} ++ ++module_init(ezxts_init); ++module_exit(ezxts_exit); ++ ++MODULE_DESCRIPTION("Motorola PCAP2 touchscreen driver"); ++MODULE_AUTHOR("Harald Welte "); ++MODULE_LICENSE("GPL"); +Index: linux-2.6.21/arch/arm/mach-pxa/ezx.c +=================================================================== +--- linux-2.6.21.orig/arch/arm/mach-pxa/ezx.c 2007-05-03 19:09:25.000000000 -0300 ++++ linux-2.6.21/arch/arm/mach-pxa/ezx.c 2007-05-03 19:15:57.000000000 -0300 +@@ -116,8 +116,32 @@ + .resource = ezxemu_resources, + }; + +-/* OHCI Controller */ ++/* PCAP_TS */ ++struct resource pcap_ts_resources[] = { ++ [0] = { ++ .start = EZX_IRQ_ADCDONE2, ++ .end = EZX_IRQ_ADCDONE2, ++ .flags = IORESOURCE_IRQ, ++ }, ++ [1] = { ++ .start = EZX_IRQ_TS, ++ .end = EZX_IRQ_TS, ++ .flags = IORESOURCE_IRQ, ++ } ++}; + ++struct platform_device pcap_ts_device = { ++ .name = "pcap-ts", ++ .id = -1, ++ .dev = { ++ .parent = &ezxpcap_device.dev, ++ }, ++ .num_resources = ARRAY_SIZE(pcap_ts_resources), ++ .resource = pcap_ts_resources, ++}; ++ ++ ++/* OHCI Controller */ + static int ezx_ohci_init(struct device *dev) + { + /* for A780 support (connected with Neptune) */ +@@ -342,6 +366,7 @@ + &ezxpcap_device, + &ezxbp_device, + &ezxemu_device, ++ &pcap_ts_device, + }; + + static void __init a780_init(void) +Index: linux-2.6.21/drivers/input/touchscreen/Makefile +=================================================================== +--- linux-2.6.21.orig/drivers/input/touchscreen/Makefile 2007-05-03 18:50:12.000000000 -0300 ++++ linux-2.6.21/drivers/input/touchscreen/Makefile 2007-05-03 18:50:59.000000000 -0300 +@@ -16,3 +16,4 @@ + obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o + obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o + obj-$(CONFIG_TOUCHSCREEN_UCB1400) += ucb1400_ts.o ++obj-$(CONFIG_TOUCHSCREEN_PCAP) += pcap_ts.o diff --git a/packages/linux/linux-ezx_2.6.21.bb b/packages/linux/linux-ezx_2.6.21.bb index 28be2b8d17..35dc2dff5d 100644 --- a/packages/linux/linux-ezx_2.6.21.bb +++ b/packages/linux/linux-ezx_2.6.21.bb @@ -5,7 +5,7 @@ HOMEPAGE = "http://www.openezx.org" LICENSE = "GPL" DEPENDS += "quilt-native" EZX = "ezx0" -PR = "${EZX}-r3" +PR = "${EZX}-r4" inherit kernel @@ -18,6 +18,7 @@ RPSRC = "http://www.rpsys.net/openzaurus/patches/archive" SRC_URI = " \ ${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \ file://ezx-core.patch;patch=1 \ + file://ezx-pm.patch;patch=1 \ file://ezx-pcap.patch;patch=1 \ file://ezx-mci.patch;patch=1 \ file://pxa27x-udc-support.2.patch;patch=1 \ @@ -26,7 +27,7 @@ SRC_URI = " \ file://ezx-serial-bug-workaround.patch;patch=1 \ file://pxa-kbd.patch;patch=1 \ file://ezx-kbd.patch;patch=1 \ - file://ezx-pm.patch;patch=1 \ + file://pcap-ts.patch;patch=1 \ file://mux_cli.patch;patch=1 \ file://mux-fix.patch;patch=1 \ file://mux-fix-init-errorpath.patch;patch=1 \ @@ -38,9 +39,6 @@ SRC_URI = " \ file://mux-linux-2.6.21-fix.patch;patch=1 \ file://mux-ifdef-ezx-features.patch;patch=1 \ file://mux_debug.patch;patch=1 \ - file://ezx-ts.patch;patch=1 \ - file://pcap_ts.c.patch;patch=1 \ - file://touchscreen-fix-r0.patch;patch=1 \ file://logo_linux_clut224.ppm \ file://defconfig-a780 \ file://defconfig-e680 \ -- cgit v1.2.3 From 4e64c8dfdb92fa358349c24969c617039ab88cd3 Mon Sep 17 00:00:00 2001 From: Leon Woestenberg Date: Sun, 6 May 2007 15:32:33 +0000 Subject: linux-efika: Add kernel 2.6.20.11 with CFS scheduler. --- .../linux/linux-efika-2.6.20.11/.mtn2git_empty | 0 .../sched-cfs-v9-v2.6.20.11.patch | 5590 ++++++++++++++++++++ packages/linux/linux-efika_2.6.20.11.bb | 86 + 3 files changed, 5676 insertions(+) create mode 100644 packages/linux/linux-efika-2.6.20.11/.mtn2git_empty create mode 100644 packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch create mode 100644 packages/linux/linux-efika_2.6.20.11.bb (limited to 'packages/linux') diff --git a/packages/linux/linux-efika-2.6.20.11/.mtn2git_empty b/packages/linux/linux-efika-2.6.20.11/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch b/packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch new file mode 100644 index 0000000000..29071a99ac --- /dev/null +++ b/packages/linux/linux-efika-2.6.20.11/sched-cfs-v9-v2.6.20.11.patch @@ -0,0 +1,5590 @@ +This is the Complete Fair Scheduler (CFS) v9 patch for +linux 2.6.20.10 patch (rediffed cleanly against .11). + +http://people.redhat.com/mingo/cfs-scheduler/ + +Index: linux-cfs-2.6.20.8.q/Documentation/kernel-parameters.txt +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/Documentation/kernel-parameters.txt ++++ linux-cfs-2.6.20.8.q/Documentation/kernel-parameters.txt +@@ -914,49 +914,6 @@ and is between 256 and 4096 characters. + + mga= [HW,DRM] + +- migration_cost= +- [KNL,SMP] debug: override scheduler migration costs +- Format: ,,... +- This debugging option can be used to override the +- default scheduler migration cost matrix. The numbers +- are indexed by 'CPU domain distance'. +- E.g. migration_cost=1000,2000,3000 on an SMT NUMA +- box will set up an intra-core migration cost of +- 1 msec, an inter-core migration cost of 2 msecs, +- and an inter-node migration cost of 3 msecs. +- +- WARNING: using the wrong values here can break +- scheduler performance, so it's only for scheduler +- development purposes, not production environments. +- +- migration_debug= +- [KNL,SMP] migration cost auto-detect verbosity +- Format=<0|1|2> +- If a system's migration matrix reported at bootup +- seems erroneous then this option can be used to +- increase verbosity of the detection process. +- We default to 0 (no extra messages), 1 will print +- some more information, and 2 will be really +- verbose (probably only useful if you also have a +- serial console attached to the system). +- +- migration_factor= +- [KNL,SMP] multiply/divide migration costs by a factor +- Format= +- This debug option can be used to proportionally +- increase or decrease the auto-detected migration +- costs for all entries of the migration matrix. +- E.g. migration_factor=150 will increase migration +- costs by 50%. (and thus the scheduler will be less +- eager migrating cache-hot tasks) +- migration_factor=80 will decrease migration costs +- by 20%. (thus the scheduler will be more eager to +- migrate tasks) +- +- WARNING: using the wrong values here can break +- scheduler performance, so it's only for scheduler +- development purposes, not production environments. +- + mousedev.tap_time= + [MOUSE] Maximum time between finger touching and + leaving touchpad surface for touch to be considered +Index: linux-cfs-2.6.20.8.q/Documentation/sched-design-CFS.txt +=================================================================== +--- /dev/null ++++ linux-cfs-2.6.20.8.q/Documentation/sched-design-CFS.txt +@@ -0,0 +1,107 @@ ++[announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS] ++ ++i'm pleased to announce the first release of the "Modular Scheduler Core ++and Completely Fair Scheduler [CFS]" patchset: ++ ++ http://redhat.com/~mingo/cfs-scheduler/ ++ ++This project is a complete rewrite of the Linux task scheduler. My goal ++is to address various feature requests and to fix deficiencies in the ++vanilla scheduler that were suggested/found in the past few years, both ++for desktop scheduling and for server scheduling workloads. ++ ++[ QuickStart: apply the patch, recompile, reboot. The new scheduler ++ will be active by default and all tasks will default to the ++ SCHED_NORMAL interactive scheduling class. ] ++ ++Highlights are: ++ ++ - the introduction of Scheduling Classes: an extensible hierarchy of ++ scheduler modules. These modules encapsulate scheduling policy ++ details and are handled by the scheduler core without the core ++ code assuming about them too much. ++ ++ - sched_fair.c implements the 'CFS desktop scheduler': it is a ++ replacement for the vanilla scheduler's SCHED_OTHER interactivity ++ code. ++ ++ i'd like to give credit to Con Kolivas for the general approach here: ++ he has proven via RSDL/SD that 'fair scheduling' is possible and that ++ it results in better desktop scheduling. Kudos Con! ++ ++ The CFS patch uses a completely different approach and implementation ++ from RSDL/SD. My goal was to make CFS's interactivity quality exceed ++ that of RSDL/SD, which is a high standard to meet :-) Testing ++ feedback is welcome to decide this one way or another. [ and, in any ++ case, all of SD's logic could be added via a kernel/sched_sd.c module ++ as well, if Con is interested in such an approach. ] ++ ++ CFS's design is quite radical: it does not use runqueues, it uses a ++ time-ordered rbtree to build a 'timeline' of future task execution, ++ and thus has no 'array switch' artifacts (by which both the vanilla ++ scheduler and RSDL/SD are affected). ++ ++ CFS uses nanosecond granularity accounting and does not rely on any ++ jiffies or other HZ detail. Thus the CFS scheduler has no notion of ++ 'timeslices' and has no heuristics whatsoever. There is only one ++ central tunable: ++ ++ /proc/sys/kernel/sched_granularity_ns ++ ++ which can be used to tune the scheduler from 'desktop' (low ++ latencies) to 'server' (good batching) workloads. It defaults to a ++ setting suitable for desktop workloads. SCHED_BATCH is handled by the ++ CFS scheduler module too. ++ ++ due to its design, the CFS scheduler is not prone to any of the ++ 'attacks' that exist today against the heuristics of the stock ++ scheduler: fiftyp.c, thud.c, chew.c, ring-test.c, massive_intr.c all ++ work fine and do not impact interactivity and produce the expected ++ behavior. ++ ++ the CFS scheduler has a much stronger handling of nice levels and ++ SCHED_BATCH: both types of workloads should be isolated much more ++ agressively than under the vanilla scheduler. ++ ++ ( another rdetail: due to nanosec accounting and timeline sorting, ++ sched_yield() support is very simple under CFS, and in fact under ++ CFS sched_yield() behaves much better than under any other ++ scheduler i have tested so far. ) ++ ++ - sched_rt.c implements SCHED_FIFO and SCHED_RR semantics, in a simpler ++ way than the vanilla scheduler does. It uses 100 runqueues (for all ++ 100 RT priority levels, instead of 140 in the vanilla scheduler) ++ and it needs no expired array. ++ ++ - reworked/sanitized SMP load-balancing: the runqueue-walking ++ assumptions are gone from the load-balancing code now, and ++ iterators of the scheduling modules are used. The balancing code got ++ quite a bit simpler as a result. ++ ++the core scheduler got smaller by more than 700 lines: ++ ++ kernel/sched.c | 1454 ++++++++++++++++------------------------------------------------ ++ 1 file changed, 372 insertions(+), 1082 deletions(-) ++ ++and even adding all the scheduling modules, the total size impact is ++relatively small: ++ ++ 18 files changed, 1454 insertions(+), 1133 deletions(-) ++ ++most of the increase is due to extensive comments. The kernel size ++impact is in fact a small negative: ++ ++ text data bss dec hex filename ++ 23366 4001 24 27391 6aff kernel/sched.o.vanilla ++ 24159 2705 56 26920 6928 kernel/sched.o.CFS ++ ++(this is mainly due to the benefit of getting rid of the expired array ++and its data structure overhead.) ++ ++thanks go to Thomas Gleixner and Arjan van de Ven for review of this ++patchset. ++ ++as usual, any sort of feedback, bugreports, fixes and suggestions are ++more than welcome, ++ ++ Ingo +Index: linux-cfs-2.6.20.8.q/Makefile +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/Makefile ++++ linux-cfs-2.6.20.8.q/Makefile +@@ -1,7 +1,7 @@ + VERSION = 2 + PATCHLEVEL = 6 + SUBLEVEL = 20 +-EXTRAVERSION = .11 ++EXTRAVERSION = .11-cfs-v9 + NAME = Homicidal Dwarf Hamster + + # *DOCUMENTATION* +Index: linux-cfs-2.6.20.8.q/arch/i386/kernel/smpboot.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/i386/kernel/smpboot.c ++++ linux-cfs-2.6.20.8.q/arch/i386/kernel/smpboot.c +@@ -1132,18 +1132,6 @@ exit: + } + #endif + +-static void smp_tune_scheduling(void) +-{ +- unsigned long cachesize; /* kB */ +- +- if (cpu_khz) { +- cachesize = boot_cpu_data.x86_cache_size; +- +- if (cachesize > 0) +- max_cache_size = cachesize * 1024; +- } +-} +- + /* + * Cycle through the processors sending APIC IPIs to boot each. + */ +@@ -1172,7 +1160,6 @@ static void __init smp_boot_cpus(unsigne + x86_cpu_to_apicid[0] = boot_cpu_physical_apicid; + + current_thread_info()->cpu = 0; +- smp_tune_scheduling(); + + set_cpu_sibling_map(0); + +Index: linux-cfs-2.6.20.8.q/arch/i386/kernel/syscall_table.S +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/i386/kernel/syscall_table.S ++++ linux-cfs-2.6.20.8.q/arch/i386/kernel/syscall_table.S +@@ -319,3 +319,4 @@ ENTRY(sys_call_table) + .long sys_move_pages + .long sys_getcpu + .long sys_epoll_pwait ++ .long sys_sched_yield_to /* 320 */ +Index: linux-cfs-2.6.20.8.q/arch/i386/kernel/tsc.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/i386/kernel/tsc.c ++++ linux-cfs-2.6.20.8.q/arch/i386/kernel/tsc.c +@@ -61,6 +61,8 @@ static inline int check_tsc_unstable(voi + + void mark_tsc_unstable(void) + { ++ sched_clock_unstable_event(); ++ + tsc_unstable = 1; + } + EXPORT_SYMBOL_GPL(mark_tsc_unstable); +@@ -107,13 +109,7 @@ unsigned long long sched_clock(void) + { + unsigned long long this_offset; + +- /* +- * in the NUMA case we dont use the TSC as they are not +- * synchronized across all CPUs. +- */ +-#ifndef CONFIG_NUMA +- if (!cpu_khz || check_tsc_unstable()) +-#endif ++ if (!cpu_khz || !cpu_has_tsc) + /* no locking but a rare wrong value is not a big deal */ + return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ); + +Index: linux-cfs-2.6.20.8.q/arch/ia64/kernel/setup.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/ia64/kernel/setup.c ++++ linux-cfs-2.6.20.8.q/arch/ia64/kernel/setup.c +@@ -773,7 +773,6 @@ static void __cpuinit + get_max_cacheline_size (void) + { + unsigned long line_size, max = 1; +- unsigned int cache_size = 0; + u64 l, levels, unique_caches; + pal_cache_config_info_t cci; + s64 status; +@@ -803,8 +802,6 @@ get_max_cacheline_size (void) + line_size = 1 << cci.pcci_line_size; + if (line_size > max) + max = line_size; +- if (cache_size < cci.pcci_cache_size) +- cache_size = cci.pcci_cache_size; + if (!cci.pcci_unified) { + status = ia64_pal_cache_config_info(l, + /* cache_type (instruction)= */ 1, +@@ -821,9 +818,6 @@ get_max_cacheline_size (void) + ia64_i_cache_stride_shift = cci.pcci_stride; + } + out: +-#ifdef CONFIG_SMP +- max_cache_size = max(max_cache_size, cache_size); +-#endif + if (max > ia64_max_cacheline_size) + ia64_max_cacheline_size = max; + } +Index: linux-cfs-2.6.20.8.q/arch/mips/kernel/smp.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/mips/kernel/smp.c ++++ linux-cfs-2.6.20.8.q/arch/mips/kernel/smp.c +@@ -245,7 +245,6 @@ void __init smp_prepare_cpus(unsigned in + { + init_new_context(current, &init_mm); + current_thread_info()->cpu = 0; +- smp_tune_scheduling(); + plat_prepare_cpus(max_cpus); + #ifndef CONFIG_HOTPLUG_CPU + cpu_present_map = cpu_possible_map; +Index: linux-cfs-2.6.20.8.q/arch/sparc/kernel/smp.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/sparc/kernel/smp.c ++++ linux-cfs-2.6.20.8.q/arch/sparc/kernel/smp.c +@@ -69,16 +69,6 @@ void __cpuinit smp_store_cpu_info(int id + cpu_data(id).prom_node = cpu_node; + cpu_data(id).mid = cpu_get_hwmid(cpu_node); + +- /* this is required to tune the scheduler correctly */ +- /* is it possible to have CPUs with different cache sizes? */ +- if (id == boot_cpu_id) { +- int cache_line,cache_nlines; +- cache_line = 0x20; +- cache_line = prom_getintdefault(cpu_node, "ecache-line-size", cache_line); +- cache_nlines = 0x8000; +- cache_nlines = prom_getintdefault(cpu_node, "ecache-nlines", cache_nlines); +- max_cache_size = cache_line * cache_nlines; +- } + if (cpu_data(id).mid < 0) + panic("No MID found for CPU%d at node 0x%08d", id, cpu_node); + } +Index: linux-cfs-2.6.20.8.q/arch/sparc64/kernel/smp.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/arch/sparc64/kernel/smp.c ++++ linux-cfs-2.6.20.8.q/arch/sparc64/kernel/smp.c +@@ -1293,41 +1293,6 @@ int setup_profiling_timer(unsigned int m + return 0; + } + +-static void __init smp_tune_scheduling(void) +-{ +- struct device_node *dp; +- int instance; +- unsigned int def, smallest = ~0U; +- +- def = ((tlb_type == hypervisor) ? +- (3 * 1024 * 1024) : +- (4 * 1024 * 1024)); +- +- instance = 0; +- while (!cpu_find_by_instance(instance, &dp, NULL)) { +- unsigned int val; +- +- val = of_getintprop_default(dp, "ecache-size", def); +- if (val < smallest) +- smallest = val; +- +- instance++; +- } +- +- /* Any value less than 256K is nonsense. */ +- if (smallest < (256U * 1024U)) +- smallest = 256 * 1024; +- +- max_cache_size = smallest; +- +- if (smallest < 1U * 1024U * 1024U) +- printk(KERN_INFO "Using max_cache_size of %uKB\n", +- smallest / 1024U); +- else +- printk(KERN_INFO "Using max_cache_size of %uMB\n", +- smallest / 1024U / 1024U); +-} +- + /* Constrain the number of cpus to max_cpus. */ + void __init smp_prepare_cpus(unsigned int max_cpus) + { +@@ -1363,7 +1328,6 @@ void __init smp_prepare_cpus(unsigned in + } + + smp_store_cpu_info(boot_cpu_id); +- smp_tune_scheduling(); + } + + /* Set this up early so that things like the scheduler can init +Index: linux-cfs-2.6.20.8.q/fs/proc/array.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/fs/proc/array.c ++++ linux-cfs-2.6.20.8.q/fs/proc/array.c +@@ -165,7 +165,6 @@ static inline char * task_state(struct t + rcu_read_lock(); + buffer += sprintf(buffer, + "State:\t%s\n" +- "SleepAVG:\t%lu%%\n" + "Tgid:\t%d\n" + "Pid:\t%d\n" + "PPid:\t%d\n" +@@ -173,9 +172,8 @@ static inline char * task_state(struct t + "Uid:\t%d\t%d\t%d\t%d\n" + "Gid:\t%d\t%d\t%d\t%d\n", + get_task_state(p), +- (p->sleep_avg/1024)*100/(1020000000/1024), +- p->tgid, p->pid, +- pid_alive(p) ? rcu_dereference(p->real_parent)->tgid : 0, ++ p->tgid, p->pid, ++ pid_alive(p) ? rcu_dereference(p->real_parent)->tgid : 0, + pid_alive(p) && p->ptrace ? rcu_dereference(p->parent)->pid : 0, + p->uid, p->euid, p->suid, p->fsuid, + p->gid, p->egid, p->sgid, p->fsgid); +@@ -312,6 +310,11 @@ int proc_pid_status(struct task_struct * + return buffer - orig; + } + ++int proc_pid_sched(struct task_struct *task, char *buffer) ++{ ++ return sched_print_task_state(task, buffer) - buffer; ++} ++ + static int do_task_stat(struct task_struct *task, char * buffer, int whole) + { + unsigned long vsize, eip, esp, wchan = ~0UL; +Index: linux-cfs-2.6.20.8.q/fs/proc/base.c +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/fs/proc/base.c ++++ linux-cfs-2.6.20.8.q/fs/proc/base.c +@@ -1839,6 +1839,7 @@ static struct pid_entry tgid_base_stuff[ + INF("environ", S_IRUSR, pid_environ), + INF("auxv", S_IRUSR, pid_auxv), + INF("status", S_IRUGO, pid_status), ++ INF("sched", S_IRUGO, pid_sched), + INF("cmdline", S_IRUGO, pid_cmdline), + INF("stat", S_IRUGO, tgid_stat), + INF("statm", S_IRUGO, pid_statm), +@@ -2121,6 +2122,7 @@ static struct pid_entry tid_base_stuff[] + INF("environ", S_IRUSR, pid_environ), + INF("auxv", S_IRUSR, pid_auxv), + INF("status", S_IRUGO, pid_status), ++ INF("sched", S_IRUGO, pid_sched), + INF("cmdline", S_IRUGO, pid_cmdline), + INF("stat", S_IRUGO, tid_stat), + INF("statm", S_IRUGO, pid_statm), +Index: linux-cfs-2.6.20.8.q/fs/proc/internal.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/fs/proc/internal.h ++++ linux-cfs-2.6.20.8.q/fs/proc/internal.h +@@ -36,6 +36,7 @@ extern int proc_exe_link(struct inode *, + extern int proc_tid_stat(struct task_struct *, char *); + extern int proc_tgid_stat(struct task_struct *, char *); + extern int proc_pid_status(struct task_struct *, char *); ++extern int proc_pid_sched(struct task_struct *, char *); + extern int proc_pid_statm(struct task_struct *, char *); + + extern struct file_operations proc_maps_operations; +Index: linux-cfs-2.6.20.8.q/include/asm-generic/bitops/sched.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-generic/bitops/sched.h ++++ linux-cfs-2.6.20.8.q/include/asm-generic/bitops/sched.h +@@ -6,28 +6,23 @@ + + /* + * Every architecture must define this function. It's the fastest +- * way of searching a 140-bit bitmap where the first 100 bits are +- * unlikely to be set. It's guaranteed that at least one of the 140 +- * bits is cleared. ++ * way of searching a 100-bit bitmap. It's guaranteed that at least ++ * one of the 100 bits is cleared. + */ + static inline int sched_find_first_bit(const unsigned long *b) + { + #if BITS_PER_LONG == 64 +- if (unlikely(b[0])) ++ if (b[0]) + return __ffs(b[0]); +- if (likely(b[1])) +- return __ffs(b[1]) + 64; +- return __ffs(b[2]) + 128; ++ return __ffs(b[1]) + 64; + #elif BITS_PER_LONG == 32 +- if (unlikely(b[0])) ++ if (b[0]) + return __ffs(b[0]); +- if (unlikely(b[1])) ++ if (b[1]) + return __ffs(b[1]) + 32; +- if (unlikely(b[2])) ++ if (b[2]) + return __ffs(b[2]) + 64; +- if (b[3]) +- return __ffs(b[3]) + 96; +- return __ffs(b[4]) + 128; ++ return __ffs(b[3]) + 96; + #else + #error BITS_PER_LONG not defined + #endif +Index: linux-cfs-2.6.20.8.q/include/asm-i386/topology.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-i386/topology.h ++++ linux-cfs-2.6.20.8.q/include/asm-i386/topology.h +@@ -85,7 +85,6 @@ static inline int node_to_first_cpu(int + .idle_idx = 1, \ + .newidle_idx = 2, \ + .wake_idx = 1, \ +- .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_EXEC \ + | SD_BALANCE_FORK \ +Index: linux-cfs-2.6.20.8.q/include/asm-i386/unistd.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-i386/unistd.h ++++ linux-cfs-2.6.20.8.q/include/asm-i386/unistd.h +@@ -325,10 +325,11 @@ + #define __NR_move_pages 317 + #define __NR_getcpu 318 + #define __NR_epoll_pwait 319 ++#define __NR_sched_yield_to 320 + + #ifdef __KERNEL__ + +-#define NR_syscalls 320 ++#define NR_syscalls 321 + + #define __ARCH_WANT_IPC_PARSE_VERSION + #define __ARCH_WANT_OLD_READDIR +Index: linux-cfs-2.6.20.8.q/include/asm-ia64/topology.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-ia64/topology.h ++++ linux-cfs-2.6.20.8.q/include/asm-ia64/topology.h +@@ -65,7 +65,6 @@ void build_cpu_to_node_map(void); + .max_interval = 4, \ + .busy_factor = 64, \ + .imbalance_pct = 125, \ +- .per_cpu_gain = 100, \ + .cache_nice_tries = 2, \ + .busy_idx = 2, \ + .idle_idx = 1, \ +@@ -97,7 +96,6 @@ void build_cpu_to_node_map(void); + .newidle_idx = 0, /* unused */ \ + .wake_idx = 1, \ + .forkexec_idx = 1, \ +- .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_EXEC \ + | SD_BALANCE_FORK \ +Index: linux-cfs-2.6.20.8.q/include/asm-mips/mach-ip27/topology.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-mips/mach-ip27/topology.h ++++ linux-cfs-2.6.20.8.q/include/asm-mips/mach-ip27/topology.h +@@ -28,7 +28,6 @@ extern unsigned char __node_distances[MA + .busy_factor = 32, \ + .imbalance_pct = 125, \ + .cache_nice_tries = 1, \ +- .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_EXEC \ + | SD_WAKE_BALANCE, \ +Index: linux-cfs-2.6.20.8.q/include/asm-powerpc/topology.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-powerpc/topology.h ++++ linux-cfs-2.6.20.8.q/include/asm-powerpc/topology.h +@@ -57,7 +57,6 @@ static inline int pcibus_to_node(struct + .busy_factor = 32, \ + .imbalance_pct = 125, \ + .cache_nice_tries = 1, \ +- .per_cpu_gain = 100, \ + .busy_idx = 3, \ + .idle_idx = 1, \ + .newidle_idx = 2, \ +Index: linux-cfs-2.6.20.8.q/include/asm-x86_64/topology.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-x86_64/topology.h ++++ linux-cfs-2.6.20.8.q/include/asm-x86_64/topology.h +@@ -43,7 +43,6 @@ extern int __node_distance(int, int); + .newidle_idx = 0, \ + .wake_idx = 1, \ + .forkexec_idx = 1, \ +- .per_cpu_gain = 100, \ + .flags = SD_LOAD_BALANCE \ + | SD_BALANCE_FORK \ + | SD_BALANCE_EXEC \ +Index: linux-cfs-2.6.20.8.q/include/asm-x86_64/unistd.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/asm-x86_64/unistd.h ++++ linux-cfs-2.6.20.8.q/include/asm-x86_64/unistd.h +@@ -619,8 +619,10 @@ __SYSCALL(__NR_sync_file_range, sys_sync + __SYSCALL(__NR_vmsplice, sys_vmsplice) + #define __NR_move_pages 279 + __SYSCALL(__NR_move_pages, sys_move_pages) ++#define __NR_sched_yield_to 280 ++__SYSCALL(__NR_sched_yield_to, sys_sched_yield_to) + +-#define __NR_syscall_max __NR_move_pages ++#define __NR_syscall_max __NR_sched_yield_to + + #ifndef __NO_STUBS + #define __ARCH_WANT_OLD_READDIR +Index: linux-cfs-2.6.20.8.q/include/linux/hardirq.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/linux/hardirq.h ++++ linux-cfs-2.6.20.8.q/include/linux/hardirq.h +@@ -79,6 +79,19 @@ + #endif + + #ifdef CONFIG_PREEMPT ++# define PREEMPT_CHECK_OFFSET 1 ++#else ++# define PREEMPT_CHECK_OFFSET 0 ++#endif ++ ++/* ++ * Check whether we were atomic before we did preempt_disable(): ++ * (used by the scheduler) ++ */ ++#define in_atomic_preempt_off() \ ++ ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) ++ ++#ifdef CONFIG_PREEMPT + # define preemptible() (preempt_count() == 0 && !irqs_disabled()) + # define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) + #else +Index: linux-cfs-2.6.20.8.q/include/linux/ktime.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/linux/ktime.h ++++ linux-cfs-2.6.20.8.q/include/linux/ktime.h +@@ -274,4 +274,6 @@ extern void ktime_get_ts(struct timespec + /* Get the real (wall-) time in timespec format: */ + #define ktime_get_real_ts(ts) getnstimeofday(ts) + ++extern ktime_t ktime_get(void); ++ + #endif +Index: linux-cfs-2.6.20.8.q/include/linux/sched.h +=================================================================== +--- linux-cfs-2.6.20.8.q.orig/include/linux/sched.h ++++ linux-cfs-2.6.20.8.q/include/linux/sched.h +@@ -2,7 +2,6 @@ + #define _LINUX_SCHED_H + + #include /* For AT_VECTOR_SIZE */ +- + /* + * cloning flags: + */ +@@ -37,6 +36,8 @@ + + #ifdef __KERNEL__ + ++#include /* For run_node */ ++ + struct sched_param { + int sched_priority; + }; +@@ -196,13 +197,13 @@ extern void init_idle(struct task_struct + extern cpumask_t nohz_cpu_mask; + + /* +- * Only dump TASK_* tasks. (-1 for all tasks) ++ * Only dump TASK_* tasks. (0 for all tasks) + */ + extern void show_state_filter(unsigned long state_filter); + + static inline void show_state(void) + { +- show_state_filter(-1); ++ show_state_filter(0); + } + + extern void show_regs(struct pt_regs *); +@@ -464,7 +465,7 @@ struct signal_struct { + * from jiffies_to_ns(utime + stime) if sched_clock uses something + * other than jiffies.) + */ +- unsigned long long sched_time; ++ unsigned long long sum_sched_runtime; + + /* + * We don't bother to synchronize most readers of this at all, +@@ -524,6 +525,7 @@ struct signal_struct { + #define MAX_RT_PRIO MAX_USER_RT_PRIO + + #define MAX_PRIO (MAX_RT_PRIO + 40) ++#define DEFAULT_PRIO (MAX_RT_PRIO + 20) + + #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) + #define rt_task(p) rt_prio((p)->prio) +@@ -635,7 +637,14 @@ enum idle_type + /* + * sched-domains (multiprocessor balancing) declarations: + */ +-#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ ++ ++/* ++ * Increase resolution of nice-level calculations: ++ */ ++#define SCHED_LOAD_SHIFT 10 ++#define SCHED_LOAD_SCALE (1UL << SCHED_LOAD_SHIFT) ++ ++#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5) + + #ifdef CONFIG_SMP + #define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ +@@ -684,7 +693,6 @@ struct sched_domain { + unsigned int imbalance_pct; /* No balance until over watermark */ + unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ + unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ +- unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ + unsigned int busy_idx; + unsigned int idle_idx; + unsigned int newidle_idx; +@@ -733,12 +741,6 @@ struct sched_domain { + extern int partition_sched_domains(cpumask_t *partition1, + cpumask_t *partition2); + +-/* +- * Maximum cache size the migration-costs auto-tuning code will +- * search from: +- */ +-extern unsigned int max_cache_size; +- + #endif /* CONFIG_SMP */ + + +@@ -789,14 +791,28 @@ struct mempolicy; + struct pipe_inode_info; + struct uts_namespace; + +-enum sleep_type { +- SLEEP_NORMAL, +- SLEEP_NONINTERACTIVE, +- SLEEP_INTERACTIVE, +- SLEEP_INTERRUPTED, +-}; ++struct rq; + +-struct prio_array; ++struct sched_class { ++ struct sched_class *next; ++ ++ void (*enqueue_task) (struct rq *rq, struct task_struct *p, ++ int wakeup, u64 now); ++ void (*dequeue_task) (struct rq *rq, struct task_struct *p, ++ int sleep, u64 now); ++ void (*yield_task) (struct rq *rq, struct task_struct *p, ++ struct task_struct *p_to); ++ ++ void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); ++ ++ struct task_struct * (*pick_next_task) (struct rq *rq, u64 now); ++ void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now); ++ ++ struct task_struct * (*load_balance_start) (struct rq *rq); ++ struct task_struct * (*load_balance_next) (struct rq *rq); ++ void (*task_tick) (struct rq *rq, struct task_struct *p); ++ void (*task_new) (struct rq *rq, struct task_struct *p); ++}; + + struct task_struct { + volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ +@@ -813,26 +829,45 @@ struct task_struct { + #endif + #endif + int load_weight; /* for niceness load balancing purposes */ ++ int load_shift; ++ + int prio, static_prio, normal_prio; ++ int on_rq; + struct list_head run_list; +- struct prio_array *array; ++ struct rb_node run_node; + + unsigned short ioprio; + #ifdef CONFIG_BLK_DEV_IO_TRACE + unsigned int btrace_seq; + #endif +- unsigned long sleep_avg; +- unsigned long long timestamp, last_ran; +- unsigned long long sched_time; /* sched_clock time spent running */ +- enum sleep_type sleep_type; ++ /* CFS scheduling class statistics fields: */ ++ u64 wait_start_fair; ++ u64 wait_start; ++ u64 exec_start; ++ u64 sleep_start; ++ u64 block_start; ++ u64 sleep_max; ++ u64 block_max; ++ u64 exec_max; ++ u64 wait_max; ++ u64 last_ran; ++ ++ s64 wait_runtime; ++ u64 sum_exec_runtime; ++ s64 fair_key; ++ s64 sum_wait_runtime; + + unsigned long policy; + cpumask_t cpus_allowed; +- unsigned int time_slice, first_time_slice; ++ unsigned int time_slice; ++ struct sched_class *sched_class; ++ ++ s64 min_wait_runtime; + + #if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) + struct sched_info sched_info; + #endif ++ u64 nr_switches; + + struct list_head tasks; + /* +@@ -1195,8 +1230,9 @@ static inline int set_cpus_allowed(struc + #endif + + extern unsigned long long sched_clock(void); ++extern void sched_clock_unstable_event(void); + extern unsigned long long +-current_sched_time(const struct task_struct *current_task); ++current_sched_runtime(const struct task_struct *current_task); + + /* sched_exec is called by processes performing an exec */ + #ifdef CONFIG_SMP +@@ -1212,6 +1248,13 @@ static inline void idle_task_exit(void) + #endif + + extern void sched_idle_next(void); ++extern char * sched_print_task_state(struct task_struct *p, char *buffer); ++ ++extern unsigned int sysctl_sched_granularity; ++extern unsigned int sysctl_sched_wakeup_granularity; ++extern unsigned int sysctl_sched_sleep_history_max; ++extern unsigned int sysctl_sched_child_runs_first; ++extern unsigned int sysctl_sched_load_smoothing; + + #ifdef CONFIG_RT_MUTEXES + extern int rt_mutex_getprio(struct task_struct *p); +@@