* Re: [PATCH 10/14] PM / MIPS: Use struct syscore_ops instead of sysdevs for PM
From: Lars-Peter Clausen @ 2011-04-19 3:08 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Kevin Hilman, Guan Xuetao, Russell King, Konrad Rzeszutek Wilk,
Greg KH, LKML, Ralf Baechle, Jeremy Fitzhardinge, Ben Dooks,
Jiri Kosina, Kay Sievers, Mike Frysinger, Linux PM mailing list,
linux-omap, linuxppc-dev, Hans-Christian Egtvedt,
linux-arm-kernel
In-Reply-To: <201104172312.35060.rjw@sisk.pl>
On 04/17/2011 11:12 PM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> Convert some MIPS architecture's code to using struct syscore_ops
> objects for power management instead of sysdev classes and sysdevs.
>
> This simplifies the code and reduces the kernel's memory footprint.
> It also is necessary for removing sysdevs from the kernel entirely in
> the future.
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
For the jz4740 part:
Acked-and-tested-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> arch/mips/alchemy/common/dbdma.c | 92 +++++++++++----------------------------
> arch/mips/alchemy/common/irq.c | 62 +++++++++-----------------
> arch/mips/jz4740/gpio.c | 52 +++++++++-------------
> arch/mips/kernel/i8259.c | 26 +++--------
> 4 files changed, 80 insertions(+), 152 deletions(-)
>
> Index: linux-2.6/arch/mips/alchemy/common/irq.c
> ===================================================================
> --- linux-2.6.orig/arch/mips/alchemy/common/irq.c
> +++ linux-2.6/arch/mips/alchemy/common/irq.c
> @@ -30,7 +30,7 @@
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> #include <linux/slab.h>
> -#include <linux/sysdev.h>
> +#include <linux/syscore_ops.h>
>
> #include <asm/irq_cpu.h>
> #include <asm/mipsregs.h>
> @@ -556,17 +556,15 @@ void __init arch_init_irq(void)
> }
> }
>
> -struct alchemy_ic_sysdev {
> - struct sys_device sysdev;
> +struct alchemy_ic {
> void __iomem *base;
> unsigned long pmdata[7];
> };
>
> -static int alchemy_ic_suspend(struct sys_device *dev, pm_message_t state)
> -{
> - struct alchemy_ic_sysdev *icdev =
> - container_of(dev, struct alchemy_ic_sysdev, sysdev);
> +static struct alchemy_ic alchemy_ic_data[2];
>
> +static void alchemy_suspend_one_ic(struct alchemy_ic *icdev)
> +{
> icdev->pmdata[0] = __raw_readl(icdev->base + IC_CFG0RD);
> icdev->pmdata[1] = __raw_readl(icdev->base + IC_CFG1RD);
> icdev->pmdata[2] = __raw_readl(icdev->base + IC_CFG2RD);
> @@ -574,15 +572,17 @@ static int alchemy_ic_suspend(struct sys
> icdev->pmdata[4] = __raw_readl(icdev->base + IC_ASSIGNRD);
> icdev->pmdata[5] = __raw_readl(icdev->base + IC_WAKERD);
> icdev->pmdata[6] = __raw_readl(icdev->base + IC_MASKRD);
> +}
>
> +static int alchemy_ic_suspend(void)
> +{
> + alchemy_suspend_one_ic(alchemy_ic_data);
> + alchemy_suspend_one_ic(alchemy_ic_data + 1);
> return 0;
> }
>
> -static int alchemy_ic_resume(struct sys_device *dev)
> +static void alchemy_resume_one_ic(struct alchemy_ic *icdev)
> {
> - struct alchemy_ic_sysdev *icdev =
> - container_of(dev, struct alchemy_ic_sysdev, sysdev);
> -
> __raw_writel(0xffffffff, icdev->base + IC_MASKCLR);
> __raw_writel(0xffffffff, icdev->base + IC_CFG0CLR);
> __raw_writel(0xffffffff, icdev->base + IC_CFG1CLR);
> @@ -604,42 +604,26 @@ static int alchemy_ic_resume(struct sys_
>
> __raw_writel(icdev->pmdata[6], icdev->base + IC_MASKSET);
> wmb();
> +}
>
> - return 0;
> +static void alchemy_ic_resume(void)
> +{
> + alchemy_resume_one_ic(alchemy_ic_data + 1);
> + alchemy_resume_one_ic(alchemy_ic_data);
> }
>
> -static struct sysdev_class alchemy_ic_sysdev_class = {
> - .name = "ic",
> +static struct syscore_ops alchemy_ic_syscore_ops = {
> .suspend = alchemy_ic_suspend,
> .resume = alchemy_ic_resume,
> };
>
> -static int __init alchemy_ic_sysdev_init(void)
> +static int __init alchemy_ic_syscore_init(void)
> {
> - struct alchemy_ic_sysdev *icdev;
> - unsigned long icbase[2] = { IC0_PHYS_ADDR, IC1_PHYS_ADDR };
> - int err, i;
> -
> - err = sysdev_class_register(&alchemy_ic_sysdev_class);
> - if (err)
> - return err;
> -
> - for (i = 0; i < 2; i++) {
> - icdev = kzalloc(sizeof(struct alchemy_ic_sysdev), GFP_KERNEL);
> - if (!icdev)
> - return -ENOMEM;
> -
> - icdev->base = ioremap(icbase[i], 0x1000);
> -
> - icdev->sysdev.id = i;
> - icdev->sysdev.cls = &alchemy_ic_sysdev_class;
> - err = sysdev_register(&icdev->sysdev);
> - if (err) {
> - kfree(icdev);
> - return err;
> - }
> - }
> + alchemy_ic_data[0].base = ioremap(icbase[IC0_PHYS_ADDR], 0x1000);
> + alchemy_ic_data[1].base = ioremap(icbase[IC1_PHYS_ADDR], 0x1000);
> +
> + register_syscore_ops(&alchemy_ic_syscore_ops);
>
> return 0;
> }
> -device_initcall(alchemy_ic_sysdev_init);
> +device_initcall(alchemy_ic_syscore_init);
> Index: linux-2.6/arch/mips/alchemy/common/dbdma.c
> ===================================================================
> --- linux-2.6.orig/arch/mips/alchemy/common/dbdma.c
> +++ linux-2.6/arch/mips/alchemy/common/dbdma.c
> @@ -36,7 +36,7 @@
> #include <linux/spinlock.h>
> #include <linux/interrupt.h>
> #include <linux/module.h>
> -#include <linux/sysdev.h>
> +#include <linux/syscore_ops.h>
> #include <asm/mach-au1x00/au1000.h>
> #include <asm/mach-au1x00/au1xxx_dbdma.h>
>
> @@ -957,37 +957,30 @@ u32 au1xxx_dbdma_put_dscr(u32 chanid, au
> return nbytes;
> }
>
> +static u32 alchemy_dbdma_pm_regs[NUM_DBDMA_CHANS + 1][6];
>
> -struct alchemy_dbdma_sysdev {
> - struct sys_device sysdev;
> - u32 pm_regs[NUM_DBDMA_CHANS + 1][6];
> -};
> -
> -static int alchemy_dbdma_suspend(struct sys_device *dev,
> - pm_message_t state)
> +static int alchemy_dbdma_suspend(void)
> {
> - struct alchemy_dbdma_sysdev *sdev =
> - container_of(dev, struct alchemy_dbdma_sysdev, sysdev);
> int i;
> u32 addr;
>
> addr = DDMA_GLOBAL_BASE;
> - sdev->pm_regs[0][0] = au_readl(addr + 0x00);
> - sdev->pm_regs[0][1] = au_readl(addr + 0x04);
> - sdev->pm_regs[0][2] = au_readl(addr + 0x08);
> - sdev->pm_regs[0][3] = au_readl(addr + 0x0c);
> + alchemy_dbdma_pm_regs[0][0] = au_readl(addr + 0x00);
> + alchemy_dbdma_pm_regs[0][1] = au_readl(addr + 0x04);
> + alchemy_dbdma_pm_regs[0][2] = au_readl(addr + 0x08);
> + alchemy_dbdma_pm_regs[0][3] = au_readl(addr + 0x0c);
>
> /* save channel configurations */
> for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++) {
> - sdev->pm_regs[i][0] = au_readl(addr + 0x00);
> - sdev->pm_regs[i][1] = au_readl(addr + 0x04);
> - sdev->pm_regs[i][2] = au_readl(addr + 0x08);
> - sdev->pm_regs[i][3] = au_readl(addr + 0x0c);
> - sdev->pm_regs[i][4] = au_readl(addr + 0x10);
> - sdev->pm_regs[i][5] = au_readl(addr + 0x14);
> + alchemy_dbdma_pm_regs[i][0] = au_readl(addr + 0x00);
> + alchemy_dbdma_pm_regs[i][1] = au_readl(addr + 0x04);
> + alchemy_dbdma_pm_regs[i][2] = au_readl(addr + 0x08);
> + alchemy_dbdma_pm_regs[i][3] = au_readl(addr + 0x0c);
> + alchemy_dbdma_pm_regs[i][4] = au_readl(addr + 0x10);
> + alchemy_dbdma_pm_regs[i][5] = au_readl(addr + 0x14);
>
> /* halt channel */
> - au_writel(sdev->pm_regs[i][0] & ~1, addr + 0x00);
> + au_writel(alchemy_dbdma_pm_regs[i][0] & ~1, addr + 0x00);
> au_sync();
> while (!(au_readl(addr + 0x14) & 1))
> au_sync();
> @@ -1001,62 +994,35 @@ static int alchemy_dbdma_suspend(struct
> return 0;
> }
>
> -static int alchemy_dbdma_resume(struct sys_device *dev)
> +static void alchemy_dbdma_resume(void)
> {
> - struct alchemy_dbdma_sysdev *sdev =
> - container_of(dev, struct alchemy_dbdma_sysdev, sysdev);
> int i;
> u32 addr;
>
> addr = DDMA_GLOBAL_BASE;
> - au_writel(sdev->pm_regs[0][0], addr + 0x00);
> - au_writel(sdev->pm_regs[0][1], addr + 0x04);
> - au_writel(sdev->pm_regs[0][2], addr + 0x08);
> - au_writel(sdev->pm_regs[0][3], addr + 0x0c);
> + au_writel(alchemy_dbdma_pm_regs[0][0], addr + 0x00);
> + au_writel(alchemy_dbdma_pm_regs[0][1], addr + 0x04);
> + au_writel(alchemy_dbdma_pm_regs[0][2], addr + 0x08);
> + au_writel(alchemy_dbdma_pm_regs[0][3], addr + 0x0c);
>
> /* restore channel configurations */
> for (i = 1, addr = DDMA_CHANNEL_BASE; i <= NUM_DBDMA_CHANS; i++) {
> - au_writel(sdev->pm_regs[i][0], addr + 0x00);
> - au_writel(sdev->pm_regs[i][1], addr + 0x04);
> - au_writel(sdev->pm_regs[i][2], addr + 0x08);
> - au_writel(sdev->pm_regs[i][3], addr + 0x0c);
> - au_writel(sdev->pm_regs[i][4], addr + 0x10);
> - au_writel(sdev->pm_regs[i][5], addr + 0x14);
> + au_writel(alchemy_dbdma_pm_regs[i][0], addr + 0x00);
> + au_writel(alchemy_dbdma_pm_regs[i][1], addr + 0x04);
> + au_writel(alchemy_dbdma_pm_regs[i][2], addr + 0x08);
> + au_writel(alchemy_dbdma_pm_regs[i][3], addr + 0x0c);
> + au_writel(alchemy_dbdma_pm_regs[i][4], addr + 0x10);
> + au_writel(alchemy_dbdma_pm_regs[i][5], addr + 0x14);
> au_sync();
> addr += 0x100; /* next channel base */
> }
> -
> - return 0;
> }
>
> -static struct sysdev_class alchemy_dbdma_sysdev_class = {
> - .name = "dbdma",
> +static struct syscore_ops alchemy_dbdma_syscore_ops = {
> .suspend = alchemy_dbdma_suspend,
> .resume = alchemy_dbdma_resume,
> };
>
> -static int __init alchemy_dbdma_sysdev_init(void)
> -{
> - struct alchemy_dbdma_sysdev *sdev;
> - int ret;
> -
> - ret = sysdev_class_register(&alchemy_dbdma_sysdev_class);
> - if (ret)
> - return ret;
> -
> - sdev = kzalloc(sizeof(struct alchemy_dbdma_sysdev), GFP_KERNEL);
> - if (!sdev)
> - return -ENOMEM;
> -
> - sdev->sysdev.id = -1;
> - sdev->sysdev.cls = &alchemy_dbdma_sysdev_class;
> - ret = sysdev_register(&sdev->sysdev);
> - if (ret)
> - kfree(sdev);
> -
> - return ret;
> -}
> -
> static int __init au1xxx_dbdma_init(void)
> {
> int irq_nr, ret;
> @@ -1084,11 +1050,7 @@ static int __init au1xxx_dbdma_init(void
> else {
> dbdma_initialized = 1;
> printk(KERN_INFO "Alchemy DBDMA initialized\n");
> - ret = alchemy_dbdma_sysdev_init();
> - if (ret) {
> - printk(KERN_ERR "DBDMA PM init failed\n");
> - ret = 0;
> - }
> + register_syscore_ops(&alchemy_dbdma_syscore_ops);
> }
>
> return ret;
> Index: linux-2.6/arch/mips/jz4740/gpio.c
> ===================================================================
> --- linux-2.6.orig/arch/mips/jz4740/gpio.c
> +++ linux-2.6/arch/mips/jz4740/gpio.c
> @@ -18,7 +18,7 @@
> #include <linux/init.h>
>
> #include <linux/spinlock.h>
> -#include <linux/sysdev.h>
> +#include <linux/syscore_ops.h>
> #include <linux/io.h>
> #include <linux/gpio.h>
> #include <linux/delay.h>
> @@ -86,7 +86,6 @@ struct jz_gpio_chip {
> spinlock_t lock;
>
> struct gpio_chip gpio_chip;
> - struct sys_device sysdev;
> };
>
> static struct jz_gpio_chip jz4740_gpio_chips[];
> @@ -459,49 +458,47 @@ static struct jz_gpio_chip jz4740_gpio_c
> JZ4740_GPIO_CHIP(D),
> };
>
> -static inline struct jz_gpio_chip *sysdev_to_chip(struct sys_device *dev)
> +static void jz4740_gpio_suspend_chip(struct jz_gpio_chip *chip)
> {
> - return container_of(dev, struct jz_gpio_chip, sysdev);
> + chip->suspend_mask = readl(chip->base + JZ_REG_GPIO_MASK);
> + writel(~(chip->wakeup), chip->base + JZ_REG_GPIO_MASK_SET);
> + writel(chip->wakeup, chip->base + JZ_REG_GPIO_MASK_CLEAR);
> }
>
> -static int jz4740_gpio_suspend(struct sys_device *dev, pm_message_t state)
> +static int jz4740_gpio_suspend(void)
> {
> - struct jz_gpio_chip *chip = sysdev_to_chip(dev);
> + int i;
>
> - chip->suspend_mask = readl(chip->base + JZ_REG_GPIO_MASK);
> - writel(~(chip->wakeup), chip->base + JZ_REG_GPIO_MASK_SET);
> - writel(chip->wakeup, chip->base + JZ_REG_GPIO_MASK_CLEAR);
> + for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); i++)
> + jz4740_gpio_suspend_chip(&jz4740_gpio_chips[i]);
>
> return 0;
> }
>
> -static int jz4740_gpio_resume(struct sys_device *dev)
> +static void jz4740_gpio_resume_chip(struct jz_gpio_chip *chip)
> {
> - struct jz_gpio_chip *chip = sysdev_to_chip(dev);
> uint32_t mask = chip->suspend_mask;
>
> writel(~mask, chip->base + JZ_REG_GPIO_MASK_CLEAR);
> writel(mask, chip->base + JZ_REG_GPIO_MASK_SET);
> +}
>
> - return 0;
> +static void jz4740_gpio_resume(void)
> +{
> + int i;
> +
> + for (i = ARRAY_SIZE(jz4740_gpio_chips) - 1; i >= 0 ; i--)
> + jz4740_gpio_resume_chip(&jz4740_gpio_chips[i]);
> }
>
> -static struct sysdev_class jz4740_gpio_sysdev_class = {
> - .name = "gpio",
> +static struct syscore_ops jz4740_gpio_syscore_ops = {
> .suspend = jz4740_gpio_suspend,
> .resume = jz4740_gpio_resume,
> };
>
> -static int jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id)
> +static void jz4740_gpio_chip_init(struct jz_gpio_chip *chip, unsigned int id)
> {
> - int ret, irq;
> -
> - chip->sysdev.id = id;
> - chip->sysdev.cls = &jz4740_gpio_sysdev_class;
> - ret = sysdev_register(&chip->sysdev);
> -
> - if (ret)
> - return ret;
> + int irq;
>
> spin_lock_init(&chip->lock);
>
> @@ -519,22 +516,17 @@ static int jz4740_gpio_chip_init(struct
> irq_set_chip_and_handler(irq, &jz_gpio_irq_chip,
> handle_level_irq);
> }
> -
> - return 0;
> }
>
> static int __init jz4740_gpio_init(void)
> {
> unsigned int i;
> - int ret;
> -
> - ret = sysdev_class_register(&jz4740_gpio_sysdev_class);
> - if (ret)
> - return ret;
>
> for (i = 0; i < ARRAY_SIZE(jz4740_gpio_chips); ++i)
> jz4740_gpio_chip_init(&jz4740_gpio_chips[i], i);
>
> + register_syscore_ops(&jz4740_gpio_syscore_ops);
> +
> printk(KERN_INFO "JZ4740 GPIO initialized\n");
>
> return 0;
> Index: linux-2.6/arch/mips/kernel/i8259.c
> ===================================================================
> --- linux-2.6.orig/arch/mips/kernel/i8259.c
> +++ linux-2.6/arch/mips/kernel/i8259.c
> @@ -14,7 +14,7 @@
> #include <linux/interrupt.h>
> #include <linux/kernel.h>
> #include <linux/spinlock.h>
> -#include <linux/sysdev.h>
> +#include <linux/syscore_ops.h>
> #include <linux/irq.h>
>
> #include <asm/i8259.h>
> @@ -215,14 +215,13 @@ spurious_8259A_irq:
> }
> }
>
> -static int i8259A_resume(struct sys_device *dev)
> +static void i8259A_resume(void)
> {
> if (i8259A_auto_eoi >= 0)
> init_8259A(i8259A_auto_eoi);
> - return 0;
> }
>
> -static int i8259A_shutdown(struct sys_device *dev)
> +static void i8259A_shutdown(void)
> {
> /* Put the i8259A into a quiescent state that
> * the kernel initialization code can get it
> @@ -232,29 +231,20 @@ static int i8259A_shutdown(struct sys_de
> outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
> outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */
> }
> - return 0;
> }
>
> -static struct sysdev_class i8259_sysdev_class = {
> - .name = "i8259",
> +static struct syscore_ops i8259_syscore_ops = {
> .resume = i8259A_resume,
> .shutdown = i8259A_shutdown,
> };
>
> -static struct sys_device device_i8259A = {
> - .id = 0,
> - .cls = &i8259_sysdev_class,
> -};
> -
> -static int __init i8259A_init_sysfs(void)
> +static int __init i8259A_init_syscore(void)
> {
> - int error = sysdev_class_register(&i8259_sysdev_class);
> - if (!error)
> - error = sysdev_register(&device_i8259A);
> - return error;
> + register_syscore_ops(&i8259_syscore_ops);
> + return 0;
> }
>
> -device_initcall(i8259A_init_sysfs);
> +device_initcall(i8259A_init_syscore);
>
> static void init_8259A(int auto_eoi)
> {
>
> --
> 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
* Re: [PATCH 10/15] powerpc: Define slb0_limit() for BOOK3E
From: Benjamin Herrenschmidt @ 2011-04-18 22:50 UTC (permalink / raw)
To: Kumar Gala
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <5313E556-6BFA-48D0-921F-7CF91892514A@freescale.com>
On Mon, 2011-04-18 at 17:30 -0500, Kumar Gala wrote:
> > On Mon, 2011-04-18 at 07:42 -0500, Kumar Gala wrote:
> >> Let's rename this function to something 'linear_map'. As on FSL
> >> Book-E 64 we do things a bit differently and have more covered in
> >> linear map than 1G
> >
> > It's not quite linear_map. It's whatever can be accessed without
> taking
> > exceptions. IE. What is bolted.
> >
> > It should probably go into a variable initialized by the mm code
> tho.
> >
> > Cheers,
> > Ben.
>
> Is this 'ppc64_rma_size' ?
Not quite either :-)
The RMA (on server) is the amount of memory that is accessible in real
mode (with MMU off).
SLB0 is segment 0, which is 256M or 1T depending on what segment size we
use, and is a bolted segment in Linux. Thus all accesses to SLB0 are
guaranteed to not generate an SLB miss fault. Since on server our linear
mapping is bolted in the hash, what that means is that any access to
memory in segment 0 is guaranteed to not take an exception (ie not
clobber SRR0/1 for example).
We re-use the SLB0 concept on BookE to represent the bolted portion of
the linear mapping since it has the same characteristics, ie, accesses
will not cause an exception that can clobber SRR0/1.
The patch Michael posted is indeed a bit gross (it's my code btw :-) and
we'll need to clean it up, my idea is to have a global set by the
platform, but maybe we can have some generic code that performs a TLB
search for IPROT entries :-)
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 12/15] powerpc/book3e: Use way 3 for linear mapping bolted entry
From: Benjamin Herrenschmidt @ 2011-04-18 22:44 UTC (permalink / raw)
To: Kumar Gala
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <7086A97F-A6A6-4D25-9FA7-20959C74E440@kernel.crashing.org>
> >> Seems like this should have a MMU Feature bit or something for A2.
> >
> > Too early. We haven't detected the CPU and are establishing the initial
> > TLB entry here.
>
> How about wrapping with CONFIG_PPC_A2
YUCK :-)
> > Any reason why that wouldn't work on something else anyways ?
>
> No, I wasn't paying attention to what this code exactly was (not enough
> context in the diff), I see its our initial setup so not a big deal.
> Was thinking this was run-time exception handler code.
No, it's the boot time bolted entry.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 10/15] powerpc: Define slb0_limit() for BOOK3E
From: Kumar Gala @ 2011-04-18 22:30 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <1303162902.28876.164.camel@pasglop>
On Apr 18, 2011, at 4:41 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2011-04-18 at 07:42 -0500, Kumar Gala wrote:
>> Let's rename this function to something 'linear_map'. As on FSL
>> Book-E 64 we do things a bit differently and have more covered in
>> linear map than 1G
>
> It's not quite linear_map. It's whatever can be accessed without taking
> exceptions. IE. What is bolted.
>
> It should probably go into a variable initialized by the mm code tho.
>
> Cheers,
> Ben.
Is this 'ppc64_rma_size' ?
- k
^ permalink raw reply
* Re: [PATCH 12/15] powerpc/book3e: Use way 3 for linear mapping bolted entry
From: Kumar Gala @ 2011-04-18 22:27 UTC (permalink / raw)
To: Benjamin Herrenschmidt
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <1303162834.28876.163.camel@pasglop>
On Apr 18, 2011, at 4:40 PM, Benjamin Herrenschmidt wrote:
> On Mon, 2011-04-18 at 07:43 -0500, Kumar Gala wrote:
>> On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:
>>=20
>>> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>=20
>>> An erratum on A2 can lead to the bolted entry we insert for the =
linear
>>> mapping being evicted, to avoid that write the bolted entry to way =
3.
>>>=20
>>> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
>>> ---
>>> arch/powerpc/kernel/exceptions-64e.S | 5 +++--
>>> 1 files changed, 3 insertions(+), 2 deletions(-)
>>>=20
>>> diff --git a/arch/powerpc/kernel/exceptions-64e.S =
b/arch/powerpc/kernel/exceptions-64e.S
>>> index 5c43063..e6c0926 100644
>>> --- a/arch/powerpc/kernel/exceptions-64e.S
>>> +++ b/arch/powerpc/kernel/exceptions-64e.S
>>> @@ -864,8 +864,9 @@ have_hes:
>>> * that will have to be made dependent on whether we are running =
under
>>> * a hypervisor I suppose.
>>> */
>>> - ori r3,r3,MAS0_HES | MAS0_WQ_ALLWAYS
>>> - mtspr SPRN_MAS0,r3
>>> + ori r11,r3,MAS0_WQ_ALLWAYS
>>> + oris r11,r11,MAS0_ESEL(3)@h /* Use way 3: workaround A2 =
erratum 376 */
>>> + mtspr SPRN_MAS0,r11
>>> lis r3,(MAS1_VALID | MAS1_IPROT)@h
>>> ori r3,r3,BOOK3E_PAGESZ_1GB << MAS1_TSIZE_SHIFT
>>> mtspr SPRN_MAS1,r3
>>=20
>> Seems like this should have a MMU Feature bit or something for A2.
>=20
> Too early. We haven't detected the CPU and are establishing the =
initial
> TLB entry here.
How about wrapping with CONFIG_PPC_A2
> Any reason why that wouldn't work on something else anyways ?
No, I wasn't paying attention to what this code exactly was (not enough =
context in the diff), I see its our initial setup so not a big deal. =
Was thinking this was run-time exception handler code.
- k
^ permalink raw reply
* Re: [PATCH 9/14] PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM
From: Rafael J. Wysocki @ 2011-04-18 21:43 UTC (permalink / raw)
To: Mike Frysinger
Cc: Kevin Hilman, Guan Xuetao, Russell King, Konrad Rzeszutek Wilk,
Greg KH, LKML, Ralf Baechle, Jeremy Fitzhardinge, Ben Dooks,
Jiri Kosina, Kay Sievers, Linux PM mailing list, linux-omap,
linuxppc-dev, Hans-Christian Egtvedt, linux-arm-kernel
In-Reply-To: <BANLkTi=BRXtsG0wK6SbK-6L-xzwMccR3eQ@mail.gmail.com>
On Monday, April 18, 2011, Mike Frysinger wrote:
> On Sun, Apr 17, 2011 at 17:11, Rafael J. Wysocki wrote:
> > Convert some Blackfin architecture's code to using struct syscore_ops
> > objects for power management instead of sysdev classes and sysdevs.
> >
> > This simplifies the code and reduces the kernel's memory footprint.
> > It also is necessary for removing sysdevs from the kernel entirely in
> > the future.
>
> looks straight forward enough ...
> Acked-by: Mike Frysinger <vapier@gentoo.org>
>
> > +static struct syscore_ops nmi_syscore_ops = {
> > .resume = nmi_wdt_resume,
> > .suspend = nmi_wdt_suspend,
> > };
>
> a bit sad this couldnt be made const
Well, that would trigger a compiler warning from register_syscore_ops().
However, I'm going to make that change change everywhere at once when all of
the conversions have been made, since it looks like we're only going to have
static syscore_ops.
Thanks,
Rafael
^ permalink raw reply
* Re: [PATCH 10/15] powerpc: Define slb0_limit() for BOOK3E
From: Benjamin Herrenschmidt @ 2011-04-18 21:41 UTC (permalink / raw)
To: Kumar Gala
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <DB59DA71-C6DA-4E65-9251-C29B973345AD@freescale.com>
On Mon, 2011-04-18 at 07:42 -0500, Kumar Gala wrote:
> Let's rename this function to something 'linear_map'. As on FSL
> Book-E 64 we do things a bit differently and have more covered in
> linear map than 1G
It's not quite linear_map. It's whatever can be accessed without taking
exceptions. IE. What is bolted.
It should probably go into a variable initialized by the mm code tho.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 12/15] powerpc/book3e: Use way 3 for linear mapping bolted entry
From: Benjamin Herrenschmidt @ 2011-04-18 21:40 UTC (permalink / raw)
To: Kumar Gala
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <FE1E8891-E134-4559-9F26-BAFC36B258AC@kernel.crashing.org>
On Mon, 2011-04-18 at 07:43 -0500, Kumar Gala wrote:
> On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:
>
> > From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> >
> > An erratum on A2 can lead to the bolted entry we insert for the linear
> > mapping being evicted, to avoid that write the bolted entry to way 3.
> >
> > Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> > ---
> > arch/powerpc/kernel/exceptions-64e.S | 5 +++--
> > 1 files changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/exceptions-64e.S b/arch/powerpc/kernel/exceptions-64e.S
> > index 5c43063..e6c0926 100644
> > --- a/arch/powerpc/kernel/exceptions-64e.S
> > +++ b/arch/powerpc/kernel/exceptions-64e.S
> > @@ -864,8 +864,9 @@ have_hes:
> > * that will have to be made dependent on whether we are running under
> > * a hypervisor I suppose.
> > */
> > - ori r3,r3,MAS0_HES | MAS0_WQ_ALLWAYS
> > - mtspr SPRN_MAS0,r3
> > + ori r11,r3,MAS0_WQ_ALLWAYS
> > + oris r11,r11,MAS0_ESEL(3)@h /* Use way 3: workaround A2 erratum 376 */
> > + mtspr SPRN_MAS0,r11
> > lis r3,(MAS1_VALID | MAS1_IPROT)@h
> > ori r3,r3,BOOK3E_PAGESZ_1GB << MAS1_TSIZE_SHIFT
> > mtspr SPRN_MAS1,r3
>
> Seems like this should have a MMU Feature bit or something for A2.
Too early. We haven't detected the CPU and are establishing the initial
TLB entry here.
Any reason why that wouldn't work on something else anyways ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH 14/15] powerpc: Add WSP platform
From: Benjamin Herrenschmidt @ 2011-04-18 21:39 UTC (permalink / raw)
To: Kumar Gala
Cc: Michael Ellerman, Jimi Xenidis, jack, imunsie, linuxppc-dev,
David Gibson
In-Reply-To: <A6E5DD55-F9D1-430E-BAA7-E770523821A0@kernel.crashing.org>
On Mon, 2011-04-18 at 07:46 -0500, Kumar Gala wrote:
>
> Can this be moved into kernel/cpu_setup_a2.S. This and the debug
> patch that follows are bit ugly.
Well, the code per-se is not really A2 specific... the labels and
comments are :-)
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH V14 4/4] ptp: Added a clock driver for the National Semiconductor PHYTER.
From: Ben Hutchings @ 2011-04-18 20:57 UTC (permalink / raw)
To: Richard Cochran
Cc: Thomas Gleixner, Rodolfo Giometti, Arnd Bergmann, Peter Zijlstra,
linux-api, devicetree-discuss, linux-kernel, Russell King,
Paul Mackerras, John Stultz, Alan Cox, netdev, Mike Frysinger,
Christoph Lameter, linuxppc-dev, David Miller, linux-arm-kernel,
Krzysztof Halasa
In-Reply-To: <1728ffb5735c2a04876a69ad55427c4e7b5a1bd7.1303107532.git.richard.cochran@omicron.at>
On Mon, 2011-04-18 at 08:30 +0200, Richard Cochran wrote:
> This patch adds support for the PTP clock found on the DP83640.
> The basic clock operations and one external time stamp have
> been implemented.
[...]
> --- /dev/null
> +++ b/drivers/net/phy/dp83640.c
[...]
> +static int match(struct sk_buff *skb, unsigned int type, struct rxts *rxts)
> +{
> + u16 *seqid;
Should be __be16 *, and similarly for the casts.
> + u8 *msgtype, *data = skb_mac_header(skb);
> +
> + /* check sequenceID, messageType, 12 bit hash of offset 20-29 */
> + /* We assume that the IPv4 header has no options. */
Does the hardware definitely not timestamp received packets with IP
options?
> + switch (type) {
> + case PTP_CLASS_V1_IPV4:
> + msgtype = data + 42 + 32;
> + seqid = (u16 *)(data + 42 + 30);
> + break;
> + case PTP_CLASS_V1_IPV6:
> + msgtype = data + 62 + 32;
> + seqid = (u16 *)(data + 62 + 30);
> + break;
> + case PTP_CLASS_V2_IPV4:
> + msgtype = data + 42 + 0;
> + seqid = (u16 *)(data + 42 + 30);
> + break;
> + case PTP_CLASS_V2_IPV6:
> + msgtype = data + 62 + 0;
> + seqid = (u16 *)(data + 62 + 30);
> + break;
> + case PTP_CLASS_V2_L2:
> + msgtype = data + 14 + 0;
> + seqid = (u16 *)(data + 14 + 30);
> + break;
> + case PTP_CLASS_V2_VLAN:
> + msgtype = data + 18 + 0;
> + seqid = (u16 *)(data + 18 + 30);
> + break;
[...]
Would be better without the magic numbers.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH V14 3/4] ptp: Added a clock driver for the IXP46x.
From: Ben Hutchings @ 2011-04-18 20:53 UTC (permalink / raw)
To: Richard Cochran
Cc: Thomas Gleixner, Rodolfo Giometti, Arnd Bergmann, Peter Zijlstra,
linux-api, devicetree-discuss, linux-kernel, Russell King,
Paul Mackerras, John Stultz, Alan Cox, netdev, Mike Frysinger,
Christoph Lameter, linuxppc-dev, David Miller, linux-arm-kernel,
Krzysztof Halasa
In-Reply-To: <dbee2487a57fd7f41e4efbbd2ddfb1313b8d71bc.1303107532.git.richard.cochran@omicron.at>
On Mon, 2011-04-18 at 08:29 +0200, Richard Cochran wrote:
> This patch adds a driver for the hardware time stamping unit found on the
> IXP465. The basic clock operations and an external trigger are implemented.
[...]
> --- a/drivers/net/arm/ixp4xx_eth.c
> +++ b/drivers/net/arm/ixp4xx_eth.c
[...]
> @@ -246,6 +255,169 @@ static int ports_open;
> static struct port *npe_port_tab[MAX_NPES];
> static struct dma_pool *dma_pool;
>
> +static struct sock_filter ptp_filter[] = {
> + PTP_FILTER
> +};
> +
> +static int ixp_ptp_match(struct sk_buff *skb, u16 uid_hi, u32 uid_lo, u16 seq)
> +{
> + unsigned int type;
> + u16 *hi, *id;
> + u8 *lo, *data = skb->data;
> +
> + type = sk_run_filter(skb, ptp_filter);
> +
> + if (PTP_CLASS_V1_IPV4 == type) {
> +
> + id = (u16 *)(data + 42 + 30);
> + hi = (u16 *)(data + 42 + 22);
> + lo = data + 42 + 24;
[...]
PTP_FILTER does not verify that the packet length is sufficient to hold
a complete PTP header, nor does it require that the IPv4 header length
is 5 (i.e. 20 bytes). So you have to check those here rather than using
magic numbers.
I think you also need to use be16_to_cpup() to read 'id' and 'hi', since
the host byte order may vary.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH 10/14] PM / MIPS: Use struct syscore_ops instead of sysdevs for PM
From: Rafael J. Wysocki @ 2011-04-18 20:03 UTC (permalink / raw)
To: Ralf Baechle
Cc: Kevin Hilman, Guan Xuetao, Russell King, Konrad Rzeszutek Wilk,
Greg KH, LKML, Jeremy Fitzhardinge, Ben Dooks, Jiri Kosina,
Kay Sievers, Mike Frysinger, Linux PM mailing list, linux-omap,
linuxppc-dev, Hans-Christian Egtvedt, linux-arm-kernel
In-Reply-To: <20110418101218.GA25325@linux-mips.org>
On Monday, April 18, 2011, Ralf Baechle wrote:
> This patch breaks the Alchemy kernel compile; below patch on top of it fixes
> that again.
>
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Thanks! If you don't mind, I'd like to fold your patch into [10/14].
Rafael
> ---
> arch/mips/alchemy/common/irq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> Index: linux-mips/arch/mips/alchemy/common/irq.c
> ===================================================================
> --- linux-mips.orig/arch/mips/alchemy/common/irq.c
> +++ linux-mips/arch/mips/alchemy/common/irq.c
> @@ -619,8 +619,8 @@ static struct syscore_ops alchemy_ic_sys
>
> static int __init alchemy_ic_syscore_init(void)
> {
> - alchemy_ic_data[0].base = ioremap(icbase[IC0_PHYS_ADDR], 0x1000);
> - alchemy_ic_data[1].base = ioremap(icbase[IC1_PHYS_ADDR], 0x1000);
> + alchemy_ic_data[0].base = ioremap(IC0_PHYS_ADDR, 0x1000);
> + alchemy_ic_data[1].base = ioremap(IC1_PHYS_ADDR, 0x1000);
>
> register_syscore_ops(&alchemy_ic_syscore_ops);
>
>
>
^ permalink raw reply
* Re: [PATCH 1/1] ppc64: fix build error when compiling with gcc-4.6.0
From: Stratos Psomadakis @ 2011-04-18 16:51 UTC (permalink / raw)
To: linux-kernel; +Cc: Stratos Psomadakis, linuxppc-dev
In-Reply-To: <1303144739-4407-2-git-send-email-psomas@cslab.ece.ntua.gr>
[-- Attachment #1: Type: text/plain, Size: 1102 bytes --]
On 18/04/2011 07:38 μμ, Stratos Psomadakis wrote:
> variable 'old' is set but not used, which results to a warning
> (-Werror=unused-but-set-variable) when compiling with gcc-4.6.0, and subsequent
> build failure.
> Remove the variable 'old', since it's not used anyway.
Something went wrong with git-send-email :/
So I send the first mail in the chain as a reply:
The build error was reported at the Gentoo Bugzilla [1].
When compiling with gcc-4.6.0, a build error occurs:
"variable ‘old’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors"
This patch removes the unnecessary assignments to the variable 'old', which cause
the compiler warning (used but not set), and build failure, and remove the variable completely.
I think it's ok to do that, since the variable is actually never used. Right?
(of course disabling CONFIG_PPC_WERROR would resolve the build failure, but cleaning up the code a bit, is better I think).
[1] https://bugs.gentoo.org/show_bug.cgi?id=363935
--
Stratos Psomadakis
<psomas@ece.ntua.gr>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
^ permalink raw reply
* Re: [PATCH 1/1] ppc64: fix build error when compiling with gcc-4.6.0
From: Stratos Psomadakis @ 2011-04-18 17:00 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev
In-Reply-To: <1303144739-4407-2-git-send-email-psomas@cslab.ece.ntua.gr>
Signed-off-by: Stratos Psomadakis <psomas@cslab.ece.ntua.gr>
--
Stratos Psomadakis
<psomas@ece.ntua.gr>
^ permalink raw reply
* [PATCH 1/1] ppc64: fix build error when compiling with gcc-4.6.0
From: Stratos Psomadakis @ 2011-04-18 16:38 UTC (permalink / raw)
To: linux-kernel; +Cc: Stratos Psomadakis, linuxppc-dev
In-Reply-To: <1303144739-4407-1-git-send-email-psomas@cslab.ece.ntua.gr>
variable 'old' is set but not used, which results to a warning
(-Werror=unused-but-set-variable) when compiling with gcc-4.6.0, and subsequent
build failure.
Remove the variable 'old', since it's not used anyway.
---
arch/powerpc/include/asm/pgtable-ppc64.h | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h
index 2b09cd5..a49d592 100644
--- a/arch/powerpc/include/asm/pgtable-ppc64.h
+++ b/arch/powerpc/include/asm/pgtable-ppc64.h
@@ -257,21 +257,20 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
pte_t *ptep)
{
- unsigned long old;
- if ((pte_val(*ptep) & _PAGE_RW) == 0)
- return;
- old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
+ if ((pte_val(*ptep) & _PAGE_RW) == 0)
+ return;
+
+ pte_update(mm, addr, ptep, _PAGE_RW, 0);
}
static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
- unsigned long old;
-
if ((pte_val(*ptep) & _PAGE_RW) == 0)
return;
- old = pte_update(mm, addr, ptep, _PAGE_RW, 1);
+
+ pte_update(mm, addr, ptep, _PAGE_RW, 1);
}
/*
--
1.7.4.1
^ permalink raw reply related
* [PATCH 0/1] ppc64: fix build error when compiling with gcc-4.6.0
From: Stratos Psomadakis @ 2011-04-18 16:38 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev
The build error was reported at the Gentoo Bugzilla [1].
When compiling with gcc-4.6.0, a build error occurs:
"variable ‘old’ set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors"
This patch removes the unnecessary assignments to the variable, which cause
the compiler warning (used but not set), and build failure, and removes it
completely.
I think it's ok to do that, since the variable wasn't actually used anywhere
inside those two functions that caused the warning. Right?
[1] https://bugs.gentoo.org/show_bug.cgi?id=363935
^ permalink raw reply
* Re: [PATCH 14/15] powerpc: Add WSP platform
From: Kumar Gala @ 2011-04-18 12:46 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Jimi Xenidis, linuxppc-dev, David Gibson, imunsie, jack
In-Reply-To: <02b9880aa9ef5d49b473c894bce886f2060f9f0b.1302856271.git.michael@ellerman.id.au>
On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:
> diff --git a/arch/powerpc/kernel/exceptions-64e.S =
b/arch/powerpc/kernel/exceptions-64e.S
> index ab5c4dd..8e5d2c1 100644
> --- a/arch/powerpc/kernel/exceptions-64e.S
> +++ b/arch/powerpc/kernel/exceptions-64e.S
> @@ -864,6 +864,20 @@ have_hes:
> * that will have to be made dependent on whether we are running =
under
> * a hypervisor I suppose.
> */
> +
> + /* BEWARE, MAGIC
> + * This code is called as an ordinary function on the boot CPU. =
But to
> + * avoid duplication, this code is also used in SCOM bringup of
> + * secondary CPUs. We read the code between the =
initial_tlb_code_start
> + * and initial_tlb_code_end labels one instruction at a time and =
RAM it
> + * into the new core via SCOM. That doesn't process branches, so =
there
> + * must be none between those two labels. It also means if this =
code
> + * ever takes any parameters, the SCOM code must also be updated =
to
> + * provide them.
> + */
> + .globl a2_tlbinit_code_start
> +a2_tlbinit_code_start:
> +
> ori r11,r3,MAS0_WQ_ALLWAYS
> oris r11,r11,MAS0_ESEL(3)@h /* Use way 3: workaround A2 =
erratum 376 */
> mtspr SPRN_MAS0,r11
> @@ -880,6 +894,9 @@ have_hes:
> /* Write the TLB entry */
> tlbwe
>=20
> + .globl a2_tlbinit_after_linear_map
> +a2_tlbinit_after_linear_map:
> +
> /* Now we branch the new virtual address mapped by this entry */
> LOAD_REG_IMMEDIATE(r3,1f)
> mtctr r3
> @@ -931,10 +948,16 @@ have_hes:
> cmpw r3,r9
> blt 2b
>=20
> + .globl a2_tlbinit_after_iprot_flush
> +a2_tlbinit_after_iprot_flush:
> +
> PPC_TLBILX(0,0,0)
> sync
> isync
>=20
> + .globl a2_tlbinit_code_end
> +a2_tlbinit_code_end:
> +
> /* We translate LR and return */
> mflr r3
> tovirt(r3,r3)
Can this be moved into kernel/cpu_setup_a2.S. This and the debug patch =
that follows are bit ugly.
- k=
^ permalink raw reply
* Re: [PATCH 12/15] powerpc/book3e: Use way 3 for linear mapping bolted entry
From: Kumar Gala @ 2011-04-18 12:43 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Jimi Xenidis, linuxppc-dev, David Gibson, imunsie, jack
In-Reply-To: <bbe411555c95e56ba427ebf638d5333b1870af77.1302856271.git.michael@ellerman.id.au>
On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>=20
> An erratum on A2 can lead to the bolted entry we insert for the linear
> mapping being evicted, to avoid that write the bolted entry to way 3.
>=20
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/kernel/exceptions-64e.S | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/exceptions-64e.S =
b/arch/powerpc/kernel/exceptions-64e.S
> index 5c43063..e6c0926 100644
> --- a/arch/powerpc/kernel/exceptions-64e.S
> +++ b/arch/powerpc/kernel/exceptions-64e.S
> @@ -864,8 +864,9 @@ have_hes:
> * that will have to be made dependent on whether we are running =
under
> * a hypervisor I suppose.
> */
> - ori r3,r3,MAS0_HES | MAS0_WQ_ALLWAYS
> - mtspr SPRN_MAS0,r3
> + ori r11,r3,MAS0_WQ_ALLWAYS
> + oris r11,r11,MAS0_ESEL(3)@h /* Use way 3: workaround A2 =
erratum 376 */
> + mtspr SPRN_MAS0,r11
> lis r3,(MAS1_VALID | MAS1_IPROT)@h
> ori r3,r3,BOOK3E_PAGESZ_1GB << MAS1_TSIZE_SHIFT
> mtspr SPRN_MAS1,r3
Seems like this should have a MMU Feature bit or something for A2.
- k=
^ permalink raw reply
* Re: [PATCH 10/15] powerpc: Define slb0_limit() for BOOK3E
From: Kumar Gala @ 2011-04-18 12:42 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Jimi Xenidis, linuxppc-dev, David Gibson, imunsie, jack
In-Reply-To: <021a5af117537ce9f7c6c3b27310f15851ab5034.1302856271.git.michael@ellerman.id.au>
On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:
> From: Michael Ellerman <michael@ellerman.id.au>
>=20
> On BOOK3E we don't have an SLB 0, but the equivalent concept is the
> bolted entry mapping the kernel. Currently this is a 1G entry, so
> for now hardcode that. This will probably need to be reworked in
> future.
>=20
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/kernel/setup_64.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>=20
> diff --git a/arch/powerpc/kernel/setup_64.c =
b/arch/powerpc/kernel/setup_64.c
> index 91a5cc5..3d0daf4 100644
> --- a/arch/powerpc/kernel/setup_64.c
> +++ b/arch/powerpc/kernel/setup_64.c
> @@ -436,10 +436,14 @@ void __init setup_system(void)
>=20
> static u64 slb0_limit(void)
> {
> +#ifdef CONFIG_PPC_BOOK3E
> + return 1 << 30;
> +#else
> if (cpu_has_feature(CPU_FTR_1T_SEGMENT)) {
> return 1UL << SID_SHIFT_1T;
> }
> return 1UL << SID_SHIFT;
> +#endif
> }
>=20
Let's rename this function to something 'linear_map'. As on FSL Book-E =
64 we do things a bit differently and have more covered in linear map =
than 1G
> static void __init irqstack_early_init(void)
> --=20
> 1.7.1
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH 07/15] powerpc: Move CPU_FTRS_BASE_BOOK3E into cputable.h & update FTR masks
From: Kumar Gala @ 2011-04-18 12:37 UTC (permalink / raw)
To: Michael Ellerman; +Cc: Jimi Xenidis, linuxppc-dev, David Gibson, imunsie, jack
In-Reply-To: <1a24282746fd056fb51dda3b25d160d2fc609da5.1302856271.git.michael@ellerman.id.au>
On Apr 15, 2011, at 3:32 AM, Michael Ellerman wrote:
> From: Michael Ellerman <michael@ellerman.id.au>
>
> Where they belong with all the others. Remove SMT which may not be
> true for all BOOK3E parts.
>
> Currently the FTRS_POSSIBLE & FTRS_ALWAYS are defined for 64 or 32 bit.
> Now that we have BOOK3E we need to split it three ways, BOOK3S, BOOK3E,
> and 32-bit.
>
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> arch/powerpc/include/asm/cputable.h | 17 +++++++++++++----
> arch/powerpc/kernel/cputable.c | 3 ---
> 2 files changed, 13 insertions(+), 7 deletions(-)
will probably need some updating based on:
commit 11ed0db9f6c7811233632d2ab79c50c011b89902
Author: Kumar Gala <galak@kernel.crashing.org>
Date: Wed Apr 6 00:11:06 2011 -0500
powerpc/book3e: Fix CPU feature handling on 64-bit e5500
The CPU_FTRS_POSSIBLE and CPU_FTRS_ALWAYS defines did not encompass
e5500 CPU features when built for 64-bit. This causes issues with
cpu_has_feature() as it utilizes the POSSIBLE & ALWAYS defines as part
of its check.
Create a unique CPU_FTRS_E5500 (as its different from CPU_FTRS_E500MC),
created a new group for 64-bit Book3e based CPUs and add CPU_FTRS_E5500
to that group.
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
- k
^ permalink raw reply
* Re: [PATCH 10/14] PM / MIPS: Use struct syscore_ops instead of sysdevs for PM
From: Ralf Baechle @ 2011-04-18 10:12 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Kevin Hilman, Guan Xuetao, Russell King, Konrad Rzeszutek Wilk,
Greg KH, LKML, Jeremy Fitzhardinge, Ben Dooks, Jiri Kosina,
Kay Sievers, Mike Frysinger, Linux PM mailing list, linux-omap,
linuxppc-dev, Hans-Christian Egtvedt, linux-arm-kernel
In-Reply-To: <201104172312.35060.rjw@sisk.pl>
This patch breaks the Alchemy kernel compile; below patch on top of it fixes
that again.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---
arch/mips/alchemy/common/irq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-mips/arch/mips/alchemy/common/irq.c
===================================================================
--- linux-mips.orig/arch/mips/alchemy/common/irq.c
+++ linux-mips/arch/mips/alchemy/common/irq.c
@@ -619,8 +619,8 @@ static struct syscore_ops alchemy_ic_sys
static int __init alchemy_ic_syscore_init(void)
{
- alchemy_ic_data[0].base = ioremap(icbase[IC0_PHYS_ADDR], 0x1000);
- alchemy_ic_data[1].base = ioremap(icbase[IC1_PHYS_ADDR], 0x1000);
+ alchemy_ic_data[0].base = ioremap(IC0_PHYS_ADDR, 0x1000);
+ alchemy_ic_data[1].base = ioremap(IC1_PHYS_ADDR, 0x1000);
register_syscore_ops(&alchemy_ic_syscore_ops);
^ permalink raw reply
* Re: [PATCH 2/14] PM: Add missing syscore_suspend() and syscore_resume() calls
From: Ian Campbell @ 2011-04-18 8:51 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Kevin Hilman, Guan Xuetao, Russell King, Konrad Rzeszutek Wilk,
Greg KH, LKML, Ralf Baechle, Jeremy Fitzhardinge, Ben Dooks,
Jiri Kosina, Kay Sievers, Mike Frysinger, Linux PM mailing list,
linux-omap, linuxppc-dev, Hans-Christian Egtvedt,
linux-arm-kernel
In-Reply-To: <201104172306.49462.rjw@sisk.pl>
On Sun, 2011-04-17 at 23:06 +0200, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> Device suspend/resume infrastructure is used not only by the suspend
> and hibernate code in kernel/power, but also by , APM, Xen and the
> kexec jump feature. However, commit 40dc166cb5dddbd36aa4ad11c03915ea
> (PM / Core: Introduce struct syscore_ops for core subsystems PM)
> failed to add syscore_suspend() and syscore_resume() calls to that
> code, which generally leads to breakage when the features in question
> are used.
>
> To fix this problem, add the missing syscore_suspend() and
> syscore_resume() calls to arch/x86/kernel/apm_32.c, kernel/kexec.c
> and drivers/xen/manage.c.
Xen bit looks ok to me:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
> arch/x86/kernel/apm_32.c | 5 +++++
> drivers/xen/manage.c | 9 ++++++++-
> kernel/kexec.c | 7 +++++++
> 3 files changed, 20 insertions(+), 1 deletion(-)
>
> Index: linux-2.6/kernel/kexec.c
> ===================================================================
> --- linux-2.6.orig/kernel/kexec.c
> +++ linux-2.6/kernel/kexec.c
> @@ -33,6 +33,7 @@
> #include <linux/vmalloc.h>
> #include <linux/swap.h>
> #include <linux/kmsg_dump.h>
> +#include <linux/syscore_ops.h>
>
> #include <asm/page.h>
> #include <asm/uaccess.h>
> @@ -1532,6 +1533,11 @@ int kernel_kexec(void)
> local_irq_disable();
> /* Suspend system devices */
> error = sysdev_suspend(PMSG_FREEZE);
> + if (!error) {
> + error = syscore_suspend();
> + if (error)
> + sysdev_resume();
> + }
> if (error)
> goto Enable_irqs;
> } else
> @@ -1546,6 +1552,7 @@ int kernel_kexec(void)
>
> #ifdef CONFIG_KEXEC_JUMP
> if (kexec_image->preserve_context) {
> + syscore_resume();
> sysdev_resume();
> Enable_irqs:
> local_irq_enable();
> Index: linux-2.6/drivers/xen/manage.c
> ===================================================================
> --- linux-2.6.orig/drivers/xen/manage.c
> +++ linux-2.6/drivers/xen/manage.c
> @@ -8,6 +8,7 @@
> #include <linux/sysrq.h>
> #include <linux/stop_machine.h>
> #include <linux/freezer.h>
> +#include <linux/syscore_ops.h>
>
> #include <xen/xen.h>
> #include <xen/xenbus.h>
> @@ -70,8 +71,13 @@ static int xen_suspend(void *data)
> BUG_ON(!irqs_disabled());
>
> err = sysdev_suspend(PMSG_FREEZE);
> + if (!err) {
> + err = syscore_suspend();
> + if (err)
> + sysdev_resume();
> + }
> if (err) {
> - printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
> + printk(KERN_ERR "xen_suspend: system core suspend failed: %d\n",
> err);
> return err;
> }
> @@ -95,6 +101,7 @@ static int xen_suspend(void *data)
> xen_timer_resume();
> }
>
> + syscore_resume();
> sysdev_resume();
>
> return 0;
> Index: linux-2.6/arch/x86/kernel/apm_32.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/kernel/apm_32.c
> +++ linux-2.6/arch/x86/kernel/apm_32.c
> @@ -228,6 +228,7 @@
> #include <linux/kthread.h>
> #include <linux/jiffies.h>
> #include <linux/acpi.h>
> +#include <linux/syscore_ops.h>
>
> #include <asm/system.h>
> #include <asm/uaccess.h>
> @@ -1238,6 +1239,7 @@ static int suspend(int vetoable)
>
> local_irq_disable();
> sysdev_suspend(PMSG_SUSPEND);
> + syscore_suspend();
>
> local_irq_enable();
>
> @@ -1255,6 +1257,7 @@ static int suspend(int vetoable)
> apm_error("suspend", err);
> err = (err == APM_SUCCESS) ? 0 : -EIO;
>
> + syscore_resume();
> sysdev_resume();
> local_irq_enable();
>
> @@ -1280,6 +1283,7 @@ static void standby(void)
>
> local_irq_disable();
> sysdev_suspend(PMSG_SUSPEND);
> + syscore_suspend();
> local_irq_enable();
>
> err = set_system_power_state(APM_STATE_STANDBY);
> @@ -1287,6 +1291,7 @@ static void standby(void)
> apm_error("standby", err);
>
> local_irq_disable();
> + syscore_resume();
> sysdev_resume();
> local_irq_enable();
>
>
> --
> 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/
>
--
Ian Campbell
Tact in audacity is knowing how far you can go without going too far.
-- Jean Cocteau
^ permalink raw reply
* Re: [PATCH V14 3/4] ptp: Added a clock driver for the IXP46x.
From: Arnd Bergmann @ 2011-04-18 8:26 UTC (permalink / raw)
To: Richard Cochran
Cc: Thomas Gleixner, Rodolfo Giometti, Peter Zijlstra, linux-api,
devicetree-discuss, linux-kernel, Russell King, Paul Mackerras,
John Stultz, Alan Cox, netdev, Mike Frysinger, Christoph Lameter,
linuxppc-dev, David Miller, linux-arm-kernel, Krzysztof Halasa
In-Reply-To: <201104181021.01279.arnd@arndb.de>
On Monday 18 April 2011, Arnd Bergmann wrote:
> On Monday 18 April 2011, Richard Cochran wrote:
> > On Mon, Apr 18, 2011 at 08:56:03AM +0200, Arnd Bergmann wrote:
> > > On Monday 18 April 2011, Richard Cochran wrote:
> > > > +
> > > > + lo = __raw_readl(®s->channel[ch].src_uuid_lo);
> > > > + hi = __raw_readl(®s->channel[ch].src_uuid_hi);
> > > > +
> > >
> > > I guess you should use readl(), not __raw_readl() here. The __raw_* functions
> > > are not meant for device drivers.
> >
> > Krzysztof had a different opinion about this.
> >
> > https://lkml.org/lkml/2011/1/8/67
> >
> > Anyway, it is his driver, and I just followed what he does elsewhere
> > in the driver. It make sense to me to keep the driver consistent.
> > Maybe we should make the change throughout?
>
> It would certainly be useful to fix it up. I now realized that this driver
> supports both big-endian and little-endian configurations, so just using
> readl() is certainly broken.
> There should probably be an ixp specific version of the safe I/O accessors
> to deal with it on all on-chip peripherals in a safe way.
Anyway, not your problem then, just leave it like it is.
Acked-by: Arnd Bergmann <arnd@arndb.de>
^ permalink raw reply
* Re: [PATCH V14 3/4] ptp: Added a clock driver for the IXP46x.
From: Arnd Bergmann @ 2011-04-18 8:21 UTC (permalink / raw)
To: Richard Cochran
Cc: Thomas Gleixner, Rodolfo Giometti, Peter Zijlstra, linux-api,
devicetree-discuss, linux-kernel, Russell King, Paul Mackerras,
John Stultz, Alan Cox, netdev, Mike Frysinger, Christoph Lameter,
linuxppc-dev, David Miller, linux-arm-kernel, Krzysztof Halasa
In-Reply-To: <20110418080606.GA3809@riccoc20.at.omicron.at>
On Monday 18 April 2011, Richard Cochran wrote:
> On Mon, Apr 18, 2011 at 08:56:03AM +0200, Arnd Bergmann wrote:
> > On Monday 18 April 2011, Richard Cochran wrote:
> > > +
> > > + lo = __raw_readl(®s->channel[ch].src_uuid_lo);
> > > + hi = __raw_readl(®s->channel[ch].src_uuid_hi);
> > > +
> >
> > I guess you should use readl(), not __raw_readl() here. The __raw_* functions
> > are not meant for device drivers.
>
> Krzysztof had a different opinion about this.
>
> https://lkml.org/lkml/2011/1/8/67
>
> Anyway, it is his driver, and I just followed what he does elsewhere
> in the driver. It make sense to me to keep the driver consistent.
> Maybe we should make the change throughout?
It would certainly be useful to fix it up. I now realized that this driver
supports both big-endian and little-endian configurations, so just using
readl() is certainly broken.
There should probably be an ixp specific version of the safe I/O accessors
to deal with it on all on-chip peripherals in a safe way.
Arnd
^ permalink raw reply
* Re: [PATCH V14 3/4] ptp: Added a clock driver for the IXP46x.
From: Richard Cochran @ 2011-04-18 8:16 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Thomas Gleixner, Rodolfo Giometti, Peter Zijlstra, linux-api,
devicetree-discuss, linux-kernel, Russell King, Paul Mackerras,
John Stultz, Alan Cox, netdev, Mike Frysinger, Christoph Lameter,
linuxppc-dev, David Miller, linux-arm-kernel, Krzysztof Halasa
In-Reply-To: <20110418080606.GA3809@riccoc20.at.omicron.at>
Also, I forgot to add Krzysztof's ack to the commit message, but he
did ack V12.
Thanks,
Richard
^ 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