From e2bdb176ffae3fd2c162db897a05fbad044ff9e9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Tue, 2 Jan 2007 18:32:37 +0100 Subject: [ARM] 4079/1: iop: Update MAINTAINERS Signed-off-by: Dan Williams Signed-off-by: Russell King --- MAINTAINERS | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 0f6d13bd468..6ecb29609cf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -412,20 +412,32 @@ S: Maintained ARM/INTEL IOP32X ARM ARCHITECTURE P: Lennert Buytenhek M: kernel@wantstofly.org +P: Dan Williams +M: dan.j.williams@intel.com L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained +S: Supported + +ARM/INTEL IOP33X ARM ARCHITECTURE +P: Dan Williams +M: dan.j.williams@intel.com +L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) +S: Supported ARM/INTEL IOP13XX ARM ARCHITECTURE P: Lennert Buytenhek M: kernel@wantstofly.org +P: Dan Williams +M: dan.j.williams@intel.com L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained +S: Supported ARM/INTEL IQ81342EX MACHINE SUPPORT P: Lennert Buytenhek M: kernel@wantstofly.org +P: Dan Williams +M: dan.j.williams@intel.com L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained +S: Supported ARM/INTEL IXP2000 ARM ARCHITECTURE P: Lennert Buytenhek @@ -448,8 +460,10 @@ S: Maintained ARM/INTEL XSC3 (MANZANO) ARM CORE P: Lennert Buytenhek M: kernel@wantstofly.org +P: Dan Williams +M: dan.j.williams@intel.com L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only) -S: Maintained +S: Supported ARM/IP FABRICS DOUBLE ESPRESSO MACHINE SUPPORT P: Lennert Buytenhek -- cgit v1.2.3 From 9ca3f07b869c1fbbdfdac3150019a3e4d2948d8e Mon Sep 17 00:00:00 2001 From: Ben Dooks Date: Sun, 24 Dec 2006 01:36:35 +0100 Subject: [ARM] 4070/1: arch/arm/kernel: fix warnings from missing includes Include to fix the warning: arch/arm/kernel/traps.c:647:6: warning: symbol '__readwrite_bug' was not declared. Should it be static? Include to fix the warning: arch/arm/kernel/time.c:42:1: warning: symbol 'rtc_lock' was not declared. Should it be static? Signed-off-by: Ben Dooks Signed-off-by: Russell King --- arch/arm/kernel/time.c | 2 ++ arch/arm/kernel/traps.c | 1 + 2 files changed, 3 insertions(+) diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 6ff5e3ff6cb..174cd4900bf 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -29,6 +29,8 @@ #include #include +#include + #include #include #include diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 042a12982e9..908915675ed 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c @@ -27,6 +27,7 @@ #include #include #include +#include #include "ptrace.h" #include "signal.h" -- cgit v1.2.3 From 4ac941d2d04ef26a91adf677f3a371818596305d Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 4 Jan 2007 02:14:49 +0100 Subject: [ARM] 4082/1: iop3xx: fix iop33x gpio register offset iop33x gpio offset is correct in include/asm-arm/arch-iop33x/iop33x.h, but include/asm-arm/hardware/iop3xx.h adds 4. Signed-off-by: Dan Williams Signed-off-by: Russell King --- include/asm-arm/arch-iop32x/iop32x.h | 2 +- include/asm-arm/hardware/iop3xx.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/asm-arm/arch-iop32x/iop32x.h b/include/asm-arm/arch-iop32x/iop32x.h index 4bbd85f3ed2..2e9469047eb 100644 --- a/include/asm-arm/arch-iop32x/iop32x.h +++ b/include/asm-arm/arch-iop32x/iop32x.h @@ -19,7 +19,7 @@ * Peripherals that are shared between the iop32x and iop33x but * located at different addresses. */ -#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c0 + (reg)) +#define IOP3XX_GPIO_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07c4 + (reg)) #define IOP3XX_TIMER_REG(reg) (IOP3XX_PERIPHERAL_VIRT_BASE + 0x07e0 + (reg)) #include diff --git a/include/asm-arm/hardware/iop3xx.h b/include/asm-arm/hardware/iop3xx.h index 1018a7486ab..13ac8a4cd01 100644 --- a/include/asm-arm/hardware/iop3xx.h +++ b/include/asm-arm/hardware/iop3xx.h @@ -168,9 +168,9 @@ extern void gpio_line_set(int line, int value); #define IOP3XX_PERCR0 (volatile u32 *)IOP3XX_REG_ADDR(0x0710) /* General Purpose I/O */ -#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0004) -#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0008) -#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x000c) +#define IOP3XX_GPOE (volatile u32 *)IOP3XX_GPIO_REG(0x0000) +#define IOP3XX_GPID (volatile u32 *)IOP3XX_GPIO_REG(0x0004) +#define IOP3XX_GPOD (volatile u32 *)IOP3XX_GPIO_REG(0x0008) /* Timers */ #define IOP3XX_TU_TMR0 (volatile u32 *)IOP3XX_TIMER_REG(0x0000) -- cgit v1.2.3 From db6ccbb61c1291c8aaefadcc8304444f27eeb88d Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 6 Jan 2007 22:53:48 +0000 Subject: [ARM] Fix kernel-mode undefined instruction aborts If the kernel attempts to execute a CP1 or CP2 instruction and it aborts, and a FP emulator is not loaded, we try to return as if to a user context, instead of the proper kernel context. Since the fault came from kernel mode, we must use the kernel return paths. Signed-off-by: Russell King --- arch/arm/kernel/entry-armv.S | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 2db42b18f53..8517c3c3eb3 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S @@ -436,7 +436,7 @@ __und_usr: usr_entry tst r3, #PSR_T_BIT @ Thumb mode? - bne fpundefinstr @ ignore FP + bne __und_usr_unknown @ ignore FP sub r4, r2, #4 @ @@ -448,7 +448,7 @@ __und_usr: @ 1: ldrt r0, [r4] adr r9, ret_from_exception - adr lr, fpundefinstr + adr lr, __und_usr_unknown @ @ fallthrough to call_fpe @ @@ -476,7 +476,9 @@ __und_usr: * Emulators may wish to make use of the following registers: * r0 = instruction opcode. * r2 = PC+4 + * r9 = normal "successful" return address * r10 = this threads thread_info structure. + * lr = unrecognised instruction return address */ call_fpe: tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 @@ -545,10 +547,12 @@ do_fpe: .data ENTRY(fp_enter) - .word fpundefinstr + .word no_fp .text -fpundefinstr: +no_fp: mov pc, lr + +__und_usr_unknown: mov r0, sp adr lr, ret_from_exception b do_undefinstr -- cgit v1.2.3 From e47c222b22cd53c317a5573e1dc5f9e0cbd46380 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 8 Jan 2007 16:42:51 +0000 Subject: [ARM] Fix potential MMCI bug The MMCI driver might end up aborting the initial command and leaving the data part of the command sequence still in place. Avoid this problem by ensuring that any data sequence is properly cleared out when a command completes. Signed-off-by: Russell King --- drivers/mmc/mmci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index e9b80e92026..ccfe6561be2 100644 --- a/drivers/mmc/mmci.c +++ b/drivers/mmc/mmci.c @@ -42,6 +42,8 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq) { writel(0, host->base + MMCICOMMAND); + BUG_ON(host->data); + host->mrq = NULL; host->cmd = NULL; @@ -198,6 +200,8 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, } if (!cmd->data || cmd->error != MMC_ERR_NONE) { + if (host->data) + mmci_stop_data(host); mmci_request_end(host, cmd->mrq); } else if (!(cmd->data->flags & MMC_DATA_READ)) { mmci_start_data(host, cmd->data); -- cgit v1.2.3 From a6f36be32622730710b2fadacb6e2649defa4371 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 30 Dec 2006 22:24:19 +0000 Subject: [ARM] pass vma for flush_anon_page() Since get_user_pages() may be used with processes other than the current process and calls flush_anon_page(), flush_anon_page() has to cope in some way with non-current processes. It may not be appropriate, or even desirable to flush a region of virtual memory cache in the current process when that is different to the process that we want the flush to occur for. Therefore, pass the vma into flush_anon_page() so that the architecture can work out whether the 'vmaddr' is for the current process or not. Signed-off-by: Russell King --- Documentation/cachetlb.txt | 5 +++-- include/asm-parisc/cacheflush.h | 2 +- include/linux/highmem.h | 2 +- mm/memory.c | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Documentation/cachetlb.txt b/Documentation/cachetlb.txt index 73e794f0ff0..debf6813934 100644 --- a/Documentation/cachetlb.txt +++ b/Documentation/cachetlb.txt @@ -373,14 +373,15 @@ maps this page at its virtual address. likely that you will need to flush the instruction cache for copy_to_user_page(). - void flush_anon_page(struct page *page, unsigned long vmaddr) + void flush_anon_page(struct vm_area_struct *vma, struct page *page, + unsigned long vmaddr) When the kernel needs to access the contents of an anonymous page, it calls this function (currently only get_user_pages()). Note: flush_dcache_page() deliberately doesn't work for an anonymous page. The default implementation is a nop (and should remain so for all coherent architectures). For incoherent architectures, it should flush - the cache of the page at vmaddr in the current user process. + the cache of the page at vmaddr. void flush_kernel_dcache_page(struct page *page) When the kernel needs to modify a user page is has obtained diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h index aedb0512cb0..a799dd8ef39 100644 --- a/include/asm-parisc/cacheflush.h +++ b/include/asm-parisc/cacheflush.h @@ -186,7 +186,7 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long } static inline void -flush_anon_page(struct page *page, unsigned long vmaddr) +flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr) { if (PageAnon(page)) flush_user_dcache_page(vmaddr); diff --git a/include/linux/highmem.h b/include/linux/highmem.h index ca9a602cffd..645d440807c 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -8,7 +8,7 @@ #include #ifndef ARCH_HAS_FLUSH_ANON_PAGE -static inline void flush_anon_page(struct page *page, unsigned long vmaddr) +static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr) { } #endif diff --git a/mm/memory.c b/mm/memory.c index 563792f4f68..af227d26e10 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1091,7 +1091,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, if (pages) { pages[i] = page; - flush_anon_page(page, start); + flush_anon_page(vma, page, start); flush_dcache_page(page); } if (vmas) -- cgit v1.2.3 From 6020dff09252e3670a89edb36baaa4afb9b10d15 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sat, 30 Dec 2006 23:17:40 +0000 Subject: [ARM] Resolve fuse and direct-IO failures due to missing cache flushes fuse does not work on ARM due to cache incoherency issues - fuse wants to use get_user_pages() to copy data from the current process into kernel space. However, since this accesses userspace via the kernel mapping, the kernel mapping can be out of date wrt data written to userspace. This can lead to unpredictable behaviour (in the case of fuse) or data corruption for direct-IO. This resolves debian bug #402876 Signed-off-by: Russell King --- arch/arm/mm/flush.c | 39 +++++++++++++++++++++++++++++++++++++++ include/asm-arm/cacheflush.h | 10 ++++++++++ 2 files changed, 49 insertions(+) diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 628348c9f6c..9df507d36e0 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c @@ -202,3 +202,42 @@ void flush_dcache_page(struct page *page) } } EXPORT_SYMBOL(flush_dcache_page); + +/* + * Flush an anonymous page so that users of get_user_pages() + * can safely access the data. The expected sequence is: + * + * get_user_pages() + * -> flush_anon_page + * memcpy() to/from page + * if written to page, flush_dcache_page() + */ +void __flush_anon_page(struct vm_area_struct *vma, struct page *page, unsigned long vmaddr) +{ + unsigned long pfn; + + /* VIPT non-aliasing caches need do nothing */ + if (cache_is_vipt_nonaliasing()) + return; + + /* + * Write back and invalidate userspace mapping. + */ + pfn = page_to_pfn(page); + if (cache_is_vivt()) { + flush_cache_page(vma, vmaddr, pfn); + } else { + /* + * For aliasing VIPT, we can flush an alias of the + * userspace address only. + */ + flush_pfn_alias(pfn, vmaddr); + } + + /* + * Invalidate kernel mapping. No data should be contained + * in this mapping of the page. FIXME: this is overkill + * since we actually ask for a write-back and invalidate. + */ + __cpuc_flush_dcache_page(page_address(page)); +} diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index d51049522cd..5f531ea0305 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h @@ -357,6 +357,16 @@ extern void flush_dcache_page(struct page *); extern void __flush_dcache_page(struct address_space *mapping, struct page *page); +#define ARCH_HAS_FLUSH_ANON_PAGE +static inline void flush_anon_page(struct vm_area_struct *vma, + struct page *page, unsigned long vmaddr) +{ + extern void __flush_anon_page(struct vm_area_struct *vma, + struct page *, unsigned long); + if (PageAnon(page)) + __flush_anon_page(vma, page, vmaddr); +} + #define flush_dcache_mmap_lock(mapping) \ write_lock_irq(&(mapping)->tree_lock) #define flush_dcache_mmap_unlock(mapping) \ -- cgit v1.2.3 From e97126cd9056b3b42cdc862ace2ed66f8026f55b Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 8 Jan 2007 19:49:12 +0000 Subject: [ARM] Provide basic printk_clock() implementation Current sched_clock() implementations on ARM cause unbootable kernels with PRINTK_TIME support enabled. To avoid this, provide a basic printk_clock() implementation which avoids sched_clock() being called before the page tables have been set up. Signed-off-by: Russell King --- arch/arm/kernel/time.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index 174cd4900bf..3c8cdcfe8d4 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c @@ -87,6 +87,17 @@ unsigned long long __attribute__((weak)) sched_clock(void) return (unsigned long long)jiffies * (1000000000 / HZ); } +/* + * An implementation of printk_clock() independent from + * sched_clock(). This avoids non-bootable kernels when + * printk_clock is enabled. + */ +unsigned long long printk_clock(void) +{ + return (unsigned long long)(jiffies - INITIAL_JIFFIES) * + (1000000000 / HZ); +} + static unsigned long next_rtc_update; /* -- cgit v1.2.3