* [PATCH] powerpc/sysdev: Fix a pci section mismatch for Book E
From: Christian Engelmayer @ 2013-12-15 18:39 UTC (permalink / raw)
To: linuxppc-dev
Moved the following functions out of the __init section:
arch/powerpc/sysdev/fsl_pci.c : fsl_add_bridge()
arch/powerpc/sysdev/indirect_pci.c : setup_indirect_pci()
Those are referenced by arch/powerpc/sysdev/fsl_pci.c : fsl_pci_probe() when
compiling for Book E support.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
---
arch/powerpc/sysdev/fsl_pci.c | 2 +-
arch/powerpc/sysdev/indirect_pci.c | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 4dfd61d..2b66425 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -454,7 +454,7 @@ void fsl_pcibios_fixup_bus(struct pci_bus *bus)
}
}
-int __init fsl_add_bridge(struct platform_device *pdev, int is_primary)
+int fsl_add_bridge(struct platform_device *pdev, int is_primary)
{
int len;
struct pci_controller *hose;
diff --git a/arch/powerpc/sysdev/indirect_pci.c b/arch/powerpc/sysdev/indirect_pci.c
index c6c8b52..f434995 100644
--- a/arch/powerpc/sysdev/indirect_pci.c
+++ b/arch/powerpc/sysdev/indirect_pci.c
@@ -152,10 +152,8 @@ static struct pci_ops indirect_pci_ops =
.write = indirect_write_config,
};
-void __init
-setup_indirect_pci(struct pci_controller* hose,
- resource_size_t cfg_addr,
- resource_size_t cfg_data, u32 flags)
+void setup_indirect_pci(struct pci_controller *hose, resource_size_t cfg_addr,
+ resource_size_t cfg_data, u32 flags)
{
resource_size_t base = cfg_addr & PAGE_MASK;
void __iomem *mbase;
--
1.8.3.2
^ permalink raw reply related
* RE: [PATCH v11] PPC: POWERNV: move iommu_add_device earlier
From: Varun Sethi @ 2013-12-15 18:22 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev@lists.ozlabs.org
Cc: Bharat.Bhushan@freescale.com, Alex Graf,
linux-kernel@vger.kernel.org
In-Reply-To: <1386834869-15561-1-git-send-email-aik@ozlabs.ru>
> -----Original Message-----
> From: Linuxppc-dev [mailto:linuxppc-dev-
> bounces+varun.sethi=3Dfreescale.com@lists.ozlabs.org] On Behalf Of Alexey
> Kardashevskiy
> Sent: Thursday, December 12, 2013 1:24 PM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Alexey Kardashevskiy; Alex Graf; Bhushan Bharat-R65777; linux-
> kernel@vger.kernel.org
> Subject: [PATCH v11] PPC: POWERNV: move iommu_add_device earlier
>=20
> The current implementation of IOMMU on sPAPR does not use iommu_ops and
> therefore does not call IOMMU API's bus_set_iommu() which
> 1) sets iommu_ops for a bus
> 2) registers a bus notifier
> Instead, PCI devices are added to IOMMU groups from
> subsys_initcall_sync(tce_iommu_init) which does basically the same thing
> without using iommu_ops callbacks.
>=20
> However Freescale PAMU driver (https://lkml.org/lkml/2013/7/1/158)
> implements iommu_ops and when tce_iommu_init is called, every PCI device
> is already added to some group so there is a conflict.
>=20
> This patch does 2 things:
> 1. removes the loop in which PCI devices were added to groups and adds
> explicit iommu_add_device() calls to add devices as soon as they get the
> iommu_table pointer assigned to them.
> 2. moves a bus notifier to powernv code in order to avoid conflict with
> the notifier from Freescale driver.
>=20
> iommu_add_device() and iommu_del_device() are public now.
>=20
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v11:
> * rebased on upstream
>=20
> v10:
> * fixed linker error when IOMMU_API is not enabled
>=20
> v9:
> * removed "KVM" from the subject as it is not really a KVM patch so PPC
> mainainter (hi Ben!) can review/include it into his tree
>=20
> v8:
> * added the check for iommu_group!=3DNULL before removing device from a
> group as suggested by Wei Yang <weiyang@linux.vnet.ibm.com>
>=20
> v2:
> * added a helper - set_iommu_table_base_and_group - which does
> set_iommu_table_base() and iommu_add_device()
> ---
> arch/powerpc/include/asm/iommu.h | 26
> ++++++++++++++++++++++++
> arch/powerpc/kernel/iommu.c | 11 ++++------
> arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++++----
> arch/powerpc/platforms/powernv/pci-p5ioc2.c | 2 +-
> arch/powerpc/platforms/powernv/pci.c | 31
> ++++++++++++++++++++++++++++-
> arch/powerpc/platforms/pseries/iommu.c | 8 +++++---
> 6 files changed, 70 insertions(+), 16 deletions(-)
>=20
> diff --git a/arch/powerpc/include/asm/iommu.h
> b/arch/powerpc/include/asm/iommu.h
> index c34656a..774fa27 100644
> --- a/arch/powerpc/include/asm/iommu.h
> +++ b/arch/powerpc/include/asm/iommu.h
> @@ -101,8 +101,34 @@ extern void iommu_free_table(struct iommu_table
> *tbl, const char *node_name);
> */
> extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
> int nid);
> +#ifdef CONFIG_IOMMU_API
> extern void iommu_register_group(struct iommu_table *tbl,
> int pci_domain_number, unsigned long pe_num);
> +extern int iommu_add_device(struct device *dev); extern void
> +iommu_del_device(struct device *dev); #else static inline void
> +iommu_register_group(struct iommu_table *tbl,
> + int pci_domain_number,
> + unsigned long pe_num)
> +{
> +}
> +
> +static inline int iommu_add_device(struct device *dev) {
> + return 0;
> +}
> +
> +static inline void iommu_del_device(struct device *dev) { } #endif /*
> +!CONFIG_IOMMU_API */
> +
> +static inline void set_iommu_table_base_and_group(struct device *dev,
> + void *base)
> +{
> + set_iommu_table_base(dev, base);
> + iommu_add_device(dev);
> +}
>=20
> extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
> struct scatterlist *sglist, int nelems, diff --git
> a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index
> 572bb5b..818a092 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -1105,7 +1105,7 @@ void iommu_release_ownership(struct iommu_table
> *tbl) } EXPORT_SYMBOL_GPL(iommu_release_ownership);
>=20
> -static int iommu_add_device(struct device *dev)
> +int iommu_add_device(struct device *dev)
> {
> struct iommu_table *tbl;
> int ret =3D 0;
> @@ -1134,11 +1134,13 @@ static int iommu_add_device(struct device *dev)
>=20
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iommu_add_device);
>=20
> -static void iommu_del_device(struct device *dev)
> +void iommu_del_device(struct device *dev)
> {
> iommu_group_remove_device(dev);
> }
> +EXPORT_SYMBOL_GPL(iommu_del_device);
>=20
> static int iommu_bus_notifier(struct notifier_block *nb,
> unsigned long action, void *data) @@ -1162,13
> +1164,8 @@ static struct notifier_block tce_iommu_bus_nb =3D {
>=20
> static int __init tce_iommu_init(void)
> {
> - struct pci_dev *pdev =3D NULL;
> -
> BUILD_BUG_ON(PAGE_SIZE < IOMMU_PAGE_SIZE);
>=20
> - for_each_pci_dev(pdev)
> - iommu_add_device(&pdev->dev);
> -
> bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
> return 0;
> }
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
> b/arch/powerpc/platforms/powernv/pci-ioda.c
> index 2c6d173..f0e6871 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -460,7 +460,7 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb
> *phb, struct pci_dev *pdev
> return;
>=20
> pe =3D &phb->ioda.pe_array[pdn->pe_number];
> - set_iommu_table_base(&pdev->dev, &pe->tce32_table);
> + set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table);
> }
>=20
> static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct
> pci_bus *bus) @@ -468,7 +468,7 @@ static void
> pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bus *bus)
> struct pci_dev *dev;
>=20
> list_for_each_entry(dev, &bus->devices, bus_list) {
> - set_iommu_table_base(&dev->dev, &pe->tce32_table);
> + set_iommu_table_base_and_group(&dev->dev, &pe->tce32_table);
> if (dev->subordinate)
> pnv_ioda_setup_bus_dma(pe, dev->subordinate);
> }
> @@ -644,7 +644,7 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb
> *phb,
> iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
>=20
> if (pe->pdev)
> - set_iommu_table_base(&pe->pdev->dev, tbl);
> + set_iommu_table_base_and_group(&pe->pdev->dev, tbl);
> else
> pnv_ioda_setup_bus_dma(pe, pe->pbus);
>=20
> @@ -723,7 +723,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb
> *phb,
> iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
>=20
> if (pe->pdev)
> - set_iommu_table_base(&pe->pdev->dev, tbl);
> + set_iommu_table_base_and_group(&pe->pdev->dev, tbl);
> else
> pnv_ioda_setup_bus_dma(pe, pe->pbus);
>=20
> diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> index f8b4bd8..e3807d6 100644
> --- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> +++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> @@ -92,7 +92,7 @@ static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb
> *phb,
> pci_domain_nr(phb->hose->bus), phb->opal_id);
> }
>=20
> - set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
> + set_iommu_table_base_and_group(&pdev->dev, &phb-
> >p5ioc2.iommu_table);
> }
>=20
> static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np, u64
> hub_id, diff --git a/arch/powerpc/platforms/powernv/pci.c
> b/arch/powerpc/platforms/powernv/pci.c
> index 4eb33a9..a78abad 100644
> --- a/arch/powerpc/platforms/powernv/pci.c
> +++ b/arch/powerpc/platforms/powernv/pci.c
> @@ -536,7 +536,7 @@ static void pnv_pci_dma_fallback_setup(struct
> pci_controller *hose,
> pdn->iommu_table =3D pnv_pci_setup_bml_iommu(hose);
> if (!pdn->iommu_table)
> return;
> - set_iommu_table_base(&pdev->dev, pdn->iommu_table);
> + set_iommu_table_base_and_group(&pdev->dev, pdn->iommu_table);
> }
>=20
The iommu add device=20
> static void pnv_pci_dma_dev_setup(struct pci_dev *pdev) @@ -657,3
> +657,32 @@ void __init pnv_pci_init(void)
> ppc_md.teardown_msi_irqs =3D pnv_teardown_msi_irqs; #endif }
> +
> +static int tce_iommu_bus_notifier(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct device *dev =3D data;
> +
> + switch (action) {
> + case BUS_NOTIFY_ADD_DEVICE:
> + return iommu_add_device(dev);
> + case BUS_NOTIFY_DEL_DEVICE:
> + if (dev->iommu_group)
> + iommu_del_device(dev);
> + return 0;
> + default:
> + return 0;
> + }
> +}
> +
> +static struct notifier_block tce_iommu_bus_nb =3D {
> + .notifier_call =3D tce_iommu_bus_notifier, };
> +
> +static int __init tce_iommu_bus_notifier_init(void) {
> + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
> + return 0;
> +}
> +
> +subsys_initcall_sync(tce_iommu_bus_notifier_init);
Why are bus notifiers required in your case, if you are creating iommu grou=
ps based on iommu tables? Also, how would you avoid conflict with PAMU iomm=
u group creation code if you use bus notifiers?
-Varun
^ permalink raw reply
* Re: [PATCH 10/10] Kconfig: cleanup SERIO_I8042 dependencies
From: Mark Salter @ 2013-12-15 15:50 UTC (permalink / raw)
To: Dmitry Torokhov
Cc: linux-mips, linux-ia64, linux-sh, Paul Mackerras, H. Peter Anvin,
sparclinux, Guan Xuetao, Russell King, x86, Ingo Molnar,
Fenghua Yu, Thomas Gleixner, linux-arm-kernel, Richard Henderson,
Tony Luck, linux-kernel, Ralf Baechle, Paul Mundt, linux-alpha,
linuxppc-dev, David S. Miller
In-Reply-To: <20131215103657.GB20197@core.coreip.homeip.net>
On Sun, 2013-12-15 at 02:36 -0800, Dmitry Torokhov wrote:
> On Sat, Dec 14, 2013 at 10:32:31AM -0800, H. Peter Anvin wrote:
> > On 12/14/2013 08:59 AM, Mark Salter wrote:
> > > Remove messy dependencies from SERIO_I8042 by having it depend on one
> > > Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
> > > which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
> > > New architectures are unlikely to need SERIO_I8042, so this avoids
> > > having an ever growing list of architectures to exclude.
> How are we going to merge this? In bulk through input tree or peacemeal
> through all arches first?
>
They should all go together to eliminate the chance of bisect breakage.
Either the input tree or maybe akpm tree.
^ permalink raw reply
* [RFC PATCH v3] powerpc: Loading kernels over 8Mbytes without CONFIG_PIN_TLB
From: Christophe Leroy @ 2013-12-15 15:09 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, scottwood
Cc: linuxppc-dev, linux-kernel
Hereunder is a try to implement the sizing of the initial memory size based=
on
initial-mapped-area size given by uboot in r7.
As this has an impact on all powerpc platforms due to the need to provide t=
he
info up to function setup_initial_memory_limit(), I'm not completly sure of=
the
proper implementation.
Thanks to provide comments.
Today on the 8xx, the only way to load kernels whose size is greater than
8Mbytes is to activate CONFIG_PIN_TLB. Otherwise, the physical memory initi=
ally
mapped is limited to 8Mbytes. This patch uses the size of initial memory ma=
pped
by the bootloader and given to the kernel through register r7.
This is done regardless of whether CONFIG_PIN_TLB is active or not. It allo=
ws to
load "big" kernels (for instance when activating CONFIG_LOCKDEP_SUPPORT) wi=
thout
having to activate CONFIG_PIN_TLB.
Not-yet-signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Index: linux/arch/powerpc/include/asm/mmu.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/include/asm/mmu.h (revision 5484)
+++ linux/arch/powerpc/include/asm/mmu.h (copie de travail)
@@ -138,7 +138,8 @@
extern void early_init_mmu_secondary(void);
extern void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size);
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size);
#ifdef CONFIG_PPC64
/* This is our real memory area size on ppc64 server, on embedded, we
Index: linux/arch/powerpc/kernel/head_8xx.S
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/kernel/head_8xx.S (revision 5484)
+++ linux/arch/powerpc/kernel/head_8xx.S (copie de travail)
@@ -31,6 +31,8 @@
#include <asm/asm-offsets.h>
#include <asm/ptrace.h>
+#define EPAPR_MAGIC 0x65504150
+
/* Macro to make the code more readable. */
#ifdef CONFIG_8xx_CPU6
#define DO_8xx_CPU6(val, reg) \
@@ -77,10 +79,19 @@
.globl __start
__start:
mr r31,r3 /* save device tree ptr */
+ li r30,0
+ lis r8,EPAPR_MAGIC@h
+ ori r8,r8, EPAPR_MAGIC@l
+ cmpw cr0,r8, r6
+ bne 1f
+
+ mr r30,r7 /* save initial ram size */
+
/* We have to turn on the MMU right away so we get cache modes
* set correctly.
*/
+1:
bl initial_mmu
/* We now have the lower 8 Meg mapped into TLB entries, and the caches
@@ -717,6 +728,8 @@
*/
li r3,0
mr r4,r31
+ li r5,0
+ mr r6,r30
bl machine_init
bl MMU_init
@@ -841,11 +854,17 @@
ori r8, r8, MI_BOOTINIT|0x2 /* Inhibit cache -- Cort */
mtspr SPRN_MD_RPN, r8
+ /* Map two more 8M kernel data pages if needed
+ * We check how much memory is mapped by the bootloader
+ */
+ lis r8, 0x0100
+ cmplw cr0, r8, r30
+ blt 2f
+
#ifdef CONFIG_PIN_TLB
- /* Map two more 8M kernel data pages.
- */
addi r10, r10, 0x0100
mtspr SPRN_MD_CTR, r10
+#endif
lis r8, KERNELBASE@h /* Create vaddr for TLB */
addis r8, r8, 0x0080 /* Add 8M */
@@ -858,20 +877,26 @@
addis r11, r11, 0x0080 /* Add 8M */
mtspr SPRN_MD_RPN, r11
+ lis r8, 0x0180
+ cmplw cr0, r8, r30
+ blt 2f
+
+#ifdef CONFIG_PIN_TLB
addi r10, r10, 0x0100
mtspr SPRN_MD_CTR, r10
+#endif
addis r8, r8, 0x0080 /* Add 8M */
mtspr SPRN_MD_EPN, r8
mtspr SPRN_MD_TWC, r9
addis r11, r11, 0x0080 /* Add 8M */
mtspr SPRN_MD_RPN, r11
-#endif
/* Since the cache is enabled according to the information we
* just loaded into the TLB, invalidate and enable the caches here.
* We should probably check/set other modes....later.
*/
+2:
lis r8, IDC_INVALL@h
mtspr SPRN_IC_CST, r8
mtspr SPRN_DC_CST, r8
Index: linux/arch/powerpc/kernel/prom.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/kernel/prom.c (revision 5484)
+++ linux/arch/powerpc/kernel/prom.c (copie de travail)
@@ -649,7 +649,7 @@
}
}
-void __init early_init_devtree(void *params)
+void __init early_init_devtree(void *params, u64 init_mem_size)
{
phys_addr_t limit;
@@ -697,7 +697,7 @@
/* make sure we've parsed cmdline for mem=3D before this */
if (memory_limit)
first_memblock_size =3D min_t(u64, first_memblock_size, memory_limit);
- setup_initial_memory_limit(memstart_addr, first_memblock_size);
+ setup_initial_memory_limit(memstart_addr, first_memblock_size, init_mem_s=
ize);
/* Reserve MEMBLOCK regions used by kernel, initrd, dt, etc... */
memblock_reserve(PHYSICAL_START, __pa(klimit) - PHYSICAL_START);
/* If relocatable, reserve first 32k for interrupt vectors etc. */
Index: linux/arch/powerpc/kernel/setup_32.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/kernel/setup_32.c (revision 5484)
+++ linux/arch/powerpc/kernel/setup_32.c (copie de travail)
@@ -119,7 +119,7 @@
* This is called very early on the boot process, after a minimal
* MMU environment has been set up but before MMU_init is called.
*/
-notrace void __init machine_init(u64 dt_ptr)
+notrace void __init machine_init(u64 dt_ptr, u64 init_mem_size)
{
lockdep_init();
@@ -127,7 +127,7 @@
udbg_early_init();
/* Do some early initialization based on the flat device tree */
- early_init_devtree(__va(dt_ptr));
+ early_init_devtree(__va(dt_ptr), init_mem_size);
epapr_paravirt_early_init();
Index: linux/arch/powerpc/kernel/setup_64.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/kernel/setup_64.c (revision 5484)
+++ linux/arch/powerpc/kernel/setup_64.c (copie de travail)
@@ -185,7 +185,7 @@
* device-tree is not accessible via normal means at this point.
*/
-void __init early_setup(unsigned long dt_ptr)
+void __init early_setup(unsigned long dt_ptr, u64 init_mem_size)
{
static __initdata struct paca_struct boot_paca;
@@ -214,7 +214,7 @@
* tree, such as retrieving the physical memory map or
* calculating/retrieving the hash table size.
*/
- early_init_devtree(__va(dt_ptr));
+ early_init_devtree(__va(dt_ptr), init_mem_size);
epapr_paravirt_early_init();
Index: linux/arch/powerpc/mm/40x_mmu.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/40x_mmu.c (revision 5484)
+++ linux/arch/powerpc/mm/40x_mmu.c (copie de travail)
@@ -147,7 +147,8 @@
}
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
/* We don't currently support the first MEMBLOCK not mapping 0
* physical on those processors
Index: linux/arch/powerpc/mm/44x_mmu.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/44x_mmu.c (revision 5484)
+++ linux/arch/powerpc/mm/44x_mmu.c (copie de travail)
@@ -212,7 +212,8 @@
}
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
u64 size;
Index: linux/arch/powerpc/mm/fsl_booke_mmu.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/fsl_booke_mmu.c (revision 5484)
+++ linux/arch/powerpc/mm/fsl_booke_mmu.c (copie de travail)
@@ -234,7 +234,8 @@
}
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
phys_addr_t limit =3D first_memblock_base + first_memblock_size;
Index: linux/arch/powerpc/mm/hash_utils_64.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/hash_utils_64.c (revision 5484)
+++ linux/arch/powerpc/mm/hash_utils_64.c (copie de travail)
@@ -1416,7 +1416,8 @@
#endif /* CONFIG_DEBUG_PAGEALLOC */
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
/* We don't currently support the first MEMBLOCK not mapping 0
* physical on those processors
Index: linux/arch/powerpc/mm/init_32.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/init_32.c (revision 5484)
+++ linux/arch/powerpc/mm/init_32.c (copie de travail)
@@ -206,19 +206,16 @@
#ifdef CONFIG_8xx /* No 8xx specific .c file to put that in ... */
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
/* We don't currently support the first MEMBLOCK not mapping 0
* physical on those processors
*/
BUG_ON(first_memblock_base !=3D 0);
-#ifdef CONFIG_PIN_TLB
- /* 8xx can only access 24MB at the moment */
- memblock_set_current_limit(min_t(u64, first_memblock_size, 0x01800000));
-#else
- /* 8xx can only access 8MB at the moment */
- memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000));
-#endif
+ if (!init_mem_size)
+ init_mem_size =3D 0x00800000;
+ memblock_set_current_limit(min_t(u64, first_memblock_size, init_mem_size)=
);
}
#endif /* CONFIG_8xx */
Index: linux/arch/powerpc/mm/ppc_mmu_32.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/ppc_mmu_32.c (revision 5484)
+++ linux/arch/powerpc/mm/ppc_mmu_32.c (copie de travail)
@@ -273,7 +273,8 @@
}
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
/* We don't currently support the first MEMBLOCK not mapping 0
* physical on those processors
Index: linux/arch/powerpc/mm/tlb_nohash.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux/arch/powerpc/mm/tlb_nohash.c (revision 5484)
+++ linux/arch/powerpc/mm/tlb_nohash.c (copie de travail)
@@ -654,7 +654,8 @@
}
void setup_initial_memory_limit(phys_addr_t first_memblock_base,
- phys_addr_t first_memblock_size)
+ phys_addr_t first_memblock_size,
+ u64 init_mem_size)
{
/* On non-FSL Embedded 64-bit, we adjust the RMA size to match
* the bolted TLB entry. We know for now that only 1G
---
Ce courrier =C3=A9lectronique ne contient aucun virus ou logiciel malveilla=
nt parce que la protection avast! Antivirus est active.
http://www.avast.com
^ permalink raw reply
* Re: [PATCH v3] powerpc: Fix PTE page address mismatch in pgtable ctor/dtor
From: Sebastian Andrzej Siewior @ 2013-12-15 12:59 UTC (permalink / raw)
To: Hong H. Pham
Cc: linux-rt-users, linux-stable, Paul Mackerras, Aneesh Kumar K.V,
linuxppc-dev
In-Reply-To: <1386425193-24015-1-git-send-email-hong.pham@windriver.com>
* Hong H. Pham | 2013-12-07 09:06:33 [-0500]:
>On PPC32, only SMP kernels are affected.
>
>On PPC64, only SMP kernels with 4K page size are affected.
$ uname -a
Linux mpc8536-1 3.12.1-rt3-00281-g9de268d #76 SMP PREEMPT RT Fri Nov 22 16:53:05 CET 2013 ppc GNU/Linux
$ uptime
22:01:10 up 22 days, 21:01, 1 user, load average: 443.08, 563.59, 586.20
This is from a mpc8536 box. The high load comes from a hackbench that was
running for quite some time. Are Book-E (CONFIG_PPC_BOOK3E_MMU without
CONFIG_PPC_BOOK3E set) not affected or is this bug not present if a SMP
kernel is booted on a UP machine?
Sebastian
^ permalink raw reply
* Re: [PATCH 10/10] Kconfig: cleanup SERIO_I8042 dependencies
From: Dmitry Torokhov @ 2013-12-15 10:36 UTC (permalink / raw)
To: H. Peter Anvin
Cc: linux-mips, linux-ia64, linux-sh, Paul Mackerras, sparclinux,
Guan Xuetao, Russell King, x86, Ingo Molnar, Mark Salter,
Fenghua Yu, Thomas Gleixner, linux-arm-kernel, Richard Henderson,
Tony Luck, linux-kernel, Ralf Baechle, Paul Mundt, linux-alpha,
linuxppc-dev, David S. Miller
In-Reply-To: <52ACA43F.2040402@zytor.com>
On Sat, Dec 14, 2013 at 10:32:31AM -0800, H. Peter Anvin wrote:
> On 12/14/2013 08:59 AM, Mark Salter wrote:
> > Remove messy dependencies from SERIO_I8042 by having it depend on one
> > Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
> > which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
> > New architectures are unlikely to need SERIO_I8042, so this avoids
> > having an ever growing list of architectures to exclude.
> >
> > Signed-off-by: Mark Salter <msalter@redhat.com>
> > CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> > CC: Richard Henderson <rth@twiddle.net>
> > CC: linux-alpha@vger.kernel.org
> > CC: Russell King <linux@arm.linux.org.uk>
> > CC: linux-arm-kernel@lists.infradead.org
> > CC: Tony Luck <tony.luck@intel.com>
> > CC: Fenghua Yu <fenghua.yu@intel.com>
> > CC: linux-ia64@vger.kernel.org
> > CC: Ralf Baechle <ralf@linux-mips.org>
> > CC: linux-mips@linux-mips.org
> > CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > CC: Paul Mackerras <paulus@samba.org>
> > CC: linuxppc-dev@lists.ozlabs.org
> > CC: Paul Mundt <lethal@linux-sh.org>
> > CC: linux-sh@vger.kernel.org
> > CC: "David S. Miller" <davem@davemloft.net>
> > CC: sparclinux@vger.kernel.org
> > CC: Guan Xuetao <gxt@mprc.pku.edu.cn>
> > CC: Ingo Molnar <mingo@redhat.com>
> > CC: Thomas Gleixner <tglx@linutronix.de>
> > CC: "H. Peter Anvin" <hpa@zytor.com>
> > CC: x86@kernel.org
>
> Acked-by: H. Peter Anvin <hpa@linux.intel.com>
How are we going to merge this? In bulk through input tree or peacemeal
through all arches first?
--
Dmitry
^ permalink raw reply
* Re: 3.13-rc1: eth0 hw csum failure on powerpc (bisected)
From: David Miller @ 2013-12-15 3:34 UTC (permalink / raw)
To: lists; +Cc: netdev, agraf, schwab, linuxppc-dev, linux-kernel
In-Reply-To: <alpine.DEB.2.11.1312141622230.25690@trent.utfs.org>
From: Christian Kujau <lists@nerdbynature.de>
Date: Sat, 14 Dec 2013 16:40:39 -0800 (PST)
> And sure enough, today's 3.13-rc3 with only that commit reverted boots
> just fine on this PowerBook G4 system.
It's reverted in my 'net' tree, that tree simple hasn't been pushed to
Linus just yet, please be patient.
^ permalink raw reply
* Re: [PATCH 10/10] Kconfig: cleanup SERIO_I8042 dependencies
From: H. Peter Anvin @ 2013-12-14 18:32 UTC (permalink / raw)
To: Mark Salter, linux-kernel
Cc: Fenghua Yu, Tony Luck, Russell King, linux-mips, linux-sh,
Dmitry Torokhov, x86, Ralf Baechle, Ingo Molnar, Paul Mundt,
Paul Mackerras, linux-alpha, sparclinux, linux-ia64,
Thomas Gleixner, Guan Xuetao, linuxppc-dev, David S. Miller,
linux-arm-kernel, Richard Henderson
In-Reply-To: <1387040376-26906-11-git-send-email-msalter@redhat.com>
On 12/14/2013 08:59 AM, Mark Salter wrote:
> Remove messy dependencies from SERIO_I8042 by having it depend on one
> Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
> which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
> New architectures are unlikely to need SERIO_I8042, so this avoids
> having an ever growing list of architectures to exclude.
>
> Signed-off-by: Mark Salter <msalter@redhat.com>
> CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> CC: Richard Henderson <rth@twiddle.net>
> CC: linux-alpha@vger.kernel.org
> CC: Russell King <linux@arm.linux.org.uk>
> CC: linux-arm-kernel@lists.infradead.org
> CC: Tony Luck <tony.luck@intel.com>
> CC: Fenghua Yu <fenghua.yu@intel.com>
> CC: linux-ia64@vger.kernel.org
> CC: Ralf Baechle <ralf@linux-mips.org>
> CC: linux-mips@linux-mips.org
> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> CC: Paul Mackerras <paulus@samba.org>
> CC: linuxppc-dev@lists.ozlabs.org
> CC: Paul Mundt <lethal@linux-sh.org>
> CC: linux-sh@vger.kernel.org
> CC: "David S. Miller" <davem@davemloft.net>
> CC: sparclinux@vger.kernel.org
> CC: Guan Xuetao <gxt@mprc.pku.edu.cn>
> CC: Ingo Molnar <mingo@redhat.com>
> CC: Thomas Gleixner <tglx@linutronix.de>
> CC: "H. Peter Anvin" <hpa@zytor.com>
> CC: x86@kernel.org
Acked-by: H. Peter Anvin <hpa@linux.intel.com>
^ permalink raw reply
* Re: 3.13-rc1: eth0 hw csum failure on powerpc (bisected)
From: Christian Kujau @ 2013-12-15 0:40 UTC (permalink / raw)
To: Andreas Schwab, davem; +Cc: netdev, linuxppc-dev, LKML, Alexander Graf
In-Reply-To: <87vbz9pmud.fsf@igel.home>
On Sat, 30 Nov 2013 at 23:05, Andreas Schwab wrote:
> >> > [...]
> >> > Freeing unused kernel memory: 204K (c06ea000 - c071d000)
> >> > eth0: hw csum failure
> >> > CPU: 0 PID: 0 Comm: swapper Not tainted 3.13.0-rc2 #1
> >> > Call Trace:
> >>
> >> Btw, full dmesg & .config: http://nerdbynature.de/bits/3.13-rc1/
> >
> > Oh, this has already been reported earlier this week:
> >
> > https://lists.ozlabs.org/pipermail/linuxppc-dev/2013-November/113584.html
>
> No solution yet, though, 3.13-rc2 is still broken.
As 3.13-rc3 was still broken, I tried a git-bisect, resulting in:
018c5bba052b3a383d83cf0c756da0e7bc748397 is the first bad commit
commit 018c5bba052b3a383d83cf0c756da0e7bc748397
Author: David S. Miller <davem@davemloft.net>
Date: Fri Nov 15 21:11:16 2013 -0500
net: Handle CHECKSUM_COMPLETE more adequately in pskb_trim_rcsum().
Currently pskb_trim_rcsum() just balks on CHECKSUM_COMPLETE packets
and remarks them as CHECKSUM_NONE, forcing a software checksum
validation later.
We have all of the mechanics available to fixup the skb->csum value,
even for complicated fragmented packets, via the helpers
skb_checksum() and csum_sub().
So just use them.
Based upon a suggestion by Herbert Xu.
Signed-off-by: David S. Miller <davem@davemloft.net>
:040000 040000 14e295c30c2d2a1164f4eb70aaec821fbe288c01 456c666ebbb355292b683c71c85585fc6d07e852 M include
And sure enough, today's 3.13-rc3 with only that commit reverted boots
just fine on this PowerBook G4 system.
Thanks,
Christian
--
BOFH excuse #152:
My pony-tail hit the on/off switch on the power strip.
^ permalink raw reply
* [PATCH 10/10] Kconfig: cleanup SERIO_I8042 dependencies
From: Mark Salter @ 2013-12-14 16:59 UTC (permalink / raw)
To: linux-kernel
Cc: linux-mips, linux-ia64, linux-sh, Paul Mackerras, H. Peter Anvin,
sparclinux, Guan Xuetao, Russell King, x86, Ingo Molnar,
Mark Salter, Fenghua Yu, Thomas Gleixner, linux-arm-kernel,
Richard Henderson, Tony Luck, Dmitry Torokhov, Ralf Baechle,
Paul Mundt, linux-alpha, linuxppc-dev, David S. Miller
In-Reply-To: <1387040376-26906-1-git-send-email-msalter@redhat.com>
Remove messy dependencies from SERIO_I8042 by having it depend on one
Kconfig symbol (ARCH_MIGHT_HAVE_PC_SERIO) and having architectures
which need it select ARCH_MIGHT_HAVE_PC_SERIO in arch/*/Kconfig.
New architectures are unlikely to need SERIO_I8042, so this avoids
having an ever growing list of architectures to exclude.
Signed-off-by: Mark Salter <msalter@redhat.com>
CC: Dmitry Torokhov <dmitry.torokhov@gmail.com>
CC: Richard Henderson <rth@twiddle.net>
CC: linux-alpha@vger.kernel.org
CC: Russell King <linux@arm.linux.org.uk>
CC: linux-arm-kernel@lists.infradead.org
CC: Tony Luck <tony.luck@intel.com>
CC: Fenghua Yu <fenghua.yu@intel.com>
CC: linux-ia64@vger.kernel.org
CC: Ralf Baechle <ralf@linux-mips.org>
CC: linux-mips@linux-mips.org
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: linuxppc-dev@lists.ozlabs.org
CC: Paul Mundt <lethal@linux-sh.org>
CC: linux-sh@vger.kernel.org
CC: "David S. Miller" <davem@davemloft.net>
CC: sparclinux@vger.kernel.org
CC: Guan Xuetao <gxt@mprc.pku.edu.cn>
CC: Ingo Molnar <mingo@redhat.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
CC: x86@kernel.org
---
drivers/input/serio/Kconfig | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/input/serio/Kconfig b/drivers/input/serio/Kconfig
index 8541f94..1f5cec2 100644
--- a/drivers/input/serio/Kconfig
+++ b/drivers/input/serio/Kconfig
@@ -16,14 +16,19 @@ config SERIO
To compile this driver as a module, choose M here: the
module will be called serio.
+config ARCH_MIGHT_HAVE_PC_SERIO
+ bool
+ help
+ Select this config option from the architecture Kconfig if
+ the architecture might use a PC serio device (i8042) to
+ communicate with keyboard, mouse, etc.
+
if SERIO
config SERIO_I8042
tristate "i8042 PC Keyboard controller"
default y
- depends on !PARISC && (!ARM || FOOTBRIDGE_HOST) && \
- (!SUPERH || SH_CAYMAN) && !M68K && !BLACKFIN && !S390 && \
- !ARC
+ depends on ARCH_MIGHT_HAVE_PC_SERIO
help
i8042 is the chip over which the standard AT keyboard and PS/2
mouse are connected to the computer. If you use these devices,
--
1.8.3.1
^ permalink raw reply related
* [PATCH 05/10] powerpc: select ARCH_MIGHT_HAVE_PC_SERIO
From: Mark Salter @ 2013-12-14 16:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Paul Mackerras, linuxppc-dev, Mark Salter
In-Reply-To: <1387040376-26906-1-git-send-email-msalter@redhat.com>
Architectures which might use an i8042 for serial IO to keyboard,
mouse, etc should select ARCH_MIGHT_HAVE_PC_SERIO.
Signed-off-by: Mark Salter <msalter@redhat.com>
CC: Benjamin Herrenschmidt <benh@kernel.crashing.org>
CC: Paul Mackerras <paulus@samba.org>
CC: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b44b52c..fb75485 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -86,6 +86,7 @@ config PPC
bool
default y
select ARCH_MIGHT_HAVE_PC_PARPORT
+ select ARCH_MIGHT_HAVE_PC_SERIO
select BINFMT_ELF
select OF
select OF_EARLY_FLATTREE
--
1.8.3.1
^ permalink raw reply related
* [GIT PULL locking/mb] Locking/memory-barrier commits
From: Paul E. McKenney @ 2013-12-14 7:48 UTC (permalink / raw)
To: mingo
Cc: linux-arch, linuxppc-dev, corbet, peterz, rusty, oleg, josh,
dhowells, paulus, torvalds
Hello, Ingo,
This pull request contains additions to the memory-barrier documentation,
along with a downgrading of UNLOCK+LOCK to no longer be a full memory
barrier, and finally an smp_mb__after_unlock_lock() that allows upgrading
a particular LOCK to pair with a preceding UNLOCK to form a full memory
barrier, and application of smp_mb__after_unlock_lock() to RCU.
The first four documentation commits are ready for 3.14:
b145f8acfd82 (Add needed ACCESS_ONCE() calls to memory-barriers.txt)
6be08d626389 (Add long atomic examples to memory-barriers.txt)
c89bb78cfbe1 (Prohibit speculative writes)
b2ba08be67fc (Document ACCESS_ONCE())
The remaining commits might or might not be, but are at a point where
getting them into -tip is appropriate given other changes in this area,
e.g., Peter's smp_load_acquire() and smp_store_release().
These changes are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git locking/mb
for you to fetch changes up to 9f9df17e265b2c5aea11a95e3e69269d005ac0ae:
powerpc: Full barrier for smp_mb__after_unlock_lock() (2013-12-13 09:05:13 -0800)
----------------------------------------------------------------
Paul E. McKenney (7):
Documentation/memory-barriers.txt: Add needed ACCESS_ONCE() calls to memory-barriers.txt
Documentation/memory-barriers.txt: Add long atomic examples to memory-barriers.txt
Documentation/memory-barriers.txt: Document ACCESS_ONCE()
locking: Add an smp_mb__after_unlock_lock() for UNLOCK+LOCK barrier
Documentation/memory-barriers.txt: Downgrade UNLOCK+LOCK
rcu: Apply smp_mb__after_unlock_lock() to preserve grace periods
powerpc: Full barrier for smp_mb__after_unlock_lock()
Peter Zijlstra (1):
Documentation/memory-barriers.txt: Prohibit speculative writes
Documentation/memory-barriers.txt | 733 ++++++++++++++++++++++++++++++------
arch/powerpc/include/asm/spinlock.h | 2 +
include/linux/spinlock.h | 10 +
kernel/rcu/tree.c | 18 +-
kernel/rcu/tree_plugin.h | 13 +
5 files changed, 661 insertions(+), 115 deletions(-)
^ permalink raw reply
* RE: [PATCH v11] PPC: POWERNV: move iommu_add_device earlier
From: Bharat.Bhushan @ 2013-12-14 4:57 UTC (permalink / raw)
To: Alexey Kardashevskiy, linuxppc-dev@lists.ozlabs.org
Cc: Alex Graf, linux-kernel@vger.kernel.org
In-Reply-To: <1386834869-15561-1-git-send-email-aik@ozlabs.ru>
> -----Original Message-----
> From: Alexey Kardashevskiy [mailto:aik@ozlabs.ru]
> Sent: Thursday, December 12, 2013 1:24 PM
> To: linuxppc-dev@lists.ozlabs.org
> Cc: Alexey Kardashevskiy; Benjamin Herrenschmidt; Bhushan Bharat-R65777; =
Alex
> Graf; linux-kernel@vger.kernel.org
> Subject: [PATCH v11] PPC: POWERNV: move iommu_add_device earlier
>=20
> The current implementation of IOMMU on sPAPR does not use iommu_ops
> and therefore does not call IOMMU API's bus_set_iommu() which
> 1) sets iommu_ops for a bus
> 2) registers a bus notifier
> Instead, PCI devices are added to IOMMU groups from
> subsys_initcall_sync(tce_iommu_init) which does basically the same
> thing without using iommu_ops callbacks.
>=20
> However Freescale PAMU driver (https://lkml.org/lkml/2013/7/1/158)
> implements iommu_ops and when tce_iommu_init is called, every PCI device
> is already added to some group so there is a conflict.
>=20
> This patch does 2 things:
> 1. removes the loop in which PCI devices were added to groups and
> adds explicit iommu_add_device() calls to add devices as soon as they get
> the iommu_table pointer assigned to them.
> 2. moves a bus notifier to powernv code in order to avoid conflict with
> the notifier from Freescale driver.
>=20
> iommu_add_device() and iommu_del_device() are public now.
>=20
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> Changes:
> v11:
> * rebased on upstream
>=20
> v10:
> * fixed linker error when IOMMU_API is not enabled
>=20
> v9:
> * removed "KVM" from the subject as it is not really a KVM patch so
> PPC mainainter (hi Ben!) can review/include it into his tree
>=20
> v8:
> * added the check for iommu_group!=3DNULL before removing device from a g=
roup
> as suggested by Wei Yang <weiyang@linux.vnet.ibm.com>
>=20
> v2:
> * added a helper - set_iommu_table_base_and_group - which does
> set_iommu_table_base() and iommu_add_device()
> ---
> arch/powerpc/include/asm/iommu.h | 26 +++++++++++++++++++++++=
+
> arch/powerpc/kernel/iommu.c | 11 ++++------
> arch/powerpc/platforms/powernv/pci-ioda.c | 8 ++++----
> arch/powerpc/platforms/powernv/pci-p5ioc2.c | 2 +-
> arch/powerpc/platforms/powernv/pci.c | 31 +++++++++++++++++++++++=
+++++-
> arch/powerpc/platforms/pseries/iommu.c | 8 +++++---
> 6 files changed, 70 insertions(+), 16 deletions(-)
>=20
> diff --git a/arch/powerpc/include/asm/iommu.h b/arch/powerpc/include/asm/=
iommu.h
> index c34656a..774fa27 100644
> --- a/arch/powerpc/include/asm/iommu.h
> +++ b/arch/powerpc/include/asm/iommu.h
> @@ -101,8 +101,34 @@ extern void iommu_free_table(struct iommu_table *tbl=
, const
> char *node_name);
> */
> extern struct iommu_table *iommu_init_table(struct iommu_table * tbl,
> int nid);
> +#ifdef CONFIG_IOMMU_API
> extern void iommu_register_group(struct iommu_table *tbl,
> int pci_domain_number, unsigned long pe_num);
> +extern int iommu_add_device(struct device *dev);
> +extern void iommu_del_device(struct device *dev);
> +#else
> +static inline void iommu_register_group(struct iommu_table *tbl,
> + int pci_domain_number,
> + unsigned long pe_num)
> +{
> +}
> +
> +static inline int iommu_add_device(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static inline void iommu_del_device(struct device *dev)
> +{
> +}
> +#endif /* !CONFIG_IOMMU_API */
> +
> +static inline void set_iommu_table_base_and_group(struct device *dev,
> + void *base)
> +{
> + set_iommu_table_base(dev, base);
> + iommu_add_device(dev);
> +}
>=20
> extern int iommu_map_sg(struct device *dev, struct iommu_table *tbl,
> struct scatterlist *sglist, int nelems,
> diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
> index 572bb5b..818a092 100644
> --- a/arch/powerpc/kernel/iommu.c
> +++ b/arch/powerpc/kernel/iommu.c
> @@ -1105,7 +1105,7 @@ void iommu_release_ownership(struct iommu_table *tb=
l)
> }
> EXPORT_SYMBOL_GPL(iommu_release_ownership);
>=20
> -static int iommu_add_device(struct device *dev)
> +int iommu_add_device(struct device *dev)
> {
> struct iommu_table *tbl;
> int ret =3D 0;
> @@ -1134,11 +1134,13 @@ static int iommu_add_device(struct device *dev)
>=20
> return ret;
> }
> +EXPORT_SYMBOL_GPL(iommu_add_device);
>=20
> -static void iommu_del_device(struct device *dev)
> +void iommu_del_device(struct device *dev)
> {
> iommu_group_remove_device(dev);
> }
> +EXPORT_SYMBOL_GPL(iommu_del_device);
>=20
> static int iommu_bus_notifier(struct notifier_block *nb,
> unsigned long action, void *data)
> @@ -1162,13 +1164,8 @@ static struct notifier_block tce_iommu_bus_nb =3D =
{
>=20
> static int __init tce_iommu_init(void)
> {
> - struct pci_dev *pdev =3D NULL;
> -
> BUILD_BUG_ON(PAGE_SIZE < IOMMU_PAGE_SIZE);
>=20
> - for_each_pci_dev(pdev)
> - iommu_add_device(&pdev->dev);
> -
> bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
> return 0;
> }
Do we need this bus notifier? We are doing a bus notifier later ....=20
> diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c
> b/arch/powerpc/platforms/powernv/pci-ioda.c
> index 2c6d173..f0e6871 100644
> --- a/arch/powerpc/platforms/powernv/pci-ioda.c
> +++ b/arch/powerpc/platforms/powernv/pci-ioda.c
> @@ -460,7 +460,7 @@ static void pnv_pci_ioda_dma_dev_setup(struct pnv_phb=
*phb,
> struct pci_dev *pdev
> return;
>=20
> pe =3D &phb->ioda.pe_array[pdn->pe_number];
> - set_iommu_table_base(&pdev->dev, &pe->tce32_table);
> + set_iommu_table_base_and_group(&pdev->dev, &pe->tce32_table);
> }
>=20
> static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe, struct pci_bu=
s *bus)
> @@ -468,7 +468,7 @@ static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe=
*pe,
> struct pci_bus *bus)
> struct pci_dev *dev;
>=20
> list_for_each_entry(dev, &bus->devices, bus_list) {
> - set_iommu_table_base(&dev->dev, &pe->tce32_table);
> + set_iommu_table_base_and_group(&dev->dev, &pe->tce32_table);
> if (dev->subordinate)
> pnv_ioda_setup_bus_dma(pe, dev->subordinate);
> }
> @@ -644,7 +644,7 @@ static void pnv_pci_ioda_setup_dma_pe(struct pnv_phb =
*phb,
> iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
>=20
> if (pe->pdev)
> - set_iommu_table_base(&pe->pdev->dev, tbl);
> + set_iommu_table_base_and_group(&pe->pdev->dev, tbl);
> else
> pnv_ioda_setup_bus_dma(pe, pe->pbus);
>=20
> @@ -723,7 +723,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb=
*phb,
> iommu_register_group(tbl, pci_domain_nr(pe->pbus), pe->pe_number);
>=20
> if (pe->pdev)
> - set_iommu_table_base(&pe->pdev->dev, tbl);
> + set_iommu_table_base_and_group(&pe->pdev->dev, tbl);
> else
> pnv_ioda_setup_bus_dma(pe, pe->pbus);
>=20
> diff --git a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> index f8b4bd8..e3807d6 100644
> --- a/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> +++ b/arch/powerpc/platforms/powernv/pci-p5ioc2.c
> @@ -92,7 +92,7 @@ static void pnv_pci_p5ioc2_dma_dev_setup(struct pnv_phb=
*phb,
> pci_domain_nr(phb->hose->bus), phb->opal_id);
> }
>=20
> - set_iommu_table_base(&pdev->dev, &phb->p5ioc2.iommu_table);
> + set_iommu_table_base_and_group(&pdev->dev, &phb->p5ioc2.iommu_table);
> }
>=20
> static void __init pnv_pci_init_p5ioc2_phb(struct device_node *np, u64 h=
ub_id,
> diff --git a/arch/powerpc/platforms/powernv/pci.c
> b/arch/powerpc/platforms/powernv/pci.c
> index 4eb33a9..a78abad 100644
> --- a/arch/powerpc/platforms/powernv/pci.c
> +++ b/arch/powerpc/platforms/powernv/pci.c
> @@ -536,7 +536,7 @@ static void pnv_pci_dma_fallback_setup(struct pci_con=
troller
> *hose,
> pdn->iommu_table =3D pnv_pci_setup_bml_iommu(hose);
> if (!pdn->iommu_table)
> return;
> - set_iommu_table_base(&pdev->dev, pdn->iommu_table);
> + set_iommu_table_base_and_group(&pdev->dev, pdn->iommu_table);
> }
>=20
> static void pnv_pci_dma_dev_setup(struct pci_dev *pdev)
> @@ -657,3 +657,32 @@ void __init pnv_pci_init(void)
> ppc_md.teardown_msi_irqs =3D pnv_teardown_msi_irqs;
> #endif
> }
> +
> +static int tce_iommu_bus_notifier(struct notifier_block *nb,
> + unsigned long action, void *data)
> +{
> + struct device *dev =3D data;
> +
> + switch (action) {
> + case BUS_NOTIFY_ADD_DEVICE:
> + return iommu_add_device(dev);
> + case BUS_NOTIFY_DEL_DEVICE:
> + if (dev->iommu_group)
> + iommu_del_device(dev);
> + return 0;
> + default:
> + return 0;
> + }
> +}
> +
> +static struct notifier_block tce_iommu_bus_nb =3D {
> + .notifier_call =3D tce_iommu_bus_notifier,
> +};
> +
> +static int __init tce_iommu_bus_notifier_init(void)
> +{
> + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
Here it is, setting up the bus notifier.
Thanks
-Bharat
> + return 0;
> +}
> +
> +subsys_initcall_sync(tce_iommu_bus_notifier_init);
> diff --git a/arch/powerpc/platforms/pseries/iommu.c
> b/arch/powerpc/platforms/pseries/iommu.c
> index f253361..a80af6c 100644
> --- a/arch/powerpc/platforms/pseries/iommu.c
> +++ b/arch/powerpc/platforms/pseries/iommu.c
> @@ -687,7 +687,8 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev =
*dev)
> iommu_table_setparms(phb, dn, tbl);
> PCI_DN(dn)->iommu_table =3D iommu_init_table(tbl, phb->node);
> iommu_register_group(tbl, pci_domain_nr(phb->bus), 0);
> - set_iommu_table_base(&dev->dev, PCI_DN(dn)->iommu_table);
> + set_iommu_table_base_and_group(&dev->dev,
> + PCI_DN(dn)->iommu_table);
> return;
> }
>=20
> @@ -699,7 +700,8 @@ static void pci_dma_dev_setup_pSeries(struct pci_dev =
*dev)
> dn =3D dn->parent;
>=20
> if (dn && PCI_DN(dn))
> - set_iommu_table_base(&dev->dev, PCI_DN(dn)->iommu_table);
> + set_iommu_table_base_and_group(&dev->dev,
> + PCI_DN(dn)->iommu_table);
> else
> printk(KERN_WARNING "iommu: Device %s has no iommu table\n",
> pci_name(dev));
> @@ -1193,7 +1195,7 @@ static void pci_dma_dev_setup_pSeriesLP(struct pci_=
dev
> *dev)
> pr_debug(" found DMA window, table: %p\n", pci->iommu_table);
> }
>=20
> - set_iommu_table_base(&dev->dev, pci->iommu_table);
> + set_iommu_table_base_and_group(&dev->dev, pci->iommu_table);
> }
>=20
> static int dma_set_mask_pSeriesLP(struct device *dev, u64 dma_mask)
> --
> 1.8.4.rc4
>=20
>=20
^ permalink raw reply
* RE: [1/3] powerpc/vfio: Enable on POWERNV platform
From: Bharat.Bhushan @ 2013-12-14 4:56 UTC (permalink / raw)
To: Scott Wood, Alexey Kardashevskiy
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Alex Williamson, Paul Mackerras, Varun Sethi,
linuxppc-dev@lists.ozlabs.org, David Gibson
In-Reply-To: <1386968550.10013.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KLUJoYXJhdA0KDQo+IA0KPiAtU2NvdHQNCj4gDQoNCg==
^ permalink raw reply
* Re: [1/3] powerpc/vfio: Enable on POWERNV platform
From: Scott Wood @ 2013-12-13 21:02 UTC (permalink / raw)
To: Alexey Kardashevskiy
Cc: kvm, linux-kernel, Bharat Bhushan, Alex Williamson,
Paul Mackerras, Varun Sethi, linuxppc-dev, David Gibson
In-Reply-To: <52AA78AE.2050800@ozlabs.ru>
On Fri, 2013-12-13 at 14:02 +1100, Alexey Kardashevskiy wrote:
> On 12/13/2013 10:35 AM, Scott Wood wrote:
> > On Tue, May 21, 2013 at 01:33:09PM +1000, Alexey Kardashevskiy wrote:
> >> +static int iommu_add_device(struct device *dev)
> >> +{
> >> + struct iommu_table *tbl;
> >> + int ret = 0;
> >> +
> >> + if (WARN_ON(dev->iommu_group)) {
> >> + pr_warn("iommu_tce: device %s is already in iommu group %d, skipping\n",
> >> + dev_name(dev),
> >> + iommu_group_id(dev->iommu_group));
> >> + return -EBUSY;
> >> + }
> > [snip]
> >> +static int __init tce_iommu_init(void)
> >> +{
> >> + struct pci_dev *pdev = NULL;
> >> +
> >> + BUILD_BUG_ON(PAGE_SIZE < IOMMU_PAGE_SIZE);
> >> +
> >> + for_each_pci_dev(pdev)
> >> + iommu_add_device(&pdev->dev);
> >> +
> >> + bus_register_notifier(&pci_bus_type, &tce_iommu_bus_nb);
> >> + return 0;
> >> +}
> >> +
> >> +subsys_initcall_sync(tce_iommu_init);
> >
> > This is missing a check to see whether the appropriate hardware is
> > present. This file should also be renamed to something less generic, and
> > depend on a kconfig symbol more specific than CONFIG_PPC64.
> >
> > When this is combined with CONFIG_FSL_PAMU on hardware with a PAMU, I get
> > a bunch of those "WARN_ON(dev->iommu_group)" dumps because PAMU already
> > got to them. Presumably without PAMU it silently (or with just pr_debug)
> > bails out at some other point.
>
>
> I posted (yet again) yesterday "[PATCH v11] PPC: POWERNV: move
> iommu_add_device earlier" which should fix this. And Bharat asked many
> times for this to get accepted :)
I still get the WARN_ONs even with that patch. You're still registering
the bus notifier unconditionally.
-Scott
^ permalink raw reply
* Re: [PATCH V4 09/10] power8, perf: Change BHRB branch filter configuration
From: Anshuman Khandual @ 2013-12-13 8:20 UTC (permalink / raw)
To: Michael Ellerman
Cc: mikey, ak, linux-kernel, eranian, linuxppc-dev, acme, sukadev,
mingo
In-Reply-To: <20131209062147.51F822C00C5@ozlabs.org>
On 12/09/2013 11:51 AM, Michael Ellerman wrote:
>
> As I said in my comments on version 3 which you ignored:
>
> I think it would be clearer if we actually checked for the possibilities we
> allow and let everything else fall through, eg:
>
> Â Â Â Â Â Â Â Â /* Ignore user/kernel/hv bits */
> Â Â Â Â Â Â Â Â branch_sample_type &= ~PERF_SAMPLE_BRANCH_PLM_ALL;
>
> Â Â Â Â Â Â Â Â if (branch_sample_type == PERF_SAMPLE_BRANCH_ANY)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return 0;
>
> Â Â Â Â Â Â Â Â if (branch_sample_type == PERF_SAMPLE_BRANCH_ANY_CALL)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return POWER8_MMCRA_IFM1;
> Â
> Â Â Â Â Â Â Â Â if (branch_sample_type == PERF_SAMPLE_BRANCH_COND)
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â return POWER8_MMCRA_IFM3;
> Â Â Â Â Â Â Â Â
> Â Â Â Â Â Â Â Â return -1;
>
Hey Michael,
This patch only adds support for the PERF_SAMPLE_BRANCH_COND filter, if the
over all code flow does not clearly suggest that all combinations of any of
these HW filters are invalid, then we can go with one more patch to clean
that up before or after this patch but not here in this patch. Finally the
code section here will look something like this. Does it sound good ?
static u64 power8_bhrb_filter_map(u64 branch_sample_type)
{
u64 pmu_bhrb_filter = 0;
/* BHRB and regular PMU events share the same privilege state
* filter configuration. BHRB is always recorded along with a
* regular PMU event. As the privilege state filter is handled
* in the basic PMC configuration of the accompanying regular
* PMU event, we ignore any separate BHRB specific request.
*/
/* Ignore user, kernel, hv bits */
branch_sample_type &= ~PERF_SAMPLE_BRANCH_PLM_ALL;
if (branch_sample_type == PERF_SAMPLE_BRANCH_ANY)
return pmu_bhrb_filter;
if (branch_sample_type == PERF_SAMPLE_BRANCH_ANY_CALL) {
pmu_bhrb_filter |= POWER8_MMCRA_IFM1;
return pmu_bhrb_filter;
}
if (branch_sample_type == PERF_SAMPLE_BRANCH_COND) {
pmu_bhrb_filter |= POWER8_MMCRA_IFM3;
return pmu_bhrb_filter;
}
/* Every thing else is unsupported */
return -1;
}
^ permalink raw reply
* Re: [PATCH] powerpc, perf: Configure BHRB filter before enabling PMU interrupts
From: Anshuman Khandual @ 2013-12-13 6:46 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, mikey
In-Reply-To: <525E166C.5070407@linux.vnet.ibm.com>
On 10/16/2013 10:00 AM, Anshuman Khandual wrote:
> On 10/14/2013 11:49 AM, Michael Ellerman wrote:
>> On Fri, Oct 11, 2013 at 10:02:28AM +0530, Anshuman Khandual wrote:
>>> On 10/11/2013 07:41 AM, Michael Ellerman wrote:
>>>> On Thu, Oct 10, 2013 at 02:20:22PM +0530, Anshuman Khandual wrote:
>>>>
>>>>> Even I think this is not right. Instruction sampling should have been
>>>>> enabled before we enable PMU interrupts. Else there is a small window
>>>>> of time where we could have the PMU enabled with events (which requires
>>>>> sampling) without the sampling itself being enabled in MMCRA.
>>>>
>>>> Yes I agree. That's a separate bug, which we'll need to test on all the book3s
>>>> platforms we have perf support for.
>>>
>>> Okay, I guess any platform which supports sampling will definitely want to have
>>> it enabled before we can set the events to count on PMU. Can you think of any
>>> problem which can arise if we move it before the enabling the PMU back ? Else
>>> we can fix this easily.
>>
>> In theory it should be a trivial change. But hardware can behave in
>> strange ways, it's possible on some old chip we need to do it the
>> current way for some reason.
>>
>> So although I don't think it will be a problem, it could be, so we
>> will need to test it thoroughly.
>
> So which are the HW chips, you would like to test this fix for possible problems ?
>
Michael,
Any updates on this patch ?
^ permalink raw reply
* RE: [PATCH 1/5] powerpc/85xx/dts: add third elo3 dma component
From: Shengzhou.Liu @ 2013-12-13 5:43 UTC (permalink / raw)
To: Hongbo Zhang, linuxppc-dev@lists.ozlabs.org, Scott Wood
In-Reply-To: <52A9887D.3060109@freescale.com>
> -----Original Message-----
> From: Hongbo Zhang [mailto:hongbo.zhang@freescale.com]
> Sent: Thursday, December 12, 2013 5:57 PM
> To: Liu Shengzhou-B36685; linuxppc-dev@lists.ozlabs.org; Wood Scott-
> B07421
> Subject: Re: [PATCH 1/5] powerpc/85xx/dts: add third elo3 dma component
>=20
> Shengzhou,
> I canceled my patch http://patchwork.ozlabs.org/patch/295157/ because the
> original wrong elo3-dma-2.dtsi hadn't been merged.
> But please pay attention to comments from Scott about my changes of
> adding 208 for some interrupts, and take some actions if needed, or
> further discussions.
>=20
> Below comments form Scott:
> "The FSL MPIC binding should be updated to point out how this works.
> Technically it's not a change to the binding itself, since it's defined
> in terms of register offset, but the explanatory text says "So interrupt
> 0 is at offset 0x0, interrupt 1 is at offset 0x20, and so on." which is
> not accurate for these new high interrupt numbers."
>=20
Hongbo,
Could you update FSL MPIC binding as Scott pointed out?
thanks,
Shengzhou
^ permalink raw reply
* Re: [RFC PATCH] time: Support in tick broadcast framework for archs without an external wakeup source
From: Preeti U Murthy @ 2013-12-13 5:21 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: peterz, fweisbec, paul.gortmaker, paulus, mingo, shangw,
rafael.j.wysocki, paulmck, arnd, linux-pm, rostedt, michael,
john.stultz, tglx, chenhui.zhao, deepthi, r58472, geoff,
linux-kernel, srivatsa.bhat, schwidefsky, linuxppc-dev
In-Reply-To: <1386911862.15730.81.camel@pasglop>
Hi Ben,
On 12/13/2013 10:47 AM, Benjamin Herrenschmidt wrote:
> On Fri, 2013-12-13 at 09:49 +0530, Preeti U Murthy wrote:
>> On some architectures, in certain CPU deep idle states the local timers stop.
>> An external clock device is used to wakeup these CPUs. The kernel support for the
>> wakeup of these CPUs is provided by the tick broadcast framework by using the
>> external clock device as the wakeup source.
>
>> However on architectures like PowerPC there is no external clock device.
>
> Minor nit ...
>
> I wouldn't make this an architectural statement. Some PowerPC's do have
> external clock devices (for example the old MPIC interrupt controller
> had timers). In fact, if we really need it, I'm sure we *could* find
> something somewhere in P8 that could act as a timer, probably hijacking
> a bit of the OCC or similar but at this stage, that's not on the radar.
>
> So make it an implementation statement. "However, not all
> implementations, such as some PowerPC ones, provide such an external
> timer ...".
Thanks for this information. I will update this going ahead.
Regards
Preeti U Murthy
^ permalink raw reply
* Re: [RFC PATCH] time: Support in tick broadcast framework for archs without an external wakeup source
From: Benjamin Herrenschmidt @ 2013-12-13 5:17 UTC (permalink / raw)
To: Preeti U Murthy
Cc: peterz, fweisbec, paul.gortmaker, paulus, mingo, shangw,
rafael.j.wysocki, paulmck, arnd, linux-pm, rostedt, michael,
john.stultz, tglx, chenhui.zhao, deepthi, r58472, geoff,
linux-kernel, srivatsa.bhat, schwidefsky, linuxppc-dev
In-Reply-To: <20131213041901.17199.37383.stgit@preeti.in.ibm.com>
On Fri, 2013-12-13 at 09:49 +0530, Preeti U Murthy wrote:
> On some architectures, in certain CPU deep idle states the local timers stop.
> An external clock device is used to wakeup these CPUs. The kernel support for the
> wakeup of these CPUs is provided by the tick broadcast framework by using the
> external clock device as the wakeup source.
> However on architectures like PowerPC there is no external clock device.
Minor nit ...
I wouldn't make this an architectural statement. Some PowerPC's do have
external clock devices (for example the old MPIC interrupt controller
had timers). In fact, if we really need it, I'm sure we *could* find
something somewhere in P8 that could act as a timer, probably hijacking
a bit of the OCC or similar but at this stage, that's not on the radar.
So make it an implementation statement. "However, not all
implementations, such as some PowerPC ones, provide such an external
timer ...".
> This
> patch includes support in the broadcast framework to handle the wakeup of the
> CPUs in deep idle states on such architectures by queuing a hrtimer on one of
> the CPUs, meant to handle the wakeup of CPUs in deep idle states. This CPU is
> identified as the bc_cpu.
>
> Each time the hrtimer expires, it is reprogrammed for the next wakeup of the
> CPUs in deep idle state after handling broadcast. However when a CPU is about
> to enter deep idle state with its wakeup time earlier than the time at which
> the hrtimer is currently programmed, it *becomes the new bc_cpu* and restarts
> the hrtimer on itself. This way the job of doing broadcast is handed around to
> the CPUs that ask for the earliest wakeup just before entering deep idle
> state. This is consistent with what happens in cases where an external clock
> device is present. The smp affinity of this clock device is set to the CPU
> with the earliest wakeup.
>
> The important point here is that the bc_cpu cannot enter deep idle state
> since it has a hrtimer queued to wakeup the other CPUs in deep idle. Hence it
> cannot have its local timer stopped. Therefore for such a CPU, the
> BROADCAST_ENTER notification has to fail implying that it cannot enter deep
> idle state. On architectures where an external clock device is present, all
> CPUs can enter deep idle.
>
> During hotplug of the bc_cpu, the job of doing a broadcast is assigned to the
> first cpu in the broadcast mask. This newly nominated bc_cpu is woken up by
> an IPI so as to queue the above mentioned hrtimer on itself.
>
> This patch is compile tested only.
>
> Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
> ---
>
> include/linux/clockchips.h | 4 +
> kernel/time/clockevents.c | 8 +-
> kernel/time/tick-broadcast.c | 157 ++++++++++++++++++++++++++++++++++++++----
> kernel/time/tick-internal.h | 8 +-
> 4 files changed, 153 insertions(+), 24 deletions(-)
>
> diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
> index 493aa02..bbda37b 100644
> --- a/include/linux/clockchips.h
> +++ b/include/linux/clockchips.h
> @@ -186,9 +186,9 @@ static inline int tick_check_broadcast_expired(void) { return 0; }
> #endif
>
> #ifdef CONFIG_GENERIC_CLOCKEVENTS
> -extern void clockevents_notify(unsigned long reason, void *arg);
> +extern int clockevents_notify(unsigned long reason, void *arg);
> #else
> -static inline void clockevents_notify(unsigned long reason, void *arg) {}
> +static inline int clockevents_notify(unsigned long reason, void *arg) {}
> #endif
>
> #else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
> diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
> index 086ad60..bbbd671 100644
> --- a/kernel/time/clockevents.c
> +++ b/kernel/time/clockevents.c
> @@ -525,11 +525,11 @@ void clockevents_resume(void)
> /**
> * clockevents_notify - notification about relevant events
> */
> -void clockevents_notify(unsigned long reason, void *arg)
> +int clockevents_notify(unsigned long reason, void *arg)
> {
> struct clock_event_device *dev, *tmp;
> unsigned long flags;
> - int cpu;
> + int cpu, ret = 0;
>
> raw_spin_lock_irqsave(&clockevents_lock, flags);
>
> @@ -542,11 +542,12 @@ void clockevents_notify(unsigned long reason, void *arg)
>
> case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
> case CLOCK_EVT_NOTIFY_BROADCAST_EXIT:
> - tick_broadcast_oneshot_control(reason);
> + ret = tick_broadcast_oneshot_control(reason);
> break;
>
> case CLOCK_EVT_NOTIFY_CPU_DYING:
> tick_handover_do_timer(arg);
> + tick_handover_bc_cpu(arg);
> break;
>
> case CLOCK_EVT_NOTIFY_SUSPEND:
> @@ -585,6 +586,7 @@ void clockevents_notify(unsigned long reason, void *arg)
> break;
> }
> raw_spin_unlock_irqrestore(&clockevents_lock, flags);
> + return ret;
> }
> EXPORT_SYMBOL_GPL(clockevents_notify);
>
> diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
> index 9532690..f90b865 100644
> --- a/kernel/time/tick-broadcast.c
> +++ b/kernel/time/tick-broadcast.c
> @@ -20,6 +20,7 @@
> #include <linux/sched.h>
> #include <linux/smp.h>
> #include <linux/module.h>
> +#include <linux/slab.h>
>
> #include "tick-internal.h"
>
> @@ -35,6 +36,10 @@ static cpumask_var_t tmpmask;
> static DEFINE_RAW_SPINLOCK(tick_broadcast_lock);
> static int tick_broadcast_force;
>
> +static struct hrtimer *bc_hrtimer;
> +static int bc_cpu = -1;
> +static ktime_t bc_next_wakeup;
> +
> #ifdef CONFIG_TICK_ONESHOT
> static void tick_broadcast_clear_oneshot(int cpu);
> #else
> @@ -528,6 +533,20 @@ static int tick_broadcast_set_event(struct clock_event_device *bc, int cpu,
> return ret;
> }
>
> +static void tick_broadcast_set_next_wakeup(int cpu, ktime_t expires, int force)
> +{
> + struct clock_event_device *bc;
> +
> + bc = tick_broadcast_device.evtdev;
> +
> + if (bc) {
> + tick_broadcast_set_event(bc, cpu, expires, force);
> + } else {
> + hrtimer_start(bc_hrtimer, expires, HRTIMER_MODE_ABS_PINNED);
> + bc_cpu = cpu;
> + }
> +}
> +
> int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
> {
> clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
> @@ -558,15 +577,13 @@ void tick_check_oneshot_broadcast(int cpu)
> /*
> * Handle oneshot mode broadcasting
> */
> -static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)
> +static int tick_oneshot_broadcast(void)
> {
> struct tick_device *td;
> ktime_t now, next_event;
> int cpu, next_cpu = 0;
>
> - raw_spin_lock(&tick_broadcast_lock);
> -again:
> - dev->next_event.tv64 = KTIME_MAX;
> + bc_next_wakeup.tv64 = KTIME_MAX;
> next_event.tv64 = KTIME_MAX;
> cpumask_clear(tmpmask);
> now = ktime_get();
> @@ -620,27 +637,83 @@ again:
> * in the event mask
> */
> if (next_event.tv64 != KTIME_MAX) {
> - /*
> - * Rearm the broadcast device. If event expired,
> - * repeat the above
> - */
> - if (tick_broadcast_set_event(dev, next_cpu, next_event, 0))
> + bc_next_wakeup = next_event;
> + }
> +
> + return next_cpu;
> +}
> +
> +/*
> + * Handler in oneshot mode for the external clock device
> + */
> +static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)
> +{
> + int next_cpu;
> +
> + raw_spin_lock(&tick_broadcast_lock);
> +
> +again: next_cpu = tick_oneshot_broadcast();
> + /*
> + * Rearm the broadcast device. If event expired,
> + * repeat the above
> + */
> + if (bc_next_wakeup.tv64 != KTIME_MAX)
> + if (tick_broadcast_set_event(dev, next_cpu, bc_next_wakeup, 0))
> goto again;
> +
> + raw_spin_unlock(&tick_broadcast_lock);
> +}
> +
> +/*
> + * Handler in oneshot mode for the hrtimer queued when there is no external
> + * clock device.
> + */
> +static enum hrtimer_restart handle_broadcast(struct hrtimer *hrtmr)
> +{
> + ktime_t now, interval;
> + int next_cpu;
> +
> + raw_spin_lock(&tick_broadcast_lock);
> + tick_oneshot_broadcast();
> +
> + now = ktime_get();
> +
> + if (bc_next_wakeup.tv64 != KTIME_MAX) {
> + interval = ktime_sub(bc_next_wakeup, now);
> + hrtimer_forward_now(bc_hrtimer, interval);
> + raw_spin_unlock(&tick_broadcast_lock);
> + return HRTIMER_RESTART;
> }
> raw_spin_unlock(&tick_broadcast_lock);
> + return HRTIMER_NORESTART;
> +}
> +
> +/* The CPU could be asked to take over from the previous bc_cpu,
> + * if it is being hotplugged out.
> + */
> +static void tick_broadcast_exit_check(int cpu)
> +{
> + if (cpu == bc_cpu)
> + hrtimer_start(bc_hrtimer, bc_next_wakeup,
> + HRTIMER_MODE_ABS_PINNED);
> +}
> +
> +static int can_enter_broadcast(int cpu)
> +{
> + return cpu != bc_cpu;
> }
>
> /*
> * Powerstate information: The system enters/leaves a state, where
> * affected devices might stop
> */
> -void tick_broadcast_oneshot_control(unsigned long reason)
> +int tick_broadcast_oneshot_control(unsigned long reason)
> {
> - struct clock_event_device *bc, *dev;
> + struct clock_event_device *dev;
> struct tick_device *td;
> unsigned long flags;
> ktime_t now;
> - int cpu;
> + int cpu, ret = 0;
>
> /*
> * Periodic mode does not care about the enter/exit of power
> @@ -660,7 +733,6 @@ void tick_broadcast_oneshot_control(unsigned long reason)
> if (!(dev->features & CLOCK_EVT_FEAT_C3STOP))
> return;
>
> - bc = tick_broadcast_device.evtdev;
>
> raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
> if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ENTER) {
> @@ -676,12 +748,21 @@ void tick_broadcast_oneshot_control(unsigned long reason)
> * woken by the IPI right away.
> */
> if (!cpumask_test_cpu(cpu, tick_broadcast_force_mask) &&
> - dev->next_event.tv64 < bc->next_event.tv64)
> - tick_broadcast_set_event(bc, cpu, dev->next_event, 1);
> + dev->next_event.tv64 < bc_next_wakeup.tv64)
> + bc_next_wakeup = dev->next_event;
> + tick_broadcast_set_next_wakeup(cpu, dev->next_event, 1);
> +
> + if (!can_enter_broadcast(cpu)) {
> + cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask);
> + clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
> + ret = 1;
> + }
> }
> } else {
> if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) {
> clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
> +
> + tick_broadcast_exit_check(cpu);
> /*
> * The cpu which was handling the broadcast
> * timer marked this cpu in the broadcast
> @@ -746,6 +827,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
> }
> out:
> raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
> + return ret;
> }
>
> /*
> @@ -824,15 +906,58 @@ void tick_broadcast_switch_to_oneshot(void)
>
> raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
>
> + bc_next_wakeup.tv64 = KTIME_MAX;
> +
> tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
> bc = tick_broadcast_device.evtdev;
> - if (bc)
> + if (bc) {
> tick_broadcast_setup_oneshot(bc);
> + bc_next_wakeup = bc->next_event;
> + } else {
> + /* An alternative to tick_broadcast_device on archs which do not have
> + * an external device
> + */
> + bc_hrtimer = kmalloc(sizeof(*bc_hrtimer), GFP_NOWAIT);
> + hrtimer_init(bc_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED);
> + bc_hrtimer->function = handle_broadcast;
> +
> + /*
> + * There may be CPUs waiting for periodic broadcast. We need
> + * to set the oneshot bits for those and program the hrtimer
> + * to fire at the next tick period.
> + */
> + cpumask_copy(tmpmask, tick_broadcast_mask);
> + cpumask_clear_cpu(cpu, tmpmask);
> + cpumask_or(tick_broadcast_oneshot_mask,
> + tick_broadcast_oneshot_mask, tmpmask);
> +
> + if (!cpumask_empty(tmpmask)) {
> + tick_broadcast_init_next_event(tmpmask,
> + tick_next_period);
> + hrtimer_start(bc_hrtimer, tick_next_period, HRTIMER_MODE_ABS_PINNED);
> + bc_next_wakeup = tick_next_period;
> + }
> + }
>
> raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
> }
>
>
> +void tick_handover_bc_cpu(int *cpup)
> +{
> + struct tick_device *td;
> +
> + if (*cpup == bc_cpu) {
> + int cpu = cpumask_first(tick_broadcast_oneshot_mask);
> +
> + bc_cpu = (cpu < nr_cpu_ids) ? cpu : -1;
> + if (bc_cpu != -1) {
> + td = &per_cpu(tick_cpu_device, bc_cpu);
> + td->evtdev->broadcast(cpumask_of(bc_cpu));
> + }
> + }
> +}
> +
> /*
> * Remove a dead CPU from broadcasting
> */
> diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
> index 18e71f7..1f73032 100644
> --- a/kernel/time/tick-internal.h
> +++ b/kernel/time/tick-internal.h
> @@ -46,23 +46,25 @@ extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *));
> extern void tick_resume_oneshot(void);
> # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
> extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
> -extern void tick_broadcast_oneshot_control(unsigned long reason);
> +extern int tick_broadcast_oneshot_control(unsigned long reason);
> extern void tick_broadcast_switch_to_oneshot(void);
> extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup);
> extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc);
> extern int tick_broadcast_oneshot_active(void);
> extern void tick_check_oneshot_broadcast(int cpu);
> +extern void tick_handover_bc_cpu(int *cpup);
> bool tick_broadcast_oneshot_available(void);
> # else /* BROADCAST */
> static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
> {
> BUG();
> }
> -static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
> +static inline int tick_broadcast_oneshot_control(unsigned long reason) { }
> static inline void tick_broadcast_switch_to_oneshot(void) { }
> static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
> static inline int tick_broadcast_oneshot_active(void) { return 0; }
> static inline void tick_check_oneshot_broadcast(int cpu) { }
> +static inline void tick_handover_bc_cpu(int *cpup) {}
> static inline bool tick_broadcast_oneshot_available(void) { return true; }
> # endif /* !BROADCAST */
>
> @@ -87,7 +89,7 @@ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
> {
> BUG();
> }
> -static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
> +static inline int tick_broadcast_oneshot_control(unsigned long reason) { }
> static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
> static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
> {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* [PATCH] powerpc/powernv: Fix OPAL LPC access in Little Endian
From: Benjamin Herrenschmidt @ 2013-12-13 4:56 UTC (permalink / raw)
To: linuxppc-dev
We are passing pointers to the firmware for reads, we need to properly
convert the result as OPAL is always BE.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
diff --git a/arch/powerpc/platforms/powernv/opal-lpc.c b/arch/powerpc/platforms/powernv/opal-lpc.c
index e7e59e4..79d83ca 100644
--- a/arch/powerpc/platforms/powernv/opal-lpc.c
+++ b/arch/powerpc/platforms/powernv/opal-lpc.c
@@ -24,25 +24,25 @@ static int opal_lpc_chip_id = -1;
static u8 opal_lpc_inb(unsigned long port)
{
int64_t rc;
- uint32_t data;
+ __be32 data;
if (opal_lpc_chip_id < 0 || port > 0xffff)
return 0xff;
rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 1);
- return rc ? 0xff : data;
+ return rc ? 0xff : be32_to_cpu(data);
}
static __le16 __opal_lpc_inw(unsigned long port)
{
int64_t rc;
- uint32_t data;
+ __be32 data;
if (opal_lpc_chip_id < 0 || port > 0xfffe)
return 0xffff;
if (port & 1)
return (__le16)opal_lpc_inb(port) << 8 | opal_lpc_inb(port + 1);
rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 2);
- return rc ? 0xffff : data;
+ return rc ? 0xffff : be32_to_cpu(data);
}
static u16 opal_lpc_inw(unsigned long port)
{
@@ -52,7 +52,7 @@ static u16 opal_lpc_inw(unsigned long port)
static __le32 __opal_lpc_inl(unsigned long port)
{
int64_t rc;
- uint32_t data;
+ __be32 data;
if (opal_lpc_chip_id < 0 || port > 0xfffc)
return 0xffffffff;
@@ -62,7 +62,7 @@ static __le32 __opal_lpc_inl(unsigned long port)
(__le32)opal_lpc_inb(port + 2) << 8 |
opal_lpc_inb(port + 3);
rc = opal_lpc_read(opal_lpc_chip_id, OPAL_LPC_IO, port, &data, 4);
- return rc ? 0xffffffff : data;
+ return rc ? 0xffffffff : be32_to_cpu(data);
}
static u32 opal_lpc_inl(unsigned long port)
^ permalink raw reply related
* [PATCH] powerpc/powernv: Fix endian issue in opal_xscom_read
From: Anton Blanchard @ 2013-12-13 4:53 UTC (permalink / raw)
To: benh, paulus; +Cc: linuxppc-dev
opal_xscom_read uses a pointer to return the data so we need
to byteswap it on LE builds.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index aded1b8..9873a26 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -811,7 +811,7 @@ int64_t opal_pci_next_error(uint64_t phb_id, uint64_t *first_frozen_pe,
int64_t opal_pci_poll(uint64_t phb_id);
int64_t opal_return_cpu(void);
-int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, uint64_t *val);
+int64_t opal_xscom_read(uint32_t gcid, uint32_t pcb_addr, __be64 *val);
int64_t opal_xscom_write(uint32_t gcid, uint32_t pcb_addr, uint64_t val);
int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type,
diff --git a/arch/powerpc/platforms/powernv/opal-xscom.c b/arch/powerpc/platforms/powernv/opal-xscom.c
index 4d99a8f..4fbf276 100644
--- a/arch/powerpc/platforms/powernv/opal-xscom.c
+++ b/arch/powerpc/platforms/powernv/opal-xscom.c
@@ -96,9 +96,11 @@ static int opal_scom_read(scom_map_t map, u64 reg, u64 *value)
{
struct opal_scom_map *m = map;
int64_t rc;
+ __be64 v;
reg = opal_scom_unmangle(reg);
- rc = opal_xscom_read(m->chip, m->addr + reg, (uint64_t *)__pa(value));
+ rc = opal_xscom_read(m->chip, m->addr + reg, (__be64 *)__pa(&v));
+ *value = be64_to_cpu(v);
return opal_xscom_err_xlate(rc);
}
^ permalink raw reply related
* Re: [PATCH 1/2] power7, perf: Make some new raw event codes available in sysfs
From: Anshuman Khandual @ 2013-12-13 4:30 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, mikey, sukadev
In-Reply-To: <1386903031.3853.2.camel@concordia>
On 12/13/2013 08:20 AM, Michael Ellerman wrote:
> On Wed, 2013-10-16 at 11:22 +0530, Anshuman Khandual wrote:
>> This patch adds some more raw event codes into the existing list
>> of event codes present in power7-events-list.h file. This tries
>> to complete the list of events supported in Power7 and matches
>> the raw event list with libpfm4 library.
>
> It's a bit annoying, but you also need to update the "ABI" document:
What is annoying ? you need to be specific.
>
> Documentation/ABI/testing/sysfs-bus-event_source-devices-events
>
The events listed under the following heading are events required to do
CPI analysis.
"Description: POWER-systems specific performance monitoring event"
/sys/devices/cpu/events/PM_1PLUS_PPC_CMPL
/sys/devices/cpu/events/PM_BRU_FIN
/sys/devices/cpu/events/PM_BR_MPRED
/sys/devices/cpu/events/PM_CMPLU_STALL
/sys/devices/cpu/events/PM_CMPLU_STALL_BRU
/sys/devices/cpu/events/PM_CMPLU_STALL_DCACHE_MISS
/sys/devices/cpu/events/PM_CMPLU_STALL_DFU
/sys/devices/cpu/events/PM_CMPLU_STALL_DIV
/sys/devices/cpu/events/PM_CMPLU_STALL_ERAT_MISS
/sys/devices/cpu/events/PM_CMPLU_STALL_FXU
/sys/devices/cpu/events/PM_CMPLU_STALL_IFU
/sys/devices/cpu/events/PM_CMPLU_STALL_LSU
/sys/devices/cpu/events/PM_CMPLU_STALL_REJECT
/sys/devices/cpu/events/PM_CMPLU_STALL_SCALAR
/sys/devices/cpu/events/PM_CMPLU_STALL_SCALAR_LONG
/sys/devices/cpu/events/PM_CMPLU_STALL_STORE
/sys/devices/cpu/events/PM_CMPLU_STALL_THRD
/sys/devices/cpu/events/PM_CMPLU_STALL_VECTOR
/sys/devices/cpu/events/PM_CMPLU_STALL_VECTOR_LONG
/sys/devices/cpu/events/PM_CYC
/sys/devices/cpu/events/PM_GCT_NOSLOT_BR_MPRED
/sys/devices/cpu/events/PM_GCT_NOSLOT_BR_MPRED_IC_MISS
/sys/devices/cpu/events/PM_GCT_NOSLOT_CYC
/sys/devices/cpu/events/PM_GCT_NOSLOT_IC_MISS
/sys/devices/cpu/events/PM_GRP_CMPL
/sys/devices/cpu/events/PM_INST_CMPL
/sys/devices/cpu/events/PM_LD_MISS_L1
/sys/devices/cpu/events/PM_LD_REF_L1
/sys/devices/cpu/events/PM_RUN_CYC
/sys/devices/cpu/events/PM_RUN_INST_CMPL
But I am not sure the events the current patch in context adds
+EVENT(PM_1THRD_CON_RUN_INSTR, 0x30062)
+EVENT(PM_CMPLU_STALL_COUNT, 0x4000B)
+EVENT(PM_MEM0_PB_RD_CL, 0x30083)
+EVENT(PM_THRD_1_RUN_CYC, 0x10060)
+EVENT(PM_THRD_2_CONC_RUN_INSTR, 0x40062)
+EVENT(PM_THRD_2_RUN_CYC, 0x20060)
+EVENT(PM_THRD_3_CONC_RUN_INST, 0x10062)
+EVENT(PM_THRD_3_RUN_CYC, 0x30060)
+EVENT(PM_THRD_4_CONC_RUN_INST, 0x20062)
+EVENT(PM_THRD_4_RUN_CYC, 0x40060)
will be helpful in CPI stack analysis and should be part of the ABI
documentation file. If it does, I will be glad to add them.
^ permalink raw reply
* [RFC PATCH] time: Support in tick broadcast framework for archs without an external wakeup source
From: Preeti U Murthy @ 2013-12-13 4:19 UTC (permalink / raw)
To: peterz, fweisbec, paul.gortmaker, paulus, mingo, shangw,
rafael.j.wysocki, galak, benh, paulmck, arnd, linux-pm, rostedt,
michael, john.stultz, tglx, chenhui.zhao, deepthi, r58472, geoff,
linux-kernel, srivatsa.bhat, schwidefsky, svaidy, linuxppc-dev
On some architectures, in certain CPU deep idle states the local timers stop.
An external clock device is used to wakeup these CPUs. The kernel support for the
wakeup of these CPUs is provided by the tick broadcast framework by using the
external clock device as the wakeup source.
However on architectures like PowerPC there is no external clock device. This
patch includes support in the broadcast framework to handle the wakeup of the
CPUs in deep idle states on such architectures by queuing a hrtimer on one of
the CPUs, meant to handle the wakeup of CPUs in deep idle states. This CPU is
identified as the bc_cpu.
Each time the hrtimer expires, it is reprogrammed for the next wakeup of the
CPUs in deep idle state after handling broadcast. However when a CPU is about
to enter deep idle state with its wakeup time earlier than the time at which
the hrtimer is currently programmed, it *becomes the new bc_cpu* and restarts
the hrtimer on itself. This way the job of doing broadcast is handed around to
the CPUs that ask for the earliest wakeup just before entering deep idle
state. This is consistent with what happens in cases where an external clock
device is present. The smp affinity of this clock device is set to the CPU
with the earliest wakeup.
The important point here is that the bc_cpu cannot enter deep idle state
since it has a hrtimer queued to wakeup the other CPUs in deep idle. Hence it
cannot have its local timer stopped. Therefore for such a CPU, the
BROADCAST_ENTER notification has to fail implying that it cannot enter deep
idle state. On architectures where an external clock device is present, all
CPUs can enter deep idle.
During hotplug of the bc_cpu, the job of doing a broadcast is assigned to the
first cpu in the broadcast mask. This newly nominated bc_cpu is woken up by
an IPI so as to queue the above mentioned hrtimer on itself.
This patch is compile tested only.
Signed-off-by: Preeti U Murthy <preeti@linux.vnet.ibm.com>
---
include/linux/clockchips.h | 4 +
kernel/time/clockevents.c | 8 +-
kernel/time/tick-broadcast.c | 157 ++++++++++++++++++++++++++++++++++++++----
kernel/time/tick-internal.h | 8 +-
4 files changed, 153 insertions(+), 24 deletions(-)
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 493aa02..bbda37b 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -186,9 +186,9 @@ static inline int tick_check_broadcast_expired(void) { return 0; }
#endif
#ifdef CONFIG_GENERIC_CLOCKEVENTS
-extern void clockevents_notify(unsigned long reason, void *arg);
+extern int clockevents_notify(unsigned long reason, void *arg);
#else
-static inline void clockevents_notify(unsigned long reason, void *arg) {}
+static inline int clockevents_notify(unsigned long reason, void *arg) {}
#endif
#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 086ad60..bbbd671 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -525,11 +525,11 @@ void clockevents_resume(void)
/**
* clockevents_notify - notification about relevant events
*/
-void clockevents_notify(unsigned long reason, void *arg)
+int clockevents_notify(unsigned long reason, void *arg)
{
struct clock_event_device *dev, *tmp;
unsigned long flags;
- int cpu;
+ int cpu, ret = 0;
raw_spin_lock_irqsave(&clockevents_lock, flags);
@@ -542,11 +542,12 @@ void clockevents_notify(unsigned long reason, void *arg)
case CLOCK_EVT_NOTIFY_BROADCAST_ENTER:
case CLOCK_EVT_NOTIFY_BROADCAST_EXIT:
- tick_broadcast_oneshot_control(reason);
+ ret = tick_broadcast_oneshot_control(reason);
break;
case CLOCK_EVT_NOTIFY_CPU_DYING:
tick_handover_do_timer(arg);
+ tick_handover_bc_cpu(arg);
break;
case CLOCK_EVT_NOTIFY_SUSPEND:
@@ -585,6 +586,7 @@ void clockevents_notify(unsigned long reason, void *arg)
break;
}
raw_spin_unlock_irqrestore(&clockevents_lock, flags);
+ return ret;
}
EXPORT_SYMBOL_GPL(clockevents_notify);
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
index 9532690..f90b865 100644
--- a/kernel/time/tick-broadcast.c
+++ b/kernel/time/tick-broadcast.c
@@ -20,6 +20,7 @@
#include <linux/sched.h>
#include <linux/smp.h>
#include <linux/module.h>
+#include <linux/slab.h>
#include "tick-internal.h"
@@ -35,6 +36,10 @@ static cpumask_var_t tmpmask;
static DEFINE_RAW_SPINLOCK(tick_broadcast_lock);
static int tick_broadcast_force;
+static struct hrtimer *bc_hrtimer;
+static int bc_cpu = -1;
+static ktime_t bc_next_wakeup;
+
#ifdef CONFIG_TICK_ONESHOT
static void tick_broadcast_clear_oneshot(int cpu);
#else
@@ -528,6 +533,20 @@ static int tick_broadcast_set_event(struct clock_event_device *bc, int cpu,
return ret;
}
+static void tick_broadcast_set_next_wakeup(int cpu, ktime_t expires, int force)
+{
+ struct clock_event_device *bc;
+
+ bc = tick_broadcast_device.evtdev;
+
+ if (bc) {
+ tick_broadcast_set_event(bc, cpu, expires, force);
+ } else {
+ hrtimer_start(bc_hrtimer, expires, HRTIMER_MODE_ABS_PINNED);
+ bc_cpu = cpu;
+ }
+}
+
int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
{
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
@@ -558,15 +577,13 @@ void tick_check_oneshot_broadcast(int cpu)
/*
* Handle oneshot mode broadcasting
*/
-static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)
+static int tick_oneshot_broadcast(void)
{
struct tick_device *td;
ktime_t now, next_event;
int cpu, next_cpu = 0;
- raw_spin_lock(&tick_broadcast_lock);
-again:
- dev->next_event.tv64 = KTIME_MAX;
+ bc_next_wakeup.tv64 = KTIME_MAX;
next_event.tv64 = KTIME_MAX;
cpumask_clear(tmpmask);
now = ktime_get();
@@ -620,27 +637,83 @@ again:
* in the event mask
*/
if (next_event.tv64 != KTIME_MAX) {
- /*
- * Rearm the broadcast device. If event expired,
- * repeat the above
- */
- if (tick_broadcast_set_event(dev, next_cpu, next_event, 0))
+ bc_next_wakeup = next_event;
+ }
+
+ return next_cpu;
+}
+
+/*
+ * Handler in oneshot mode for the external clock device
+ */
+static void tick_handle_oneshot_broadcast(struct clock_event_device *dev)
+{
+ int next_cpu;
+
+ raw_spin_lock(&tick_broadcast_lock);
+
+again: next_cpu = tick_oneshot_broadcast();
+ /*
+ * Rearm the broadcast device. If event expired,
+ * repeat the above
+ */
+ if (bc_next_wakeup.tv64 != KTIME_MAX)
+ if (tick_broadcast_set_event(dev, next_cpu, bc_next_wakeup, 0))
goto again;
+
+ raw_spin_unlock(&tick_broadcast_lock);
+}
+
+/*
+ * Handler in oneshot mode for the hrtimer queued when there is no external
+ * clock device.
+ */
+static enum hrtimer_restart handle_broadcast(struct hrtimer *hrtmr)
+{
+ ktime_t now, interval;
+ int next_cpu;
+
+ raw_spin_lock(&tick_broadcast_lock);
+ tick_oneshot_broadcast();
+
+ now = ktime_get();
+
+ if (bc_next_wakeup.tv64 != KTIME_MAX) {
+ interval = ktime_sub(bc_next_wakeup, now);
+ hrtimer_forward_now(bc_hrtimer, interval);
+ raw_spin_unlock(&tick_broadcast_lock);
+ return HRTIMER_RESTART;
}
raw_spin_unlock(&tick_broadcast_lock);
+ return HRTIMER_NORESTART;
+}
+
+/* The CPU could be asked to take over from the previous bc_cpu,
+ * if it is being hotplugged out.
+ */
+static void tick_broadcast_exit_check(int cpu)
+{
+ if (cpu == bc_cpu)
+ hrtimer_start(bc_hrtimer, bc_next_wakeup,
+ HRTIMER_MODE_ABS_PINNED);
+}
+
+static int can_enter_broadcast(int cpu)
+{
+ return cpu != bc_cpu;
}
/*
* Powerstate information: The system enters/leaves a state, where
* affected devices might stop
*/
-void tick_broadcast_oneshot_control(unsigned long reason)
+int tick_broadcast_oneshot_control(unsigned long reason)
{
- struct clock_event_device *bc, *dev;
+ struct clock_event_device *dev;
struct tick_device *td;
unsigned long flags;
ktime_t now;
- int cpu;
+ int cpu, ret = 0;
/*
* Periodic mode does not care about the enter/exit of power
@@ -660,7 +733,6 @@ void tick_broadcast_oneshot_control(unsigned long reason)
if (!(dev->features & CLOCK_EVT_FEAT_C3STOP))
return;
- bc = tick_broadcast_device.evtdev;
raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
if (reason == CLOCK_EVT_NOTIFY_BROADCAST_ENTER) {
@@ -676,12 +748,21 @@ void tick_broadcast_oneshot_control(unsigned long reason)
* woken by the IPI right away.
*/
if (!cpumask_test_cpu(cpu, tick_broadcast_force_mask) &&
- dev->next_event.tv64 < bc->next_event.tv64)
- tick_broadcast_set_event(bc, cpu, dev->next_event, 1);
+ dev->next_event.tv64 < bc_next_wakeup.tv64)
+ bc_next_wakeup = dev->next_event;
+ tick_broadcast_set_next_wakeup(cpu, dev->next_event, 1);
+
+ if (!can_enter_broadcast(cpu)) {
+ cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask);
+ clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
+ ret = 1;
+ }
}
} else {
if (cpumask_test_and_clear_cpu(cpu, tick_broadcast_oneshot_mask)) {
clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT);
+
+ tick_broadcast_exit_check(cpu);
/*
* The cpu which was handling the broadcast
* timer marked this cpu in the broadcast
@@ -746,6 +827,7 @@ void tick_broadcast_oneshot_control(unsigned long reason)
}
out:
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
+ return ret;
}
/*
@@ -824,15 +906,58 @@ void tick_broadcast_switch_to_oneshot(void)
raw_spin_lock_irqsave(&tick_broadcast_lock, flags);
+ bc_next_wakeup.tv64 = KTIME_MAX;
+
tick_broadcast_device.mode = TICKDEV_MODE_ONESHOT;
bc = tick_broadcast_device.evtdev;
- if (bc)
+ if (bc) {
tick_broadcast_setup_oneshot(bc);
+ bc_next_wakeup = bc->next_event;
+ } else {
+ /* An alternative to tick_broadcast_device on archs which do not have
+ * an external device
+ */
+ bc_hrtimer = kmalloc(sizeof(*bc_hrtimer), GFP_NOWAIT);
+ hrtimer_init(bc_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED);
+ bc_hrtimer->function = handle_broadcast;
+
+ /*
+ * There may be CPUs waiting for periodic broadcast. We need
+ * to set the oneshot bits for those and program the hrtimer
+ * to fire at the next tick period.
+ */
+ cpumask_copy(tmpmask, tick_broadcast_mask);
+ cpumask_clear_cpu(cpu, tmpmask);
+ cpumask_or(tick_broadcast_oneshot_mask,
+ tick_broadcast_oneshot_mask, tmpmask);
+
+ if (!cpumask_empty(tmpmask)) {
+ tick_broadcast_init_next_event(tmpmask,
+ tick_next_period);
+ hrtimer_start(bc_hrtimer, tick_next_period, HRTIMER_MODE_ABS_PINNED);
+ bc_next_wakeup = tick_next_period;
+ }
+ }
raw_spin_unlock_irqrestore(&tick_broadcast_lock, flags);
}
+void tick_handover_bc_cpu(int *cpup)
+{
+ struct tick_device *td;
+
+ if (*cpup == bc_cpu) {
+ int cpu = cpumask_first(tick_broadcast_oneshot_mask);
+
+ bc_cpu = (cpu < nr_cpu_ids) ? cpu : -1;
+ if (bc_cpu != -1) {
+ td = &per_cpu(tick_cpu_device, bc_cpu);
+ td->evtdev->broadcast(cpumask_of(bc_cpu));
+ }
+ }
+}
+
/*
* Remove a dead CPU from broadcasting
*/
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h
index 18e71f7..1f73032 100644
--- a/kernel/time/tick-internal.h
+++ b/kernel/time/tick-internal.h
@@ -46,23 +46,25 @@ extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *));
extern void tick_resume_oneshot(void);
# ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc);
-extern void tick_broadcast_oneshot_control(unsigned long reason);
+extern int tick_broadcast_oneshot_control(unsigned long reason);
extern void tick_broadcast_switch_to_oneshot(void);
extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup);
extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc);
extern int tick_broadcast_oneshot_active(void);
extern void tick_check_oneshot_broadcast(int cpu);
+extern void tick_handover_bc_cpu(int *cpup);
bool tick_broadcast_oneshot_available(void);
# else /* BROADCAST */
static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
{
BUG();
}
-static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
+static inline int tick_broadcast_oneshot_control(unsigned long reason) { }
static inline void tick_broadcast_switch_to_oneshot(void) { }
static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
static inline int tick_broadcast_oneshot_active(void) { return 0; }
static inline void tick_check_oneshot_broadcast(int cpu) { }
+static inline void tick_handover_bc_cpu(int *cpup) {}
static inline bool tick_broadcast_oneshot_available(void) { return true; }
# endif /* !BROADCAST */
@@ -87,7 +89,7 @@ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
{
BUG();
}
-static inline void tick_broadcast_oneshot_control(unsigned long reason) { }
+static inline int tick_broadcast_oneshot_control(unsigned long reason) { }
static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { }
static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc)
{
^ permalink raw reply related
* RE: [PATCH v7] clk: corenet: Adds the clock binding
From: Yuantian Tang @ 2013-12-13 3:39 UTC (permalink / raw)
To: Scott Wood; +Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1384938289-24713-1-git-send-email-Yuantian.Tang@freescale.com>
UElORy4NCg0KVGhhbmtzLA0KWXVhbnRpYW4NCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0t
LQ0KPiBGcm9tOiBUYW5nIFl1YW50aWFuLUIyOTk4Mw0KPiBTZW50OiAyMDEzxOoxMdTCMjDI1SDQ
x8bayP0gMTc6MDUNCj4gVG86IGdhbGFrQGtlcm5lbC5jcmFzaGluZy5vcmcNCj4gQ2M6IGRldmlj
ZXRyZWVAdmdlci5rZXJuZWwub3JnOyBsaW51eHBwYy1kZXZAbGlzdHMub3psYWJzLm9yZzsNCj4g
bWFyay5ydXRsYW5kQGFybS5jb207IFdvb2QgU2NvdHQtQjA3NDIxOyBncmFudC5saW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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