* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2014-04-09 7:23 UTC (permalink / raw)
To: Linus Torvalds
Cc: Tejun Heo, Greg Kroah-Hartman, linuxppc-dev, Linux Kernel list
Hi Linus !
Here are a few more powerpc things for you.
So you'll find here the conversion of the two new firmware sysfs
interfaces to the new API for self-removing files that Greg and Tejun
introduced, so they can finally remove the old one.
I'm also reverting the hwmon driver for powernv. I shouldn't have merged
it, I got a bit carried away here. I hadn't realized it was never CCed
to the relevant maintainer(s) and list(s), and happens to have some
issues so I'm taking it out and it will come back via the proper
channels.
The rest is a bunch of LE fixes (argh, some of the new stuff was broken
on LE, I really need to start testing LE myself !) and various random
fixes here and there.
Finally one bit that's not strictly a fix, which is the HVC OPAL change
to "kick" the HVC thread when the firmware tells us there is new
incoming data. I don't feel like waiting for this one, it's simple
enough, and it makes a big difference in console responsiveness which is
good for my nerves.
Cheers,
Ben.
The following changes since commit 18a1a7a1d862ae0794a0179473d08a414dd49234:
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile (2014-04-06 08:11:57 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git merge
for you to fetch changes up to cc4f265ad9a37bdb1846c45eebe454c382f31d67:
powerpc/powernv Adapt opal-elog and opal-dump to new sysfs_remove_file_self (2014-04-09 13:51:50 +1000)
----------------------------------------------------------------
Aneesh Kumar K.V (1):
powerpc/mm: NUMA pte should be handled via slow path in get_user_pages_fast()
Anton Blanchard (3):
powerpc/powernv: Fix endian issues with OPAL async code
powerpc/powernv: Fix endian issues with sensor code
powerpc: Add lq/stq emulation
Benjamin Herrenschmidt (8):
powerpc: Adjust CPU_FTR_SMT on all platforms
powerpc: Make boot_cpuid common between 32 and 64-bit
powerpc/prom: early_init_dt_scan_cpus() updates cpu features only once
powerpc/ppc64: Gracefully handle early interrupts
powerpc/ppc64: Do not turn AIL (reloc-on interrupts) too early
powerpc/powernv: Add opal_notifier_unregister() and export to modules
tty/hvc_opal: Kick the HVC thread on OPAL console events
Revert "powerpc/powernv: hwmon driver for power values, fan rpm and temperature"
Greg Kurz (1):
powerpc/le: Enable RTAS events support
Joe Perches (1):
powerpc: Convert last uses of __FUNCTION__ to __func__
Joel Stanley (2):
powerpc/powernv: Add OPAL message log interface
powerpc/powernv: Add invalid OPAL call
Li Zhong (1):
powerpc: Use of_node_init() for the fakenode in msi_bitmap.c
Mahesh Salgaonkar (1):
powerpc/book3s: Fix mc_recoverable_range buffer overrun issue.
Michael Neuling (3):
powerpc/tm: Disable IRQ in tm_recheckpoint
powerpc: Remove dead code in sycall entry
powerpc/opal: Add missing include
Michael Wang (1):
power, sched: stop updating inside arch_update_cpu_topology() when nothing to be update
Monam Agarwal (1):
arch/powerpc: Use RCU_INIT_POINTER(x, NULL) in platforms/cell/spu_syscalls.c
Stephen Chivers (1):
powerpc: Correct emulated mtfsf instruction
Stewart Smith (1):
powerpc/powernv Adapt opal-elog and opal-dump to new sysfs_remove_file_self
Tony Breeds (1):
powerpc/le: Avoid creatng R_PPC64_TOCSAVE relocations for modules.
arch/powerpc/Makefile | 1 +
arch/powerpc/include/asm/emulated_ops.h | 1 +
arch/powerpc/include/asm/opal.h | 19 +-
arch/powerpc/include/asm/rtas.h | 127 ++++--
arch/powerpc/kernel/align.c | 52 ++-
arch/powerpc/kernel/cpu_setup_power.S | 2 -
arch/powerpc/kernel/exceptions-64s.S | 8 -
arch/powerpc/kernel/paca.c | 3 +-
arch/powerpc/kernel/process.c | 34 +-
arch/powerpc/kernel/prom.c | 58 +--
arch/powerpc/kernel/rtas.c | 15 +-
arch/powerpc/kernel/rtasd.c | 24 +-
arch/powerpc/kernel/setup-common.c | 3 +
arch/powerpc/kernel/setup_32.c | 2 -
arch/powerpc/kernel/setup_64.c | 28 +-
arch/powerpc/kernel/signal_32.c | 2 +
arch/powerpc/kernel/signal_64.c | 2 +
arch/powerpc/kernel/tm.S | 2 +-
arch/powerpc/kernel/traps.c | 1 +
arch/powerpc/math-emu/mtfsf.c | 58 ++-
arch/powerpc/mm/gup.c | 13 +
arch/powerpc/mm/numa.c | 15 +
arch/powerpc/platforms/cell/spu_syscalls.c | 2 +-
arch/powerpc/platforms/powernv/Makefile | 1 +
arch/powerpc/platforms/powernv/opal-async.c | 7 +-
arch/powerpc/platforms/powernv/opal-dump.c | 9 +-
arch/powerpc/platforms/powernv/opal-elog.c | 9 +-
arch/powerpc/platforms/powernv/opal-msglog.c | 120 ++++++
arch/powerpc/platforms/powernv/opal-sensor.c | 6 +-
arch/powerpc/platforms/powernv/opal-sysparam.c | 4 +-
arch/powerpc/platforms/powernv/opal-wrappers.S | 1 +
arch/powerpc/platforms/powernv/opal.c | 59 ++-
arch/powerpc/platforms/pseries/io_event_irq.c | 6 +-
arch/powerpc/platforms/pseries/nvram.c | 11 +-
arch/powerpc/platforms/pseries/ras.c | 17 +-
arch/powerpc/sysdev/msi_bitmap.c | 2 +-
drivers/hwmon/Kconfig | 8 -
drivers/hwmon/Makefile | 1 -
drivers/hwmon/ibmpowernv.c | 529 -------------------------
drivers/tty/hvc/hvc_opal.c | 22 +-
40 files changed, 546 insertions(+), 738 deletions(-)
create mode 100644 arch/powerpc/platforms/powernv/opal-msglog.c
delete mode 100644 drivers/hwmon/ibmpowernv.c
^ permalink raw reply
* Re: [PATCH v3 2/2] ARM: dts: Append clock bindings for sai2 on VF610 platform
From: Shawn Guo @ 2014-04-09 7:58 UTC (permalink / raw)
To: Nicolin Chen
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
broonie, ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo,
rob, galak, linuxppc-dev
In-Reply-To: <08ba57a2fdce1a404a6bcb61e21e25509fcd6b30.1396605772.git.Guangyu.Chen@freescale.com>
On Fri, Apr 04, 2014 at 06:08:13PM +0800, Nicolin Chen wrote:
> Since we added fours clock to the DT binding, we should update the current
> SAI dts/dtsi so as not to break their functions.
If so, shouldn't the change be in the same patch as driver change?
Shawn
>
> Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> Tested-by: Xiubo Li <Li.Xiubo@freescale.com>
> ---
> arch/arm/boot/dts/vf610.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
> index d31ce1b..9fd0007 100644
> --- a/arch/arm/boot/dts/vf610.dtsi
> +++ b/arch/arm/boot/dts/vf610.dtsi
> @@ -139,8 +139,10 @@
> compatible = "fsl,vf610-sai";
> reg = <0x40031000 0x1000>;
> interrupts = <0 86 0x04>;
> - clocks = <&clks VF610_CLK_SAI2>;
> - clock-names = "sai";
> + clocks = <&clks VF610_CLK_SAI2>,
> + <&clks VF610_CLK_SAI2>,
> + <&clks 0>, <&clks 0>;
> + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> status = "disabled";
> };
>
> --
> 1.8.4
>
>
^ permalink raw reply
* Re: [PATCH v3 2/2] ARM: dts: Append clock bindings for sai2 on VF610 platform
From: Nicolin Chen @ 2014-04-09 7:51 UTC (permalink / raw)
To: Shawn Guo
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
broonie, ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo,
rob, galak, linuxppc-dev
In-Reply-To: <20140409075812.GC28420@dragon>
On Wed, Apr 09, 2014 at 03:58:15PM +0800, Shawn Guo wrote:
> On Fri, Apr 04, 2014 at 06:08:13PM +0800, Nicolin Chen wrote:
> > Since we added fours clock to the DT binding, we should update the current
> > SAI dts/dtsi so as not to break their functions.
>
> If so, shouldn't the change be in the same patch as driver change?
Okay..I'd like to merge them into one patch.
Thank you,
Nicolin
>
> Shawn
>
> >
> > Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> > Tested-by: Xiubo Li <Li.Xiubo@freescale.com>
> > ---
> > arch/arm/boot/dts/vf610.dtsi | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
> > index d31ce1b..9fd0007 100644
> > --- a/arch/arm/boot/dts/vf610.dtsi
> > +++ b/arch/arm/boot/dts/vf610.dtsi
> > @@ -139,8 +139,10 @@
> > compatible = "fsl,vf610-sai";
> > reg = <0x40031000 0x1000>;
> > interrupts = <0 86 0x04>;
> > - clocks = <&clks VF610_CLK_SAI2>;
> > - clock-names = "sai";
> > + clocks = <&clks VF610_CLK_SAI2>,
> > + <&clks VF610_CLK_SAI2>,
> > + <&clks 0>, <&clks 0>;
> > + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> > status = "disabled";
> > };
> >
> > --
> > 1.8.4
> >
> >
>
^ permalink raw reply
* Re: [PATCH v3 2/2] ARM: dts: Append clock bindings for sai2 on VF610 platform
From: Shawn Guo @ 2014-04-09 8:11 UTC (permalink / raw)
To: Nicolin Chen
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
broonie, ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo,
rob, galak, linuxppc-dev
In-Reply-To: <08ba57a2fdce1a404a6bcb61e21e25509fcd6b30.1396605772.git.Guangyu.Chen@freescale.com>
On Fri, Apr 04, 2014 at 06:08:13PM +0800, Nicolin Chen wrote:
> Since we added fours clock to the DT binding, we should update the current
> SAI dts/dtsi so as not to break their functions.
For the record, you're asking my ACK to have the dts change go via sound
tree for not breaking vf610 function on the sound branch, while
ignoring the fact that the existing DTB will break with the new kernel
anyway.
I'm not completely happy with the approach, but considering that the
existing binding is incorrect, I'm fine with it as long as people agree
to go this way.
Shawn
>
> Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> Tested-by: Xiubo Li <Li.Xiubo@freescale.com>
> ---
> arch/arm/boot/dts/vf610.dtsi | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
> index d31ce1b..9fd0007 100644
> --- a/arch/arm/boot/dts/vf610.dtsi
> +++ b/arch/arm/boot/dts/vf610.dtsi
> @@ -139,8 +139,10 @@
> compatible = "fsl,vf610-sai";
> reg = <0x40031000 0x1000>;
> interrupts = <0 86 0x04>;
> - clocks = <&clks VF610_CLK_SAI2>;
> - clock-names = "sai";
> + clocks = <&clks VF610_CLK_SAI2>,
> + <&clks VF610_CLK_SAI2>,
> + <&clks 0>, <&clks 0>;
> + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> status = "disabled";
> };
>
> --
> 1.8.4
>
>
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Peter Zijlstra @ 2014-04-09 8:20 UTC (permalink / raw)
To: Madhavan Srinivasan
Cc: linux-arch, riel, rusty, linux-mm, x86, linux-kernel, Dave Hansen,
ak, paulus, mgorman, akpm, linuxppc-dev, mingo, kirill.shutemov
In-Reply-To: <5344A312.80802@linux.vnet.ibm.com>
On Wed, Apr 09, 2014 at 07:02:02AM +0530, Madhavan Srinivasan wrote:
> On Friday 04 April 2014 09:48 PM, Dave Hansen wrote:
> > On 04/03/2014 11:27 PM, Madhavan Srinivasan wrote:
> >> This patch creates infrastructure to move the FAULT_AROUND_ORDER
> >> to arch/ using Kconfig. This will enable architecture maintainers
> >> to decide on suitable FAULT_AROUND_ORDER value based on
> >> performance data for that architecture. Patch also adds
> >> FAULT_AROUND_ORDER Kconfig element in arch/X86.
> >
> > Please don't do it this way.
> >
> > In mm/Kconfig, put
> >
> > config FAULT_AROUND_ORDER
> > int
> > default 1234 if POWERPC
> > default 4
> >
> > The way you have it now, every single architecture that needs to enable
> > this has to go put that in their Kconfig. That's madness. This way,
>
> I though about it and decided not to do this way because, in future,
> sub platforms of the architecture may decide to change the values. Also,
> adding an if line for each architecture with different sub platforms
> oring to it will look messy.
This still misses out on Ben's objection that its impossible to get this
right at compile time for many kernels, since they can boot and run on
many different subarchs.
^ permalink raw reply
* [RFC PATCH powerpc] Protect remove_memory() with device hotplug lock
From: Li Zhong @ 2014-04-09 8:54 UTC (permalink / raw)
To: PowerPC email list; +Cc: Paul Mackerras, Nathan Fontenot
While testing memory hot-remove, I found following dead lock:
Process #1141 is drmgr, trying to remove some memory, i.e. memory499.
It holds the memory_hotplug_mutex, and blocks when trying to remove file
"online" under dir memory499, in kernfs_drain(), at
wait_event(root->deactivate_waitq,
atomic_read(&kn->active) == KN_DEACTIVATED_BIAS);
Process #1120 is trying to online memory499 by
echo 1 > memory499/online
In .kernfs_fop_write, it uses kernfs_get_active() to increase
&kn->active, thus blocking process #1141. While itself is blocked later
when trying to acquire memory_hotplug_mutex, which is held by process
#1141.
The backtrace of both processes are shown below:
# cat /proc/1120/stack
[<c000000001b18600>] 0xc000000001b18600
[<c000000000015044>] .__switch_to+0x144/0x200
[<c000000000263ca4>] .online_pages+0x74/0x7b0
[<c00000000055b40c>] .memory_subsys_online+0x9c/0x150
[<c00000000053cbe8>] .device_online+0xb8/0x120
[<c00000000053cd04>] .online_store+0xb4/0xc0
[<c000000000538ce4>] .dev_attr_store+0x64/0xa0
[<c00000000030f4ec>] .sysfs_kf_write+0x7c/0xb0
[<c00000000030e574>] .kernfs_fop_write+0x154/0x1e0
[<c000000000268450>] .vfs_write+0xe0/0x260
[<c000000000269144>] .SyS_write+0x64/0x110
[<c000000000009ffc>] syscall_exit+0x0/0x7c
# cat /proc/1141/stack
[<c000000001b18600>] 0xc000000001b18600
[<c000000000015044>] .__switch_to+0x144/0x200
[<c00000000030be14>] .__kernfs_remove+0x204/0x300
[<c00000000030d428>] .kernfs_remove_by_name_ns+0x68/0xf0
[<c00000000030fb38>] .sysfs_remove_file_ns+0x38/0x60
[<c000000000539354>] .device_remove_attrs+0x54/0xc0
[<c000000000539fd8>] .device_del+0x158/0x250
[<c00000000053a104>] .device_unregister+0x34/0xa0
[<c00000000055bc14>] .unregister_memory_section+0x164/0x170
[<c00000000024ee18>] .__remove_pages+0x108/0x4c0
[<c00000000004b590>] .arch_remove_memory+0x60/0xc0
[<c00000000026446c>] .remove_memory+0x8c/0xe0
[<c00000000007f9f4>] .pseries_remove_memblock+0xd4/0x160
[<c00000000007fcfc>] .pseries_memory_notifier+0x27c/0x290
[<c0000000008ae6cc>] .notifier_call_chain+0x8c/0x100
[<c0000000000d858c>] .__blocking_notifier_call_chain+0x6c/0xe0
[<c00000000071ddec>] .of_property_notify+0x7c/0xc0
[<c00000000071ed3c>] .of_update_property+0x3c/0x1b0
[<c0000000000756cc>] .ofdt_write+0x3dc/0x740
[<c0000000002f60fc>] .proc_reg_write+0xac/0x110
[<c000000000268450>] .vfs_write+0xe0/0x260
[<c000000000269144>] .SyS_write+0x64/0x110
[<c000000000009ffc>] syscall_exit+0x0/0x7c
This patch uses lock_device_hotplug() to protect remove_memory() called
in pseries_remove_memblock(), which is also stated before function
remove_memory():
* NOTE: The caller must call lock_device_hotplug() to serialize hotplug
* and online/offline operations before this call, as required by
* try_offline_node().
*/
void __ref remove_memory(int nid, u64 start, u64 size)
With this lock held, the other process(#1120 above) trying to online the
memory block will retry the system call when calling
lock_device_hotplug_sysfs(), and finally find No such device error.
Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 573b488..e96357c 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -109,10 +109,12 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
nid = memory_add_physaddr_to_nid(base);
+ lock_device_hotplug();
for (i = 0; i < sections_per_block; i++) {
remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
base += MIN_MEMORY_BLOCK_SIZE;
}
+ unlock_device_hotplug();
/* Update memory regions for memory remove */
memblock_remove(base, memblock_size);
^ permalink raw reply related
* Re: [PATCH v3 2/2] ARM: dts: Append clock bindings for sai2 on VF610 platform
From: Nicolin Chen @ 2014-04-09 8:39 UTC (permalink / raw)
To: Shawn Guo
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
broonie, ijc+devicetree, linux-kernel, robh+dt, timur, Li.Xiubo,
rob, galak, linuxppc-dev
In-Reply-To: <20140409081137.GD28420@dragon>
Hi Shawn,
On Wed, Apr 09, 2014 at 04:11:38PM +0800, Shawn Guo wrote:
> On Fri, Apr 04, 2014 at 06:08:13PM +0800, Nicolin Chen wrote:
> > Since we added fours clock to the DT binding, we should update the current
> > SAI dts/dtsi so as not to break their functions.
>
> For the record, you're asking my ACK to have the dts change go via sound
> tree for not breaking vf610 function on the sound branch, while
> ignoring the fact that the existing DTB will break with the new kernel
> anyway.
>
> I'm not completely happy with the approach, but considering that the
> existing binding is incorrect, I'm fine with it as long as people agree
> to go this way.
Although I'm not a big fan of explaining, yet, I still want to say that
actually I've balanced this way and your last suggestion against the v1.
It'd be surely better to distinguish two platforms as you suggested if
we are looking at this change alone since the change is nearly tiny and
the code to specify them wouldn't be quite a lot. However, there's more
work to do based on this patch, an auto-selecting clock source mechanism
for SAI as a DAI master for example, which would need to drop the existing
code and to add the new one. If vf610 is still using the old one, it would
not benefit from the further feature and the code would be definitely ugly
as we would have to add too many platform checks. So personally I prefer
this reasonable change than the little sacrifice we're going to make here.
Right now I feel grateful for what Sascha suggested to the DT bindings of
fsl-spdif. It was a painstaking experience when getting it upstream last
year but what's done at that moment makes the driver more flexible. So I
think we should do the strict and comprehensive review for the clock part
to every module from now on since an once-defined-DT-binding would be so
painful to improved for us.
Thank you,
Nicolin
>
> Shawn
>
> >
> > Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
> > Tested-by: Xiubo Li <Li.Xiubo@freescale.com>
> > ---
> > arch/arm/boot/dts/vf610.dtsi | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
> > index d31ce1b..9fd0007 100644
> > --- a/arch/arm/boot/dts/vf610.dtsi
> > +++ b/arch/arm/boot/dts/vf610.dtsi
> > @@ -139,8 +139,10 @@
> > compatible = "fsl,vf610-sai";
> > reg = <0x40031000 0x1000>;
> > interrupts = <0 86 0x04>;
> > - clocks = <&clks VF610_CLK_SAI2>;
> > - clock-names = "sai";
> > + clocks = <&clks VF610_CLK_SAI2>,
> > + <&clks VF610_CLK_SAI2>,
> > + <&clks 0>, <&clks 0>;
> > + clock-names = "bus", "mclk1", "mclk2", "mclk3";
> > status = "disabled";
> > };
> >
> > --
> > 1.8.4
> >
> >
>
^ permalink raw reply
* [PATCH] powerpc/powernv Adapt opal-elog and opal-dump to new sysfs_remove_file_self API from (removed) sysfs_schedule_callback
From: Stewart Smith @ 2014-04-09 3:47 UTC (permalink / raw)
To: benh, linuxppc-dev; +Cc: Stewart Smith
A merge fix for powernv opal-dump and opal-elog code with driver-next
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/opal-dump.c | 9 ++-------
arch/powerpc/platforms/powernv/opal-elog.c | 9 ++-------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal-dump.c b/arch/powerpc/platforms/powernv/opal-dump.c
index 0c767c5..b9827b0 100644
--- a/arch/powerpc/platforms/powernv/opal-dump.c
+++ b/arch/powerpc/platforms/powernv/opal-dump.c
@@ -86,19 +86,14 @@ static int64_t dump_send_ack(uint32_t dump_id)
return rc;
}
-static void delay_release_kobj(void *kobj)
-{
- kobject_put((struct kobject *)kobj);
-}
-
static ssize_t dump_ack_store(struct dump_obj *dump_obj,
struct dump_attribute *attr,
const char *buf,
size_t count)
{
dump_send_ack(dump_obj->id);
- sysfs_schedule_callback(&dump_obj->kobj, delay_release_kobj,
- &dump_obj->kobj, THIS_MODULE);
+ sysfs_remove_file_self(&dump_obj->kobj, &attr->attr);
+ kobject_put(&dump_obj->kobj);
return count;
}
diff --git a/arch/powerpc/platforms/powernv/opal-elog.c b/arch/powerpc/platforms/powernv/opal-elog.c
index 1d7355b..ef7bc2a 100644
--- a/arch/powerpc/platforms/powernv/opal-elog.c
+++ b/arch/powerpc/platforms/powernv/opal-elog.c
@@ -70,19 +70,14 @@ static ssize_t elog_ack_show(struct elog_obj *elog_obj,
return sprintf(buf, "ack - acknowledge log message\n");
}
-static void delay_release_kobj(void *kobj)
-{
- kobject_put((struct kobject *)kobj);
-}
-
static ssize_t elog_ack_store(struct elog_obj *elog_obj,
struct elog_attribute *attr,
const char *buf,
size_t count)
{
opal_send_ack_elog(elog_obj->id);
- sysfs_schedule_callback(&elog_obj->kobj, delay_release_kobj,
- &elog_obj->kobj, THIS_MODULE);
+ sysfs_remove_file_self(&elog_obj->kobj, &attr->attr);
+ kobject_put(&elog_obj->kobj);
return count;
}
--
1.7.10.4
^ permalink raw reply related
* [PATCH] powerpc/rmu: Fix the error memory free parameters
From: Liu Gang @ 2014-04-09 10:04 UTC (permalink / raw)
To: linuxppc-dev, b07421; +Cc: Liu Gang, r61911
There are error parameters should be corrected when
calling dma_free_coherent to free rmu rx-ring buffers
in fsl_open_inb_mbox() function.
Signed-off-by: Liu Gang <Gang.Liu@freescale.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
---
arch/powerpc/sysdev/fsl_rmu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/sysdev/fsl_rmu.c b/arch/powerpc/sysdev/fsl_rmu.c
index 00e224a..b48197a 100644
--- a/arch/powerpc/sysdev/fsl_rmu.c
+++ b/arch/powerpc/sysdev/fsl_rmu.c
@@ -881,9 +881,9 @@ fsl_open_inb_mbox(struct rio_mport *mport, void *dev_id, int mbox, int entries)
rc = request_irq(IRQ_RIO_RX(mport), fsl_rio_rx_handler, 0,
"msg_rx", (void *)mport);
if (rc < 0) {
- dma_free_coherent(priv->dev, RIO_MSG_BUFFER_SIZE,
- rmu->msg_tx_ring.virt_buffer[i],
- rmu->msg_tx_ring.phys_buffer[i]);
+ dma_free_coherent(priv->dev,
+ rmu->msg_rx_ring.size * RIO_MAX_MSG_SIZE,
+ rmu->msg_rx_ring.virt, rmu->msg_rx_ring.phys);
goto out;
}
--
1.8.5
^ permalink raw reply related
* Re: hugetlb: ensure hugepage access is denied if hugepages are not supported
From: Mel Gorman @ 2014-04-09 10:25 UTC (permalink / raw)
To: Nishanth Aravamudan
Cc: linux-mm, paulus, anton, nyc, akpm, linuxppc-dev, aneesh.kumar
In-Reply-To: <20140403231413.GB17412@linux.vnet.ibm.com>
On Thu, Apr 03, 2014 at 04:14:13PM -0700, Nishanth Aravamudan wrote:
> In KVM guests on Power, in a guest not backed by hugepages, we see the
> following:
>
> AnonHugePages: 0 kB
> HugePages_Total: 0
> HugePages_Free: 0
> HugePages_Rsvd: 0
> HugePages_Surp: 0
> Hugepagesize: 64 kB
>
> HPAGE_SHIFT == 0 in this configuration, which indicates that hugepages
> are not supported at boot-time, but this is only checked in
> hugetlb_init(). Extract the check to a helper function, and use it in a
> few relevant places.
>
> This does make hugetlbfs not supported (not registered at all) in this
> environment. I believe this is fine, as there are no valid hugepages and
> that won't change at runtime.
>
> Signed-off-by: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Acked-by: Mel Gorman <mgorman@suse.de>
This patch looks ok but the changelog misses important information from
the original report which is probably why it fell through the cracks.
Add the fact that you encountered a problem during mount to the changelog
and resend it directly to Andrew. This part from your original report;
Currently, I am seeing the following when I `mount -t hugetlbfs
/none /dev/hugetlbfs`, and then simply do a `ls /dev/hugetlbfs`. I
think it's related to the fact that hugetlbfs is properly not
correctly setting itself up in this state?:
Unable to handle kernel paging request for data at address 0x00000031
Faulting instruction address: 0xc000000000245710
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=2048 NUMA pSeries
....
It probably slipped through the cracks because from the changelog this
looks like a minor formatting issue and not a functional fix.
>
> diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> index d19b30a..cc8fcc7 100644
> --- a/fs/hugetlbfs/inode.c
> +++ b/fs/hugetlbfs/inode.c
> @@ -1017,6 +1017,11 @@ static int __init init_hugetlbfs_fs(void)
> int error;
> int i;
>
> + if (!hugepages_supported()) {
> + printk(KERN_ERR "hugetlbfs: Disabling because there are no supported hugepage sizes\n");
> + return -ENOTSUPP;
> + }
> +
> error = bdi_init(&hugetlbfs_backing_dev_info);
> if (error)
> return error;
KERN_ERR feels like overkill for this type of issue. KERN_INFO?
--
Mel Gorman
SUSE Labs
^ permalink raw reply
* [PATCH v4] ASoC: fsl_sai: Add clock controls for SAI
From: Nicolin Chen @ 2014-04-09 11:06 UTC (permalink / raw)
To: broonie, Li.Xiubo
Cc: mark.rutland, devicetree, alsa-devel, pawel.moll, linux-doc,
ijc+devicetree, linux-kernel, timur, robh+dt, rob, galak,
shawn.guo, linuxppc-dev
The SAI mainly has the following clocks:
bus clock
control and configure registers and to generate synchronous
interrupts and DMA requests.
mclk1, mclk2, mclk3
to generate the bit clock when the receiver or transmitter is
configured for an internally generated bit clock.
So this patch adds these clocks and their clock controls to the driver,
meanwhile, corrects the existing DTS accordingly so those platforms can
benifit from the further feature with different clock sources.
Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com>
CC: Xiubo Li <Li.Xiubo@freescale.com>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
---
@Xiubo
Even though you've tested it before, I'd still like to wait for your test
result to this newer version.
Changelog
v4:
* Merged into single patch.
* Fixed bus clock ID on vf610.
v3:
* Use int type for ret instead of u32.
* Added Acked-by and Tested-by from Xiubo Li.
v2:
* Appended two extra mclks to the driver since SAI actually has three.
* Renamed clock name to 'bus' and 'mclk' according to the reference manual.
.../devicetree/bindings/sound/fsl-sai.txt | 9 ++--
arch/arm/boot/dts/vf610.dtsi | 6 ++-
sound/soc/fsl/fsl_sai.c | 51 ++++++++++++++++++++--
sound/soc/fsl/fsl_sai.h | 4 ++
4 files changed, 61 insertions(+), 9 deletions(-)
diff --git a/Documentation/devicetree/bindings/sound/fsl-sai.txt b/Documentation/devicetree/bindings/sound/fsl-sai.txt
index 35c09fe..0f4e238 100644
--- a/Documentation/devicetree/bindings/sound/fsl-sai.txt
+++ b/Documentation/devicetree/bindings/sound/fsl-sai.txt
@@ -10,7 +10,8 @@ Required properties:
- compatible: Compatible list, contains "fsl,vf610-sai" or "fsl,imx6sx-sai".
- reg: Offset and length of the register set for the device.
- clocks: Must contain an entry for each entry in clock-names.
-- clock-names : Must include the "sai" entry.
+- clock-names : Must include the "bus" for register access and "mclk1" "mclk2"
+ "mclk3" for bit clock and frame clock providing.
- dmas : Generic dma devicetree binding as described in
Documentation/devicetree/bindings/dma/dma.txt.
- dma-names : Two dmas have to be defined, "tx" and "rx".
@@ -30,8 +31,10 @@ sai2: sai@40031000 {
reg = <0x40031000 0x1000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2_1>;
- clocks = <&clks VF610_CLK_SAI2>;
- clock-names = "sai";
+ clocks = <&clks VF610_CLK_PLATFORM_BUS>,
+ <&clks VF610_CLK_SAI2>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
dma-names = "tx", "rx";
dmas = <&edma0 0 VF610_EDMA_MUXID0_SAI2_TX>,
<&edma0 0 VF610_EDMA_MUXID0_SAI2_RX>;
diff --git a/arch/arm/boot/dts/vf610.dtsi b/arch/arm/boot/dts/vf610.dtsi
index d31ce1b..4c3cd59 100644
--- a/arch/arm/boot/dts/vf610.dtsi
+++ b/arch/arm/boot/dts/vf610.dtsi
@@ -139,8 +139,10 @@
compatible = "fsl,vf610-sai";
reg = <0x40031000 0x1000>;
interrupts = <0 86 0x04>;
- clocks = <&clks VF610_CLK_SAI2>;
- clock-names = "sai";
+ clocks = <&clks VF610_CLK_PLATFORM_BUS>,
+ <&clks VF610_CLK_SAI2>,
+ <&clks 0>, <&clks 0>;
+ clock-names = "bus", "mclk1", "mclk2", "mclk3";
status = "disabled";
};
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index db9f75e..7cd4af9 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -401,7 +401,23 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
- u32 reg;
+ struct device *dev = &sai->pdev->dev;
+ u32 reg, i;
+ int ret;
+
+ ret = clk_prepare_enable(sai->bus_clk);
+ if (ret) {
+ dev_err(dev, "failed to enable bus clock\n");
+ return ret;
+ }
+
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++) {
+ ret = clk_prepare_enable(sai->mclk_clk[i]);
+ if (ret) {
+ dev_err(dev, "failed to enable mclk%d clock\n", i + 1);
+ goto err;
+ }
+ }
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
reg = FSL_SAI_TCR3;
@@ -412,13 +428,20 @@ static int fsl_sai_startup(struct snd_pcm_substream *substream,
FSL_SAI_CR3_TRCE);
return 0;
+
+err:
+ for (; i > 0; i--)
+ clk_disable_unprepare(sai->mclk_clk[i - 1]);
+ clk_disable_unprepare(sai->bus_clk);
+
+ return ret;
}
static void fsl_sai_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
- u32 reg;
+ u32 reg, i;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
reg = FSL_SAI_TCR3;
@@ -427,6 +450,10 @@ static void fsl_sai_shutdown(struct snd_pcm_substream *substream,
regmap_update_bits(sai->regmap, reg, FSL_SAI_CR3_TRCE,
~FSL_SAI_CR3_TRCE);
+
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++)
+ clk_disable_unprepare(sai->mclk_clk[i]);
+ clk_disable_unprepare(sai->bus_clk);
}
static const struct snd_soc_dai_ops fsl_sai_pcm_dai_ops = {
@@ -559,7 +586,8 @@ static int fsl_sai_probe(struct platform_device *pdev)
struct fsl_sai *sai;
struct resource *res;
void __iomem *base;
- int irq, ret;
+ char tmp[8];
+ int irq, ret, i;
sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL);
if (!sai)
@@ -582,12 +610,27 @@ static int fsl_sai_probe(struct platform_device *pdev)
return PTR_ERR(base);
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
- "sai", base, &fsl_sai_regmap_config);
+ "bus", base, &fsl_sai_regmap_config);
if (IS_ERR(sai->regmap)) {
dev_err(&pdev->dev, "regmap init failed\n");
return PTR_ERR(sai->regmap);
}
+ sai->bus_clk = devm_clk_get(&pdev->dev, "bus");
+ if (IS_ERR(sai->bus_clk)) {
+ dev_err(&pdev->dev, "failed to get bus clock\n");
+ return PTR_ERR(sai->bus_clk);
+ }
+
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++) {
+ sprintf(tmp, "mclk%d", i + 1);
+ sai->mclk_clk[i] = devm_clk_get(&pdev->dev, tmp);
+ if (IS_ERR(sai->mclk_clk[i])) {
+ dev_err(&pdev->dev, "failed to get mclk%d clock\n", i + 1);
+ return PTR_ERR(sai->mclk_clk[i]);
+ }
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h
index 677670d..0e6c9f5 100644
--- a/sound/soc/fsl/fsl_sai.h
+++ b/sound/soc/fsl/fsl_sai.h
@@ -119,6 +119,8 @@
#define FSL_SAI_CLK_MAST2 2
#define FSL_SAI_CLK_MAST3 3
+#define FSL_SAI_MCLK_MAX 3
+
/* SAI data transfer numbers per DMA request */
#define FSL_SAI_MAXBURST_TX 6
#define FSL_SAI_MAXBURST_RX 6
@@ -126,6 +128,8 @@
struct fsl_sai {
struct platform_device *pdev;
struct regmap *regmap;
+ struct clk *bus_clk;
+ struct clk *mclk_clk[FSL_SAI_MCLK_MAX];
bool big_endian_regs;
bool big_endian_data;
--
1.8.4
^ permalink raw reply related
* [PATCH 1/2][powerpc/fsl] Added binding for Freescale CoreNet coherency fabric (CCF)
From: Diana Craciun @ 2014-04-09 12:23 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Diana Craciun
From: Diana Craciun <Diana.Craciun@freescale.com>
The CoreNet coherency fabric is a fabric-oriented, conectivity
infrastructure that enables the implementation of coherent, multicore
systems. The CCF acts as a central interconnect for cores,
platform-level caches, memory subsystem, peripheral devices and I/O host
bridges in the system.
Signed-off-by: Diana Craciun <Diana.Craciun@freescale.com>
---
.../devicetree/bindings/powerpc/fsl/ccf.txt | 37 ++++++++++++++++++++++
1 file changed, 37 insertions(+)
create mode 100644 Documentation/devicetree/bindings/powerpc/fsl/ccf.txt
diff --git a/Documentation/devicetree/bindings/powerpc/fsl/ccf.txt b/Documentation/devicetree/bindings/powerpc/fsl/ccf.txt
new file mode 100644
index 0000000..61f1a33
--- /dev/null
+++ b/Documentation/devicetree/bindings/powerpc/fsl/ccf.txt
@@ -0,0 +1,37 @@
+Freescale CoreNet Coherency Fabric(CCF) Device Tree Binding
+
+DESCRIPTION
+
+The CoreNet coherency fabric is a fabric-oriented, connectivity infrastructure
+that enables the implementation of coherent, multicore systems.
+
+Required properties:
+
+- compatible : <string>
+ fsl,corenet-cf - CoreNet coherency fabric version 1
+ fsl,corenetX-cf - CoreNet coherency fabric version X
+
+- reg : <prop-encoded-array>
+ A standard property. Specifies the pshysical address and
+ length of the CoreNet coherency fabric memory space.
+
+- interrupts : <prop-encoded-array>
+ Interrupt mapping for CCF error interrupt.
+
+- fsl,ccf-num-csdids: <u32>
+ Specifies the number of Coherency Subdomain ID Port Mapping
+ Registers that are supported by the CCF.
+
+- fsl,ccf-num-snoopids: <u32>
+ Specifies the number of Snoop ID Port Mapping Registers that
+ are supported by CCF.
+
+Example:
+
+ corenet-cf@18000 {
+ compatible = "fsl,corenet2-cf";
+ reg = <0x18000 0x1000>;
+ interrupts = <16 2 1 31>;
+ fsl,ccf-num-csdids = <32>;
+ fsl,ccf-num-snoopids = <32>;
+ };
--
1.7.11.7
^ permalink raw reply related
* [PATCH 2/2][powerpc/fsl] Updated T4240 corenet-cf node in device tree
From: Diana Craciun @ 2014-04-09 12:23 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Diana Craciun
In-Reply-To: <1397046198-8496-1-git-send-email-diana.craciun@freescale.com>
From: Diana Craciun <Diana.Craciun@freescale.com>
Updated the compatible to reflect that CCF hardware
is different on T4240
Signed-off-by: Diana Craciun <Diana.Craciun@freescale.com>
---
arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
index f99d74f..e1a8734 100644
--- a/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
+++ b/arch/powerpc/boot/dts/fsl/t4240si-post.dtsi
@@ -343,7 +343,7 @@
};
corenet-cf@18000 {
- compatible = "fsl,corenet-cf";
+ compatible = "fsl,corenet2-cf";
reg = <0x18000 0x1000>;
interrupts = <16 2 1 31>;
fsl,ccf-num-csdids = <32>;
--
1.7.11.7
^ permalink raw reply related
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Dave Hansen @ 2014-04-09 15:46 UTC (permalink / raw)
To: Madhavan Srinivasan, linux-kernel, linuxppc-dev, linux-mm,
linux-arch, x86
Cc: riel, ak, peterz, rusty, paulus, mgorman, akpm, mingo,
kirill.shutemov
In-Reply-To: <5344A312.80802@linux.vnet.ibm.com>
On 04/08/2014 06:32 PM, Madhavan Srinivasan wrote:
>> > In mm/Kconfig, put
>> >
>> > config FAULT_AROUND_ORDER
>> > int
>> > default 1234 if POWERPC
>> > default 4
>> >
>> > The way you have it now, every single architecture that needs to enable
>> > this has to go put that in their Kconfig. That's madness. This way,
> I though about it and decided not to do this way because, in future,
> sub platforms of the architecture may decide to change the values. Also,
> adding an if line for each architecture with different sub platforms
> oring to it will look messy.
I'm not sure why I'm trying here any more. You do seem quite content to
add as much cruft to ppc and every other architecture as possible. If
your theoretical scenario pops up, you simply do this in ppc:
config ARCH_FAULT_AROUND_ORDER
int
default 999
default 888 if OTHER_SILLY_POWERPC_SUBARCH
But *ONLY* in the architectures that care about doing that stuff. You
leave every other architecture on the planet alone. Then, in mm/Kconfig:
config FAULT_AROUND_ORDER
int
default ARCH_FAULT_AROUND_ORDER if ARCH_FAULT_AROUND_ORDER
default 4
Your way still requires going and individually touching every single
architecture's Kconfig that wants to enable fault around. That's not an
acceptable solution.
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Dave Hansen @ 2014-04-09 15:48 UTC (permalink / raw)
To: Peter Zijlstra, Madhavan Srinivasan
Cc: linux-arch, riel, rusty, x86, linux-kernel, linux-mm, ak, paulus,
mgorman, akpm, linuxppc-dev, mingo, kirill.shutemov
In-Reply-To: <20140409082008.GA10526@twins.programming.kicks-ass.net>
On 04/09/2014 01:20 AM, Peter Zijlstra wrote:
> This still misses out on Ben's objection that its impossible to get this
> right at compile time for many kernels, since they can boot and run on
> many different subarchs.
Completely agree. The Kconfig-time stuff should probably just be a knob
to turn it off completely, if anything.
^ permalink raw reply
* Re: [RFC PATCH powerpc] Protect remove_memory() with device hotplug lock
From: Nathan Fontenot @ 2014-04-09 16:14 UTC (permalink / raw)
To: Li Zhong, PowerPC email list; +Cc: Paul Mackerras
In-Reply-To: <1397033686.25199.33.camel@ThinkPad-T5421.cn.ibm.com>
On 04/09/2014 03:54 AM, Li Zhong wrote:
> While testing memory hot-remove, I found following dead lock:
>
> Process #1141 is drmgr, trying to remove some memory, i.e. memory499.
> It holds the memory_hotplug_mutex, and blocks when trying to remove file
> "online" under dir memory499, in kernfs_drain(), at
> wait_event(root->deactivate_waitq,
> atomic_read(&kn->active) == KN_DEACTIVATED_BIAS);
>
> Process #1120 is trying to online memory499 by
> echo 1 > memory499/online
>
> In .kernfs_fop_write, it uses kernfs_get_active() to increase
> &kn->active, thus blocking process #1141. While itself is blocked later
> when trying to acquire memory_hotplug_mutex, which is held by process
> #1141.
>
> The backtrace of both processes are shown below:
>
> # cat /proc/1120/stack
> [<c000000001b18600>] 0xc000000001b18600
> [<c000000000015044>] .__switch_to+0x144/0x200
> [<c000000000263ca4>] .online_pages+0x74/0x7b0
> [<c00000000055b40c>] .memory_subsys_online+0x9c/0x150
> [<c00000000053cbe8>] .device_online+0xb8/0x120
> [<c00000000053cd04>] .online_store+0xb4/0xc0
> [<c000000000538ce4>] .dev_attr_store+0x64/0xa0
> [<c00000000030f4ec>] .sysfs_kf_write+0x7c/0xb0
> [<c00000000030e574>] .kernfs_fop_write+0x154/0x1e0
> [<c000000000268450>] .vfs_write+0xe0/0x260
> [<c000000000269144>] .SyS_write+0x64/0x110
> [<c000000000009ffc>] syscall_exit+0x0/0x7c
>
>
> # cat /proc/1141/stack
> [<c000000001b18600>] 0xc000000001b18600
> [<c000000000015044>] .__switch_to+0x144/0x200
> [<c00000000030be14>] .__kernfs_remove+0x204/0x300
> [<c00000000030d428>] .kernfs_remove_by_name_ns+0x68/0xf0
> [<c00000000030fb38>] .sysfs_remove_file_ns+0x38/0x60
> [<c000000000539354>] .device_remove_attrs+0x54/0xc0
> [<c000000000539fd8>] .device_del+0x158/0x250
> [<c00000000053a104>] .device_unregister+0x34/0xa0
> [<c00000000055bc14>] .unregister_memory_section+0x164/0x170
> [<c00000000024ee18>] .__remove_pages+0x108/0x4c0
> [<c00000000004b590>] .arch_remove_memory+0x60/0xc0
> [<c00000000026446c>] .remove_memory+0x8c/0xe0
> [<c00000000007f9f4>] .pseries_remove_memblock+0xd4/0x160
> [<c00000000007fcfc>] .pseries_memory_notifier+0x27c/0x290
> [<c0000000008ae6cc>] .notifier_call_chain+0x8c/0x100
> [<c0000000000d858c>] .__blocking_notifier_call_chain+0x6c/0xe0
> [<c00000000071ddec>] .of_property_notify+0x7c/0xc0
> [<c00000000071ed3c>] .of_update_property+0x3c/0x1b0
> [<c0000000000756cc>] .ofdt_write+0x3dc/0x740
> [<c0000000002f60fc>] .proc_reg_write+0xac/0x110
> [<c000000000268450>] .vfs_write+0xe0/0x260
> [<c000000000269144>] .SyS_write+0x64/0x110
> [<c000000000009ffc>] syscall_exit+0x0/0x7c
>
> This patch uses lock_device_hotplug() to protect remove_memory() called
> in pseries_remove_memblock(), which is also stated before function
> remove_memory():
>
> * NOTE: The caller must call lock_device_hotplug() to serialize hotplug
> * and online/offline operations before this call, as required by
> * try_offline_node().
> */
> void __ref remove_memory(int nid, u64 start, u64 size)
>
> With this lock held, the other process(#1120 above) trying to online the
> memory block will retry the system call when calling
> lock_device_hotplug_sysfs(), and finally find No such device error.
>
> Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
> ---
> arch/powerpc/platforms/pseries/hotplug-memory.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
> index 573b488..e96357c 100644
> --- a/arch/powerpc/platforms/pseries/hotplug-memory.c
> +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
> @@ -109,10 +109,12 @@ static int pseries_remove_memblock(unsigned long base, unsigned int memblock_siz
> sections_per_block = block_sz / MIN_MEMORY_BLOCK_SIZE;
> nid = memory_add_physaddr_to_nid(base);
>
> + lock_device_hotplug();
> for (i = 0; i < sections_per_block; i++) {
> remove_memory(nid, base, MIN_MEMORY_BLOCK_SIZE);
> base += MIN_MEMORY_BLOCK_SIZE;
> }
> + unlock_device_hotplug();
>
Should we be releasing the lock here? I think we want to hold the lock
until we exit pseries_remove_memblock(). This would ensure that are able
to finish all the work needed to remove memory while holding the lock.
-Nathan
> /* Update memory regions for memory remove */
> memblock_remove(base, memblock_size);
>
>
^ permalink raw reply
* [PATCH 01/60] powerpc/powernv: Return secondary CPUs to firmware before FW update
From: Vasant Hegde @ 2014-04-09 17:18 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Vasant Hegde
Firmware update on PowerNV platform takes several minutes. During
this time one CPU is stuck in FW and the kernel complains about "soft
lockups".
This patch returns all secondary CPUs to firmware before starting
firmware update process.
[ Reworked a bit and cleaned up -- BenH ]
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
arch/powerpc/include/asm/opal.h | 1 +
arch/powerpc/platforms/powernv/opal-flash.c | 47 ++++++++++++++++++++++++++---
arch/powerpc/platforms/powernv/setup.c | 25 +++++++++++++--
3 files changed, 66 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 05a23d0..5c34170 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -922,6 +922,7 @@ extern unsigned long opal_get_boot_time(void);
extern void opal_nvram_init(void);
extern int opal_elog_register_init(void);
extern void opal_flash_init(void);
+extern void opal_flash_term_callback(void);
extern int opal_elog_init(void);
extern void opal_platform_dump_init(void);
extern void opal_sys_param_init(void);
diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
index 16e571b..11ab43f 100644
--- a/arch/powerpc/platforms/powernv/opal-flash.c
+++ b/arch/powerpc/platforms/powernv/opal-flash.c
@@ -20,6 +20,7 @@
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
+#include <linux/delay.h>
#include <asm/opal.h>
@@ -388,11 +389,6 @@ static int opal_flash_update(int op)
(sg->num_entries * sizeof(struct opal_sg_entry) + 16);
}
- pr_alert("FLASH: Image is %u bytes\n", image_data.size);
- pr_alert("FLASH: Image update requested\n");
- pr_alert("FLASH: Image will be updated during system reboot\n");
- pr_alert("FLASH: This will take several minutes. Do not power off!\n");
-
flash:
rc = opal_update_flash(addr);
@@ -400,6 +396,47 @@ invalid_img:
return rc;
}
+/* Return CPUs to OPAL before starting FW update */
+static void flash_return_cpu(void *info)
+{
+ int cpu = smp_processor_id();
+
+ if (!cpu_online(cpu))
+ return;
+
+ /* Disable IRQ */
+ hard_irq_disable();
+
+ /* Return the CPU to OPAL */
+ opal_return_cpu();
+}
+
+/* This gets called just before system reboots */
+void opal_flash_term_callback(void)
+{
+ struct cpumask mask;
+
+ if (update_flash_data.status != FLASH_IMG_READY)
+ return;
+
+ pr_alert("FLASH: Flashing new firmware\n");
+ pr_alert("FLASH: Image is %u bytes\n", image_data.size);
+ pr_alert("FLASH: Performing flash and reboot/shutdown\n");
+ pr_alert("FLASH: This will take several minutes. Do not power off!\n");
+
+ /* Small delay to help getting the above message out */
+ msleep(500);
+
+ /* Return secondary CPUs to firmware */
+ cpumask_copy(&mask, cpu_online_mask);
+ cpumask_clear_cpu(smp_processor_id(), &mask);
+ if (!cpumask_empty(&mask))
+ smp_call_function_many(&mask,
+ flash_return_cpu, NULL, false);
+ /* Hard disable interrupts */
+ hard_irq_disable();
+}
+
/*
* Show candidate image status
*/
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 1735678..42c16a6 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -98,11 +98,32 @@ static void pnv_show_cpuinfo(struct seq_file *m)
of_node_put(root);
}
+static void pnv_prepare_going_down(void)
+{
+ /*
+ * Disable all notifiers from OPAL, we can't
+ * service interrupts anymore anyway
+ */
+ opal_notifier_disable();
+
+ /* Soft disable interrupts */
+ local_irq_disable();
+
+ /*
+ * Return secondary CPUs to firwmare if a flash update
+ * is pending otherwise we will get all sort of error
+ * messages about CPU being stuck etc.. This will also
+ * have the side effect of hard disabling interrupts so
+ * past this point, the kernel is effectively dead.
+ */
+ opal_flash_term_callback();
+}
+
static void __noreturn pnv_restart(char *cmd)
{
long rc = OPAL_BUSY;
- opal_notifier_disable();
+ pnv_prepare_going_down();
while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
rc = opal_cec_reboot();
@@ -119,7 +140,7 @@ static void __noreturn pnv_power_off(void)
{
long rc = OPAL_BUSY;
- opal_notifier_disable();
+ pnv_prepare_going_down();
while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
rc = opal_cec_power_down(0);
--
1.8.3.1
^ permalink raw reply related
* Re: [PATCH v2] powernv: kvm: make _PAGE_NUMA take effect
From: Liu ping fan @ 2014-04-10 3:28 UTC (permalink / raw)
To: Alexander Graf
Cc: kvm-devel, kvm-ppc, Paul Mackerras, Aneesh Kumar K.V,
linuxppc-dev, Alexander Graf
In-Reply-To: <53426385.2010102@suse.de>
On Mon, Apr 7, 2014 at 4:36 PM, Alexander Graf <agraf@suse.de> wrote:
>
> On 07.04.14 09:42, Aneesh Kumar K.V wrote:
>>
>> Alexander Graf <agraf@suse.com> writes:
>>
>>> On 03.04.14 04:36, Liu ping fan wrote:
>>>>
>>>> Hi Alex, could you help to pick up this patch? since v3.14 kernel can
>>>> enable numa fault for powerpc.
>>>
>>> What bad happens without this patch? We map a page even though it was
>>> declared to get NUMA migrated? What happens next?
>>
>> Nothing much, we won't be properly accounting the numa access in the
>> host. What we want to achieve is to convert a guest access of the page to
>> a host fault so that we can do proper numa access accounting in the
>> host. This would enable us to migrate the page to the correct numa
>> node.
>
>
> Ok, so no breakages, just less performance. I wouldn't consider it stable
> material then :).
>
Sorry to reply late, since I am half out of office during this period.
I am puzzling about you reply. Without this patch, the guest can
NOT sense the numa changes and ask host to put the pages in right
place. So the pages which is used by guest will be always misplaced.
The numa-fault method is inspired by real requirement to improve
performance, so we should also consider the performance drop of guest.
Right?
Regards,
Fan
>
> Alex
>
^ permalink raw reply
* Re: [PATCH v2] fix wrong usage of dmaengine_unmap_put in async_xxx
From: Dan Williams @ 2014-04-10 4:01 UTC (permalink / raw)
To: xuelin.shi; +Cc: Koul, Vinod, dmaengine@vger.kernel.org, linuxppc-dev
In-Reply-To: <1395303385-29461-1-git-send-email-xuelin.shi@freescale.com>
On Thu, Mar 20, 2014 at 1:16 AM, <xuelin.shi@freescale.com> wrote:
> From: Xuelin Shi <xuelin.shi@freescale.com>
>
> dmaengine_unmap_put does below two things:
> a) unmap pages for srcs and dests
> b) free unmap struct
>
> The unmap struct data is generated but only initialized while
> other some dma contions are met, like dma alignment etc.
> If the unmap data is not initialized, call dmaengine_unmap_put
> will unmap some random data in unmap->addr[...]
Actually, this should be fixed by your other patch:
https://patchwork.kernel.org/patch/3863711/
Because the to_cnt, from_cnt, are properly initialized to zero. The
only issue was that the unmap pool was not specified.
Can you verify that the problem still exists with that patch applied?
I'll mark it for -stable.
> Also call dmaengine_get_unmap_data immediatally after generating tx
> is not correct. Maybe the tx has not been finished by DMA hardware
> yet but the srcs and dests are dma unmapped.
I disagree. It is correct because the unmap data is reference
counted. If the DMA hardware is still using the buffers then it must
hold a reference on the unmap data. The dmaengine_put_unmap_data()
instances your are removing are the ones that drop the initial
reference count set in dmaengine_get_unmap_data().
^ permalink raw reply
* Re: [PATCH v2] fix dmaengine_unmap failure
From: Dan Williams @ 2014-04-10 4:03 UTC (permalink / raw)
To: xuelin.shi; +Cc: Koul, Vinod, dmaengine@vger.kernel.org, linuxppc-dev
In-Reply-To: <1395297230-8195-1-git-send-email-xuelin.shi@freescale.com>
On Wed, Mar 19, 2014 at 11:33 PM, <xuelin.shi@freescale.com> wrote:
> From: Xuelin Shi <xuelin.shi@freescale.com>
>
> The count which is used to get_unmap_data maybe not the same as the
> count computed in dmaengine_unmap which causes to free data in a
> wrong pool.
>
> This patch fixes this issue by keeping the map count with unmap_data
> structure and use this count to get the pool.
>
> Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
> ---
> change history:
> v1: keep mempool pointer with unmap struct
> v2: keep u8 map_cnt instead of mempool pointer to save mem.
>
Looks good, but please next time remember to prefix your subject line. I.e.
"dmaengine: fix dmaengine_unmap failure"
I'll fix this up.
--
Dan
^ permalink raw reply
* [PATCH] Fix 3bc95598 'powerpc/PCI: Use list_for_each_entry() for bus traversal'
From: Mike Qiu @ 2014-04-10 6:51 UTC (permalink / raw)
To: linuxppc-dev; +Cc: wangyijing, Mike Qiu, anton, bhelgaas, paulus
Unable to handle kernel paging request for data at address 0x00000000
Faulting instruction address: 0xc000000000041d78
Oops: Kernel access of bad area, sig: 11 [#1]
...
NIP [c000000000041d78] .sys_pciconfig_iobase+0x68/0x1f0
LR [c000000000041e0c] .sys_pciconfig_iobase+0xfc/0x1f0
Call Trace:
[c0000003b4787db0] [c000000000041e0c] .sys_pciconfig_iobase+0xfc/0x1f0 (unreliable)
[c0000003b4787e30] [c000000000009ed8] syscall_exit+0x0/0x98
This bug was introduced by commit 3bc955987fb377f3c95bc29deb498e96819b8451
The root cause was the 'bus' has been set to null while try to access
bus->next.
Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
---
arch/powerpc/kernel/pci_64.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index 2a47790..7b6c1ae 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -209,6 +209,7 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
{
struct pci_controller* hose;
struct pci_bus *bus = NULL;
+ struct pci_bus *tmp_bus = NULL;
struct device_node *hose_node;
/* Argh ! Please forgive me for that hack, but that's the
@@ -229,10 +230,12 @@ long sys_pciconfig_iobase(long which, unsigned long in_bus,
* used on pre-domains setup. We return the first match
*/
- list_for_each_entry(bus, &pci_root_buses, node) {
- if (in_bus >= bus->number && in_bus <= bus->busn_res.end)
+ list_for_each_entry(tmp_bus, &pci_root_buses, node) {
+ if (in_bus >= tmp_bus->number &&
+ in_bus <= tmp_bus->busn_res.end) {
+ bus = tmp_bus;
break;
- bus = NULL;
+ }
}
if (bus == NULL || bus->dev.of_node == NULL)
return -ENODEV;
--
1.8.0.1
^ permalink raw reply related
* Re: [PATCH v2 8/8] DMA: Freescale: add suspend resume functions for DMA driver
From: Hongbo Zhang @ 2014-04-10 6:55 UTC (permalink / raw)
To: vkoul, dan.j.williams, dmaengine; +Cc: scottwood, linuxppc-dev, linux-kernel
In-Reply-To: <1396582037-23065-9-git-send-email-hongbo.zhang@freescale.com>
On 04/04/2014 11:27 AM, hongbo.zhang@freescale.com wrote:
> From: Hongbo Zhang <hongbo.zhang@freescale.com>
>
> This patch adds suspend resume functions for Freescale DMA driver.
> .prepare callback is used to stop further descriptors from being added into the
> pending queue, and also issue pending queues into execution if there is any.
> .suspend callback makes sure all the pending jobs are cleaned up and all the
> channels are idle, and save the mode registers.
> .resume callback re-initializes the channels by restore the mode registers.
>
> Signed-off-by: Hongbo Zhang <hongbo.zhang@freescale.com>
> ---
> drivers/dma/fsldma.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++
> drivers/dma/fsldma.h | 16 ++++++++
> 2 files changed, 115 insertions(+)
>
> diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
> index c9bf54a..91482d2 100644
> --- a/drivers/dma/fsldma.c
> +++ b/drivers/dma/fsldma.c
> @@ -400,6 +400,14 @@ static dma_cookie_t fsl_dma_tx_submit(struct dma_async_tx_descriptor *tx)
>
> spin_lock_bh(&chan->desc_lock);
>
> +#ifdef CONFIG_PM
> + if (unlikely(chan->pm_state != RUNNING)) {
> + chan_dbg(chan, "cannot submit due to suspend\n");
> + spin_unlock_bh(&chan->desc_lock);
> + return -1;
> + }
> +#endif
> +
> /*
> * assign cookies to all of the software descriptors
> * that make up this transaction
> @@ -1311,6 +1319,9 @@ static int fsl_dma_chan_probe(struct fsldma_device *fdev,
> INIT_LIST_HEAD(&chan->ld_running);
> INIT_LIST_HEAD(&chan->ld_completed);
> chan->idle = true;
> +#ifdef CONFIG_PM
> + chan->pm_state = RUNNING;
> +#endif
>
> chan->common.device = &fdev->common;
> dma_cookie_init(&chan->common);
> @@ -1450,6 +1461,91 @@ static int fsldma_of_remove(struct platform_device *op)
> return 0;
> }
>
> +#ifdef CONFIG_PM
> +static int fsldma_prepare(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct fsldma_device *fdev = platform_get_drvdata(pdev);
> + struct fsldma_chan *chan;
> + int i;
> +
> + for (i = 0; i < FSL_DMA_MAX_CHANS_PER_DEVICE; i++) {
> + chan = fdev->chan[i];
> + if (!chan)
> + continue;
> +
> + spin_lock_bh(&chan->desc_lock);
> + chan->pm_state = SUSPENDING;
> + if (!list_empty(&chan->ld_pending))
> + fsl_chan_xfer_ld_queue(chan);
> + spin_unlock_bh(&chan->desc_lock);
> + }
> +
> + return 0;
> +}
> +
> +static int fsldma_suspend(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct fsldma_device *fdev = platform_get_drvdata(pdev);
> + struct fsldma_chan *chan;
> + int i;
> +
> + for (i = 0; i < FSL_DMA_MAX_CHANS_PER_DEVICE; i++) {
> + chan = fdev->chan[i];
> + if (!chan)
> + continue;
> +
> + spin_lock_bh(&chan->desc_lock);
> + if (!chan->idle)
> + goto out;
> + chan->regs_save.mr = DMA_IN(chan, &chan->regs->mr, 32);
> + chan->pm_state = SUSPENDED;
> + spin_unlock_bh(&chan->desc_lock);
> + }
> + return 0;
> +
> +out:
> + for (; i >= 0; i--) {
> + chan = fdev->chan[i];
> + if (!chan)
> + continue;
the pm_state should be restored too, e.g.
chan->pm_state = RUNNING;
I will send new iteration for adding this.
> + spin_unlock_bh(&chan->desc_lock);
> + }
> + return -EBUSY;
> +}
> +
> +static int fsldma_resume(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct fsldma_device *fdev = platform_get_drvdata(pdev);
> + struct fsldma_chan *chan;
> + u32 mode;
> + int i;
> +
> + for (i = 0; i < FSL_DMA_MAX_CHANS_PER_DEVICE; i++) {
> + chan = fdev->chan[i];
> + if (!chan)
> + continue;
> +
> + spin_lock_bh(&chan->desc_lock);
> + mode = chan->regs_save.mr
> + & ~FSL_DMA_MR_CS & ~FSL_DMA_MR_CC & ~FSL_DMA_MR_CA;
> + DMA_OUT(chan, &chan->regs->mr, mode, 32);
> + chan->pm_state = RUNNING;
> + spin_unlock_bh(&chan->desc_lock);
> + }
> +
> + return 0;
> +}
> +
> +static const struct dev_pm_ops fsldma_pm_ops = {
> + .prepare = fsldma_prepare,
> + .suspend = fsldma_suspend,
> + .resume = fsldma_resume,
> +};
> +#endif
> +
> static const struct of_device_id fsldma_of_ids[] = {
> { .compatible = "fsl,elo3-dma", },
> { .compatible = "fsl,eloplus-dma", },
> @@ -1462,6 +1558,9 @@ static struct platform_driver fsldma_of_driver = {
> .name = "fsl-elo-dma",
> .owner = THIS_MODULE,
> .of_match_table = fsldma_of_ids,
> +#ifdef CONFIG_PM
> + .pm = &fsldma_pm_ops,
> +#endif
> },
> .probe = fsldma_of_probe,
> .remove = fsldma_of_remove,
> diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h
> index ec19517..eecaf9e 100644
> --- a/drivers/dma/fsldma.h
> +++ b/drivers/dma/fsldma.h
> @@ -134,6 +134,18 @@ struct fsldma_device {
> #define FSL_DMA_CHAN_PAUSE_EXT 0x00001000
> #define FSL_DMA_CHAN_START_EXT 0x00002000
>
> +#ifdef CONFIG_PM
> +struct fsldma_chan_regs_save {
> + u32 mr;
> +};
> +
> +enum fsldma_pm_state {
> + RUNNING = 0,
> + SUSPENDING,
> + SUSPENDED,
> +};
> +#endif
> +
> struct fsldma_chan {
> char name[8]; /* Channel name */
> struct fsldma_chan_regs __iomem *regs;
> @@ -161,6 +173,10 @@ struct fsldma_chan {
> struct tasklet_struct tasklet;
> u32 feature;
> bool idle; /* DMA controller is idle */
> +#ifdef CONFIG_PM
> + struct fsldma_chan_regs_save regs_save;
> + enum fsldma_pm_state pm_state;
> +#endif
>
> void (*toggle_ext_pause)(struct fsldma_chan *fsl_chan, int enable);
> void (*toggle_ext_start)(struct fsldma_chan *fsl_chan, int enable);
^ permalink raw reply
* Re: [PATCH 01/60] powerpc/powernv: Return secondary CPUs to firmware before FW update
From: Vasant Hegde @ 2014-04-10 7:04 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <1397063935-30478-1-git-send-email-hegdevasant@linux.vnet.ibm.com>
On 04/09/2014 10:48 PM, Vasant Hegde wrote:
> Firmware update on PowerNV platform takes several minutes. During
> this time one CPU is stuck in FW and the kernel complains about "soft
> lockups".
>
Ben,
Sorry for the confusion in subject line.. Its just 1 patch.. not 1/60 .
-Vasant
> This patch returns all secondary CPUs to firmware before starting
> firmware update process.
>
> [ Reworked a bit and cleaned up -- BenH ]
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> arch/powerpc/include/asm/opal.h | 1 +
> arch/powerpc/platforms/powernv/opal-flash.c | 47 ++++++++++++++++++++++++++---
> arch/powerpc/platforms/powernv/setup.c | 25 +++++++++++++--
> 3 files changed, 66 insertions(+), 7 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 05a23d0..5c34170 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -922,6 +922,7 @@ extern unsigned long opal_get_boot_time(void);
> extern void opal_nvram_init(void);
> extern int opal_elog_register_init(void);
> extern void opal_flash_init(void);
> +extern void opal_flash_term_callback(void);
> extern int opal_elog_init(void);
> extern void opal_platform_dump_init(void);
> extern void opal_sys_param_init(void);
> diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
> index 16e571b..11ab43f 100644
> --- a/arch/powerpc/platforms/powernv/opal-flash.c
> +++ b/arch/powerpc/platforms/powernv/opal-flash.c
> @@ -20,6 +20,7 @@
> #include <linux/mm.h>
> #include <linux/vmalloc.h>
> #include <linux/pagemap.h>
> +#include <linux/delay.h>
>
> #include <asm/opal.h>
>
> @@ -388,11 +389,6 @@ static int opal_flash_update(int op)
> (sg->num_entries * sizeof(struct opal_sg_entry) + 16);
> }
>
> - pr_alert("FLASH: Image is %u bytes\n", image_data.size);
> - pr_alert("FLASH: Image update requested\n");
> - pr_alert("FLASH: Image will be updated during system reboot\n");
> - pr_alert("FLASH: This will take several minutes. Do not power off!\n");
> -
> flash:
> rc = opal_update_flash(addr);
>
> @@ -400,6 +396,47 @@ invalid_img:
> return rc;
> }
>
> +/* Return CPUs to OPAL before starting FW update */
> +static void flash_return_cpu(void *info)
> +{
> + int cpu = smp_processor_id();
> +
> + if (!cpu_online(cpu))
> + return;
> +
> + /* Disable IRQ */
> + hard_irq_disable();
> +
> + /* Return the CPU to OPAL */
> + opal_return_cpu();
> +}
> +
> +/* This gets called just before system reboots */
> +void opal_flash_term_callback(void)
> +{
> + struct cpumask mask;
> +
> + if (update_flash_data.status != FLASH_IMG_READY)
> + return;
> +
> + pr_alert("FLASH: Flashing new firmware\n");
> + pr_alert("FLASH: Image is %u bytes\n", image_data.size);
> + pr_alert("FLASH: Performing flash and reboot/shutdown\n");
> + pr_alert("FLASH: This will take several minutes. Do not power off!\n");
> +
> + /* Small delay to help getting the above message out */
> + msleep(500);
> +
> + /* Return secondary CPUs to firmware */
> + cpumask_copy(&mask, cpu_online_mask);
> + cpumask_clear_cpu(smp_processor_id(), &mask);
> + if (!cpumask_empty(&mask))
> + smp_call_function_many(&mask,
> + flash_return_cpu, NULL, false);
> + /* Hard disable interrupts */
> + hard_irq_disable();
> +}
> +
> /*
> * Show candidate image status
> */
> diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
> index 1735678..42c16a6 100644
> --- a/arch/powerpc/platforms/powernv/setup.c
> +++ b/arch/powerpc/platforms/powernv/setup.c
> @@ -98,11 +98,32 @@ static void pnv_show_cpuinfo(struct seq_file *m)
> of_node_put(root);
> }
>
> +static void pnv_prepare_going_down(void)
> +{
> + /*
> + * Disable all notifiers from OPAL, we can't
> + * service interrupts anymore anyway
> + */
> + opal_notifier_disable();
> +
> + /* Soft disable interrupts */
> + local_irq_disable();
> +
> + /*
> + * Return secondary CPUs to firwmare if a flash update
> + * is pending otherwise we will get all sort of error
> + * messages about CPU being stuck etc.. This will also
> + * have the side effect of hard disabling interrupts so
> + * past this point, the kernel is effectively dead.
> + */
> + opal_flash_term_callback();
> +}
> +
> static void __noreturn pnv_restart(char *cmd)
> {
> long rc = OPAL_BUSY;
>
> - opal_notifier_disable();
> + pnv_prepare_going_down();
>
> while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
> rc = opal_cec_reboot();
> @@ -119,7 +140,7 @@ static void __noreturn pnv_power_off(void)
> {
> long rc = OPAL_BUSY;
>
> - opal_notifier_disable();
> + pnv_prepare_going_down();
>
> while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
> rc = opal_cec_power_down(0);
>
^ permalink raw reply
* [PATCH v3 0/8] DMA: Freescale: driver cleanups and enhancements
From: hongbo.zhang @ 2014-04-10 7:09 UTC (permalink / raw)
To: vkoul, dan.j.williams, dmaengine
Cc: scottwood, Hongbo Zhang, linuxppc-dev, linux-kernel, leo.li
From: Hongbo Zhang <hongbo.zhang@linaro.org>
Hi Vinod Koul,
Please have a look at the v3 patch set.
v2 -> v3 change:
Only add "chan->pm_state = RUNNING" for patch[8/8].
v1 -> v2 change:
The only one change is introducing a new patch[1/7] to remove the unnecessary
macro FSL_DMA_LD_DEBUG, thus the total patches number is 8 now (was 7)
Hongbo Zhang (8):
DMA: Freescale: remove the unnecessary FSL_DMA_LD_DEBUG
DMA: Freescale: unify register access methods
DMA: Freescale: remove attribute DMA_INTERRUPT of dmaengine
DMA: Freescale: add fsl_dma_free_descriptor() to reduce code
duplication
DMA: Freescale: move functions to avoid forward declarations
DMA: Freescale: change descriptor release process for supporting
async_tx
DMA: Freescale: use spin_lock_bh instead of spin_lock_irqsave
DMA: Freescale: add suspend resume functions for DMA driver
drivers/dma/fsldma.c | 591 ++++++++++++++++++++++++++++++++------------------
drivers/dma/fsldma.h | 33 ++-
2 files changed, 409 insertions(+), 215 deletions(-)
--
1.7.9.5
^ permalink raw reply
* [PATCH v3 1/8] DMA: Freescale: remove the unnecessary FSL_DMA_LD_DEBUG
From: hongbo.zhang @ 2014-04-10 7:09 UTC (permalink / raw)
To: vkoul, dan.j.williams, dmaengine
Cc: scottwood, Hongbo Zhang, linuxppc-dev, linux-kernel, leo.li
In-Reply-To: <1397113805-24171-1-git-send-email-hongbo.zhang@freescale.com>
From: Hongbo Zhang <hongbo.zhang@freescale.com>
Some codes are calling chan_dbg with FSL_DMA_LD_DEBUG surrounded, it is really
unnecessary to use such a macro because chan_dbg is a wrapper of dev_dbg, we do
have corresponding DEBUG macro to switch on/off dev_dbg, and most of the other
codes are also calling chan_dbg directly without using FSL_DMA_LD_DEBUG.
Signed-off-by: Hongbo Zhang <hongbo.zhang@freescale.com>
---
drivers/dma/fsldma.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index f157c6f..ec50420 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -426,9 +426,7 @@ static struct fsl_desc_sw *fsl_dma_alloc_descriptor(struct fsldma_chan *chan)
desc->async_tx.tx_submit = fsl_dma_tx_submit;
desc->async_tx.phys = pdesc;
-#ifdef FSL_DMA_LD_DEBUG
chan_dbg(chan, "LD %p allocated\n", desc);
-#endif
return desc;
}
@@ -479,9 +477,7 @@ static void fsldma_free_desc_list(struct fsldma_chan *chan,
list_for_each_entry_safe(desc, _desc, list, node) {
list_del(&desc->node);
-#ifdef FSL_DMA_LD_DEBUG
chan_dbg(chan, "LD %p free\n", desc);
-#endif
dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys);
}
}
@@ -493,9 +489,7 @@ static void fsldma_free_desc_list_reverse(struct fsldma_chan *chan,
list_for_each_entry_safe_reverse(desc, _desc, list, node) {
list_del(&desc->node);
-#ifdef FSL_DMA_LD_DEBUG
chan_dbg(chan, "LD %p free\n", desc);
-#endif
dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys);
}
}
@@ -832,9 +826,7 @@ static void fsldma_cleanup_descriptor(struct fsldma_chan *chan,
/* Run the link descriptor callback function */
if (txd->callback) {
-#ifdef FSL_DMA_LD_DEBUG
chan_dbg(chan, "LD %p callback\n", desc);
-#endif
txd->callback(txd->callback_param);
}
@@ -842,9 +834,7 @@ static void fsldma_cleanup_descriptor(struct fsldma_chan *chan,
dma_run_dependencies(txd);
dma_descriptor_unmap(txd);
-#ifdef FSL_DMA_LD_DEBUG
chan_dbg(chan, "LD %p free\n", desc);
-#endif
dma_pool_free(chan->desc_pool, desc, txd->phys);
}
--
1.7.9.5
^ 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