* 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] 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
* [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: [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
* 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: [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
* [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
* [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 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
* 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] 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
* [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
* 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
* [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 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
* 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 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 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
* [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/3] devcietree: bindings: add some MFD Keymile FPGAs
From: Valentin Longchamp @ 2014-04-09 6:39 UTC (permalink / raw)
To: Scott Wood; +Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
In-Reply-To: <1397004291.32034.327.camel@snotra.buserror.net>
On 04/09/2014 02:44 AM, Scott Wood wrote:
> On Tue, 2014-03-25 at 14:41 +0100, Valentin Longchamp wrote:
>> These are the bindings for 2 MFD devices used on some of the Keymile boards.
>> The first one is the chassis managmenet bfticu FPGA.
>> The second one is the board controller (reset, LEDs, GPIOs) QRIO CPDL.
>> These FPGAs are used in the kmcoge4 board.
>>
>> This patch also add KEYMILE to the vendor-prefixes.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>>
>> ---
>> Changes in v3:
>> - add a patch with the bindings for the KEYMILE FPGAs
>>
>> Changes in v2: None
>>
>> Documentation/devicetree/bindings/mfd/bfticu.txt | 26 ++++++++++++++++++++++
>> Documentation/devicetree/bindings/mfd/qriox.txt | 17 ++++++++++++++
>> .../devicetree/bindings/vendor-prefixes.txt | 1 +
>> 3 files changed, 44 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/mfd/bfticu.txt
>> create mode 100644 Documentation/devicetree/bindings/mfd/qriox.txt
>>
>> diff --git a/Documentation/devicetree/bindings/mfd/bfticu.txt b/Documentation/devicetree/bindings/mfd/bfticu.txt
>> new file mode 100644
>> index 0000000..92de32e
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/bfticu.txt
>> @@ -0,0 +1,26 @@
>> +KEYMILE bfticu Chassis Management FPGA
>> +
>> +The bfticu is a multifunction device that manages the whole chassis.
>> +Its main functionality is to collect IRQs from the whole chassis and signals
>> +them to a single controller.
>> +
>> +Required properties:
>> +- compatible: "keymile,bfticu"
>> +- interrupt-controller: the bfticu FPGA is an interrupt controller
>> +- interrupts: the main IRQ line to signal the collected IRQs
>> +- #interrupt-cells : is 2
>> + - The 1st cell is the local IRQ number on the bfticu
>> + - The 2nd cell is the type of the IRQ (IRQ_TYPE_xxx)
>
> Device tree bindings should not depend on the content of Linux headers.
> One is stable ABI, and the other isn't.
>
> If you want you can make the values the same for convenience, as is done
> by IPIC, CPM PIC, etc -- but the values need to be explicitly stated in
> the binding. It'll still break if the Linux values change (so it may
> not be a good idea to try to keep the values the same), but at least the
> fix would be in Linux code rather than an ABI change.
OK. I will then explicitly give the list of the values.
>
>> diff --git a/Documentation/devicetree/bindings/mfd/qriox.txt b/Documentation/devicetree/bindings/mfd/qriox.txt
>> new file mode 100644
>> index 0000000..f301e2d
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/mfd/qriox.txt
>> @@ -0,0 +1,17 @@
>> +KEYMILE qrio Board Control CPLD
>> +
>> +The qrio is a multifunction device that controls the KEYMILE boards based on
>> +the kmp204x design.
>> +It is consists of a reset controller, watchdog timer, LEDs, and 2 IRQ capable
>> +GPIO blocks.
>> +
>> +Required properties:
>> +- compatible: "keymile,qriox"
>> +- reg: access on the parent local bus (chip select, offset in chip select, size)
>> +
>> +Example:
>> +
>> + board-control@1,0 {
>> + compatible = "keymile,qriox";
>> + reg = <1 0 0x80>;
>> + };
>
> If it has GPIO blocks, shouldn't it be using the GPIO binding?
>
You are right it should. But this is currently being reworked (also in HW) and
that's why I left it out completely, instead of submitting something subject to
change.
Valentin
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Madhavan Srinivasan @ 2014-04-09 1:44 UTC (permalink / raw)
To: David Miller, dave.hansen
Cc: linux-arch, riel, rusty, peterz, x86, linux-kernel, linux-mm, ak,
paulus, mgorman, akpm, linuxppc-dev, mingo, kirill.shutemov
In-Reply-To: <20140404.135056.2103520199689146670.davem@davemloft.net>
On Friday 04 April 2014 11:20 PM, David Miller wrote:
> From: Dave Hansen <dave.hansen@intel.com>
> Date: Fri, 04 Apr 2014 09:18:43 -0700
>
>> 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,
>> you only put it in one place, and folks only have to care if they want
>> to change the default to be something other than 4.
>
> It looks more like it's necessary only to change the default, not
> to enable it. Unless I read his patch wrong...
>
Yes. With current patch, you only need to change the default by which
you enable it.
With regards
Maddy
>
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Madhavan Srinivasan @ 2014-04-09 1:32 UTC (permalink / raw)
To: Dave Hansen, linux-kernel, linuxppc-dev, linux-mm, linux-arch,
x86
Cc: riel, ak, peterz, rusty, paulus, mgorman, akpm, mingo,
kirill.shutemov
In-Reply-To: <533EDB63.8090909@intel.com>
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.
With regards
Maddy
> you only put it in one place, and folks only have to care if they want
> to change the default to be something other than 4.
>
^ permalink raw reply
* Re: [PATCH V2 1/2] mm: move FAULT_AROUND_ORDER to arch/
From: Madhavan Srinivasan @ 2014-04-09 1:14 UTC (permalink / raw)
To: Kirill A. Shutemov
Cc: linux-arch, riel, rusty, peterz, x86, linux-kernel, linux-mm, ak,
paulus, mgorman, akpm, linuxppc-dev, mingo, kirill.shutemov
In-Reply-To: <20140404131747.GA23076@node.dhcp.inet.fi>
On Friday 04 April 2014 06:47 PM, Kirill A. Shutemov wrote:
> On Fri, Apr 04, 2014 at 11:57:14AM +0530, Madhavan Srinivasan wrote:
>> Kirill A. Shutemov with faultaround patchset introduced
>> vm_ops->map_pages() for mapping easy accessible pages around
>> fault address in hope to reduce number of minor page faults.
>>
>> 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.
>>
>> Signed-off-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
>> ---
>> arch/x86/Kconfig | 4 ++++
>> include/linux/mm.h | 9 +++++++++
>> mm/memory.c | 12 +++++-------
>> 3 files changed, 18 insertions(+), 7 deletions(-)
>>
>> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
>> index 9c0a657..5833f22 100644
>> --- a/arch/x86/Kconfig
>> +++ b/arch/x86/Kconfig
>> @@ -1177,6 +1177,10 @@ config DIRECT_GBPAGES
>> support it. This can improve the kernel's performance a tiny bit by
>> reducing TLB pressure. If in doubt, say "Y".
>>
>> +config FAULT_AROUND_ORDER
>> + int
>> + default "4"
>> +
>> # Common NUMA Features
>> config NUMA
>> bool "Numa Memory Allocation and Scheduler Support"
>> diff --git a/include/linux/mm.h b/include/linux/mm.h
>> index 0bd4359..b93c1c3 100644
>> --- a/include/linux/mm.h
>> +++ b/include/linux/mm.h
>> @@ -26,6 +26,15 @@ struct file_ra_state;
>> struct user_struct;
>> struct writeback_control;
>>
>> +/*
>> + * Fault around order is a control knob to decide the fault around pages.
>> + * Default value is set to 0UL (disabled), but the arch can override it as
>> + * desired.
>> + */
>> +#ifndef CONFIG_FAULT_AROUND_ORDER
>> +#define CONFIG_FAULT_AROUND_ORDER 0
>> +#endif
>> +
>
> I don't think it should be in header file: nobody except mm/memory.c cares.
> Just put it instead '#define FAULT_AROUND_ORDER'.
>
Ok. Will do this change.
>> #ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */
>> extern unsigned long max_mapnr;
>>
>> diff --git a/mm/memory.c b/mm/memory.c
>> index b02c584..22a4a89 100644
>> --- a/mm/memory.c
>> +++ b/mm/memory.c
>> @@ -3358,10 +3358,8 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address,
>> update_mmu_cache(vma, address, pte);
>> }
>>
>> -#define FAULT_AROUND_ORDER 4
>> -
>> #ifdef CONFIG_DEBUG_FS
>> -static unsigned int fault_around_order = FAULT_AROUND_ORDER;
>> +static unsigned int fault_around_order = CONFIG_FAULT_AROUND_ORDER;
>>
>> static int fault_around_order_get(void *data, u64 *val)
>> {
>> @@ -3371,7 +3369,7 @@ static int fault_around_order_get(void *data, u64 *val)
>>
>> static int fault_around_order_set(void *data, u64 val)
>> {
>> - BUILD_BUG_ON((1UL << FAULT_AROUND_ORDER) > PTRS_PER_PTE);
>> + BUILD_BUG_ON((1UL << CONFIG_FAULT_AROUND_ORDER) > PTRS_PER_PTE);
>> if (1UL << val > PTRS_PER_PTE)
>> return -EINVAL;
>> fault_around_order = val;
>> @@ -3406,14 +3404,14 @@ static inline unsigned long fault_around_pages(void)
>> {
>> unsigned long nr_pages;
>>
>> - nr_pages = 1UL << FAULT_AROUND_ORDER;
>> + nr_pages = 1UL << CONFIG_FAULT_AROUND_ORDER;
>> BUILD_BUG_ON(nr_pages > PTRS_PER_PTE);
>> return nr_pages;
>> }
>>
>> static inline unsigned long fault_around_mask(void)
>> {
>> - return ~((1UL << (PAGE_SHIFT + FAULT_AROUND_ORDER)) - 1);
>> + return ~((1UL << (PAGE_SHIFT + CONFIG_FAULT_AROUND_ORDER)) - 1);
>> }
>> #endif
>>
>> @@ -3471,7 +3469,7 @@ static int do_read_fault(struct mm_struct *mm, struct vm_area_struct *vma,
>> * if page by the offset is not ready to be mapped (cold cache or
>> * something).
>> */
>> - if (vma->vm_ops->map_pages) {
>> + if ((vma->vm_ops->map_pages) && (fault_around_pages() > 1)) {
>
> if (vma->vm_ops->map_pages && fault_around_pages()) {
>
For a fault around value of 0, fault_around_pages() will return 1 and
that is reason for checking it greater than 1. Also, using debug fs,
fault around value can be zeroed.
With regards
Maddy
>> pte = pte_offset_map_lock(mm, pmd, address, &ptl);
>> do_fault_around(vma, address, pte, pgoff, flags);
>> if (!pte_same(*pte, orig_pte))
>> --
>> 1.7.10.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply
* Re: [PATCH] powerpc/qe: Setup clock source for TDM
From: Scott Wood @ 2014-04-09 1:05 UTC (permalink / raw)
To: Xie Xiaobo; +Cc: linuxppc-dev
In-Reply-To: <1395133745-5557-1-git-send-email-X.Xie@freescale.com>
On Tue, 2014-03-18 at 17:09 +0800, Xie Xiaobo wrote:
> diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
> index 238a07b..9a9f733 100644
> --- a/arch/powerpc/sysdev/qe_lib/qe.c
> +++ b/arch/powerpc/sysdev/qe_lib/qe.c
> @@ -1,5 +1,6 @@
> /*
> - * Copyright (C) 2006-2010 Freescale Semiconductor, Inc. All rights reserved.
> + * Copyright (C) 2006-2010, 2014 Freescale Semiconductor, Inc.
> + * All rights reserved.
> *
> * Authors: Shlomi Gridish <gridish@freescale.com>
> * Li Yang <leoli@freescale.com>
> @@ -240,6 +241,12 @@ enum qe_clock qe_clock_source(const char *source)
> if (strcasecmp(source, "none") == 0)
> return QE_CLK_NONE;
>
> + if (strcasecmp(source, "tsync_pin") == 0)
> + return QE_TSYNC_PIN;
> +
> + if (strcasecmp(source, "rsync_pin") == 0)
> + return QE_RSYNC_PIN;
> +
Binding update?
> @@ -210,3 +210,774 @@ int ucc_set_qe_mux_rxtx(unsigned int ucc_num, enum qe_clock clock,
>
> return 0;
> }
> +
> +/* tdm_num: TDM A-H port num is 0-7 */
> +int ucc_set_tdm_rxtx_clk(u32 tdm_num, enum qe_clock clock,
> + enum comm_dir mode)
> +{
> + u32 clock_bits, shift;
> + struct qe_mux *qe_mux_reg;
> + __be32 __iomem *cmxs1cr;
> +
> + clock_bits = 0;
> + qe_mux_reg = &qe_immr->qmx;
> +
> + if ((tdm_num > 7 || tdm_num < 0))
> + return -EINVAL;
> +
> + /* The communications direction must be RX or TX */
> + if (!((mode == COMM_DIR_RX) || (mode == COMM_DIR_TX)))
> + return -EINVAL;
Unnecessary parentheses.
tdm_num cannot be < 0 as it is unsigned.
Use a symbolic name rather than "7".
> + switch (mode) {
> + case COMM_DIR_RX:
> + switch (tdm_num) {
> + case 0:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK3:
> + clock_bits = 6;
> + break;
> + case QE_CLK8:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 28;
> + break;
> + case 1:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK5:
> + clock_bits = 6;
> + break;
> + case QE_CLK10:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 24;
> + break;
> + case 2:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK7:
> + clock_bits = 6;
> + break;
> + case QE_CLK12:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 20;
> + break;
> + case 3:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK9:
> + clock_bits = 6;
> + break;
> + case QE_CLK14:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 16;
> + break;
> + case 4:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK11:
> + clock_bits = 6;
> + break;
> + case QE_CLK16:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 28;
> + break;
> + case 5:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK13:
> + clock_bits = 6;
> + break;
> + case QE_CLK18:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 24;
> + break;
> + case 6:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK15:
> + clock_bits = 6;
> + break;
> + case QE_CLK20:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 20;
> + break;
> + case 7:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK17:
> + clock_bits = 6;
> + break;
> + case QE_CLK22:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 16;
> + break;
> + default:
> + break;
> + }
> + break;
> + case COMM_DIR_TX:
> + switch (tdm_num) {
> + case 0:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK4:
> + clock_bits = 6;
> + break;
> + case QE_CLK9:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 12;
> + break;
> + case 1:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK6:
> + clock_bits = 6;
> + break;
> + case QE_CLK11:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 8;
> + break;
> + case 2:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK8:
> + clock_bits = 6;
> + break;
> + case QE_CLK13:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 4;
> + break;
> + case 3:
> + switch (clock) {
> + case QE_BRG3:
> + clock_bits = 1;
> + break;
> + case QE_BRG4:
> + clock_bits = 2;
> + break;
> + case QE_CLK1:
> + clock_bits = 4;
> + break;
> + case QE_CLK2:
> + clock_bits = 5;
> + break;
> + case QE_CLK10:
> + clock_bits = 6;
> + break;
> + case QE_CLK15:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 0;
> + break;
> + case 4:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK12:
> + clock_bits = 6;
> + break;
> + case QE_CLK17:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 12;
> + break;
> + case 5:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK14:
> + clock_bits = 6;
> + break;
> + case QE_CLK19:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 8;
> + break;
> + case 6:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK16:
> + clock_bits = 6;
> + break;
> + case QE_CLK21:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 4;
> + break;
> + case 7:
> + switch (clock) {
> + case QE_BRG12:
> + clock_bits = 1;
> + break;
> + case QE_BRG13:
> + clock_bits = 2;
> + break;
> + case QE_CLK23:
> + clock_bits = 4;
> + break;
> + case QE_CLK24:
> + clock_bits = 5;
> + break;
> + case QE_CLK18:
> + clock_bits = 6;
> + break;
> + case QE_CLK3:
> + clock_bits = 7;
> + break;
> + default:
> + break;
> + }
> + shift = 0;
> + break;
> + default:
> + break;
> + }
> + break;
> + default:
> + break;
> + }
Unnecessary "default"s.
Please consider reformatting this data into an array.
> + if (!clock_bits)
> + return -ENOENT;
> +
> + cmxs1cr = (tdm_num < 4) ? (&qe_mux_reg->cmxsi1cr_l) :
> + (&qe_mux_reg->cmxsi1cr_h);
Unnecessary parentheses.
> +int ucc_set_tdm_rxtx_sync(u32 tdm_num, enum qe_clock clock,
> + enum comm_dir mode)
Similar comments as the clock function above.
> + clock_bits = (u32) source;
Unnecessary cast.
> +#ifdef CONFIG_FSL_UCC_TDM
> + } else {
> + /* tdm Rx clock routing */
> + if ((uf_info->rx_clock != QE_CLK_NONE) &&
> + ucc_set_tdm_rxtx_clk(uf_info->tdm_num,
> + uf_info->rx_clock, COMM_DIR_RX)) {
> + pr_err("%s: illegal value for RX clock", __func__);
> + ucc_fast_free(uccf);
> + return -EINVAL;
> + }
> +
> + /* tdm Tx clock routing */
> + if ((uf_info->tx_clock != QE_CLK_NONE) &&
> + ucc_set_tdm_rxtx_clk(uf_info->tdm_num,
> + uf_info->tx_clock, COMM_DIR_TX)) {
> + pr_err("%s:illegal value for TX clock", __func__);
> + ucc_fast_free(uccf);
> + return -EINVAL;
> + }
> +
> + /* tdm Rx sync clock routing */
> + if ((uf_info->rx_sync != QE_CLK_NONE) &&
> + ucc_set_tdm_rxtx_sync(uf_info->tdm_num,
> + uf_info->rx_sync, COMM_DIR_RX)) {
> + pr_err("%s:illegal value for TX clock", __func__);
> + ucc_fast_free(uccf);
> + return -EINVAL;
> + }
> +
> + /* tdm Tx sync clock routing */
> + if ((uf_info->tx_sync != QE_CLK_NONE) &&
> + ucc_set_tdm_rxtx_sync(uf_info->tdm_num,
> + uf_info->tx_sync, COMM_DIR_TX)) {
> + pr_err("%s:illegal value for TX clock", __func__);
> + ucc_fast_free(uccf);
> + return -EINVAL;
> + }
Please be consistent with error formatting (space after colon), and
either make the error messages distinctive, or if it isn't worthwhile,
factor out the error code to the end and use goto. You should probably
do that anyway, even if you print a distinctive error message first.
Also you should probably provide more info in the print regarding the
particular values and subdevices involved.
-Scott
^ permalink raw reply
* Re: [PATCH v3 3/3] powerpc/mpc85xx: add support for Keymile's kmcoge4 board
From: Scott Wood @ 2014-04-09 0:47 UTC (permalink / raw)
To: Valentin Longchamp; +Cc: devicetree, linuxppc-dev
In-Reply-To: <1395754915-14534-4-git-send-email-valentin.longchamp@keymile.com>
On Tue, 2014-03-25 at 14:41 +0100, Valentin Longchamp wrote:
> + lbc: localbus@ffe124000 {
> + reg = <0xf 0xfe124000 0 0x1000>;
> + ranges = <0 0 0xf 0xffa00000 0x00040000 /* LB 0 */
> + 1 0 0xf 0xfb000000 0x00010000 /* LB 1 */
> + 2 0 0xf 0xd0000000 0x10000000 /* LB 2 */
> + 3 0 0xf 0xe0000000 0x10000000>; /* LB 3 */
> +
> + nand@0,0 {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "fsl,elbc-fcm-nand";
> + reg = <0 0 0x40000>;
> +
> + partition@0 {
> + label = "ubi0";
> + reg = <0x0 0x10000000>;
> + };
Putting partition info in the dts file is a bad habit and (as I've told
others) I don't think we should continue doing so in new dts files.
In this case it looks like you're just making the entire chip into one
partition, so I'm not sure what the point is of partitioning at all.
-Scott
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox