[RFC PATCH v2, part4 27/39] mm/ppc: prepare for removing num_physpages and simplify mem_init()
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu jiang@huawei.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: Paul Mackerras pau...@samba.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ker...@vger.kernel.org --- arch/powerpc/mm/mem.c | 56 +++-- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 0e154a9..8aba687 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -303,46 +303,27 @@ void __init paging_init(void) void __init mem_init(void) { -#ifdef CONFIG_NEED_MULTIPLE_NODES - int nid; -#endif - pg_data_t *pgdat; - unsigned long i; - struct page *page; - unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize; - #ifdef CONFIG_SWIOTLB swiotlb_init(0); #endif - num_physpages = memblock_phys_mem_size() PAGE_SHIFT; high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); #ifdef CONFIG_NEED_MULTIPLE_NODES -for_each_online_node(nid) { - if (NODE_DATA(nid)-node_spanned_pages != 0) { - printk(freeing bootmem node %d\n, nid); - free_all_bootmem_node(NODE_DATA(nid)); - } + { + pg_data_t *pgdat; + + for_each_online_pgdat(pgdat) + if (pgdat-node_spanned_pages != 0) { + printk(freeing bootmem node %d\n, + pgdat-node_id); + free_all_bootmem_node(pgdat); + } } #else max_mapnr = max_pfn; free_all_bootmem(); #endif - for_each_online_pgdat(pgdat) { - for (i = 0; i pgdat-node_spanned_pages; i++) { - if (!pfn_valid(pgdat-node_start_pfn + i)) - continue; - page = pgdat_page_nr(pgdat, i); - if (PageReserved(page)) - reservedpages++; - } - } - - codesize = (unsigned long)_sdata - (unsigned long)_stext; - datasize = (unsigned long)_edata - (unsigned long)_sdata; - initsize = (unsigned long)__init_end - (unsigned long)__init_begin; - bsssize = (unsigned long)__bss_stop - (unsigned long)__bss_start; #ifdef CONFIG_HIGHMEM { @@ -352,13 +333,9 @@ void __init mem_init(void) for (pfn = highmem_mapnr; pfn max_mapnr; ++pfn) { phys_addr_t paddr = (phys_addr_t)pfn PAGE_SHIFT; struct page *page = pfn_to_page(pfn); - if (memblock_is_reserved(paddr)) - continue; - free_highmem_page(page); - reservedpages--; + if (!memblock_is_reserved(paddr)) + free_highmem_page(page); } - printk(KERN_DEBUG High memory: %luk\n, - totalhigh_pages (PAGE_SHIFT-10)); } #endif /* CONFIG_HIGHMEM */ @@ -371,16 +348,7 @@ void __init mem_init(void) (mfspr(SPRN_TLB1CFG) TLBnCFG_N_ENTRY) - 1; #endif - printk(KERN_INFO Memory: %luk/%luk available (%luk kernel code, - %luk reserved, %luk data, %luk bss, %luk init)\n, - nr_free_pages() (PAGE_SHIFT-10), - num_physpages (PAGE_SHIFT-10), - codesize 10, - reservedpages (PAGE_SHIFT-10), - datasize 10, - bsssize 10, - initsize 10); - + mem_init_print_info(NULL); #ifdef CONFIG_PPC32 pr_info(Kernel virtual memory layout:\n); pr_info( * 0x%08lx..0x%08lx : fixmap\n, FIXADDR_START, FIXADDR_TOP); -- 1.7.9.5 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[RFC PATCH v2, part4 28/39] mm/ppc: prepare for removing num_physpages and simplify mem_init()
Prepare for removing num_physpages and simplify mem_init(). Signed-off-by: Jiang Liu jiang@huawei.com Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: Paul Mackerras pau...@samba.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-ker...@vger.kernel.org --- arch/powerpc/mm/mem.c | 56 +++-- 1 file changed, 12 insertions(+), 44 deletions(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index 0e154a9..8aba687 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -303,46 +303,27 @@ void __init paging_init(void) void __init mem_init(void) { -#ifdef CONFIG_NEED_MULTIPLE_NODES - int nid; -#endif - pg_data_t *pgdat; - unsigned long i; - struct page *page; - unsigned long reservedpages = 0, codesize, initsize, datasize, bsssize; - #ifdef CONFIG_SWIOTLB swiotlb_init(0); #endif - num_physpages = memblock_phys_mem_size() PAGE_SHIFT; high_memory = (void *) __va(max_low_pfn * PAGE_SIZE); #ifdef CONFIG_NEED_MULTIPLE_NODES -for_each_online_node(nid) { - if (NODE_DATA(nid)-node_spanned_pages != 0) { - printk(freeing bootmem node %d\n, nid); - free_all_bootmem_node(NODE_DATA(nid)); - } + { + pg_data_t *pgdat; + + for_each_online_pgdat(pgdat) + if (pgdat-node_spanned_pages != 0) { + printk(freeing bootmem node %d\n, + pgdat-node_id); + free_all_bootmem_node(pgdat); + } } #else max_mapnr = max_pfn; free_all_bootmem(); #endif - for_each_online_pgdat(pgdat) { - for (i = 0; i pgdat-node_spanned_pages; i++) { - if (!pfn_valid(pgdat-node_start_pfn + i)) - continue; - page = pgdat_page_nr(pgdat, i); - if (PageReserved(page)) - reservedpages++; - } - } - - codesize = (unsigned long)_sdata - (unsigned long)_stext; - datasize = (unsigned long)_edata - (unsigned long)_sdata; - initsize = (unsigned long)__init_end - (unsigned long)__init_begin; - bsssize = (unsigned long)__bss_stop - (unsigned long)__bss_start; #ifdef CONFIG_HIGHMEM { @@ -352,13 +333,9 @@ void __init mem_init(void) for (pfn = highmem_mapnr; pfn max_mapnr; ++pfn) { phys_addr_t paddr = (phys_addr_t)pfn PAGE_SHIFT; struct page *page = pfn_to_page(pfn); - if (memblock_is_reserved(paddr)) - continue; - free_highmem_page(page); - reservedpages--; + if (!memblock_is_reserved(paddr)) + free_highmem_page(page); } - printk(KERN_DEBUG High memory: %luk\n, - totalhigh_pages (PAGE_SHIFT-10)); } #endif /* CONFIG_HIGHMEM */ @@ -371,16 +348,7 @@ void __init mem_init(void) (mfspr(SPRN_TLB1CFG) TLBnCFG_N_ENTRY) - 1; #endif - printk(KERN_INFO Memory: %luk/%luk available (%luk kernel code, - %luk reserved, %luk data, %luk bss, %luk init)\n, - nr_free_pages() (PAGE_SHIFT-10), - num_physpages (PAGE_SHIFT-10), - codesize 10, - reservedpages (PAGE_SHIFT-10), - datasize 10, - bsssize 10, - initsize 10); - + mem_init_print_info(NULL); #ifdef CONFIG_PPC32 pr_info(Kernel virtual memory layout:\n); pr_info( * 0x%08lx..0x%08lx : fixmap\n, FIXADDR_START, FIXADDR_TOP); -- 1.7.9.5 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/2] cpufreq: Notify all policy-cpus in cpufreq_notify_transition()
On 24 March 2013 20:07, Francesco Lavra francescolavra...@gmail.com wrote: On 03/24/2013 02:48 PM, Viresh Kumar wrote: policy-cpus contains all online cpus that have single shared clock line. And their frequencies are always updated together. Many SMP system's cpufreq drivers take care of this in individual drivers but the best place for this code is in cpufreq core. This patch modifies cpufreq_notify_transition() to notify frequency change for all cpus in policy-cpus and hence updates all users of this API. One thing about this work. I compiled it for ARM and Intel. Also this stuff is tested by Fengguang Wu fengguang...@intel.com automated build system. I am not sure if that builds all architectures or not. I tried to review my patch closely but their can be some minor mistakes. I thought of adding this in the patch details but forgot at last. Is their a simple way to compile stuff for all platforms? Sorry i am not aware of it :( diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c + ret = cpu_set_cclk(policy-cpu, freqs.new * 1000); + if (ret != 0) { + WARN_ONCE(ret, cpufreq set freq failed %d\n, ret); + break; This doesn't even compile, as the break statement isn't in the for_each_online_cpu() loop anymore. I tried to review it very carefully but this situation was a bit tricky :) Thanks for trying it out. Following should fix it for you: commit 942ca8a6bc87e3c42beabc9102755136493e5355 Author: Viresh Kumar viresh.ku...@linaro.org Date: Sun Mar 24 20:21:43 2013 +0530 fixup! cpufreq: Notify all policy-cpus in cpufreq_notify_transition() --- arch/blackfin/mach-common/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c index 4e67368..995511e80 100644 --- a/arch/blackfin/mach-common/cpufreq.c +++ b/arch/blackfin/mach-common/cpufreq.c @@ -164,7 +164,7 @@ static int bfin_target(struct cpufreq_policy *policy, ret = cpu_set_cclk(policy-cpu, freqs.new * 1000); if (ret != 0) { WARN_ONCE(ret, cpufreq set freq failed %d\n, ret); - break; + return ret; } #endif on_each_cpu(bfin_adjust_core_timer, index, 1); @Rafael: Let me add fixups for now, i will send final patch later after others also review their part. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/2] cpufreq: Notify all policy-cpus in cpufreq_notify_transition()
On Sunday, March 24, 2013 08:23:27 PM Viresh Kumar wrote: On 24 March 2013 20:07, Francesco Lavra francescolavra...@gmail.com wrote: On 03/24/2013 02:48 PM, Viresh Kumar wrote: policy-cpus contains all online cpus that have single shared clock line. And their frequencies are always updated together. Many SMP system's cpufreq drivers take care of this in individual drivers but the best place for this code is in cpufreq core. This patch modifies cpufreq_notify_transition() to notify frequency change for all cpus in policy-cpus and hence updates all users of this API. One thing about this work. I compiled it for ARM and Intel. Also this stuff is tested by Fengguang Wu fengguang...@intel.com automated build system. I am not sure if that builds all architectures or not. I tried to review my patch closely but their can be some minor mistakes. I thought of adding this in the patch details but forgot at last. Is their a simple way to compile stuff for all platforms? Sorry i am not aware of it :( diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c + ret = cpu_set_cclk(policy-cpu, freqs.new * 1000); + if (ret != 0) { + WARN_ONCE(ret, cpufreq set freq failed %d\n, ret); + break; This doesn't even compile, as the break statement isn't in the for_each_online_cpu() loop anymore. I tried to review it very carefully but this situation was a bit tricky :) Thanks for trying it out. Following should fix it for you: commit 942ca8a6bc87e3c42beabc9102755136493e5355 Author: Viresh Kumar viresh.ku...@linaro.org Date: Sun Mar 24 20:21:43 2013 +0530 fixup! cpufreq: Notify all policy-cpus in cpufreq_notify_transition() --- arch/blackfin/mach-common/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c index 4e67368..995511e80 100644 --- a/arch/blackfin/mach-common/cpufreq.c +++ b/arch/blackfin/mach-common/cpufreq.c @@ -164,7 +164,7 @@ static int bfin_target(struct cpufreq_policy *policy, ret = cpu_set_cclk(policy-cpu, freqs.new * 1000); if (ret != 0) { WARN_ONCE(ret, cpufreq set freq failed %d\n, ret); - break; + return ret; } #endif on_each_cpu(bfin_adjust_core_timer, index, 1); @Rafael: Let me add fixups for now, i will send final patch later after others also review their part. OK -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 0/2] Fix for mv643xx_eth built as module
Hello Simon, Le dimanche 24 mars 2013 21:33:58, Simon Baatz a écrit : Recently [1], mv643xx_eth was changed to make use of mvmdio. However, this change introduces two problems when mvmdio and mv643xx_eth are built as modules: - mvmdio is not loaded automatically by udev - mv643xx_eth oopses when it can't find its PHY, i.e. when mvmdio is not yet loaded The first problem can be fixed easily by adding a module alias for the respective platform device. The proposed fix for the second problem uses EPROBE_DEFER as suggested by Thomas Petazzoni when the driver can't find its PHY. These patches apply on top of Florian Fainelli's patchset. They have been tested on Marvel Kirkwood non-DT. Both fixes look good to me, thanks for fixing this! Acked-by: Florian Fainelli flor...@openwrt.org -- Florian ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 0/2] Fix for mv643xx_eth built as module
From: Florian Fainelli flor...@openwrt.org Date: Sun, 24 Mar 2013 21:48:33 +0100 Hello Simon, Le dimanche 24 mars 2013 21:33:58, Simon Baatz a écrit : Recently [1], mv643xx_eth was changed to make use of mvmdio. However, this change introduces two problems when mvmdio and mv643xx_eth are built as modules: - mvmdio is not loaded automatically by udev - mv643xx_eth oopses when it can't find its PHY, i.e. when mvmdio is not yet loaded The first problem can be fixed easily by adding a module alias for the respective platform device. The proposed fix for the second problem uses EPROBE_DEFER as suggested by Thomas Petazzoni when the driver can't find its PHY. These patches apply on top of Florian Fainelli's patchset. They have been tested on Marvel Kirkwood non-DT. Both fixes look good to me, thanks for fixing this! Acked-by: Florian Fainelli flor...@openwrt.org All applied, thanks. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/2] cpufreq: Notify all policy-cpus in cpufreq_notify_transition()
On 03/24/2013 02:48 PM, Viresh Kumar wrote: policy-cpus contains all online cpus that have single shared clock line. And their frequencies are always updated together. Many SMP system's cpufreq drivers take care of this in individual drivers but the best place for this code is in cpufreq core. This patch modifies cpufreq_notify_transition() to notify frequency change for all cpus in policy-cpus and hence updates all users of this API. Signed-off-by: Viresh Kumar viresh.ku...@linaro.org Cc: Sekhar Nori nsek...@ti.com Cc: Sascha Hauer ker...@pengutronix.de Cc: Eric Miao eric.y.m...@gmail.com Cc: Haojian Zhuang haojian.zhu...@gmail.com Cc: Ben Dooks ben-li...@fluff.org Cc: Kukjin Kim kgene@samsung.com Cc: Stephen Warren swar...@wwwdotorg.org Cc: Haavard Skinnemoen hskinnem...@gmail.com Cc: Hans-Christian Egtvedt egtv...@samfundet.no Cc: Mike Frysinger vap...@gentoo.org Cc: Mikael Starvik star...@axis.com Cc: Jesper Nilsson jesper.nils...@axis.com Cc: Tony Luck tony.l...@intel.com Cc: Fenghua Yu fenghua...@intel.com Cc: Arnd Bergmann a...@arndb.de Cc: Benjamin Herrenschmidt b...@kernel.crashing.org Cc: Ralf Baechle r...@linux-mips.org Cc: Paul Mundt let...@linux-sh.org Cc: David S. Miller da...@davemloft.net Cc: Thomas Renninger tr...@suse.de Cc: Borislav Petkov b...@alien8.de Cc: Guan Xuetao g...@mprc.pku.edu.cn Cc: linux-arm-ker...@lists.infradead.org Cc: linux-cris-ker...@axis.com Cc: linux-i...@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: cbe-oss-...@lists.ozlabs.org Cc: linux-m...@linux-mips.org Cc: linux...@vger.kernel.org Cc: sparcli...@vger.kernel.org Cc: linux-ker...@vger.kernel.org --- arch/arm/mach-davinci/cpufreq.c | 5 +- arch/arm/mach-imx/cpufreq.c | 5 +- arch/arm/mach-integrator/cpu.c | 6 +-- arch/arm/mach-pxa/cpufreq-pxa2xx.c | 5 +- arch/arm/mach-pxa/cpufreq-pxa3xx.c | 5 +- arch/arm/mach-s3c24xx/cpufreq.c | 8 +-- arch/arm/mach-sa1100/cpu-sa1100.c| 5 +- arch/arm/mach-sa1100/cpu-sa1110.c| 5 +- arch/arm/mach-tegra/cpu-tegra.c | 6 +-- arch/avr32/mach-at32ap/cpufreq.c | 5 +- arch/blackfin/mach-common/cpufreq.c | 79 arch/cris/arch-v32/mach-a3/cpufreq.c | 20 +++ arch/cris/arch-v32/mach-fs/cpufreq.c | 17 +++--- arch/ia64/kernel/cpufreq/acpi-cpufreq.c | 22 arch/mips/kernel/cpufreq/loongson2_cpufreq.c | 5 +- arch/powerpc/platforms/cell/cbe_cpufreq.c| 5 +- arch/powerpc/platforms/pasemi/cpufreq.c | 5 +- arch/powerpc/platforms/powermac/cpufreq_32.c | 14 ++--- arch/powerpc/platforms/powermac/cpufreq_64.c | 5 +- arch/sh/kernel/cpufreq.c | 5 +- arch/sparc/kernel/us2e_cpufreq.c | 13 ++--- arch/sparc/kernel/us3_cpufreq.c | 13 ++--- arch/unicore32/kernel/cpu-ucv2.c | 5 +- drivers/cpufreq/acpi-cpufreq.c | 11 +--- drivers/cpufreq/cpufreq-cpu0.c | 12 ++--- drivers/cpufreq/cpufreq-nforce2.c| 5 +- drivers/cpufreq/cpufreq.c| 45 +--- drivers/cpufreq/dbx500-cpufreq.c | 6 +-- drivers/cpufreq/e_powersaver.c | 11 ++-- drivers/cpufreq/elanfreq.c | 10 ++-- drivers/cpufreq/exynos-cpufreq.c | 7 +-- drivers/cpufreq/gx-suspmod.c | 11 ++-- drivers/cpufreq/imx6q-cpufreq.c | 12 ++--- drivers/cpufreq/kirkwood-cpufreq.c | 10 ++-- drivers/cpufreq/longhaul.c | 18 --- drivers/cpufreq/maple-cpufreq.c | 5 +- drivers/cpufreq/omap-cpufreq.c | 11 +--- drivers/cpufreq/p4-clockmod.c| 10 +--- drivers/cpufreq/pcc-cpufreq.c| 5 +- drivers/cpufreq/powernow-k6.c| 12 ++--- drivers/cpufreq/powernow-k7.c| 10 ++-- drivers/cpufreq/powernow-k8.c| 16 +++--- drivers/cpufreq/s3c2416-cpufreq.c| 5 +- drivers/cpufreq/s3c64xx-cpufreq.c| 7 ++- drivers/cpufreq/s5pv210-cpufreq.c| 5 +- drivers/cpufreq/sc520_freq.c | 10 ++-- drivers/cpufreq/spear-cpufreq.c | 7 +-- drivers/cpufreq/speedstep-centrino.c | 24 ++--- drivers/cpufreq/speedstep-ich.c | 12 + drivers/cpufreq/speedstep-smi.c | 5 +- include/linux/cpufreq.h | 4 +- 51 files changed, 232 insertions(+), 337 deletions(-) [...] diff --git a/arch/blackfin/mach-common/cpufreq.c b/arch/blackfin/mach-common/cpufreq.c index d88bd31..4e67368 100644 --- a/arch/blackfin/mach-common/cpufreq.c +++ b/arch/blackfin/mach-common/cpufreq.c @@ -127,13 +127,13 @@ unsigned long cpu_set_cclk(int cpu, unsigned long new) } #endif -static int bfin_target(struct
[PATCH 0/2] Fix for mv643xx_eth built as module
Recently [1], mv643xx_eth was changed to make use of mvmdio. However, this change introduces two problems when mvmdio and mv643xx_eth are built as modules: - mvmdio is not loaded automatically by udev - mv643xx_eth oopses when it can't find its PHY, i.e. when mvmdio is not yet loaded The first problem can be fixed easily by adding a module alias for the respective platform device. The proposed fix for the second problem uses EPROBE_DEFER as suggested by Thomas Petazzoni when the driver can't find its PHY. These patches apply on top of Florian Fainelli's patchset. They have been tested on Marvel Kirkwood non-DT. - Simon [1] https://lkml.org/lkml/2013/3/22/247 Simon Baatz (2): net: mvmdio: define module alias for platform device mv643xx_eth: defer probing if Marvell Orion MDIO driver not loaded drivers/net/ethernet/marvell/mv643xx_eth.c | 12 +--- drivers/net/ethernet/marvell/mvmdio.c |1 + 2 files changed, 10 insertions(+), 3 deletions(-) -- 1.7.9.5 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 2/2] mv643xx_eth: defer probing if Marvell Orion MDIO driver not loaded
When both the Marvell MV643XX ethernet driver and the Orion MDIO driver are compiled as modules, the ethernet driver may be probed before the MDIO driver. Let mv643xx_eth_probe() return EPROBE_DEFER in this case, i.e. when it cannot find the PHY. Signed-off-by: Simon Baatz gmbno...@gmail.com --- drivers/net/ethernet/marvell/mv643xx_eth.c | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index a65a92e..aedbd82 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c @@ -2681,7 +2681,7 @@ static struct phy_device *phy_scan(struct mv643xx_eth_private *mp, } /* Attempt to connect to the PHY using orion-mdio */ - phydev = NULL; + phydev = ERR_PTR(-ENODEV); for (i = 0; i num; i++) { int addr = (start + i) 0x1f; @@ -2812,11 +2812,17 @@ static int mv643xx_eth_probe(struct platform_device *pdev) netif_set_real_num_tx_queues(dev, mp-txq_count); netif_set_real_num_rx_queues(dev, mp-rxq_count); - if (pd-phy_addr != MV643XX_ETH_PHY_NONE) + if (pd-phy_addr != MV643XX_ETH_PHY_NONE) { mp-phy = phy_scan(mp, pd-phy_addr); - if (mp-phy != NULL) + if (IS_ERR(mp-phy)) { + err = PTR_ERR(mp-phy); + if (err == -ENODEV) + err = -EPROBE_DEFER; + goto out; + } phy_init(mp, pd-speed, pd-duplex); + } SET_ETHTOOL_OPS(dev, mv643xx_eth_ethtool_ops); -- 1.7.9.5 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH 1/2] net: mvmdio: define module alias for platform device
The mvmdio driver can be instantiated using device tree or as a classic platform device. In order to load the driver automatically by udev in the latter case, the driver needs to define a module alias for the platform device. Signed-off-by: Simon Baatz gmbno...@gmail.com --- drivers/net/ethernet/marvell/mvmdio.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c index 3472574..7b5158f 100644 --- a/drivers/net/ethernet/marvell/mvmdio.c +++ b/drivers/net/ethernet/marvell/mvmdio.c @@ -295,3 +295,4 @@ module_platform_driver(orion_mdio_driver); MODULE_DESCRIPTION(Marvell MDIO interface driver); MODULE_AUTHOR(Thomas Petazzoni thomas.petazz...@free-electrons.com); MODULE_LICENSE(GPL); +MODULE_ALIAS(platform:orion-mdio); -- 1.7.9.5 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [Suggestion] PowerPC: kernel: cross compiling issue with allmodconfig
Chen Gang gang.c...@asianux.com wrote: On 2013年03月22日 06:54, Michael Neuling wrote: This is great, thanks a lot. If you want this to be picked up by the maintainer, you'll need to add your signed-off-by. The signed-off-by is to indicate that your happy for it to be included and that you're legally allowed to do so. See http://gerrit.googlecode.com/svn/documentation/2.0/user-signedoffby.html for more info. Mikey thanks, too. I prefer Benjamin to have a closer look for my fixing. if pass his checking, I will send a patch. (he is on vacation, now, and he will check it when he is back). benh asked paulus or sfr to send in while he was away. So please send your signed off by now (if you can), or someone is going to rewrite it, sent it upstream bypassing you. Mikey ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] PPC: define the conditions where the ePAPR idle hcall can be supported
Stuart Yoder stuart.yo...@freescale.com wrote: From: Stuart Yoder stuart.yo...@freescale.com For 32-bit, CONFIG_EPAPR_PARAVIRT pulls in both epapr_paravirt.c and epapr_hcalls.c which contains the 32-bit paravirt idle loop. For 64-bit, the paravirt idle loop is in idle_book3e.S and that source file is included only if CONFIG_PPC_BOOK3E_64 defined. This patch makes that dependency for 64-bit explicit. Signed-off-by: Stuart Yoder stuart.yo...@freescale.com It works for me. Thanks. --- arch/powerpc/kernel/epapr_paravirt.c |6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/epapr_paravirt.c b/arch/powerpc/kernel/epapr_paravirt.c index f3eab85..d44a571 100644 --- a/arch/powerpc/kernel/epapr_paravirt.c +++ b/arch/powerpc/kernel/epapr_paravirt.c @@ -23,8 +23,10 @@ #include asm/code-patching.h #include asm/machdep.h +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) extern void epapr_ev_idle(void); extern u32 epapr_ev_idle_start[]; +#endif You don't need this #ifdef bool epapr_paravirt_enabled; @@ -47,11 +49,15 @@ static int __init epapr_paravirt_init(void) for (i = 0; i (len / 4); i++) { patch_instruction(epapr_hypercall_start + i, insts[i]); +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) patch_instruction(epapr_ev_idle_start + i, insts[i]); +#endif } +#if !defined(CONFIG_64BIT) || defined(CONFIG_PPC_BOOK3E_64) if (of_get_property(hyper_node, has-idle, NULL)) ppc_md.power_save = epapr_ev_idle; +#endif epapr_paravirt_enabled = true; -- 1.7.9.7 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] PowerPC:kernel: make additional room in exception vector area
The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function) Signed-off-by: Chen Gang gang.c...@asianux.com --- arch/powerpc/kernel/exceptions-64s.S | 144 +- 1 files changed, 72 insertions(+), 72 deletions(-) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 200afa5..56bd923 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -1066,78 +1066,6 @@ unrecov_user_slb: #endif /* __DISABLED__ */ -/* - * r13 points to the PACA, r9 contains the saved CR, - * r12 contain the saved SRR1, SRR0 is still ready for return - * r3 has the faulting address - * r9 - r13 are saved in paca-exslb. - * r3 is saved in paca-slb_r3 - * We assume we aren't going to take any exceptions during this procedure. - */ -_GLOBAL(slb_miss_realmode) - mflrr10 -#ifdef CONFIG_RELOCATABLE - mtctr r11 -#endif - - stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ - std r10,PACA_EXSLB+EX_LR(r13) /* save LR */ - - bl .slb_allocate_realmode - - /* All done -- return from exception. */ - - ld r10,PACA_EXSLB+EX_LR(r13) - ld r3,PACA_EXSLB+EX_R3(r13) - lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ - - mtlrr10 - - andi. r10,r12,MSR_RI /* check for unrecoverable exception */ - beq-2f - -.machine push -.machine power4 - mtcrf 0x80,r9 - mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ -.machine pop - - RESTORE_PPR_PACA(PACA_EXSLB, r9) - ld r9,PACA_EXSLB+EX_R9(r13) - ld r10,PACA_EXSLB+EX_R10(r13) - ld r11,PACA_EXSLB+EX_R11(r13) - ld r12,PACA_EXSLB+EX_R12(r13) - ld r13,PACA_EXSLB+EX_R13(r13) - rfid - b . /* prevent speculative execution */ - -2: mfspr r11,SPRN_SRR0 - ld r10,PACAKBASE(r13) - LOAD_HANDLER(r10,unrecov_slb) - mtspr SPRN_SRR0,r10 - ld r10,PACAKMSR(r13) - mtspr SPRN_SRR1,r10 - rfid - b . - -unrecov_slb: - EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB) - DISABLE_INTS - bl .save_nvgprs -1: addir3,r1,STACK_FRAME_OVERHEAD - bl .unrecoverable_exception - b 1b - - -#ifdef CONFIG_PPC_970_NAP -power4_fixup_nap: - andcr9,r9,r10 - std r9,TI_LOCAL_FLAGS(r11) - ld r10,_LINK(r1) /* make idle task do the */ - std r10,_NIP(r1)/* equivalent of a blr */ - blr -#endif - .align 7 .globl alignment_common alignment_common: @@ -1336,6 +1264,78 @@ _GLOBAL(opal_mc_secondary_handler) /* + * r13 points to the PACA, r9 contains the saved CR, + * r12 contain the saved SRR1, SRR0 is still ready for return + * r3 has the faulting address + * r9 - r13 are saved in paca-exslb. + * r3 is saved in paca-slb_r3 + * We assume we aren't going to take any exceptions during this procedure. + */ +_GLOBAL(slb_miss_realmode) + mflrr10 +#ifdef CONFIG_RELOCATABLE + mtctr r11 +#endif + + stw r9,PACA_EXSLB+EX_CCR(r13) /* save CR in exc. frame */ + std r10,PACA_EXSLB+EX_LR(r13) /* save LR */ + + bl .slb_allocate_realmode + + /* All done -- return from exception. */ + + ld r10,PACA_EXSLB+EX_LR(r13) + ld r3,PACA_EXSLB+EX_R3(r13) + lwz r9,PACA_EXSLB+EX_CCR(r13) /* get saved CR */ + + mtlrr10 + + andi. r10,r12,MSR_RI /* check for unrecoverable exception */ + beq-2f + +.machine push +.machine power4 + mtcrf 0x80,r9 + mtcrf 0x01,r9 /* slb_allocate uses cr0 and cr7 */ +.machine pop + + RESTORE_PPR_PACA(PACA_EXSLB, r9) + ld r9,PACA_EXSLB+EX_R9(r13) + ld r10,PACA_EXSLB+EX_R10(r13) + ld r11,PACA_EXSLB+EX_R11(r13) + ld r12,PACA_EXSLB+EX_R12(r13) + ld r13,PACA_EXSLB+EX_R13(r13) + rfid + b . /* prevent speculative execution */ + +2: mfspr r11,SPRN_SRR0 + ld r10,PACAKBASE(r13) + LOAD_HANDLER(r10,unrecov_slb) + mtspr SPRN_SRR0,r10 + ld r10,PACAKMSR(r13) + mtspr SPRN_SRR1,r10 + rfid + b . + +unrecov_slb: + EXCEPTION_PROLOG_COMMON(0x4100, PACA_EXSLB) + DISABLE_INTS + bl .save_nvgprs +1: addir3,r1,STACK_FRAME_OVERHEAD + bl .unrecoverable_exception + b 1b + + +#ifdef CONFIG_PPC_970_NAP +power4_fixup_nap: + andcr9,r9,r10 + std r9,TI_LOCAL_FLAGS(r11) + ld r10,_LINK(r1) /* make idle task do the */ + std
[PATCH v2] powerpc/dts: Fix the dts for p1025rdb 36bit
fix the following errors: Error: arch/powerpc/boot/dts/p1025rdb.dtsi:326.2-3 label or path, 'qe', not found Error: arch/powerpc/boot/dts/fsl/p1021si-post.dtsi:242.2-3 label or path, 'qe', not found FATAL ERROR: Syntax error parsing input tree Signed-off-by: Zhicheng Fan b32...@freescale.com --- arch/powerpc/boot/dts/p1025rdb_36b.dts |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/boot/dts/p1025rdb_36b.dts b/arch/powerpc/boot/dts/p1025rdb_36b.dts index 4ce4bfa..06deb6f 100644 --- a/arch/powerpc/boot/dts/p1025rdb_36b.dts +++ b/arch/powerpc/boot/dts/p1025rdb_36b.dts @@ -82,6 +82,11 @@ 0x0 0x10; }; }; + + qe: qe@fffe8 { + status = disabled; /* no firmware loaded */ + }; + }; /include/ p1025rdb.dtsi -- 1.7.0.4 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] PowerPC:kernel: section mismatch from smp_release_cpus to __initdata spinning_secondaries
Hello Maintainers: could you help check this patch whether is ok ? thanks. On 2013年03月20日 14:30, Chen Gang wrote: the smp_release_cpus is a normal funciton and called in normal environments, but it calls the __initdata spinning_secondaries. need modify spinning_secondaries to match smp_release_cpus. the related warning: (the linker report boot_paca.33377, but it should be spinning_secondaries) - WARNING: arch/powerpc/kernel/built-in.o(.text+0x23176): Section mismatch in reference from the function .smp_release_cpus() to the variable .init.data:boot_paca.33377 The function .smp_release_cpus() references the variable __initdata boot_paca.33377. This is often because .smp_release_cpus lacks a __initdata annotation or the annotation of boot_paca.33377 is wrong. WARNING: arch/powerpc/kernel/built-in.o(.text+0x231fe): Section mismatch in reference from the function .smp_release_cpus() to the variable .init.data:boot_paca.33377 The function .smp_release_cpus() references the variable __initdata boot_paca.33377. This is often because .smp_release_cpus lacks a __initdata annotation or the annotation of boot_paca.33377 is wrong. - Signed-off-by: Chen Gang gang.c...@asianux.com --- arch/powerpc/kernel/setup_64.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 75fbaceb..e8a2f2e 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -76,7 +76,7 @@ #endif int boot_cpuid = 0; -int __initdata spinning_secondaries; +int spinning_secondaries; u64 ppc64_pft_size; /* Pick defaults since we might want to patch instructions -- Chen Gang Asianux Corporation ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] arch/powerpc/kernel: using %12.12s instead of %12s for avoiding memory overflow.
Hello Maintainers: could you help check this patch whether is ok ? thanks. On 2013年02月17日 12:00, Chen Gang wrote: Hello relative members: please give a glance to this patch, when you have time. thanks. :-) gchen. 于 2013年01月24日 12:14, Chen Gang 写道: for tmp_part-header.name: it is Terminating null required only for names 12 chars. so need to limit the %.12s for it in printk additional info: %12s limit the width, not for the original string output length if name length is more than 12, it still can be fully displayed. if name length is less than 12, the ' ' will be filled before name. %.12s truly limit the original string output length (precision) Signed-off-by: Chen Gang gang.c...@asianux.com --- arch/powerpc/kernel/nvram_64.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index bec1e93..57bf6d2 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c @@ -202,7 +202,7 @@ static void __init nvram_print_partitions(char * label) printk(KERN_WARNING %s-\n, label); printk(KERN_WARNING indx\t\tsig\tchks\tlen\tname\n); list_for_each_entry(tmp_part, nvram_partitions, partition) { -printk(KERN_WARNING %4d\t%02x\t%02x\t%d\t%12s\n, +printk(KERN_WARNING %4d\t%02x\t%02x\t%d\t%12.12s\n, tmp_part-index, tmp_part-header.signature, tmp_part-header.checksum, tmp_part-header.length, tmp_part-header.name); -- Chen Gang Asianux Corporation ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] PowerPC:kernel: make additional room in exception vector area
Hi all, On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang gang.c...@asianux.com wrote: The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function) Signed-off-by: Chen Gang gang.c...@asianux.com --- arch/powerpc/kernel/exceptions-64s.S | 144 +- 1 files changed, 72 insertions(+), 72 deletions(-) Thanks, Chen, I have applied this to linux-next today and pending the builds overnight, will send it to Linus tomorrow or Wednesday. -- Cheers, Stephen Rothwells...@canb.auug.org.au pgpo459H6LW_Y.pgp Description: PGP signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/2] cpufreq: Notify all policy-cpus in cpufreq_notify_transition()
On 24 March 2013 19:18, Viresh Kumar viresh.ku...@linaro.org wrote: policy-cpus contains all online cpus that have single shared clock line. And their frequencies are always updated together. Many SMP system's cpufreq drivers take care of this in individual drivers but the best place for this code is in cpufreq core. This patch modifies cpufreq_notify_transition() to notify frequency change for all cpus in policy-cpus and hence updates all users of this API. Another fixup for tegra: diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c index 3b441d6..11ca730 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -106,7 +106,8 @@ out: return ret; } -static int tegra_update_cpu_speed(unsigned long rate) +static int tegra_update_cpu_speed(struct cpufreq_policy *policy, + unsigned long rate) { int ret = 0; struct cpufreq_freqs freqs; @@ -179,7 +180,7 @@ static int tegra_target(struct cpufreq_policy *policy, target_cpu_speed[policy-cpu] = freq; - ret = tegra_update_cpu_speed(tegra_cpu_highest_speed()); + ret = tegra_update_cpu_speed(policy, tegra_cpu_highest_speed()); out: mutex_unlock(tegra_cpu_lock); @@ -191,10 +192,12 @@ static int tegra_pm_notify(struct notifier_block *nb, unsigned long event, { mutex_lock(tegra_cpu_lock); if (event == PM_SUSPEND_PREPARE) { + struct cpufreq_policy *policy = cpufreq_cpu_get(0); is_suspended = true; pr_info(Tegra cpufreq suspend: setting frequency to %d kHz\n, freq_table[0].frequency); - tegra_update_cpu_speed(freq_table[0].frequency); + tegra_update_cpu_speed(policy, freq_table[0].frequency); + cpufreq_cpu_put(policy); } else if (event == PM_POST_SUSPEND) { is_suspended = false; } ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] PowerPC:kernel: make additional room in exception vector area
On 2013年03月25日 13:14, Stephen Rothwell wrote: Hi all, On Mon, 25 Mar 2013 09:31:31 +0800 Chen Gang gang.c...@asianux.com wrote: The FWNMI region is fixed at 0x7000 and the vector are now overflowing that with allmodconfig. Fix that by moving slb_miss_realmode code out of that region as it doesn't need to be that close to the call sites (it is a _GLOBAL function) Signed-off-by: Chen Gang gang.c...@asianux.com --- arch/powerpc/kernel/exceptions-64s.S | 144 +- 1 files changed, 72 insertions(+), 72 deletions(-) Thanks, Chen, I have applied this to linux-next today and pending the builds overnight, will send it to Linus tomorrow or Wednesday. thanks. :-) -- Chen Gang Asianux Corporation ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev