Commit 154e8227 authored by Stephen Rothwell's avatar Stephen Rothwell

Merge commit 'arm-current/master'

parents 4142e0d1 b7cfda9f
This diff is collapsed.
...@@ -212,7 +212,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x) ...@@ -212,7 +212,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
* *
* page_to_pfn(page) convert a struct page * to a PFN number * page_to_pfn(page) convert a struct page * to a PFN number
* pfn_to_page(pfn) convert a _valid_ PFN number to struct page * * pfn_to_page(pfn) convert a _valid_ PFN number to struct page *
* pfn_valid(pfn) indicates whether a PFN number is valid
* *
* virt_to_page(k) convert a _valid_ virtual address to struct page * * virt_to_page(k) convert a _valid_ virtual address to struct page *
* virt_addr_valid(k) indicates whether a virtual address is valid * virt_addr_valid(k) indicates whether a virtual address is valid
...@@ -221,10 +220,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x) ...@@ -221,10 +220,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
#define ARCH_PFN_OFFSET PHYS_PFN_OFFSET #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET
#ifndef CONFIG_SPARSEMEM
#define pfn_valid(pfn) ((pfn) >= PHYS_PFN_OFFSET && (pfn) < (PHYS_PFN_OFFSET + max_mapnr))
#endif
#define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory)
...@@ -241,18 +236,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x) ...@@ -241,18 +236,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
#define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn) #define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn)
#define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT) #define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT)
#define pfn_valid(pfn) \
({ \
unsigned int nid = PFN_TO_NID(pfn); \
int valid = nid < MAX_NUMNODES; \
if (valid) { \
pg_data_t *node = NODE_DATA(nid); \
valid = (pfn - node->node_start_pfn) < \
node->node_spanned_pages; \
} \
valid; \
})
#define virt_to_page(kaddr) \ #define virt_to_page(kaddr) \
(ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
......
...@@ -194,6 +194,10 @@ typedef unsigned long pgprot_t; ...@@ -194,6 +194,10 @@ typedef unsigned long pgprot_t;
typedef struct page *pgtable_t; typedef struct page *pgtable_t;
#ifndef CONFIG_SPARSEMEM
extern int pfn_valid(unsigned long);
#endif
#include <asm/memory.h> #include <asm/memory.h>
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
......
...@@ -678,8 +678,8 @@ static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enab ...@@ -678,8 +678,8 @@ static int corgi_enter_suspend(unsigned long alarm_time, unsigned int alarm_enab
dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n"); dev_dbg(sharpsl_pm.dev, "User triggered wakeup in offline charger.\n");
} }
if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) || (sharpsl_fatal_check() < 0) ) if ((!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_LOCK)) ||
{ (!sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_FATAL))) {
dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n"); dev_err(sharpsl_pm.dev, "Fatal condition. Suspend.\n");
corgi_goto_sleep(alarm_time, alarm_enable, state); corgi_goto_sleep(alarm_time, alarm_enable, state);
return 1; return 1;
......
...@@ -144,7 +144,14 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page) ...@@ -144,7 +144,14 @@ void __flush_dcache_page(struct address_space *mapping, struct page *page)
* page. This ensures that data in the physical page is mutually * page. This ensures that data in the physical page is mutually
* coherent with the kernels mapping. * coherent with the kernels mapping.
*/ */
__cpuc_flush_dcache_page(page_address(page)); #ifdef CONFIG_HIGHMEM
/*
* kmap_atomic() doesn't set the page virtual address, and
* kunmap_atomic() takes care of cache flushing already.
*/
if (page_address(page))
#endif
__cpuc_flush_dcache_page(page_address(page));
/* /*
* If this is a page cache page, and we have an aliasing VIPT cache, * If this is a page cache page, and we have an aliasing VIPT cache,
......
...@@ -40,11 +40,16 @@ void *kmap_atomic(struct page *page, enum km_type type) ...@@ -40,11 +40,16 @@ void *kmap_atomic(struct page *page, enum km_type type)
{ {
unsigned int idx; unsigned int idx;
unsigned long vaddr; unsigned long vaddr;
void *kmap;
pagefault_disable(); pagefault_disable();
if (!PageHighMem(page)) if (!PageHighMem(page))
return page_address(page); return page_address(page);
kmap = kmap_high_get(page);
if (kmap)
return kmap;
idx = type + KM_TYPE_NR * smp_processor_id(); idx = type + KM_TYPE_NR * smp_processor_id();
vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx); vaddr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
#ifdef CONFIG_DEBUG_HIGHMEM #ifdef CONFIG_DEBUG_HIGHMEM
...@@ -80,6 +85,9 @@ void kunmap_atomic(void *kvaddr, enum km_type type) ...@@ -80,6 +85,9 @@ void kunmap_atomic(void *kvaddr, enum km_type type)
#else #else
(void) idx; /* to kill a warning */ (void) idx; /* to kill a warning */
#endif #endif
} else if (vaddr >= PKMAP_ADDR(0) && vaddr < PKMAP_ADDR(LAST_PKMAP)) {
/* this address was obtained through kmap_high_get() */
kunmap_high(pte_page(pkmap_page_table[PKMAP_NR(vaddr)]));
} }
pagefault_enable(); pagefault_enable();
} }
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/mman.h> #include <linux/mman.h>
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <linux/initrd.h> #include <linux/initrd.h>
#include <linux/sort.h>
#include <linux/highmem.h> #include <linux/highmem.h>
#include <asm/mach-types.h> #include <asm/mach-types.h>
...@@ -349,12 +350,43 @@ static void __init bootmem_free_node(int node, struct meminfo *mi) ...@@ -349,12 +350,43 @@ static void __init bootmem_free_node(int node, struct meminfo *mi)
free_area_init_node(node, zone_size, min, zhole_size); free_area_init_node(node, zone_size, min, zhole_size);
} }
#ifndef CONFIG_SPARSEMEM
int pfn_valid(unsigned long pfn)
{
struct meminfo *mi = &meminfo;
unsigned int left = 0, right = mi->nr_banks;
do {
unsigned int mid = (right + left) / 2;
struct membank *bank = &mi->bank[mid];
if (pfn < bank_pfn_start(bank))
right = mid;
else if (pfn >= bank_pfn_end(bank))
left = mid + 1;
else
return 1;
} while (left < right);
return 0;
}
EXPORT_SYMBOL(pfn_valid);
#endif
static int __init meminfo_cmp(const void *_a, const void *_b)
{
const struct membank *a = _a, *b = _b;
long cmp = bank_pfn_start(a) - bank_pfn_start(b);
return cmp < 0 ? -1 : cmp > 0 ? 1 : 0;
}
void __init bootmem_init(void) void __init bootmem_init(void)
{ {
struct meminfo *mi = &meminfo; struct meminfo *mi = &meminfo;
unsigned long min, max_low, max_high; unsigned long min, max_low, max_high;
int node, initrd_node; int node, initrd_node;
sort(&mi->bank, mi->nr_banks, sizeof(mi->bank[0]), meminfo_cmp, NULL);
/* /*
* Locate which node contains the ramdisk image, if any. * Locate which node contains the ramdisk image, if any.
*/ */
......
...@@ -110,7 +110,11 @@ static struct console ks8695_console; ...@@ -110,7 +110,11 @@ static struct console ks8695_console;
static void ks8695uart_stop_tx(struct uart_port *port) static void ks8695uart_stop_tx(struct uart_port *port)
{ {
if (tx_enabled(port)) { if (tx_enabled(port)) {
disable_irq(KS8695_IRQ_UART_TX); /* use disable_irq_nosync() and not disable_irq() to avoid self
* imposed deadlock by not waiting for irq handler to end,
* since this ks8695uart_stop_tx() is called from interrupt context.
*/
disable_irq_nosync(KS8695_IRQ_UART_TX);
tx_enable(port, 0); tx_enable(port, 0);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment