* [PATCH V2 2/2] powerpc/mm: Fix compile error of pgtable-ppc64.h
From: Aneesh Kumar K.V @ 2014-01-31 10:29 UTC (permalink / raw)
To: benh, paulus, stable; +Cc: linuxppc-dev, Aneesh Kumar K.V, Li Zhong
In-Reply-To: <1391164141-14073-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
From: Li Zhong <zhong@linux.vnet.ibm.com>
It seems that forward declaration couldn't work well with typedef, use
struct spinlock directly to avoiding following build errors:
In file included from include/linux/spinlock.h:81,
from include/linux/seqlock.h:35,
from include/linux/time.h:5,
from include/uapi/linux/timex.h:56,
from include/linux/timex.h:56,
from include/linux/sched.h:17,
from arch/powerpc/kernel/asm-offsets.c:17:
include/linux/spinlock_types.h:76: error: redefinition of typedef 'spinlock_t'
/root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here
upstream sha1:fd120dc2e205d2318a8b47d6d8098b789e3af67d
for 3.13 stable series
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/pgtable-ppc64.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index d27960c89a71..bc141c950b1e 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -560,9 +560,9 @@ extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp);
#define pmd_move_must_withdraw pmd_move_must_withdraw
-typedef struct spinlock spinlock_t;
-static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
- spinlock_t *old_pmd_ptl)
+struct spinlock;
+static inline int pmd_move_must_withdraw(struct spinlock *new_pmd_ptl,
+ struct spinlock *old_pmd_ptl)
{
/*
* Archs like ppc64 use pgtable to store per pmd
--
1.8.3.2
^ permalink raw reply related
* [PATCH V2 1/2] powerpc/thp: Fix crash on mremap
From: Aneesh Kumar K.V @ 2014-01-31 10:29 UTC (permalink / raw)
To: benh, paulus, stable; +Cc: linuxppc-dev, Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
This patch fix the below crash
NIP [c00000000004cee4] .__hash_page_thp+0x2a4/0x440
LR [c0000000000439ac] .hash_page+0x18c/0x5e0
...
Call Trace:
[c000000736103c40] [00001ffffb000000] 0x1ffffb000000(unreliable)
[437908.479693] [c000000736103d50] [c0000000000439ac] .hash_page+0x18c/0x5e0
[437908.479699] [c000000736103e30] [c00000000000924c] .do_hash_page+0x4c/0x58
On ppc64 we use the pgtable for storing the hpte slot information and
store address to the pgtable at a constant offset (PTRS_PER_PMD) from
pmd. On mremap, when we switch the pmd, we need to withdraw and deposit
the pgtable again, so that we find the pgtable at PTRS_PER_PMD offset
from new pmd.
We also want to move the withdraw and deposit before the set_pmd so
that, when page fault find the pmd as trans huge we can be sure that
pgtable can be located at the offset.
upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f
for 3.13 stable series
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/pgtable-ppc64.h | 14 ++++++++++++++
include/asm-generic/pgtable.h | 12 ++++++++++++
mm/huge_memory.c | 14 +++++---------
3 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 4a191c472867..d27960c89a71 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -558,5 +558,19 @@ extern pgtable_t pgtable_trans_huge_withdraw(struct mm_struct *mm, pmd_t *pmdp);
#define __HAVE_ARCH_PMDP_INVALIDATE
extern void pmdp_invalidate(struct vm_area_struct *vma, unsigned long address,
pmd_t *pmdp);
+
+#define pmd_move_must_withdraw pmd_move_must_withdraw
+typedef struct spinlock spinlock_t;
+static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
+ spinlock_t *old_pmd_ptl)
+{
+ /*
+ * Archs like ppc64 use pgtable to store per pmd
+ * specific information. So when we switch the pmd,
+ * we should also withdraw and deposit the pgtable
+ */
+ return true;
+}
+
#endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_PGTABLE_PPC64_H_ */
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index db0923458940..8e4f41d9af4d 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -558,6 +558,18 @@ static inline pmd_t pmd_read_atomic(pmd_t *pmdp)
}
#endif
+#ifndef pmd_move_must_withdraw
+static inline int pmd_move_must_withdraw(spinlock_t *new_pmd_ptl,
+ spinlock_t *old_pmd_ptl)
+{
+ /*
+ * With split pmd lock we also need to move preallocated
+ * PTE page table if new_pmd is on different PMD page table.
+ */
+ return new_pmd_ptl != old_pmd_ptl;
+}
+#endif
+
/*
* This function is meant to be used by sites walking pagetables with
* the mmap_sem hold in read mode to protect against MADV_DONTNEED and
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 95d1acb0f3d2..5d80c53b87cb 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1502,19 +1502,15 @@ int move_huge_pmd(struct vm_area_struct *vma, struct vm_area_struct *new_vma,
spin_lock_nested(new_ptl, SINGLE_DEPTH_NESTING);
pmd = pmdp_get_and_clear(mm, old_addr, old_pmd);
VM_BUG_ON(!pmd_none(*new_pmd));
- set_pmd_at(mm, new_addr, new_pmd, pmd_mksoft_dirty(pmd));
- if (new_ptl != old_ptl) {
- pgtable_t pgtable;
- /*
- * Move preallocated PTE page table if new_pmd is on
- * different PMD page table.
- */
+ if (pmd_move_must_withdraw(new_ptl, old_ptl)) {
+ pgtable_t pgtable;
pgtable = pgtable_trans_huge_withdraw(mm, old_pmd);
pgtable_trans_huge_deposit(mm, new_pmd, pgtable);
-
- spin_unlock(new_ptl);
}
+ set_pmd_at(mm, new_addr, new_pmd, pmd_mksoft_dirty(pmd));
+ if (new_ptl != old_ptl)
+ spin_unlock(new_ptl);
spin_unlock(old_ptl);
}
out:
--
1.8.3.2
^ permalink raw reply related
* [PATCH 2/2][v8] powerpc/config: Enable memory driver
From: Prabhakar Kushwaha @ 2014-01-31 9:40 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Prabhakar Kushwaha
As Freescale IFC controller has been moved to driver to driver/memory.
So enable memory driver in powerpc config
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
Based upon git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
Branch next
Changes for v2: Sending as it is
Changes for v3: Sending as it is
Changes for v4: Rebased to
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
changes for v5:
- Rebased to branch next of
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
Changes for v6: Sending as it is
Changes for v7: Sending as it is
Changes for v8: Sending as it is
arch/powerpc/configs/corenet32_smp_defconfig | 1 +
arch/powerpc/configs/corenet64_smp_defconfig | 1 +
arch/powerpc/configs/mpc85xx_defconfig | 1 +
arch/powerpc/configs/mpc85xx_smp_defconfig | 1 +
4 files changed, 4 insertions(+)
diff --git a/arch/powerpc/configs/corenet32_smp_defconfig b/arch/powerpc/configs/corenet32_smp_defconfig
index bbd794d..087d437 100644
--- a/arch/powerpc/configs/corenet32_smp_defconfig
+++ b/arch/powerpc/configs/corenet32_smp_defconfig
@@ -142,6 +142,7 @@ CONFIG_RTC_DRV_DS3232=y
CONFIG_RTC_DRV_CMOS=y
CONFIG_UIO=y
CONFIG_STAGING=y
+CONFIG_MEMORY=y
CONFIG_VIRT_DRIVERS=y
CONFIG_FSL_HV_MANAGER=y
CONFIG_EXT2_FS=y
diff --git a/arch/powerpc/configs/corenet64_smp_defconfig b/arch/powerpc/configs/corenet64_smp_defconfig
index 63508dd..25b03f8 100644
--- a/arch/powerpc/configs/corenet64_smp_defconfig
+++ b/arch/powerpc/configs/corenet64_smp_defconfig
@@ -129,6 +129,7 @@ CONFIG_EDAC=y
CONFIG_EDAC_MM_EDAC=y
CONFIG_DMADEVICES=y
CONFIG_FSL_DMA=y
+CONFIG_MEMORY=y
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
CONFIG_ISO9660_FS=m
diff --git a/arch/powerpc/configs/mpc85xx_defconfig b/arch/powerpc/configs/mpc85xx_defconfig
index 83d3550..cba638c 100644
--- a/arch/powerpc/configs/mpc85xx_defconfig
+++ b/arch/powerpc/configs/mpc85xx_defconfig
@@ -216,6 +216,7 @@ CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_DMADEVICES=y
CONFIG_FSL_DMA=y
+CONFIG_MEMORY=y
# CONFIG_NET_DMA is not set
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
diff --git a/arch/powerpc/configs/mpc85xx_smp_defconfig b/arch/powerpc/configs/mpc85xx_smp_defconfig
index 4b68629..e315b8a 100644
--- a/arch/powerpc/configs/mpc85xx_smp_defconfig
+++ b/arch/powerpc/configs/mpc85xx_smp_defconfig
@@ -217,6 +217,7 @@ CONFIG_RTC_DRV_CMOS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_DMADEVICES=y
CONFIG_FSL_DMA=y
+CONFIG_MEMORY=y
# CONFIG_NET_DMA is not set
CONFIG_EXT2_FS=y
CONFIG_EXT3_FS=y
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/2][v8] driver/memory:Move Freescale IFC driver to a common driver
From: Prabhakar Kushwaha @ 2014-01-31 9:39 UTC (permalink / raw)
To: linuxppc-dev; +Cc: scottwood, Prabhakar Kushwaha
Freescale IFC controller has been used for mpc8xxx. It will be used
for ARM-based SoC as well. This patch moves the driver to driver/memory
and fix the header file includes.
Also remove module_platform_driver() and instead call
platform_driver_register() from subsys_initcall() to make sure this module
has been loaded before MTD partition parsing starts.
Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
---
Based upon git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git
Branch next
Changes for v2:
- Move fsl_ifc in driver/memory
Changes for v3:
- move device tree bindings to memory
Changes for v4: Rebased to
git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
Changes for v5:
- Moved powerpc/Kconfig option to driver/memory
Changes for v6:
- Update Kconfig details
Changes for v7:
- Update Kconfig
Changes for v8:
- Update Kconfig help
.../{powerpc => memory-controllers}/fsl/ifc.txt | 0
arch/powerpc/Kconfig | 4 ----
arch/powerpc/sysdev/Makefile | 1 -
drivers/memory/Kconfig | 8 ++++++++
drivers/memory/Makefile | 1 +
{arch/powerpc/sysdev => drivers/memory}/fsl_ifc.c | 8 ++++++--
drivers/mtd/nand/fsl_ifc_nand.c | 2 +-
.../include/asm => include/linux}/fsl_ifc.h | 0
8 files changed, 16 insertions(+), 8 deletions(-)
rename Documentation/devicetree/bindings/{powerpc => memory-controllers}/fsl/ifc.txt (100%)
rename {arch/powerpc/sysdev => drivers/memory}/fsl_ifc.c (98%)
rename {arch/powerpc/include/asm => include/linux}/fsl_ifc.h (100%)
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/ifc.txt b/Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt
similarity index 100%
rename from Documentation/devicetree/bindings/powerpc/fsl/ifc.txt
rename to Documentation/devicetree/bindings/memory-controllers/fsl/ifc.txt
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index a5e5d2e..00edd29 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -734,10 +734,6 @@ config FSL_LBC
controller. Also contains some common code used by
drivers for specific local bus peripherals.
-config FSL_IFC
- bool
- depends on FSL_SOC
-
config FSL_GTM
bool
depends on PPC_83xx || QUICC_ENGINE || CPM2
diff --git a/arch/powerpc/sysdev/Makefile b/arch/powerpc/sysdev/Makefile
index f67ac90..afbcc37 100644
--- a/arch/powerpc/sysdev/Makefile
+++ b/arch/powerpc/sysdev/Makefile
@@ -21,7 +21,6 @@ obj-$(CONFIG_FSL_SOC) += fsl_soc.o fsl_mpic_err.o
obj-$(CONFIG_FSL_PCI) += fsl_pci.o $(fsl-msi-obj-y)
obj-$(CONFIG_FSL_PMC) += fsl_pmc.o
obj-$(CONFIG_FSL_LBC) += fsl_lbc.o
-obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
obj-$(CONFIG_FSL_GTM) += fsl_gtm.o
obj-$(CONFIG_FSL_85XX_CACHE_SRAM) += fsl_85xx_l2ctlr.o fsl_85xx_cache_sram.o
obj-$(CONFIG_SIMPLE_GPIO) += simple_gpio.o
diff --git a/drivers/memory/Kconfig b/drivers/memory/Kconfig
index 29a11db..57721ed 100644
--- a/drivers/memory/Kconfig
+++ b/drivers/memory/Kconfig
@@ -50,4 +50,12 @@ config TEGRA30_MC
analysis, especially for IOMMU/SMMU(System Memory Management
Unit) module.
+config FSL_IFC
+ bool "Freescale Integrated Flash Controller"
+ depends on FSL_SOC
+ help
+ This driver is for the Integrated Flash Controller(IFC) module
+ available in Freescale SoCs. This controller allows to handle
+ devices such as NOR, NAND, FPGA and ASIC etc.
+
endif
diff --git a/drivers/memory/Makefile b/drivers/memory/Makefile
index 969d923..f2bf25c 100644
--- a/drivers/memory/Makefile
+++ b/drivers/memory/Makefile
@@ -6,6 +6,7 @@ ifeq ($(CONFIG_DDR),y)
obj-$(CONFIG_OF) += of_memory.o
endif
obj-$(CONFIG_TI_EMIF) += emif.o
+obj-$(CONFIG_FSL_IFC) += fsl_ifc.o
obj-$(CONFIG_MVEBU_DEVBUS) += mvebu-devbus.o
obj-$(CONFIG_TEGRA20_MC) += tegra20-mc.o
obj-$(CONFIG_TEGRA30_MC) += tegra30-mc.o
diff --git a/arch/powerpc/sysdev/fsl_ifc.c b/drivers/memory/fsl_ifc.c
similarity index 98%
rename from arch/powerpc/sysdev/fsl_ifc.c
rename to drivers/memory/fsl_ifc.c
index fbc885b..3d5d792 100644
--- a/arch/powerpc/sysdev/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -29,8 +29,8 @@
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/platform_device.h>
+#include <linux/fsl_ifc.h>
#include <asm/prom.h>
-#include <asm/fsl_ifc.h>
struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
@@ -298,7 +298,11 @@ static struct platform_driver fsl_ifc_ctrl_driver = {
.remove = fsl_ifc_ctrl_remove,
};
-module_platform_driver(fsl_ifc_ctrl_driver);
+static int __init fsl_ifc_init(void)
+{
+ return platform_driver_register(&fsl_ifc_ctrl_driver);
+}
+subsys_initcall(fsl_ifc_init);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Freescale Semiconductor");
diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index 4335577..865b323 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -30,7 +30,7 @@
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/nand_ecc.h>
-#include <asm/fsl_ifc.h>
+#include <linux/fsl_ifc.h>
#define FSL_IFC_V1_1_0 0x01010000
#define ERR_BYTE 0xFF /* Value returned for read
diff --git a/arch/powerpc/include/asm/fsl_ifc.h b/include/linux/fsl_ifc.h
similarity index 100%
rename from arch/powerpc/include/asm/fsl_ifc.h
rename to include/linux/fsl_ifc.h
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v2] kexec/ppc64 fix device tree endianess issues for memory attributes
From: Simon Horman @ 2014-01-31 5:21 UTC (permalink / raw)
To: Laurent Dufour; +Cc: Mahesh Salgaonkar, kexec, linuxppc-dev, Anton Blanchard
In-Reply-To: <20140130150622.11156.39497.stgit@nimbus>
On Thu, Jan 30, 2014 at 04:06:22PM +0100, Laurent Dufour wrote:
> All the attributes exposed in the device tree are in Big Endian format.
>
> This patch add the byte swap operation for some entries which were not yet
> processed, including those fixed by the following kernel's patch :
>
> https://lists.ozlabs.org/pipermail/linuxppc-dev/2014-January/114720.html
>
> To work on PPC64 Little Endian mode, kexec now requires that the kernel's
> patch mentioned above is applied on the kexecing kernel.
>
> Tested on ppc64 LPAR (kexec/dump) and ppc64le in a Qemu/KVM guest (kexec)
>
> Changes from v1 :
> * add processing of the following entries :
> - ibm,dynamic-reconfiguration-memory
> - chosen/linux,kernel-end
> - chosen/linux,crashkernel-base & size
> - chosen/linux,memory-limit
> - chosen/linux,htab-base & size
> - linux,tce-base & size
> - memory@/reg
> Signed-off-by: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Thanks, applied.
^ permalink raw reply
* [PATCH 3/3] cpuidle/ppc: Split timer_interrupt() into timer handling and interrupt handling routines
From: Preeti U Murthy @ 2014-01-31 4:10 UTC (permalink / raw)
To: deepthi, svaidy, toshi.kani, arnd, geoff, mpe, rusty,
linux-kernel, paul.gortmaker, afleming, anton, srivatsa.bhat,
benh, paulus, ady8radu, linuxppc-dev
In-Reply-To: <20140131040631.13071.19603.stgit@preeti.in.ibm.com>
From: Preeti U Murthy <preeti@linux.vnet.ibm.com>
Split timer_interrupt(), which is the local timer interrupt handler on ppc
into routines called during regular interrupt handling and __timer_interrupt(),
which takes care of running local timers and collecting time related stats.
This will enable callers interested only in running expired local timers to
directly call into __timer_interupt(). One of the use cases of this is the
tick broadcast IPI handling in which the sleeping CPUs need to handle the local
timers that have expired.
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
arch/powerpc/kernel/time.c | 81 +++++++++++++++++++++++++-------------------
1 file changed, 46 insertions(+), 35 deletions(-)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index 3ff97db..df2989b 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -478,6 +478,47 @@ void arch_irq_work_raise(void)
#endif /* CONFIG_IRQ_WORK */
+void __timer_interrupt(void)
+{
+ struct pt_regs *regs = get_irq_regs();
+ u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
+ struct clock_event_device *evt = &__get_cpu_var(decrementers);
+ u64 now;
+
+ trace_timer_interrupt_entry(regs);
+
+ if (test_irq_work_pending()) {
+ clear_irq_work_pending();
+ irq_work_run();
+ }
+
+ now = get_tb_or_rtc();
+ if (now >= *next_tb) {
+ *next_tb = ~(u64)0;
+ if (evt->event_handler)
+ evt->event_handler(evt);
+ __get_cpu_var(irq_stat).timer_irqs_event++;
+ } else {
+ now = *next_tb - now;
+ if (now <= DECREMENTER_MAX)
+ set_dec((int)now);
+ /* We may have raced with new irq work */
+ if (test_irq_work_pending())
+ set_dec(1);
+ __get_cpu_var(irq_stat).timer_irqs_others++;
+ }
+
+#ifdef CONFIG_PPC64
+ /* collect purr register values often, for accurate calculations */
+ if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
+ struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
+ cu->current_tb = mfspr(SPRN_PURR);
+ }
+#endif
+
+ trace_timer_interrupt_exit(regs);
+}
+
/*
* timer_interrupt - gets called when the decrementer overflows,
* with interrupts disabled.
@@ -486,8 +527,6 @@ void timer_interrupt(struct pt_regs * regs)
{
struct pt_regs *old_regs;
u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
- struct clock_event_device *evt = &__get_cpu_var(decrementers);
- u64 now;
/* Ensure a positive value is written to the decrementer, or else
* some CPUs will continue to take decrementer exceptions.
@@ -519,39 +558,7 @@ void timer_interrupt(struct pt_regs * regs)
old_regs = set_irq_regs(regs);
irq_enter();
- trace_timer_interrupt_entry(regs);
-
- if (test_irq_work_pending()) {
- clear_irq_work_pending();
- irq_work_run();
- }
-
- now = get_tb_or_rtc();
- if (now >= *next_tb) {
- *next_tb = ~(u64)0;
- if (evt->event_handler)
- evt->event_handler(evt);
- __get_cpu_var(irq_stat).timer_irqs_event++;
- } else {
- now = *next_tb - now;
- if (now <= DECREMENTER_MAX)
- set_dec((int)now);
- /* We may have raced with new irq work */
- if (test_irq_work_pending())
- set_dec(1);
- __get_cpu_var(irq_stat).timer_irqs_others++;
- }
-
-#ifdef CONFIG_PPC64
- /* collect purr register values often, for accurate calculations */
- if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
- struct cpu_usage *cu = &__get_cpu_var(cpu_usage_array);
- cu->current_tb = mfspr(SPRN_PURR);
- }
-#endif
-
- trace_timer_interrupt_exit(regs);
-
+ __timer_interrupt();
irq_exit();
set_irq_regs(old_regs);
}
@@ -828,6 +835,10 @@ static void decrementer_set_mode(enum clock_event_mode mode,
/* Interrupt handler for the timer broadcast IPI */
void tick_broadcast_ipi_handler(void)
{
+ u64 *next_tb = &__get_cpu_var(decrementers_next_tb);
+
+ *next_tb = get_tb_or_rtc();
+ __timer_interrupt();
}
static void register_decrementer_clockevent(int cpu)
^ permalink raw reply related
* [PATCH 2/3] powerpc: Implement tick broadcast IPI as a fixed IPI message
From: Preeti U Murthy @ 2014-01-31 4:10 UTC (permalink / raw)
To: deepthi, svaidy, toshi.kani, arnd, geoff, mpe, rusty,
linux-kernel, paul.gortmaker, afleming, anton, srivatsa.bhat,
benh, paulus, ady8radu, linuxppc-dev
In-Reply-To: <20140131040631.13071.19603.stgit@preeti.in.ibm.com>
From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
For scalability and performance reasons, we want the tick broadcast IPIs
to be handled as efficiently as possible. Fixed IPI messages
are one of the most efficient mechanisms available - they are faster than
the smp_call_function mechanism because the IPI handlers are fixed and hence
they don't involve costly operations such as adding IPI handlers to the target
CPU's function queue, acquiring locks for synchronization etc.
Luckily we have an unused IPI message slot, so use that to implement
tick broadcast IPIs efficiently.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
[Functions renamed to tick_broadcast* and Changelog modified by
Preeti U. Murthy<preeti@linux.vnet.ibm.com>]
Signed-off-by: Preeti U. Murthy <preeti@linux.vnet.ibm.com>
Acked-by: Geoff Levand <geoff@infradead.org> [For the PS3 part]
---
arch/powerpc/include/asm/smp.h | 2 +-
arch/powerpc/include/asm/time.h | 1 +
arch/powerpc/kernel/smp.c | 19 +++++++++++++++----
arch/powerpc/kernel/time.c | 5 +++++
arch/powerpc/platforms/cell/interrupt.c | 2 +-
arch/powerpc/platforms/ps3/smp.c | 2 +-
6 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 9f7356b..ff51046 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -120,7 +120,7 @@ extern int cpu_to_core_id(int cpu);
* in /proc/interrupts will be wrong!!! --Troy */
#define PPC_MSG_CALL_FUNCTION 0
#define PPC_MSG_RESCHEDULE 1
-#define PPC_MSG_UNUSED 2
+#define PPC_MSG_TICK_BROADCAST 2
#define PPC_MSG_DEBUGGER_BREAK 3
/* for irq controllers that have dedicated ipis per message (4) */
diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
index c1f2676..1d428e6 100644
--- a/arch/powerpc/include/asm/time.h
+++ b/arch/powerpc/include/asm/time.h
@@ -28,6 +28,7 @@ extern struct clock_event_device decrementer_clockevent;
struct rtc_time;
extern void to_tm(int tim, struct rtc_time * tm);
extern void GregorianDay(struct rtc_time *tm);
+extern void tick_broadcast_ipi_handler(void);
extern void generic_calibrate_decr(void);
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ee7d76b..6f06f05 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -35,6 +35,7 @@
#include <asm/ptrace.h>
#include <linux/atomic.h>
#include <asm/irq.h>
+#include <asm/hw_irq.h>
#include <asm/page.h>
#include <asm/pgtable.h>
#include <asm/prom.h>
@@ -145,9 +146,9 @@ static irqreturn_t reschedule_action(int irq, void *data)
return IRQ_HANDLED;
}
-static irqreturn_t unused_action(int irq, void *data)
+static irqreturn_t tick_broadcast_ipi_action(int irq, void *data)
{
- /* This slot is unused and hence available for use, if needed */
+ tick_broadcast_ipi_handler();
return IRQ_HANDLED;
}
@@ -168,14 +169,14 @@ static irqreturn_t debug_ipi_action(int irq, void *data)
static irq_handler_t smp_ipi_action[] = {
[PPC_MSG_CALL_FUNCTION] = call_function_action,
[PPC_MSG_RESCHEDULE] = reschedule_action,
- [PPC_MSG_UNUSED] = unused_action,
+ [PPC_MSG_TICK_BROADCAST] = tick_broadcast_ipi_action,
[PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action,
};
const char *smp_ipi_name[] = {
[PPC_MSG_CALL_FUNCTION] = "ipi call function",
[PPC_MSG_RESCHEDULE] = "ipi reschedule",
- [PPC_MSG_UNUSED] = "ipi unused",
+ [PPC_MSG_TICK_BROADCAST] = "ipi tick-broadcast",
[PPC_MSG_DEBUGGER_BREAK] = "ipi debugger",
};
@@ -251,6 +252,8 @@ irqreturn_t smp_ipi_demux(void)
generic_smp_call_function_interrupt();
if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
scheduler_ipi();
+ if (all & IPI_MESSAGE(PPC_MSG_TICK_BROADCAST))
+ tick_broadcast_ipi_handler();
if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
debug_ipi_action(0, NULL);
} while (info->messages);
@@ -289,6 +292,14 @@ void arch_send_call_function_ipi_mask(const struct cpumask *mask)
do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
}
+void tick_broadcast(const struct cpumask *mask)
+{
+ unsigned int cpu;
+
+ for_each_cpu(cpu, mask)
+ do_message_pass(cpu, PPC_MSG_TICK_BROADCAST);
+}
+
#if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC)
void smp_send_debugger_break(void)
{
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b3dab20..3ff97db 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -825,6 +825,11 @@ static void decrementer_set_mode(enum clock_event_mode mode,
decrementer_set_next_event(DECREMENTER_MAX, dev);
}
+/* Interrupt handler for the timer broadcast IPI */
+void tick_broadcast_ipi_handler(void)
+{
+}
+
static void register_decrementer_clockevent(int cpu)
{
struct clock_event_device *dec = &per_cpu(decrementers, cpu);
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index adf3726..8a106b4 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -215,7 +215,7 @@ void iic_request_IPIs(void)
{
iic_request_ipi(PPC_MSG_CALL_FUNCTION);
iic_request_ipi(PPC_MSG_RESCHEDULE);
- iic_request_ipi(PPC_MSG_UNUSED);
+ iic_request_ipi(PPC_MSG_TICK_BROADCAST);
iic_request_ipi(PPC_MSG_DEBUGGER_BREAK);
}
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index 00d1a7c..b358bec 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -76,7 +76,7 @@ static int __init ps3_smp_probe(void)
BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
- BUILD_BUG_ON(PPC_MSG_UNUSED != 2);
+ BUILD_BUG_ON(PPC_MSG_TICK_BROADCAST != 2);
BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
for (i = 0; i < MSG_COUNT; i++) {
^ permalink raw reply related
* [PATCH 1/3] powerpc: Free up the slot of PPC_MSG_CALL_FUNC_SINGLE IPI message
From: Preeti U Murthy @ 2014-01-31 4:10 UTC (permalink / raw)
To: deepthi, svaidy, toshi.kani, arnd, geoff, mpe, rusty,
linux-kernel, paul.gortmaker, afleming, anton, srivatsa.bhat,
benh, paulus, ady8radu, linuxppc-dev
In-Reply-To: <20140131040631.13071.19603.stgit@preeti.in.ibm.com>
From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
The IPI handlers for both PPC_MSG_CALL_FUNC and PPC_MSG_CALL_FUNC_SINGLE map
to a common implementation - generic_smp_call_function_single_interrupt(). So,
we can consolidate them and save one of the IPI message slots, (which are
precious on powerpc, since only 4 of those slots are available).
So, implement the functionality of PPC_MSG_CALL_FUNC_SINGLE using
PPC_MSG_CALL_FUNC itself and release its IPI message slot, so that it can be
used for something else in the future, if desired.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Preeti U. Murthy <preeti@linux.vnet.ibm.com>
Acked-by: Geoff Levand <geoff@infradead.org> [For the PS3 part]
---
arch/powerpc/include/asm/smp.h | 2 +-
arch/powerpc/kernel/smp.c | 12 +++++-------
arch/powerpc/platforms/cell/interrupt.c | 2 +-
arch/powerpc/platforms/ps3/smp.c | 2 +-
4 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index 084e080..9f7356b 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -120,7 +120,7 @@ extern int cpu_to_core_id(int cpu);
* in /proc/interrupts will be wrong!!! --Troy */
#define PPC_MSG_CALL_FUNCTION 0
#define PPC_MSG_RESCHEDULE 1
-#define PPC_MSG_CALL_FUNC_SINGLE 2
+#define PPC_MSG_UNUSED 2
#define PPC_MSG_DEBUGGER_BREAK 3
/* for irq controllers that have dedicated ipis per message (4) */
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index ac2621a..ee7d76b 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -145,9 +145,9 @@ static irqreturn_t reschedule_action(int irq, void *data)
return IRQ_HANDLED;
}
-static irqreturn_t call_function_single_action(int irq, void *data)
+static irqreturn_t unused_action(int irq, void *data)
{
- generic_smp_call_function_single_interrupt();
+ /* This slot is unused and hence available for use, if needed */
return IRQ_HANDLED;
}
@@ -168,14 +168,14 @@ static irqreturn_t debug_ipi_action(int irq, void *data)
static irq_handler_t smp_ipi_action[] = {
[PPC_MSG_CALL_FUNCTION] = call_function_action,
[PPC_MSG_RESCHEDULE] = reschedule_action,
- [PPC_MSG_CALL_FUNC_SINGLE] = call_function_single_action,
+ [PPC_MSG_UNUSED] = unused_action,
[PPC_MSG_DEBUGGER_BREAK] = debug_ipi_action,
};
const char *smp_ipi_name[] = {
[PPC_MSG_CALL_FUNCTION] = "ipi call function",
[PPC_MSG_RESCHEDULE] = "ipi reschedule",
- [PPC_MSG_CALL_FUNC_SINGLE] = "ipi call function single",
+ [PPC_MSG_UNUSED] = "ipi unused",
[PPC_MSG_DEBUGGER_BREAK] = "ipi debugger",
};
@@ -251,8 +251,6 @@ irqreturn_t smp_ipi_demux(void)
generic_smp_call_function_interrupt();
if (all & IPI_MESSAGE(PPC_MSG_RESCHEDULE))
scheduler_ipi();
- if (all & IPI_MESSAGE(PPC_MSG_CALL_FUNC_SINGLE))
- generic_smp_call_function_single_interrupt();
if (all & IPI_MESSAGE(PPC_MSG_DEBUGGER_BREAK))
debug_ipi_action(0, NULL);
} while (info->messages);
@@ -280,7 +278,7 @@ EXPORT_SYMBOL_GPL(smp_send_reschedule);
void arch_send_call_function_single_ipi(int cpu)
{
- do_message_pass(cpu, PPC_MSG_CALL_FUNC_SINGLE);
+ do_message_pass(cpu, PPC_MSG_CALL_FUNCTION);
}
void arch_send_call_function_ipi_mask(const struct cpumask *mask)
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 2d42f3b..adf3726 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -215,7 +215,7 @@ void iic_request_IPIs(void)
{
iic_request_ipi(PPC_MSG_CALL_FUNCTION);
iic_request_ipi(PPC_MSG_RESCHEDULE);
- iic_request_ipi(PPC_MSG_CALL_FUNC_SINGLE);
+ iic_request_ipi(PPC_MSG_UNUSED);
iic_request_ipi(PPC_MSG_DEBUGGER_BREAK);
}
diff --git a/arch/powerpc/platforms/ps3/smp.c b/arch/powerpc/platforms/ps3/smp.c
index 4b35166..00d1a7c 100644
--- a/arch/powerpc/platforms/ps3/smp.c
+++ b/arch/powerpc/platforms/ps3/smp.c
@@ -76,7 +76,7 @@ static int __init ps3_smp_probe(void)
BUILD_BUG_ON(PPC_MSG_CALL_FUNCTION != 0);
BUILD_BUG_ON(PPC_MSG_RESCHEDULE != 1);
- BUILD_BUG_ON(PPC_MSG_CALL_FUNC_SINGLE != 2);
+ BUILD_BUG_ON(PPC_MSG_UNUSED != 2);
BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
for (i = 0; i < MSG_COUNT; i++) {
^ permalink raw reply related
* [PATCH 0/3] powerpc: Free up an IPI message slot for tick broadcast IPIs
From: Preeti U Murthy @ 2014-01-31 4:09 UTC (permalink / raw)
To: deepthi, svaidy, toshi.kani, arnd, geoff, mpe, rusty,
linux-kernel, paul.gortmaker, afleming, anton, srivatsa.bhat,
benh, paulus, ady8radu, linuxppc-dev
This patchset is a precursor for enabling deep idle states on powerpc,
when the local CPU timers stop. The tick broadcast framework in
the Linux Kernel today handles wakeup of such CPUs at their next timer event
by using an external clock device. At the expiry of this clock device, IPIs
are sent to the CPUs in deep idle states so that they wakeup to handle their
respective timers. This patchset frees up one of the IPI slots on powerpc
so as to be used to handle the tick broadcast IPI.
On certain implementations of powerpc, such an external clock device is absent.
Adding support to the tick broadcast framework to handle wakeup of CPUs from
deep idle states on such implementations is currently under discussion.
https://lkml.org/lkml/2014/1/15/86
https://lkml.org/lkml/2014/1/24/28
Either way this patchset is essential to enable handling the tick broadcast IPIs.
---
Preeti U Murthy (1):
cpuidle/ppc: Split timer_interrupt() into timer handling and interrupt handling routines
Srivatsa S. Bhat (2):
powerpc: Free up the slot of PPC_MSG_CALL_FUNC_SINGLE IPI message
powerpc: Implement tick broadcast IPI as a fixed IPI message
arch/powerpc/include/asm/smp.h | 2 -
arch/powerpc/include/asm/time.h | 1
arch/powerpc/kernel/smp.c | 23 ++++++--
arch/powerpc/kernel/time.c | 86 ++++++++++++++++++-------------
arch/powerpc/platforms/cell/interrupt.c | 2 -
arch/powerpc/platforms/ps3/smp.c | 2 -
6 files changed, 71 insertions(+), 45 deletions(-)
--
^ permalink raw reply
* Re: [PATCH 1/2][v7] driver/memory:Move Freescale IFC driver to a common driver
From: Scott Wood @ 2014-01-31 3:47 UTC (permalink / raw)
To: Kushwaha Prabhakar-B32579; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <cc597cc6590e4eb7b7d6fbc004fbf749@DM2PR03MB464.namprd03.prod.outlook.com>
On Thu, 2014-01-30 at 21:23 -0600, Kushwaha Prabhakar-B32579 wrote:
>
> > -----Original Message-----
> > From: Wood Scott-B07421
> > Sent: Friday, January 31, 2014 3:01 AM
> > To: Kushwaha Prabhakar-B32579
> > Cc: linuxppc-dev@lists.ozlabs.org
> > Subject: Re: [PATCH 1/2][v7] driver/memory:Move Freescale IFC driver to a common
> > driver
> >
> > On Tue, 2014-01-28 at 10:59 +0530, Prabhakar Kushwaha wrote:
> > > Freescale IFC controller has been used for mpc8xxx. It will be used
> > > for ARM-based SoC as well. This patch moves the driver to
> > > driver/memory and fix the header file includes.
> > >
> > > Also remove module_platform_driver() and instead call
> > > platform_driver_register() from subsys_initcall() to make sure this
> > > module has been loaded before MTD partition parsing starts.
> > >
> > > Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> > > Acked-by: Arnd Bergmann <arnd@arndb.de>
> >
> > When did Arnd ack this? Especially in v7 form... and I don't see him on CC.
> >
> > > +config FSL_IFC
> > > + bool "Freescale Integrated Flash Controller"
> > > + depends on FSL_SOC
> > > + help
> > > + This driver is for the Integrated Flash Controller Controller(IFC)
> >
> > Controller Controller?
>
> I will fix it
>
> >
> > > + module available in Freescale SoCs. This controller allows to handle
> > flash
> > > + devices such as NOR, NAND, FPGA and ASIC etc
> >
> > FPGA and ASIC are not (necessarily) flash devices.
> >
>
> Yes it true.
> I am not sure this folder is only for flash controller.
> I can see references of FPGA, SRAM in same Kconfigs.
Right, just fix the help text.
s/handle flash devices/handle devices/
-Scott
^ permalink raw reply
* RE: [PATCH 1/2][v7] driver/memory:Move Freescale IFC driver to a common driver
From: prabhakar @ 2014-01-31 3:23 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1391117477.6733.39.camel@snotra.buserror.net>
DQoNCj4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCj4gRnJvbTogV29vZCBTY290dC1CMDc0
MjENCj4gU2VudDogRnJpZGF5LCBKYW51YXJ5IDMxLCAyMDE0IDM6MDEgQU0NCj4gVG86IEt1c2h3
YWhhIFByYWJoYWthci1CMzI1NzkNCj4gQ2M6IGxpbnV4cHBjLWRldkBsaXN0cy5vemxhYnMub3Jn
DQo+IFN1YmplY3Q6IFJlOiBbUEFUQ0ggMS8yXVt2N10gZHJpdmVyL21lbW9yeTpNb3ZlIEZyZWVz
Y2FsZSBJRkMgZHJpdmVyIHRvIGEgY29tbW9uDQo+IGRyaXZlcg0KPiANCj4gT24gVHVlLCAyMDE0
LTAxLTI4IGF0IDEwOjU5ICswNTMwLCBQcmFiaGFrYXIgS3VzaHdhaGEgd3JvdGU6DQo+ID4gIEZy
ZWVzY2FsZSBJRkMgY29udHJvbGxlciBoYXMgYmVlbiB1c2VkIGZvciBtcGM4eHh4LiBJdCB3aWxs
IGJlIHVzZWQNCj4gPiBmb3IgQVJNLWJhc2VkIFNvQyBhcyB3ZWxsLiBUaGlzIHBhdGNoIG1vdmVz
IHRoZSBkcml2ZXIgdG8NCj4gPiBkcml2ZXIvbWVtb3J5ICBhbmQgZml4IHRoZSBoZWFkZXIgZmls
ZSBpbmNsdWRlcy4NCj4gPg0KPiA+ICBBbHNvIHJlbW92ZSBtb2R1bGVfcGxhdGZvcm1fZHJpdmVy
KCkgYW5kICBpbnN0ZWFkIGNhbGwNCj4gPiAgcGxhdGZvcm1fZHJpdmVyX3JlZ2lzdGVyKCkgZnJv
bSBzdWJzeXNfaW5pdGNhbGwoKSB0byBtYWtlIHN1cmUgdGhpcw0KPiA+IG1vZHVsZSAgaGFzIGJl
ZW4gbG9hZGVkIGJlZm9yZSBNVEQgcGFydGl0aW9uIHBhcnNpbmcgc3RhcnRzLg0KPiA+DQo+ID4g
U2lnbmVkLW9mZi1ieTogUHJhYmhha2FyIEt1c2h3YWhhIDxwcmFiaGFrYXJAZnJlZXNjYWxlLmNv
bT4NCj4gPiBBY2tlZC1ieTogQXJuZCBCZXJnbWFubiA8YXJuZEBhcm5kYi5kZT4NCj4gDQo+IFdo
ZW4gZGlkIEFybmQgYWNrIHRoaXM/ICBFc3BlY2lhbGx5IGluIHY3IGZvcm0uLi4gYW5kIEkgZG9u
J3Qgc2VlIGhpbSBvbiBDQy4NCj4gDQo+ID4gK2NvbmZpZyBGU0xfSUZDDQo+ID4gKwlib29sICJG
cmVlc2NhbGUgSW50ZWdyYXRlZCBGbGFzaCBDb250cm9sbGVyIg0KPiA+ICsJZGVwZW5kcyBvbiBG
U0xfU09DDQo+ID4gKwloZWxwDQo+ID4gKwkgIFRoaXMgZHJpdmVyIGlzIGZvciB0aGUgSW50ZWdy
YXRlZCBGbGFzaCBDb250cm9sbGVyIENvbnRyb2xsZXIoSUZDKQ0KPiANCj4gQ29udHJvbGxlciBD
b250cm9sbGVyPw0KDQpJIHdpbGwgZml4IGl0DQoNCj4gDQo+ID4gKwkgIG1vZHVsZSBhdmFpbGFi
bGUgaW4gRnJlZXNjYWxlIFNvQ3MuIFRoaXMgY29udHJvbGxlciBhbGxvd3MgdG8gaGFuZGxlDQo+
IGZsYXNoDQo+ID4gKwkgIGRldmljZXMgc3VjaCBhcyBOT1IsIE5BTkQsIEZQR0EgYW5kIEFTSUMg
ZXRjDQo+IA0KPiBGUEdBIGFuZCBBU0lDIGFyZSBub3QgKG5lY2Vzc2FyaWx5KSBmbGFzaCBkZXZp
Y2VzLg0KPiANCg0KWWVzIGl0IHRydWUuIA0KSSBhbSBub3Qgc3VyZSB0aGlzIGZvbGRlciBpcyBv
bmx5IGZvciBmbGFzaCBjb250cm9sbGVyLg0KSSBjYW4gc2VlIHJlZmVyZW5jZXMgb2YgRlBHQSwg
U1JBTSBpbiBzYW1lIEtjb25maWdzLiANCg0KUmVnYXJkcywNClByYWJoYWthcg0K
^ permalink raw reply
* Re: [PATCH] powerpc/eeh: drop taken reference to driver on eeh_rmv_device
From: Gavin Shan @ 2014-01-31 0:46 UTC (permalink / raw)
To: Thadeu Lima de Souza Cascardo; +Cc: linuxppc-dev, shangw, paulus
In-Reply-To: <1391086848-11311-1-git-send-email-cascardo@linux.vnet.ibm.com>
On Thu, Jan 30, 2014 at 11:00:48AM -0200, Thadeu Lima de Souza Cascardo wrote:
>Commit f5c57710dd62dd06f176934a8b4b8accbf00f9f8 ("powerpc/eeh: Use
>partial hotplug for EEH unaware drivers") introduces eeh_rmv_device,
>which may grab a reference to a driver, but not release it.
>
>That prevents a driver from being removed after it has gone through EEH
>recovery.
>
>This patch drops the reference in either exit path if it was taken.
>
>Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
>---
> arch/powerpc/kernel/eeh_driver.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
>diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c
>index 7bb30dc..afe7337 100644
>--- a/arch/powerpc/kernel/eeh_driver.c
>+++ b/arch/powerpc/kernel/eeh_driver.c
>@@ -364,7 +364,7 @@ static void *eeh_rmv_device(void *data, void *userdata)
> return NULL;
> driver = eeh_pcid_get(dev);
> if (driver && driver->err_handler)
>- return NULL;
>+ goto out;
>
> /* Remove it from PCI subsystem */
> pr_debug("EEH: Removing %s without EEH sensitive driver\n",
>@@ -377,6 +377,9 @@ static void *eeh_rmv_device(void *data, void *userdata)
For normal case (driver without EEH support), we probably release the reference
to the driver before pci_stop_and_remove_bus_device().
> pci_stop_and_remove_bus_device(dev);
> pci_unlock_rescan_remove();
>
>+out:
>+ if (driver)
>+ eeh_pcid_put(dev);
> return NULL;
We needn't "if (driver)" here as eeh_pcid_put() already had the check.
> }
>
Thanks,
Gavin
^ permalink raw reply
* Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h
From: Greg KH @ 2014-01-30 22:37 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: paulus, linuxppc-dev, Aneesh Kumar K.V, stable, Li Zhong
In-Reply-To: <1391115541.29634.15.camel@pasglop>
On Fri, Jan 31, 2014 at 07:59:01AM +1100, Benjamin Herrenschmidt wrote:
> If that's an issue for you, just drop the 3.13 variant of the patch and
> we'll send it again with the build fix as soon as Linus has pulled the
> latter.
I have done that.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH 1/2][v7] driver/memory:Move Freescale IFC driver to a common driver
From: Scott Wood @ 2014-01-30 21:31 UTC (permalink / raw)
To: Prabhakar Kushwaha; +Cc: linuxppc-dev
In-Reply-To: <1390886979-9341-1-git-send-email-prabhakar@freescale.com>
On Tue, 2014-01-28 at 10:59 +0530, Prabhakar Kushwaha wrote:
> Freescale IFC controller has been used for mpc8xxx. It will be used
> for ARM-based SoC as well. This patch moves the driver to driver/memory
> and fix the header file includes.
>
> Also remove module_platform_driver() and instead call
> platform_driver_register() from subsys_initcall() to make sure this module
> has been loaded before MTD partition parsing starts.
>
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
When did Arnd ack this? Especially in v7 form... and I don't see him on
CC.
> +config FSL_IFC
> + bool "Freescale Integrated Flash Controller"
> + depends on FSL_SOC
> + help
> + This driver is for the Integrated Flash Controller Controller(IFC)
Controller Controller?
> + module available in Freescale SoCs. This controller allows to handle flash
> + devices such as NOR, NAND, FPGA and ASIC etc
FPGA and ASIC are not (necessarily) flash devices.
-Scott
^ permalink raw reply
* Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h
From: Benjamin Herrenschmidt @ 2014-01-30 20:59 UTC (permalink / raw)
To: Greg KH; +Cc: paulus, linuxppc-dev, Aneesh Kumar K.V, stable, Li Zhong
In-Reply-To: <20140130175514.GA29370@kroah.com>
On Thu, 2014-01-30 at 09:55 -0800, Greg KH wrote:
> On Thu, Jan 30, 2014 at 11:08:52PM +0530, Aneesh Kumar K.V wrote:
> > Greg KH <greg@kroah.com> writes:
> >
> > > On Thu, Jan 30, 2014 at 09:57:36AM +1100, Benjamin Herrenschmidt wrote:
> > >> On Wed, 2014-01-29 at 10:45 -0800, Greg KH wrote:
> > >> > On Tue, Jan 28, 2014 at 05:52:42PM +0530, Aneesh Kumar K.V wrote:
> > >> > > From: Li Zhong <zhong@linux.vnet.ibm.com>
> > >> > >
> > >> > > It seems that forward declaration couldn't work well with typedef, use
> > >> > > struct spinlock directly to avoiding following build errors:
> > >> > >
> > >> > > In file included from include/linux/spinlock.h:81,
> > >> > > from include/linux/seqlock.h:35,
> > >> > > from include/linux/time.h:5,
> > >> > > from include/uapi/linux/timex.h:56,
> > >> > > from include/linux/timex.h:56,
> > >> > > from include/linux/sched.h:17,
> > >> > > from arch/powerpc/kernel/asm-offsets.c:17:
> > >> > > include/linux/spinlock_types.h:76: error: redefinition of typedef 'spinlock_t'
> > >> > > /root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here
> > >> > >
> > >> > > build fix for upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f
> > >> > > for 3.13 stable series
> > >> >
> > >> > I don't understand, why is this needed? Is there a corrisponding patch
> > >> > upstream that already does this? What went wrong with a "normal"
> > >> > backport of the patch to 3.13?
> > >>
> > >> There's a corresponding patch in powerpc-next that I'm about to send to
> > >> Linus today, but for the backport, the "fix" could be folded into the
> > >> original offending patch.
> > >
> > > Oh come on, you know better than to try to send me a patch that isn't in
> > > Linus's tree already. Crap, I can't take that at all.
> > >
> > > Send me the git commit id when it is in Linus's tree, otherwise I'm not
> > > taking it.
> > >
> > > And no, don't "fold in" anything, that's not ok either. I'll just go
> > > drop this patch entirely from all of my -stable trees for now. Feel
> > > free to resend them when all of the needed stuff is upstream.
> >
> > The fix for mremap crash is already in Linus tree.
>
> What is the git commit id?
Relax Greg :-) The submissions all had the commit ID of the original
patch upsteam: b3084f4db3aeb991c507ca774337c7e7893ed04f
The only *thing* here is due to churn upstream in 3.13, the backport
is a bit different for 3.13 vs. earlier versions.
The earlier ones are perfectly kosher and you should have no reason
not to take them.
The 3.13, well, Mahesh was a bit quick here, he sent you the actual
patch that went upstream ... and a second patch to fix a problem
with older gcc's that it introduces. Because it's a simple build fix of
the previous patch, I suggested folding it in instead.
That build fix is what is not yet upstream, it's in my -next branch
which Linus hasn't pulled just yet.
If that's an issue for you, just drop the 3.13 variant of the patch and
we'll send it again with the build fix as soon as Linus has pulled the
latter.
> > It is the build failure for older gcc compiler version that is not in
> > linus tree.
>
> That is what I can not take.
>
> > We missed that in the first pull request. Do we really need to drop
> > the patch from 3.11 and 3.12 trees ?
>
> I already did.
>
> > The patch their is a variant, and don't require this build fix.
>
> Don't give me a "variant", give me the exact same patch, only changed to
> handle the fuzz/differences of older kernels, don't make different
> changes to the original patch to make up for things you found out later
> on, otherwise everyone is confused as to why the fix for the fix is not
> in the tree.
The backport patch is a "variant" because of changes in the affected
function that went into 3.13.
> So, when both patches get in Linus's tree, please send me the properly
> backported patches and I'll be glad to apply them.
Ben.
^ permalink raw reply
* Re: [PATCH v2 1/6] idle: move the cpuidle entry point to the generic idle loop
From: Nicolas Pitre @ 2014-01-30 19:24 UTC (permalink / raw)
To: Daniel Lezcano
Cc: linaro-kernel, Russell King, linux-pm, Peter Zijlstra, linux-sh,
Rafael J. Wysocki, linux-kernel, Olof Johansson, Paul Mundt,
Preeti U Murthy, Thomas Gleixner, linuxppc-dev, Ingo Molnar,
linux-arm-kernel
In-Reply-To: <52EA8BD4.6020803@linaro.org>
On Thu, 30 Jan 2014, Daniel Lezcano wrote:
> On 01/30/2014 05:07 PM, Nicolas Pitre wrote:
> > On Thu, 30 Jan 2014, Daniel Lezcano wrote:
> > > But what I don't get with your comment is the local_irq_enable is done
> > > from
> > > the cpuidle common framework in 'cpuidle_enter_state' it is not done from
> > > the
> > > arch specific backend cpuidle driver.
> >
> > Oh well... This certainly means we'll have to clean this mess as some
> > drivers do it on their own while some others don't. Some drivers also
> > loop on !need_resched() while some others simply return on the first
> > interrupt.
>
> Ok, I think the mess is coming from 'default_idle' which does not re-enable
> the local_irq but used from different places like amd_e400_idle and
> apm_cpu_idle.
Yet if you look at the code path before my patches you'll see that IRQs
were enabled only after cpuidle_idle_call() had returned success.
> void default_idle(void)
> {
> trace_cpu_idle_rcuidle(1, smp_processor_id());
> safe_halt();
> trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
> }
>
> Considering the system configured without cpuidle because this one *always*
> enable the local irq,
Yet this is discutable. Given that some hardware do have IRQs turned on
upon exiting idle mode, I think we should generalize it so that
the explicit enabling
of IRQs, when needed, should be done as close as possible to the
operation that caused idle mode to be entered.
> we have the different cases:
>
> x86_idle = default_idle();
> ==> local_irq_enable is missing
According to Peter it is not.
> x86_idle = amd_e400_idle();
> ==> it calls local_irq_disable(); but in the idle loop context where the
> local irqs are already disabled.
Since it returned from default_idle() then IRQs are enabled.
> ==> if amd_e400_c1e_detected is true, the local_irq are enabled
> ==> otherwise no
> ==> default_idle is called from there and does not enable local_irqs
Again, it does.
> > > So the code above could be:
> > >
> > > if (cpuidle_idle_call())
> > > x86_idle();
> > >
> > > without the else section, this local_irq_enable is pointless. Or may be I
> > > missed something ?
> >
> > A later patch removes it anyway. But if it is really necessary to
> > enable interrupts then the core will do it but with a warning now.
>
> This WARN should disappear. It was there because it was up to the backend
> cpuidle driver to enable the irq. But in the meantime, that was consolidated
> into a single place in the cpuidle framework so no need to try to catch
> errors.
And that consolidation was a mistake IMHO. We should assume that the
exiting of idle mode has IRQs enabled already, and do so manually in the
backend driver if it is not the case on particular hardware. That's the
only way to ensure uniformity at a higher level.
Yet, if a code path is buggy in that regard, whether this is through
cpuidle when enabled, or the default idle function otherwise, then the
warning is there in cpu_idle_loop() to catch them all.
> What about (based on this patchset).
>
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 4505e2a..2d60cbb 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -299,6 +299,7 @@ void arch_cpu_idle_dead(void)
> void arch_cpu_idle(void)
> {
> x86_idle();
> + local_irq_enable();
> }
Again this is redundant.
Nicolas
^ permalink raw reply
* [PATCH] powerpc: Fix kdump hang issue on p8 with relocation on exception enabled.
From: Mahesh J Salgaonkar @ 2014-01-30 19:01 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt
Cc: Steve Best, Paul Mackerras, Anton Blanchard, Hari Bathini
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
On p8 systems, with relocation on exception feature enabled we are seeing
kdump kernel hang at interrupt vector 0xc*4400. The reason is, with this
feature enabled, exception are raised with MMU (IR=DR=1) ON with the
default offset of 0xc*4000. Since exception is raised in virtual mode it
requires the vector region to be executable without which it fails to
fetch and execute instruction at 0xc*4xxx. For default kernel since kernel
is loaded at real 0, the htab mappings sets the entire kernel text region
executable. But for relocatable kernel (e.g. kdump case) we only copy
interrupt vectors down to real 0 and never marked that region as
executable because in p7 and below we always get exception in real mode.
This patch fixes this issue by marking htab mapping range as executable
that overlaps with the interrupt vector region for relocatable kernel.
Thanks to Ben who helped me to debug this issue and find the root cause.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
arch/powerpc/include/asm/sections.h | 12 ++++++++++++
arch/powerpc/mm/hash_utils_64.c | 14 ++++++++++++++
2 files changed, 26 insertions(+)
diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h
index 4ee06fe..d0e784e 100644
--- a/arch/powerpc/include/asm/sections.h
+++ b/arch/powerpc/include/asm/sections.h
@@ -8,6 +8,7 @@
#ifdef __powerpc64__
+extern char __start_interrupts[];
extern char __end_interrupts[];
extern char __prom_init_toc_start[];
@@ -21,6 +22,17 @@ static inline int in_kernel_text(unsigned long addr)
return 0;
}
+static inline int overlaps_interrupt_vector_text(unsigned long start,
+ unsigned long end)
+{
+ unsigned long real_start, real_end;
+ real_start = __start_interrupts - _stext;
+ real_end = __end_interrupts - _stext;
+
+ return start < (unsigned long)__va(real_end) &&
+ (unsigned long)__va(real_start) < end;
+}
+
static inline int overlaps_kernel_text(unsigned long start, unsigned long end)
{
return start < (unsigned long)__init_end &&
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 6176b3c..50e21af 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -206,6 +206,20 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
if (overlaps_kernel_text(vaddr, vaddr + step))
tprot &= ~HPTE_R_N;
+ /*
+ * If relocatable, check if it overlaps interrupt vectors that
+ * are copied down to real 0. For relocatable kernel
+ * (e.g. kdump case) we copy interrupt vectors down to real
+ * address 0. Mark that region as executable. This is
+ * because on p8 system with relocation on exception feature
+ * enabled, exceptions are raised with MMU (IR=DR=1) ON. Hence
+ * in order to execute the interrupt handlers in virtual
+ * mode the vector region need to be marked as executable.
+ */
+ if ((PHYSICAL_START > MEMORY_START) &&
+ overlaps_interrupt_vector_text(vaddr, vaddr + step))
+ tprot &= ~HPTE_R_N;
+
hash = hpt_hash(vpn, shift, ssize);
hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP);
^ permalink raw reply related
* [PATCH] powerpc/pseries: Disable relocation on exception while going down during crash.
From: Mahesh J Salgaonkar @ 2014-01-30 19:00 UTC (permalink / raw)
To: linuxppc-dev, Benjamin Herrenschmidt
Cc: Steve Best, Paul Mackerras, Anton Blanchard, Hari Bathini
From: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Disable relocation on exception while going down even in kdump case. This
is because we are about clear htab mappings while kexec-ing into kdump
kernel and we may run into issues if we still have AIL ON.
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/setup.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index c1f1908..3925173 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -430,8 +430,7 @@ static void pSeries_machine_kexec(struct kimage *image)
{
long rc;
- if (firmware_has_feature(FW_FEATURE_SET_MODE) &&
- (image->type != KEXEC_TYPE_CRASH)) {
+ if (firmware_has_feature(FW_FEATURE_SET_MODE)) {
rc = pSeries_disable_reloc_on_exc();
if (rc != H_SUCCESS)
pr_warning("Warning: Failed to disable relocation on "
^ permalink raw reply related
* Re: [PATCH v2 1/6] idle: move the cpuidle entry point to the generic idle loop
From: Peter Zijlstra @ 2014-01-30 18:06 UTC (permalink / raw)
To: Daniel Lezcano
Cc: Nicolas Pitre, linaro-kernel, Russell King, linux-pm, linux-sh,
Rafael J. Wysocki, linux-kernel, Olof Johansson, Paul Mundt,
Preeti U Murthy, Thomas Gleixner, linuxppc-dev, Ingo Molnar,
linux-arm-kernel
In-Reply-To: <52EA8BD4.6020803@linaro.org>
On Thu, Jan 30, 2014 at 06:28:52PM +0100, Daniel Lezcano wrote:
> Ok, I think the mess is coming from 'default_idle' which does not re-enable
> the local_irq but used from different places like amd_e400_idle and
> apm_cpu_idle.
>
> void default_idle(void)
> {
> trace_cpu_idle_rcuidle(1, smp_processor_id());
> safe_halt();
> trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
> }
>
> Considering the system configured without cpuidle because this one *always*
> enable the local irq, we have the different cases:
>
> x86_idle = default_idle();
> ==> local_irq_enable is missing
>
safe_halt() is "sti; hlt" and so very much does the irq_enable.
^ permalink raw reply
* Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h
From: Aneesh Kumar K.V @ 2014-01-30 18:03 UTC (permalink / raw)
To: Greg KH; +Cc: paulus, linuxppc-dev, Li Zhong, stable
In-Reply-To: <20140130175514.GA29370@kroah.com>
Greg KH <greg@kroah.com> writes:
> On Thu, Jan 30, 2014 at 11:08:52PM +0530, Aneesh Kumar K.V wrote:
>> Greg KH <greg@kroah.com> writes:
>>
>> > On Thu, Jan 30, 2014 at 09:57:36AM +1100, Benjamin Herrenschmidt wrote:
>> >> On Wed, 2014-01-29 at 10:45 -0800, Greg KH wrote:
>> >> > On Tue, Jan 28, 2014 at 05:52:42PM +0530, Aneesh Kumar K.V wrote:
>> >> > > From: Li Zhong <zhong@linux.vnet.ibm.com>
>> >> > >
>> >> > > It seems that forward declaration couldn't work well with typedef, use
>> >> > > struct spinlock directly to avoiding following build errors:
>> >> > >
>> >> > > In file included from include/linux/spinlock.h:81,
>> >> > > from include/linux/seqlock.h:35,
>> >> > > from include/linux/time.h:5,
>> >> > > from include/uapi/linux/timex.h:56,
>> >> > > from include/linux/timex.h:56,
>> >> > > from include/linux/sched.h:17,
>> >> > > from arch/powerpc/kernel/asm-offsets.c:17:
>> >> > > include/linux/spinlock_types.h:76: error: redefinition of typedef 'spinlock_t'
>> >> > > /root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here
>> >> > >
>> >> > > build fix for upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f
>> >> > > for 3.13 stable series
>> >> >
>> >> > I don't understand, why is this needed? Is there a corrisponding patch
>> >> > upstream that already does this? What went wrong with a "normal"
>> >> > backport of the patch to 3.13?
>> >>
>> >> There's a corresponding patch in powerpc-next that I'm about to send to
>> >> Linus today, but for the backport, the "fix" could be folded into the
>> >> original offending patch.
>> >
>> > Oh come on, you know better than to try to send me a patch that isn't in
>> > Linus's tree already. Crap, I can't take that at all.
>> >
>> > Send me the git commit id when it is in Linus's tree, otherwise I'm not
>> > taking it.
>> >
>> > And no, don't "fold in" anything, that's not ok either. I'll just go
>> > drop this patch entirely from all of my -stable trees for now. Feel
>> > free to resend them when all of the needed stuff is upstream.
>>
>> The fix for mremap crash is already in Linus tree.
>
> What is the git commit id?
upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f
That is patch 1 in this series.
>
>> It is the build failure for older gcc compiler version that is not in
>> linus tree.
>
> That is what I can not take.
>
>> We missed that in the first pull request. Do we really need to drop
>> the patch from 3.11 and 3.12 trees ?
>
> I already did.
>
>> The patch their is a variant, and don't require this build fix.
>
> Don't give me a "variant", give me the exact same patch, only changed to
> handle the fuzz/differences of older kernels, don't make different
> changes to the original patch to make up for things you found out later
> on, otherwise everyone is confused as to why the fix for the fix is not
> in the tree.
In this specific case it may be difficult. 3.13 have other changes
around the code path. It has split pmd locks etc which result in us
doing a withdraw and deposit even on x86. For 3.11 and 3.12, we need to
do that extra withdraw and deposit only for ppc64. Hence the variant
which used #ifdef around that code.
>
> So, when both patches get in Linus's tree, please send me the properly
> backported patches and I'll be glad to apply them.
>
-aneesh
^ permalink raw reply
* Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h
From: Greg KH @ 2014-01-30 17:55 UTC (permalink / raw)
To: Aneesh Kumar K.V; +Cc: linuxppc-dev, stable, paulus, Li Zhong
In-Reply-To: <8761p15pzn.fsf@linux.vnet.ibm.com>
On Thu, Jan 30, 2014 at 11:08:52PM +0530, Aneesh Kumar K.V wrote:
> Greg KH <greg@kroah.com> writes:
>
> > On Thu, Jan 30, 2014 at 09:57:36AM +1100, Benjamin Herrenschmidt wrote:
> >> On Wed, 2014-01-29 at 10:45 -0800, Greg KH wrote:
> >> > On Tue, Jan 28, 2014 at 05:52:42PM +0530, Aneesh Kumar K.V wrote:
> >> > > From: Li Zhong <zhong@linux.vnet.ibm.com>
> >> > >
> >> > > It seems that forward declaration couldn't work well with typedef, use
> >> > > struct spinlock directly to avoiding following build errors:
> >> > >
> >> > > In file included from include/linux/spinlock.h:81,
> >> > > from include/linux/seqlock.h:35,
> >> > > from include/linux/time.h:5,
> >> > > from include/uapi/linux/timex.h:56,
> >> > > from include/linux/timex.h:56,
> >> > > from include/linux/sched.h:17,
> >> > > from arch/powerpc/kernel/asm-offsets.c:17:
> >> > > include/linux/spinlock_types.h:76: error: redefinition of typedef 'spinlock_t'
> >> > > /root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here
> >> > >
> >> > > build fix for upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f
> >> > > for 3.13 stable series
> >> >
> >> > I don't understand, why is this needed? Is there a corrisponding patch
> >> > upstream that already does this? What went wrong with a "normal"
> >> > backport of the patch to 3.13?
> >>
> >> There's a corresponding patch in powerpc-next that I'm about to send to
> >> Linus today, but for the backport, the "fix" could be folded into the
> >> original offending patch.
> >
> > Oh come on, you know better than to try to send me a patch that isn't in
> > Linus's tree already. Crap, I can't take that at all.
> >
> > Send me the git commit id when it is in Linus's tree, otherwise I'm not
> > taking it.
> >
> > And no, don't "fold in" anything, that's not ok either. I'll just go
> > drop this patch entirely from all of my -stable trees for now. Feel
> > free to resend them when all of the needed stuff is upstream.
>
> The fix for mremap crash is already in Linus tree.
What is the git commit id?
> It is the build failure for older gcc compiler version that is not in
> linus tree.
That is what I can not take.
> We missed that in the first pull request. Do we really need to drop
> the patch from 3.11 and 3.12 trees ?
I already did.
> The patch their is a variant, and don't require this build fix.
Don't give me a "variant", give me the exact same patch, only changed to
handle the fuzz/differences of older kernels, don't make different
changes to the original patch to make up for things you found out later
on, otherwise everyone is confused as to why the fix for the fix is not
in the tree.
So, when both patches get in Linus's tree, please send me the properly
backported patches and I'll be glad to apply them.
greg k-h
^ permalink raw reply
* Re: [PATCH 2/2] Fix compile error of pgtable-ppc64.h
From: Aneesh Kumar K.V @ 2014-01-30 17:38 UTC (permalink / raw)
To: Greg KH, Benjamin Herrenschmidt; +Cc: paulus, linuxppc-dev, Li Zhong, stable
In-Reply-To: <20140130123457.GA6571@kroah.com>
Greg KH <greg@kroah.com> writes:
> On Thu, Jan 30, 2014 at 09:57:36AM +1100, Benjamin Herrenschmidt wrote:
>> On Wed, 2014-01-29 at 10:45 -0800, Greg KH wrote:
>> > On Tue, Jan 28, 2014 at 05:52:42PM +0530, Aneesh Kumar K.V wrote:
>> > > From: Li Zhong <zhong@linux.vnet.ibm.com>
>> > >
>> > > It seems that forward declaration couldn't work well with typedef, use
>> > > struct spinlock directly to avoiding following build errors:
>> > >
>> > > In file included from include/linux/spinlock.h:81,
>> > > from include/linux/seqlock.h:35,
>> > > from include/linux/time.h:5,
>> > > from include/uapi/linux/timex.h:56,
>> > > from include/linux/timex.h:56,
>> > > from include/linux/sched.h:17,
>> > > from arch/powerpc/kernel/asm-offsets.c:17:
>> > > include/linux/spinlock_types.h:76: error: redefinition of typedef 'spinlock_t'
>> > > /root/linux-next/arch/powerpc/include/asm/pgtable-ppc64.h:563: note: previous declaration of 'spinlock_t' was here
>> > >
>> > > build fix for upstream SHA1: b3084f4db3aeb991c507ca774337c7e7893ed04f
>> > > for 3.13 stable series
>> >
>> > I don't understand, why is this needed? Is there a corrisponding patch
>> > upstream that already does this? What went wrong with a "normal"
>> > backport of the patch to 3.13?
>>
>> There's a corresponding patch in powerpc-next that I'm about to send to
>> Linus today, but for the backport, the "fix" could be folded into the
>> original offending patch.
>
> Oh come on, you know better than to try to send me a patch that isn't in
> Linus's tree already. Crap, I can't take that at all.
>
> Send me the git commit id when it is in Linus's tree, otherwise I'm not
> taking it.
>
> And no, don't "fold in" anything, that's not ok either. I'll just go
> drop this patch entirely from all of my -stable trees for now. Feel
> free to resend them when all of the needed stuff is upstream.
The fix for mremap crash is already in Linus tree. It is the build
failure for older gcc compiler version that is not in linus tree. We
missed that in the first pull request. Do we really need to drop the
patch from 3.11 and 3.12 trees ? The patch their is a variant, and don't
require this build fix.
-aneesh
^ permalink raw reply
* Re: [PATCH v2 1/6] idle: move the cpuidle entry point to the generic idle loop
From: Daniel Lezcano @ 2014-01-30 17:28 UTC (permalink / raw)
To: Nicolas Pitre
Cc: linaro-kernel, Russell King, linux-pm, Peter Zijlstra, linux-sh,
Rafael J. Wysocki, linux-kernel, Olof Johansson, Paul Mundt,
Preeti U Murthy, Thomas Gleixner, linuxppc-dev, Ingo Molnar,
linux-arm-kernel
In-Reply-To: <alpine.LFD.2.11.1401301056180.1652@knanqh.ubzr>
On 01/30/2014 05:07 PM, Nicolas Pitre wrote:
> On Thu, 30 Jan 2014, Daniel Lezcano wrote:
>
>> On 01/30/2014 06:28 AM, Nicolas Pitre wrote:
>>> On Thu, 30 Jan 2014, Preeti U Murthy wrote:
>>>
>>>> Hi Nicolas,
>>>>
>>>> On 01/30/2014 02:01 AM, Nicolas Pitre wrote:
>>>>> On Wed, 29 Jan 2014, Nicolas Pitre wrote:
>>>>>
>>>>>> In order to integrate cpuidle with the scheduler, we must have a
>>>>>> better
>>>>>> proximity in the core code with what cpuidle is doing and not delegate
>>>>>> such interaction to arch code.
>>>>>>
>>>>>> Architectures implementing arch_cpu_idle() should simply enter
>>>>>> a cheap idle mode in the absence of a proper cpuidle driver.
>>>>>>
>>>>>> Signed-off-by: Nicolas Pitre <nico@linaro.org>
>>>>>> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
>>>>>
>>>>> As mentioned in my reply to Olof's comment on patch #5/6, here's a new
>>>>> version of this patch adding the safety local_irq_enable() to the core
>>>>> code.
>>>>>
>>>>> ----- >8
>>>>>
>>>>> From: Nicolas Pitre <nicolas.pitre@linaro.org>
>>>>> Subject: idle: move the cpuidle entry point to the generic idle loop
>>>>>
>>>>> In order to integrate cpuidle with the scheduler, we must have a better
>>>>> proximity in the core code with what cpuidle is doing and not delegate
>>>>> such interaction to arch code.
>>>>>
>>>>> Architectures implementing arch_cpu_idle() should simply enter
>>>>> a cheap idle mode in the absence of a proper cpuidle driver.
>>>>>
>>>>> In both cases i.e. whether it is a cpuidle driver or the default
>>>>> arch_cpu_idle(), the calling convention expects IRQs to be disabled
>>>>> on entry and enabled on exit. There is a warning in place already but
>>>>> let's add a forced IRQ enable here as well. This will allow for
>>>>> removing the forced IRQ enable some implementations do locally and
>>>>
>>>> Why would this patch allow for removing the forced IRQ enable that are
>>>> being done on some archs in arch_cpu_idle()? Isn't this patch expecting
>>>> the default arch_cpu_idle() to have re-enabled the interrupts after
>>>> exiting from the default idle state? Its supposed to only catch faulty
>>>> cpuidle drivers that haven't enabled IRQs on exit from idle state but
>>>> are expected to have done so, isn't it?
>>>
>>> Exact. However x86 currently does this:
>>>
>>> if (cpuidle_idle_call())
>>> x86_idle();
>>> else
>>> local_irq_enable();
>>>
>>> So whenever cpuidle_idle_call() is successful then IRQs are
>>> unconditionally enabled whether or not the underlying cpuidle driver has
>>> properly done it or not. And the reason is that some of the x86 cpuidle
>>> do fail to enable IRQs before returning.
>>>
>>> So the idea is to get rid of this unconditional IRQ enabling and let the
>>> core issue a warning instead (as well as enabling IRQs to allow the
>>> system to run).
>>
>> But what I don't get with your comment is the local_irq_enable is done from
>> the cpuidle common framework in 'cpuidle_enter_state' it is not done from the
>> arch specific backend cpuidle driver.
>
> Oh well... This certainly means we'll have to clean this mess as some
> drivers do it on their own while some others don't. Some drivers also
> loop on !need_resched() while some others simply return on the first
> interrupt.
Ok, I think the mess is coming from 'default_idle' which does not
re-enable the local_irq but used from different places like
amd_e400_idle and apm_cpu_idle.
void default_idle(void)
{
trace_cpu_idle_rcuidle(1, smp_processor_id());
safe_halt();
trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
}
Considering the system configured without cpuidle because this one
*always* enable the local irq, we have the different cases:
x86_idle = default_idle();
==> local_irq_enable is missing
x86_idle = amd_e400_idle();
==> it calls local_irq_disable(); but in the idle loop context where the
local irqs are already disabled.
==> if amd_e400_c1e_detected is true, the local_irq are enabled
==> otherwise no
==> default_idle is called from there and does not enable local_irqs
>> So the code above could be:
>>
>> if (cpuidle_idle_call())
>> x86_idle();
>>
>> without the else section, this local_irq_enable is pointless. Or may be I
>> missed something ?
>
> A later patch removes it anyway. But if it is really necessary to
> enable interrupts then the core will do it but with a warning now.
This WARN should disappear. It was there because it was up to the
backend cpuidle driver to enable the irq. But in the meantime, that was
consolidated into a single place in the cpuidle framework so no need to
try to catch errors.
What about (based on this patchset).
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 4505e2a..2d60cbb 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -299,6 +299,7 @@ void arch_cpu_idle_dead(void)
void arch_cpu_idle(void)
{
x86_idle();
+ local_irq_enable();
}
/*
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
^ permalink raw reply related
* Re: [PATCH v2 6/6] cpu/idle.c: move to sched/idle.c
From: Peter Zijlstra @ 2014-01-30 16:52 UTC (permalink / raw)
To: Joe Perches
Cc: Nicolas Pitre, linaro-kernel, Russell King, linux-sh, linux-pm,
Daniel Lezcano, Rafael J. Wysocki, linux-kernel, Paul Mundt,
Preeti U Murthy, Thomas Gleixner, linuxppc-dev, Ingo Molnar,
linux-arm-kernel
In-Reply-To: <1391100076.2422.56.camel@joe-AO722>
On Thu, Jan 30, 2014 at 08:41:16AM -0800, Joe Perches wrote:
> Perhaps you could use a newer version of patch
>
> GNU patch version 2.7 released
Yeah, I know about that, I'll wait until its common in all distros,
updating all machines I use by hand is just painful.
^ permalink raw reply
* Re: [PATCH v2 6/6] cpu/idle.c: move to sched/idle.c
From: Joe Perches @ 2014-01-30 16:41 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Nicolas Pitre, linaro-kernel, Russell King, linux-sh, linux-pm,
Daniel Lezcano, Rafael J. Wysocki, linux-kernel, Paul Mundt,
Preeti U Murthy, Thomas Gleixner, linuxppc-dev, Ingo Molnar,
linux-arm-kernel
In-Reply-To: <20140130162753.GF5002@laptop.programming.kicks-ass.net>
On Thu, 2014-01-30 at 17:27 +0100, Peter Zijlstra wrote:
> On Thu, Jan 30, 2014 at 11:03:31AM -0500, Nicolas Pitre wrote:
> > > This is not a valid patch for PATCH(1). Please try again.
> >
> > Don't you use git? ;-)
>
> Nah, git and me don't get along well.
Perhaps you could use a newer version of patch
http://savannah.gnu.org/forum/forum.php?forum_id=7361
GNU patch version 2.7 released
Item posted by Andreas Gruenbacher <agruen> on Wed 12 Sep 2012 02:18:14
PM UTC.
I am pleased to announce that version 2.7 of GNU patch has been
released. The following significant changes have happened since the last
stable release in December 2009:
* Support for most features of the "diff --git" format, including
renames and copies, permission changes, and symlink diffs.
Binary diffs are not supported yet; patch will complain and skip
them.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox