Re: The MAX high_addr for `mmap` on PPC64

2012-08-28 Thread madper
On Wed, 29 Aug 2012 11:42:58 +0800, David Gibson wrote: On Wed, Aug 29, 2012 at 11:34:08AM +0800, madper wrote: Hi every one, I use the ltp (Linux-Test-Project) and run it on both ppc64 and x86_64. There is a code like follows in `ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap0

Re: The MAX high_addr for `mmap` on PPC64

2012-08-28 Thread David Gibson
On Wed, Aug 29, 2012 at 11:34:08AM +0800, madper wrote: > Hi every one, > I use the ltp (Linux-Test-Project) and run it on both ppc64 and x86_64. > There is a code like follows in > `ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap03.c`: > `code` > #define HIGH_ADDR (void *)(

The MAX high_addr for `mmap` on PPC64

2012-08-28 Thread madper
Hi every one, I use the ltp (Linux-Test-Project) and run it on both ppc64 and x86_64. There is a code like follows in `ltp/testcase/kernel/mem/hugetbl/hugemmap/hugemmap03.c`: `code` #define HIGH_ADDR (void *)(0x1) /* Attempt to mmap into highmem addr, s

[PATCH] powerpc/8544ds: add partition table for norflash

2012-08-28 Thread Dongsheng.wang
From: Wang Dongsheng create partition table for norflash. Signed-off-by: Wang Dongsheng --- arch/powerpc/boot/dts/mpc8544ds.dts |4 ++- arch/powerpc/boot/dts/mpc8544ds.dtsi | 38 ++ 2 files changed, 41 insertions(+), 1 deletions(-) diff --git a/arch/pow

Re: [PATCH] powerpc/mm: match variable types to API

2012-08-28 Thread Paul Mackerras
On Tue, Aug 21, 2012 at 02:22:28PM -0400, Paul Gortmaker wrote: > From: Joe MacDonald > > sys_subpage_prot() takes an unsigned long for 'addr' then does some stuff > with it and the result is stored in a signed int, i, which is eventually > used as the size parameter in a copy_from_user call. Up

[PATCH] clk: Make the generic clock API available by default

2012-08-28 Thread Mark Brown
Rather than requiring platforms to select the generic clock API to make it available make the API available as a user selectable option unless the user either selects HAVE_CUSTOM_CLK (if they have their own implementation) or selects COMMON_CLK (if they depend on the generic implementation). All c

[RFC v8 PATCH 04/20] memory-hotplug: offline and remove memory when removing the memory device

2012-08-28 Thread wency
From: Yasuaki Ishimatsu We should offline and remove memory when removing the memory device. The memory device can be removed by 2 ways: 1. send eject request by SCI 2. echo 1 >/sys/bus/pci/devices/PNP0C80:XX/eject In the 1st case, acpi_memory_disable_device() will be called. In the 2nd case, ac

[RFC v8 PATCH 02/20] memory-hotplug: implement offline_memory()

2012-08-28 Thread wency
From: Wen Congyang The function offline_memory() will be called when hot removing a memory device. The memory device may contain more than one memory block. If the memory block has been offlined, __offline_pages() will fail. So we should try to offline one memory block at a time. If the memory b

[RFC v8 PATCH 12/20] memory-hotplug: introduce new function arch_remove_memory()

2012-08-28 Thread wency
From: Wen Congyang We don't call __add_pages() directly in the function add_memory() because some other architecture related things need to be done before or after calling __add_pages(). So we should introduce a new function arch_remove_memory() to revert the things done in arch_add_memory(). No

[RFC v8 PATCH 16/20] memory-hotplug: free memmap of sparse-vmemmap

2012-08-28 Thread wency
From: Yasuaki Ishimatsu All pages of virtual mapping in removed memory cannot be freed, since some pages used as PGD/PUD includes not only removed memory but also other memory. So the patch checks whether page can be freed or not. How to check whether page can be freed or not? 1. When removing

[RFC v8 PATCH 15/20] memory-hotplug: implement register_page_bootmem_info_section of sparse-vmemmap

2012-08-28 Thread wency
From: Yasuaki Ishimatsu For removing memmap region of sparse-vmemmap which is allocated bootmem, memmap region of sparse-vmemmap needs to be registered by get_page_bootmem(). So the patch searches pages of virtual mapping and registers the pages by get_page_bootmem(). Note: register_page_bootmem

[RFC v8 PATCH 17/20] memory_hotplug: clear zone when the memory is removed

2012-08-28 Thread wency
From: Yasuaki Ishimatsu When a memory is added, we update zone's and pgdat's start_pfn and spanned_pages in the function __add_zone(). So we should revert these when the memory is removed. Add a new function __remove_zone() to do this. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjam

[RFC v8 PATCH 00/20] memory-hotplug: hot-remove physical memory

2012-08-28 Thread wency
From: Wen Congyang This patch series aims to support physical memory hot-remove. The patches can free/remove the following things: - acpi_memory_info : [RFC PATCH 4/19] - /sys/firmware/memmap/X/{end, start, type} : [RFC PATCH 8/19] - iomem_resource

[RFC v8 PATCH 08/20] memory-hotplug: remove /sys/firmware/memmap/X sysfs

2012-08-28 Thread wency
From: Yasuaki Ishimatsu When (hot)adding memory into system, /sys/firmware/memmap/X/{end, start, type} sysfs files are created. But there is no code to remove these files. The patch implements the function to remove them. Note : The code does not free firmware_map_entry since there is no way to

[RFC v8 PATCH 01/20] memory-hotplug: rename remove_memory() to offline_memory()/offline_pages()

2012-08-28 Thread wency
From: Yasuaki Ishimatsu remove_memory() only try to offline pages. It is called in two cases: 1. hot remove a memory device 2. echo offline >/sys/devices/system/memory/memoryXX/state In the 1st case, we should also change memory block's state, and notify the userspace that the memory block's sta

[RFC v8 PATCH 11/20] memory-hotplug: remove_memory calls __remove_pages

2012-08-28 Thread wency
From: Yasuaki Ishimatsu The patch adds __remove_pages() to remove_memory(). Then the range of phys_start_pfn argument and nr_pages argument in __remove_pagse() may have different zone. So zone argument is removed from __remove_pages() and __remove_pages() caluculates zone in each section. When C

[RFC v8 PATCH 14/20] memory-hotplug: move register_page_bootmem_info_node and put_page_bootmem for sparse-vmemmap

2012-08-28 Thread wency
From: Yasuaki Ishimatsu For implementing register_page_bootmem_info_node of sparse-vmemmap, register_page_bootmem_info_node and put_page_bootmem are moved to memory_hotplug.c CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter

[RFC v8 PATCH 09/20] memory-hotplug: does not release memory region in PAGES_PER_SECTION chunks

2012-08-28 Thread wency
From: Yasuaki Ishimatsu Since applying a patch(de7f0cba96786c), release_mem_region() has been changed as called in PAGES_PER_SECTION chunks because register_memory_resource() is called in PAGES_PER_SECTION chunks by add_memory(). But it seems firmware dependency. If CRS are written in the PAGES_P

[RFC v8 PATCH 05/20] memory-hotplug: check whether memory is present or not

2012-08-28 Thread wency
From: Yasuaki Ishimatsu If system supports memory hot-remove, online_pages() may online removed pages. So online_pages() need to check whether onlining pages are present or not. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lamete

[RFC v8 PATCH 06/20] memory-hotplug: export the function acpi_bus_remove()

2012-08-28 Thread wency
From: Wen Congyang The function acpi_bus_remove() can remove a acpi device from acpi device. When a acpi device is removed, we need to call this function to remove the acpi device from acpi bus. So export this function. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt

[RFC v8 PATCH 19/20] memory-hotplug: remove sysfs file of node

2012-08-28 Thread wency
From: Wen Congyang This patch introduces a new function try_offline_node() to remove sysfs file of node when all memory sections of this node are removed. If some memory sections of this node are not removed, this function does nothing. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benja

[RFC v8 PATCH 10/20] memory-hotplug: add memory_block_release

2012-08-28 Thread wency
From: Yasuaki Ishimatsu When calling remove_memory_block(), the function shows following message at device_release(). Device 'memory528' does not have a release() function, it is broken and must be fixed. remove_memory_block() calls kfree(mem). I think it shouled be called from device_release()

[RFC v8 PATCH 18/20] memory-hotplug: add node_device_release

2012-08-28 Thread wency
From: Yasuaki Ishimatsu When calling unregister_node(), the function shows following message at device_release(). Device 'node2' does not have a release() function, it is broken and must be fixed. So the patch implements node_device_release() CC: David Rientjes CC: Jiang Liu CC: Len Brown C

[RFC v8 PATCH 13/20] memory-hotplug: check page type in get_page_bootmem

2012-08-28 Thread wency
From: Yasuaki Ishimatsu There is a possibility that get_page_bootmem() is called to the same page many times. So when get_page_bootmem is called to the same page, the function only increments page->_count. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mac

[RFC v8 PATCH 03/20] memory-hotplug: store the node id in acpi_memory_device

2012-08-28 Thread wency
From: Wen Congyang The memory device has only one node id. Store the node id when enable the memory device, and we can reuse it when removing the memory device. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Ki

[RFC v8 PATCH 20/20] memory-hotplug: clear hwpoisoned flag when onlining pages

2012-08-28 Thread wency
From: Wen Congyang hwpoisoned may set when we offline a page by the sysfs interface /sys/devices/system/memory/soft_offline_page or /sys/devices/system/memory/hard_offline_page. If we don't clear this flag when onlining pages, this page can't be freed, and will not in free list. So we can't offli

[RFC v8 PATCH 07/20] memory-hotplug: call acpi_bus_remove() to remove memory device

2012-08-28 Thread wency
From: Wen Congyang The memory device has been ejected and powoffed, so we can call acpi_bus_remove() to remove the memory device from acpi bus. CC: David Rientjes CC: Jiang Liu CC: Len Brown CC: Benjamin Herrenschmidt CC: Paul Mackerras CC: Christoph Lameter Cc: Minchan Kim CC: Andrew Mor

[PATCH V10] powerpc/fsl-pci: Unify pci/pcie initialization code

2012-08-28 Thread Jia Hongtao
We unified the Freescale pci/pcie initialization by changing the fsl_pci to a platform driver. In previous PCI code architecture the initialization routine is called at board_setup_arch stage. Now the initialization is done in probe function which is architectural better. Also It's convenient for a