* Re: [V3 01/10] perf: New conditional branch filter criteria in branch stack sampling
From: Anshuman Khandual @ 2013-12-03 10:21 UTC (permalink / raw)
To: mpe@ellerman.id.au
Cc: mikey, michaele, linux-kernel, eranian, linuxppc-dev, sukadev
In-Reply-To: <529474C7.9050005@linux.vnet.ibm.com>
On 11/26/2013 03:45 PM, Anshuman Khandual wrote:
> On 11/26/2013 11:36 AM, mpe@ellerman.id.au wrote:
>> Ideally your commit subject would contain a verb, preferably in the present
>> tense.
>>
>> I think simply "perf: Add PERF_SAMPLE_BRANCH_COND" would be clearer.
>
>
> Sure, will change it.
>
>>
>> On Wed, 2013-16-10 at 06:56:48 UTC, Anshuman Khandual wrote:
>>> POWER8 PMU based BHRB supports filtering for conditional branches.
>>> This patch introduces new branch filter PERF_SAMPLE_BRANCH_COND which
>>> will extend the existing perf ABI. Other architectures can provide
>>> this functionality with either HW filtering support (if present) or
>>> with SW filtering of instructions.
>>>
>>> Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
>>> Reviewed-by: Stephane Eranian <eranian@google.com>
>>> ---
>>> include/uapi/linux/perf_event.h | 3 ++-
>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
>>> index 0b1df41..5da52b6 100644
>>> --- a/include/uapi/linux/perf_event.h
>>> +++ b/include/uapi/linux/perf_event.h
>>> @@ -160,8 +160,9 @@ enum perf_branch_sample_type {
>>> PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */
>>> PERF_SAMPLE_BRANCH_IN_TX = 1U << 8, /* in transaction */
>>> PERF_SAMPLE_BRANCH_NO_TX = 1U << 9, /* not in transaction */
>>> + PERF_SAMPLE_BRANCH_COND = 1U << 10, /* conditional branches */
>>>
>>> - PERF_SAMPLE_BRANCH_MAX = 1U << 10, /* non-ABI */
>>> + PERF_SAMPLE_BRANCH_MAX = 1U << 11, /* non-ABI */
>>> };
>>
>> This no longer applies against Linus' tree, you'll need to rebase it.
>
> Okay
Hey Michael,
Looks like the patch still applies on top of Linus's tree. The modified patch with
a new commit subject line can be found here.
----------------------------------------------------------------------
>From d368096fc51a8da65f2d80ed5090d43cbc269f62 Mon Sep 17 00:00:00 2001
From: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Date: Mon, 22 Jul 2013 12:22:27 +0530
Subject: [PATCH] perf: Add PERF_SAMPLE_BRANCH_COND
POWER8 PMU based BHRB supports filtering for conditional branches.
This patch introduces new branch filter PERF_SAMPLE_BRANCH_COND which
will extend the existing perf ABI. Other architectures can provide
this functionality with either HW filtering support (if present) or
with SW filtering of instructions.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Reviewed-by: Stephane Eranian <eranian@google.com>
---
include/uapi/linux/perf_event.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/perf_event.h b/include/uapi/linux/perf_event.h
index e1802d6..e2d8b8b 100644
--- a/include/uapi/linux/perf_event.h
+++ b/include/uapi/linux/perf_event.h
@@ -163,8 +163,9 @@ enum perf_branch_sample_type {
PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7, /* transaction aborts */
PERF_SAMPLE_BRANCH_IN_TX = 1U << 8, /* in transaction */
PERF_SAMPLE_BRANCH_NO_TX = 1U << 9, /* not in transaction */
+ PERF_SAMPLE_BRANCH_COND = 1U << 10, /* conditional branches */
- PERF_SAMPLE_BRANCH_MAX = 1U << 10, /* non-ABI */
+ PERF_SAMPLE_BRANCH_MAX = 1U << 11, /* non-ABI */
};
#define PERF_SAMPLE_BRANCH_PLM_ALL \
--
1.7.11.7
^ permalink raw reply related
* [PATCH] ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits
From: Nicolin Chen @ 2013-12-03 10:38 UTC (permalink / raw)
To: broonie, timur; +Cc: tiwai, alsa-devel, linuxppc-dev, lgirdwood, perex
Since we introduced symmetric_channels and symmetric_samplebits, we implement
these two features to fsl_ssi so as to drop some no-more-needed code and make
the driver neat and clean.
Signed-off-by: Nicolin Chen <b42378@freescale.com>
---
sound/soc/fsl/fsl_ssi.c | 79 ++++++-------------------------------------------
1 file changed, 9 insertions(+), 70 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 90ff107..f9f4569 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -119,8 +119,6 @@ static inline void write_ssi_mask(u32 __iomem *addr, u32 clear, u32 set)
* @ssi: pointer to the SSI's registers
* @ssi_phys: physical address of the SSI registers
* @irq: IRQ of this SSI
- * @first_stream: pointer to the stream that was opened first
- * @second_stream: pointer to second stream
* @playback: the number of playback streams opened
* @capture: the number of capture streams opened
* @cpu_dai: the CPU DAI for this device
@@ -132,8 +130,6 @@ struct fsl_ssi_private {
struct ccsr_ssi __iomem *ssi;
dma_addr_t ssi_phys;
unsigned int irq;
- struct snd_pcm_substream *first_stream;
- struct snd_pcm_substream *second_stream;
unsigned int fifo_depth;
struct snd_soc_dai_driver cpu_dai_drv;
struct device_attribute dev_attr;
@@ -438,54 +434,13 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream,
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct fsl_ssi_private *ssi_private =
snd_soc_dai_get_drvdata(rtd->cpu_dai);
- int synchronous = ssi_private->cpu_dai_drv.symmetric_rates;
- /*
- * If this is the first stream opened, then request the IRQ
- * and initialize the SSI registers.
+ /* First, we only do fsl_ssi_setup() when SSI is going to be active.
+ * Second, fsl_ssi_setup was already called by ac97_init earlier if
+ * the driver is in ac97 mode.
*/
- if (!ssi_private->first_stream) {
- ssi_private->first_stream = substream;
-
- /*
- * fsl_ssi_setup was already called by ac97_init earlier if
- * the driver is in ac97 mode.
- */
- if (!ssi_private->imx_ac97)
- fsl_ssi_setup(ssi_private);
- } else {
- if (synchronous) {
- struct snd_pcm_runtime *first_runtime =
- ssi_private->first_stream->runtime;
- /*
- * This is the second stream open, and we're in
- * synchronous mode, so we need to impose sample
- * sample size constraints. This is because STCCR is
- * used for playback and capture in synchronous mode,
- * so there's no way to specify different word
- * lengths.
- *
- * Note that this can cause a race condition if the
- * second stream is opened before the first stream is
- * fully initialized. We provide some protection by
- * checking to make sure the first stream is
- * initialized, but it's not perfect. ALSA sometimes
- * re-initializes the driver with a different sample
- * rate or size. If the second stream is opened
- * before the first stream has received its final
- * parameters, then the second stream may be
- * constrained to the wrong sample rate or size.
- */
- if (first_runtime->sample_bits) {
- snd_pcm_hw_constraint_minmax(substream->runtime,
- SNDRV_PCM_HW_PARAM_SAMPLE_BITS,
- first_runtime->sample_bits,
- first_runtime->sample_bits);
- }
- }
-
- ssi_private->second_stream = substream;
- }
+ if (!dai->active && !ssi_private->imx_ac97)
+ fsl_ssi_setup(ssi_private);
return 0;
}
@@ -615,23 +570,6 @@ static int fsl_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
return 0;
}
-/**
- * fsl_ssi_shutdown: shutdown the SSI
- *
- * Shutdown the SSI if there are no other substreams open.
- */
-static void fsl_ssi_shutdown(struct snd_pcm_substream *substream,
- struct snd_soc_dai *dai)
-{
- struct snd_soc_pcm_runtime *rtd = substream->private_data;
- struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(rtd->cpu_dai);
-
- if (ssi_private->first_stream == substream)
- ssi_private->first_stream = ssi_private->second_stream;
-
- ssi_private->second_stream = NULL;
-}
-
static int fsl_ssi_dai_probe(struct snd_soc_dai *dai)
{
struct fsl_ssi_private *ssi_private = snd_soc_dai_get_drvdata(dai);
@@ -647,7 +585,6 @@ static int fsl_ssi_dai_probe(struct snd_soc_dai *dai)
static const struct snd_soc_dai_ops fsl_ssi_dai_ops = {
.startup = fsl_ssi_startup,
.hw_params = fsl_ssi_hw_params,
- .shutdown = fsl_ssi_shutdown,
.trigger = fsl_ssi_trigger,
};
@@ -722,7 +659,6 @@ static int fsl_ssi_ac97_trigger(struct snd_pcm_substream *substream, int cmd,
static const struct snd_soc_dai_ops fsl_ssi_ac97_dai_ops = {
.startup = fsl_ssi_startup,
- .shutdown = fsl_ssi_shutdown,
.trigger = fsl_ssi_ac97_trigger,
};
@@ -947,8 +883,11 @@ static int fsl_ssi_probe(struct platform_device *pdev)
}
/* Are the RX and the TX clocks locked? */
- if (!of_find_property(np, "fsl,ssi-asynchronous", NULL))
+ if (!of_find_property(np, "fsl,ssi-asynchronous", NULL)) {
ssi_private->cpu_dai_drv.symmetric_rates = 1;
+ ssi_private->cpu_dai_drv.symmetric_channels = 1;
+ ssi_private->cpu_dai_drv.symmetric_samplebits = 1;
+ }
/* Determine the FIFO depth. */
iprop = of_get_property(np, "fsl,fifo-depth", NULL);
--
1.8.4
^ permalink raw reply related
* [PATCH v1 1/1] powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node
From: Gerhard Sittig @ 2013-12-03 10:56 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: devicetree, Gerhard Sittig, linuxppc-dev
the 'soc' node in the common .dtsi for MPC5121 has an '#interrupt-cells'
property although this node is not an interrupt controller
remove this erroneously placed property because starting with v3.13-rc1
lookup and resolution of 'interrupts' specs for peripherals gets misled,
emits 'no irq domain found' WARN() messages and breaks the boot process
irq: no irq domain found for /soc@80000000 !
------------[ cut here ]------------
WARNING: at /home/gsi/SRC/linux-torvalds/drivers/of/platform.c:171
Modules linked in:
CPU: 0 PID: 1 Comm: swapper Tainted: G W 3.13.0-rc1-00001-g8a66234 #8
task: df823bb0 ti: df834000 task.ti: df834000
NIP: c02b5190 LR: c02b5180 CTR: c01cf4e0
REGS: df835c50 TRAP: 0700 Tainted: G W (3.13.0-rc1-00001-g8a66234)
MSR: 00029032 <EE,ME,IR,DR,RI> CR: 229a9d42 XER: 20000000
GPR00: c02b5180 df835d00 df823bb0 00000000 00000000 df835b18 ffffffff 00000308
GPR08: c0479cc0 c0480000 c0479cc0 00000308 00000308 00000000 c00040fc 00000000
GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 df850880
GPR24: df84d670 00000000 00000001 df8561a0 dffffccc df85089c 00000020 00000001
NIP [c02b5190] of_device_alloc+0xf4/0x1a0
LR [c02b5180] of_device_alloc+0xe4/0x1a0
Call Trace:
[df835d00] [c02b5180] of_device_alloc+0xe4/0x1a0 (unreliable)
[df835d50] [c02b5278] of_platform_device_create_pdata+0x3c/0xc8
[df835d70] [c02b53fc] of_platform_bus_create+0xf8/0x170
[df835dc0] [c02b5448] of_platform_bus_create+0x144/0x170
[df835e10] [c02b55a8] of_platform_bus_probe+0x98/0xe8
[df835e30] [c0437508] mpc512x_init+0x28/0x1c4
[df835e70] [c0435de8] ppc_init+0x4c/0x60
[df835e80] [c0003b28] do_one_initcall+0x150/0x1a4
[df835ef0] [c0432048] kernel_init_freeable+0x114/0x1c0
[df835f30] [c0004114] kernel_init+0x18/0x124
[df835f40] [c000e910] ret_from_kernel_thread+0x5c/0x64
Instruction dump:
409effd4 57c9103a 57de2834 7c89f050 7f83e378 7c972214 7f45d378 48001f55
7c63d278 7c630034 5463d97e 687a0001 <0f1a0000> 2f990000 387b0010 939b0098
---[ end trace 2257f10e5a20cbdd ]---
...
irq: no irq domain found for /soc@80000000 !
fsl-diu-fb 80002100.display: could not get DIU IRQ
fsl-diu-fb: probe of 80002100.display failed with error -22
irq: no irq domain found for /soc@80000000 !
mpc512x_dma 80014000.dma: Error mapping IRQ!
mpc512x_dma: probe of 80014000.dma failed with error -22
...
irq: no irq domain found for /soc@80000000 !
fs_enet: probe of 80002800.ethernet failed with error -22
...
irq: no irq domain found for /soc@80000000 !
mpc5121-rtc 80000a00.rtc: mpc5121_rtc_probe: could not request irq: 0
mpc5121-rtc: probe of 80000a00.rtc failed with error -22
...
[ best viewed with 'git diff -U5' to have DT node names in the context ]
Cc: Anatolij Gustschin <agust@denx.de>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: devicetree@vger.kernel.org
Signed-off-by: Gerhard Sittig <gsi@denx.de>
---
arch/powerpc/boot/dts/mpc5121.dtsi | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/powerpc/boot/dts/mpc5121.dtsi b/arch/powerpc/boot/dts/mpc5121.dtsi
index bd14c00e5146..2d7cb04ac962 100644
--- a/arch/powerpc/boot/dts/mpc5121.dtsi
+++ b/arch/powerpc/boot/dts/mpc5121.dtsi
@@ -75,11 +75,10 @@
soc@80000000 {
compatible = "fsl,mpc5121-immr";
#address-cells = <1>;
#size-cells = <1>;
- #interrupt-cells = <2>;
ranges = <0x0 0x80000000 0x400000>;
reg = <0x80000000 0x400000>;
bus-frequency = <66000000>; /* 66 MHz ips bus */
--
1.7.10.4
^ permalink raw reply related
* [PATCH v2] watchdog: mpc8xxx_wdt convert to watchdog core
From: Christophe Leroy @ 2013-12-03 13:31 UTC (permalink / raw)
To: Wim Van Sebroeck, scottwood, Guenter Roeck
Cc: linuxppc-dev, linux-kernel, linux-watchdog
Convert mpc8xxx_wdt.c to the new watchdog API.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
--- a/drivers/watchdog/mpc8xxx_wdt.c 2013-05-11 22:57:46.000000000 +0200
+++ b/drivers/watchdog/mpc8xxx_wdt.c 2013-11-30 16:14:53.803495472 +0100
@@ -72,53 +72,36 @@
* to 0
*/
static int prescale = 1;
-static unsigned int timeout_sec;
-static unsigned long wdt_is_open;
static DEFINE_SPINLOCK(wdt_spinlock);
-static void mpc8xxx_wdt_keepalive(void)
+static int mpc8xxx_wdt_ping(struct watchdog_device *w)
{
/* Ping the WDT */
spin_lock(&wdt_spinlock);
out_be16(&wd_base->swsrr, 0x556c);
out_be16(&wd_base->swsrr, 0xaa39);
spin_unlock(&wdt_spinlock);
+ return 0;
}
+static struct watchdog_device mpc8xxx_wdt_dev;
static void mpc8xxx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
+static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0,
+ (unsigned long)&mpc8xxx_wdt_dev);
static void mpc8xxx_wdt_timer_ping(unsigned long arg)
{
- mpc8xxx_wdt_keepalive();
- /* We're pinging it twice faster than needed, just to be sure. */
- mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
-}
+ struct watchdog_device *w = (struct watchdog_device *)arg;
-static void mpc8xxx_wdt_pr_warn(const char *msg)
-{
- pr_crit("%s, expect the %s soon!\n", msg,
- reset ? "reset" : "machine check exception");
-}
-
-static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- if (count)
- mpc8xxx_wdt_keepalive();
- return count;
+ mpc8xxx_wdt_ping(w);
+ /* We're pinging it twice faster than needed, just to be sure. */
+ mod_timer(&wdt_timer, jiffies + HZ * w->timeout / 2);
}
-static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_start(struct watchdog_device *w)
{
u32 tmp = SWCRR_SWEN;
- if (test_and_set_bit(0, &wdt_is_open))
- return -EBUSY;
-
- /* Once we start the watchdog we can't stop it */
- if (nowayout)
- __module_get(THIS_MODULE);
/* Good, fire up the show */
if (prescale)
@@ -132,59 +115,31 @@
del_timer_sync(&wdt_timer);
- return nonseekable_open(inode, file);
+ return 0;
}
-static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_stop(struct watchdog_device *w)
{
- if (!nowayout)
- mpc8xxx_wdt_timer_ping(0);
- else
- mpc8xxx_wdt_pr_warn("watchdog closed");
- clear_bit(0, &wdt_is_open);
+ mod_timer(&wdt_timer, jiffies);
return 0;
}
-static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg)
-{
- void __user *argp = (void __user *)arg;
- int __user *p = argp;
- static const struct watchdog_info ident = {
- .options = WDIOF_KEEPALIVEPING,
- .firmware_version = 1,
- .identity = "MPC8xxx",
- };
-
- switch (cmd) {
- case WDIOC_GETSUPPORT:
- return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
- case WDIOC_GETSTATUS:
- case WDIOC_GETBOOTSTATUS:
- return put_user(0, p);
- case WDIOC_KEEPALIVE:
- mpc8xxx_wdt_keepalive();
- return 0;
- case WDIOC_GETTIMEOUT:
- return put_user(timeout_sec, p);
- default:
- return -ENOTTY;
- }
-}
+static struct watchdog_info mpc8xxx_wdt_info = {
+ .options = WDIOF_KEEPALIVEPING,
+ .firmware_version = 1,
+ .identity = "MPC8xxx",
+};
-static const struct file_operations mpc8xxx_wdt_fops = {
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .write = mpc8xxx_wdt_write,
- .unlocked_ioctl = mpc8xxx_wdt_ioctl,
- .open = mpc8xxx_wdt_open,
- .release = mpc8xxx_wdt_release,
+static struct watchdog_ops mpc8xxx_wdt_ops = {
+ .owner = THIS_MODULE,
+ .start = mpc8xxx_wdt_start,
+ .ping = mpc8xxx_wdt_ping,
+ .stop = mpc8xxx_wdt_stop,
};
-static struct miscdevice mpc8xxx_wdt_miscdev = {
- .minor = WATCHDOG_MINOR,
- .name = "watchdog",
- .fops = &mpc8xxx_wdt_fops,
+static struct watchdog_device mpc8xxx_wdt_dev = {
+ .info = &mpc8xxx_wdt_info,
+ .ops = &mpc8xxx_wdt_ops,
};
static const struct of_device_id mpc8xxx_wdt_match[];
@@ -196,6 +151,7 @@
const struct mpc8xxx_wdt_type *wdt_type;
u32 freq = fsl_get_sys_freq();
bool enabled;
+ unsigned int timeout_sec;
match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
if (!match)
@@ -222,6 +178,7 @@
else
timeout_sec = timeout / freq;
+ mpc8xxx_wdt_dev.timeout = timeout_sec;
#ifdef MODULE
ret = mpc8xxx_wdt_init_late();
if (ret)
@@ -237,7 +194,7 @@
* userspace handles it.
*/
if (enabled)
- mpc8xxx_wdt_timer_ping(0);
+ mod_timer(&wdt_timer, jiffies);
return 0;
err_unmap:
iounmap(wd_base);
@@ -247,9 +204,10 @@
static int mpc8xxx_wdt_remove(struct platform_device *ofdev)
{
- mpc8xxx_wdt_pr_warn("watchdog removed");
+ pr_crit("Watchdog removed, expect the %s soon!\n",
+ reset ? "reset" : "machine check exception");
del_timer_sync(&wdt_timer);
- misc_deregister(&mpc8xxx_wdt_miscdev);
+ watchdog_unregister_device(&mpc8xxx_wdt_dev);
iounmap(wd_base);
return 0;
@@ -301,10 +259,11 @@
if (!wd_base)
return -ENODEV;
- ret = misc_register(&mpc8xxx_wdt_miscdev);
+ watchdog_set_nowayout(&mpc8xxx_wdt_dev, nowayout);
+
+ ret = watchdog_register_device(&mpc8xxx_wdt_dev);
if (ret) {
- pr_err("cannot register miscdev on minor=%d (err=%d)\n",
- WATCHDOG_MINOR, ret);
+ pr_err("cannot register watchdog device (err=%d)\n", ret);
return ret;
}
return 0;
diff -ur a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1146,6 +1146,7 @@
config 8xxx_WDT
tristate "MPC8xxx Platform Watchdog Timer"
depends on PPC_8xx || PPC_83xx || PPC_86xx
+ select WATCHDOG_CORE
help
This driver is for a SoC level watchdog that exists on some
Freescale PowerPC processors. So far this driver supports:
^ permalink raw reply
* Re: [PATCH v1 1/1] powerpc/512x: dts: remove misplaced IRQ spec from 'soc' node
From: Anatolij Gustschin @ 2013-12-03 14:04 UTC (permalink / raw)
To: Gerhard Sittig; +Cc: devicetree, linuxppc-dev
In-Reply-To: <1386068212-11484-1-git-send-email-gsi@denx.de>
On Tue, 3 Dec 2013 11:56:52 +0100
Gerhard Sittig <gsi@denx.de> wrote:
> the 'soc' node in the common .dtsi for MPC5121 has an '#interrupt-cells'
> property although this node is not an interrupt controller
>
> remove this erroneously placed property because starting with v3.13-rc1
> lookup and resolution of 'interrupts' specs for peripherals gets misled,
> emits 'no irq domain found' WARN() messages and breaks the boot process
>
> irq: no irq domain found for /soc@80000000 !
> ------------[ cut here ]------------
> WARNING: at /home/gsi/SRC/linux-torvalds/drivers/of/platform.c:171
> Modules linked in:
> CPU: 0 PID: 1 Comm: swapper Tainted: G W 3.13.0-rc1-00001-g8a66234 #8
> task: df823bb0 ti: df834000 task.ti: df834000
> NIP: c02b5190 LR: c02b5180 CTR: c01cf4e0
> REGS: df835c50 TRAP: 0700 Tainted: G W (3.13.0-rc1-00001-g8a66234)
> MSR: 00029032 <EE,ME,IR,DR,RI> CR: 229a9d42 XER: 20000000
>
> GPR00: c02b5180 df835d00 df823bb0 00000000 00000000 df835b18 ffffffff 00000308
> GPR08: c0479cc0 c0480000 c0479cc0 00000308 00000308 00000000 c00040fc 00000000
> GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 df850880
> GPR24: df84d670 00000000 00000001 df8561a0 dffffccc df85089c 00000020 00000001
> NIP [c02b5190] of_device_alloc+0xf4/0x1a0
> LR [c02b5180] of_device_alloc+0xe4/0x1a0
> Call Trace:
> [df835d00] [c02b5180] of_device_alloc+0xe4/0x1a0 (unreliable)
> [df835d50] [c02b5278] of_platform_device_create_pdata+0x3c/0xc8
> [df835d70] [c02b53fc] of_platform_bus_create+0xf8/0x170
> [df835dc0] [c02b5448] of_platform_bus_create+0x144/0x170
> [df835e10] [c02b55a8] of_platform_bus_probe+0x98/0xe8
> [df835e30] [c0437508] mpc512x_init+0x28/0x1c4
> [df835e70] [c0435de8] ppc_init+0x4c/0x60
> [df835e80] [c0003b28] do_one_initcall+0x150/0x1a4
> [df835ef0] [c0432048] kernel_init_freeable+0x114/0x1c0
> [df835f30] [c0004114] kernel_init+0x18/0x124
> [df835f40] [c000e910] ret_from_kernel_thread+0x5c/0x64
> Instruction dump:
> 409effd4 57c9103a 57de2834 7c89f050 7f83e378 7c972214 7f45d378 48001f55
> 7c63d278 7c630034 5463d97e 687a0001 <0f1a0000> 2f990000 387b0010 939b0098
> ---[ end trace 2257f10e5a20cbdd ]---
>
> ...
> irq: no irq domain found for /soc@80000000 !
> fsl-diu-fb 80002100.display: could not get DIU IRQ
> fsl-diu-fb: probe of 80002100.display failed with error -22
> irq: no irq domain found for /soc@80000000 !
> mpc512x_dma 80014000.dma: Error mapping IRQ!
> mpc512x_dma: probe of 80014000.dma failed with error -22
> ...
> irq: no irq domain found for /soc@80000000 !
> fs_enet: probe of 80002800.ethernet failed with error -22
> ...
> irq: no irq domain found for /soc@80000000 !
> mpc5121-rtc 80000a00.rtc: mpc5121_rtc_probe: could not request irq: 0
> mpc5121-rtc: probe of 80000a00.rtc failed with error -22
> ...
>
> [ best viewed with 'git diff -U5' to have DT node names in the context ]
>
> Cc: Anatolij Gustschin <agust@denx.de>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: devicetree@vger.kernel.org
> Signed-off-by: Gerhard Sittig <gsi@denx.de>
> ---
> arch/powerpc/boot/dts/mpc5121.dtsi | 1 -
> 1 file changed, 1 deletion(-)
applied, thanks!
Anatolij
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits
From: Mark Brown @ 2013-12-03 14:58 UTC (permalink / raw)
To: Nicolin Chen; +Cc: alsa-devel, lgirdwood, tiwai, timur, perex, linuxppc-dev
In-Reply-To: <1386067087-12243-1-git-send-email-b42378@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
On Tue, Dec 03, 2013 at 06:38:07PM +0800, Nicolin Chen wrote:
> Since we introduced symmetric_channels and symmetric_samplebits, we implement
> these two features to fsl_ssi so as to drop some no-more-needed code and make
> the driver neat and clean.
Applied, thanks.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* RE: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe devices
From: Varun Sethi @ 2013-12-03 18:15 UTC (permalink / raw)
To: Alex Williamson
Cc: joro@8bytes.org, Stuart Yoder, linux-kernel@vger.kernel.org,
Bharat Bhushan, iommu@lists.linux-foundation.org, Scott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QgcmVseSBvbiB0aGUgZHJpdmVyLA0K
PiBidXQgdGhlbiBtYXliZSB0aGVyZSBzaG91bGQgYmUgYSBwcl9kZWJ1Zy9pbmZvIGhlcmUgdG8g
bm90aWZ5IHRoYXQNCj4gc29tZWJvZHkgbGVmdCB0aGUgZGV2aWNlIHJ1bm5pbmcuICBUaGVyZSBt
aWdodCBhbHNvIGJlIHRoZSBxdWVzdGlvbiBvZg0KPiB3aGV0aGVyIHlvdSBzaG91bGQgdGVzdCB0
aGUgYnVzbWFzdGVyIGJpdCBpbiB0aGUgY29tbWFuZCByZWdpc3RlciByYXRoZXINCj4gdGhhbiB0
cnVzdGluZyB0aGVzZSBpbmRpcmVjdCBwYXRocyBpZiBpdCdzIHJlYWxseSBmb3IgY2xlYW51cC4g
IFRoYW5rcywNCj4gDQpPbmNlIHRoZSBkZXZpY2UgaXMgZGV0YWNoZWQgZnJvbSB0aGUgZG9tYWlu
LCB3ZSBlbmFibGUgYSBkZWZhdWx0IERNQSB3aW5kb3cgZm9yIHRoZSBkZXZpY2UuIEJlZm9yZSBl
bmFibGluZyB0aGUgZGVmYXVsdCB3aW5kb3csIEkgd2FudCB0byBlbnN1cmUgdGhhdCBkZXZpY2Ug
RE1BIGlzIGRpc2FibGVkLiBWRklPIHN1YnN5c3RlbSBoYW5kbGVzIHRoaXMgZm9yIHZmaW8tcGNp
LiBCdXQsIGNhbiB3ZSBhc3N1bWUgdGhhdCB0aGlzIHdvdWxkIGFsd2F5cyBiZSB0aGUgY2FzZT8N
Cg0KLVZhcnVuDQoNCg0K
^ permalink raw reply
* Re: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe devices
From: Alex Williamson @ 2013-12-03 18:34 UTC (permalink / raw)
To: Varun Sethi
Cc: joro@8bytes.org, Stuart Yoder, linux-kernel@vger.kernel.org,
Bharat Bhushan, iommu@lists.linux-foundation.org, Scott Wood,
linuxppc-dev@lists.ozlabs.org
In-Reply-To: <C5ECD7A89D1DC44195F34B25E172658D0A606B8F@039-SN2MPN1-011.039d.mgd.msft.net>
On Tue, 2013-12-03 at 18:15 +0000, Varun Sethi wrote:
>
> > -----Original Message-----
> > From: Alex Williamson [mailto:alex.williamson@redhat.com]
> > Sent: Tuesday, December 03, 2013 3:04 AM
> > To: Sethi Varun-B16395
> > Cc: joro@8bytes.org; iommu@lists.linux-foundation.org; linuxppc-
> > dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Yoder Stuart-B08248;
> > Wood Scott-B07421; Bhushan Bharat-R65777
> > Subject: Re: [PATCH 2/3 v2] iommu/fsl: Enable default DMA window for PCIe
> > devices
> >
> > On Wed, 2013-10-16 at 16:53 +0530, Varun Sethi wrote:
> > > Once the PCIe device assigned to a guest VM (via VFIO) gets detached
> > > from the iommu domain (when guest terminates), its PAMU table entry is
> > > disabled. So, this would prevent the device from being used once it's
> > assigned back to the host.
> > >
> > > This patch allows for creation of a default DMA window corresponding
> > > to the device and subsequently enabling the PAMU table entry. Before
> > > we enable the entry, we ensure that the device's bus master capability
> > is disabled (device quiesced).
> > >
> > > Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
> > > ---
> > > drivers/iommu/fsl_pamu.c | 43 ++++++++++++++++++++++++++++---
> > -----
> > > drivers/iommu/fsl_pamu.h | 1 +
> > > drivers/iommu/fsl_pamu_domain.c | 46
> > ++++++++++++++++++++++++++++++++++++---
> > > 3 files changed, 78 insertions(+), 12 deletions(-)
> > >
> > > diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c index
> > > cba0498..fb4a031 100644
> > > --- a/drivers/iommu/fsl_pamu.c
> > > +++ b/drivers/iommu/fsl_pamu.c
> > > @@ -225,6 +225,21 @@ static struct paace *pamu_get_spaace(struct paace
> > *paace, u32 wnum)
> > > return spaace;
> > > }
> > >
> > > +/*
> > > + * Defaul PPAACE settings for an LIODN.
> > > + */
> > > +static void setup_default_ppaace(struct paace *ppaace) {
> > > + pamu_init_ppaace(ppaace);
> > > + /* window size is 2^(WSE+1) bytes */
> > > + set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
> > > + ppaace->wbah = 0;
> > > + set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
> > > + set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> > > + PAACE_ATM_NO_XLATE);
> > > + set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> > > + PAACE_AP_PERMS_ALL);
> > > +}
> > > /**
> > > * pamu_get_fspi_and_allocate() - Allocates fspi index and reserves
> > subwindows
> > > * required for primary PAACE in the
> > secondary
> > > @@ -253,6 +268,24 @@ static unsigned long
> > pamu_get_fspi_and_allocate(u32 subwin_cnt)
> > > return (spaace_addr - (unsigned long)spaact) / (sizeof(struct
> > > paace)); }
> > >
> > > +/* Reset the PAACE entry to the default state */ void
> > > +enable_default_dma_window(int liodn) {
> > > + struct paace *ppaace;
> > > +
> > > + ppaace = pamu_get_ppaace(liodn);
> > > + if (!ppaace) {
> > > + pr_debug("Invalid liodn entry\n");
> > > + return;
> > > + }
> > > +
> > > + memset(ppaace, 0, sizeof(struct paace));
> > > +
> > > + setup_default_ppaace(ppaace);
> > > + mb();
> > > + pamu_enable_liodn(liodn);
> > > +}
> > > +
> > > /* Release the subwindows reserved for a particular LIODN */ void
> > > pamu_free_subwins(int liodn) { @@ -752,15 +785,7 @@ static void
> > > __init setup_liodns(void)
> > > continue;
> > > }
> > > ppaace = pamu_get_ppaace(liodn);
> > > - pamu_init_ppaace(ppaace);
> > > - /* window size is 2^(WSE+1) bytes */
> > > - set_bf(ppaace->addr_bitfields, PPAACE_AF_WSE, 35);
> > > - ppaace->wbah = 0;
> > > - set_bf(ppaace->addr_bitfields, PPAACE_AF_WBAL, 0);
> > > - set_bf(ppaace->impl_attr, PAACE_IA_ATM,
> > > - PAACE_ATM_NO_XLATE);
> > > - set_bf(ppaace->addr_bitfields, PAACE_AF_AP,
> > > - PAACE_AP_PERMS_ALL);
> > > + setup_default_ppaace(ppaace);
> > > if (of_device_is_compatible(node, "fsl,qman-portal"))
> > > setup_qbman_paace(ppaace, QMAN_PORTAL_PAACE);
> > > if (of_device_is_compatible(node, "fsl,qman")) diff --
> > git
> > > a/drivers/iommu/fsl_pamu.h b/drivers/iommu/fsl_pamu.h index
> > > 8fc1a12..0edcbbbb 100644
> > > --- a/drivers/iommu/fsl_pamu.h
> > > +++ b/drivers/iommu/fsl_pamu.h
> > > @@ -406,5 +406,6 @@ void get_ome_index(u32 *omi_index, struct device
> > > *dev); int pamu_update_paace_stash(int liodn, u32 subwin, u32
> > > value); int pamu_disable_spaace(int liodn, u32 subwin);
> > > u32 pamu_get_max_subwin_cnt(void);
> > > +void enable_default_dma_window(int liodn);
> > >
> > > #endif /* __FSL_PAMU_H */
> > > diff --git a/drivers/iommu/fsl_pamu_domain.c
> > > b/drivers/iommu/fsl_pamu_domain.c index 966ae70..dd6cafc 100644
> > > --- a/drivers/iommu/fsl_pamu_domain.c
> > > +++ b/drivers/iommu/fsl_pamu_domain.c
> > > @@ -340,17 +340,57 @@ static inline struct device_domain_info
> > *find_domain(struct device *dev)
> > > return dev->archdata.iommu_domain;
> > > }
> > >
> > > +/* Disable device DMA capability and enable default DMA window */
> > > +static void disable_device_dma(struct device_domain_info *info,
> > > + int enable_dma_window)
> >
> > nit, bool?
> >
> > > +{
> > > +#ifdef CONFIG_PCI
> > > + if (info->dev->bus == &pci_bus_type) {
> > > + struct pci_dev *pdev = NULL;
> >
> > nit, unnecessary initialization
> >
> > > + pdev = to_pci_dev(info->dev);
> > > + if (pci_is_enabled(pdev))
> > > + pci_disable_device(pdev);
> >
> > This looks suspicious. What's the case where you're finding devices
> > where this is needed? Logically the driver that called
> > pci_enable_device() should also call pci_disabled_device() when it's
> > done. Maybe there's a case to be made that we can't rely on the driver,
> > but then maybe there should be a pr_debug/info here to notify that
> > somebody left the device running. There might also be the question of
> > whether you should test the busmaster bit in the command register rather
> > than trusting these indirect paths if it's really for cleanup. Thanks,
> >
> Once the device is detached from the domain, we enable a default DMA
> window for the device. Before enabling the default window, I want to
> ensure that device DMA is disabled. VFIO subsystem handles this for
> vfio-pci. But, can we assume that this would always be the case?
That's what I'm asking. It seems like pci_enable/disable_device is part
of the driver API and every enable should have a matching disable. If
this is to catch cases where the disable never happened, then there
should be some indication that the previous driver did something wrong
and we should have some sort of printed warning. Then there's also the
question of whether this fully does what you want it to. This is an
indirect way of checking the busmaster bit in the command register. If
you really want to make sure it's disabled, is it sufficient or should
we be reading the actual command register? Thanks,
Alex
^ permalink raw reply
* Re: Build regressions/improvements in v3.13-rc2
From: Guenter Roeck @ 2013-12-03 20:45 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: sparclinux, linux-xtensa@linux-xtensa.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Linux-sh list
In-Reply-To: <CAMuHMdV1hoUnYixPghCAy-LuTaB9JU-BFfBPH06gxhLRAqfp8Q@mail.gmail.com>
On Sun, Dec 01, 2013 at 10:50:16AM +0100, Geert Uytterhoeven wrote:
> On Sun, Dec 1, 2013 at 10:44 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > JFYI, when comparing v3.13-rc2[1] to v3.13-rc1[3], the summaries are:
> > - build errors: +8/-8
> > - build warnings: +147/-97
>
> + /scratch/kisskb/src/drivers/crypto/caam/jr.c: error: implicit
> declaration of function 'of_iomap'
> [-Werror=implicit-function-declaration]: => 468:2
>
> powerpc/mpc85xx_defconfig
>
> + /scratch/kisskb/src/arch/powerpc/kernel/swsusp_booke.S: Error:
> invalid sprg number: => 161, 85, 165, 91, 167, 163, 87, 89
>
> powerpc-randconfig
>
> + /scratch/kisskb/src/drivers/tty/ehv_bytechan.c: error: type
> defaults to 'int' in declaration of 'console_initcall'
> [-Werror=implicit-int]: => 363:1
>
> powerpc-allmodconfig
>
> + /scratch/kisskb/src/arch/sparc/kernel/kgdb_64.c: error: implicit
> declaration of function 'exception_enter'
> [-Werror=implicit-function-declaration]: => 162:7
> + /scratch/kisskb/src/arch/sparc/kernel/kgdb_64.c: error: implicit
> declaration of function 'exception_exit'
> [-Werror=implicit-function-declaration]: => 176:2
>
> sparc64-allmodconfig
>
> + error: drivers/built-in.o: undefined reference to
> `i2c_register_driver': => .init.literal+0xd88)
> + error: sram.c: undefined reference to `devm_regmap_init_i2c': =>
> .text+0x590dc)
>
> sparc-allmodconfig
> xtensa-allmodconfig
>
> + /scratch/kisskb/src/drivers/gpu/drm/drm_gem_cma_helper.c: error:
> implicit declaration of function 'dma_alloc_writecombine'
> [-Werror=implicit-function-declaration]: => 91:2
> + /scratch/kisskb/src/drivers/gpu/drm/drm_gem_cma_helper.c: error:
> implicit declaration of function 'dma_free_writecombine'
> [-Werror=implicit-function-declaration]: => 176:3
>
> sh-randconfig
>
> > [1] http://kisskb.ellerman.id.au/kisskb/head/6939/ (119 out of 120 configs)
> > [3] http://kisskb.ellerman.id.au/kisskb/head/6919/ (119 out of 120 configs)
>
Also:
ia64-defconfig:
arch/ia64/kernel/built-in.o: In function `skip_rbs_switch':
(.text+0xef2): undefined reference to `preempt_schedule_irq'
arm-allmodconfig:
drivers/isdn/hisax/telespci.c: In function 'setup_telespci':
drivers/isdn/hisax/telespci.c:294:2: error: #error "not running on big endian machines now"
mips64 (out of tree 64 bit configuration with MIPS32_O32 not set):
arch/mips/include/asm/syscall.h: In function 'mips_get_syscall_arg':
arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp' [-Werror=unused-variable]
Guenter
^ permalink raw reply
* Re: Build regressions/improvements in v3.13-rc2
From: Geert Uytterhoeven @ 2013-12-03 21:01 UTC (permalink / raw)
To: Guenter Roeck
Cc: sparclinux, linux-xtensa@linux-xtensa.org,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Linux-sh list
In-Reply-To: <20131203204540.GA4796@roeck-us.net>
On Tue, Dec 3, 2013 at 9:45 PM, Guenter Roeck <linux@roeck-us.net> wrote:
> ia64-defconfig:
>
> arch/ia64/kernel/built-in.o: In function `skip_rbs_switch':
> (.text+0xef2): undefined reference to `preempt_schedule_irq'
Funny, that one was actually introduced in v3.13-rc1, but it fell through
the cracks of the regex handling in my script.
BTW, my scripts are back online: https://github.com/geertu/linux-scripts.
linux-log-diff didn't see the ia64 breakage, linux-log-summary did.
One day I plan to merge linux-log-diff and linux-log-summary, so I have
to maintain only one regex chain.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH v4 1/1] powerpc/embedded6xx: Add support for Motorola/Emerson MVME5100
From: Stephen Chivers @ 2013-12-03 22:00 UTC (permalink / raw)
To: benh; +Cc: schivers, linuxppc-dev, cproctor
Add support for the Motorola/Emerson MVME5100 Single Board Computer.
The MVME5100 is a 6U form factor VME64 computer with:
- A single MPC7410 or MPC750 CPU
- A HAWK Processor Host Bridge (CPU to PCI) and
MultiProcessor Interrupt Controller (MPIC)
- Up to 500Mb of onboard memory
- A M48T37 Real Time Clock (RTC) and Non-Volatile Memory chip
- Two 16550 compatible UARTS
- Two Intel E100 Fast Ethernets
- Two PCI Mezzanine Card (PMC) Slots
- PPCBug Firmware
The HAWK PHB/MPIC is compatible with the MPC10x devices.
There is no onboard disk support. This is usually provided by installing a PMC
in first PMC slot.
This patch revives the board support, it was present in early 2.6
series kernels. The board support in those days was by Matt Porter of
MontaVista Software.
CSC Australia has around 31 of these boards in service. The kernel in use
for the boards is based on 2.6.31. The boards are operated without disks
from a file server.
This patch is based on linux-3.13-rc2 and has been boot tested.
Only boards with 512 Mb of memory are known to work.
V1->V2:
Address comments by Kular Gama and Scott Wood.
Minor adjustment to platforms/embedded6xx/Kconfig to ensure
correct indentation where possible.
V2->V3:
Address comments by Scott Wood and Ben Herrenschmidt.
Address errors reported by checkpatch.
V3->V4:
Address comment by Geert Uytterhoeven
Add tested by Alessio Bogani.
Signed-off-by: Stephen Chivers <schivers@csc.com>
Tested-by: Alessio Igor Bogani <alessio.bogani@elettra.eu>
---
arch/powerpc/boot/Makefile | 3 +-
arch/powerpc/boot/dts/mvme5100.dts | 185 +++++++++++++++++++++
arch/powerpc/boot/mvme5100.c | 27 +++
arch/powerpc/boot/wrapper | 4 +
arch/powerpc/configs/mvme5100_defconfig | 144 ++++++++++++++++
arch/powerpc/platforms/embedded6xx/Kconfig | 13 ++-
arch/powerpc/platforms/embedded6xx/Makefile | 1 +
arch/powerpc/platforms/embedded6xx/mvme5100.c | 221 +++++++++++++++++++++++++
8 files changed, 596 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index ca7f08c..cd9ea99 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -95,7 +95,7 @@ src-plat-$(CONFIG_FSL_SOC_BOOKE) += cuboot-85xx.c cuboot-85xx-cpm2.c
src-plat-$(CONFIG_EMBEDDED6xx) += cuboot-pq2.c cuboot-mpc7448hpc2.c \
cuboot-c2k.c gamecube-head.S \
gamecube.c wii-head.S wii.c holly.c \
- prpmc2800.c
+ prpmc2800.c fixed-head.S mvme5100.c
src-plat-$(CONFIG_AMIGAONE) += cuboot-amigaone.c
src-plat-$(CONFIG_PPC_PS3) += ps3-head.S ps3-hvcall.S ps3.c
src-plat-$(CONFIG_EPAPR_BOOT) += epapr.c epapr-wrapper.c
@@ -286,6 +286,7 @@ image-$(CONFIG_MPC7448HPC2) += cuImage.mpc7448hpc2
image-$(CONFIG_PPC_C2K) += cuImage.c2k
image-$(CONFIG_GAMECUBE) += dtbImage.gamecube
image-$(CONFIG_WII) += dtbImage.wii
+image-$(CONFIG_MVME5100) += dtbImage.mvme5100
# Board port in arch/powerpc/platform/amigaone/Kconfig
image-$(CONFIG_AMIGAONE) += cuImage.amigaone
diff --git a/arch/powerpc/boot/dts/mvme5100.dts b/arch/powerpc/boot/dts/mvme5100.dts
new file mode 100644
index 0000000..1ecb341
--- /dev/null
+++ b/arch/powerpc/boot/dts/mvme5100.dts
@@ -0,0 +1,185 @@
+/*
+ * Device Tree Source for Motorola/Emerson MVME5100.
+ *
+ * Copyright 2013 CSC Australia Pty. Ltd.
+ *
+ * This file is licensed under the terms of the GNU General Public
+ * License version 2. This program is licensed "as is" without
+ * any warranty of any kind, whether express or implied.
+ */
+
+/dts-v1/;
+
+/ {
+ model = "MVME5100";
+ compatible = "MVME5100";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ aliases {
+ serial0 = &serial0;
+ pci0 = &pci0;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ PowerPC,7410 {
+ device_type = "cpu";
+ reg = <0x0>;
+ /* Following required by dtc but not used */
+ d-cache-line-size = <32>;
+ i-cache-line-size = <32>;
+ i-cache-size = <32768>;
+ d-cache-size = <32768>;
+ timebase-frequency = <25000000>;
+ clock-frequency = <500000000>;
+ bus-frequency = <100000000>;
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x0 0x20000000>;
+ };
+
+ hawk@fef80000 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "hawk-bridge", "simple-bus";
+ ranges = <0x0 0xfef80000 0x10000>;
+ reg = <0xfef80000 0x10000>;
+
+ serial0: serial@8000 {
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <0x8000 0x80>;
+ reg-shift = <4>;
+ clock-frequency = <1843200>;
+ current-speed = <9600>;
+ interrupts = <1 1>; // IRQ1 Level Active Low.
+ interrupt-parent = <&mpic>;
+ };
+
+ serial1: serial@8200 {
+ device_type = "serial";
+ compatible = "ns16550";
+ reg = <0x8200 0x80>;
+ reg-shift = <4>;
+ clock-frequency = <1843200>;
+ current-speed = <9600>;
+ interrupts = <1 1>; // IRQ1 Level Active Low.
+ interrupt-parent = <&mpic>;
+ };
+
+ mpic: interrupt-controller@f3f80000 {
+ #interrupt-cells = <2>;
+ #address-cells = <0>;
+ device_type = "open-pic";
+ compatible = "chrp,open-pic";
+ interrupt-controller;
+ reg = <0xf3f80000 0x40000>;
+ };
+ };
+
+ pci0: pci@feff0000 {
+ #address-cells = <3>;
+ #size-cells = <2>;
+ #interrupt-cells = <1>;
+ device_type = "pci";
+ compatible = "hawk-pci";
+ reg = <0xfec00000 0x400000>;
+ 8259-interrupt-acknowledge = <0xfeff0030>;
+ ranges = <0x1000000 0x0 0x0 0xfe000000 0x0 0x800000
+ 0x2000000 0x0 0x80000000 0x80000000 0x0 0x74000000>;
+ bus-range = <0 255>;
+ clock-frequency = <33333333>;
+ interrupt-parent = <&mpic>;
+ interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
+ interrupt-map = <
+
+ /*
+ * This definition (IDSEL 11) duplicates the
+ * interrupts definition in the i8259
+ * interrupt controller below.
+ *
+ * Do not change the interrupt sense/polarity from
+ * 0x2 to anything else, doing so will cause endless
+ * "spurious" i8259 interrupts to be fielded.
+ */
+ // IDSEL 11 - iPMC712 PCI/ISA Bridge
+ 0x5800 0x0 0x0 0x1 &mpic 0x0 0x2
+ 0x5800 0x0 0x0 0x2 &mpic 0x0 0x2
+ 0x5800 0x0 0x0 0x3 &mpic 0x0 0x2
+ 0x5800 0x0 0x0 0x4 &mpic 0x0 0x2
+
+ /* IDSEL 12 - Not Used */
+
+ /* IDSEL 13 - Universe VME Bridge */
+ 0x6800 0x0 0x0 0x1 &mpic 0x5 0x1
+ 0x6800 0x0 0x0 0x2 &mpic 0x6 0x1
+ 0x6800 0x0 0x0 0x3 &mpic 0x7 0x1
+ 0x6800 0x0 0x0 0x4 &mpic 0x8 0x1
+
+ /* IDSEL 14 - ENET 1 */
+ 0x7000 0x0 0x0 0x1 &mpic 0x2 0x1
+
+ /* IDSEL 15 - Not Used */
+
+ /* IDSEL 16 - PMC Slot 1 */
+ 0x8000 0x0 0x0 0x1 &mpic 0x9 0x1
+ 0x8000 0x0 0x0 0x2 &mpic 0xa 0x1
+ 0x8000 0x0 0x0 0x3 &mpic 0xb 0x1
+ 0x8000 0x0 0x0 0x4 &mpic 0xc 0x1
+
+ /* IDSEL 17 - PMC Slot 2 */
+ 0x8800 0x0 0x0 0x1 &mpic 0xc 0x1
+ 0x8800 0x0 0x0 0x2 &mpic 0x9 0x1
+ 0x8800 0x0 0x0 0x3 &mpic 0xa 0x1
+ 0x8800 0x0 0x0 0x4 &mpic 0xb 0x1
+
+ /* IDSEL 18 - Not Used */
+
+ /* IDSEL 19 - ENET 2 */
+ 0x9800 0x0 0x0 0x1 &mpic 0xd 0x1
+
+ /* IDSEL 20 - PMCSPAN (PCI-X) */
+ 0xa000 0x0 0x0 0x1 &mpic 0x9 0x1
+ 0xa000 0x0 0x0 0x2 &mpic 0xa 0x1
+ 0xa000 0x0 0x0 0x3 &mpic 0xb 0x1
+ 0xa000 0x0 0x0 0x4 &mpic 0xc 0x1
+
+ >;
+
+ isa {
+ #address-cells = <2>;
+ #size-cells = <1>;
+ #interrupt-cells = <2>;
+ device_type = "isa";
+ compatible = "isa";
+ ranges = <0x00000001 0 0x01000000 0 0x00000000 0x00001000>;
+ interrupt-parent = <&i8259>;
+
+ i8259: interrupt-controller@20 {
+ #interrupt-cells = <2>;
+ #address-cells = <0>;
+ interrupts = <0 2>;
+ device_type = "interrupt-controller";
+ compatible = "chrp,iic";
+ interrupt-controller;
+ reg = <1 0x00000020 0x00000002
+ 1 0x000000a0 0x00000002
+ 1 0x000004d0 0x00000002>;
+ interrupt-parent = <&mpic>;
+ };
+
+ };
+
+ };
+
+ chosen {
+ linux,stdout-path = &serial0;
+ };
+
+};
diff --git a/arch/powerpc/boot/mvme5100.c b/arch/powerpc/boot/mvme5100.c
new file mode 100644
index 0000000..cb865f8
--- /dev/null
+++ b/arch/powerpc/boot/mvme5100.c
@@ -0,0 +1,27 @@
+/*
+ * Motorola/Emerson MVME5100 with PPCBug firmware.
+ *
+ * Author: Stephen Chivers <schivers@csc.com>
+ *
+ * Copyright 2013 CSC Australia Pty. Ltd.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ */
+#include "types.h"
+#include "ops.h"
+#include "io.h"
+
+BSS_STACK(4096);
+
+void platform_init(unsigned long r3, unsigned long r4, unsigned long r5)
+{
+ u32 heapsize;
+
+ heapsize = 0x8000000 - (u32)_end; /* 128M */
+ simple_alloc_init(_end, heapsize, 32, 64);
+ fdt_init(_dtb_start);
+ serial_console_init();
+}
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 2e1af74..d27a255 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -265,6 +265,10 @@ epapr)
link_address='0x20000000'
pie=-pie
;;
+mvme5100)
+ platformo="$object/fixed-head.o $object/mvme5100.o"
+ binary=y
+ ;;
esac
vmz="$tmpdir/`basename \"$kernel\"`.$ext"
diff --git a/arch/powerpc/configs/mvme5100_defconfig b/arch/powerpc/configs/mvme5100_defconfig
new file mode 100644
index 0000000..93c7752
--- /dev/null
+++ b/arch/powerpc/configs/mvme5100_defconfig
@@ -0,0 +1,144 @@
+CONFIG_SYSVIPC=y
+CONFIG_POSIX_MQUEUE=y
+CONFIG_NO_HZ=y
+CONFIG_HIGH_RES_TIMERS=y
+CONFIG_IKCONFIG=y
+CONFIG_IKCONFIG_PROC=y
+CONFIG_LOG_BUF_SHIFT=14
+# CONFIG_UTS_NS is not set
+# CONFIG_IPC_NS is not set
+# CONFIG_PID_NS is not set
+# CONFIG_NET_NS is not set
+CONFIG_CC_OPTIMIZE_FOR_SIZE=y
+# CONFIG_COMPAT_BRK is not set
+CONFIG_MODULES=y
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_BLK_DEV_BSG is not set
+# CONFIG_PPC_CHRP is not set
+# CONFIG_PPC_PMAC is not set
+CONFIG_EMBEDDED6xx=y
+CONFIG_MVME5100=y
+CONFIG_KVM_GUEST=y
+CONFIG_HZ_100=y
+# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
+# CONFIG_COMPACTION is not set
+CONFIG_CMDLINE_BOOL=y
+CONFIG_CMDLINE="console=ttyS0,9600 ip=dhcp root=/dev/nfs"
+CONFIG_NET=y
+CONFIG_PACKET=y
+CONFIG_UNIX=y
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_INET_LRO is not set
+# CONFIG_IPV6 is not set
+CONFIG_NETFILTER=y
+CONFIG_NF_CONNTRACK=m
+CONFIG_NF_CT_PROTO_SCTP=m
+CONFIG_NF_CONNTRACK_AMANDA=m
+CONFIG_NF_CONNTRACK_FTP=m
+CONFIG_NF_CONNTRACK_H323=m
+CONFIG_NF_CONNTRACK_IRC=m
+CONFIG_NF_CONNTRACK_NETBIOS_NS=m
+CONFIG_NF_CONNTRACK_PPTP=m
+CONFIG_NF_CONNTRACK_SIP=m
+CONFIG_NF_CONNTRACK_TFTP=m
+CONFIG_NETFILTER_XT_MATCH_MAC=m
+CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
+CONFIG_NETFILTER_XT_MATCH_STATE=m
+CONFIG_NF_CONNTRACK_IPV4=m
+CONFIG_IP_NF_IPTABLES=m
+CONFIG_IP_NF_FILTER=m
+CONFIG_IP_NF_TARGET_REJECT=m
+CONFIG_IP_NF_MANGLE=m
+CONFIG_IP_NF_TARGET_ECN=m
+CONFIG_IP_NF_TARGET_TTL=m
+CONFIG_IP_NF_RAW=m
+CONFIG_IP_NF_ARPTABLES=m
+CONFIG_IP_NF_ARPFILTER=m
+CONFIG_IP_NF_ARP_MANGLE=m
+CONFIG_LAPB=m
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+CONFIG_PROC_DEVICETREE=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=2
+CONFIG_BLK_DEV_RAM_SIZE=8192
+CONFIG_EEPROM_LEGACY=m
+CONFIG_NETDEVICES=y
+CONFIG_TUN=m
+# CONFIG_NET_VENDOR_3COM is not set
+CONFIG_E100=y
+# CONFIG_WLAN is not set
+# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
+# CONFIG_INPUT_KEYBOARD is not set
+# CONFIG_INPUT_MOUSE is not set
+# CONFIG_SERIO is not set
+CONFIG_SERIAL_8250=y
+CONFIG_SERIAL_8250_CONSOLE=y
+CONFIG_SERIAL_8250_NR_UARTS=10
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_MANY_PORTS=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_HW_RANDOM=y
+CONFIG_I2C=y
+CONFIG_I2C_CHARDEV=y
+CONFIG_I2C_MPC=y
+# CONFIG_HWMON is not set
+CONFIG_VIDEO_OUTPUT_CONTROL=m
+# CONFIG_VGA_CONSOLE is not set
+# CONFIG_HID is not set
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_IOMMU_SUPPORT is not set
+CONFIG_VME_BUS=m
+CONFIG_VME_CA91CX42=m
+CONFIG_EXT2_FS=m
+CONFIG_EXT3_FS=m
+# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set
+CONFIG_XFS_FS=m
+CONFIG_ISO9660_FS=m
+CONFIG_JOLIET=y
+CONFIG_ZISOFS=y
+CONFIG_UDF_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_VFAT_FS=m
+CONFIG_PROC_KCORE=y
+CONFIG_TMPFS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=m
+CONFIG_NFSD_V3=y
+CONFIG_CIFS=m
+CONFIG_NLS=y
+CONFIG_NLS_CODEPAGE_437=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_ISO8859_1=m
+CONFIG_NLS_UTF8=m
+CONFIG_CRC_CCITT=m
+CONFIG_CRC_T10DIF=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_MAGIC_SYSRQ=y
+CONFIG_DEBUG_KERNEL=y
+CONFIG_DETECT_HUNG_TASK=y
+CONFIG_DEFAULT_HUNG_TASK_TIMEOUT=20
+CONFIG_CRYPTO_CBC=y
+CONFIG_CRYPTO_PCBC=m
+CONFIG_CRYPTO_MD5=y
+CONFIG_CRYPTO_MICHAEL_MIC=m
+CONFIG_CRYPTO_SHA1=m
+CONFIG_CRYPTO_BLOWFISH=m
+CONFIG_CRYPTO_DES=y
+CONFIG_CRYPTO_SERPENT=m
+CONFIG_CRYPTO_TWOFISH=m
+CONFIG_CRYPTO_DEFLATE=m
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
diff --git a/arch/powerpc/platforms/embedded6xx/Kconfig b/arch/powerpc/platforms/embedded6xx/Kconfig
index 302ba43..6d3c7a9 100644
--- a/arch/powerpc/platforms/embedded6xx/Kconfig
+++ b/arch/powerpc/platforms/embedded6xx/Kconfig
@@ -67,6 +67,18 @@ config PPC_C2K
This option enables support for the GE Fanuc C2K board (formerly
an SBS board).
+config MVME5100
+ bool "Motorola/Emerson MVME5100"
+ depends on EMBEDDED6xx
+ select MPIC
+ select PCI
+ select PPC_INDIRECT_PCI
+ select PPC_I8259
+ select PPC_NATIVE
+ help
+ This option enables support for the Motorola (now Emerson) MVME5100
+ board.
+
config TSI108_BRIDGE
bool
select PCI
@@ -113,4 +125,3 @@ config WII
help
Select WII if configuring for the Nintendo Wii.
More information at: <http://gc-linux.sourceforge.net/>
-
diff --git a/arch/powerpc/platforms/embedded6xx/Makefile b/arch/powerpc/platforms/embedded6xx/Makefile
index 66c23e4..cdd48d4 100644
--- a/arch/powerpc/platforms/embedded6xx/Makefile
+++ b/arch/powerpc/platforms/embedded6xx/Makefile
@@ -11,3 +11,4 @@ obj-$(CONFIG_USBGECKO_UDBG) += usbgecko_udbg.o
obj-$(CONFIG_GAMECUBE_COMMON) += flipper-pic.o
obj-$(CONFIG_GAMECUBE) += gamecube.o
obj-$(CONFIG_WII) += wii.o hlwd-pic.o
+obj-$(CONFIG_MVME5100) += mvme5100.o
diff --git a/arch/powerpc/platforms/embedded6xx/mvme5100.c b/arch/powerpc/platforms/embedded6xx/mvme5100.c
new file mode 100644
index 0000000..25e3bfb
--- /dev/null
+++ b/arch/powerpc/platforms/embedded6xx/mvme5100.c
@@ -0,0 +1,221 @@
+/*
+ * Board setup routines for the Motorola/Emerson MVME5100.
+ *
+ * Copyright 2013 CSC Australia Pty. Ltd.
+ *
+ * Based on earlier code by:
+ *
+ * Matt Porter, MontaVista Software Inc.
+ * Copyright 2001 MontaVista Software Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * Author: Stephen Chivers <schivers@csc.com>
+ *
+ */
+
+#include <linux/of_platform.h>
+
+#include <asm/i8259.h>
+#include <asm/pci-bridge.h>
+#include <asm/mpic.h>
+#include <asm/prom.h>
+#include <mm/mmu_decl.h>
+#include <asm/udbg.h>
+
+#define HAWK_MPIC_SIZE 0x00040000U
+#define MVME5100_PCI_MEM_OFFSET 0x00000000
+
+/* Board register addresses. */
+#define BOARD_STATUS_REG 0xfef88080
+#define BOARD_MODFAIL_REG 0xfef88090
+#define BOARD_MODRST_REG 0xfef880a0
+#define BOARD_TBEN_REG 0xfef880c0
+#define BOARD_SW_READ_REG 0xfef880e0
+#define BOARD_GEO_ADDR_REG 0xfef880e8
+#define BOARD_EXT_FEATURE1_REG 0xfef880f0
+#define BOARD_EXT_FEATURE2_REG 0xfef88100
+
+static phys_addr_t pci_membase;
+static u_char *restart;
+
+static void mvme5100_8259_cascade(unsigned int irq, struct irq_desc *desc)
+{
+ struct irq_chip *chip = irq_desc_get_chip(desc);
+ unsigned int cascade_irq = i8259_irq();
+
+ if (cascade_irq != NO_IRQ)
+ generic_handle_irq(cascade_irq);
+
+ chip->irq_eoi(&desc->irq_data);
+}
+
+static void __init mvme5100_pic_init(void)
+{
+ struct mpic *mpic;
+ struct device_node *np;
+ struct device_node *cp = NULL;
+ unsigned int cirq;
+ unsigned long intack = 0;
+ const u32 *prop = NULL;
+
+ np = of_find_node_by_type(NULL, "open-pic");
+ if (!np) {
+ pr_err("Could not find open-pic node\n");
+ return;
+ }
+
+ mpic = mpic_alloc(np, pci_membase, 0, 16, 256, " OpenPIC ");
+
+ BUG_ON(mpic == NULL);
+ of_node_put(np);
+
+ mpic_assign_isu(mpic, 0, pci_membase + 0x10000);
+
+ mpic_init(mpic);
+
+ cp = of_find_compatible_node(NULL, NULL, "chrp,iic");
+ if (cp == NULL) {
+ pr_warn("mvme5100_pic_init: couldn't find i8259\n");
+ return;
+ }
+
+ cirq = irq_of_parse_and_map(cp, 0);
+ if (cirq == NO_IRQ) {
+ pr_warn("mvme5100_pic_init: no cascade interrupt?\n");
+ return;
+ }
+
+ np = of_find_compatible_node(NULL, "pci", "mpc10x-pci");
+ if (np) {
+ prop = of_get_property(np, "8259-interrupt-acknowledge", NULL);
+
+ if (prop)
+ intack = prop[0];
+
+ of_node_put(np);
+ }
+
+ if (intack)
+ pr_debug("mvme5100_pic_init: PCI 8259 intack at 0x%016lx\n",
+ intack);
+
+ i8259_init(cp, intack);
+ of_node_put(cp);
+ irq_set_chained_handler(cirq, mvme5100_8259_cascade);
+}
+
+static int __init mvme5100_add_bridge(struct device_node *dev)
+{
+ const int *bus_range;
+ int len;
+ struct pci_controller *hose;
+ unsigned short devid;
+
+ pr_info("Adding PCI host bridge %s\n", dev->full_name);
+
+ bus_range = of_get_property(dev, "bus-range", &len);
+
+ hose = pcibios_alloc_controller(dev);
+ if (hose == NULL)
+ return -ENOMEM;
+
+ hose->first_busno = bus_range ? bus_range[0] : 0;
+ hose->last_busno = bus_range ? bus_range[1] : 0xff;
+
+ setup_indirect_pci(hose, 0xfe000cf8, 0xfe000cfc, 0);
+
+ pci_process_bridge_OF_ranges(hose, dev, 1);
+
+ early_read_config_word(hose, 0, 0, PCI_DEVICE_ID, &devid);
+
+ if (devid != PCI_DEVICE_ID_MOTOROLA_HAWK) {
+ pr_err("HAWK PHB not present?\n");
+ return 0;
+ }
+
+ early_read_config_dword(hose, 0, 0, PCI_BASE_ADDRESS_1, &pci_membase);
+
+ if (pci_membase == 0) {
+ pr_err("HAWK PHB mibar not correctly set?\n");
+ return 0;
+ }
+
+ pr_info("mvme5100_pic_init: pci_membase: %x\n", pci_membase);
+
+ return 0;
+}
+
+static struct of_device_id mvme5100_of_bus_ids[] __initdata = {
+ { .compatible = "hawk-bridge", },
+ {},
+};
+
+/*
+ * Setup the architecture
+ */
+static void __init mvme5100_setup_arch(void)
+{
+ struct device_node *np;
+
+ if (ppc_md.progress)
+ ppc_md.progress("mvme5100_setup_arch()", 0);
+
+ for_each_compatible_node(np, "pci", "hawk-pci")
+ mvme5100_add_bridge(np);
+
+ restart = ioremap(BOARD_MODRST_REG, 4);
+}
+
+
+static void mvme5100_show_cpuinfo(struct seq_file *m)
+{
+ seq_puts(m, "Vendor\t\t: Motorola/Emerson\n");
+ seq_puts(m, "Machine\t\t: MVME5100\n");
+}
+
+static void mvme5100_restart(char *cmd)
+{
+
+ local_irq_disable();
+ mtmsr(mfmsr() | MSR_IP);
+
+ out_8((u_char *) restart, 0x01);
+
+ while (1)
+ ;
+}
+
+/*
+ * Called very early, device-tree isn't unflattened
+ */
+static int __init mvme5100_probe(void)
+{
+ unsigned long root = of_get_flat_dt_root();
+
+ return of_flat_dt_is_compatible(root, "MVME5100");
+}
+
+static int __init probe_of_platform_devices(void)
+{
+
+ of_platform_bus_probe(NULL, mvme5100_of_bus_ids, NULL);
+ return 0;
+}
+
+machine_device_initcall(mvme5100, probe_of_platform_devices);
+
+define_machine(mvme5100) {
+ .name = "MVME5100",
+ .probe = mvme5100_probe,
+ .setup_arch = mvme5100_setup_arch,
+ .init_IRQ = mvme5100_pic_init,
+ .show_cpuinfo = mvme5100_show_cpuinfo,
+ .get_irq = mpic_get_irq,
+ .restart = mvme5100_restart,
+ .calibrate_decr = generic_calibrate_decr,
+ .progress = udbg_progress,
+};
^ permalink raw reply related
* Re: Error in frreing hugepages with preemption enabled
From: Andrea Arcangeli @ 2013-12-03 22:21 UTC (permalink / raw)
To: Alexander Graf
Cc: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org, Bharat Bhushan,
Scott Wood, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <EDB02D3B-6B03-4CCB-95C8-FDF2F2932E1D@suse.de>
Hi everyone,
On Fri, Nov 29, 2013 at 12:13:03PM +0100, Alexander Graf wrote:
>
> On 29.11.2013, at 05:38, Bharat Bhushan <Bharat.Bhushan@freescale.com> wrote:
>
> > Hi Alex,
> >
> > I am running KVM guest with host kernel having CONFIG_PREEMPT enabled. With allocated pages things seems to work fine but I uses hugepages for guest I see below prints when "quit" from qemu.
> >
> > (qemu) QEMU waiting for connection on: telnet:0.0.0.0:4444,server
> > qemu-system-ppc64: pci_add_option_rom: failed to find romfile "efi-virtio.rom"
> > q
> > debug_smp_processor_id: 15 callbacks suppressed
> > BUG: using smp_processor_id() in preemptible [00000000] code: qemu-system-ppc/2504
> > caller is .free_hugepd_range+0xb0/0x21c
> > CPU: 1 PID: 2504 Comm: qemu-system-ppc Not tainted 3.12.0-rc3-07733-gabf4907 #175
> > Call Trace:
> > [c0000000fb433400] [c000000000007d38] .show_stack+0x7c/0x1cc (unreliable)
> > [c0000000fb4334d0] [c0000000005e8ce0] .dump_stack+0x9c/0xf4
> > [c0000000fb433560] [c0000000002de5ec] .debug_smp_processor_id+0x108/0x11c
> > [c0000000fb4335f0] [c000000000025e10] .free_hugepd_range+0xb0/0x21c
> > [c0000000fb433680] [c0000000000265bc] .hugetlb_free_pgd_range+0x2c8/0x3b0
> > [c0000000fb4337a0] [c0000000000e428c] .free_pgtables+0x14c/0x158
> > [c0000000fb433840] [c0000000000ef320] .exit_mmap+0xec/0x194
> > [c0000000fb433960] [c00000000004d780] .mmput+0x64/0x124
> > [c0000000fb4339e0] [c000000000051f40] .do_exit+0x29c/0x9c8
> > [c0000000fb433ae0] [c0000000000527c8] .do_group_exit+0x50/0xc4
> > [c0000000fb433b70] [c0000000000606a0] .get_signal_to_deliver+0x21c/0x5d8
> > [c0000000fb433c70] [c000000000009b08] .do_signal+0x54/0x278
> > [c0000000fb433db0] [c000000000009e50] .do_notify_resume+0x64/0x78
> > [c0000000fb433e30] [c000000000000b44] .ret_from_except_lite+0x70/0x74
> >
> >
> > This mean that free_hugepd_range() must be called with preemption enabled.
>
> with preemption disabled.
>
> > I tried below change and this seems to work fine (I am not having expertise in this area so not sure this is correct way)
>
> Not sure - the scope looks odd to me. Let's ask Andrea - I'm sure he knows what to do :).
:) So I had a look at the top of this function (0xb0) in the upstream
kernel and no smp_processor_id() call is apparent, is this stock git
or a ppc tree? The first few calls seem not to call it but I may have
overlooked something. It's just quicker if somebody with vmlinux finds
the location of it.
static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshift,
unsigned long start, unsigned long end,
unsigned long floor, unsigned long ceiling)
{
pte_t *hugepte = hugepd_page(*hpdp);
int i;
unsigned long pdmask = ~((1UL << pdshift) - 1);
unsigned int num_hugepd = 1;
#ifdef CONFIG_PPC_FSL_BOOK3E
/* Note: On fsl the hpdp may be the first of several */
num_hugepd = (1 << (hugepd_shift(*hpdp) - pdshift));
#else
unsigned int shift = hugepd_shift(*hpdp);
#endif
start &= pdmask;
if (start < floor)
return;
if (ceiling) {
ceiling &= pdmask;
if (! ceiling)
return;
}
if (end - 1 > ceiling - 1)
return;
for (i = 0; i < num_hugepd; i++, hpdp++)
hpdp->pd = 0;
tlb->need_flush = 1;
#ifdef CONFIG_PPC_FSL_BOOK3E
hugepd_free(tlb, hugepte);
#else
pgtable_free_tlb(tlb, hugepte, pdshift - shift);
#endif
}
Generally smp_processor_id should never be used, exactly to avoid
problems like above with preempion enabled in .config.
Instead it should be replaced with a get_cpu()/put_cpu() pair that is
exactly meant to fix bugs like this and define proper critical
sections around the per-cpu variables.
#define get_cpu() ({ preempt_disable(); smp_processor_id(); })
#define put_cpu() preempt_enable()
After you find where that smp_processor_id() is located, you should
simply replace it with a get_cpu() and then you should insert a
put_cpu immediately after the "cpu" info is not used anymore. That
will define a proper and strict critical section around the use of the
per-cpu variables.
With a ppc vmlinux it should be immediate to find the location of
smp_processor_id but I don't have the ppc vmlinux here.
Thanks!
Andrea
>
>
> Alex
>
> >
> > diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c
> > index d67db4b..6bf8459 100644
> > --- a/arch/powerpc/mm/hugetlbpage.c
> > +++ b/arch/powerpc/mm/hugetlbpage.c
> > @@ -563,8 +563,10 @@ static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
> > */
> > next = addr + (1 << hugepd_shift(*(hugepd_t *)pmd));
> > #endif
> > + preempt_disable();
> > free_hugepd_range(tlb, (hugepd_t *)pmd, PMD_SHIFT,
> > addr, next, floor, ceiling);
> > + preempt_enable();
> > } while (addr = next, addr != end);
> >
> > start &= PUD_MASK;
> >
> >
> > Thanks
> > -Bharat
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: Error in frreing hugepages with preemption enabled
From: Benjamin Herrenschmidt @ 2013-12-04 2:22 UTC (permalink / raw)
To: Andrea Arcangeli
Cc: kvm@vger.kernel.org, Alexander Graf, kvm-ppc@vger.kernel.org,
Bharat Bhushan, Scott Wood, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <20131203222121.GB18764@redhat.com>
On Tue, 2013-12-03 at 23:21 +0100, Andrea Arcangeli wrote:
> #ifdef CONFIG_PPC_FSL_BOOK3E
> hugepd_free(tlb, hugepte);
^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the culprit
(Alex, you didn't specify this was embedded or did I miss it ?)
> #else
> pgtable_free_tlb(tlb, hugepte, pdshift - shift);
> #endif
> }
That function does:
batchp = &__get_cpu_var(hugepd_freelist_cur);
IE, it tries to use a per-CPU batch. Basically, it's duplicating the
logic in mm/memory.c for RCU freeing using a per-cpu freelist. I suppose
it assumes being called under something like the page table lock ?
This code also never "flushes" the batch, which is a concern...
Alex, this is Freescale stuff, can you followup with them ?
Cheers,
Ben.
^ permalink raw reply
* Re: [V3 00/10] perf: New conditional branch filter
From: Michael Ellerman @ 2013-12-04 2:50 UTC (permalink / raw)
To: Anshuman Khandual
Cc: mikey, linux-kernel, eranian, linuxppc-dev,
Arnaldo Carvalho de Melo, sukadev
In-Reply-To: <1381906617-11392-1-git-send-email-khandual@linux.vnet.ibm.com>
On Wed, 2013-10-16 at 12:26 +0530, Anshuman Khandual wrote:
> This patchset is the re-spin of the original branch stack sampling
> patchset which introduced new PERF_SAMPLE_BRANCH_COND branch filter. This patchset
> also enables SW based branch filtering support for book3s powerpc platforms which
> have PMU HW backed branch stack sampling support.
>
> Summary of code changes in this patchset:
>
> (1) Introduces a new PERF_SAMPLE_BRANCH_COND branch filter
> (2) Add the "cond" branch filter options in the "perf record" tool
> (3) Enable PERF_SAMPLE_BRANCH_COND in X86 platforms
> (4) Enable PERF_SAMPLE_BRANCH_COND in POWER8 platform
> (5) Update the documentation regarding "perf record" tool
Can you please address my comments and then resend patches 1-5. And make sure
you send them to the perf maintainers.
Those three touch the generic code, powerpc and x86, so we'll get those merged
first, and then focus on the remaining patches, which are powerpc specific.
cheers
^ permalink raw reply
* Re: [PATCH -V2 3/5] mm: Move change_prot_numa outside CONFIG_ARCH_USES_NUMA_PROT_NONE
From: Benjamin Herrenschmidt @ 2013-12-04 3:13 UTC (permalink / raw)
To: Aneesh Kumar K.V; +Cc: linux-mm, paulus, linuxppc-dev
In-Reply-To: <1384766893-10189-4-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
On Mon, 2013-11-18 at 14:58 +0530, Aneesh Kumar K.V wrote:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>
> change_prot_numa should work even if _PAGE_NUMA != _PAGE_PROTNONE.
> On archs like ppc64 that don't use _PAGE_PROTNONE and also have
> a separate page table outside linux pagetable, we just need to
> make sure that when calling change_prot_numa we flush the
> hardware page table entry so that next page access result in a numa
> fault.
That patch doesn't look right...
You are essentially making change_prot_numa() do whatever it does (which
I don't completely understand) *for all architectures* now, whether they
have CONFIG_ARCH_USES_NUMA_PROT_NONE or not ... So because you want that
behaviour on powerpc book3s64, you change everybody.
Is that correct ?
Also what exactly is that doing, can you explain ? From what I can see,
it calls back into the core of mprotect to change the protection to
vma->vm_page_prot, which I would have expected is already the protection
there, with the added "prot_numa" flag passed down.
Your changeset comment says "On archs like ppc64 [...] we just need to
make sure that when calling change_prot_numa we flush the
hardware page table entry so that next page access result in a numa
fault."
But change_prot_numa() does a lot more than that ... it does
pte_mknuma(), do we need it ? I assume we do or we wouldn't have added
that PTE bit to begin with...
Now it *might* be allright and it might be that no other architecture
cares anyway etc... but I need at least some mm folks to ack on that
patch before I can take it because it *will* change behaviour of other
architectures.
Cheers,
Ben.
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> include/linux/mm.h | 3 ---
> mm/mempolicy.c | 9 ---------
> 2 files changed, 12 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 0548eb201e05..51794c1a1d7e 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1851,11 +1851,8 @@ static inline pgprot_t vm_get_page_prot(unsigned long vm_flags)
> }
> #endif
>
> -#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE
> unsigned long change_prot_numa(struct vm_area_struct *vma,
> unsigned long start, unsigned long end);
> -#endif
> -
> struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
> int remap_pfn_range(struct vm_area_struct *, unsigned long addr,
> unsigned long pfn, unsigned long size, pgprot_t);
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index c4403cdf3433..cae10af4fdc4 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -613,7 +613,6 @@ static inline int queue_pages_pgd_range(struct vm_area_struct *vma,
> return 0;
> }
>
> -#ifdef CONFIG_ARCH_USES_NUMA_PROT_NONE
> /*
> * This is used to mark a range of virtual addresses to be inaccessible.
> * These are later cleared by a NUMA hinting fault. Depending on these
> @@ -627,7 +626,6 @@ unsigned long change_prot_numa(struct vm_area_struct *vma,
> unsigned long addr, unsigned long end)
> {
> int nr_updated;
> - BUILD_BUG_ON(_PAGE_NUMA != _PAGE_PROTNONE);
>
> nr_updated = change_protection(vma, addr, end, vma->vm_page_prot, 0, 1);
> if (nr_updated)
> @@ -635,13 +633,6 @@ unsigned long change_prot_numa(struct vm_area_struct *vma,
>
> return nr_updated;
> }
> -#else
> -static unsigned long change_prot_numa(struct vm_area_struct *vma,
> - unsigned long addr, unsigned long end)
> -{
> - return 0;
> -}
> -#endif /* CONFIG_ARCH_USES_NUMA_PROT_NONE */
>
> /*
> * Walk through page tables and collect pages to be migrated.
^ permalink raw reply
* Re: [PATCH v2] watchdog: mpc8xxx_wdt convert to watchdog core
From: Guenter Roeck @ 2013-12-04 5:10 UTC (permalink / raw)
To: Christophe Leroy, Wim Van Sebroeck, scottwood
Cc: linuxppc-dev, linux-kernel, linux-watchdog
In-Reply-To: <20131203133140.5E9DF1A2BEA@localhost.localdomain>
On 12/03/2013 05:31 AM, Christophe Leroy wrote:
> Convert mpc8xxx_wdt.c to the new watchdog API.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
> diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
> --- a/drivers/watchdog/mpc8xxx_wdt.c 2013-05-11 22:57:46.000000000 +0200
> +++ b/drivers/watchdog/mpc8xxx_wdt.c 2013-11-30 16:14:53.803495472 +0100
> @@ -72,53 +72,36 @@
> * to 0
> */
> static int prescale = 1;
> -static unsigned int timeout_sec;
>
> -static unsigned long wdt_is_open;
> static DEFINE_SPINLOCK(wdt_spinlock);
>
> -static void mpc8xxx_wdt_keepalive(void)
> +static int mpc8xxx_wdt_ping(struct watchdog_device *w)
> {
> /* Ping the WDT */
> spin_lock(&wdt_spinlock);
> out_be16(&wd_base->swsrr, 0x556c);
> out_be16(&wd_base->swsrr, 0xaa39);
> spin_unlock(&wdt_spinlock);
> + return 0;
> }
>
Ok, now I understand a bit better.
I think it would be better to keep the original mpc8xxx_wdt_keepalive()
function and add
static int mpc8xxx_wdt_ping(struct watchdog_device *w)
{
mpc8xxx_wdt_keepalive();
}
since the parameter is not used. Then you can call mpc8xxx_wdt_keepalive()
from mpc8xxx_wdt_timer_ping(), and you don't have to add the dummy argument.
Otherwise looks good.
Note there is a problem in the probe function with
u32 freq = fsl_get_sys_freq();
and
if (!freq || freq == -1)
^^^^^^^^^^^
but fixing that would be a different patch.
Guenter
> +static struct watchdog_device mpc8xxx_wdt_dev;
> static void mpc8xxx_wdt_timer_ping(unsigned long arg);
> -static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
> +static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0,
> + (unsigned long)&mpc8xxx_wdt_dev);
>
> static void mpc8xxx_wdt_timer_ping(unsigned long arg)
> {
> - mpc8xxx_wdt_keepalive();
> - /* We're pinging it twice faster than needed, just to be sure. */
> - mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
> -}
> + struct watchdog_device *w = (struct watchdog_device *)arg;
>
> -static void mpc8xxx_wdt_pr_warn(const char *msg)
> -{
> - pr_crit("%s, expect the %s soon!\n", msg,
> - reset ? "reset" : "machine check exception");
> -}
> -
> -static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
> - size_t count, loff_t *ppos)
> -{
> - if (count)
> - mpc8xxx_wdt_keepalive();
> - return count;
> + mpc8xxx_wdt_ping(w);
> + /* We're pinging it twice faster than needed, just to be sure. */
> + mod_timer(&wdt_timer, jiffies + HZ * w->timeout / 2);
> }
>
> -static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
> +static int mpc8xxx_wdt_start(struct watchdog_device *w)
> {
> u32 tmp = SWCRR_SWEN;
> - if (test_and_set_bit(0, &wdt_is_open))
> - return -EBUSY;
> -
> - /* Once we start the watchdog we can't stop it */
> - if (nowayout)
> - __module_get(THIS_MODULE);
>
> /* Good, fire up the show */
> if (prescale)
> @@ -132,59 +115,31 @@
>
> del_timer_sync(&wdt_timer);
>
> - return nonseekable_open(inode, file);
> + return 0;
> }
>
> -static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
> +static int mpc8xxx_wdt_stop(struct watchdog_device *w)
> {
> - if (!nowayout)
> - mpc8xxx_wdt_timer_ping(0);
> - else
> - mpc8xxx_wdt_pr_warn("watchdog closed");
> - clear_bit(0, &wdt_is_open);
> + mod_timer(&wdt_timer, jiffies);
> return 0;
> }
>
> -static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd,
> - unsigned long arg)
> -{
> - void __user *argp = (void __user *)arg;
> - int __user *p = argp;
> - static const struct watchdog_info ident = {
> - .options = WDIOF_KEEPALIVEPING,
> - .firmware_version = 1,
> - .identity = "MPC8xxx",
> - };
> -
> - switch (cmd) {
> - case WDIOC_GETSUPPORT:
> - return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
> - case WDIOC_GETSTATUS:
> - case WDIOC_GETBOOTSTATUS:
> - return put_user(0, p);
> - case WDIOC_KEEPALIVE:
> - mpc8xxx_wdt_keepalive();
> - return 0;
> - case WDIOC_GETTIMEOUT:
> - return put_user(timeout_sec, p);
> - default:
> - return -ENOTTY;
> - }
> -}
> +static struct watchdog_info mpc8xxx_wdt_info = {
> + .options = WDIOF_KEEPALIVEPING,
> + .firmware_version = 1,
> + .identity = "MPC8xxx",
> +};
>
> -static const struct file_operations mpc8xxx_wdt_fops = {
> - .owner = THIS_MODULE,
> - .llseek = no_llseek,
> - .write = mpc8xxx_wdt_write,
> - .unlocked_ioctl = mpc8xxx_wdt_ioctl,
> - .open = mpc8xxx_wdt_open,
> - .release = mpc8xxx_wdt_release,
> +static struct watchdog_ops mpc8xxx_wdt_ops = {
> + .owner = THIS_MODULE,
> + .start = mpc8xxx_wdt_start,
> + .ping = mpc8xxx_wdt_ping,
> + .stop = mpc8xxx_wdt_stop,
> };
>
> -static struct miscdevice mpc8xxx_wdt_miscdev = {
> - .minor = WATCHDOG_MINOR,
> - .name = "watchdog",
> - .fops = &mpc8xxx_wdt_fops,
> +static struct watchdog_device mpc8xxx_wdt_dev = {
> + .info = &mpc8xxx_wdt_info,
> + .ops = &mpc8xxx_wdt_ops,
> };
>
> static const struct of_device_id mpc8xxx_wdt_match[];
> @@ -196,6 +151,7 @@
> const struct mpc8xxx_wdt_type *wdt_type;
> u32 freq = fsl_get_sys_freq();
> bool enabled;
> + unsigned int timeout_sec;
>
> match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
> if (!match)
> @@ -222,6 +178,7 @@
> else
> timeout_sec = timeout / freq;
>
> + mpc8xxx_wdt_dev.timeout = timeout_sec;
> #ifdef MODULE
> ret = mpc8xxx_wdt_init_late();
> if (ret)
> @@ -237,7 +194,7 @@
> * userspace handles it.
> */
> if (enabled)
> - mpc8xxx_wdt_timer_ping(0);
> + mod_timer(&wdt_timer, jiffies);
> return 0;
> err_unmap:
> iounmap(wd_base);
> @@ -247,9 +204,10 @@
>
> static int mpc8xxx_wdt_remove(struct platform_device *ofdev)
> {
> - mpc8xxx_wdt_pr_warn("watchdog removed");
> + pr_crit("Watchdog removed, expect the %s soon!\n",
> + reset ? "reset" : "machine check exception");
> del_timer_sync(&wdt_timer);
> - misc_deregister(&mpc8xxx_wdt_miscdev);
> + watchdog_unregister_device(&mpc8xxx_wdt_dev);
> iounmap(wd_base);
>
> return 0;
> @@ -301,10 +259,11 @@
> if (!wd_base)
> return -ENODEV;
>
> - ret = misc_register(&mpc8xxx_wdt_miscdev);
> + watchdog_set_nowayout(&mpc8xxx_wdt_dev, nowayout);
> +
> + ret = watchdog_register_device(&mpc8xxx_wdt_dev);
> if (ret) {
> - pr_err("cannot register miscdev on minor=%d (err=%d)\n",
> - WATCHDOG_MINOR, ret);
> + pr_err("cannot register watchdog device (err=%d)\n", ret);
> return ret;
> }
> return 0;
> diff -ur a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
> --- a/drivers/watchdog/Kconfig
> +++ b/drivers/watchdog/Kconfig
> @@ -1146,6 +1146,7 @@
> config 8xxx_WDT
> tristate "MPC8xxx Platform Watchdog Timer"
> depends on PPC_8xx || PPC_83xx || PPC_86xx
> + select WATCHDOG_CORE
> help
> This driver is for a SoC level watchdog that exists on some
> Freescale PowerPC processors. So far this driver supports:
>
>
^ permalink raw reply
* [PATCH v3] watchdog: mpc8xxx_wdt convert to watchdog core
From: Christophe Leroy @ 2013-12-04 6:32 UTC (permalink / raw)
To: Wim Van Sebroeck, scottwood, Guenter Roeck
Cc: linuxppc-dev, linux-kernel, linux-watchdog
Convert mpc8xxx_wdt.c to the new watchdog API.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c
--- a/drivers/watchdog/mpc8xxx_wdt.c 2013-05-11 22:57:46.000000000 +0200
+++ b/drivers/watchdog/mpc8xxx_wdt.c 2013-11-30 16:14:53.803495472 +0100
@@ -72,9 +72,7 @@
* to 0
*/
static int prescale = 1;
-static unsigned int timeout_sec;
-static unsigned long wdt_is_open;
static DEFINE_SPINLOCK(wdt_spinlock);
static void mpc8xxx_wdt_keepalive(void)
@@ -86,39 +84,23 @@
spin_unlock(&wdt_spinlock);
}
+static struct watchdog_device mpc8xxx_wdt_dev;
static void mpc8xxx_wdt_timer_ping(unsigned long arg);
-static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0);
+static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0,
+ (unsigned long)&mpc8xxx_wdt_dev);
static void mpc8xxx_wdt_timer_ping(unsigned long arg)
{
+ struct watchdog_device *w = (struct watchdog_device *)arg;
+
mpc8xxx_wdt_keepalive();
/* We're pinging it twice faster than needed, just to be sure. */
- mod_timer(&wdt_timer, jiffies + HZ * timeout_sec / 2);
-}
-
-static void mpc8xxx_wdt_pr_warn(const char *msg)
-{
- pr_crit("%s, expect the %s soon!\n", msg,
- reset ? "reset" : "machine check exception");
+ mod_timer(&wdt_timer, jiffies + HZ * w->timeout / 2);
}
-static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- if (count)
- mpc8xxx_wdt_keepalive();
- return count;
-}
-
-static int mpc8xxx_wdt_open(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_start(struct watchdog_device *w)
{
u32 tmp = SWCRR_SWEN;
- if (test_and_set_bit(0, &wdt_is_open))
- return -EBUSY;
-
- /* Once we start the watchdog we can't stop it */
- if (nowayout)
- __module_get(THIS_MODULE);
/* Good, fire up the show */
if (prescale)
@@ -132,59 +114,37 @@
del_timer_sync(&wdt_timer);
- return nonseekable_open(inode, file);
+ return 0;
}
-static int mpc8xxx_wdt_release(struct inode *inode, struct file *file)
+static int mpc8xxx_wdt_ping(struct watchdog_device *w)
{
- if (!nowayout)
- mpc8xxx_wdt_timer_ping(0);
- else
- mpc8xxx_wdt_pr_warn("watchdog closed");
- clear_bit(0, &wdt_is_open);
+ mpc8xxx_wdt_keepalive();
return 0;
}
-static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd,
- unsigned long arg)
+static int mpc8xxx_wdt_stop(struct watchdog_device *w)
{
- void __user *argp = (void __user *)arg;
- int __user *p = argp;
- static const struct watchdog_info ident = {
- .options = WDIOF_KEEPALIVEPING,
- .firmware_version = 1,
- .identity = "MPC8xxx",
- };
-
- switch (cmd) {
- case WDIOC_GETSUPPORT:
- return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
- case WDIOC_GETSTATUS:
- case WDIOC_GETBOOTSTATUS:
- return put_user(0, p);
- case WDIOC_KEEPALIVE:
- mpc8xxx_wdt_keepalive();
- return 0;
- case WDIOC_GETTIMEOUT:
- return put_user(timeout_sec, p);
- default:
- return -ENOTTY;
- }
+ mod_timer(&wdt_timer, jiffies);
+ return 0;
}
-static const struct file_operations mpc8xxx_wdt_fops = {
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .write = mpc8xxx_wdt_write,
- .unlocked_ioctl = mpc8xxx_wdt_ioctl,
- .open = mpc8xxx_wdt_open,
- .release = mpc8xxx_wdt_release,
+static struct watchdog_info mpc8xxx_wdt_info = {
+ .options = WDIOF_KEEPALIVEPING,
+ .firmware_version = 1,
+ .identity = "MPC8xxx",
};
-static struct miscdevice mpc8xxx_wdt_miscdev = {
- .minor = WATCHDOG_MINOR,
- .name = "watchdog",
- .fops = &mpc8xxx_wdt_fops,
+static struct watchdog_ops mpc8xxx_wdt_ops = {
+ .owner = THIS_MODULE,
+ .start = mpc8xxx_wdt_start,
+ .ping = mpc8xxx_wdt_ping,
+ .stop = mpc8xxx_wdt_stop,
+};
+
+static struct watchdog_device mpc8xxx_wdt_dev = {
+ .info = &mpc8xxx_wdt_info,
+ .ops = &mpc8xxx_wdt_ops,
};
static const struct of_device_id mpc8xxx_wdt_match[];
@@ -196,6 +156,7 @@
const struct mpc8xxx_wdt_type *wdt_type;
u32 freq = fsl_get_sys_freq();
bool enabled;
+ unsigned int timeout_sec;
match = of_match_device(mpc8xxx_wdt_match, &ofdev->dev);
if (!match)
@@ -222,6 +183,7 @@
else
timeout_sec = timeout / freq;
+ mpc8xxx_wdt_dev.timeout = timeout_sec;
#ifdef MODULE
ret = mpc8xxx_wdt_init_late();
if (ret)
@@ -237,7 +199,7 @@
* userspace handles it.
*/
if (enabled)
- mpc8xxx_wdt_timer_ping(0);
+ mod_timer(&wdt_timer, jiffies);
return 0;
err_unmap:
iounmap(wd_base);
@@ -247,9 +209,10 @@
static int mpc8xxx_wdt_remove(struct platform_device *ofdev)
{
- mpc8xxx_wdt_pr_warn("watchdog removed");
+ pr_crit("Watchdog removed, expect the %s soon!\n",
+ reset ? "reset" : "machine check exception");
del_timer_sync(&wdt_timer);
- misc_deregister(&mpc8xxx_wdt_miscdev);
+ watchdog_unregister_device(&mpc8xxx_wdt_dev);
iounmap(wd_base);
return 0;
@@ -301,10 +264,11 @@
if (!wd_base)
return -ENODEV;
- ret = misc_register(&mpc8xxx_wdt_miscdev);
+ watchdog_set_nowayout(&mpc8xxx_wdt_dev, nowayout);
+
+ ret = watchdog_register_device(&mpc8xxx_wdt_dev);
if (ret) {
- pr_err("cannot register miscdev on minor=%d (err=%d)\n",
- WATCHDOG_MINOR, ret);
+ pr_err("cannot register watchdog device (err=%d)\n", ret);
return ret;
}
return 0;
diff -ur a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1146,6 +1146,7 @@
config 8xxx_WDT
tristate "MPC8xxx Platform Watchdog Timer"
depends on PPC_8xx || PPC_83xx || PPC_86xx
+ select WATCHDOG_CORE
help
This driver is for a SoC level watchdog that exists on some
Freescale PowerPC processors. So far this driver supports:
^ permalink raw reply
* [PATCH 0/3] optimize for powerpc _PAGE_NUMA
From: Liu Ping Fan @ 2013-12-04 6:59 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, Aneesh Kumar K.V
I saw Aneesh had implemented Numa faults on ppc64. Most of them have been reviewed-by.
So I just diff mine and his to form some trivial modification.
Based on Aneesh's series "[PATCH -V2 0/5] powerpc: mm: Numa faults support for ppc64"
Liu Ping Fan (3):
powerpc: mm: make _PAGE_NUMA take effect
mm: export numa_migrate_prep()
powerpc: mm: optimize for the correctly placed page
arch/powerpc/mm/hash_utils_64.c | 32 ++++++++++++++++++++++++++++++++
include/linux/mm.h | 2 ++
2 files changed, 34 insertions(+)
--
1.8.1.4
^ permalink raw reply
* [PATCH 1/3] powerpc: mm: make _PAGE_NUMA take effect
From: Liu Ping Fan @ 2013-12-04 6:59 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, Aneesh Kumar K.V
In-Reply-To: <1386140348-7854-1-git-send-email-pingfank@linux.vnet.ibm.com>
To enable the do_numa_page(), we should not fix _PAGE_NUMA in
hash_page(), so bail out for the case of pte_numa().
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
arch/powerpc/mm/hash_utils_64.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index fb176e9..9bf1195 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -1033,7 +1033,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
/* Get PTE and page size from page tables */
ptep = find_linux_pte_or_hugepte(pgdir, ea, &hugeshift);
- if (ptep == NULL || !pte_present(*ptep)) {
+ if (ptep == NULL || !pte_present(*ptep) || pte_numa(*ptep)) {
DBG_LOW(" no PTE !\n");
rc = 1;
goto bail;
--
1.8.1.4
^ permalink raw reply related
* [PATCH 2/3] mm: export numa_migrate_prep()
From: Liu Ping Fan @ 2013-12-04 6:59 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, Aneesh Kumar K.V
In-Reply-To: <1386140348-7854-1-git-send-email-pingfank@linux.vnet.ibm.com>
powerpc will use it in fast path.
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
include/linux/mm.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5ab0e22..420fb77 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1092,6 +1092,8 @@ extern unsigned long change_protection(struct vm_area_struct *vma, unsigned long
extern int mprotect_fixup(struct vm_area_struct *vma,
struct vm_area_struct **pprev, unsigned long start,
unsigned long end, unsigned long newflags);
+extern int numa_migrate_prep(struct page *page, struct vm_area_struct *vma,
+ unsigned long addr, int page_nid);
/*
* doesn't attempt to fault and will return short.
--
1.8.1.4
^ permalink raw reply related
* [PATCH 3/3] powerpc: mm: optimize for the correctly placed page
From: Liu Ping Fan @ 2013-12-04 6:59 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paul Mackerras, Aneesh Kumar K.V
In-Reply-To: <1386140348-7854-1-git-send-email-pingfank@linux.vnet.ibm.com>
The period check of _PAGE_NUMA can probably trigger the check on
the correctly placed page. For this case, we can just insert hpte and
do fast exception return.
Signed-off-by: Liu Ping Fan <pingfank@linux.vnet.ibm.com>
---
arch/powerpc/mm/hash_utils_64.c | 34 +++++++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 9bf1195..735678c 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -965,6 +965,10 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
const struct cpumask *tmp;
int rc, user_region = 0, local = 0;
int psize, ssize;
+ pte_t old, new;
+ struct vm_area_struct *vma;
+ int page_nid, target_nid;
+ struct page *test_page;
DBG_LOW("hash_page(ea=%016lx, access=%lx, trap=%lx\n",
ea, access, trap);
@@ -1033,12 +1037,40 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
/* Get PTE and page size from page tables */
ptep = find_linux_pte_or_hugepte(pgdir, ea, &hugeshift);
- if (ptep == NULL || !pte_present(*ptep) || pte_numa(*ptep)) {
+ if (ptep == NULL || !pte_present(*ptep)) {
DBG_LOW(" no PTE !\n");
rc = 1;
goto bail;
}
+ old = pte_val(*ptep);
+ if (pte_numa(old)) {
+ /* If fail to lock, let do_page_fault() to handle it */
+ if (down_read_trylock(&mm->mmap_sem)) {
+ vma = find_vma(mm, ea);
+ up_read(&mm->mmap_sem);
+ test_page = pte_page(old);
+ page_nid = page_to_nid(test_page);
+ target_nid = numa_migrate_prep(test_page, vma, ea,
+ page_nid);
+ if (target_nid < 0) {
+ new = pte_mknonnuma(old);
+ /* If ptep is modified under us,
+ * just retry the access
+ */
+ if (unlikely(cmpxchg(ptep, old, new) != old)) {
+ put_page(test_page);
+ return 0;
+ }
+ put_page(test_page);
+ }
+ } else {
+ put_page(test_page);
+ rc = 1;
+ goto bail;
+ }
+ }
+
/* Add _PAGE_PRESENT to the required access perm */
access |= _PAGE_PRESENT;
--
1.8.1.4
^ permalink raw reply related
* Re: [PATCH v3] watchdog: mpc8xxx_wdt convert to watchdog core
From: Guenter Roeck @ 2013-12-04 7:15 UTC (permalink / raw)
To: Christophe Leroy, Wim Van Sebroeck, scottwood
Cc: linuxppc-dev, linux-kernel, linux-watchdog
In-Reply-To: <20131204063214.D1DB01A2BEA@localhost.localdomain>
On 12/03/2013 10:32 PM, Christophe Leroy wrote:
> Convert mpc8xxx_wdt.c to the new watchdog API.
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
^ permalink raw reply
* Re: [PATCH] ASoC: fsl_ssi: Implement symmetric_channels and symmetric_samplebits
From: Nicolin Chen @ 2013-12-04 7:27 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel, lgirdwood, tiwai, timur, perex, linuxppc-dev
In-Reply-To: <20131203145833.GV27568@sirena.org.uk>
On Tue, Dec 03, 2013 at 02:58:33PM +0000, Mark Brown wrote:
> On Tue, Dec 03, 2013 at 06:38:07PM +0800, Nicolin Chen wrote:
> > Since we introduced symmetric_channels and symmetric_samplebits, we implement
> > these two features to fsl_ssi so as to drop some no-more-needed code and make
> > the driver neat and clean.
>
> Applied, thanks.
Sir, shall we also implement these two to other drivers like codecs?
I know this symmetry is a new feature and might be still immature.
By implementing it might bring some side effects. But meanwhile, it
would also allows us to engage more people to test it, although myself
have done a branch of tests with different user cases on my platform.
Or we just wait for people engaging by themselves?
Thank you,
Nicolin Chen
^ permalink raw reply
* Re: [PATCH v4 1/1] powerpc/embedded6xx: Add support for Motorola/Emerson MVME5100
From: Geert Uytterhoeven @ 2013-12-04 9:50 UTC (permalink / raw)
To: Stephen Chivers; +Cc: linuxppc-dev@lists.ozlabs.org, cproctor
In-Reply-To: <20131203220056.36011E0729@canberra.localdomain>
On Tue, Dec 3, 2013 at 11:00 PM, Stephen Chivers <schivers@csc.com> wrote:
> Address comments by Kular Gama and Scott Wood.
Kumar Gala.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH V4 02/10] powerpc, perf: Enable conditional branch filter for POWER8
From: Anshuman Khandual @ 2013-12-04 10:32 UTC (permalink / raw)
To: linuxppc-dev, linux-kernel
Cc: mikey, ak, eranian, michael, acme, sukadev, mingo
In-Reply-To: <1386153162-11225-1-git-send-email-khandual@linux.vnet.ibm.com>
Enables conditional branch filter support for POWER8
utilizing MMCRA register based filter and also invalidates
any BHRB branch filter combination.
Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
---
arch/powerpc/perf/power8-pmu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c
index a3f7abd..e88b9cb 100644
--- a/arch/powerpc/perf/power8-pmu.c
+++ b/arch/powerpc/perf/power8-pmu.c
@@ -586,6 +586,16 @@ static u64 power8_bhrb_filter_map(u64 branch_sample_type)
return pmu_bhrb_filter;
}
+ if (branch_sample_type & PERF_SAMPLE_BRANCH_COND) {
+ pmu_bhrb_filter |= POWER8_MMCRA_IFM3;
+ return pmu_bhrb_filter;
+ }
+
+ /* PMU does not support ANY combination of HW BHRB filters */
+ if ((branch_sample_type & PERF_SAMPLE_BRANCH_ANY_CALL) &&
+ (branch_sample_type & PERF_SAMPLE_BRANCH_COND))
+ return -1;
+
/* Every thing else is unsupported */
return -1;
}
--
1.7.11.7
^ permalink raw reply related
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