Re: [PATCH] ARM: exynos_defconfig: Enable cpufreq-dt driver

2015-08-10 Thread Javier Martinez Canillas
Hello Krzysztof,

On 08/11/2015 04:15 AM, Krzysztof Kozlowski wrote:
> With the latest patches the cpufreq-dt can be used on multiple
> Exynos SoCs: 3250, 4210, 4212, 4412 and 5250.
> 
> Enable it along with default ondemand governor to conserve the energy,
> reduce temperature while maintaining acceptable performance.
> 
> Signed-off-by: Krzysztof Kozlowski 
> ---
>  arch/arm/configs/exynos_defconfig | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm/configs/exynos_defconfig 
> b/arch/arm/configs/exynos_defconfig
> index 67965cedeb69..2263cd94cb93 100644
> --- a/arch/arm/configs/exynos_defconfig
> +++ b/arch/arm/configs/exynos_defconfig
> @@ -27,6 +27,8 @@ CONFIG_ARM_APPENDED_DTB=y
>  CONFIG_ARM_ATAG_DTB_COMPAT=y
>  CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M 
> console=ttySAC1,115200 init=/linuxrc mem=256M"
>  CONFIG_CPU_FREQ=y
> +CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
> +CONFIG_CPUFREQ_DT=y
>  CONFIG_CPU_IDLE=y
>  CONFIG_ARM_EXYNOS_CPUIDLE=y
>  CONFIG_VFP=y
> 

Reviewed-by: Javier Martinez Canillas 

Best regards,
-- 
Javier Martinez Canillas
Open Source Group
Samsung Research America
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net] netconsole: Check for carrier before calling netpoll_send_udp()

2015-08-10 Thread Jonathan Maxwell
> What if the carrier check passes, and then the chip reset starts on
> another cpu?  You'll have the same problem.

Okay, let me see if I can come up with a better way to mitigate this.

On Tue, Aug 11, 2015 at 2:22 PM, David Miller  wrote:
> From: Jon Maxwell 
> Date: Tue, 11 Aug 2015 11:32:26 +1000
>
>> We have seen a few crashes recently where a NIC is getting
>> reset for some reason and then the driver or another module calls
>> printk() which invokes netconsole. Netconsole then calls the
>> adapter specific poll routine via netpoll which crashes because
>> the adapter is resetting and its structures are being reinitialized.
>
> This isn't a fix.
>
> What if the carrier check passes, and then the chip reset starts on
> another cpu?  You'll have the same problem.
>
> I'm not applying this, sorry.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 Resend] net/fddi: remove HWM_REVERSE() macro

2015-08-10 Thread yalin wang

> On Aug 11, 2015, at 13:37, David Miller  wrote:
> 
> From: yalin wang 
> Date: Tue, 11 Aug 2015 13:11:22 +0800
> 
>> HWM_REVERSE() macro is unused, remove it.
>> 
>> Signed-off-by: yalin wang 
> 
> You did not do as I asked you to, this patch is still corrupted
> and there is no way you successfully applied what is in this patch.
> 
>> -#defineHWM_REVERSE(x)  x)<<24L)&0xff00L)   +
>>\
>> -(((x)<< 8L)&0x00ffL)   +   \
>> -(((x)>> 8L)&0xff00L)   +   \
>> -(((x)>>24L)&0x00ffL))
> 
> This indentation here is spaces, whereas in the source files they
> are TABS.
> 
> Your email client did this.
> 
> If you fail to properly verify that your outgoing patches are not
> corrupted before submitting them here, I will stop reviewing and
> considering your changes.
> 
> Thank you.
ouch,  i am sorry that i am sending from windows PC,
let me check that .
Sorry for that .--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] joystick/zhenhua: remove zhenhua_bitreverse()

2015-08-10 Thread yalin wang
This change remove zhenhua_bitreverse() function, use generic
bitrev8() function instead.

Signed-off-by: yalin wang 
---
 drivers/input/joystick/zhenhua.c | 13 ++---
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/input/joystick/zhenhua.c b/drivers/input/joystick/zhenhua.c
index 30af2e8..4a8258b 100644
--- a/drivers/input/joystick/zhenhua.c
+++ b/drivers/input/joystick/zhenhua.c
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -72,16 +73,6 @@ struct zhenhua {
char phys[32];
 };
 
-
-/* bits in all incoming bytes needs to be "reversed" */
-static int zhenhua_bitreverse(int x)
-{
-   x = ((x & 0xaa) >> 1) | ((x & 0x55) << 1);
-   x = ((x & 0xcc) >> 2) | ((x & 0x33) << 2);
-   x = ((x & 0xf0) >> 4) | ((x & 0x0f) << 4);
-   return x;
-}
-
 /*
  * zhenhua_process_packet() decodes packets the driver receives from the
  * RC transmitter. It updates the data accordingly.
@@ -120,7 +111,7 @@ static irqreturn_t zhenhua_interrupt(struct serio *serio, 
unsigned char data, un
return IRQ_HANDLED; /* wrong MSB -- ignore this byte */
 
if (zhenhua->idx < ZHENHUA_MAX_LENGTH)
-   zhenhua->data[zhenhua->idx++] = zhenhua_bitreverse(data);
+   zhenhua->data[zhenhua->idx++] = bitrev8(data);
 
if (zhenhua->idx == ZHENHUA_MAX_LENGTH) {
zhenhua_process_packet(zhenhua);
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 Resend] net/fddi: remove HWM_REVERSE() macro

2015-08-10 Thread David Miller
From: yalin wang 
Date: Tue, 11 Aug 2015 13:11:22 +0800

> HWM_REVERSE() macro is unused, remove it.
> 
> Signed-off-by: yalin wang 

You did not do as I asked you to, this patch is still corrupted
and there is no way you successfully applied what is in this patch.

> -#defineHWM_REVERSE(x)  x)<<24L)&0xff00L)   + 
>   \
> -(((x)<< 8L)&0x00ffL)   +   \
> -(((x)>> 8L)&0xff00L)   +   \
> -(((x)>>24L)&0x00ffL))

This indentation here is spaces, whereas in the source files they
are TABS.

Your email client did this.

If you fail to properly verify that your outgoing patches are not
corrupted before submitting them here, I will stop reviewing and
considering your changes.

Thank you.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Staging: android: ion: Fix missing a blank line coding style issue.

2015-08-10 Thread Sudip Mukherjee
On Mon, Aug 10, 2015 at 11:42:27PM -0500, Junsu Shin wrote:
> This is a patch to the ion.c that fixes a warning that tells missing a blank 
> line after declaration
> 
> Signed-off-by: Junsu Shin 
> ---
1) This is a false positive.
2) You need to refresh your tree. This has already been fixed.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net-next] bpf: fix the bug "'struct bpf_array' has no member named 'prog'" in s390 architecture

2015-08-10 Thread David Miller
From: Kaixu Xia 
Date: Tue, 11 Aug 2015 05:00:24 +

> 'Kbuild test robot' sent me an email about a build error
> "'struct bpf_array' has no member named 'prog'" in s390
> architecture. This error is caused by commit: 2a36f0b92eb
> 638dd023870574eb471b1c56be9ad [656/692] bpf: Make the bpf
> _prog_array_map more generic. In this patch, the member 'prog'
> of struct bpf_array has been replaced by 'ptrs'. So this
> patch fix it.

Please resubmit with a proper "Fixes: " and "Signed-off-by: "
tags.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/3] ARM: dts: sun6i: Add security system crypto engine clock and device nodes

2015-08-10 Thread Chen-Yu Tsai
A31/A31s have the same "Security System" crypto engine as A10/A20,
but with a separate reset control.

Signed-off-by: Chen-Yu Tsai 
---
 arch/arm/boot/dts/sun6i-a31.dtsi | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi
index 39953e76bbfc..7afb80f07dad 100644
--- a/arch/arm/boot/dts/sun6i-a31.dtsi
+++ b/arch/arm/boot/dts/sun6i-a31.dtsi
@@ -346,6 +346,14 @@
 "mmc3_sample";
};
 
+   ss_clk: clk@01c2009c {
+   #clock-cells = <0>;
+   compatible = "allwinner,sun4i-a10-mod0-clk";
+   reg = <0x01c2009c 0x4>;
+   clocks = <>, < 0>;
+   clock-output-names = "ss";
+   };
+
spi0_clk: clk@01c200a0 {
#clock-cells = <0>;
compatible = "allwinner,sun4i-a10-mod0-clk";
@@ -882,6 +890,16 @@
#size-cells = <0>;
};
 
+   crypto: crypto-engine@01c15000 {
+   compatible = "allwinner,sun4i-a10-crypto";
+   reg = <0x01c15000 0x1000>;
+   interrupts = ;
+   clocks = <_gates 5>, <_clk>;
+   clock-names = "ahb", "mod";
+   resets = <_rst 5>;
+   reset-names = "ahb";
+   };
+
timer@01c6 {
compatible = "allwinner,sun6i-a31-hstimer",
 "allwinner,sun7i-a20-hstimer";
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/3] ARM: sun6i: Support Security System crypto engine

2015-08-10 Thread Chen-Yu Tsai
Hi everyone,

This series enables support for the crypto engine found in sun6i, or
Allwinner A31/A31s SoCs. The crypto engine is the same hardware as on
earlier sun4i/sun7i (A10/A20), with the only difference being the reset
control is separated out of the clock gate control.

The same hardware is also available on the A33, but not the A23. Support
for this requires additions to the clock driver, and will be submitted
separately once things are clear on how to proceed. I already have a
proof of concept working.


Patch 1 adds an optional reset control property to the sunxi-ss binding.

Patch 2 adds optional reset control support to the sunxi-ss driver.

Patch 3 enables the crypto engine on sun6i, by adding the module clock and
device node.


Regards
ChenYu


Chen-Yu Tsai (3):
  crypto: sunxi-ss: Document optional reset control bindings
  crypto: sunxi-ss: Add optional reset control support
  ARM: dts: sun6i: Add security system crypto engine clock and device
nodes

 .../devicetree/bindings/crypto/sun4i-ss.txt|  4 
 arch/arm/boot/dts/sun6i-a31.dtsi   | 18 ++
 drivers/crypto/sunxi-ss/sun4i-ss-core.c| 22 ++
 drivers/crypto/sunxi-ss/sun4i-ss.h |  2 ++
 4 files changed, 46 insertions(+)

-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/3] crypto: sunxi-ss: Document optional reset control bindings

2015-08-10 Thread Chen-Yu Tsai
Later Allwinner SoCs split out the reset controls for individual modules
out of the clock gate controls. The "Security System" crypto engine is
no different.

Signed-off-by: Chen-Yu Tsai 
---
 Documentation/devicetree/bindings/crypto/sun4i-ss.txt | 4 
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/crypto/sun4i-ss.txt 
b/Documentation/devicetree/bindings/crypto/sun4i-ss.txt
index 1e02d177fea6..5d38e9b7033f 100644
--- a/Documentation/devicetree/bindings/crypto/sun4i-ss.txt
+++ b/Documentation/devicetree/bindings/crypto/sun4i-ss.txt
@@ -9,6 +9,10 @@ Required properties:
* "ahb" : AHB gating clock
* "mod" : SS controller clock
 
+Optional properties:
+ - resets : phandle + reset specifier pair
+ - reset-names : must contain "ahb"
+
 Example:
crypto: crypto-engine@01c15000 {
compatible = "allwinner,sun4i-a10-crypto";
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] crypto: sunxi-ss: Add optional reset control support

2015-08-10 Thread Chen-Yu Tsai
On sun6i and later platforms, the reset control is split out of the
clock gates. Add support for an optional reset control.

Signed-off-by: Chen-Yu Tsai 
---
 drivers/crypto/sunxi-ss/sun4i-ss-core.c | 22 ++
 drivers/crypto/sunxi-ss/sun4i-ss.h  |  2 ++
 2 files changed, 24 insertions(+)

diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-core.c 
b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
index 0b79b58c913b..eab6fe227fa0 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-core.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-core.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "sun4i-ss.h"
 
@@ -253,6 +254,14 @@ static int sun4i_ss_probe(struct platform_device *pdev)
}
dev_dbg(>dev, "clock ahb_ss acquired\n");
 
+   ss->reset = devm_reset_control_get_optional(>dev, "ahb");
+   if (IS_ERR(ss->reset)) {
+   if (PTR_ERR(ss->reset) == -EPROBE_DEFER)
+   return PTR_ERR(ss->reset);
+   dev_info(>dev, "no reset control found\n");
+   ss->reset = NULL;
+   }
+
/* Enable both clocks */
err = clk_prepare_enable(ss->busclk);
if (err != 0) {
@@ -275,6 +284,15 @@ static int sun4i_ss_probe(struct platform_device *pdev)
goto error_clk;
}
 
+   /* Deassert reset if we have a reset control */
+   if (ss->reset) {
+   err = reset_control_deassert(ss->reset);
+   if (err) {
+   dev_err(>dev, "Cannot deassert reset control\n");
+   goto error_clk;
+   }
+   }
+
/*
 * The only impact on clocks below requirement are bad performance,
 * so do not print "errors"
@@ -352,6 +370,8 @@ error_alg:
break;
}
}
+   if (ss->reset)
+   reset_control_assert(ss->reset);
 error_clk:
clk_disable_unprepare(ss->ssclk);
 error_ssclk:
@@ -376,6 +396,8 @@ static int sun4i_ss_remove(struct platform_device *pdev)
}
 
writel(0, ss->base + SS_CTL);
+   if (ss->reset)
+   reset_control_assert(ss->reset);
clk_disable_unprepare(ss->busclk);
clk_disable_unprepare(ss->ssclk);
return 0;
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss.h 
b/drivers/crypto/sunxi-ss/sun4i-ss.h
index db18b2554e6f..8e9c05f6e4d4 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss.h
+++ b/drivers/crypto/sunxi-ss/sun4i-ss.h
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -129,6 +130,7 @@ struct sun4i_ss_ctx {
int irq;
struct clk *busclk;
struct clk *ssclk;
+   struct reset_control *reset;
struct device *dev;
struct resource *res;
spinlock_t slock; /* control the use of the device */
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] zlib_deflate/deftree: Remove bi_reverse()

2015-08-10 Thread yalin wang
This change remove bi_reverse() and use generic bitrev32() instead,
have better performance on some platforms.

Signed-off-by: yalin wang 
---
 lib/zlib_deflate/deftree.c |  6 +++---
 lib/zlib_deflate/defutil.h | 16 
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/lib/zlib_deflate/deftree.c b/lib/zlib_deflate/deftree.c
index ddf3482..9b1756b 100644
--- a/lib/zlib_deflate/deftree.c
+++ b/lib/zlib_deflate/deftree.c
@@ -35,6 +35,7 @@
 /* #include "deflate.h" */
 
 #include 
+#include 
 #include "defutil.h"
 
 #ifdef DEBUG_ZLIB
@@ -146,7 +147,6 @@ static void send_all_trees (deflate_state *s, int lcodes, 
int dcodes,
 static void compress_block (deflate_state *s, ct_data *ltree,
ct_data *dtree);
 static void set_data_type  (deflate_state *s);
-static unsigned bi_reverse (unsigned value, int length);
 static void bi_windup  (deflate_state *s);
 static void bi_flush   (deflate_state *s);
 static void copy_block (deflate_state *s, char *buf, unsigned len,
@@ -284,7 +284,7 @@ static void tr_static_init(void)
 /* The static distance tree is trivial: */
 for (n = 0; n < D_CODES; n++) {
 static_dtree[n].Len = 5;
-static_dtree[n].Code = bi_reverse((unsigned)n, 5);
+static_dtree[n].Code = bitrev32((u32)n) >> (32 - 5);
 }
 static_init_done = 1;
 }
@@ -520,7 +520,7 @@ static void gen_codes(
 int len = tree[n].Len;
 if (len == 0) continue;
 /* Now reverse the bits */
-tree[n].Code = bi_reverse(next_code[len]++, len);
+tree[n].Code = bitrev32((u32)(next_code[len]++)) >> (32 - len);
 
 Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
  n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
diff --git a/lib/zlib_deflate/defutil.h b/lib/zlib_deflate/defutil.h
index b640b64..a8c3708 100644
--- a/lib/zlib_deflate/defutil.h
+++ b/lib/zlib_deflate/defutil.h
@@ -293,22 +293,6 @@ void zlib_tr_stored_type_only (deflate_state *);
 }
 
 /* ===
- * Reverse the first len bits of a code, using straightforward code (a faster
- * method would use a table)
- * IN assertion: 1 <= len <= 15
- */
-static inline unsigned bi_reverse(unsigned code, /* the value to invert */
- int len)   /* its bit length */
-{
-register unsigned res = 0;
-do {
-res |= code & 1;
-code >>= 1, res <<= 1;
-} while (--len > 0);
-return res >> 1;
-}
-
-/* ===
  * Flush the bit buffer, keeping at most 7 bits in it.
  */
 static inline void bi_flush(deflate_state *s)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: lustre: lustre: llite: Added a new line after declaration

2015-08-10 Thread Sudip Mukherjee
On Mon, Aug 10, 2015 at 08:56:02PM +0530, Aparna Karuthodi wrote:
> Added a new line to fix a coding style error no space after
> declaration detected by checkpatch.
> 
> Signed-off-by: Aparna Karuthodi 
> ---
Why are you sending this patch again? You have sent this one long back
and has already been merged by: 06d0c4989fa4 ("staging: lustre: llite:
Fix No space after the declaration")

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 Resend] net/fddi: remove HWM_REVERSE() macro

2015-08-10 Thread yalin wang
HWM_REVERSE() macro is unused, remove it.

Signed-off-by: yalin wang 
---
drivers/net/fddi/skfp/h/hwmtm.h | 10 --
1 file changed, 10 deletions(-)

diff --git a/drivers/net/fddi/skfp/h/hwmtm.h b/drivers/net/fddi/skfp/h/hwmtm.h
index 5924d42..4ca2341 100644
--- a/drivers/net/fddi/skfp/h/hwmtm.h
+++ b/drivers/net/fddi/skfp/h/hwmtm.h
@@ -74,15 +74,6 @@
#define NULL   0
#endif

-#ifdef LITTLE_ENDIAN
-#define HWM_REVERSE(x) (x)
-#else
-#defineHWM_REVERSE(x)  x)<<24L)&0xff00L)   +   
\
-(((x)<< 8L)&0x00ffL)   +   \
-(((x)>> 8L)&0xff00L)   +   \
-(((x)>>24L)&0x00ffL))
-#endif
-
#define C_INDIC(1L<<25)
#define A_INDIC(1L<<26)
#defineRD_FS_LOCAL 0x80
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] net/fddi: remove HWM_REVERSE() macro

2015-08-10 Thread yalin wang

> On Aug 11, 2015, at 12:24, David Miller  wrote:
> 
> From: yalin wang 
> Date: Tue, 11 Aug 2015 09:57:21 +0800
> 
>> HWM_REVERSE() macro is unused, remove it.
>> 
>> Signed-off-by: yalin wang 
> 
> Your email client has corrupted this patch.
> 
> Please read Documentation/email-clients.txt, send a test patch to yourself,
> and only resubmit this change once you are able to successfully apply the
> patch you receive in that test email.
> 
> Thanks.
ok, Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC PATCH] mmc: sdhci-of-arasan: Add the support for sdhci-5.1

2015-08-10 Thread Michal Simek
On 08/11/2015 03:34 AM, Shawn Lin wrote:
> This patch adds the quirks and compatible string in sdhci-of-arasan.c
> to support sdhci-arasan5.1 version of controller. No documented controller
> IP version is found in the TRM, so we use ths version of command queueing
> engine integrated into this controller by arasan to specify our controller.
> 
> Signed-off-by: Shawn Lin 
> 
> ---
> 
>  Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 2 +-
>  drivers/mmc/host/sdhci-of-arasan.c | 4 
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt 
> b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> index 7e94903..da541c3 100644
> --- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> +++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
> @@ -9,7 +9,7 @@ Device Tree Bindings for the Arasan SDHCI Controller
>  
>  Required Properties:
>- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
> -'arasan,sdhci-4.9a'
> +'arasan,sdhci-4.9a' or 'arasan,sdhci-5.1'
>- reg: From mmc bindings: Register location and length.
>- clocks: From clock bindings: Handles to clock inputs.
>- clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
> diff --git a/drivers/mmc/host/sdhci-of-arasan.c 
> b/drivers/mmc/host/sdhci-of-arasan.c
> index ef5a7d2..c9012f5 100644
> --- a/drivers/mmc/host/sdhci-of-arasan.c
> +++ b/drivers/mmc/host/sdhci-of-arasan.c
> @@ -175,6 +175,9 @@ static int sdhci_arasan_probe(struct platform_device 
> *pdev)
>   if (of_device_is_compatible(pdev->dev.of_node, "arasan,sdhci-4.9a")) {
>   host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
>   host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
> + } else if (of_device_is_compatible(pdev->dev.of_node,
> +"arasan,sdhci-5.1")) {
> + host->quirks |= SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;

Is this broken Arasan version or just broken capability on your SoC?

Thanks,
Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net-next] bpf: fix the bug "'struct bpf_array' has no member named 'prog'" in s390 architecture

2015-08-10 Thread Kaixu Xia
'Kbuild test robot' sent me an email about a build error
"'struct bpf_array' has no member named 'prog'" in s390
architecture. This error is caused by commit: 2a36f0b92eb
638dd023870574eb471b1c56be9ad [656/692] bpf: Make the bpf
_prog_array_map more generic. In this patch, the member 'prog'
of struct bpf_array has been replaced by 'ptrs'. So this
patch fix it.
---
 arch/s390/net/bpf_jit_comp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c
index 9f4bbc0..eeda051 100644
--- a/arch/s390/net/bpf_jit_comp.c
+++ b/arch/s390/net/bpf_jit_comp.c
@@ -1032,7 +1032,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, 
struct bpf_prog *fp, int i
  MAX_TAIL_CALL_CNT, 0, 0x2);
 
/*
-* prog = array->prog[index];
+* prog = array->ptrs[index];
 * if (prog == NULL)
 * goto out;
 */
@@ -1041,7 +1041,7 @@ static noinline int bpf_jit_insn(struct bpf_jit *jit, 
struct bpf_prog *fp, int i
EMIT6_DISP_LH(0xeb00, 0x000d, REG_1, BPF_REG_3, REG_0, 3);
/* lg %r1,prog(%b2,%r1) */
EMIT6_DISP_LH(0xe300, 0x0004, REG_1, BPF_REG_2,
- REG_1, offsetof(struct bpf_array, prog));
+ REG_1, offsetof(struct bpf_array, ptrs));
/* clgij %r1,0,0x8,label0 */
EMIT6_PCREL_IMM_LABEL(0xec00, 0x007d, REG_1, 0, 0, 0x8);
 
-- 
1.8.3.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] MODSIGN: Use PKCS#7 for module signatures [ver #7]

2015-08-10 Thread James Morris
On Tue, 11 Aug 2015, David Howells wrote:

> This is mentioned in the
> 
>   MODSIGN: Provide a utility to append a PKCS#7 signature to a module
> 
> commit description.
> 
>   Note that the utility is written in C and must be linked against the
>   OpenSSL crypto library.
> 
> Would it help to update the module-signing.txt document, the config option or
> the git pull request/cover note?

Yes :)

-- 
James Morris


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] pinctrl: mediatek: Fix multiple registeration issue.

2015-08-10 Thread Hongzhou Yang
Use dynamic allocation to fix multiple registeration issue.

--8<
Since our common driver need support main chip and PMU
at the same time, that means it will register two
pinctrl device, and the pinctrl_desc structure should
be used two times.

But pinctrl_desc use global static definition, then
the latest registered pinctrl device will overwrite
the old one's, all members in pinctrl_desc will set to
the new one's, such as name, pins and pins numbers, etc.
This is a bug. Changing to use devm_kzalloc to fix it.

Cc: sta...@vger.kernel.org # v4.1+
Signed-off-by: Hongzhou Yang 
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c |   27 +++--
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c 
b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index ad1ea16..2bba504 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -1202,17 +1202,12 @@ static int mtk_pctrl_build_state(struct platform_device 
*pdev)
return 0;
 }
 
-static struct pinctrl_desc mtk_pctrl_desc = {
-   .confops= _pconf_ops,
-   .pctlops= _pctrl_ops,
-   .pmxops = _pmx_ops,
-};
-
 int mtk_pctrl_init(struct platform_device *pdev,
const struct mtk_pinctrl_devdata *data,
struct regmap *regmap)
 {
struct pinctrl_pin_desc *pins;
+   struct pinctrl_desc *mtk_pctrl_desc;
struct mtk_pinctrl *pctl;
struct device_node *np = pdev->dev.of_node, *node;
struct property *prop;
@@ -1265,12 +1260,22 @@ int mtk_pctrl_init(struct platform_device *pdev,
 
for (i = 0; i < pctl->devdata->npins; i++)
pins[i] = pctl->devdata->pins[i].pin;
-   mtk_pctrl_desc.name = dev_name(>dev);
-   mtk_pctrl_desc.owner = THIS_MODULE;
-   mtk_pctrl_desc.pins = pins;
-   mtk_pctrl_desc.npins = pctl->devdata->npins;
+
+   mtk_pctrl_desc = devm_kzalloc(>dev, sizeof(*mtk_pctrl_desc),
+   GFP_KERNEL);
+   if (!mtk_pctrl_desc)
+   return -ENOMEM;
+
+   mtk_pctrl_desc->name = dev_name(>dev);
+   mtk_pctrl_desc->owner = THIS_MODULE;
+   mtk_pctrl_desc->pins = pins;
+   mtk_pctrl_desc->npins = pctl->devdata->npins;
+   mtk_pctrl_desc->confops = _pconf_ops;
+   mtk_pctrl_desc->pctlops = _pctrl_ops;
+   mtk_pctrl_desc->pmxops = _pmx_ops;
pctl->dev = >dev;
-   pctl->pctl_dev = pinctrl_register(_pctrl_desc, >dev, pctl);
+
+   pctl->pctl_dev = pinctrl_register(mtk_pctrl_desc, >dev, pctl);
if (IS_ERR(pctl->pctl_dev)) {
dev_err(>dev, "couldn't register pinctrl driver\n");
return PTR_ERR(pctl->pctl_dev);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v7 0/9] Fixes and new clocks support for Mediatek MT8173

2015-08-10 Thread Daniel Kurtz
Hi James,

On Mon, Aug 10, 2015 at 5:50 PM, James Liao  wrote:
> This patchset is based on 4.2-rc2 and [1], and contains minor fixes and
> subsystem clocks support for Mediatek MT8173.
>
> The previous reviews can be found in [2].
>
> changes since v6:
> - Use DUMMY_RATE (0) instead of typical rate for clocks that we don't care
>   and not controlled in CCF.

For the whole series:
Reviewed-by: Daniel Kurtz 

>
> changes since v5:
> - Rebase to 4.2-rc2.
> - Patch "Fix enabling of critical clocks" had been included in 4.2-rc2,
>   so it need not be included in this patchset.
>
> changes since v4:
> - Add a separated patch to remove unused dpi_ck.
> - Add separated patches to fix clk/mediatek in release 4.2-rc1.
> - Add __init* for initialization data and functions.
> - Rename dummy_clk with oscillator in DT.
> - Remove mtk_clk_register_apmixed_ex(), call mtk_clk_register_ref2usb_tx()
>   directly to register USB clock.
>
> changes since v3:
> - Remove clk_null dependency from root clocks.
> - Use fixed-rate clocks with typical rate to replace clk_null.
> - Separate ref2usb_tx implementation to clk-apmixed.c
> - Use clock-controller as the name of clock providers.
>
> changes since v2:
> - Rebase to 4.2-rc1.
> - Add device tree nodes for subsystem clocks.
> - Fine tune comments of patches.
> - Add __init, __initconst and const to init data and functions.
> - Removed unused code from init functions of subsystem clocks.
>
> changes since v1:
> - Add CA7PLL and CA15PLL as critical clocks.
> - Use the same register descriptor for imgsys, vensys and vencltsys.
> - Generalize apmixedsys special clocks registration.
>
> [1] https://patchwork.kernel.org/patch/6446341/
> [2] https://lkml.org/lkml/2015/8/4/111
>
> James Liao (9):
>   clk: mediatek: Removed unused dpi_ck clock from MT8173
>   clk: mediatek: Remove unused code from MT8173.
>   clk: mediatek: Add __initdata and __init for data and functions
>   clk: mediatek: Add fixed clocks support for Mediatek SoC.
>   clk: mediatek: Fix rate and dependency of MT8173 clocks
>   dt-bindings: ARM: Mediatek: Document devicetree bindings for clock
> controllers
>   clk: mediatek: Add subsystem clocks of MT8173
>   clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS
>   arm64: dts: mt8173: Add subsystem clock controller device nodes
>
>  .../bindings/arm/mediatek/mediatek,imgsys.txt  |  22 ++
>  .../bindings/arm/mediatek/mediatek,mmsys.txt   |  22 ++
>  .../bindings/arm/mediatek/mediatek,vdecsys.txt |  22 ++
>  .../bindings/arm/mediatek/mediatek,vencltsys.txt   |  22 ++
>  .../bindings/arm/mediatek/mediatek,vencsys.txt |  22 ++
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi   |  37 +++
>  drivers/clk/mediatek/Makefile  |   2 +-
>  drivers/clk/mediatek/clk-apmixed.c | 107 +++
>  drivers/clk/mediatek/clk-gate.c|   2 +-
>  drivers/clk/mediatek/clk-mt8173.c  | 342 
> -
>  drivers/clk/mediatek/clk-mtk.c |  36 ++-
>  drivers/clk/mediatek/clk-mtk.h |  24 +-
>  drivers/clk/mediatek/clk-pll.c |   7 +-
>  include/dt-bindings/clock/mt8173-clk.h | 101 +-
>  14 files changed, 735 insertions(+), 33 deletions(-)
>  create mode 100644 
> Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
>  create mode 100644 
> Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt
>  create mode 100644 
> Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt
>  create mode 100644 
> Documentation/devicetree/bindings/arm/mediatek/mediatek,vencltsys.txt
>  create mode 100644 
> Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt
>  create mode 100644 drivers/clk/mediatek/clk-apmixed.c
>
> --
> 1.8.1.1.dirty
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] Staging: android: ion: Fix missing a blank line coding style issue.

2015-08-10 Thread Junsu Shin
This is a patch to the ion.c that fixes a warning that tells missing a blank 
line after declaration

Signed-off-by: Junsu Shin 
---
 drivers/staging/android/ion/ion.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/android/ion/ion.c 
b/drivers/staging/android/ion/ion.c
index 6f48112..e44f5e6 100644
--- a/drivers/staging/android/ion/ion.c
+++ b/drivers/staging/android/ion/ion.c
@@ -1106,6 +1106,7 @@ struct dma_buf *ion_share_dma_buf(struct ion_client 
*client,
struct ion_buffer *buffer;
struct dma_buf *dmabuf;
bool valid_handle;
+
DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
 
mutex_lock(>lock);
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/2] watchdog: add wdt shutdown callback to disable wdt if enabled

2015-08-10 Thread Guenter Roeck

On 08/10/2015 09:28 PM, Daniel Kurtz wrote:

Hi Guenter, Matthias,

On Fri, Jul 24, 2015 at 1:37 AM, Matthias Brugger
 wrote:

On Thursday, July 23, 2015 01:49:11 PM Eddie Huang wrote:

From: Greta Zhang 

Without .shutdown(), watchdog might reset the system during power off.
For example, if watchdog's timeout is set to 30s, then it is reset to
zero by mtk_wdt_ping(). During power off, no app will ping watchdog,
but watchdog is still running and may trigger reset.

Signed-off-by: Greta Zhang 
Signed-off-by: Eddie Huang 
---
  drivers/watchdog/mtk_wdt.c | 9 +
  1 file changed, 9 insertions(+)


Acked-by: Matthias Brugger 


is the plan to land these two patches via Guenter's watchdog tree [0]?
[0] git://www.linux-watchdog.org/linux-watchdog.git


That is Wim's tree, and Wim is the maintainer ;-).

I have the patches queued in my tree [1], and I plan to send a pull request
to Wim this week or early next week.

Guenter

---
[1] 
https://git.kernel.org/cgit/linux/kernel/git/groeck/linux-staging.git/log/?h=watchdog-next

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/2] watchdog: add wdt shutdown callback to disable wdt if enabled

2015-08-10 Thread Daniel Kurtz
Hi Guenter, Matthias,

On Fri, Jul 24, 2015 at 1:37 AM, Matthias Brugger
 wrote:
> On Thursday, July 23, 2015 01:49:11 PM Eddie Huang wrote:
>> From: Greta Zhang 
>>
>> Without .shutdown(), watchdog might reset the system during power off.
>> For example, if watchdog's timeout is set to 30s, then it is reset to
>> zero by mtk_wdt_ping(). During power off, no app will ping watchdog,
>> but watchdog is still running and may trigger reset.
>>
>> Signed-off-by: Greta Zhang 
>> Signed-off-by: Eddie Huang 
>> ---
>>  drivers/watchdog/mtk_wdt.c | 9 +
>>  1 file changed, 9 insertions(+)
>
> Acked-by: Matthias Brugger 

is the plan to land these two patches via Guenter's watchdog tree [0]?
[0] git://www.linux-watchdog.org/linux-watchdog.git

In fact, though, I don't see any new patches in that repository.
The only branches I see are:
  remotes/wdog/master  b953c0d Linux 4.1
  remotes/wdog/winbond-superio dc89871
Sample Winbond Super-I/O MFD device consisting out of a lowel-level
driver that does the detection and creates the platform-data and a
watchdog driver.

Am I looking in the wrong place?

-Dan

> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] net/fddi: remove HWM_REVERSE() macro

2015-08-10 Thread David Miller
From: yalin wang 
Date: Tue, 11 Aug 2015 09:57:21 +0800

>  HWM_REVERSE() macro is unused, remove it.
> 
> Signed-off-by: yalin wang 

Your email client has corrupted this patch.

Please read Documentation/email-clients.txt, send a test patch to yourself,
and only resubmit this change once you are able to successfully apply the
patch you receive in that test email.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH net] netconsole: Check for carrier before calling netpoll_send_udp()

2015-08-10 Thread David Miller
From: Jon Maxwell 
Date: Tue, 11 Aug 2015 11:32:26 +1000

> We have seen a few crashes recently where a NIC is getting
> reset for some reason and then the driver or another module calls
> printk() which invokes netconsole. Netconsole then calls the
> adapter specific poll routine via netpoll which crashes because 
> the adapter is resetting and its structures are being reinitialized.

This isn't a fix.

What if the carrier check passes, and then the chip reset starts on
another cpu?  You'll have the same problem.

I'm not applying this, sorry.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[GIT PULL] extcon next for 4.3

2015-08-10 Thread Chanwoo Choi
Dear Greg,

This is extcon-next full request for v4.3. I add detailed description of this
pull request on below. Please pull extcon with following updates.

Best Regards,
Chanwoo Choi

The following changes since commit f7644cbfcdf03528f0f450f3940c4985b2291f49:

  Linux 4.2-rc6 (2015-08-09 15:54:30 -0400)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git 
tags/extcon-next-for-4.3
  
for you to fetch changes up to 92b7cb5dc885b38b21093eefed8028b615952965:

  extcon: palmas: Support GPIO based USB ID detection (2015-08-10 21:26:25 
+0900)


Update extcon for v4.3

This patchset include the function update of extcon drivers without critical 
update
and fix minor issue of extcon drivers.

Detailed description for patchset:
1. Update the extcon drivers:
- Update the logic of microphone detection for extcon-arizona driver
- Support GPIO based USB ID detection of extcon-palmas driver

2. Fix minor issues:
- Clean code and remove the opitonal print_state() function pointer from extcon 
core driver
- Clear interrupt bit state before requesting irq on extcon-max778433 driver
- Fix signedness bugs of extcon core driver


Chanwoo Choi (4):
  extcon: Remove duplicate header file in extcon.h
  extcon: Remove optional print_state() function pointer of struct 
extcon_dev
  extcon: palmas: Remove the mutually_exclusive array
  extcon: Add exception handling to prevent the NULL pointer access

Charles Keepax (6):
  extcon: arizona: Update to use the new device properties API
  extcon: arizona: Add basic microphone detection DT/ACPI bindings
  extcon: arizona: Use gpiod inteface to handle micd_pol_gpio gpio
  extcon: arizona: Ensure variables are set for headphone detection
  extcon: arizona: Declare 3-pole jack if we detect open circuit on mic
  extcon: arizona: Simplify pdata symantics for micd_dbtime

Dan Carpenter (1):
  extcon: Fix signedness bugs about break error handling

Jaewon Kim (1):
  extcon: max77843: Clear IRQ bits state before request IRQ

Krzysztof Kozlowski (1):
  extcon: Drop owner assignment from i2c_driver

Roger Quadros (1):
  extcon: palmas: Support GPIO based USB ID detection

 .../devicetree/bindings/extcon/extcon-palmas.txt   |   5 +-
 drivers/extcon/extcon-arizona.c| 101 +---
 drivers/extcon/extcon-gpio.c   |  18 ---
 drivers/extcon/extcon-max77843.c   |   9 ++
 drivers/extcon/extcon-palmas.c | 132 ++---
 drivers/extcon/extcon-rt8973a.c|   1 -
 drivers/extcon/extcon-sm5502.c |   1 -
 drivers/extcon/extcon-usb-gpio.c   |   1 +
 drivers/extcon/extcon.c|  48 ++--
 include/linux/extcon.h |   7 --
 include/linux/mfd/palmas.h |   7 ++
 11 files changed, 253 insertions(+), 77 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 bluetooth-next] cc2520: set the default fifo pin value from platform data

2015-08-10 Thread Marcel Holtmann
Hi Yong,

> When the device tree support is disabled, the fifo_pin is uninitialized,
> this patch will set the fifo_pin value based on platform data
> 
> Signed-off-by: Yong Li 
> ---
> drivers/net/ieee802154/cc2520.c | 1 +
> 1 file changed, 1 insertion(+)

patch has been applied to bluetooth-next tree.

Regards

Marcel

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V10] fixup: audit: implement audit by executable

2015-08-10 Thread Richard Guy Briggs
On 15/08/10, Paul Moore wrote:
> On Monday, August 10, 2015 01:29:43 PM Richard Guy Briggs wrote:
> > On 15/08/10, Paul Moore wrote:
> > > On Saturday, August 08, 2015 10:20:25 AM Richard Guy Briggs wrote:
> > > > diff --git a/kernel/audit_watch.c b/kernel/audit_watch.c
> > > > index 1255dbf..656c7e9 100644
> > > > --- a/kernel/audit_watch.c
> > > > +++ b/kernel/audit_watch.c
> > > > @@ -540,8 +540,14 @@ int audit_dupe_exe(struct audit_krule *new, struct
> > > > audit_krule *old)
> > > > 
> > > >  int audit_exe_compare(struct task_struct *tsk, struct
> > > >  audit_fsnotify_mark
> > > > 
> > > > *mark) {
> > > > -   unsigned long ino = tsk->mm->exe_file->f_inode->i_ino;
> > > > -   dev_t dev = tsk->mm->exe_file->f_inode->i_sb->s_dev;
> > > > -
> > > > +   struct file *exe_file;
> > > > +   unsigned long ino;
> > > > +   dev_t dev;
> > > > +
> > > > +   rcu_read_lock();
> > > > +   exe_file = rcu_dereference(tsk->mm->exe_file);
> > > 
> > > This line is triggering a sparse error on my system:
> > >  # make C=1 M=kernel
> > >  ...
> > >  
> > >CHECK   kernel/audit_watch.c
> > >  
> > >  kernel/audit_watch.c:548:20: error: incompatible types in comparison
> > >  expression (different address spaces)
> > 
> > That's odd.  I got this complaint when I had forgotten to add the
> > rcu_dereference() call, but not in its current state.  Mind you, I get
> > swamped with errors and warnings from all over the system (starting with
> > ptrace.c, signal.c, exit.c, fork.c, audit.c, ftrace.c,
> > selinux/netnode.c, ...) when I add
> > "M=kernel" to my build command, so I start to wonder how valid that
> > result is or that flag.  Where is M=kernel documented?
> 
> I don't remember anymore, it's something I've been using so long that I've 
> forgotten where I first learned of it.  The "M=" flag signals that you 
> only 
> want to build a specific module/directory, e.g. M=kernel builds everything 
> under kernel/ whereas M=security/selinux builds everything under 
> security/selinux.
> 
> So you don't see this error?

No, I don't, but I see a number of unrelated ones that I will address in time...

> paul moore

- RGB

--
Richard Guy Briggs 
Senior Software Engineer, Kernel Security, AMER ENG Base Operating Systems, Red 
Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635, Alt: +1.613.693.0684x3545
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 00/11] test_user_copy improvements

2015-08-10 Thread David Miller
From: David Miller 
Date: Mon, 10 Aug 2015 15:29:38 -0700 (PDT)

> Also, I think the tests you added and protected with MIPS ifdefs could
> equally be enabled on sparc64.

James, as per this issue, I was thinking we could do something like this
so that the tests don't get messy:

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index cee5f93..48d20c8 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -1922,6 +1922,7 @@ config CPU_MIPSR6
 
 config EVA
bool
+   select ARCH_SPLIT_VA_SPACE
 
 config XPA
bool
diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 56442d2..4001d04 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -80,6 +80,7 @@ config SPARC64
select NO_BOOTMEM
select HAVE_ARCH_AUDITSYSCALL
select ARCH_SUPPORTS_ATOMIC_RMW
+   select ARCH_SPLIT_VA_SPACE
 
 config ARCH_DEFCONFIG
string
diff --git a/lib/Kconfig b/lib/Kconfig
index 3a2ef67..149eb29 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -62,6 +62,9 @@ config ARCH_USE_CMPXCHG_LOCKREF
 config ARCH_HAS_FAST_MULTIPLIER
bool
 
+config ARCH_SPLIT_VA_SPACE
+   def_bool n
+
 config CRC_CCITT
tristate "CRC-CCITT functions"
help
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4] dtb: Create a common home for cross-architecture dtsi files.

2015-08-10 Thread Masahiro Yamada
Hi

2015-08-04 1:06 GMT+09:00 Ian Campbell :
> Commit 9ccd608070b6 ("arm64: dts: add device tree for ARM SMM-A53x2 on
> LogicTile Express 20MG") added a new dts file to arch/arm64 which
> included "../../../../arm/boot/dts/vexpress-v2m-rs1.dtsi", i.e. a
> .dtsi supplied by arch/arm.
>
> Unfortunately this causes some issues for the split device tree
> repository[0], since things get moved around there. In that context
> the new .dts ends up at src/arm64/arm/vexpress-v2f-1xv7-ca53x2.dts
> while the include is at src/arm/vexpress-v2m-rs1.dtsi.
>
> The sharing of the .dtsi is legitimate since the baseboard is the same
> for various vexpress systems whatever processor they use.
>
> Rather than using ../../ tricks to pickup .dtsi files from another
> arch this patch creates a new directory kernel/dts as a home for such
> cross-arch .dtsi files and arranges for it to be in the include path
> for both dtc and cpp. The dtsi file itself is moved into a vendor
> subdir in this case "arm" (the vendor, not the ARCH=).


Question:
If this patch is applied, which directory will be created in
device-tree-rebasing?
src/kernel/, src/common/, or something else?
Either will do, of course.


Another nit:
I just noticed a period at the end of the commit subject.
Re-post would not be needed only for such a minor thing,
but please try best to remember to drop it when this patch is applied.




-- 
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 0/4] ARM: dts: exynos3250: Add UART2 and MMC2 dt node with related clocks

2015-08-10 Thread Chanwoo Choi
This patch add the UART2 / MMC2 devicetree node for Exynos3250 SoC and add
the related clocks (mux, divider, gate) of UART2 / MMC2 device.

Chanwoo Choi (4):
  clk: samsung: exynos3250: Add UART2 clock
  clk: samsung: exynos3250: Add MMC2 clock
  ARM: dts: Add UART2 dt node for Exynos3250 SoC
  ARM: dts: Add MSHC2 dt node for Exynos3250 SoC

 arch/arm/boot/dts/exynos3250-pinctrl.dtsi | 42 +++
 arch/arm/boot/dts/exynos3250.dtsi | 25 ++
 drivers/clk/samsung/clk-exynos3250.c  | 15 +++
 include/dt-bindings/clock/exynos3250.h| 11 +++-
 4 files changed, 92 insertions(+), 1 deletion(-)

-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] clk: samsung: exynos3250: Add UART2 clock

2015-08-10 Thread Chanwoo Choi
This patch add the UART2 clocks (mux, divider, gate) of Exynos3250 SoC.

Cc: Sylwester Nawrocki 
Cc: Tomasz Figa 
Signed-off-by: Chanwoo Choi 
---
 drivers/clk/samsung/clk-exynos3250.c   | 6 ++
 include/dt-bindings/clock/exynos3250.h | 6 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/samsung/clk-exynos3250.c 
b/drivers/clk/samsung/clk-exynos3250.c
index 538de66a759e..2105863a3ace 100644
--- a/drivers/clk/samsung/clk-exynos3250.c
+++ b/drivers/clk/samsung/clk-exynos3250.c
@@ -307,6 +307,7 @@ static struct samsung_mux_clock mux_clks[] __initdata = {
MUX(CLK_MOUT_MMC0, "mout_mmc0", group_sclk_p, SRC_FSYS, 0, 4),
 
/* SRC_PERIL0 */
+   MUX(CLK_MOUT_UART2, "mout_uart2", group_sclk_p, SRC_PERIL0, 8, 4),
MUX(CLK_MOUT_UART1, "mout_uart1", group_sclk_p, SRC_PERIL0, 4, 4),
MUX(CLK_MOUT_UART0, "mout_uart0", group_sclk_p, SRC_PERIL0, 0, 4),
 
@@ -389,6 +390,7 @@ static struct samsung_div_clock div_clks[] __initdata = {
DIV(CLK_DIV_MMC0, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
 
/* DIV_PERIL0 */
+   DIV(CLK_DIV_UART2, "div_uart2", "mout_uart2", DIV_PERIL0, 8, 4),
DIV(CLK_DIV_UART1, "div_uart1", "mout_uart1", DIV_PERIL0, 4, 4),
DIV(CLK_DIV_UART0, "div_uart0", "mout_uart0", DIV_PERIL0, 0, 4),
 
@@ -551,6 +553,9 @@ static struct samsung_gate_clock gate_clks[] __initdata = {
GATE_SCLK_PERIL, 7, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_SPI0, "sclk_spi0", "div_spi0_pre",
GATE_SCLK_PERIL, 6, CLK_SET_RATE_PARENT, 0),
+
+   GATE(CLK_SCLK_UART2, "sclk_uart2", "div_uart2",
+   GATE_SCLK_PERIL, 2, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_UART1, "sclk_uart1", "div_uart1",
GATE_SCLK_PERIL, 1, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_UART0, "sclk_uart0", "div_uart0",
@@ -648,6 +653,7 @@ static struct samsung_gate_clock gate_clks[] __initdata = {
GATE(CLK_I2C2, "i2c2", "div_aclk_100", GATE_IP_PERIL, 8, 0, 0),
GATE(CLK_I2C1, "i2c1", "div_aclk_100", GATE_IP_PERIL, 7, 0, 0),
GATE(CLK_I2C0, "i2c0", "div_aclk_100", GATE_IP_PERIL, 6, 0, 0),
+   GATE(CLK_UART2, "uart2", "div_aclk_100", GATE_IP_PERIL, 2, 0, 0),
GATE(CLK_UART1, "uart1", "div_aclk_100", GATE_IP_PERIL, 1, 0, 0),
GATE(CLK_UART0, "uart0", "div_aclk_100", GATE_IP_PERIL, 0, 0, 0),
 };
diff --git a/include/dt-bindings/clock/exynos3250.h 
b/include/dt-bindings/clock/exynos3250.h
index aab088d30199..89a7d97b002c 100644
--- a/include/dt-bindings/clock/exynos3250.h
+++ b/include/dt-bindings/clock/exynos3250.h
@@ -78,6 +78,7 @@
 #define CLK_MOUT_CORE  58
 #define CLK_MOUT_APLL  59
 #define CLK_MOUT_ACLK_266_SUB  60
+#define CLK_MOUT_UART2 61
 
 /* Dividers */
 #define CLK_DIV_GPL64
@@ -126,6 +127,7 @@
 #define CLK_DIV_CORE   107
 #define CLK_DIV_HPM108
 #define CLK_DIV_COPY   109
+#define CLK_DIV_UART2  110
 
 /* Gates */
 #define CLK_ASYNC_G3D  128
@@ -222,6 +224,7 @@
 #define CLK_BLOCK_MFC  219
 #define CLK_BLOCK_CAM  220
 #define CLK_SMIES  221
+#define CLK_UART2  222
 
 /* Special clocks */
 #define CLK_SCLK_JPEG  224
@@ -248,12 +251,13 @@
 #define CLK_SCLK_SPI0  245
 #define CLK_SCLK_UART1 246
 #define CLK_SCLK_UART0 247
+#define CLK_SCLK_UART2 248
 
 /*
  * Total number of clocks of main CMU.
  * NOTE: Must be equal to last clock ID increased by one.
  */
-#define CLK_NR_CLKS248
+#define CLK_NR_CLKS249
 
 /*
  * CMU DMC
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/4] ARM: dts: Add UART2 dt node for Exynos3250 SoC

2015-08-10 Thread Chanwoo Choi
This patch add the uart2 devicetree node for Exynos3250 SoC.

Cc: Kukjin Kim 
Cc: Krzysztof Kozlowski 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos3250-pinctrl.dtsi |  7 +++
 arch/arm/boot/dts/exynos3250.dtsi | 12 
 2 files changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
index 5ab81c39e2c9..eac1d21c10d4 100644
--- a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
@@ -120,6 +120,13 @@
samsung,pin-drv = <0>;
};
 
+   uart2_data: uart2-data {
+   samsung,pins = "gpa1-0", "gpa1-1";
+   samsung,pin-function = <2>;
+   samsung,pin-pud = <0>;
+   samsung,pin-drv = <0>;
+   };
+
i2c3_bus: i2c3-bus {
samsung,pins = "gpa1-2", "gpa1-3";
samsung,pin-function = <3>;
diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 2db99433e17f..02f3250766c9 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -42,6 +42,7 @@
i2c7 = _7;
serial0 = _0;
serial1 = _1;
+   serial2 = _2;
};
 
cpus {
@@ -435,6 +436,17 @@
status = "disabled";
};
 
+   serial_2: serial@1382 {
+   compatible = "samsung,exynos4210-uart";
+   reg = <0x1382 0x100>;
+   interrupts = <0 111 0>;
+   clocks = < CLK_UART2>, < CLK_SCLK_UART2>;
+   clock-names = "uart", "clk_uart_baud0";
+   pinctrl-names = "default";
+   pinctrl-0 = <_data>;
+   status = "disabled";
+   };
+
i2c_0: i2c@1386 {
#address-cells = <1>;
#size-cells = <0>;
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] clk: samsung: exynos3250: Add MMC2 clock

2015-08-10 Thread Chanwoo Choi
This patch add the MMC2 clocks (mux, divider, gate) of Exynos3250 SoC.

Cc: Sylwester Nawrocki 
Cc: Tomasz Figa 
Signed-off-by: Chanwoo Choi 
---
 drivers/clk/samsung/clk-exynos3250.c   | 9 +
 include/dt-bindings/clock/exynos3250.h | 7 ++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/samsung/clk-exynos3250.c 
b/drivers/clk/samsung/clk-exynos3250.c
index 2105863a3ace..2683cf03e656 100644
--- a/drivers/clk/samsung/clk-exynos3250.c
+++ b/drivers/clk/samsung/clk-exynos3250.c
@@ -303,6 +303,7 @@ static struct samsung_mux_clock mux_clks[] __initdata = {
 
/* SRC_FSYS */
MUX(CLK_MOUT_TSADC, "mout_tsadc", group_sclk_p, SRC_FSYS, 28, 4),
+   MUX(CLK_MOUT_MMC2, "mout_mmc2", group_sclk_p, SRC_FSYS, 8, 4),
MUX(CLK_MOUT_MMC1, "mout_mmc1", group_sclk_p, SRC_FSYS, 4, 4),
MUX(CLK_MOUT_MMC0, "mout_mmc0", group_sclk_p, SRC_FSYS, 0, 4),
 
@@ -389,6 +390,11 @@ static struct samsung_div_clock div_clks[] __initdata = {
CLK_SET_RATE_PARENT, 0),
DIV(CLK_DIV_MMC0, "div_mmc0", "mout_mmc0", DIV_FSYS1, 0, 4),
 
+   /* DIV_FSYS2 */
+   DIV_F(CLK_DIV_MMC2_PRE, "div_mmc2_pre", "div_mmc2", DIV_FSYS2, 8, 8,
+   CLK_SET_RATE_PARENT, 0),
+   DIV(CLK_DIV_MMC2, "div_mmc2", "mout_mmc2", DIV_FSYS2, 0, 4),
+
/* DIV_PERIL0 */
DIV(CLK_DIV_UART2, "div_uart2", "mout_uart2", DIV_PERIL0, 8, 4),
DIV(CLK_DIV_UART1, "div_uart1", "mout_uart1", DIV_PERIL0, 4, 4),
@@ -539,6 +545,8 @@ static struct samsung_gate_clock gate_clks[] __initdata = {
GATE_SCLK_FSYS, 9, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_EBI, "sclk_ebi", "div_ebi",
GATE_SCLK_FSYS, 6, CLK_SET_RATE_PARENT, 0),
+   GATE(CLK_SCLK_MMC2, "sclk_mmc2", "div_mmc2_pre",
+   GATE_SCLK_FSYS, 2, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_MMC1, "sclk_mmc1", "div_mmc1_pre",
GATE_SCLK_FSYS, 1, CLK_SET_RATE_PARENT, 0),
GATE(CLK_SCLK_MMC0, "sclk_mmc0", "div_mmc0_pre",
@@ -634,6 +642,7 @@ static struct samsung_gate_clock gate_clks[] __initdata = {
GATE(CLK_USBOTG, "usbotg", "div_aclk_200", GATE_IP_FSYS, 13, 0, 0),
GATE(CLK_USBHOST, "usbhost", "div_aclk_200", GATE_IP_FSYS, 12, 0, 0),
GATE(CLK_SROMC, "sromc", "div_aclk_200", GATE_IP_FSYS, 11, 0, 0),
+   GATE(CLK_SDMMC2, "sdmmc2", "div_aclk_200", GATE_IP_FSYS, 7, 0, 0),
GATE(CLK_SDMMC1, "sdmmc1", "div_aclk_200", GATE_IP_FSYS, 6, 0, 0),
GATE(CLK_SDMMC0, "sdmmc0", "div_aclk_200", GATE_IP_FSYS, 5, 0, 0),
GATE(CLK_PDMA1, "pdma1", "div_aclk_200", GATE_IP_FSYS, 1, 0, 0),
diff --git a/include/dt-bindings/clock/exynos3250.h 
b/include/dt-bindings/clock/exynos3250.h
index 89a7d97b002c..fbc9ef61b191 100644
--- a/include/dt-bindings/clock/exynos3250.h
+++ b/include/dt-bindings/clock/exynos3250.h
@@ -79,6 +79,7 @@
 #define CLK_MOUT_APLL  59
 #define CLK_MOUT_ACLK_266_SUB  60
 #define CLK_MOUT_UART2 61
+#define CLK_MOUT_MMC2  62
 
 /* Dividers */
 #define CLK_DIV_GPL64
@@ -128,6 +129,8 @@
 #define CLK_DIV_HPM108
 #define CLK_DIV_COPY   109
 #define CLK_DIV_UART2  110
+#define CLK_DIV_MMC2_PRE   111
+#define CLK_DIV_MMC2   112
 
 /* Gates */
 #define CLK_ASYNC_G3D  128
@@ -225,6 +228,7 @@
 #define CLK_BLOCK_CAM  220
 #define CLK_SMIES  221
 #define CLK_UART2  222
+#define CLK_SDMMC2 223
 
 /* Special clocks */
 #define CLK_SCLK_JPEG  224
@@ -252,12 +256,13 @@
 #define CLK_SCLK_UART1 246
 #define CLK_SCLK_UART0 247
 #define CLK_SCLK_UART2 248
+#define CLK_SCLK_MMC2  249
 
 /*
  * Total number of clocks of main CMU.
  * NOTE: Must be equal to last clock ID increased by one.
  */
-#define CLK_NR_CLKS249
+#define CLK_NR_CLKS250
 
 /*
  * CMU DMC
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] ARM: dts: Add MSHC2 dt node for Exynos3250 SoC

2015-08-10 Thread Chanwoo Choi
This patch add the MSHC2 (Mobile Storage Host Controller) devicetree node for
Exynos3250 SoC.

Cc: Kukjin Kim 
Cc: Krzysztof Kozlowski 
Signed-off-by: Chanwoo Choi 
---
 arch/arm/boot/dts/exynos3250-pinctrl.dtsi | 35 +++
 arch/arm/boot/dts/exynos3250.dtsi | 13 
 2 files changed, 48 insertions(+)

diff --git a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi 
b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
index eac1d21c10d4..78b995fed6c7 100644
--- a/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
+++ b/arch/arm/boot/dts/exynos3250-pinctrl.dtsi
@@ -452,6 +452,41 @@
samsung,pin-drv = <3>;
};
 
+   sd2_clk: sd2-clk {
+   samsung,pins = "gpk2-0";
+   samsung,pin-function = <2>;
+   samsung,pin-pud = <0>;
+   samsung,pin-drv = <3>;
+   };
+
+   sd2_cmd: sd2-cmd {
+   samsung,pins = "gpk2-1";
+   samsung,pin-function = <2>;
+   samsung,pin-pud = <0>;
+   samsung,pin-drv = <3>;
+   };
+
+   sd2_cd: sd2-cd {
+   samsung,pins = "gpk2-2";
+   samsung,pin-function = <2>;
+   samsung,pin-pud = <3>;
+   samsung,pin-drv = <3>;
+   };
+
+   sd2_bus1: sd2-bus-width1 {
+   samsung,pins = "gpk2-3";
+   samsung,pin-function = <2>;
+   samsung,pin-pud = <3>;
+   samsung,pin-drv = <3>;
+   };
+
+   sd2_bus4: sd2-bus-width4 {
+   samsung,pins = "gpk2-4", "gpk2-5", "gpk2-6";
+   samsung,pin-function = <2>;
+   samsung,pin-pud = <3>;
+   samsung,pin-drv = <3>;
+   };
+
cam_port_b_io: cam-port-b-io {
samsung,pins = "gpm0-0", "gpm0-1", "gpm0-2", "gpm0-3",
"gpm0-4", "gpm0-5", "gpm0-6", "gpm0-7",
diff --git a/arch/arm/boot/dts/exynos3250.dtsi 
b/arch/arm/boot/dts/exynos3250.dtsi
index 02f3250766c9..5a91eaa26565 100644
--- a/arch/arm/boot/dts/exynos3250.dtsi
+++ b/arch/arm/boot/dts/exynos3250.dtsi
@@ -30,6 +30,7 @@
pinctrl1 = _1;
mshc0 = _0;
mshc1 = _1;
+   mshc2 = _2;
spi0 = _0;
spi1 = _1;
i2c0 = _0;
@@ -341,6 +342,18 @@
status = "disabled";
};
 
+   mshc_2: mshc@1253 {
+   compatible = "samsung,exynos5250-dw-mshc";
+   reg = <0x1253 0x1000>;
+   interrupts = <0 144 0>;
+   clocks = < CLK_SDMMC2>, < CLK_SCLK_MMC2>;
+   clock-names = "biu", "ciu";
+   fifo-depth = <0x80>;
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "disabled";
+   };
+
exynos_usbphy: exynos-usbphy@125B {
compatible = "samsung,exynos3250-usb2-phy";
reg = <0x125B 0x100>;
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: Unbreak resetting default values for tcp_wmem/udp_wmem_min

2015-08-10 Thread David Miller
From: Calvin Owens 
Date: Mon, 10 Aug 2015 20:34:06 -0700

> I'm really questioning the limitation itself: why enforce a minimum of
> SOCK_MIN_SNDBUF here? Why not SK_MEM_QUANTUM?
> 
> Commit 8133534c760d4083 referred to b1cb59cf2efe7971, which choose to
> use the SOCK_MIN constants as the lower limits to avoid nasty bugs. But
> AFAICS, a limit of SOCK_MIN_SNDBUF isn't necessary to do that: the
> BUG_ON cited in the commit message for b1cb59cf2efe7971 seems to have
> happened because unix_stream_sendmsg() expects a minimum of a full page
> (ie SK_MEM_QUANTUM) and the math broke, not because it had less than
> SOCK_MIN_SNDBUF allocated.
> 
> Nothing seems to assume that it has at least SOCK_MIN_SNDBUF to play
> with, so my argument is that enforcing a minimum of SK_MEM_QUANTUM
> avoids the sort of bugs commit 8133534c760d4083 was trying to avoid, and
> it does so without breaking anybody's sysctl configurations. What do you
> think?

The author of said commit argues that too small values lead to really
bad performance, but I guess he should have adjusted the default if he
cared about it so much.

Ok, can you respin your patch with some added details in the commit
message like what you said above?

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 03/10] cleanup IORESOURCE_CACHEABLE vs ioremap()

2015-08-10 Thread Dan Williams
Quoting Arnd:
I was thinking the opposite approach and basically removing all uses
of IORESOURCE_CACHEABLE from the kernel. There are only a handful of
them.and we can probably replace them all with hardcoded
ioremap_cached() calls in the cases they are actually useful.

All existing usages of IORESOURCE_CACHEABLE call ioremap() instead of
ioremap_nocache() if the resource is cacheable, however ioremap() is
uncached by default. Clearly none of the existing usages care about the
cacheability. Particularly devm_ioremap_resource() never worked as
advertised since it always fell back to plain ioremap().

Clean this up as the new direction we want is to convert
ioremap_() usages to memremap(..., flags).

Suggested-by: Arnd Bergmann 
Signed-off-by: Dan Williams 
---
 arch/arm/mach-clps711x/board-cdb89712.c |2 +-
 arch/powerpc/kernel/pci_of_scan.c   |2 +-
 arch/sparc/kernel/pci.c |3 +--
 drivers/pci/probe.c |3 +--
 drivers/pnp/manager.c   |2 --
 drivers/scsi/aic94xx/aic94xx_init.c |7 +--
 drivers/scsi/arcmsr/arcmsr_hba.c|5 +
 drivers/scsi/mvsas/mv_init.c|   15 ---
 drivers/video/fbdev/ocfb.c  |1 -
 lib/devres.c|   13 -
 lib/pci_iomap.c |7 ++-
 11 files changed, 16 insertions(+), 44 deletions(-)

diff --git a/arch/arm/mach-clps711x/board-cdb89712.c 
b/arch/arm/mach-clps711x/board-cdb89712.c
index 1ec378c334e5..972abdb10028 100644
--- a/arch/arm/mach-clps711x/board-cdb89712.c
+++ b/arch/arm/mach-clps711x/board-cdb89712.c
@@ -95,7 +95,7 @@ static struct physmap_flash_data cdb89712_bootrom_pdata 
__initdata = {
 
 static struct resource cdb89712_bootrom_resources[] __initdata = {
DEFINE_RES_NAMED(CS7_PHYS_BASE, SZ_128, "BOOTROM", IORESOURCE_MEM |
-IORESOURCE_CACHEABLE | IORESOURCE_READONLY),
+IORESOURCE_READONLY),
 };
 
 static struct platform_device cdb89712_bootrom_pdev __initdata = {
diff --git a/arch/powerpc/kernel/pci_of_scan.c 
b/arch/powerpc/kernel/pci_of_scan.c
index 42e02a2d570b..d4726addff0b 100644
--- a/arch/powerpc/kernel/pci_of_scan.c
+++ b/arch/powerpc/kernel/pci_of_scan.c
@@ -102,7 +102,7 @@ static void of_pci_parse_addrs(struct device_node *node, 
struct pci_dev *dev)
res = >resource[(i - PCI_BASE_ADDRESS_0) >> 2];
} else if (i == dev->rom_base_reg) {
res = >resource[PCI_ROM_RESOURCE];
-   flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE;
+   flags |= IORESOURCE_READONLY;
} else {
printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
continue;
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c
index c928bc64b4ba..04da147e0712 100644
--- a/arch/sparc/kernel/pci.c
+++ b/arch/sparc/kernel/pci.c
@@ -231,8 +231,7 @@ static void pci_parse_of_addrs(struct platform_device *op,
res = >resource[(i - PCI_BASE_ADDRESS_0) >> 2];
} else if (i == dev->rom_base_reg) {
res = >resource[PCI_ROM_RESOURCE];
-   flags |= IORESOURCE_READONLY | IORESOURCE_CACHEABLE
- | IORESOURCE_SIZEALIGN;
+   flags |= IORESOURCE_READONLY | IORESOURCE_SIZEALIGN;
} else {
printk(KERN_ERR "PCI: bad cfg reg num 0x%x\n", i);
continue;
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index cefd636681b6..8ed37dd04056 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -326,8 +326,7 @@ static void pci_read_bases(struct pci_dev *dev, unsigned 
int howmany, int rom)
struct resource *res = >resource[PCI_ROM_RESOURCE];
dev->rom_base_reg = rom;
res->flags = IORESOURCE_MEM | IORESOURCE_PREFETCH |
-   IORESOURCE_READONLY | IORESOURCE_CACHEABLE |
-   IORESOURCE_SIZEALIGN;
+   IORESOURCE_READONLY | IORESOURCE_SIZEALIGN;
__pci_read_base(dev, pci_bar_mem32, res, rom);
}
 }
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c
index 9357aa779048..7ad3295752ef 100644
--- a/drivers/pnp/manager.c
+++ b/drivers/pnp/manager.c
@@ -97,8 +97,6 @@ static int pnp_assign_mem(struct pnp_dev *dev, struct pnp_mem 
*rule, int idx)
/* ??? rule->flags restricted to 8 bits, all tests bogus ??? */
if (!(rule->flags & IORESOURCE_MEM_WRITEABLE))
res->flags |= IORESOURCE_READONLY;
-   if (rule->flags & IORESOURCE_MEM_CACHEABLE)
-   res->flags |= IORESOURCE_CACHEABLE;
if (rule->flags & IORESOURCE_MEM_RANGELENGTH)
res->flags |= IORESOURCE_RANGELENGTH;
if (rule->flags & 

[PATCH v4 08/10] pmem: convert to generic memremap

2015-08-10 Thread Dan Williams
Update memremap_pmem() to query the architecture for the mapping type of
the given persistent memory range  and then pass those flags to generic
memremap().  arch_memremap_pmem_flags() is provided an address range to
evaluate in the event an arch has a need for different mapping types by
address range.  For example the ACPI NFIT carries EFI mapping types in
its memory range description table.

Cc: Ross Zwisler 
Signed-off-by: Dan Williams 
---
 arch/x86/include/asm/io.h |2 +-
 arch/x86/mm/ioremap.c |   16 ++--
 include/linux/pmem.h  |   26 +++---
 3 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 8aeb6456188a..1644e19ea032 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -248,7 +248,7 @@ static inline void flush_write_buffers(void)
 #endif
 }
 
-void __pmem *arch_memremap_pmem(resource_size_t offset, size_t size);
+unsigned long arch_memremap_pmem_flags(resource_size_t offset, size_t size);
 #endif /* __KERNEL__ */
 
 extern void native_io_delay(void);
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index c0734030e9db..43b12c146113 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -205,6 +205,16 @@ err_free_memtype:
return NULL;
 }
 
+unsigned long arch_memremap_pmem_flags(resource_size_t offset, size_t size)
+{
+   /*
+* The expectation is that pmem is always WB capable range on
+* x86, i.e. no need to walk the range.
+*/
+   return MEMREMAP_WB;
+}
+EXPORT_SYMBOL(arch_memremap_pmem_flags);
+
 /**
  * ioremap_nocache -   map bus memory into CPU space
  * @phys_addr:bus address of the memory
@@ -317,12 +327,6 @@ void __iomem *ioremap_cache(resource_size_t phys_addr, 
unsigned long size)
 }
 EXPORT_SYMBOL(ioremap_cache);
 
-void __pmem *arch_memremap_pmem(resource_size_t offset, size_t size)
-{
-   return (void __force __pmem *) ioremap_cache(offset, size);
-}
-EXPORT_SYMBOL(arch_memremap_pmem);
-
 void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
unsigned long prot_val)
 {
diff --git a/include/linux/pmem.h b/include/linux/pmem.h
index 1bf74c735fa0..03f9d73f3e13 100644
--- a/include/linux/pmem.h
+++ b/include/linux/pmem.h
@@ -28,10 +28,10 @@ static inline bool __arch_has_wmb_pmem(void)
return false;
 }
 
-static inline void __pmem *arch_memremap_pmem(resource_size_t offset,
+static inline unsigned long arch_memremap_pmem_flags(resource_size_t offset,
unsigned long size)
 {
-   return NULL;
+   return 0;
 }
 
 static inline void arch_memcpy_to_pmem(void __pmem *dst, const void *src,
@@ -43,8 +43,8 @@ static inline void arch_memcpy_to_pmem(void __pmem *dst, 
const void *src,
 
 /*
  * Architectures that define ARCH_HAS_PMEM_API must provide
- * implementations for arch_memremap_pmem(), arch_memcpy_to_pmem(),
- * arch_wmb_pmem(), and __arch_has_wmb_pmem().
+ * implementations for arch_memremap_pmem_flags(),
+ * arch_memcpy_to_pmem(), arch_wmb_pmem(), and __arch_has_wmb_pmem().
  */
 
 static inline void memcpy_from_pmem(void *dst, void __pmem const *src, size_t 
size)
@@ -54,7 +54,7 @@ static inline void memcpy_from_pmem(void *dst, void __pmem 
const *src, size_t si
 
 static inline void memunmap_pmem(void __pmem *addr)
 {
-   iounmap((void __force __iomem *) addr);
+   memunmap((void __force *) addr);
 }
 
 /**
@@ -85,16 +85,15 @@ static inline bool arch_has_pmem_api(void)
  * default_memremap_pmem + default_memcpy_to_pmem is sufficient for
  * making data durable relative to i/o completion.
  */
-static void default_memcpy_to_pmem(void __pmem *dst, const void *src,
+static inline void default_memcpy_to_pmem(void __pmem *dst, const void *src,
size_t size)
 {
memcpy((void __force *) dst, src, size);
 }
 
-static void __pmem *default_memremap_pmem(resource_size_t offset,
-   unsigned long size)
+static inline unsigned long default_memremap_pmem_flags(void)
 {
-   return (void __pmem *) memremap(offset, size, MEMREMAP_WT);
+   return MEMREMAP_WT;
 }
 
 /**
@@ -112,9 +111,14 @@ static void __pmem *default_memremap_pmem(resource_size_t 
offset,
 static inline void __pmem *memremap_pmem(resource_size_t offset,
unsigned long size)
 {
+   unsigned long flags;
+
if (arch_has_pmem_api())
-   return arch_memremap_pmem(offset, size);
-   return default_memremap_pmem(offset, size);
+   flags = arch_memremap_pmem_flags(offset, size);
+   else
+   flags = default_memremap_pmem_flags();
+
+   return (void __pmem *) memremap(offset, size, flags);
 }
 
 /**

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  

[PATCH v4 00/10] memremap for 4.3

2015-08-10 Thread Dan Williams
Changes since v3: [1]

1/ Include devm_memremap() support (Christoph)

2/ Rebase the series to defer the removal of ioremap_cache() and drop
   any of the ioremap_cache()-to-memremap() conversions that have yet to be
   acked by the appropriate maintainer. This avoids any potential for
   bisection breakage during the 4.3 merge and the cleanup can be done for
   4.4. (Christoph)

[1]: https://lists.01.org/pipermail/linux-nvdimm/2015-July/001649.html
---

While developing the pmem driver we noticed that the __iomem annotation
on the return value from ioremap_cache() was being mishandled by several
callers.  We also observed that all of the call sites expected to be
able to treat the return value from ioremap_cache() as normal
(non-__iomem) pointer to memory.

See also, the LWN write up: https://lwn.net/Articles/653585/

This has passed a 0day run and will appear in libnvdimm-for-next
shortly.

---

Christoph Hellwig (2):
  devres: add devm_memremap
  pmem: switch to devm_ allocations

Dan Williams (8):
  mm: enhance region_is_ram() to region_intersects()
  arch, drivers: don't include  directly, use  instead
  cleanup IORESOURCE_CACHEABLE vs ioremap()
  arch: introduce memremap()
  visorbus: switch from ioremap_cache to memremap
  libnvdimm, pmem: push call to ioremap_cache out of line
  pmem: switch from ioremap_wt to memremap
  pmem: convert to generic memremap


 arch/arm/mach-clps711x/board-cdb89712.c|2 
 arch/arm/mach-shmobile/pm-rcar.c   |2 
 arch/ia64/include/asm/io.h |1 
 arch/ia64/kernel/cyclone.c |2 
 arch/powerpc/kernel/pci_of_scan.c  |2 
 arch/sh/include/asm/io.h   |1 
 arch/sparc/kernel/pci.c|3 -
 arch/x86/include/asm/io.h  |7 -
 arch/x86/mm/ioremap.c  |   10 ++
 arch/xtensa/include/asm/io.h   |1 
 drivers/isdn/icn/icn.h |2 
 drivers/mtd/devices/slram.c|2 
 drivers/mtd/nand/diskonchip.c  |2 
 drivers/mtd/onenand/generic.c  |2 
 drivers/nvdimm/pmem.c  |   36 ++
 drivers/pci/probe.c|3 -
 drivers/pnp/manager.c  |2 
 drivers/scsi/aic94xx/aic94xx_init.c|7 -
 drivers/scsi/arcmsr/arcmsr_hba.c   |5 -
 drivers/scsi/mvsas/mv_init.c   |   15 +--
 drivers/scsi/sun3x_esp.c   |2 
 drivers/staging/comedi/drivers/ii_pci20kc.c|1 
 drivers/staging/unisys/visorbus/visorchannel.c |   16 ++-
 drivers/staging/unisys/visorbus/visorchipset.c |   17 ++-
 drivers/tty/serial/8250/8250_core.c|2 
 drivers/video/fbdev/ocfb.c |1 
 drivers/video/fbdev/s1d13xxxfb.c   |3 -
 drivers/video/fbdev/stifb.c|1 
 include/linux/io-mapping.h |2 
 include/linux/io.h |   13 ++
 include/linux/mm.h |9 +-
 include/linux/mtd/map.h|2 
 include/linux/pmem.h   |   30 +++--
 include/video/vga.h|2 
 kernel/Makefile|2 
 kernel/memremap.c  |  138 
 kernel/resource.c  |   61 ++-
 lib/devres.c   |   13 +-
 lib/pci_iomap.c|7 -
 tools/testing/nvdimm/Kbuild|4 -
 tools/testing/nvdimm/test/iomap.c  |   46 ++--
 41 files changed, 323 insertions(+), 156 deletions(-)
 create mode 100644 kernel/memremap.c
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 06/10] libnvdimm, pmem: push call to ioremap_cache out of line

2015-08-10 Thread Dan Williams
In preparation for deprecating ioremap_cache() push its usage into arch
code where it deleted in a later globabl conversion of ioremap_cache()
to arch_memremap().

Signed-off-by: Dan Williams 
---
 arch/x86/include/asm/io.h |7 +--
 arch/x86/mm/ioremap.c |6 ++
 tools/testing/nvdimm/Kbuild   |2 +-
 tools/testing/nvdimm/test/iomap.c |6 +++---
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index cc9c61bc1abe..8aeb6456188a 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -248,12 +248,7 @@ static inline void flush_write_buffers(void)
 #endif
 }
 
-static inline void __pmem *arch_memremap_pmem(resource_size_t offset,
-   unsigned long size)
-{
-   return (void __force __pmem *) ioremap_cache(offset, size);
-}
-
+void __pmem *arch_memremap_pmem(resource_size_t offset, size_t size);
 #endif /* __KERNEL__ */
 
 extern void native_io_delay(void);
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
index b9c78f3bcd67..c0734030e9db 100644
--- a/arch/x86/mm/ioremap.c
+++ b/arch/x86/mm/ioremap.c
@@ -317,6 +317,12 @@ void __iomem *ioremap_cache(resource_size_t phys_addr, 
unsigned long size)
 }
 EXPORT_SYMBOL(ioremap_cache);
 
+void __pmem *arch_memremap_pmem(resource_size_t offset, size_t size)
+{
+   return (void __force __pmem *) ioremap_cache(offset, size);
+}
+EXPORT_SYMBOL(arch_memremap_pmem);
+
 void __iomem *ioremap_prot(resource_size_t phys_addr, unsigned long size,
unsigned long prot_val)
 {
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index f56914c7929b..de2912ea78e8 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -1,7 +1,7 @@
 ldflags-y += --wrap=ioremap_wt
 ldflags-y += --wrap=ioremap_wc
 ldflags-y += --wrap=devm_ioremap_nocache
-ldflags-y += --wrap=ioremap_cache
+ldflags-y += --wrap=arch_memremap_pmem
 ldflags-y += --wrap=ioremap_nocache
 ldflags-y += --wrap=iounmap
 ldflags-y += --wrap=__request_region
diff --git a/tools/testing/nvdimm/test/iomap.c 
b/tools/testing/nvdimm/test/iomap.c
index 64bfaa50831c..f8486f98f860 100644
--- a/tools/testing/nvdimm/test/iomap.c
+++ b/tools/testing/nvdimm/test/iomap.c
@@ -80,11 +80,11 @@ void __iomem *__wrap_devm_ioremap_nocache(struct device 
*dev,
 }
 EXPORT_SYMBOL(__wrap_devm_ioremap_nocache);
 
-void __iomem *__wrap_ioremap_cache(resource_size_t offset, unsigned long size)
+void *__wrap_arch_memremap_pmem(resource_size_t offset, size_t size)
 {
-   return __nfit_test_ioremap(offset, size, ioremap_cache);
+   return __nfit_test_ioremap(offset, size, arch_memremap_pmem);
 }
-EXPORT_SYMBOL(__wrap_ioremap_cache);
+EXPORT_SYMBOL(__wrap_arch_memremap_pmem);
 
 void __iomem *__wrap_ioremap_nocache(resource_size_t offset, unsigned long 
size)
 {

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 09/10] devres: add devm_memremap

2015-08-10 Thread Dan Williams
From: Christoph Hellwig 

Signed-off-by: Christoph Hellwig 
Signed-off-by: Dan Williams 
---
 include/linux/io.h |4 
 kernel/memremap.c  |   40 
 2 files changed, 44 insertions(+)

diff --git a/include/linux/io.h b/include/linux/io.h
index 3fcf6256c088..d8d749abd665 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -80,6 +80,10 @@ int check_signature(const volatile void __iomem *io_addr,
const unsigned char *signature, int length);
 void devm_ioremap_release(struct device *dev, void *res);
 
+void *devm_memremap(struct device *dev, resource_size_t offset,
+   size_t size, unsigned long flags);
+void devm_memunmap(struct device *dev, void *addr);
+
 /*
  * Some systems do not have legacy ISA devices.
  * /dev/port is not a valid interface on these systems.
diff --git a/kernel/memremap.c b/kernel/memremap.c
index a293de52e837..1dbe88088aa1 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -10,6 +10,7 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * General Public License for more details.
  */
+#include 
 #include 
 #include 
 #include 
@@ -96,3 +97,42 @@ void memunmap(void *addr)
iounmap((void __iomem *) addr);
 }
 EXPORT_SYMBOL(memunmap);
+
+static void devm_memremap_release(struct device *dev, void *res)
+{
+   memunmap(res);
+}
+
+static int devm_memremap_match(struct device *dev, void *res, void *match_data)
+{
+   return *(void **)res == match_data;
+}
+
+void *devm_memremap(struct device *dev, resource_size_t offset,
+   size_t size, unsigned long flags)
+{
+   void **ptr, *addr;
+
+   ptr = devres_alloc(devm_memremap_release, sizeof(*ptr), GFP_KERNEL);
+   if (!ptr)
+   return NULL;
+
+   addr = memremap(offset, size, flags);
+   if (addr) {
+   *ptr = addr;
+   devres_add(dev, ptr);
+   } else
+   devres_free(ptr);
+
+   return addr;
+}
+EXPORT_SYMBOL(devm_memremap);
+
+void devm_memunmap(struct device *dev, void *addr)
+{
+   WARN_ON(devres_destroy(dev, devm_memremap_release, devm_memremap_match,
+  addr));
+   memunmap(addr);
+}
+EXPORT_SYMBOL(devm_memunmap);
+

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 07/10] pmem: switch from ioremap_wt to memremap

2015-08-10 Thread Dan Williams
In preparation for deprecating ioremap_wt() convert its usage in
the PMEM API to memremap.

Acked-by: Ross Zwisler 
Signed-off-by: Dan Williams 
---
 include/linux/pmem.h  |2 +-
 tools/testing/nvdimm/Kbuild   |4 ++--
 tools/testing/nvdimm/test/iomap.c |   34 +-
 3 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/include/linux/pmem.h b/include/linux/pmem.h
index d2114045a6c4..1bf74c735fa0 100644
--- a/include/linux/pmem.h
+++ b/include/linux/pmem.h
@@ -94,7 +94,7 @@ static void default_memcpy_to_pmem(void __pmem *dst, const 
void *src,
 static void __pmem *default_memremap_pmem(resource_size_t offset,
unsigned long size)
 {
-   return (void __pmem __force *)ioremap_wt(offset, size);
+   return (void __pmem *) memremap(offset, size, MEMREMAP_WT);
 }
 
 /**
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index de2912ea78e8..8032a49f7873 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -1,7 +1,7 @@
-ldflags-y += --wrap=ioremap_wt
 ldflags-y += --wrap=ioremap_wc
 ldflags-y += --wrap=devm_ioremap_nocache
-ldflags-y += --wrap=arch_memremap_pmem
+ldflags-y += --wrap=memremap
+ldflags-y += --wrap=memunmap
 ldflags-y += --wrap=ioremap_nocache
 ldflags-y += --wrap=iounmap
 ldflags-y += --wrap=__request_region
diff --git a/tools/testing/nvdimm/test/iomap.c 
b/tools/testing/nvdimm/test/iomap.c
index f8486f98f860..21288f34a5ca 100644
--- a/tools/testing/nvdimm/test/iomap.c
+++ b/tools/testing/nvdimm/test/iomap.c
@@ -80,11 +80,20 @@ void __iomem *__wrap_devm_ioremap_nocache(struct device 
*dev,
 }
 EXPORT_SYMBOL(__wrap_devm_ioremap_nocache);
 
-void *__wrap_arch_memremap_pmem(resource_size_t offset, size_t size)
+void *__wrap_memremap(resource_size_t offset, size_t size,
+   unsigned long flags)
 {
-   return __nfit_test_ioremap(offset, size, arch_memremap_pmem);
+   struct nfit_test_resource *nfit_res;
+
+   rcu_read_lock();
+   nfit_res = get_nfit_res(offset);
+   rcu_read_unlock();
+   if (nfit_res)
+   return (void __iomem *) nfit_res->buf + offset
+   - nfit_res->res->start;
+   return memremap(offset, size, flags);
 }
-EXPORT_SYMBOL(__wrap_arch_memremap_pmem);
+EXPORT_SYMBOL(__wrap_memremap);
 
 void __iomem *__wrap_ioremap_nocache(resource_size_t offset, unsigned long 
size)
 {
@@ -92,12 +101,6 @@ void __iomem *__wrap_ioremap_nocache(resource_size_t 
offset, unsigned long size)
 }
 EXPORT_SYMBOL(__wrap_ioremap_nocache);
 
-void __iomem *__wrap_ioremap_wt(resource_size_t offset, unsigned long size)
-{
-   return __nfit_test_ioremap(offset, size, ioremap_wt);
-}
-EXPORT_SYMBOL(__wrap_ioremap_wt);
-
 void __iomem *__wrap_ioremap_wc(resource_size_t offset, unsigned long size)
 {
return __nfit_test_ioremap(offset, size, ioremap_wc);
@@ -117,6 +120,19 @@ void __wrap_iounmap(volatile void __iomem *addr)
 }
 EXPORT_SYMBOL(__wrap_iounmap);
 
+void __wrap_memunmap(void *addr)
+{
+   struct nfit_test_resource *nfit_res;
+
+   rcu_read_lock();
+   nfit_res = get_nfit_res((unsigned long) addr);
+   rcu_read_unlock();
+   if (nfit_res)
+   return;
+   return memunmap(addr);
+}
+EXPORT_SYMBOL(__wrap_memunmap);
+
 struct resource *__wrap___request_region(struct resource *parent,
resource_size_t start, resource_size_t n, const char *name,
int flags)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v4 10/10] pmem: switch to devm_ allocations

2015-08-10 Thread Dan Williams
From: Christoph Hellwig 

Signed-off-by: Christoph Hellwig 
[djbw: tools/testing/nvdimm/ support]
Signed-off-by: Dan Williams 
---
 drivers/nvdimm/pmem.c |   36 +
 include/linux/pmem.h  |6 ++---
 tools/testing/nvdimm/Kbuild   |4 ++-
 tools/testing/nvdimm/test/iomap.c |   46 +
 4 files changed, 42 insertions(+), 50 deletions(-)

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index bcf48f133443..eb7552d939e1 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -119,7 +119,7 @@ static struct pmem_device *pmem_alloc(struct device *dev,
 {
struct pmem_device *pmem;
 
-   pmem = kzalloc(sizeof(*pmem), GFP_KERNEL);
+   pmem = devm_kzalloc(dev, sizeof(*pmem), GFP_KERNEL);
if (!pmem)
return ERR_PTR(-ENOMEM);
 
@@ -128,19 +128,16 @@ static struct pmem_device *pmem_alloc(struct device *dev,
if (!arch_has_pmem_api())
dev_warn(dev, "unable to guarantee persistence of writes\n");
 
-   if (!request_mem_region(pmem->phys_addr, pmem->size, dev_name(dev))) {
+   if (!devm_request_mem_region(dev, pmem->phys_addr, pmem->size,
+   dev_name(dev))) {
dev_warn(dev, "could not reserve region [0x%pa:0x%zx]\n",
>phys_addr, pmem->size);
-   kfree(pmem);
return ERR_PTR(-EBUSY);
}
 
-   pmem->virt_addr = memremap_pmem(pmem->phys_addr, pmem->size);
-   if (!pmem->virt_addr) {
-   release_mem_region(pmem->phys_addr, pmem->size);
-   kfree(pmem);
+   pmem->virt_addr = memremap_pmem(dev, pmem->phys_addr, pmem->size);
+   if (!pmem->virt_addr)
return ERR_PTR(-ENXIO);
-   }
 
return pmem;
 }
@@ -210,20 +207,12 @@ static int pmem_rw_bytes(struct nd_namespace_common *ndns,
return 0;
 }
 
-static void pmem_free(struct pmem_device *pmem)
-{
-   memunmap_pmem(pmem->virt_addr);
-   release_mem_region(pmem->phys_addr, pmem->size);
-   kfree(pmem);
-}
-
 static int nd_pmem_probe(struct device *dev)
 {
struct nd_region *nd_region = to_nd_region(dev->parent);
struct nd_namespace_common *ndns;
struct nd_namespace_io *nsio;
struct pmem_device *pmem;
-   int rc;
 
ndns = nvdimm_namespace_common_probe(dev);
if (IS_ERR(ndns))
@@ -236,16 +225,14 @@ static int nd_pmem_probe(struct device *dev)
 
dev_set_drvdata(dev, pmem);
ndns->rw_bytes = pmem_rw_bytes;
+
if (is_nd_btt(dev))
-   rc = nvdimm_namespace_attach_btt(ndns);
-   else if (nd_btt_probe(ndns, pmem) == 0) {
+   return nvdimm_namespace_attach_btt(ndns);
+
+   if (nd_btt_probe(ndns, pmem) == 0)
/* we'll come back as btt-pmem */
-   rc = -ENXIO;
-   } else
-   rc = pmem_attach_disk(ndns, pmem);
-   if (rc)
-   pmem_free(pmem);
-   return rc;
+   return -ENXIO;
+   return pmem_attach_disk(ndns, pmem);
 }
 
 static int nd_pmem_remove(struct device *dev)
@@ -256,7 +243,6 @@ static int nd_pmem_remove(struct device *dev)
nvdimm_namespace_detach_btt(to_nd_btt(dev)->ndns);
else
pmem_detach_disk(pmem);
-   pmem_free(pmem);
 
return 0;
 }
diff --git a/include/linux/pmem.h b/include/linux/pmem.h
index 03f9d73f3e13..eff2e6ba2a1a 100644
--- a/include/linux/pmem.h
+++ b/include/linux/pmem.h
@@ -108,8 +108,8 @@ static inline unsigned long 
default_memremap_pmem_flags(void)
  * wmb_pmem() arrange for the data to be written through the
  * cache to persistent media.
  */
-static inline void __pmem *memremap_pmem(resource_size_t offset,
-   unsigned long size)
+static inline void __pmem *memremap_pmem(struct device *dev,
+   resource_size_t offset, unsigned long size)
 {
unsigned long flags;
 
@@ -118,7 +118,7 @@ static inline void __pmem *memremap_pmem(resource_size_t 
offset,
else
flags = default_memremap_pmem_flags();
 
-   return (void __pmem *) memremap(offset, size, flags);
+   return (void __pmem *) devm_memremap(dev, offset, size, flags);
 }
 
 /**
diff --git a/tools/testing/nvdimm/Kbuild b/tools/testing/nvdimm/Kbuild
index 8032a49f7873..04c5fc09576d 100644
--- a/tools/testing/nvdimm/Kbuild
+++ b/tools/testing/nvdimm/Kbuild
@@ -1,9 +1,9 @@
 ldflags-y += --wrap=ioremap_wc
 ldflags-y += --wrap=devm_ioremap_nocache
-ldflags-y += --wrap=memremap
-ldflags-y += --wrap=memunmap
+ldflags-y += --wrap=devm_memremap
 ldflags-y += --wrap=ioremap_nocache
 ldflags-y += --wrap=iounmap
+ldflags-y += --wrap=__devm_request_region
 ldflags-y += --wrap=__request_region
 ldflags-y += --wrap=__release_region
 
diff --git a/tools/testing/nvdimm/test/iomap.c 
b/tools/testing/nvdimm/test/iomap.c
index 21288f34a5ca..402110cab9e9 100644
--- 

[PATCH v4 05/10] visorbus: switch from ioremap_cache to memremap

2015-08-10 Thread Dan Williams
In preparation for deprecating ioremap_cache() convert its usage in
visorbus to memremap.

Cc: Benjamin Romer 
Cc: David Kershner 
Acked-by: Greg Kroah-Hartman 
Signed-off-by: Dan Williams 
---
 drivers/staging/unisys/visorbus/visorchannel.c |   16 +---
 drivers/staging/unisys/visorbus/visorchipset.c |   17 +
 2 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index 20b63496e9f2..19c4a78a3617 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -21,6 +21,7 @@
  */
 
 #include 
+#include 
 
 #include "version.h"
 #include "visorbus.h"
@@ -36,7 +37,7 @@ static const uuid_le spar_video_guid = 
SPAR_CONSOLEVIDEO_CHANNEL_PROTOCOL_GUID;
 struct visorchannel {
u64 physaddr;
ulong nbytes;
-   void __iomem *mapped;
+   void *mapped;
bool requested;
struct channel_header chan_hdr;
uuid_le guid;
@@ -93,7 +94,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
}
}
 
-   channel->mapped = ioremap_cache(physaddr, size);
+   channel->mapped = memremap(physaddr, size, MEMREMAP_WB);
if (!channel->mapped) {
release_mem_region(physaddr, size);
goto cleanup;
@@ -113,7 +114,7 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
if (uuid_le_cmp(guid, NULL_UUID_LE) == 0)
guid = channel->chan_hdr.chtype;
 
-   iounmap(channel->mapped);
+   memunmap(channel->mapped);
if (channel->requested)
release_mem_region(channel->physaddr, channel->nbytes);
channel->mapped = NULL;
@@ -126,7 +127,8 @@ visorchannel_create_guts(u64 physaddr, unsigned long 
channel_bytes,
}
}
 
-   channel->mapped = ioremap_cache(channel->physaddr, channel_bytes);
+   channel->mapped = memremap(channel->physaddr, channel_bytes,
+   MEMREMAP_WB);
if (!channel->mapped) {
release_mem_region(channel->physaddr, channel_bytes);
goto cleanup;
@@ -167,7 +169,7 @@ visorchannel_destroy(struct visorchannel *channel)
if (!channel)
return;
if (channel->mapped) {
-   iounmap(channel->mapped);
+   memunmap(channel->mapped);
if (channel->requested)
release_mem_region(channel->physaddr, channel->nbytes);
}
@@ -241,7 +243,7 @@ visorchannel_read(struct visorchannel *channel, ulong 
offset,
if (offset + nbytes > channel->nbytes)
return -EIO;
 
-   memcpy_fromio(local, channel->mapped + offset, nbytes);
+   memcpy(local, channel->mapped + offset, nbytes);
 
return 0;
 }
@@ -262,7 +264,7 @@ visorchannel_write(struct visorchannel *channel, ulong 
offset,
memcpy(>chan_hdr + offset, local, copy_size);
}
 
-   memcpy_toio(channel->mapped + offset, local, nbytes);
+   memcpy(channel->mapped + offset, local, nbytes);
 
return 0;
 }
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index bb8087e70127..e3c55ccf929b 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -119,7 +119,7 @@ static struct visorchannel *controlvm_channel;
 
 /* Manages the request payload in the controlvm channel */
 struct visor_controlvm_payload_info {
-   u8 __iomem *ptr;/* pointer to base address of payload pool */
+   u8 *ptr;/* pointer to base address of payload pool */
u64 offset; /* offset from beginning of controlvm
 * channel to beginning of payload * pool */
u32 bytes;  /* number of bytes in payload pool */
@@ -401,21 +401,22 @@ parser_init_byte_stream(u64 addr, u32 bytes, bool local, 
bool *retry)
p = __va((unsigned long) (addr));
memcpy(ctx->data, p, bytes);
} else {
-   void __iomem *mapping;
+   void *mapping;
 
if (!request_mem_region(addr, bytes, "visorchipset")) {
rc = NULL;
goto cleanup;
}
 
-   mapping = ioremap_cache(addr, bytes);
+   mapping = memremap(addr, bytes, MEMREMAP_WB);
if (!mapping) {
release_mem_region(addr, bytes);
rc = NULL;
goto cleanup;
}
-   memcpy_fromio(ctx->data, mapping, bytes);
+   memcpy(ctx->data, mapping, bytes);
release_mem_region(addr, bytes);
+   memunmap(mapping);
}
 
ctx->byte_stream = true;
@@ -1327,7 +1328,7 @@ static 

[PATCH v4 04/10] arch: introduce memremap()

2015-08-10 Thread Dan Williams
Existing users of ioremap_cache() are mapping memory that is known in
advance to not have i/o side effects.  These users are forced to cast
away the __iomem annotation, or otherwise neglect to fix the sparse
errors thrown when dereferencing pointers to this memory.  Provide
memremap() as a non __iomem annotated ioremap_*() in the case when
ioremap is otherwise a pointer to cacheable memory. Empirically,
ioremap_() call sites are seeking memory-like semantics
(e.g.  speculative reads, and prefetching permitted).

memremap() is a break from the ioremap implementation pattern of adding
a new memremap_() for each mapping type and having silent
compatibility fall backs.  Instead, the implementation defines flags
that are passed to the central memremap() and if a mapping type is not
supported by an arch memremap returns NULL.

We introduce a memremap prototype as a trivial wrapper of
ioremap_cache() and ioremap_wt().  Later, once all ioremap_cache() and
ioremap_wt() usage has been removed from drivers we teach archs to
implement arch_memremap() with the ability to strictly enforce the
mapping type.

Cc: Arnd Bergmann 
Signed-off-by: Dan Williams 
---
 arch/ia64/include/asm/io.h   |1 
 arch/sh/include/asm/io.h |1 
 arch/xtensa/include/asm/io.h |1 
 include/linux/io.h   |9 
 kernel/Makefile  |2 +
 kernel/memremap.c|   98 ++
 6 files changed, 112 insertions(+)
 create mode 100644 kernel/memremap.c

diff --git a/arch/ia64/include/asm/io.h b/arch/ia64/include/asm/io.h
index 80a7e34be009..9041bbe2b7b4 100644
--- a/arch/ia64/include/asm/io.h
+++ b/arch/ia64/include/asm/io.h
@@ -435,6 +435,7 @@ static inline void __iomem * ioremap_cache (unsigned long 
phys_addr, unsigned lo
 {
return ioremap(phys_addr, size);
 }
+#define ioremap_cache ioremap_cache
 
 
 /*
diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h
index 728c4c571f40..6194e20fccca 100644
--- a/arch/sh/include/asm/io.h
+++ b/arch/sh/include/asm/io.h
@@ -342,6 +342,7 @@ ioremap_cache(phys_addr_t offset, unsigned long size)
 {
return __ioremap_mode(offset, size, PAGE_KERNEL);
 }
+#define ioremap_cache ioremap_cache
 
 #ifdef CONFIG_HAVE_IOREMAP_PROT
 static inline void __iomem *
diff --git a/arch/xtensa/include/asm/io.h b/arch/xtensa/include/asm/io.h
index c39bb6e61911..867840f5400f 100644
--- a/arch/xtensa/include/asm/io.h
+++ b/arch/xtensa/include/asm/io.h
@@ -57,6 +57,7 @@ static inline void __iomem *ioremap_cache(unsigned long 
offset,
else
BUG();
 }
+#define ioremap_cache ioremap_cache
 
 #define ioremap_wc ioremap_nocache
 #define ioremap_wt ioremap_nocache
diff --git a/include/linux/io.h b/include/linux/io.h
index fb5a99800e77..3fcf6256c088 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -121,4 +121,13 @@ static inline int arch_phys_wc_index(int handle)
 #endif
 #endif
 
+enum {
+   /* See memremap() kernel-doc for usage description... */
+   MEMREMAP_WB = 1 << 0,
+   MEMREMAP_WT = 1 << 1,
+};
+
+void *memremap(resource_size_t offset, size_t size, unsigned long flags);
+void memunmap(void *addr);
+
 #endif /* _LINUX_IO_H */
diff --git a/kernel/Makefile b/kernel/Makefile
index 43c4c920f30a..92866d36e376 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -99,6 +99,8 @@ obj-$(CONFIG_JUMP_LABEL) += jump_label.o
 obj-$(CONFIG_CONTEXT_TRACKING) += context_tracking.o
 obj-$(CONFIG_TORTURE_TEST) += torture.o
 
+obj-$(CONFIG_HAS_IOMEM) += memremap.o
+
 $(obj)/configs.o: $(obj)/config_data.h
 
 # config_data.h contains the same information as ikconfig.h but gzipped.
diff --git a/kernel/memremap.c b/kernel/memremap.c
new file mode 100644
index ..a293de52e837
--- /dev/null
+++ b/kernel/memremap.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright(c) 2015 Intel Corporation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ */
+#include 
+#include 
+#include 
+
+#ifndef ioremap_cache
+/* temporary while we convert existing ioremap_cache users to memremap */
+__weak void __iomem *ioremap_cache(resource_size_t offset, unsigned long size)
+{
+   return ioremap(offset, size);
+}
+#endif
+
+/**
+ * memremap() - remap an iomem_resource as cacheable memory
+ * @offset: iomem resource start address
+ * @size: size of remap
+ * @flags: either MEMREMAP_WB or MEMREMAP_WT
+ *
+ * memremap() is "ioremap" for cases where it is known that the resource
+ * being mapped does not have i/o side effects and the __iomem
+ * annotation is not applicable.
+ *
+ * MEMREMAP_WB - matches the default 

[PATCH v4 01/10] mm: enhance region_is_ram() to region_intersects()

2015-08-10 Thread Dan Williams
region_is_ram() is used to prevent the establishment of aliased mappings
to physical "System RAM" with incompatible cache settings.  However, it
uses "-1" to indicate both "unknown" memory ranges (ranges not described
by platform firmware) and "mixed" ranges (where the parameters describe
a range that partially overlaps "System RAM").

Fix this up by explicitly tracking the "unknown" vs "mixed" resource
cases and returning REGION_INTERSECTS, REGION_MIXED, or REGION_DISJOINT.
This re-write also adds support for detecting when the requested region
completely eclipses all of a resource.  Note, the implementation treats
overlaps between "unknown" and the requested memory type as
REGION_INTERSECTS.

Finally, other memory types can be passed in by name, for now the only
usage "System RAM".

Suggested-by: Luis R. Rodriguez 
Reviewed-by: Toshi Kani 
Signed-off-by: Dan Williams 
---
 include/linux/mm.h |9 +++-
 kernel/resource.c  |   61 +++-
 2 files changed, 44 insertions(+), 26 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 2e872f92dbac..84b05ebedb2d 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -369,7 +369,14 @@ static inline int put_page_unless_one(struct page *page)
 }
 
 extern int page_is_ram(unsigned long pfn);
-extern int region_is_ram(resource_size_t phys_addr, unsigned long size);
+
+enum {
+   REGION_INTERSECTS,
+   REGION_DISJOINT,
+   REGION_MIXED,
+};
+
+int region_intersects(resource_size_t offset, size_t size, const char *type);
 
 /* Support for virtually mapped pages */
 struct page *vmalloc_to_page(const void *addr);
diff --git a/kernel/resource.c b/kernel/resource.c
index fed052a1bc9f..f150dbbe6f62 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -492,40 +492,51 @@ int __weak page_is_ram(unsigned long pfn)
 }
 EXPORT_SYMBOL_GPL(page_is_ram);
 
-/*
- * Search for a resouce entry that fully contains the specified region.
- * If found, return 1 if it is RAM, 0 if not.
- * If not found, or region is not fully contained, return -1
+/**
+ * region_intersects() - determine intersection of region with known resources
+ * @start: region start address
+ * @size: size of region
+ * @name: name of resource (in iomem_resource)
  *
- * Used by the ioremap functions to ensure the user is not remapping RAM and is
- * a vast speed up over walking through the resource table page by page.
+ * Check if the specified region partially overlaps or fully eclipses a
+ * resource identified by @name.  Return REGION_DISJOINT if the region
+ * does not overlap @name, return REGION_MIXED if the region overlaps
+ * @type and another resource, and return REGION_INTERSECTS if the
+ * region overlaps @type and no other defined resource. Note, that
+ * REGION_INTERSECTS is also returned in the case when the specified
+ * region overlaps RAM and undefined memory holes.
+ *
+ * region_intersect() is used by memory remapping functions to ensure
+ * the user is not remapping RAM and is a vast speed up over walking
+ * through the resource table page by page.
  */
-int region_is_ram(resource_size_t start, unsigned long size)
+int region_intersects(resource_size_t start, size_t size, const char *name)
 {
-   struct resource *p;
-   resource_size_t end = start + size - 1;
unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-   const char *name = "System RAM";
-   int ret = -1;
+   resource_size_t end = start + size - 1;
+   int type = 0; int other = 0;
+   struct resource *p;
 
read_lock(_lock);
for (p = iomem_resource.child; p ; p = p->sibling) {
-   if (p->end < start)
-   continue;
-
-   if (p->start <= start && end <= p->end) {
-   /* resource fully contains region */
-   if ((p->flags != flags) || strcmp(p->name, name))
-   ret = 0;
-   else
-   ret = 1;
-   break;
-   }
-   if (end < p->start)
-   break;  /* not found */
+   bool is_type = strcmp(p->name, name) == 0 && p->flags == flags;
+
+   if (start >= p->start && start <= p->end)
+   is_type ? type++ : other++;
+   if (end >= p->start && end <= p->end)
+   is_type ? type++ : other++;
+   if (p->start >= start && p->end <= end)
+   is_type ? type++ : other++;
}
read_unlock(_lock);
-   return ret;
+
+   if (other == 0)
+   return type ? REGION_INTERSECTS : REGION_DISJOINT;
+
+   if (type)
+   return REGION_MIXED;
+
+   return REGION_DISJOINT;
 }
 
 void __weak arch_remove_reservations(struct resource *avail)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to 

[PATCH v4 02/10] arch, drivers: don't include directly, use instead

2015-08-10 Thread Dan Williams
Preparation for uniform definition of ioremap, ioremap_wc, ioremap_wt,
and ioremap_cache, tree-wide.

Acked-by: Christoph Hellwig 
Signed-off-by: Dan Williams 
---
 arch/arm/mach-shmobile/pm-rcar.c|2 +-
 arch/ia64/kernel/cyclone.c  |2 +-
 drivers/isdn/icn/icn.h  |2 +-
 drivers/mtd/devices/slram.c |2 +-
 drivers/mtd/nand/diskonchip.c   |2 +-
 drivers/mtd/onenand/generic.c   |2 +-
 drivers/scsi/sun3x_esp.c|2 +-
 drivers/staging/comedi/drivers/ii_pci20kc.c |1 +
 drivers/tty/serial/8250/8250_core.c |2 +-
 drivers/video/fbdev/s1d13xxxfb.c|3 +--
 drivers/video/fbdev/stifb.c |1 +
 include/linux/io-mapping.h  |2 +-
 include/linux/mtd/map.h |2 +-
 include/video/vga.h |2 +-
 14 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-shmobile/pm-rcar.c b/arch/arm/mach-shmobile/pm-rcar.c
index 00022ee56f80..9d3dde00c2fe 100644
--- a/arch/arm/mach-shmobile/pm-rcar.c
+++ b/arch/arm/mach-shmobile/pm-rcar.c
@@ -12,7 +12,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "pm-rcar.h"
 
 /* SYSC */
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c
index 4826ff957a3d..5fa3848ba224 100644
--- a/arch/ia64/kernel/cyclone.c
+++ b/arch/ia64/kernel/cyclone.c
@@ -4,7 +4,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /* IBM Summit (EXA) Cyclone counter code*/
 #define CYCLONE_CBAR_ADDR 0xFEB00CD0
diff --git a/drivers/isdn/icn/icn.h b/drivers/isdn/icn/icn.h
index b713466997a0..f8f2e76d34bf 100644
--- a/drivers/isdn/icn/icn.h
+++ b/drivers/isdn/icn/icn.h
@@ -38,7 +38,7 @@ typedef struct icn_cdef {
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index 2fc4957cbe7f..a70eb83e68f1 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index 7da266a53979..0802158a3f75 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -24,7 +24,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
index 32a216d31141..ab7bda0bb245 100644
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@ -18,7 +18,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 /*
  * Note: Driver name and platform data format have been updated!
diff --git a/drivers/scsi/sun3x_esp.c b/drivers/scsi/sun3x_esp.c
index e26e81de7c45..d50c5ed8f428 100644
--- a/drivers/scsi/sun3x_esp.c
+++ b/drivers/scsi/sun3x_esp.c
@@ -12,9 +12,9 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 #include 
 #include 
 
diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c 
b/drivers/staging/comedi/drivers/ii_pci20kc.c
index 0768bc42a5db..14ef1f67dd42 100644
--- a/drivers/staging/comedi/drivers/ii_pci20kc.c
+++ b/drivers/staging/comedi/drivers/ii_pci20kc.c
@@ -28,6 +28,7 @@
  */
 
 #include 
+#include 
 #include "../comedidev.h"
 
 /*
diff --git a/drivers/tty/serial/8250/8250_core.c 
b/drivers/tty/serial/8250/8250_core.c
index 37fff12dd4d0..fe902ff52e58 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -38,11 +38,11 @@
 #include 
 #include 
 #include 
+#include 
 #ifdef CONFIG_SPARC
 #include 
 #endif
 
-#include 
 #include 
 
 #include "8250.h"
diff --git a/drivers/video/fbdev/s1d13xxxfb.c b/drivers/video/fbdev/s1d13xxxfb.c
index 83433cb0dfba..96aa46dc696c 100644
--- a/drivers/video/fbdev/s1d13xxxfb.c
+++ b/drivers/video/fbdev/s1d13xxxfb.c
@@ -32,8 +32,7 @@
 #include 
 #include 
 #include 
-
-#include 
+#include 
 
 #include 
 
diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index 735355b0e023..7df4228e25f0 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -64,6 +64,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include   /* for HP-UX compatibility */
 #include 
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index c27dde7215b5..e399029b68c5 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -21,7 +21,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 /*
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 29975c73a953..366cf77953b5 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -27,9 +27,9 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 #include 
 
 #ifdef CONFIG_MTD_MAP_BANK_WIDTH_1
diff --git a/include/video/vga.h b/include/video/vga.h
index 

Re: [PATCH v6 0/3] Add MediaTek display PWM driver

2015-08-10 Thread Daniel Kurtz
Thierry,

I think these patches are ready.
Will you please consider picking up in your pwm tree?

-Dan


On Mon, Aug 3, 2015 at 2:21 PM, YH Huang  wrote:
> On Fri, 2015-07-24 at 17:10 +0800, YH Huang wrote:
>> On Fri, 2015-07-24 at 10:42 +0200, Matthias Brugger wrote:
>> > On Monday, July 20, 2015 04:17:14 PM YH Huang wrote:
>> > > This patch series add the use of display PWM driver, documentation
>> > > and device tree for Mediatek SoCs. The driver is used to support
>> > > the backlight of the panel. This is based on v4.2-rc1.
>> > >
>> > > The clock definitions (CLK_MM_DISP_PWM*) are added by James Liao's patch:
>> > > clk: mediatek: Add subsystem clocks of MT8173
>> > >
>> > > Change in v6:
>> > > 1. Enable clocks in the pwm_enable function
>> > > 2. Remove suspend/resume code since pwm-backlight driver has done the 
>> > > same
>> > > things 3. Revise some code to make it easier to read
>> > >
>> >
>> > Can you please provide the whole change log for all versions the next time.
>> > It's easier this way to understand the evolution of the series.
>>
>> Change in v6:
>> 1. Enable clocks in the pwm_enable function.
>> 2. Remove suspend/resume code since pwm-backlight driver has done the
>> same things.
>> 3. Revise some code to make it easier to read.
>>
>> Change in v5:
>> 1. Configure PWM output via pinctrl.
>> 2. Fix the parameter name in dtsi.
>>
>> Change in v4:
>> 1. Codebase is on v4.2-rc1.
>> 2. Add the PWM node in dtsi.
>> 3. Change the dependency in Kconfig.
>> 4. Rewrite some code for readability.
>>
>> Change in v3:
>> 1. Add suspend/resume function.
>> 2. Fix the formula for high_width calculation.
>> 3. Rewrite some code to make it easier to read.
>> 4. Add more information in the commit message.
>>
>> Change in v2:
>> 1. Rewrite descriptions for driver in kconfig to make it much clear.
>> 2. Rename the driver from "pwm-mediatek-disp" to "pwm-mtk-disp".
>> 3. Disable clocks in the error path.
>> 4. Change the shift values in decimal instead of hex.
>> 5. Rename and add some variables or function name for consistency and
>> readability.
>> 6. Drop unnecessary parentheses, spaces, variables and add newlines to
>> make the code easiler to read.
>>
>> Thanks for your suggestion.
>
> Hi Thierry,
>
> Do you have any suggestions?
> Maybe we could apply the patch?
>
> Regards,
> YH Huang
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 01/11] block: make generic_make_request handle arbitrarily sized bios

2015-08-10 Thread Kent Overstreet
On Mon, Aug 10, 2015 at 10:41:55PM -0400, Mike Snitzer wrote:
> On Mon, Aug 10 2015 at 10:00pm -0400,
> Martin K. Petersen  wrote:
> 
> > > "Ming" == Ming Lin  writes:
> > 
> > Ming> Did you mean still use (UINT_MAX >> 9) in blkdev_issue_discard()?
> > 
> > Ming> But that doesn't work for dm-thinp. See Kent's suggestion to use
> > Ming> 1<<31.
> > 
> > I'm not sure why things are not working for dm-thinp. Presumably Kent's
> > code would split the discard at a granularity boundary so why would that
> > cause problems for dm?
> 
> DM-thinp processes discards internally before it passes them down (if
> configured to do so).  If a discard is smaller than the granularity of a
> thinp block (whose size is configurable) or if the start and end of the
> discard's extent is misaligned (relative to the thinp blocks mapped to
> the logical extent) then the discard won't actually discard partial
> thinp blocks.

This kind of logic really doesn't belong in dm - if it's needed, it really
belongs in bio_split() (which is supposed to work correctly for discards - so if
it is needed, then bio_split() needs fixing...)

IMO though it belongs in the driver - if a discard needs to be dropped because
it's too small and the hardware can't do it, that should be the driver's
responsibility.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: Unbreak resetting default values for tcp_wmem/udp_wmem_min

2015-08-10 Thread Calvin Owens
On Sunday 08/09 at 22:41 -0700, David Miller wrote:
> From: Calvin Owens 
> Date: Wed, 5 Aug 2015 13:26:54 -0700
> 
> > Commit 8133534c760d4083 ("net: limit tcp/udp rmem/wmem to
> > SOCK_{RCV,SND}BUF_MIN") modified four sysctls to enforce that the values
> > written to them are not less than SOCK_MIN_{RCV,SND}BUF.
> > 
> > This change is fine for tcp_rmem and udp_rmem_min, since SOCK_MIN_RCVBUF
> > is equal to equal to TCP_SKB_MIN_TRUESIZE. But it breaks tcp_wmem and
> > udp_wmem_min for previously valid values because SOCK_MIN_SNDBUF is
> > (2 * TCP_SKB_MIN_TRUESIZE), which ends up being greater than 4KB.
> > 
> > Thus, 4096 is no longer accepted as a valid value, despite still being
> > the default for udp_wmem_min, and for 'min' in tcp_wmem. A huge number
> > of sysctl configurations at FB use 4096 as 'min', so this change breaks
> > all of them.
> > 
> > This patch changes the sysctls to simply enforce that the value written
> > is greater than or equal to the default value of SK_MEM_QUANTUM.
> > 
> > Fixes: 8133534c760d4083 ("net: limit tcp/udp rmem/wmem to SOCK_MIN...")
> > Signed-off-by: Calvin Owens 
> 
> I think increasing the default makes more sense.
> 
> If we don't allow applications to set 4K, the kernel shouldn't start
> with that value either.

I'm really questioning the limitation itself: why enforce a minimum of
SOCK_MIN_SNDBUF here? Why not SK_MEM_QUANTUM?

Commit 8133534c760d4083 referred to b1cb59cf2efe7971, which choose to
use the SOCK_MIN constants as the lower limits to avoid nasty bugs. But
AFAICS, a limit of SOCK_MIN_SNDBUF isn't necessary to do that: the
BUG_ON cited in the commit message for b1cb59cf2efe7971 seems to have
happened because unix_stream_sendmsg() expects a minimum of a full page
(ie SK_MEM_QUANTUM) and the math broke, not because it had less than
SOCK_MIN_SNDBUF allocated.

Nothing seems to assume that it has at least SOCK_MIN_SNDBUF to play
with, so my argument is that enforcing a minimum of SK_MEM_QUANTUM
avoids the sort of bugs commit 8133534c760d4083 was trying to avoid, and
it does so without breaking anybody's sysctl configurations. What do you
think?

Thanks very much,
Calvin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 bluetooth-next] cc2520: set the default fifo pin value from platform data

2015-08-10 Thread Varka Bhadram

On 08/11/2015 08:13 AM, sdliy...@gmail.com wrote:

From: Yong Li 

When the device tree support is disabled, the fifo_pin is uninitialized,
this patch will set the fifo_pin value based on platform data

Signed-off-by: Yong Li 


Acked-by: Varka Bhadram 


---
  drivers/net/ieee802154/cc2520.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index 613dae5..c5b54a1 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -833,6 +833,7 @@ static int cc2520_get_platform_data(struct spi_device *spi,
if (!spi_pdata)
return -ENOENT;
*pdata = *spi_pdata;
+   priv->fifo_pin = pdata->fifo;
return 0;
}
  


--
Varka Bhadram.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCHv2 6/8] serial: imx: add runtime pm support

2015-08-10 Thread Fabio Estevam
On Mon, Aug 10, 2015 at 10:35 PM, Eduardo Valentin  wrote:

>  static int imx_poll_get_char(struct uart_port *port)
>  {
> -   if (!(readl_relaxed(port->membase + USR2) & USR2_RDR))
> -   return NO_POLL_CHAR;
> +   int ret;
> +
> +   pm_runtime_get_sync(sport->dev);
> +   if (!(readl_relaxed(port->membase + USR2) & USR2_RDR)) {
> +   ret = NO_POLL_CHAR;
> +   goto mark_last;
> +   }
>
> -   return readl_relaxed(port->membase + URXD0) & URXD_RX_DATA;
> +   ret = readl_relaxed(port->membase + URXD0) & URXD_RX_DATA;
> +
> +mark_last:
> +   pm_runtime_mark_last_busy(sport->dev);
> +   pm_runtime_put_autosuspend(sport->dev);

You should return ret here.

> +static int serial_imx_runtime_resume(struct device *dev)
> +{
> +   struct imx_port *sport = dev_get_drvdata(dev);
> +
> +   clk_enable(sport->clk_per);

clk_enable() may fail.

> +   clk_enable(sport->clk_ipg);

Same here.

> @@ -2096,6 +2212,8 @@ static int imx_serial_port_resume(struct device *dev)
> struct platform_device *pdev = to_platform_device(dev);
> struct imx_port *sport = platform_get_drvdata(pdev);
>
> +   clk_prepare_enable(sport->clk_per);

clk_prepare_enable() may fail.

> +   clk_prepare_enable(sport->clk_ipg);

Ditto.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] regmap: Move documentation to regmap.h

2015-08-10 Thread Nicolas Boichat
Hi Mark,

On Wed, Jul 8, 2015 at 6:32 PM, Nicolas Boichat  wrote:
> Init functions defined in regmap*.c files are now prefixed with
> __, take lockdep key and class parameters, and should not be
> called directly: move the documentation to regmap.h, where the
> macros are defined.
>
> Signed-off-by: Nicolas Boichat 
> ---
> Applies on top of this series:
> [PATCHv2 0/3] regmap: Use different lockdep class for each regmap init call
> sent earlier today.

First, thanks for the applying the series above.

This documentation patch is still valid, and now applies cleanly on
regmap/for-next.

Best,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] surface pro 3: Add support driver for Surface Pro 3 buttons

2015-08-10 Thread Darren Hart
On Thu, Aug 06, 2015 at 11:55:29AM -0700, Joe Perches wrote:
> On Wed, 2015-08-05 at 16:47 -0700, Darren Hart wrote:
> > On Thu, Aug 06, 2015 at 11:20:44AM +, Chen, Yu C wrote:
> []
> > > Is it ok to keep these codes and add comments like:
> 
> It's your code Yu, do whatever you think appropriate.
> 
> > > /*
> > >  * When a button(power button/volume button/home button) is 
> > >  * pressed down or released, different ACPI notification codes 
> > >  * will be generated. We can distinguish different event code 
> > >  * and value of buttons by these notification codes, then pass
> > >  * (EV_KEY, event code(key_code), value(pressed)) to input layer.
> > >  */
> > 
> > The commentary is useful regardless. However, I suspect Joe was
> > referring to the approach pairing the PRESS and RELEASE cases?
> > 
> 
> True.
> 
> btw Darren, your computer's email time setting seems off.

Nothing gets past kernel devs! Corporate firewall broke ntp for Linux VM from
where I sent this, didn't notice until too late.

-- 
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH v2] staging: fsl-mc: add DPAA2 overview readme

2015-08-10 Thread Stuart Yoder


> -Original Message-
> From: Alexander Graf [mailto:ag...@suse.de]
> Sent: Sunday, August 09, 2015 9:25 AM
> To: Yoder Stuart-B08248; gre...@linuxfoundation.org; Rivera Jose-B46482; katz 
> Itai-RM05202
> Cc: de...@driverdev.osuosl.org; linux-kernel@vger.kernel.org; a...@arndb.de
> Subject: Re: [PATCH v2] staging: fsl-mc: add DPAA2 overview readme
> 
> 
> 
> On 07.08.15 03:09, Stuart Yoder wrote:
> > add README file providing an overview of the DPAA2 architecture
> > and how it is integrated in Linux
> >
> > Signed-off-by: Stuart Yoder 
> > ---
> > -v2: added changelog text
> >
> >  drivers/staging/fsl-mc/README.txt | 364 
> > ++
> >  drivers/staging/fsl-mc/TODO   |   4 -
> >  2 files changed, 364 insertions(+), 4 deletions(-)
> >  create mode 100644 drivers/staging/fsl-mc/README.txt
> >
> > diff --git a/drivers/staging/fsl-mc/README.txt 
> > b/drivers/staging/fsl-mc/README.txt
> > new file mode 100644
> > index 000..8214102
> > --- /dev/null
> > +++ b/drivers/staging/fsl-mc/README.txt
> > @@ -0,0 +1,364 @@
> > +Copyright (C) 2015 Freescale Semiconductor Inc.
> > +
> > +DPAA2 (Data Path Acceleration Architecture Gen2)
> > +
> > +
> > +This document provides an overview of the Freescale DPAA2 architecture
> > +and how it is integrated into the Linux kernel.
> > +
> > +Contents summary
> > +   -DPAA2 overview
> > +   -Overview of DPAA2 objects
> > +   -DPAA2 Linux driver architecture overview
> > +-bus driver
> > +-dprc driver
> > +-allocator
> > +-dpio driver
> > +-Ethernet
> > +-mac
> > +
> > +DPAA2 Overview
> > +--
> > +
> > +DPAA2 is a hardware architecture designed for high-speeed network
> > +packet processing.  DPAA2 consists of sophisticated mechanisms for
> > +processing Ethernet packets, queue management, buffer management,
> > +autonomous L2 switching, virtual Ethernet bridging, and accelerator
> > +(e.g. crypto) sharing.
> > +
> > +A DPAA2 hardware component called the Management Complex (or MC) manages 
> > the
> > +DPAA2 hardware resources.  The MC provides an object-based abstraction for
> > +software drivers to use the DPAA2 hardware.
> > +
> > +The MC uses DPAA2 hardware resources such as queues, buffer pools, and
> > +network ports to create functional objects/devices such as network
> > +interfaces, an L2 switch, or accelerator instances.
> > +
> > +The MC provides memory-mapped I/O command interfaces (MC portals)
> > +which DPAA2 software drivers use to operate on DPAA2 objects:
> > +
> > + +--+
> > + |  OS  |
> > + |DPAA2 drivers |
> > + | ||
> > + +-|+
> > +   |
> > +   | (create,discover,connect
> > +   |  config,use,destroy)
> > +   |
> > + DPAA2 |
> > + +| mc portal |-+
> > + | ||
> > + |   +- - - - - - - - - - - - -V- - -+  |
> > + |   |   |  |
> > + |   |   Management Complex (MC) |  |
> > + |   |   |  |
> > + |   +- - - - - - - - - - - - - - - -+  |
> > + |  |
> > + | Hardware  Hardware   |
> > + | Resources Objects|
> > + | - ---|
> > + | -queues   -DPRC  |
> > + | -buffer pools -DPMCP |
> > + | -Eth MACs/ports   -DPIO  |
> > + | -network interface-DPNI  |
> > + |  profiles -DPMAC |
> > + | -queue portals-DPBP  |
> > + | -MC portals...   |
> > + |  ... |
> > + |  |
> > + +--+
> > +
> > +The MC mediates operations such as create, discover,
> > +connect, configuration, and destroy.  Fast-path operations
> > +on data, such as packet transmit/receive, are not mediated by
> > +the MC and are done directly using memory mapped regions in
> > +DPIO objects.
> > +
> > +Overview of DPAA2 Objects
> > +-
> > +The section provides a brief overview of some key objects
> > +in the DPAA2 hardware.  A simple scenario is described illustrating
> > +the objects involved in creating a network interfaces.
> > +
> > +-DPRC (Datapath Resource Container)
> > +
> > +A DPRC is an container object that holds all the other
> > +types of DPAA2 

Re: [PATCH v2 4/5] ARM: berlin: add a PWM node on the BG2

2015-08-10 Thread Jisheng Zhang
Dear Sebastian,

On Mon, 10 Aug 2015 21:51:44 +0200
Sebastian Hesselbarth  wrote:

> On 30.07.2015 11:23, Antoine Tenart wrote:
> > This patch adds a PWM node in the Berlin BG2 device tree, using the
> > newly added Berlin PWM driver.
> >
> > Signed-off-by: Antoine Tenart 
> > ---
> >   arch/arm/boot/dts/berlin2.dtsi | 6 ++
> >   1 file changed, 6 insertions(+)
> >
> > diff --git a/arch/arm/boot/dts/berlin2.dtsi b/arch/arm/boot/dts/berlin2.dtsi
> > index ef811de09908..e17bd5faed27 100644
> > --- a/arch/arm/boot/dts/berlin2.dtsi
> > +++ b/arch/arm/boot/dts/berlin2.dtsi
> > @@ -512,5 +512,11 @@
> > interrupts = ;
> > };
> > };
> > +
> > +   pwm: pwm@f2 {
> > +   compatible = "marvell,berlin-pwm";
> > +   reg = <0xf2 0x40>;
> > +   #pwm-cells = <3>;
> > +   };
> 
> I only checked berlin2.dtsi:
> The top most line with  belongs to a sub-node of
> apb@fc - which means that the pwm node isn't sorted in by
> address. Please sort the nodes by address in all three DT patches.
> 
> BTW, is there any IRQ from the PWM IP routed to any intc upstream?
> A quick look into some BSP code does not reveal any hints maybe
> one of the Marvell guys can comment on it.

There's no interrupt for the PWM in all berlin SoCs ;)

Thanks,
Jisheng

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] ARM: berlin: register cpufreq-dt for the BG2Q

2015-08-10 Thread Jisheng Zhang
Dear Sebastian,

On Mon, 10 Aug 2015 22:22:44 +0200
Sebastian Hesselbarth  wrote:

> On 31.07.2015 08:16, Jisheng Zhang wrote:
> > On Thu, 30 Jul 2015 14:35:51 +0200
> > Antoine Tenart  wrote:
> >
> >> The BG2Q SoC uses cpufreq-dt for cpufreq. Register a platform device for
> >> this.
> >>
> >> Signed-off-by: Antoine Tenart 
> >> ---
> [...]
> >> diff --git a/arch/arm/mach-berlin/berlin.c b/arch/arm/mach-berlin/berlin.c
> >> index ac181c6797ee..0de906374994 100644
> >> --- a/arch/arm/mach-berlin/berlin.c
> >> +++ b/arch/arm/mach-berlin/berlin.c
> >> @@ -15,9 +15,21 @@
> [...]
> >> +static void __init berlin_init_late(void)
> >> +{
> >> +  if (of_find_matching_node(NULL, berlin2q_match))
> >> +  platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
> >
> > I'm not sure is it acceptable to always register cpufreq-dt platform device.
> > In cpufreq-dt driver, the probe will exit if there's no cpuclk node.
> 
> Jisheng,
> 
> registering the _device_ without checking for any requirements of
> the _driver_ is usual practice. It it the driver's job to check
> all of them and report an error or warning. So, I am fine with
> adding the device unconditionally.
> 
> Using the .init_late() callback seems reasonable - but can you
> evaluate if we can have cpufreq-dt also for BG2/BG2CD? I'd also
> accept a single, default operating-point.

hmm, if so, we can enable cpufreq-dt for BG2/BG2CD. In fact, there's no any
problem if we don't touch the voltage, only changing the cpufreq should not
introduce stable issues.

> 
> BTW, there is one true point about Jisheng's comment: try to order
> your patches logically correct to avoid unnecessary warnings, i.e.
> 
> 1/3 add cpuclk
> 2/3 add cpufreq-dt properties
> 3/3 register cpufreq-dt device
> 
> If you consider a git-bisect run, you can land in between any of the
> three patches but they are always in the above order - so ordering is
> important.
> 
> Sebastian
> 
> >> +}
> >> +
> >>   static const char * const berlin_dt_compat[] = {
> >>"marvell,berlin",
> >>NULL,
> >> @@ -25,6 +37,7 @@ static const char * const berlin_dt_compat[] = {
> >>
> >>   DT_MACHINE_START(BERLIN_DT, "Marvell Berlin")
> >>.dt_compat  = berlin_dt_compat,
> >> +  .init_late  = berlin_init_late,
> >>/*
> >> * with DT probing for L2CCs, berlin_init_machine can be removed.
> >> * Note: 88DE3005 (Armada 1500-mini) uses pl310 l2cc
> >
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 7/9] perf report: Add support for srcfile sort key

2015-08-10 Thread Namhyung Kim
On Mon, Aug 10, 2015 at 05:56:31PM -0300, Arnaldo Carvalho de Melo wrote:
> From: Andi Kleen 
> 
> In some cases it's useful to characterize samples by file. This is
> useful to get a higher level categorization, for example to map cost to
> subsystems.
> 
> Add a srcfile sort key to perf report. It builds on top of the existing
> srcline support.
> 
> Commiter notes:
> 
> E.g.:
> 
>   # perf record -F 1 usleep 1
>   [ perf record: Woken up 1 times to write data ]
>   [ perf record: Captured and wrote 0.016 MB perf.data (13 samples) ]
>   [root@zoo ~]# perf report -s srcfile --stdio
>   # Total Lost Samples: 0
>   #
>   # Samples: 13  of event 'cycles'
>   # Event count (approx.): 869878
>   #
>   # Overhead  Source File
>   #   ...
>   60.99%  .
>   20.62%  paravirt.h
>   14.23%  rmap.c
>4.04%  signal.c
>0.11%  msr.h
> 
>   #
> 
> The first line is collecting all the files for which srcfiles couldn't somehow
> get resolved to:
> 
>   # perf report -s srcfile,dso --stdio
>   # Total Lost Samples: 0
>   #
>   # Samples: 13  of event 'cycles'
>   # Event count (approx.): 869878
>   #
>   # Overhead  Source File  Shared Object
>   #   ...  
>   40.97%  .ld-2.20.so
>   20.62%  paravirt.h   [kernel.vmlinux]
>   20.02%  .libc-2.20.so
>   14.23%  rmap.c   [kernel.vmlinux]
>4.04%  signal.c [kernel.vmlinux]
>0.11%  msr.h[kernel.vmlinux]
> 
>   #
> 
> XXX: Investigate why that is not resolving on Fedora 21, Andi says he hasn't
>  seen this on Fedora 22.
> 
> Signed-off-by: Andi Kleen 
> Tested-by: Arnaldo Carvalho de Melo 
> Cc: Jiri Olsa 
> Cc: Namhyung Kim 
> Link: 
> http://lkml.kernel.org/r/1438988064-21834-1-git-send-email-a...@firstfloor.org
> [ Added column length update, from 0e65bdb3f90f ('perf hists: Update the 
> column width for the "srcline" sort key') ]
> Signed-off-by: Arnaldo Carvalho de Melo 
> ---
>  tools/perf/Documentation/perf-report.txt |  2 ++
>  tools/perf/util/hist.c   |  5 +++
>  tools/perf/util/hist.h   |  1 +
>  tools/perf/util/sort.c   | 52 
> 
>  tools/perf/util/sort.h   |  2 ++
>  5 files changed, 62 insertions(+)
> 
> diff --git a/tools/perf/Documentation/perf-report.txt 
> b/tools/perf/Documentation/perf-report.txt
> index 1a782ef02b68..7b07d19e2d54 100644
> --- a/tools/perf/Documentation/perf-report.txt
> +++ b/tools/perf/Documentation/perf-report.txt
> @@ -81,6 +81,8 @@ OPTIONS
>   - cpu: cpu number the task ran at the time of sample
>   - srcline: filename and line number executed at the time of sample.  The
>   DWARF debugging info must be provided.
> + - srcfile: file name of the source file of the same. Requires dwarf
> + information.
>   - weight: Event specific weight, e.g. memory latency or transaction
>   abort cost. This is the global weight.
>   - local_weight: Local weight version of the weight above.
> diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
> index 608c0a7fd0f4..6bccfae334b1 100644
> --- a/tools/perf/util/hist.c
> +++ b/tools/perf/util/hist.c
> @@ -154,6 +154,9 @@ void hists__calc_col_len(struct hists *hists, struct 
> hist_entry *h)
>   if (h->srcline)
>   hists__new_col_len(hists, HISTC_SRCLINE, strlen(h->srcline));
>  
> + if (h->srcfile)
> + hists__new_col_len(hists, HISTC_SRCFILE, strlen(h->srcfile));
> +
>   if (h->transaction)
>   hists__new_col_len(hists, HISTC_TRANSACTION,
>  hist_entry__transaction_len());
> @@ -949,6 +952,8 @@ void hist_entry__delete(struct hist_entry *he)
>  
>   zfree(>stat_acc);
>   free_srcline(he->srcline);
> + if (he->srcfile && he->srcfile[0])
> + free(he->srcfile);
>   free_callchain(he->callchain);
>   free(he);
>  }
> diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
> index e2f712f85d2e..bc528d54e457 100644
> --- a/tools/perf/util/hist.h
> +++ b/tools/perf/util/hist.h
> @@ -30,6 +30,7 @@ enum hist_column {
>   HISTC_PARENT,
>   HISTC_CPU,
>   HISTC_SRCLINE,
> + HISTC_SRCFILE,
>   HISTC_MISPREDICT,
>   HISTC_IN_TX,
>   HISTC_ABORT,
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index 5177088a71d3..c0c32b050e45 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -319,6 +319,57 @@ struct sort_entry sort_srcline = {
>   .se_width_idx   = HISTC_SRCLINE,
>  };
>  
> +/* --sort srcfile */
> +
> +static char no_srcfile[1];
> +
> +static char *get_srcfile(struct hist_entry *e)
> +{
> + char *sf, *p;
> + struct map *map = e->ms.map;
> +
> + sf = get_srcline(map->dso, map__rip_2objdump(map, e->ip),
> +  e->ms.sym, true);

AFAIK get_srcline() can return a string literal SRCLINE_UNKNOWN.  It
should not be freed or 

Re: [PATCH] [v2] surface pro 3: Add support driver for Surface Pro 3 buttons

2015-08-10 Thread Darren Hart
On Fri, Aug 07, 2015 at 08:48:18AM +, Chen, Yu C wrote:
> On Fri, 2015-08-07 at 01:27 -0700, Joe Perches wrote:
> > On Fri, 2015-08-07 at 15:57 +0800, Chen Yu wrote:   
> > \
> > > + ret;\
> > > +})
> > 
> > This seems a bit complicated.
> > 
> > The else ret = 0 isn't necessary as it's initialized to 0.
> > bool might be better than int.
> > 
> Got.
> > > +static void surface_button_notify(struct acpi_device *device, u32 event)
> > > +{
> > > + struct surface_button *button = acpi_driver_data(device);
> > > + struct input_dev *input;
> > > + int key_code = KEY_RESERVED;
> > > + bool pressed = false;
> > > +
> > > + if (!handle_surface_button_notify(POWER, KEY_POWER) &&
> > > + !handle_surface_button_notify(HOME, KEY_LEFTMETA) &&
> > > + !handle_surface_button_notify(VOLUME_UP, KEY_VOLUMEUP) &&
> > > + !handle_surface_button_notify(VOLUME_DOWN, KEY_VOLUMEDOWN))
> > > + dev_info_ratelimited(>dev,
> > > + "Unsupported event [0x%x]\n", event);
> > 
> > Some might prefer alignment to the open parenthesis:
> > 
> > if (!handle_surface_button_notify(POWER, KEY_POWER) &&
> > !handle_surface_button_notify(HOME, KEY_LEFTMETA) &&
> > !handle_surface_button_notify(VOLUME_UP, KEY_VOLUMEUP) &&
> > !handle_surface_button_notify(VOLUME_DOWN, KEY_VOLUMEDOWN))
> > 
> > I think the older switch/case was easier to understand.
> > 
> OK, then let's keep the switch/case.
> thanks.

Agreed.


-- 
Darren Hart
Intel Open Source Technology Center
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 bluetooth-next] cc2520: set the default fifo pin value from platform data

2015-08-10 Thread sdliyong
From: Yong Li 

When the device tree support is disabled, the fifo_pin is uninitialized,
this patch will set the fifo_pin value based on platform data

Signed-off-by: Yong Li 
---
 drivers/net/ieee802154/cc2520.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index 613dae5..c5b54a1 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -833,6 +833,7 @@ static int cc2520_get_platform_data(struct spi_device *spi,
if (!spi_pdata)
return -ENOENT;
*pdata = *spi_pdata;
+   priv->fifo_pin = pdata->fifo;
return 0;
}
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [spi:topic/mtk 2/2] drivers/spi/spi-mt65xx.c:362:24: sparse: incorrect type in argument 1 (different base types)

2015-08-10 Thread lei liu
Hello Mark,

On Fri, 2015-08-07 at 22:33 +0800, kbuild test robot wrote:
> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi topic/mtk
> head:   a568231f463225eb31593f71446a267a03ae0528
> commit: a568231f463225eb31593f71446a267a03ae0528 [2/2] spi: mediatek: Add spi 
> bus for Mediatek MT8173
> reproduce:
>   # apt-get install sparse
>   git checkout a568231f463225eb31593f71446a267a03ae0528
>   make ARCH=x86_64 allmodconfig
>   make C=1 CF=-D__CHECK_ENDIAN__
> 
> 

I use these commands and also find another waring:

../drivers/spi/spi-mt65xx.c:589:25: warning: incorrect type in argument
1 (different address spaces)
../drivers/spi/spi-mt65xx.c:589:25: expected void const *ptr
../drivers/spi/spi-mt65xx.c:589:25: got void [noderef] *base
../drivers/spi/spi-mt65xx.c:590:36: warning: incorrect type in argument
1 (different address spaces)
../drivers/spi/spi-mt65xx.c:590:36: expected void const *ptr
../drivers/spi/spi-mt65xx.c:590:36: got void [noderef] *base

vi drivers/spi/spi-mt65xx.c +589

588 mdata->base = devm_ioremap_resource(>dev, res);
589 if (IS_ERR(mdata->base)) {
590 ret = PTR_ERR(mdata->base);
591 goto err_put_master;
592 }

should I also fix them?

> sparse warnings: (new ones prefixed by >>)
> 
> >> drivers/spi/spi-mt65xx.c:362:24: sparse: incorrect type in argument 1 
> >> (different base types)
>drivers/spi/spi-mt65xx.c:362:24:expected unsigned int [unsigned] val
>drivers/spi/spi-mt65xx.c:362:24:got restricted __le32 [usertype] 
> 
>drivers/spi/spi-mt65xx.c:364:24: sparse: incorrect type in argument 1 
> (different base types)
>drivers/spi/spi-mt65xx.c:364:24:expected unsigned int [unsigned] val
>drivers/spi/spi-mt65xx.c:364:24:got restricted __le32 [usertype] 
> 
> >> drivers/spi/spi-mt65xx.c:734:24: sparse: symbol 'mtk_spi_driver' was not 
> >> declared. Should it be static?
> 
> Please review and possibly fold the followup patch.
> 
> vim +362 drivers/spi/spi-mt65xx.c
> 
>346mult_delta = 
> mtk_spi_get_mult_delta(mdata->tx_sgl_len);
>347mdata->xfer_len = mdata->tx_sgl_len - 
> mult_delta;
>348mdata->tx_sgl_len = mult_delta;
>349} else if (mdata->rx_sgl_len) {
>350mult_delta = 
> mtk_spi_get_mult_delta(mdata->rx_sgl_len);
>351mdata->xfer_len = mdata->rx_sgl_len - 
> mult_delta;
>352mdata->rx_sgl_len = mult_delta;
>353}
>354}
>355
>356static void mtk_spi_setup_dma_addr(struct spi_master *master,
>357   struct spi_transfer *xfer)
>358{
>359struct mtk_spi *mdata = spi_master_get_devdata(master);
>360
>361if (mdata->tx_sgl)
>  > 362writel(cpu_to_le32(xfer->tx_dma), mdata->base + 
> SPI_TX_SRC_REG);
>363if (mdata->rx_sgl)
>364writel(cpu_to_le32(xfer->rx_dma), mdata->base + 
> SPI_RX_DST_REG);
>365}
>366
>367static int mtk_spi_fifo_transfer(struct spi_master *master,
>368 struct spi_device *spi,
>369 struct spi_transfer *xfer)
>370{
> 
> ---
> 0-DAY kernel test infrastructureOpen Source Technology Center
> https://lists.01.org/pipermail/kbuild-all   Intel Corporation


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf, tools, report: Add support for srcfile sort key

2015-08-10 Thread Namhyung Kim
On Mon, Aug 10, 2015 at 05:37:40PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Aug 10, 2015 at 03:32:47PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Mon, Aug 10, 2015 at 01:12:41PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > (gdb) fr 2
> > > #2  0x004bb812 in sort__srcline_cmp (left=0x1bfa090, 
> > > right=0x7fffc0a0) at util/sort.c:306
> > > 306   hists__new_col_len(right->hists, 
> > > HISTC_SRCLINE,
> > > (gdb) p right->hists
> > > $7 = (struct hists *) 0x0
> > > (gdb) p left->hists
> > > $8 = (struct hists *) 0x18d66e0
> 
> > > Due to this both "-s srcline" and "-s srcfile" crashes here.
>  
> > Ok, this one needs to be applied before yours and Andi's:
>  
> > +++ b/tools/perf/util/hist.c
> > @@ -761,6 +761,7 @@ iter_add_next_cumulative_entry(struct hist_entry_iter 
> > *iter,
> > struct hist_entry **he_cache = iter->priv;
> > struct hist_entry *he;
> > struct hist_entry he_tmp = {
> > +   .hists = evsel__hists(evsel),
> > .cpu = al->cpu,
> > -
> 
> > Because you will use that stack synthesized he_tmp entry as a parameter
> > to the cmp() function, that will end up trying to access he_tmp->hists,
> > that was NULL, b00m.
> 
> all this is moot, as we need to update that column length elsewhere,
> together with all the other fileds, please see:
> 
>   
> ://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core=e8e6d37e73e6b950c891c780745460b87f4755b6

Looks good to me.

> 
> And now, with it really updating the width, we get to another problem,
> in one case I got a line like:
> 
>   0.00%  JS_GetInstancePrivate(JSContext*, JSObject*, JSClass*, JS 
> /usr/lib64/libmozjs-24.so 0x1a0bd1 d [.] JS_GetInstancePrivate(JSContext*, 
> JSObject*, JSClass*, JS::Value*)

It seems like ':' character in the symbol name affects the result for some 
reason.

Thanks,
Namhyung


> 
> Which is really strange, i.e. it mixed up demangled stuff with the
> srcfile, i.e. normal lines for:
> 
>  perf report -v -s srcfile,dso,symbol --stdio
> 
> Look like:
> 
>  1.94%  malloc.c/usr/lib64/libc-2.20.so   0x80f91 d [.] _int_malloc
> 
> Anyway, will continue this later, together with checking why it doesn't 
> resolve
> many things, that one may be related, in some cases, to functions in assembly
> source files, for now it updates correctly the column width for "srcline" and
> "srcfile".
> 
> - Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V1 Resend 04/11] drivers: md: Drop unlikely before IS_ERR(_OR_NULL)

2015-08-10 Thread Mike Snitzer
On Mon, Aug 10 2015 at  9:42pm -0400,
Viresh Kumar  wrote:

> On 10-08-15, 16:05, Mike Snitzer wrote:
> > On Mon, Aug 10 2015 at  2:12am -0400,
> > Viresh Kumar  wrote:
> > 
> > > IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
> > > is no need to do that again from its callers. Drop it.
> > > 
> > > Signed-off-by: Viresh Kumar 
> > 
> > I picked this up for 4.3, staged in linux-dm.git's 'for-next', see:
> > https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next=e2545d97b6cc0556fbd1099fca9271e3ca1d0b01
> 
> I had no clue about it as I didn't look at individual maintainer's
> tree. But rebased things over linux-next/master.
> 
> Why isn't your branch merged into linux-next ?

I just staged it today, so the next linux-next will pick it up.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] arm64: dts: Add base stratix 10 dtsi

2015-08-10 Thread Jisheng Zhang
On Mon, 10 Aug 2015 16:09:18 -0500
 wrote:

> From: Dinh Nguyen 
> 
> Add the base DTS for Altera's SoCFPGA Stratix 10 platform.
> 
> Signed-off-by: Dinh Nguyen 
> ---
>  arch/arm64/Kconfig |   5 +
>  arch/arm64/boot/dts/Makefile   |   1 +
>  arch/arm64/boot/dts/altera/Makefile|   5 +
>  arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi  | 354 
> +
>  .../boot/dts/altera/socfpga_stratix10_socdk.dts|  38 +++
>  arch/arm64/configs/defconfig   |   1 +
>  6 files changed, 404 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/altera/Makefile
>  create mode 100644 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
>  create mode 100644 arch/arm64/boot/dts/altera/socfpga_stratix10_socdk.dts
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index 318175f..0f8ab2b 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -207,6 +207,11 @@ config ARCH_SEATTLE
>   help
> This enables support for AMD Seattle SOC Family
>  
> +config ARCH_STRATIX10
> + bool "Altera's Stratix 10 SoCFPGA Family"
> + help
> +   This enables support for Altera's Stratix 10 SoCFPGA Family
> +
>  config ARCH_TEGRA
>   bool "NVIDIA Tegra SoC Family"
>   select ARCH_HAS_RESET_CONTROLLER
> diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
> index 38913be..7fb421a 100644
> --- a/arch/arm64/boot/dts/Makefile
> +++ b/arch/arm64/boot/dts/Makefile
> @@ -1,3 +1,4 @@
> +dts-dirs += altera
>  dts-dirs += amd
>  dts-dirs += apm
>  dts-dirs += arm
> diff --git a/arch/arm64/boot/dts/altera/Makefile 
> b/arch/arm64/boot/dts/altera/Makefile
> new file mode 100644
> index 000..d7a6416
> --- /dev/null
> +++ b/arch/arm64/boot/dts/altera/Makefile
> @@ -0,0 +1,5 @@
> +dtb-$(CONFIG_ARCH_STRATIX10) += socfpga_stratix10_socdk.dtb
> +
> +always   := $(dtb-y)
> +subdir-y := $(dts-dirs)
> +clean-files  := *.dtb
> diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi 
> b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
> new file mode 100644
> index 000..34f6dc3
> --- /dev/null
> +++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
> @@ -0,0 +1,354 @@
> +/*
> + * Copyright Altera Corporation (C) 2015. All rights reserved.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + *
> + * You should have received a copy of the GNU General Public License along 
> with
> + * this program.  If not, see .
> + */
> +
> +/dts-v1/;
> +
> +/ {
> + compatible = "altr,socfpga-stratix10";
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
[...]
> +
> + pmu {
> + compatible = "arm,armv8-pmuv3";
> + interrupts = <0 120 8>,
> +  <0 121 8>,
> +  <0 122 8>,
> +  <0 123 8>;

it's better to add interrupt-affinity according to Sudeep's suggestions.

> + };
> +
> + psci {
> + compatible = "arm,psci-0.2";
> + method = "smc";
> + };
> +
> + intc: intc@8000 {
> + compatible = "arm,gic-400", "arm,cortex-a15-gic";
> + #interrupt-cells = <3>;
> + interrupt-controller;
> + reg = <0x0 0x9000 0x1000>,
> +   <0x0 0xa000 0x2000>,
> +   <0x0 0xc000 0x1000>,
> +   <0x0 0xd000 0x1000>;
> + };
> +
> + soc {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + compatible = "simple-bus";
> + device_type = "soc";
> + interrupt-parent = <>;
> + ranges;
> +
> + clkmgr@ffd1000 {
> + compatible = "altr,clk-mgr";
> + reg = <0xffd1 0x1000>;
> + };
> +
> + gmac0: ethernet@ff80 {
> + compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", 
> "snps,dwmac";
> + reg = <0xff80 0x2000>;
> + interrupts = <0 90 4>;
> + interrupt-names = "macirq";
> + mac-address = [00 00 00 00 00 00];
> + status = "disabled";
> + };
> +
> + gmac1: ethernet@ff802000 {
> + compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", 
> "snps,dwmac";
> + reg = <0xff802000 0x2000>;
> + interrupts = <0 91 4>;
> + interrupt-names = 

Re: [PATCH v5 01/11] block: make generic_make_request handle arbitrarily sized bios

2015-08-10 Thread Mike Snitzer
On Mon, Aug 10 2015 at 10:00pm -0400,
Martin K. Petersen  wrote:

> > "Ming" == Ming Lin  writes:
> 
> Ming> Did you mean still use (UINT_MAX >> 9) in blkdev_issue_discard()?
> 
> Ming> But that doesn't work for dm-thinp. See Kent's suggestion to use
> Ming> 1<<31.
> 
> I'm not sure why things are not working for dm-thinp. Presumably Kent's
> code would split the discard at a granularity boundary so why would that
> cause problems for dm?

DM-thinp processes discards internally before it passes them down (if
configured to do so).  If a discard is smaller than the granularity of a
thinp block (whose size is configurable) or if the start and end of the
discard's extent is misaligned (relative to the thinp blocks mapped to
the logical extent) then the discard won't actually discard partial
thinp blocks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/6] PM / OPP: restructure _of_init_opp_table_v2()

2015-08-10 Thread Viresh Kumar
On 10-08-15, 17:31, Stephen Boyd wrote:
> I am not insisting anything. But another patch to get rid of the
> goto sounds fine.

The separate patch to kill goto.

-8<-

Message-Id: 
<9f9b9ea6ea3685d5f71c132e7efb18917253961f.1439260355.git.viresh.ku...@linaro.org>
From: Viresh Kumar 
Date: Tue, 11 Aug 2015 08:01:01 +0530
Subject: [PATCH] PM / OPP: Remove unnecessary goto statements

The code simply returns after jumping to the out label and doesn't free
any resources, etc.

Kill the unnecessary goto statements.

Signed-off-by: Viresh Kumar 
---
 drivers/base/power/opp.c | 25 +
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index f42e098b71fe..220e8d77e2c4 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -1269,14 +1269,14 @@ static int _of_init_opp_table_v2(struct device *dev,
 {
struct device_node *np;
struct device_opp *dev_opp;
-   int ret = 0, count = 0;
+   int ret, count = 0;
 
dev_opp = _managed_opp(opp_np);
if (dev_opp) {
/* OPPs are already managed */
if (!_add_list_dev(dev, dev_opp))
-   ret = -ENOMEM;
-   goto out;
+   return -ENOMEM;
+   return 0;
}
 
/* We have opp-list node now, iterate over it and add OPPs */
@@ -1287,31 +1287,24 @@ static int _of_init_opp_table_v2(struct device *dev,
if (ret) {
dev_err(dev, "%s: Failed to add OPP, %d\n", __func__,
ret);
-   break;
+   of_free_opp_table(dev);
+   return ret;
}
}
 
/* There should be one of more OPP defined */
if (WARN_ON(!count))
-   goto out;
-
-   if (ret) {
-   of_free_opp_table(dev);
-   goto out;
-   }
+   return -ENOENT;
 
dev_opp = _find_device_opp(dev);
-   if (WARN_ON(!dev_opp)) {
-   ret = -EINVAL;
-   goto out;
-   }
+   if (WARN_ON(!dev_opp))
+   return -EINVAL;
 
dev_opp->np = opp_np;
dev_opp->shared_opp = of_property_read_bool(opp_np,
"opp-shared");
 
-out:
-   return ret;
+   return 0;
 }
 
 /* Initializes OPP tables based on old-deprecated bindings */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC V2] bmac:change to use bitrev8() generic function

2015-08-10 Thread yalin wang
This change to use generic bitrev8() for bmac driver.

Signed-off-by: yalin wang 
---
 drivers/net/ethernet/apple/bmac.c | 17 +++--
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ethernet/apple/bmac.c 
b/drivers/net/ethernet/apple/bmac.c
index a65d7a6..7f7a398 100644
--- a/drivers/net/ethernet/apple/bmac.c
+++ b/drivers/net/ethernet/apple/bmac.c
@@ -22,6 +22,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -805,18 +806,6 @@ static irqreturn_t bmac_txdma_intr(int irq, void *dev_id)
 }
 
 #ifndef SUNHME_MULTICAST
-/* Real fast bit-reversal algorithm, 6-bit values */
-static int reverse6[64] = {
-   0x0,0x20,0x10,0x30,0x8,0x28,0x18,0x38,
-   0x4,0x24,0x14,0x34,0xc,0x2c,0x1c,0x3c,
-   0x2,0x22,0x12,0x32,0xa,0x2a,0x1a,0x3a,
-   0x6,0x26,0x16,0x36,0xe,0x2e,0x1e,0x3e,
-   0x1,0x21,0x11,0x31,0x9,0x29,0x19,0x39,
-   0x5,0x25,0x15,0x35,0xd,0x2d,0x1d,0x3d,
-   0x3,0x23,0x13,0x33,0xb,0x2b,0x1b,0x3b,
-   0x7,0x27,0x17,0x37,0xf,0x2f,0x1f,0x3f
-};
-
 static unsigned int
 crc416(unsigned int curval, unsigned short nxtval)
 {
@@ -871,7 +860,7 @@ bmac_addhash(struct bmac_data *bp, unsigned char *addr)
 
if (!(*addr)) return;
crc = bmac_crc((unsigned short *)addr) & 0x3f; /* Big-endian alert! */
-   crc = reverse6[crc];/* Hyperfast bit-reversing algorithm */
+   crc = bitrev8((u8)crc) >> 2;
if (bp->hash_use_count[crc]++) return; /* This bit is already set */
mask = crc % 16;
mask = (unsigned char)1 << mask;
@@ -886,7 +875,7 @@ bmac_removehash(struct bmac_data *bp, unsigned char *addr)
 
/* Now, delete the address from the filter copy, as indicated */
crc = bmac_crc((unsigned short *)addr) & 0x3f; /* Big-endian alert! */
-   crc = reverse6[crc];/* Hyperfast bit-reversing algorithm */
+   crc = bitrev8((u8)crc) >> 2;
if (bp->hash_use_count[crc] == 0) return; /* That bit wasn't in use! */
if (--bp->hash_use_count[crc]) return; /* That bit is still in use */
mask = crc % 16;
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v1] usb: dwc2: reset AHB hclk domain before init

2015-08-10 Thread Yunzhi Li
We initiate dwc2 usb controller in BIOS, when kernel driver
start-up we should reset AHB hclk domain to reset all AHB
interface registers to default. Without this the FIFO value
setting might be incorrect because calculating FIFO size need the
power-on value of GRXFSIZ/GNPTXFSIZ/HPTXFSIZ registers.

This patch could avoid warnning massage like in rk3288 platform:
[2.074764] dwc2 ff58.usb: 256 invalid for
host_perio_tx_fifo_size. Check HW configuration.

Signed-off-by: Yunzhi Li 

---

 drivers/usb/dwc2/platform.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/drivers/usb/dwc2/platform.c b/drivers/usb/dwc2/platform.c
index 9093530..3da21ab 100644
--- a/drivers/usb/dwc2/platform.c
+++ b/drivers/usb/dwc2/platform.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -165,6 +166,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
struct resource *res;
struct phy *phy;
struct usb_phy *uphy;
+   struct reset_control *rst;
int retval;
int irq;
 
@@ -189,6 +191,16 @@ static int dwc2_driver_probe(struct platform_device *dev)
 
hsotg->dev = >dev;
 
+   /* AHB hclk domain reset, set all AHB interface registers to default */
+   rst = devm_reset_control_get_optional(>dev, "ahb_reset");
+   if (IS_ERR(rst)) {
+   dev_dbg(>dev, "Can't get dwc2 AHB reset\n");
+   } else {
+   reset_control_assert(rst);
+   udelay(5);
+   reset_control_deassert(rst);
+   }
+
/*
 * Use reasonable defaults so platforms don't have to provide these.
 */
-- 
2.0.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/6] PM / OPP: restructure _of_init_opp_table_v2()

2015-08-10 Thread Viresh Kumar
On 10-08-15, 17:31, Stephen Boyd wrote:
> So ret is 0. I thought it was an error path, but I guess this is a
> warning path and we return 0 still?

Urg ..

-8<-

Message-Id: 

From: Viresh Kumar 
Date: Tue, 4 Aug 2015 11:57:36 +0530
Subject: [PATCH] PM / OPP: restructure _of_init_opp_table_v2()

'dev_opp' will always be NULL in _of_init_opp_table_v2() after creating
OPPs for a device. There is no point comparing it against NULL there.

Restructure code a bit to make it more efficient.

Signed-off-by: Viresh Kumar 
---
 drivers/base/power/opp.c | 23 ---
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
index 1daaa1a418a2..f42e098b71fe 100644
--- a/drivers/base/power/opp.c
+++ b/drivers/base/power/opp.c
@@ -1295,20 +1295,21 @@ static int _of_init_opp_table_v2(struct device *dev,
if (WARN_ON(!count))
goto out;
 
-   if (!ret) {
-   if (!dev_opp) {
-   dev_opp = _find_device_opp(dev);
-   if (WARN_ON(!dev_opp))
-   goto out;
-   }
-
-   dev_opp->np = opp_np;
-   dev_opp->shared_opp = of_property_read_bool(opp_np,
-   "opp-shared");
-   } else {
+   if (ret) {
of_free_opp_table(dev);
+   goto out;
}
 
+   dev_opp = _find_device_opp(dev);
+   if (WARN_ON(!dev_opp)) {
+   ret = -EINVAL;
+   goto out;
+   }
+
+   dev_opp->np = opp_np;
+   dev_opp->shared_opp = of_property_read_bool(opp_np,
+   "opp-shared");
+
 out:
return ret;
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/2] perf hists browser: Support horizontal scrolling with '<' and '>' key

2015-08-10 Thread Namhyung Kim
On Mon, Aug 10, 2015 at 08:14:45PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 11, 2015 at 01:02:56AM +0200, Jiri Olsa escreveu:
> > On Mon, Aug 10, 2015 at 07:58:22PM -0300, Arnaldo Carvalho de Melo wrote:
>  
> > SNIP
>  
> > > > it'd really help for perf mem output, which is quite wide.. and we 
> > > > probably
> > > > have more wide outputs, or users with narrow terminals ;-)
> 
> > > I'm not going against horizontal scrolling, it is needed, sure thing,
> > > its surprising we are doing this only now. What I am asking is this fine
> > > scrolling of one column per <- or -> keypress, but I really need to try
> > > it with things like 'perf mem', I thought that when you pressed '>', in
> > > this patch, it would move entire sort key columns, not just one vertical
> > > column one character wide, right?
>  
> > yep, the whole sort column seemed more usefull,
> > though 1 vertical column is nice also
> 
> We can get that by using the right and left keys while pressing shift or
> alt, I think.

I'd also like to do it.  But it seems SLang_getkey() doesn't return
the shift, alt or control key status for arrow keys.  CTRL(K_LEFT) or
META(K_RIGHT) didn't work for me.  Anyone has an idea?

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v4 0/6] cpufreq: use generic cpufreq drivers for Exynos4x12 platform

2015-08-10 Thread Krzysztof Kozlowski
On 10.08.2015 10:27, Kukjin Kim wrote:
> Krzysztof Kozlowski wrote:
>>
>> W dniu 08.08.2015 o 11:07, Viresh Kumar pisze:
>>> On 08-08-15, 00:24, Rafael J. Wysocki wrote:
 OK, so please let me know which patches you want me to pick up.

 Ideally, I'd prefer them to be resent in a separate series with ACKs and 
 all
 with a cover letter clearly stating whose tree they are being targeted at.
>>>
>>> He already sent it separately, let me send a confirmatory mail in
>>> reply to that.
>>
>> Dear Kukjin,
>>
>> Can you apply the 2-5 of this series to v4.3? It's getting late but
>> maybe they still could go?
>>
> Once my previous pull-request landed into arm-soc, I'll try to send out this
> series 2-5 for v4.3.

Additionally (better late than never):
Patches 2-5 tested on Trats2 board (Exynos4412)

Tested-by: Krzysztof Kozlowski 

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] ARM: exynos_defconfig: Enable cpufreq-dt driver

2015-08-10 Thread Krzysztof Kozlowski
With the latest patches the cpufreq-dt can be used on multiple
Exynos SoCs: 3250, 4210, 4212, 4412 and 5250.

Enable it along with default ondemand governor to conserve the energy,
reduce temperature while maintaining acceptable performance.

Signed-off-by: Krzysztof Kozlowski 
---
 arch/arm/configs/exynos_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/configs/exynos_defconfig 
b/arch/arm/configs/exynos_defconfig
index 67965cedeb69..2263cd94cb93 100644
--- a/arch/arm/configs/exynos_defconfig
+++ b/arch/arm/configs/exynos_defconfig
@@ -27,6 +27,8 @@ CONFIG_ARM_APPENDED_DTB=y
 CONFIG_ARM_ATAG_DTB_COMPAT=y
 CONFIG_CMDLINE="root=/dev/ram0 rw ramdisk=8192 initrd=0x4100,8M 
console=ttySAC1,115200 init=/linuxrc mem=256M"
 CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+CONFIG_CPUFREQ_DT=y
 CONFIG_CPU_IDLE=y
 CONFIG_ARM_EXYNOS_CPUIDLE=y
 CONFIG_VFP=y
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 1/2] perf hists browser: Support horizontal scrolling with '<' and '>' key

2015-08-10 Thread Namhyung Kim
Hi Arnaldo,

On Mon, Aug 10, 2015 at 07:58:22PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Tue, Aug 11, 2015 at 12:46:03AM +0200, Jiri Olsa escreveu:
> > On Mon, Aug 10, 2015 at 12:50:04PM -0300, Arnaldo Carvalho de Melo wrote:
> > > Em Sun, Aug 09, 2015 at 01:21:39PM +0200, Jiri Olsa escreveu:
> > > > On Sun, Aug 09, 2015 at 07:35:42PM +0900, Namhyung Kim wrote:
> > > > > Jiri said that it'd be more eye-friendly if it can move by column
> > > > > widths.  So change the keys to do it rather than jumping 10 
> > > > > characters.
> > > > > Also add ',' and '.' keys which reside same position in the keyboard 
> > > > > to
> > > > > move by 1 characters.
> > > > 
> > > > I like it ;-)
> > > 
> > > Humm, I don't, its not natural, I doubt anyone will think about using ,
> > > and . to move by one character right/left, ditto for <>, I think we
> > > should just recover <- and -> (left and right arrows) for navigation,
> > > leave ENTER to be what -> was doing and esc for what <- does, in fact it
> > > is already like that.
> > 
> > I would ;-) anyway I also think arrows are the best, but I thought we
> > dont want to break existing interface much
> 
> In this case I think we can, enter and esc are really well know keys for
> entering and escaping from a place, and we have them working forever
> doing that, its just that at some time I used <- as an alias for ESC and
> -> as alias for ENTER.
> 
> I.e. for people using ESC and ENTER, this will not be noticed :-)

Yes, but I guess many people use arrow keys more than ESC and ENTER
since we use up/down arrow keys anyway.  I do want to use left/right
arrow for scrolling, but I'm afraid that it'll bother existing users..

Thanks,
Namhyung


>  
> > > Probably using shift or control or alt + <- -> for moving one column at
> > > at time is enough, but humm, is there value in that?
> > 
> > it'd really help for perf mem output, which is quite wide.. and we probably
> > have more wide outputs, or users with narrow terminals ;-)
> 
> I'm not going against horizontal scrolling, it is needed, sure thing,
> its surprising we are doing this only now. What I am asking is this fine
> scrolling of one column per <- or -> keypress, but I really need to try
> it with things like 'perf mem', I thought that when you pressed '>', in
> this patch, it would move entire sort key columns, not just one vertical
> column one character wide, right?
> 
> - Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFCv5 PATCH 38/46] sched: scheduler-driven cpu frequency selection

2015-08-10 Thread Leo Yan
On Tue, Jul 07, 2015 at 07:24:21PM +0100, Morten Rasmussen wrote:
> From: Michael Turquette 
> 
> Scheduler-driven cpu frequency selection is desirable as part of the
> on-going effort to make the scheduler better aware of energy
> consumption.  No piece of the Linux kernel has a better view of the
> factors that affect a cpu frequency selection policy than the
> scheduler[0], and this patch is an attempt to converge on an initial
> solution.
> 
> This patch implements a simple shim layer between the Linux scheduler
> and the cpufreq subsystem. This interface accepts a capacity request
> from the Completely Fair Scheduler and honors the max request from all
> cpus in the same frequency domain.
> 
> The policy magic comes from choosing the cpu capacity request from cfs
> and is not contained in this cpufreq governor. This code is
> intentionally dumb.
> 
> Note that this "governor" is event-driven. There is no polling loop to
> check cpu idle time nor any other method which is unsynchronized with
> the scheduler.
> 
> Thanks to Juri Lelli  for contributing design ideas,
> code and test results.
> 
> [0] http://article.gmane.org/gmane.linux.kernel/1499836
> 
> Signed-off-by: Michael Turquette 
> Signed-off-by: Juri Lelli 
> ---
>  drivers/cpufreq/Kconfig  |  24 
>  include/linux/cpufreq.h  |   3 +
>  kernel/sched/Makefile|   1 +
>  kernel/sched/cpufreq_sched.c | 308 
> +++
>  kernel/sched/sched.h |   8 ++
>  5 files changed, 344 insertions(+)
>  create mode 100644 kernel/sched/cpufreq_sched.c
> 
> diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
> index 659879a..9bbf44c 100644
> --- a/drivers/cpufreq/Kconfig
> +++ b/drivers/cpufreq/Kconfig
> @@ -102,6 +102,15 @@ config CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
> Be aware that not all cpufreq drivers support the conservative
> governor. If unsure have a look at the help section of the
> driver. Fallback governor will be the performance governor.
> +
> +config CPU_FREQ_DEFAULT_GOV_SCHED
> + bool "sched"
> + select CPU_FREQ_GOV_SCHED
> + select CPU_FREQ_GOV_PERFORMANCE
> + help
> +   Use the CPUfreq governor 'sched' as default. This scales
> +   cpu frequency from the scheduler as per-entity load tracking
> +   statistics are updated.
>  endchoice
>  
>  config CPU_FREQ_GOV_PERFORMANCE
> @@ -183,6 +192,21 @@ config CPU_FREQ_GOV_CONSERVATIVE
>  
> If in doubt, say N.
>  
> +config CPU_FREQ_GOV_SCHED
> + tristate "'sched' cpufreq governor"
> + depends on CPU_FREQ
> + select CPU_FREQ_GOV_COMMON
> + help
> +   'sched' - this governor scales cpu frequency from the
> +   scheduler as a function of cpu capacity utilization. It does
> +   not evaluate utilization on a periodic basis (as ondemand
> +   does) but instead is invoked from the completely fair
> +   scheduler when updating per-entity load tracking statistics.
> +   Latency to respond to changes in load is improved over polling
> +   governors due to its event-driven design.
> +
> +   If in doubt, say N.
> +
>  comment "CPU frequency scaling drivers"
>  
>  config CPUFREQ_DT
> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
> index 1f2c9a1..30241c9 100644
> --- a/include/linux/cpufreq.h
> +++ b/include/linux/cpufreq.h
> @@ -494,6 +494,9 @@ extern struct cpufreq_governor cpufreq_gov_ondemand;
>  #elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE)
>  extern struct cpufreq_governor cpufreq_gov_conservative;
>  #define CPUFREQ_DEFAULT_GOVERNOR (_gov_conservative)
> +#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_SCHED_GOV)

s/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHED_GOV/CONFIG_CPU_FREQ_DEFAULT_GOV_SCHED/

> +extern struct cpufreq_governor cpufreq_gov_sched_gov;

s/cpufreq_gov_sched_gov/cpufreq_gov_sched/

> +#define CPUFREQ_DEFAULT_GOVERNOR (_gov_sched)
>  #endif
>  
>  /*
> diff --git a/kernel/sched/Makefile b/kernel/sched/Makefile
> index 6768797..90ed832 100644
> --- a/kernel/sched/Makefile
> +++ b/kernel/sched/Makefile
> @@ -19,3 +19,4 @@ obj-$(CONFIG_SCHED_AUTOGROUP) += auto_group.o
>  obj-$(CONFIG_SCHEDSTATS) += stats.o
>  obj-$(CONFIG_SCHED_DEBUG) += debug.o
>  obj-$(CONFIG_CGROUP_CPUACCT) += cpuacct.o
> +obj-$(CONFIG_CPU_FREQ_GOV_SCHED) += cpufreq_sched.o
> diff --git a/kernel/sched/cpufreq_sched.c b/kernel/sched/cpufreq_sched.c
> new file mode 100644
> index 000..5020f24
> --- /dev/null
> +++ b/kernel/sched/cpufreq_sched.c
> @@ -0,0 +1,308 @@
> +/*
> + *  Copyright (C)  2015 Michael Turquette 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include "sched.h"
> +
> +#define THROTTLE_NSEC

RE: [PATCH] igb: Fix a memory leak in igb_probe

2015-08-10 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org]
> On Behalf Of Jia-Ju Bai
> Sent: Wednesday, August 05, 2015 7:05 AM
> To: Kirsher, Jeffrey T; Brandeburg, Jesse
> Cc: intel-wired-...@lists.osuosl.org; net...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Jia-Ju Bai
> Subject: [PATCH] igb: Fix a memory leak in igb_probe
> 
> In error handling code of igb_probe, the memory adapter->shadow_vfta
> allocated by kcalloc in igb_sw_init is not freed. So when register_netdev
> or igb_init_i2c is failed, a memory leak will occur.
> This patch adds kfree to fix it.
> 
> Signed-off-by: Jia-Ju Bai 
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c |1 +
>  1 file changed, 1 insertion(+)

Tested-by: Aaron Brown 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL] MODSIGN: Use PKCS#7 for module signatures [ver #7]

2015-08-10 Thread David Howells
James Morris  wrote:

> On Mon, 10 Aug 2015, David Howells wrote:
> 
> > James Morris  wrote:
> > 
> > > I get a build failure:
> > > 
> > >   HOSTCC  scripts/sign-file
> > > scripts/sign-file.c:20:25: error: openssl/bio.h: No such file or directory
> > > 
> > > followed by many lines of error.
> > 
> > What openssl do you have installed and do you have the -devel packages for 
> > it
> > installed?  In particular libcrypto.
> 
> openssl-1.0.1e-30.el6.11.x86_64
> 
> and not the devel packages.

Yeah, you need the openssl-devel package now.  There's some stuff using the
library directly allows us to do that you can't do with just the command line
tool.

This is mentioned in the

MODSIGN: Provide a utility to append a PKCS#7 signature to a module

commit description.

Note that the utility is written in C and must be linked against the
OpenSSL crypto library.

Would it help to update the module-signing.txt document, the config option or
the git pull request/cover note?

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [Intel-wired-lan] [PATCH 1/2] igb: Teardown SR-IOV before unregister_netdev()

2015-08-10 Thread Brown, Aaron F
> From: Intel-wired-lan [mailto:intel-wired-lan-boun...@lists.osuosl.org] On
> Behalf Of Alex Williamson
> Sent: Monday, July 27, 2015 4:19 PM
> To: intel-wired-...@lists.osuosl.org; Kirsher, Jeffrey T
> Cc: net...@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH 1/2] igb: Teardown SR-IOV before
> unregister_netdev()
> 
> When the .remove() callback for a PF is called, SR-IOV support for the
> device is disabled, which requires unbinding and removing the VFs.
> The VFs may be in-use either by the host kernel or userspace, such as
> assigned to a VM through vfio-pci.  In this latter case, the VFs may
> be removed either by shutting down the VM or hot-unplugging the
> devices from the VM.  Unfortunately in the case of a Windows 2012 R2
> guest, hot-unplug is broken due to the ordering of the PF driver
> teardown.  Disabling SR-IOV prior to unregister_netdev() avoids this
> issue.
> 
> Signed-off-by: Alex Williamson 
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c |8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

Tested-by: Aaron Brown 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] igb: Fix a deadlock in igb_sriov_reinit

2015-08-10 Thread Brown, Aaron F
> From: netdev-ow...@vger.kernel.org [mailto:netdev-ow...@vger.kernel.org]
> On Behalf Of Jia-Ju Bai
> Sent: Sunday, August 02, 2015 8:36 PM
> To: Kirsher, Jeffrey T; Brandeburg, Jesse
> Cc: intel-wired-...@lists.osuosl.org; net...@vger.kernel.org; linux-
> ker...@vger.kernel.org; Jia-Ju Bai
> Subject: [PATCH] igb: Fix a deadlock in igb_sriov_reinit
> 
> When igb_init_interrupt_scheme in igb_sriov_reinit is failed, the lock
> acquired by rtnl_lock() is not released, which causes a deadlock.
> This patch adds rtnl_unlock() in error handling to fix it.
> 
> Signed-off-by: Jia-Ju Bai 
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c |1 +
>  1 file changed, 1 insertion(+)

Tested-by: Aaron Brown 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC] bmac:change to use bitrev8() generic function

2015-08-10 Thread yalin wang

> On Aug 10, 2015, at 20:02, David Laight  wrote:
> 
>> From: Tobias Klauser
>> Sent: 10 August 2015 12:49
>> On 2015-08-10 at 11:53:41 +0200, yalin wang  wrote:
>>> This change to use generic bitrev8() for bmac driver.
> ...
>>> @@ -871,7 +860,7 @@ bmac_addhash(struct bmac_data *bp, unsigned char *addr)
>>> 
>>> if (!(*addr)) return;
>>> crc = bmac_crc((unsigned short *)addr) & 0x3f; /* Big-endian alert! */
> 
> Why not *((u8 *)addr + 1) & 0x3f
> 
>>> -   crc = reverse6[crc];/* Hyperfast bit-reversing algorithm */
>>> +   crc = bitrev8((u8)crc);
>> 
>> No, this won't work. reverse6 works on 6 bit values, while bitrev8 works
>> on 8bit values, e.g. reverse6[1] = 0x20, while bitrev8(1) = 0x80
> 
> You could use bitrev8(n) >> 2.
> 
> But that is a 'strange' map of a 7-bit value to a 6-bit one.
> 
> I thought it was more common for ethernet hardware to use the
> value of the crc register after all 6 bytes of the mac address
> had been processed.
oh, my mistake, i will change it in V2 for review.--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v5 01/11] block: make generic_make_request handle arbitrarily sized bios

2015-08-10 Thread Martin K. Petersen
> "Ming" == Ming Lin  writes:

Ming> Did you mean still use (UINT_MAX >> 9) in blkdev_issue_discard()?

Ming> But that doesn't work for dm-thinp. See Kent's suggestion to use
Ming> 1<<31.

I'm not sure why things are not working for dm-thinp. Presumably Kent's
code would split the discard at a granularity boundary so why would that
cause problems for dm?

In looking at this I just found out that we'll corrupt data on certain
SCSI configs with the granularity enforcement in place. I'll have to
conjure up a fix for that...

-- 
Martin K. Petersen  Oracle Linux Engineering
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] net/fddi: remove HWM_REVERSE() macro

2015-08-10 Thread yalin wang
 HWM_REVERSE() macro is unused, remove it.

Signed-off-by: yalin wang 
---
 drivers/net/fddi/skfp/h/hwmtm.h | 10 --
 1 file changed, 10 deletions(-)

diff --git a/drivers/net/fddi/skfp/h/hwmtm.h b/drivers/net/fddi/skfp/h/hwmtm.h
index 5924d42..4ca2341 100644
--- a/drivers/net/fddi/skfp/h/hwmtm.h
+++ b/drivers/net/fddi/skfp/h/hwmtm.h
@@ -74,15 +74,6 @@
 #define NULL   0
 #endif
 
-#ifdef LITTLE_ENDIAN
-#define HWM_REVERSE(x) (x)
-#else
-#defineHWM_REVERSE(x)  x)<<24L)&0xff00L)   +   
\
-(((x)<< 8L)&0x00ffL)   +   \
-(((x)>> 8L)&0xff00L)   +   \
-(((x)>>24L)&0x00ffL))
-#endif
-
 #define C_INDIC(1L<<25)
 #define A_INDIC(1L<<26)
 #defineRD_FS_LOCAL 0x80
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] pinctrl: mediatek: Implement pictrl irq wake handler

2015-08-10 Thread Hongzhou Yang
On Mon, 2015-08-10 at 14:43 +0200, Linus Walleij wrote:
> On Wed, Jul 29, 2015 at 11:36 AM,   wrote:
> 
> > From: Maoguang Meng 
> >
> > This patch implement irq_set_wake for suspend resume.
> >
> > Signed-off-by: Maoguang Meng 
> 
> Hongzhou/Yingjoe: are you OK with this patch? Can I have your ACKs?
> 
> Yours,
> Linus Walleij

Hi Linus,

Yes, you can. Thank you.

Acked-by: Hongzhou Yang 

Hongzhou

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH V1 Resend 04/11] drivers: md: Drop unlikely before IS_ERR(_OR_NULL)

2015-08-10 Thread Viresh Kumar
On 10-08-15, 16:05, Mike Snitzer wrote:
> On Mon, Aug 10 2015 at  2:12am -0400,
> Viresh Kumar  wrote:
> 
> > IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag and there
> > is no need to do that again from its callers. Drop it.
> > 
> > Signed-off-by: Viresh Kumar 
> 
> I picked this up for 4.3, staged in linux-dm.git's 'for-next', see:
> https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next=e2545d97b6cc0556fbd1099fca9271e3ca1d0b01

I had no clue about it as I didn't look at individual maintainer's
tree. But rebased things over linux-next/master.

Why isn't your branch merged into linux-next ?

-- 
viresh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net/fddi:change HWM_REVERSE() macro

2015-08-10 Thread yalin wang

> On Aug 11, 2015, at 00:36, Joe Perches  wrote:
> 
> On Tue, 2015-08-11 at 00:14 +0800, yalin wang wrote:
>> HWM_REVERSE
> 
> Is unused and it would be better if removed.
> 
ok,  i will send V2 patch .
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] isdn:remove reverse_bits(), use revbit8()

2015-08-10 Thread yalin wang

> On Aug 11, 2015, at 05:30, David Miller  wrote:
> 
> From: yalin wang 
> Date: Mon, 10 Aug 2015 17:15:57 +0800
> 
>> This change isdn driver, remove reverse_bits() function,
>> use the generic revbit8() function instead.
>> 
>> Signed-off-by: yalin wang 
> 
> Applied, however please format your Subject lines better in the
> future.
> 
> There should be a space after the subsystem specifier and the ':'
> character.  So "isdn: "
> 
> Then you should capitalize the description in the Subject line
> because it is very much like an English sentence.
i see,
Thanks for your kindly remind !
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[RFC PATCH] mmc: sdhci-of-arasan: Add the support for sdhci-5.1

2015-08-10 Thread Shawn Lin
This patch adds the quirks and compatible string in sdhci-of-arasan.c
to support sdhci-arasan5.1 version of controller. No documented controller
IP version is found in the TRM, so we use ths version of command queueing
engine integrated into this controller by arasan to specify our controller.

Signed-off-by: Shawn Lin 

---

 Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 2 +-
 drivers/mmc/host/sdhci-of-arasan.c | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt 
b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
index 7e94903..da541c3 100644
--- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
+++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
@@ -9,7 +9,7 @@ Device Tree Bindings for the Arasan SDHCI Controller
 
 Required Properties:
   - compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
-'arasan,sdhci-4.9a'
+'arasan,sdhci-4.9a' or 'arasan,sdhci-5.1'
   - reg: From mmc bindings: Register location and length.
   - clocks: From clock bindings: Handles to clock inputs.
   - clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
diff --git a/drivers/mmc/host/sdhci-of-arasan.c 
b/drivers/mmc/host/sdhci-of-arasan.c
index ef5a7d2..c9012f5 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -175,6 +175,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
if (of_device_is_compatible(pdev->dev.of_node, "arasan,sdhci-4.9a")) {
host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
+   } else if (of_device_is_compatible(pdev->dev.of_node,
+  "arasan,sdhci-5.1")) {
+   host->quirks |= SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
}
 
sdhci_get_of_property(pdev);
@@ -217,6 +220,7 @@ static int sdhci_arasan_remove(struct platform_device *pdev)
 
 static const struct of_device_id sdhci_arasan_of_match[] = {
{ .compatible = "arasan,sdhci-8.9a" },
+   { .compatible = "arasan,sdhci-5.1" },
{ .compatible = "arasan,sdhci-4.9a" },
{ }
 };
-- 
2.3.7


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 0/8] serial: imx: rework pm support and add runtime pm

2015-08-10 Thread Eduardo Valentin
Hello all,


This is version 2 of a patch series to introduce runtime pm in the imx serial
driver. The difference now is that it is rebased on top of linux-next, given
that some of the work done in v1 was already sent.

Here is the link of v1:
http://marc.info/?l=linux-pm=143914435605790=2

As always, comments are welcome.

BR

Eduardo Valentin (8):
  serial: imx: remove unbalanced clk_prepare
  serial: imx: introduce serial_imx_enable_wakeup()
  serial: imx: allow waking up on RTSD
  serial: imx: save and restore context in the suspend path
  serial: imx: add a flag to indicate we are in the suspend path
  serial: imx: add runtime pm support
  serial: imx: add pm_qos request
  serial: imx: use SET_*SYSTEM_PM_OPS helper functions

 arch/arm/boot/dts/Makefile |   1 +
 drivers/tty/serial/imx.c   | 352 ++---
 2 files changed, 270 insertions(+), 83 deletions(-)

-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 2/8] serial: imx: introduce serial_imx_enable_wakeup()

2015-08-10 Thread Eduardo Valentin
This change is a code reorganization. Here we introduce
serial_imx_enable_wakeup() helper function to do
the job of configuring and preparing wakeup sources
on imx serial device. The idea is to allow other
parts of the code to call this function whenever
the device is known to go to idle.

Cc: Fabio Estevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 arch/arm/boot/dts/Makefile |  1 +
 drivers/tty/serial/imx.c   | 22 ++
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 821e015..d60b28f 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -330,6 +330,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-wandboard-revb1.dtb
 dtb-$(CONFIG_SOC_IMX6SL) += \
imx6sl-evk.dtb \
+   imx6sl-fox-p1.dtb \
imx6sl-warp.dtb
 dtb-$(CONFIG_SOC_IMX6SX) += \
imx6sx-sabreauto.dtb \
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index b27c232..3c2b0ac 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1972,6 +1972,18 @@ static int serial_imx_remove(struct platform_device 
*pdev)
return uart_remove_one_port(_reg, >port);
 }
 
+static void serial_imx_enable_wakeup(struct imx_port *sport, bool on)
+{
+   unsigned int val;
+
+   val = readl(sport->port.membase + UCR3);
+   if (on)
+   val |= UCR3_AWAKEN;
+   else
+   val &= ~UCR3_AWAKEN;
+   writel(val, sport->port.membase + UCR3);
+}
+
 static int imx_serial_port_suspend_noirq(struct device *dev)
 {
struct platform_device *pdev = to_platform_device(dev);
@@ -2029,12 +2041,9 @@ static int imx_serial_port_suspend(struct device *dev)
 {
struct platform_device *pdev = to_platform_device(dev);
struct imx_port *sport = platform_get_drvdata(pdev);
-   unsigned int val;
 
/* enable wakeup from i.MX UART */
-   val = readl(sport->port.membase + UCR3);
-   val |= UCR3_AWAKEN;
-   writel(val, sport->port.membase + UCR3);
+   serial_imx_enable_wakeup(sport, true);
 
uart_suspend_port(_reg, >port);
 
@@ -2045,12 +2054,9 @@ static int imx_serial_port_resume(struct device *dev)
 {
struct platform_device *pdev = to_platform_device(dev);
struct imx_port *sport = platform_get_drvdata(pdev);
-   unsigned int val;
 
/* disable wakeup from i.MX UART */
-   val = readl(sport->port.membase + UCR3);
-   val &= ~UCR3_AWAKEN;
-   writel(val, sport->port.membase + UCR3);
+   serial_imx_enable_wakeup(sport, false);
 
uart_resume_port(_reg, >port);
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 5/8] serial: imx: add a flag to indicate we are in the suspend path

2015-08-10 Thread Eduardo Valentin
This is a simple flag that gets set across prepare and complete
callbacks in the suspend path. We the flag we may avoid
runtime pm idling at the same time.

Cc: Fabio Estevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 20 
 1 file changed, 20 insertions(+)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index fe3d41c..50abb60 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -218,6 +218,8 @@ struct imx_port {
wait_queue_head_t   dma_wait;
unsigned intsaved_reg[10];
boolcontext_saved;
+
+   boolis_suspending;
 };
 
 struct imx_port_ucrs {
@@ -2026,6 +2028,22 @@ static void serial_imx_enable_wakeup(struct imx_port 
*sport, bool on)
writel(val, sport->port.membase + UCR1);
 }
 
+static int serial_imx_prepare(struct device *dev)
+{
+   struct imx_port *sport = dev_get_drvdata(dev);
+
+   sport->is_suspending = true;
+
+   return 0;
+}
+
+static void serial_imx_complete(struct device *dev)
+{
+   struct imx_port *sport = dev_get_drvdata(dev);
+
+   sport->is_suspending = false;
+}
+
 static int imx_serial_port_suspend_noirq(struct device *dev)
 {
struct platform_device *pdev = to_platform_device(dev);
@@ -2091,6 +2109,8 @@ static const struct dev_pm_ops imx_serial_port_pm_ops = {
.resume_noirq = imx_serial_port_resume_noirq,
.suspend = imx_serial_port_suspend,
.resume = imx_serial_port_resume,
+   .prepare = serial_imx_prepare,
+   .complete = serial_imx_complete,
 };
 
 static struct platform_driver serial_imx_driver = {
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 4/8] serial: imx: save and restore context in the suspend path

2015-08-10 Thread Eduardo Valentin
This change teaches the imx serial driver to save its
context and restore it across suspend and resume path.
To do so, it introduces serial_imx_restore_context()
and serial_imx_save_context() functions. They use
a shadow set of registers to save key registers
and restore them accordingly. These functions can
be reused on other situations, when the device
context is lost.

Cc: Fabio Estevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 58 ++--
 1 file changed, 37 insertions(+), 21 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 167dea1..fe3d41c 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -217,6 +217,7 @@ struct imx_port {
unsigned intdma_tx_nents;
wait_queue_head_t   dma_wait;
unsigned intsaved_reg[10];
+   boolcontext_saved;
 };
 
 struct imx_port_ucrs {
@@ -1972,6 +1973,40 @@ static int serial_imx_remove(struct platform_device 
*pdev)
return uart_remove_one_port(_reg, >port);
 }
 
+static void serial_imx_restore_context(struct imx_port *sport)
+{
+   if (!sport->context_saved)
+   return;
+
+   writel(sport->saved_reg[4], sport->port.membase + UFCR);
+   writel(sport->saved_reg[5], sport->port.membase + UESC);
+   writel(sport->saved_reg[6], sport->port.membase + UTIM);
+   writel(sport->saved_reg[7], sport->port.membase + UBIR);
+   writel(sport->saved_reg[8], sport->port.membase + UBMR);
+   writel(sport->saved_reg[9], sport->port.membase + IMX21_UTS);
+   writel(sport->saved_reg[0], sport->port.membase + UCR1);
+   writel(sport->saved_reg[1] | UCR2_SRST, sport->port.membase + UCR2);
+   writel(sport->saved_reg[2], sport->port.membase + UCR3);
+   writel(sport->saved_reg[3], sport->port.membase + UCR4);
+   sport->context_saved = false;
+}
+
+static void serial_imx_save_context(struct imx_port *sport)
+{
+   /* Save necessary regs */
+   sport->saved_reg[0] = readl(sport->port.membase + UCR1);
+   sport->saved_reg[1] = readl(sport->port.membase + UCR2);
+   sport->saved_reg[2] = readl(sport->port.membase + UCR3);
+   sport->saved_reg[3] = readl(sport->port.membase + UCR4);
+   sport->saved_reg[4] = readl(sport->port.membase + UFCR);
+   sport->saved_reg[5] = readl(sport->port.membase + UESC);
+   sport->saved_reg[6] = readl(sport->port.membase + UTIM);
+   sport->saved_reg[7] = readl(sport->port.membase + UBIR);
+   sport->saved_reg[8] = readl(sport->port.membase + UBMR);
+   sport->saved_reg[9] = readl(sport->port.membase + IMX21_UTS);
+   sport->context_saved = true;
+}
+
 static void serial_imx_enable_wakeup(struct imx_port *sport, bool on)
 {
unsigned int val;
@@ -2001,17 +2036,7 @@ static int imx_serial_port_suspend_noirq(struct device 
*dev)
if (ret)
return ret;
 
-   /* Save necessary regs */
-   sport->saved_reg[0] = readl(sport->port.membase + UCR1);
-   sport->saved_reg[1] = readl(sport->port.membase + UCR2);
-   sport->saved_reg[2] = readl(sport->port.membase + UCR3);
-   sport->saved_reg[3] = readl(sport->port.membase + UCR4);
-   sport->saved_reg[4] = readl(sport->port.membase + UFCR);
-   sport->saved_reg[5] = readl(sport->port.membase + UESC);
-   sport->saved_reg[6] = readl(sport->port.membase + UTIM);
-   sport->saved_reg[7] = readl(sport->port.membase + UBIR);
-   sport->saved_reg[8] = readl(sport->port.membase + UBMR);
-   sport->saved_reg[9] = readl(sport->port.membase + IMX21_UTS);
+   serial_imx_save_context(sport);
 
clk_disable(sport->clk_ipg);
 
@@ -2028,16 +2053,7 @@ static int imx_serial_port_resume_noirq(struct device 
*dev)
if (ret)
return ret;
 
-   writel(sport->saved_reg[4], sport->port.membase + UFCR);
-   writel(sport->saved_reg[5], sport->port.membase + UESC);
-   writel(sport->saved_reg[6], sport->port.membase + UTIM);
-   writel(sport->saved_reg[7], sport->port.membase + UBIR);
-   writel(sport->saved_reg[8], sport->port.membase + UBMR);
-   writel(sport->saved_reg[9], sport->port.membase + IMX21_UTS);
-   writel(sport->saved_reg[0], sport->port.membase + UCR1);
-   writel(sport->saved_reg[1] | UCR2_SRST, sport->port.membase + UCR2);
-   writel(sport->saved_reg[2], sport->port.membase + UCR3);
-   writel(sport->saved_reg[3], sport->port.membase + UCR4);
+   serial_imx_restore_context(sport);
 
clk_disable(sport->clk_ipg);
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 7/8] serial: imx: add pm_qos request

2015-08-10 Thread Eduardo Valentin
This change introduces pm_qos requests in the imx serial driver.
The idea is to skip deeper C-state in case we need a strict
latency requirement in the uart port. The latency is
computed based on the buffer size and the current baud rate.
We schedule a work queue to set the pm qos requirement.

Cc: Fabio Estevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 25 +
 1 file changed, 25 insertions(+)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 7d97a26..5053c82 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -223,6 +224,10 @@ struct imx_port {
boolcontext_saved;
 
struct device   *dev;
+   struct pm_qos_request   pm_qos_request;
+   u32 latency;
+   u32 calc_latency;
+   struct work_struct  qos_work;
boolis_suspending;
 };
 
@@ -1321,6 +1326,14 @@ static void imx_flush_buffer(struct uart_port *port)
pm_runtime_put_autosuspend(sport->dev);
 }
 
+static void serial_imx_uart_qos_work(struct work_struct *work)
+{
+   struct imx_port *sport = container_of(work, struct imx_port,
+   qos_work);
+
+   pm_qos_update_request(>pm_qos_request, sport->latency);
+}
+
 static void
 imx_set_termios(struct uart_port *port, struct ktermios *termios,
   struct ktermios *old)
@@ -1394,6 +1407,12 @@ imx_set_termios(struct uart_port *port, struct ktermios 
*termios,
baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
quot = uart_get_divisor(port, baud);
 
+   /* calculate wakeup latency constraint */
+   sport->calc_latency = (USEC_PER_SEC * sport->port.fifosize) /
+   (baud / 8);
+   sport->latency = sport->calc_latency;
+   schedule_work(>qos_work);
+
spin_lock_irqsave(>port.lock, flags);
 
sport->port.read_status_mask = 0;
@@ -2011,7 +2030,12 @@ static int serial_imx_probe(struct platform_device *pdev)
 
imx_ports[sport->port.line] = sport;
 
+   sport->latency = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
+   sport->calc_latency = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE;
sport->dev = >dev;
+   pm_qos_add_request(>pm_qos_request, PM_QOS_CPU_DMA_LATENCY,
+  sport->latency);
+   INIT_WORK(>qos_work, serial_imx_uart_qos_work);
platform_set_drvdata(pdev, sport);
 
device_init_wakeup(sport->dev, true);
@@ -2041,6 +2065,7 @@ static int serial_imx_remove(struct platform_device *pdev)
clk_unprepare(sport->clk_per);
clk_unprepare(sport->clk_ipg);
ret = uart_remove_one_port(_reg, >port);
+   pm_qos_remove_request(>pm_qos_request);
device_init_wakeup(>dev, false);
 
return ret;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 3/8] serial: imx: allow waking up on RTSD

2015-08-10 Thread Eduardo Valentin
This patch sets RTSDEN bit when going into idle (Stop mode).
We add the RTSDEN for the case RTS is sent from
the remote connection. This way we allow the system
to wakeup when RTS is received.

Cc: Fabio Stevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3c2b0ac..167dea1 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1982,6 +1982,13 @@ static void serial_imx_enable_wakeup(struct imx_port 
*sport, bool on)
else
val &= ~UCR3_AWAKEN;
writel(val, sport->port.membase + UCR3);
+
+   val = readl(sport->port.membase + UCR1);
+   if (on)
+   val |= UCR1_RTSDEN;
+   else
+   val &= ~UCR1_RTSDEN;
+   writel(val, sport->port.membase + UCR1);
 }
 
 static int imx_serial_port_suspend_noirq(struct device *dev)
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 6/8] serial: imx: add runtime pm support

2015-08-10 Thread Eduardo Valentin
This change introduces the runtime pm support on imx serial
driver. The objective is to be able to idle the uart
port whenever it is not in use while still being able
to wake it up when needed. The key changes in this patch are:
1. Move the clock handling to runtime pm. Both, ipg and per,
are now handled in the suspend and resume callbacks. Only
enabling and disabling the clocks are handled in runtime
suspend and resume, so we are able to use runtime pm
in IRQ context.
2. Clocks are prepared in probe and unprepared in remove,
so we do not need to prepare (may sleep) in runtime pm.
3. We mark the device activity based on uart and console
callbacks. Whenever the device is needed and we want to
access registers, we runtime_pm_get and then mark its
last usage when we are done. This is done also across
IRQs and DMA callbacks.
4. We reuse the infrastructure in place for suspend and
resume, so we do not need to redo wakeup configuration,
or context save and restore.

After this change, the clocks are still sane, in the sense
of having balanced clock prepare and enable.

Cc: Fabio Estevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 212 +--
 1 file changed, 166 insertions(+), 46 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 50abb60..7d97a26 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -39,6 +39,9 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -219,6 +222,7 @@ struct imx_port {
unsigned intsaved_reg[10];
boolcontext_saved;
 
+   struct device   *dev;
boolis_suspending;
 };
 
@@ -369,6 +373,7 @@ static void imx_stop_tx(struct uart_port *port)
if (sport->dma_is_enabled && sport->dma_is_txing)
return;
 
+   pm_runtime_get_sync(sport->dev);
temp = readl(port->membase + UCR1);
writel(temp & ~UCR1_TXMPTYEN, port->membase + UCR1);
 
@@ -386,6 +391,8 @@ static void imx_stop_tx(struct uart_port *port)
temp &= ~UCR4_TCEN;
writel(temp, port->membase + UCR4);
}
+   pm_runtime_mark_last_busy(sport->dev);
+   pm_runtime_put_autosuspend(sport->dev);
 }
 
 /*
@@ -405,12 +412,15 @@ static void imx_stop_rx(struct uart_port *port)
}
}
 
+   pm_runtime_get_sync(sport->dev);
temp = readl(sport->port.membase + UCR2);
writel(temp & ~UCR2_RXEN, sport->port.membase + UCR2);
 
/* disable the `Receiver Ready Interrrupt` */
temp = readl(sport->port.membase + UCR1);
writel(temp & ~UCR1_RRDYEN, sport->port.membase + UCR1);
+   pm_runtime_mark_last_busy(sport->dev);
+   pm_runtime_put_autosuspend(sport->dev);
 }
 
 /*
@@ -482,6 +492,7 @@ static void dma_tx_callback(void *data)
unsigned long flags;
unsigned long temp;
 
+   pm_runtime_get_sync(sport->dev);
spin_lock_irqsave(>port.lock, flags);
 
dma_unmap_sg(sport->port.dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE);
@@ -506,13 +517,17 @@ static void dma_tx_callback(void *data)
if (waitqueue_active(>dma_wait)) {
wake_up(>dma_wait);
dev_dbg(sport->port.dev, "exit in %s.\n", __func__);
-   return;
+   goto mark_last;
}
 
spin_lock_irqsave(>port.lock, flags);
if (!uart_circ_empty(xmit) && !uart_tx_stopped(>port))
imx_dma_tx(sport);
spin_unlock_irqrestore(>port.lock, flags);
+
+mark_last:
+   pm_runtime_mark_last_busy(sport->dev);
+   pm_runtime_put_autosuspend(sport->dev);
 }
 
 static void imx_dma_tx(struct imx_port *sport)
@@ -579,6 +594,7 @@ static void imx_start_tx(struct uart_port *port)
struct imx_port *sport = (struct imx_port *)port;
unsigned long temp;
 
+   pm_runtime_get_sync(sport->dev);
if (port->rs485.flags & SER_RS485_ENABLED) {
/* enable transmitter and shifter empty irq */
temp = readl(port->membase + UCR2);
@@ -606,14 +622,18 @@ static void imx_start_tx(struct uart_port *port)
temp &= ~UCR1_TDMAEN;
temp |= UCR1_TXMPTYEN;
writel(temp, sport->port.membase + UCR1);
-   return;
+   goto mark_last;
}
 
if (!uart_circ_empty(>state->xmit) &&
!uart_tx_stopped(port))
imx_dma_tx(sport);
-   return;
+   goto mark_last;
}
+
+mark_last:
+   pm_runtime_mark_last_busy(sport->dev);
+   pm_runtime_put_autosuspend(sport->dev);
 }
 
 static irqreturn_t imx_rtsint(int irq, void *dev_id)
@@ -622,6 +642,7 @@ static irqreturn_t 

[PATCHv2 8/8] serial: imx: use SET_*SYSTEM_PM_OPS helper functions

2015-08-10 Thread Eduardo Valentin
Instead of setting manually each field, use the helper functions
provided by the PM subsystem.

Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 5053c82..8cd7e63 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2250,10 +2250,10 @@ static int imx_serial_port_resume(struct device *dev)
 static const struct dev_pm_ops imx_serial_port_pm_ops = {
SET_RUNTIME_PM_OPS(serial_imx_runtime_suspend,
   serial_imx_runtime_resume, NULL)
-   .suspend_noirq = imx_serial_port_suspend_noirq,
-   .resume_noirq = imx_serial_port_resume_noirq,
-   .suspend = imx_serial_port_suspend,
-   .resume = imx_serial_port_resume,
+   SET_SYSTEM_SLEEP_PM_OPS(imx_serial_port_suspend_noirq,
+   imx_serial_port_resume_noirq)
+   SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_serial_port_suspend,
+ imx_serial_port_resume)
.prepare = serial_imx_prepare,
.complete = serial_imx_complete,
 };
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCHv2 1/8] serial: imx: remove unbalanced clk_prepare

2015-08-10 Thread Eduardo Valentin
The current code attempts to prepare clk_per and clk_ipg
before using the device. However, the result is an extra
prepare call on each clock. Here is the output of uart
clocks (only uart enabled and used as console):

$  grep uart /sys/kernel/debug/clk/clk_summary
 uart_serial   128000  0 0
   uart   126600  0 0

This patch balances the calls of prepares. The result is:

$  grep uart /sys/kernel/debug/clk/clk_summary
 uart_serial   118000  0 0
   uart   116600  0 0

Cc: Fabio Estevam 
Cc: Greg Kroah-Hartman 
Cc: Jiri Slaby 
Cc: linux-ser...@vger.kernel.org
Cc: linux...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Eduardo Valentin 
---
 drivers/tty/serial/imx.c | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 9a248eb..b27c232 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1630,12 +1630,12 @@ imx_console_write(struct console *co, const char *s, 
unsigned int count)
int locked = 1;
int retval;
 
-   retval = clk_enable(sport->clk_per);
+   retval = clk_prepare_enable(sport->clk_per);
if (retval)
return;
-   retval = clk_enable(sport->clk_ipg);
+   retval = clk_prepare_enable(sport->clk_ipg);
if (retval) {
-   clk_disable(sport->clk_per);
+   clk_disable_unprepare(sport->clk_per);
return;
}
 
@@ -1674,8 +1674,8 @@ imx_console_write(struct console *co, const char *s, 
unsigned int count)
if (locked)
spin_unlock_irqrestore(>port.lock, flags);
 
-   clk_disable(sport->clk_ipg);
-   clk_disable(sport->clk_per);
+   clk_disable_unprepare(sport->clk_ipg);
+   clk_disable_unprepare(sport->clk_per);
 }
 
 /*
@@ -1776,15 +1776,7 @@ imx_console_setup(struct console *co, char *options)
 
retval = uart_set_options(>port, co, baud, parity, bits, flow);
 
-   clk_disable(sport->clk_ipg);
-   if (retval) {
-   clk_unprepare(sport->clk_ipg);
-   goto error_console;
-   }
-
-   retval = clk_prepare(sport->clk_per);
-   if (retval)
-   clk_disable_unprepare(sport->clk_ipg);
+   clk_disable_unprepare(sport->clk_ipg);
 
 error_console:
return retval;
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH net] netconsole: Check for carrier before calling netpoll_send_udp()

2015-08-10 Thread Jon Maxwell
We have seen a few crashes recently where a NIC is getting
reset for some reason and then the driver or another module calls
printk() which invokes netconsole. Netconsole then calls the
adapter specific poll routine via netpoll which crashes because 
the adapter is resetting and its structures are being reinitialized.

So far we have seen this happen with ixgbe and vmxnet3 drivers.
The back trace from the ixgbe crash example looks like this:

#8 [] page_fault at
#9 [] ixgbe_clean_rx_irq at  [ixgbe] <--- crash here
#10 [] ixgbe_poll at  [ixgbe]
#11 [] netpoll_poll_dev at 
#12 [] netpoll_send_skb_on_dev at 
#13 [] netpoll_send_udp at 
#14 [] write_msg at  [netconsole]
#15 [] __call_console_drivers at 
#16 [] _call_console_drivers at 
#17 [] release_console_sem at 
#18 [] vprintk at 
#19 [] printk at 
#20 [] __dev_printk at 
#21 [] _dev_info at 
#22 [] ixgbe_init_interrupt_scheme at  [ixgbe]
#23 [] ixgbe_dcbnl_devreset at  [ixgbe]
#24 [] ixgbe_dcbnl_set_all at  [ixgbe]
#25 [] ixgbe_dcbnl_setdcbx at  [ixgbe]
#26 [] dcb_doit at 
#27 [] rtnetlink_rcv_msg at 
#28 [] netlink_rcv_skb at 
#29 [] rtnetlink_rcv at 
#30 [] netlink_unicast at 
#31 [] netlink_sendmsg at 
#32 [] sock_sendmsg at 
#33 [] sys_sendto at 
#34 [] system_call_fastpath at 

I could reproduce this using an ixgbe NIC. 

I verified that the proposed fix works. It checks that carrier is 
asserted before calling netpoll_send_udp(). Therefore if the adapter
is resetting netconsole does not call the netpoll routines and the 
crash is avoided. When the adapter is back online and carrier is 
reasserted netconsole will succeed again.

Signed-off-by: Jon Maxwell 
---
 drivers/net/netconsole.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ba2f5e7..f760463 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -744,7 +744,8 @@ static void write_msg(struct console *con, const char *msg, 
unsigned int len)
spin_lock_irqsave(_list_lock, flags);
list_for_each_entry(nt, _list, list) {
netconsole_target_get(nt);
-   if (nt->enabled && netif_running(nt->np.dev)) {
+   if (nt->enabled && netif_running(nt->np.dev) &&
+   netif_carrier_ok(nt->np.dev)) {
/*
 * We nest this inside the for-each-target loop above
 * so that we're able to get as much logging out to
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Question] lockdep: Is nested lock handled correctly?

2015-08-10 Thread Boqun Feng
Hi Peter,

On Mon, Aug 10, 2015 at 04:24:17PM +0200, Peter Zijlstra wrote:
> On Mon, Aug 10, 2015 at 09:49:24PM +0800, Boqun Feng wrote:



> > Though I don't want to have a locking order like that either, we can't
> > stop others from using that order(maybe a good design review will) and
> > lockdep yells something -unrelated- in such an order.
> > 
> > I think we can either let lockdep complain if some one uses this
> > locking order or clean up current code a little bit to tolarent this.
> > 
> > If you really think we should do something about it, I can write the
> > patch and add test cases.
> 
> 
> Maybe something like the below in __lock_acquire():
> 
>   /* Daft bugger, can't guard a nesting order with the same lock class */
>   if (DEBUG_LOCKS_WARN_ON(lock == nest_lock))
>   return 0;
> 
> ?

I may not understand this well.. but I think this may not detect the
problem. The problem is:

A correct nesting order get disturbed by other locks acquired before the
nested lock acquired and release before the nested, which makes two
held_lock structures merged during __lock_acquire().


I think we can detect this in __lock_release():

diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
index 8acfbf7..e75f622 100644
--- a/kernel/locking/lockdep.c
+++ b/kernel/locking/lockdep.c
@@ -3427,6 +3427,19 @@ found_it:
curr->lockdep_depth = i;
curr->curr_chain_key = hlock->prev_chain_key;
 
+   /*
+* We are going to "reacquire" the rest of stack, but we find out
+* __lock_acquire() will merge the next hlock into prev_hlock,
+* which means this is not a good time to release this lock and lock
+* users might need to reconsider the locking design.
+*/
+   if (prev_hlock && (i+1) < depth) {
+   hlock = curr->held_locks + i + 1;
+   if (DEBUG_LOCKS_WARN_ON(hlock->nest_lock &&
+   hlock->class_idx == prev_hlock->class_idx))
+   return 0;
+   }
+
for (i++; i < depth; i++) {
hlock = curr->held_locks + i;
if (!__lock_acquire(hlock->instance,


Regards,
Boqun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] mmc: sdhci-of-arasan: Add the support for sdhci-5.1

2015-08-10 Thread Shawn Lin

On 2015/8/11 9:14, Shawn Lin wrote:

This patch adds the quirks and compatible string in sdhci-of-arasan.c
to support sdhci-arasan5.1 version of controller.



Sorry for wrong send-email ops, pls ignore this patch :(


Signed-off-by: Shawn Lin 
---

  Documentation/devicetree/bindings/mmc/arasan,sdhci.txt | 2 +-
  drivers/mmc/host/sdhci-of-arasan.c | 4 
  2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt 
b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
index 7e94903..da541c3 100644
--- a/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
+++ b/Documentation/devicetree/bindings/mmc/arasan,sdhci.txt
@@ -9,7 +9,7 @@ Device Tree Bindings for the Arasan SDHCI Controller

  Required Properties:
- compatible: Compatibility string. Must be 'arasan,sdhci-8.9a' or
-'arasan,sdhci-4.9a'
+'arasan,sdhci-4.9a' or 'arasan,sdhci-5.1'
- reg: From mmc bindings: Register location and length.
- clocks: From clock bindings: Handles to clock inputs.
- clock-names: From clock bindings: Tuple including "clk_xin" and "clk_ahb"
diff --git a/drivers/mmc/host/sdhci-of-arasan.c 
b/drivers/mmc/host/sdhci-of-arasan.c
index ef5a7d2..c9012f5 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -175,6 +175,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
if (of_device_is_compatible(pdev->dev.of_node, "arasan,sdhci-4.9a")) {
host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
host->quirks2 |= SDHCI_QUIRK2_HOST_NO_CMD23;
+   } else if (of_device_is_compatible(pdev->dev.of_node,
+  "arasan,sdhci-5.1")) {
+   host->quirks |= SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
}

sdhci_get_of_property(pdev);
@@ -217,6 +220,7 @@ static int sdhci_arasan_remove(struct platform_device *pdev)

  static const struct of_device_id sdhci_arasan_of_match[] = {
{ .compatible = "arasan,sdhci-8.9a" },
+   { .compatible = "arasan,sdhci-5.1" },
{ .compatible = "arasan,sdhci-4.9a" },
{ }
  };




--
Shawn Lin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/2] f2fs: increase the number of max hard links

2015-08-10 Thread Jaegeuk Kim
This patch increases the number of maximum hard links for one file.

Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/f2fs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 3884794..f18d31e 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -321,7 +321,7 @@ enum {
 */
 };
 
-#define F2FS_LINK_MAX  32000   /* maximum link count per file */
+#define F2FS_LINK_MAX  65536   /* maximum link count per file */
 
 #define MAX_DIR_RA_PAGES   4   /* maximum ra pages of dir */
 
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments

2015-08-10 Thread Jaegeuk Kim
We should avoid wrong checkpoints when there is no dirty segments.

Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/gc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index fcb263a..c4ed116 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -809,13 +809,14 @@ gc_more:
if (unlikely(f2fs_cp_error(sbi)))
goto stop;
 
+   if (!__get_victim(sbi, , gc_type))
+   goto stop;
+
if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
gc_type = FG_GC;
write_checkpoint(sbi, );
}
 
-   if (!__get_victim(sbi, , gc_type))
-   goto stop;
ret = 0;
 
/* readahead multi ssa blocks those have contiguous address */
-- 
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   4   5   6   7   8   9   10   >