From 3c0f13bcdd4491d33f866e0ebd9286556ef13d8d Mon Sep 17 00:00:00 2001 From: Thomas Meyer Date: Tue, 8 Nov 2011 19:49:30 +0100 Subject: Hexagon: Use resource_size function Use resource_size function on resource object instead of explicit computation. The semantic patch that makes this change is available in scripts/coccinelle/api/resource_size.cocci. More information about semantic patching is available at http://coccinelle.lip6.fr/ Signed-off-by: Thomas Meyer Signed-off-by: Richard Kuo diff --git a/arch/hexagon/kernel/time.c b/arch/hexagon/kernel/time.c index 5d9b33b..36ba641 100644 --- a/arch/hexagon/kernel/time.c +++ b/arch/hexagon/kernel/time.c @@ -201,12 +201,10 @@ void __init time_init_deferred(void) resource = rtos_timer_device.resource; /* ioremap here means this has to run later, after paging init */ - rtos_timer = ioremap(resource->start, resource->end - - resource->start + 1); + rtos_timer = ioremap(resource->start, resource_size(resource)); if (!rtos_timer) { - release_mem_region(resource->start, resource->end - - resource->start + 1); + release_mem_region(resource->start, resource_size(resource)); } clocksource_register_khz(&hexagon_clocksource, pcycle_freq_mhz * 1000); -- cgit v0.10.2 From bfd46276fdf4e936259193a520d6bc1926800fb4 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Sun, 20 Nov 2011 21:59:55 +0100 Subject: Remove unneeded include of version.h from arch/hexagon/include/asm/spinlock_types.h "make versioncheck" points out that arch/hexagon/include/asm/spinlock_types.h does not need to include version.h . A quick look at the file seems to confirm its findings, so here's a patch that removes the include. Signed-off-by: Jesper Juhl Signed-off-by: Richard Kuo diff --git a/arch/hexagon/include/asm/spinlock_types.h b/arch/hexagon/include/asm/spinlock_types.h index 5e937af..99b5a75 100644 --- a/arch/hexagon/include/asm/spinlock_types.h +++ b/arch/hexagon/include/asm/spinlock_types.h @@ -21,8 +21,6 @@ #ifndef _ASM_SPINLOCK_TYPES_H #define _ASM_SPINLOCK_TYPES_H -#include - #ifndef __LINUX_SPINLOCK_TYPES_H # error "please don't include this file directly" #endif -- cgit v0.10.2 From 222c547ee7155045dc20c26d39191b0e9b49f6a8 Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 24 Jan 2012 14:31:36 +0100 Subject: arch/hexagon/kernel/dma.c: make function static This function is only used in the same file, and the other similar functions in this file are also static. Signed-off-by: Julia Lawall [rkuo@codeaurora.org: adjusted patch to apply to latest] Signed-off-by: Richard Kuo diff --git a/arch/hexagon/kernel/dma.c b/arch/hexagon/kernel/dma.c index 0f2367c..2b48751 100644 --- a/arch/hexagon/kernel/dma.c +++ b/arch/hexagon/kernel/dma.c @@ -54,7 +54,7 @@ static struct gen_pool *coherent_pool; /* Allocates from a pool of uncached memory that was reserved at boot time */ -void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, +static void *hexagon_dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_addr, gfp_t flag, struct dma_attrs *attrs) { -- cgit v0.10.2 From 393a86af71b5bc6b11eac8e1594fb8be4c2ce84c Mon Sep 17 00:00:00 2001 From: Kautuk Consul Date: Tue, 20 Mar 2012 09:23:33 -0400 Subject: hexagon/mm/vm_fault.c: Port OOM changes to do_page_fault Commit d065bd810b6deb67d4897a14bfe21f8eb526ba99 (mm: retry page fault when blocking on disk transfer) and commit 37b23e0525d393d48a7d59f870b3bc061a30ccdb (x86,mm: make pagefault killable) The above commits introduced changes into the x86 pagefault handler for making the page fault handler retryable as well as killable. These changes reduce the mmap_sem hold time, which is crucial during OOM killer invocation. Port these changes to hexagon. Signed-off-by: Kautuk Consul Signed-off-by: Richard Kuo diff --git a/arch/hexagon/mm/vm_fault.c b/arch/hexagon/mm/vm_fault.c index c10b76f..06695cc 100644 --- a/arch/hexagon/mm/vm_fault.c +++ b/arch/hexagon/mm/vm_fault.c @@ -53,6 +53,8 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) int si_code = SEGV_MAPERR; int fault; const struct exception_table_entry *fixup; + unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE | + (cause > 0 ? FAULT_FLAG_WRITE : 0); /* * If we're in an interrupt or have no user context, @@ -63,6 +65,7 @@ void do_page_fault(unsigned long address, long cause, struct pt_regs *regs) local_irq_enable(); +retry: down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) @@ -96,14 +99,23 @@ good_area: break; } - fault = handle_mm_fault(mm, vma, address, (cause > 0)); + fault = handle_mm_fault(mm, vma, address, flags); + + if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) + return; /* The most common case -- we are done. */ if (likely(!(fault & VM_FAULT_ERROR))) { - if (fault & VM_FAULT_MAJOR) - current->maj_flt++; - else - current->min_flt++; + if (flags & FAULT_FLAG_ALLOW_RETRY) { + if (fault & VM_FAULT_MAJOR) + current->maj_flt++; + else + current->min_flt++; + if (fault & VM_FAULT_RETRY) { + flags &= ~FAULT_FLAG_ALLOW_RETRY; + goto retry; + } + } up_read(&mm->mmap_sem); return; -- cgit v0.10.2 From 5042ab91c4272e158748180ae70a2e097f9e90e3 Mon Sep 17 00:00:00 2001 From: Richard Kuo Date: Tue, 15 Nov 2011 16:31:48 -0600 Subject: various Kconfig cleanup and old platform build code removal Signed-off-by: Richard Kuo diff --git a/arch/hexagon/Kconfig b/arch/hexagon/Kconfig index 22615dd..bc979f7 100644 --- a/arch/hexagon/Kconfig +++ b/arch/hexagon/Kconfig @@ -13,8 +13,8 @@ config HEXAGON # select ARCH_REQUIRE_GPIOLIB # select HAVE_CLK # select IRQ_PER_CPU - select HAVE_IRQ_WORK # select GENERIC_PENDING_IRQ if SMP + select HAVE_IRQ_WORK select GENERIC_ATOMIC64 select HAVE_PERF_EVENTS select HAVE_GENERIC_HARDIRQS @@ -26,7 +26,7 @@ config HEXAGON select NO_IOPORT select GENERIC_IOMAP select GENERIC_SMP_IDLE_THREAD - # mostly generic routines, with some accelerated ones + select STACKTRACE_SUPPORT ---help--- Qualcomm Hexagon is a processor architecture designed for high performance and low power across a wide variety of applications. @@ -73,15 +73,6 @@ config GENERIC_CSUM config GENERIC_IRQ_PROBE def_bool y -#config ZONE_DMA -# bool -# default y - -config HAS_DMA - bool - select HAVE_DMA_ATTRS - default y - config NEED_SG_DMA_LENGTH def_bool y @@ -114,14 +105,11 @@ config GENERIC_BUG def_bool y depends on BUG -config BUG - def_bool y - menu "Machine selection" choice prompt "System type" - default HEXAGON_ARCH_V2 + default HEXAGON_COMET config HEXAGON_COMET bool "Comet Board" @@ -194,8 +182,7 @@ source "kernel/Kconfig.hz" source "kernel/time/Kconfig" config GENERIC_GPIO - bool "Generic GPIO support" - default n + def_bool n endmenu diff --git a/arch/hexagon/Makefile b/arch/hexagon/Makefile index e27d030..d00d900 100644 --- a/arch/hexagon/Makefile +++ b/arch/hexagon/Makefile @@ -50,8 +50,3 @@ head-y := arch/hexagon/kernel/head.o core-y += arch/hexagon/kernel/ \ arch/hexagon/mm/ \ arch/hexagon/lib/ - -# arch/hexagon/platform/common/ -# -#core-$(CONFIG_HEXAGON_COMET) += arch/hexagon/platform/comet/ -#machine-$(CONFIG_HEXAGON_COMET) := comet -- cgit v0.10.2