[x86/mm/pat, drivers/media/ivtv] WARNING: CPU: 0 PID: 1 at drivers/media/pci/ivtv/ivtvfb.c:1270 ivtvfb_init()

2015-06-20 Thread Fengguang Wu
Greetings,

0day kernel testing robot got the below dmesg and the first bad commit is

git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master

commit 1bf1735b478008c30acaff18ec6f4a3ff211c28a
Author: Luis R. Rodriguez 
AuthorDate: Mon Jun 15 10:28:16 2015 +0200
Commit: Ingo Molnar 
CommitDate: Thu Jun 18 11:23:41 2015 +0200

x86/mm/pat, drivers/media/ivtv: Use arch_phys_wc_add() and require PAT 
disabled

We are burrying direct access to MTRR code support on
x86 in order to take advantage of PAT. In the future, we
also want to make the default behavior of ioremap_nocache()
to use strong UC, at which point the use of mtrr_add() on
those systems would make write-combining void.

In order to help both enable us to later make strong
UC default and in order to phase out direct MTRR access
code, port the driver over to the arch_phys_wc_add() API
and annotate that the device driver requires systems to
boot with PAT disabled, with the 'nopat' kernel parameter.

This is a workable compromise given that the hardware is
really rare these days, and perhaps only some lost souls
stuck with obsolete hardware are expected to be using this
feature of the device driver.

Signed-off-by: Luis R. Rodriguez 
Signed-off-by: Borislav Petkov 
Acked-by: Andy Walls 
Acked-by: Mauro Carvalho Chehab 
Cc: Andrew Morton 
Cc: Andy Lutomirski 
Cc: Antonino Daplas 
Cc: Arnd Bergmann 
Cc: Borislav Petkov 
Cc: Brian Gerst 
Cc: Daniel Vetter 
Cc: Dave Airlie 
Cc: Dave Hansen 
Cc: Denys Vlasenko 
Cc: Doug Ledford 
Cc: H. Peter Anvin 
Cc: Jean-Christophe Plagniol-Villard 
Cc: Juergen Gross 
Cc: Linus Torvalds 
Cc: Michael S. Tsirkin 
Cc: Oleg Nesterov 
Cc: Peter Zijlstra 
Cc: Roger Pau Monné 
Cc: Stefan Bader 
Cc: Suresh Siddha 
Cc: Thomas Gleixner 
Cc: Ville Syrjälä 
Cc: bhelg...@google.com
Cc: konrad.w...@oracle.com
Cc: linux-me...@vger.kernel.org
Cc: tomi.valkei...@ti.com
Cc: toshi.k...@hp.com
Link: 
http://lkml.kernel.org/r/1434053994-2196-2-git-send-email-mcg...@do-not-panic.com
Signed-off-by: Ingo Molnar 

+---+++-+
|   | 957561ec0f | 
1bf1735b47 | v4.1-rc8_061911 |
+---+++-+
| boot_successes| 63 | 0
  | 0   |
| boot_failures | 0  | 22   
  | 13  |
| WARNING:at_drivers/media/pci/ivtv/ivtvfb.c:#ivtvfb_init() | 0  | 22   
  | 13  |
| backtrace:ivtvfb_init | 0  | 22   
  | 13  |
| backtrace:warn_slowpath_fmt   | 0  | 22   
  | 13  |
| backtrace:kernel_init_freeable| 0  | 22   
  | 13  |
+---+++-+

[   12.956506] ivtv: Start initialization, version 1.4.3
[   12.958238] ivtv: End initialization
[   12.959438] [ cut here ]
[   12.974076] WARNING: CPU: 0 PID: 1 at drivers/media/pci/ivtv/ivtvfb.c:1270 
ivtvfb_init+0x32/0xa3()
[   12.978017] ivtvfb needs PAT disabled, boot with nopat kernel parameter
[   12.980628] CPU: 0 PID: 1 Comm: swapper Not tainted 4.1.0-rc5-00034-g1bf1735 
#2
[   12.995566] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 
1.7.5-20140531_083030-gandalf 04/01/2014
[   12.999061]  8d429cc8 880010c5bdc8 8cf47a88 
880010c5be08
[   13.001954]  8c68e6d5 8d977327 8d9c6910 
88139ef8
[   13.004862]   8d977327  
880010c5be68
[   13.007636] Call Trace:
[   13.008469]  [] dump_stack+0x19/0x1b
[   13.010185]  [] warn_slowpath_common+0x75/0xb0
[   13.024843]  [] ? module_start+0xa4/0xa4
[   13.026876]  [] ? module_start+0xa4/0xa4
[   13.029041]  [] warn_slowpath_fmt+0x41/0x50
[   13.031312]  [] ivtvfb_init+0x32/0xa3
[   13.033362]  [] do_one_initcall+0x19a/0x1ae
[   13.035444]  [] kernel_init_freeable+0x11a/0x1a2
[   13.037434]  [] ? rest_init+0xc0/0xc0
[   13.051468]  [] kernel_init+0x9/0xf0
[   13.053252]  [] ret_from_fork+0x42/0x70
[   13.055149]  [] ? rest_init+0xc0/0xc0
[   13.057090] ---[ end trace 4c8a37b47d22b2c8 ]---
[   13.058748] Zoran MJPEG board driver version 0.10.1

git bisect start 1e5a271153487afd411894cfcbebed348c56e251 
0f57d86787d8b1076ea8f9cba2a46d534a27 --
git bisect good cfe18bb129d434b5229366eef876f076e9143bf4  # 16:20 22+  
0  Merge 'pm/bleeding-edge' into devel-hourly-20150619

Re: [PATCH 6/8] Staging: sm750fb: ddk750_sii164.c: Place braces on previous lines

2015-06-20 Thread Sudip Mukherjee
On Fri, Jun 19, 2015 at 12:48:19PM -0700, Isaac Assegai wrote:
> Place braces on previous lines in ddk750_sii164.c to
> rectify the following checkpatch errors:
> ERROR: that open brace { should be on the previous line
> 
> Signed-off-by: Isaac Assegai 
> ---
>  drivers/staging/sm750fb/ddk750_sii164.c | 16 +---
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
> b/drivers/staging/sm750fb/ddk750_sii164.c
> index 7f58fbe..64d4291 100644
> --- a/drivers/staging/sm750fb/ddk750_sii164.c
> +++ b/drivers/staging/sm750fb/ddk750_sii164.c
> @@ -136,8 +136,7 @@ long sii164InitChip(
>  #endif
>  
>   /* Check if SII164 Chip exists */
> - if ((sii164GetVendorID() == SII164_VENDOR_ID) && (sii164GetDeviceID() 
> == SII164_DEVICE_ID))
> - {
> + if ((sii164GetVendorID() == SII164_VENDOR_ID) && (sii164GetDeviceID() 
> == SII164_DEVICE_ID) {


you have not build tested it :(
In function ‘sii164InitChip’:
error: expected ‘)’ before ‘{’ token

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.10 14/46] d_walk() might skip too much

2015-06-20 Thread Jari Ruusu
On 6/19/15, Greg Kroah-Hartman  wrote:
> I would much rather just include the "real" upstream patches, instead of
> an odd backport.
>
> Jari, can you just backport the above referenced patches instead and
> provide those backports?

I won't do that, sorry. It is more complicated than you think. It would
involve backporting more VFS-re-write-patch-bombs than would be acceptable
to stable kernel branch. Above mentioned d_walk() function that Al Viro
modified in mainline don't even exist in 3.10.y and older brances.

My understanding is that complete backport of above mentioned "deal with
deadlock in d_walk()" and "d_walk() might skip too much" patches to 3.10.y
branch is to apply all these patches:

(a) backport of "deal with deadlock in d_walk()", by Ben Hutchings
(b) dcache: Fix locking bugs in backported "deal with deadlock in d_walk()"
(c) Al Viro's "d_walk() might skip too much" applied THREE times.

Of those, you merged (a) and (b) to 3.10.76 stable, and one copy of (c) to
3.10.80 stable.

The problem is that you didn't realize that "deal with deadlock in d_walk()"
was applied to three different places in Ben Hutchings' backport, and that
latest Al Viro's fix had to be also applied to three different places.
Considering the sh*t that you have to deal with, nobody is blaming you for
that mistake.

I am asking that you apply Al Viro's original "d_walk() might skip too much"
patch TWO more times to 3.10.y stable branch. On both times, your patch tool
will find the correct place of source file to modify, but with different
offsets each time.

-- 
Jari Ruusu  4096R/8132F189 12D6 4C3A DCDA 0AA4 27BD  ACDF F073 3C80 8132 F189
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH RESEND] phy: tusb1210: Use devm_gpiod_get_optional for optional GPIOs

2015-06-20 Thread Axel Lin
Also simplify the code a bit by specify direction and initial value for
output in devm_gpiod_get_optional function.

Signed-off-by: Axel Lin 
Acked-by: Heikki Krogerus 
Acked-by: Kishon Vijay Abraham I 
---
Hi
This patch was sent on https://lkml.org/lkml/2015/5/31/221 with ACKs.
It's still not in linux-next, so here is a resend.

 drivers/phy/phy-tusb1210.c | 28 ++--
 1 file changed, 10 insertions(+), 18 deletions(-)

diff --git a/drivers/phy/phy-tusb1210.c b/drivers/phy/phy-tusb1210.c
index 07efdd3..e0174da 100644
--- a/drivers/phy/phy-tusb1210.c
+++ b/drivers/phy/phy-tusb1210.c
@@ -61,32 +61,24 @@ static struct phy_ops phy_ops = {
 
 static int tusb1210_probe(struct ulpi *ulpi)
 {
-   struct gpio_desc *gpio;
struct tusb1210 *tusb;
u8 val, reg;
-   int ret;
 
tusb = devm_kzalloc(&ulpi->dev, sizeof(*tusb), GFP_KERNEL);
if (!tusb)
return -ENOMEM;
 
-   gpio = devm_gpiod_get(&ulpi->dev, "reset");
-   if (!IS_ERR(gpio)) {
-   ret = gpiod_direction_output(gpio, 0);
-   if (ret)
-   return ret;
-   gpiod_set_value_cansleep(gpio, 1);
-   tusb->gpio_reset = gpio;
-   }
+   tusb->gpio_reset = devm_gpiod_get_optional(&ulpi->dev, "reset",
+  GPIOD_OUT_LOW);
+   if (IS_ERR(tusb->gpio_reset))
+   return PTR_ERR(tusb->gpio_reset);
+   gpiod_set_value_cansleep(tusb->gpio_reset, 1);
 
-   gpio = devm_gpiod_get(&ulpi->dev, "cs");
-   if (!IS_ERR(gpio)) {
-   ret = gpiod_direction_output(gpio, 0);
-   if (ret)
-   return ret;
-   gpiod_set_value_cansleep(gpio, 1);
-   tusb->gpio_cs = gpio;
-   }
+   tusb->gpio_cs = devm_gpiod_get_optional(&ulpi->dev, "cs",
+   GPIOD_OUT_LOW);
+   if (IS_ERR(tusb->gpio_cs))
+   return PTR_ERR(tusb->gpio_cs);
+   gpiod_set_value_cansleep(tusb->gpio_cs, 1);
 
/*
 * VENDOR_SPECIFIC2 register in TUSB1210 can be used for configuring eye
-- 
2.1.0



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] staging: sm750fb: use tabs for indentation

2015-06-20 Thread Sudip Mukherjee
On Fri, Jun 19, 2015 at 10:50:57PM -0700, Juston Li wrote:
> Replace spaces with tabs for indentation to fix the checkpatch.pl warning
> 'WARNING: please, no spaces at the start of a line'
> 
> checkpatch doesn't catch comments indented by spaces but I fixed comments
> adjacent to warnings as well so they would remain aligned.
> 
> Signed-off-by: Juston Li 
> ---

> diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
> b/drivers/staging/sm750fb/ddk750_hwi2c.c
> index 7826376..23d6e19 100644
> --- a/drivers/staging/sm750fb/ddk750_hwi2c.c
> +++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
> @@ -9,71 +9,69 @@
>  #define HWI2C_WAIT_TIMEOUT  0xF
>  
>  
> -int hwI2CInit(
> -unsigned char busSpeedMode
> -)
> +int hwI2CInit(unsigned char busSpeedMode)
but this is what you say in commit message. Please only do one type of
change in a single patch.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: ACPI regression? Was Re: Ethernet chip disappeared from lspci

2015-06-20 Thread Andreas Mohr
Hi,

[lkml.org still broken --> no accurate mail header info possible...]

Just to ask the obvious:
I assume using /sys/bus/pci/rescan does not help once it's broken?
(since the machine comes up empty at initial-boot scan, too)


Also, you could try diffing lspci -vvxxx -s output
of working vs. "distorting" kernel version - perhaps some register setup
has been changed (e.g. due to power management improvements or some such),
which may encourage the card
to get a problematic/corrupt state.

> Upon powering off the system,
> the r8169 driver compained about "rtl_eriar_cond = 1 loop 100"

Yup, that seems to be
rtl_eri_read() in ethernet/realtek/r8169.c
waiting on low condition of
RTL_R32(ERIAR) & ERIAR_FLAG;

Andreas Mohr
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4.0 000/105] 4.0.6-stable review

2015-06-20 Thread Sudip Mukherjee
On Fri, Jun 19, 2015 at 01:34:50PM -0700, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.0.6 release.
> There are 105 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Sun Jun 21 20:35:34 UTC 2015.
> Anything received after that time might be too late.
Compiled and booted on x86_32.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.14 00/44] 3.14.45-stable review

2015-06-20 Thread Sudip Mukherjee
On Fri, Jun 19, 2015 at 01:35:59PM -0700, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.14.45 release.
> There are 44 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Sun Jun 21 20:35:40 UTC 2015.
> Anything received after that time might be too late.
Compiled and booted on x86_32.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.10 00/29] 3.10.81-stable review

2015-06-20 Thread Sudip Mukherjee
On Fri, Jun 19, 2015 at 01:36:20PM -0700, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 3.10.81 release.
> There are 29 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Sun Jun 21 20:35:45 UTC 2015.
> Anything received after that time might be too late.
Compiled and booted on x86_32.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq()

2015-06-20 Thread Thomas Gleixner
On Sat, 20 Jun 2015, Sergey Senozhatsky wrote:

> On (06/19/15 14:21), Thomas Gleixner wrote:
> [..]
> > Can you please collect the output of /proc/timer_list for the previous
> > patch and then replace the previous patch with the one below and
> > gather all the data again?
> > 
> 
> attached.

Can you please send me the dmesg of the second patch as well?

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq()

2015-06-20 Thread Sergey Senozhatsky
On (06/20/15 09:52), Thomas Gleixner wrote:
[..]
> 
> Can you please send me the dmesg of the second patch as well?
> 

I'm sorry, what second patch?

-ss
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC -v2] panic_on_oom_timeout

2015-06-20 Thread Tetsuo Handa
Tetsuo Handa wrote:
> One case is that the system can not panic of threads are unable to call
> out_of_memory() for some reason.
^ if

> Well, if without analysis purpose,
> 
>   if (time_after(jiffies, oom_start + sysctl_panic_on_oom_timeout * HZ))
> panic();
> 
> (that is, pass the jiffies as of calling out_of_memory() for the first time
> of this memory allocation request as an argument to out_of_memory(), and
> compare at check_panic_on_oom()) is sufficient? Very simple implementation
> because we do not use mod_timer()/del_timer().

Here is an untested patch.

diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index b5b4278..4c64b92 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -355,7 +355,7 @@ static void moom_callback(struct work_struct *ignored)
 {
mutex_lock(&oom_lock);
if (!out_of_memory(node_zonelist(first_memory_node, GFP_KERNEL),
-  GFP_KERNEL, 0, NULL, true))
+  GFP_KERNEL, 0, NULL, true, NULL))
pr_info("OOM request ignored because killer is disabled\n");
mutex_unlock(&oom_lock);
 }
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 7deecb7..75525e9 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -64,14 +64,16 @@ extern void oom_kill_process(struct task_struct *p, gfp_t 
gfp_mask, int order,
 
 extern void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
   int order, const nodemask_t *nodemask,
-  struct mem_cgroup *memcg);
+  struct mem_cgroup *memcg,
+  const unsigned long *oom_start);
 
 extern enum oom_scan_t oom_scan_process_thread(struct task_struct *task,
unsigned long totalpages, const nodemask_t *nodemask,
bool force_kill);
 
 extern bool out_of_memory(struct zonelist *zonelist, gfp_t gfp_mask,
-   int order, nodemask_t *mask, bool force_kill);
+ int order, nodemask_t *mask, bool force_kill,
+ const unsigned long *oom_start);
 
 extern void exit_oom_victim(void);
 
@@ -99,4 +101,5 @@ static inline bool task_will_free_mem(struct task_struct 
*task)
 extern int sysctl_oom_dump_tasks;
 extern int sysctl_oom_kill_allocating_task;
 extern int sysctl_panic_on_oom;
+extern int sysctl_panic_on_oom_timeout;
 #endif /* _INCLUDE_LINUX_OOM_H */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index c566b56..74a1b68 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -1162,6 +1162,14 @@ static struct ctl_table vm_table[] = {
.extra2 = &two,
},
{
+   .procname   = "panic_on_oom_timeout",
+   .data   = &sysctl_panic_on_oom_timeout,
+   .maxlen = sizeof(sysctl_panic_on_oom_timeout),
+   .mode   = 0644,
+   .proc_handler   = proc_dointvec_minmax,
+   .extra1 = &zero,
+   },
+   {
.procname   = "oom_kill_allocating_task",
.data   = &sysctl_oom_kill_allocating_task,
.maxlen = sizeof(sysctl_oom_kill_allocating_task),
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index acb93c5..ab1ae3e 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1563,7 +1563,8 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup 
*memcg, gfp_t gfp_mask,
goto unlock;
}
 
-   check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL, memcg);
+   check_panic_on_oom(CONSTRAINT_MEMCG, gfp_mask, order, NULL, memcg,
+  NULL);
totalpages = mem_cgroup_get_limit(memcg) ? : 1;
for_each_mem_cgroup_tree(iter, memcg) {
struct css_task_iter it;
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index dff991e..9d30f2e 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -40,6 +40,7 @@
 #include 
 
 int sysctl_panic_on_oom;
+int sysctl_panic_on_oom_timeout;
 int sysctl_oom_kill_allocating_task;
 int sysctl_oom_dump_tasks = 1;
 
@@ -602,7 +603,8 @@ void oom_kill_process(struct task_struct *p, gfp_t 
gfp_mask, int order,
  */
 void check_panic_on_oom(enum oom_constraint constraint, gfp_t gfp_mask,
int order, const nodemask_t *nodemask,
-   struct mem_cgroup *memcg)
+   struct mem_cgroup *memcg,
+   const unsigned long *oom_start)
 {
if (likely(!sysctl_panic_on_oom))
return;
@@ -614,6 +616,14 @@ void check_panic_on_oom(enum oom_constraint constraint, 
gfp_t gfp_mask,
 */
if (constraint != CONSTRAINT_NONE)
return;
+   /*
+* panic_on_oom_timeout only affects panic_on_oom == 1 and
+* CONSTRAINT_NONE.
+*/
+   if (sysctl_p

Re: [PATCH 4.0 000/105] 4.0.6-stable review

2015-06-20 Thread Heinz Diehl
On 19.06.2015, Greg Kroah-Hartman wrote: 

> This is the start of the stable review cycle for the 4.0.6 release.
> There are 105 patches in this series

Since a few -stable releases I'm missing this one (it's already in
mainline):

https://www.mail-archive.com/linux-crypto%40vger.kernel.org/msg14118.html

Thanks,
 Heinz
 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2] Changes to existing files for 0PF FPGA board.

2015-06-20 Thread Geert Uytterhoeven
Hi Rob,

On Sat, Jun 20, 2015 at 12:11 AM, Rob Landley  wrote:
> On 06/18/2015 02:36 PM, Geert Uytterhoeven wrote:
>> On Thu, Jun 18, 2015 at 7:19 PM, Rob Landley  wrote:
>>> Changes to existing files to add 0pf j2 board support.
>>
>> Thanks for your patch!
>>
>> Like Greg already said, splitting it up in logical parts and providing useful
>> patch descriptions would be highly appreciated.
>
> I actually don't know how to split it up further. The initial port was
> done by a series of contractors (in Russia, I think), and then I
> inherited it to try to get something releasable. This is the smallest
> chunk I could get to actually boot.
>
> I suppose I could send you the serial driver by itself, and _then_ the
> board, but it wouldn't compile if nothing uses it. (Similarly you can't
> boot the board without a serial console...)

You don't have to send in a big initial patch that actually boots.
For new architecture/SoC/board support, just split it in logical hunks,
and submit it in some logical order that always builds.

E.g.:
  - SoC core support (arch/sh/),
  - Board support (arch/sh/),
  - Drivers.

The first two should go in through akpm (sh is orphaned),
the rest through the individual subsystem maintainers.

> (Now the reason _I_ thought you'd reject it had more to do with not
> having converted it to device tree yet, and things on that level. But I

Sh is an existing supported architecture, so DT is not a hard requirement.
If you would have waited until after the removal of sh, it would be much
harder :-) (cfr. h8300, but Sato-san did a great job there, with DT, CCF, ...)

> wanted to get it out there so people outside $DAYJOB can test the
> hardware. We did a linuxcon japan presentation which lwn.net covered,
> and we're getting pokes about "where can I download this", so...)

It's great to hear there's so much interest in this! Let's hope this will
attract more actual contributors...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3] staging: sm750fb: use tabs for indentation

2015-06-20 Thread Juston Li
On Sat, Jun 20, 2015 at 12:43 AM, Sudip Mukherjee
 wrote:
> On Fri, Jun 19, 2015 at 10:50:57PM -0700, Juston Li wrote:
>> Replace spaces with tabs for indentation to fix the checkpatch.pl warning
>> 'WARNING: please, no spaces at the start of a line'
>>
>> checkpatch doesn't catch comments indented by spaces but I fixed comments
>> adjacent to warnings as well so they would remain aligned.
>>
>> Signed-off-by: Juston Li 
>> ---
> 
>> diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
>> b/drivers/staging/sm750fb/ddk750_hwi2c.c
>> index 7826376..23d6e19 100644
>> --- a/drivers/staging/sm750fb/ddk750_hwi2c.c
>> +++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
>> @@ -9,71 +9,69 @@
>>  #define HWI2C_WAIT_TIMEOUT  0xF
>>
>>
>> -int hwI2CInit(
>> -unsigned char busSpeedMode
>> -)
>> +int hwI2CInit(unsigned char busSpeedMode)
> but this is what you say in commit message. Please only do one type of
> change in a single patch.

Yeah, there were a couple of those changes I forgot to mention.
They were cases where there was nothing to align the lines to and it was
easier just to fix the overall code style.

It is a separate change so I'll remove the changes and resend.
I actually finished on several other  checkpatch.pl fix patches so
I'll just include this in a patchset.

Regards
Juston
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq()

2015-06-20 Thread Thomas Gleixner
On Sat, 20 Jun 2015, Sergey Senozhatsky wrote:

> On (06/20/15 09:52), Thomas Gleixner wrote:
> [..]
> > 
> > Can you please send me the dmesg of the second patch as well?
> > 
> 
> I'm sorry, what second patch?

The one which I forgot to append when I replied yesterday. Appended now.

Thanks,

tglx


diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index e2449cf38b06..c47aab35a17e 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -578,7 +578,7 @@ static void hpet_msi_capability_lookup(unsigned int 
start_timer)
continue;
 
irq = hpet_assign_irq(hpet_domain, hdev, hdev->num);
-   if (irq < 0)
+   if (irq <= 0)
continue;
 
sprintf(hdev->name, "hpet%d", i);
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index b1c7e8f46bfb..49f9b6d2edf6 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -209,6 +209,9 @@ int irq_set_affinity_locked(struct irq_data *data, const 
struct cpumask *mask,
if (!chip || !chip->irq_set_affinity)
return -EINVAL;
 
+   /* Figure out where the set affinitycall comes from */
+   WARN_ON(data->irq == 0);
+
if (irq_can_move_pcntxt(data)) {
ret = irq_do_set_affinity(data, mask, force);
} else {
diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
index dd203e276b07..00bbabbc144b 100644
--- a/kernel/irq/migration.c
+++ b/kernel/irq/migration.c
@@ -12,16 +12,17 @@ void irq_move_masked_irq(struct irq_data *idata)
if (likely(!irqd_is_setaffinity_pending(&desc->irq_data)))
return;
 
+   irqd_clr_move_pending(&desc->irq_data);
+
+
/*
 * Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
 */
-   if (!irqd_can_balance(&desc->irq_data)) {
+   if (irqd_is_per_cpu(&desc->irq_data)) {
WARN_ON(1);
return;
}
 
-   irqd_clr_move_pending(&desc->irq_data);
-
if (unlikely(cpumask_empty(desc->pending_mask)))
return;
 





--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2] bpf: BPF based latency tracing

2015-06-20 Thread Daniel Borkmann

On 06/19/2015 04:00 PM, Daniel Wagner wrote:

BPF offers another way to generate latency histograms. We attach
kprobes at trace_preempt_off and trace_preempt_on and calculate the
time it takes to from seeing the off/on transition.

The first array is used to store the start time stamp. The key is the
CPU id. The second array stores the log2(time diff). We need to use
static allocation here (array and not hash tables). The kprobes
hooking into trace_preempt_on|off should not calling any dynamic
memory allocation or free path. We need to avoid recursivly
getting called. Besides that, it reduces jitter in the measurement.

CPU 0
   latency: count distribution
1 -> 1: 0||
2 -> 3: 0||
4 -> 7: 0||
8 -> 15   : 0||
   16 -> 31   : 0||
   32 -> 63   : 0||
   64 -> 127  : 0||
  128 -> 255  : 0||
  256 -> 511  : 0||
  512 -> 1023 : 0||
 1024 -> 2047 : 0||
 2048 -> 4095 : 166723   |*** |
 4096 -> 8191 : 19870|*** |
 8192 -> 16383: 6324 ||
16384 -> 32767: 1098 ||
32768 -> 65535: 190  ||
65536 -> 131071   : 179  ||
   131072 -> 262143   : 18   ||
   262144 -> 524287   : 4||
   524288 -> 1048575  : 1363 ||
CPU 1
   latency: count distribution
1 -> 1: 0||
2 -> 3: 0||
4 -> 7: 0||
8 -> 15   : 0||
   16 -> 31   : 0||
   32 -> 63   : 0||
   64 -> 127  : 0||
  128 -> 255  : 0||
  256 -> 511  : 0||
  512 -> 1023 : 0||
 1024 -> 2047 : 0||
 2048 -> 4095 : 114042   |*** |
 4096 -> 8191 : 9587 |**  |
 8192 -> 16383: 4140 ||
16384 -> 32767: 673  ||
32768 -> 65535: 179  ||
65536 -> 131071   : 29   ||
   131072 -> 262143   : 4||
   262144 -> 524287   : 1||
   524288 -> 1048575  : 364  ||
CPU 2
   latency: count distribution
1 -> 1: 0||
2 -> 3: 0||
4 -> 7: 0||
8 -> 15   : 0||
   16 -> 31   : 0||
   32 -> 63   : 0||
   64 -> 127  : 0||
  128 -> 255  : 0||
  256 -> 511  : 0||
  512 -> 1023 : 0||
 1024 -> 2047 : 0||
 2048 -> 4095 : 40147|*** |
 4096 -> 8191 : 2300 |*   |
 8192 -> 16383: 828  ||
16384 -> 32767: 178  ||
32768 -> 65535: 59 

[PATCH v3 2/6] ARM: dts: pxa: add dma engine node to pxa3xx-nand

2015-06-20 Thread Robert Jarzmik
Add the dma client description for pxa3xx-nand to use its dma through
device-tree.

Signed-off-by: Robert Jarzmik 
---
 arch/arm/boot/dts/pxa3xx.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/pxa3xx.dtsi b/arch/arm/boot/dts/pxa3xx.dtsi
index 4eb1563..d90489b 100644
--- a/arch/arm/boot/dts/pxa3xx.dtsi
+++ b/arch/arm/boot/dts/pxa3xx.dtsi
@@ -30,6 +30,8 @@
reg = <0x4310 90>;
interrupts = <45>;
clocks = <&clks CLK_NAND>;
+   dmas = <&pdma 97>;
+   dma-names = "data";
#address-cells = <1>;
#size-cells = <1>;  
status = "disabled";
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 3/6] ARM: dts: pxa: add dma pxamci nodes to pxa3xx

2015-06-20 Thread Robert Jarzmik
Add the 3 possible mmc controllers on pxa3xx SoCs to the devicetree
description. Add the dma and clocks to the device-tree description of
pxa27x and pxa3xx at the same time.

Signed-off-by: Robert Jarzmik 
---
 arch/arm/boot/dts/pxa2xx.dtsi |  4 
 arch/arm/boot/dts/pxa3xx.dtsi | 33 +
 2 files changed, 37 insertions(+)

diff --git a/arch/arm/boot/dts/pxa2xx.dtsi b/arch/arm/boot/dts/pxa2xx.dtsi
index 71a0cd7..5e5af07 100644
--- a/arch/arm/boot/dts/pxa2xx.dtsi
+++ b/arch/arm/boot/dts/pxa2xx.dtsi
@@ -128,6 +128,10 @@
compatible = "marvell,pxa-mmc";
reg = <0x4110 0x1000>;
interrupts = <23>;
+   clocks = <&clks CLK_MMC>;
+   dmas = <&pdma 21 3
+   &pdma 22 3>;
+   dma-names = "rx", "tx";
status = "disabled";
};
 
diff --git a/arch/arm/boot/dts/pxa3xx.dtsi b/arch/arm/boot/dts/pxa3xx.dtsi
index d90489b..29aeac5 100644
--- a/arch/arm/boot/dts/pxa3xx.dtsi
+++ b/arch/arm/boot/dts/pxa3xx.dtsi
@@ -53,6 +53,39 @@
interrupt-controller;
#interrupt-cells = <0x2>;
};
+
+   mmc0: mmc@4110 {
+   compatible = "marvell,pxa-mmc";
+   reg = <0x4110 0x1000>;
+   interrupts = <23>;
+   clocks = <&clks CLK_MMC>;
+   dmas = <&pdma 21 3
+   &pdma 22 3>;
+   dma-names = "rx", "tx";
+   status = "disabled";
+   };
+
+   mmc1: mmc@4200 {
+   compatible = "marvell,pxa-mmc";
+   reg = <0x4200 0x1000>;
+   interrupts = <41>;
+   clocks = <&clks CLK_MMC1>;
+   dmas = <&pdma 93 3
+   &pdma 94 3>;
+   dma-names = "rx", "tx";
+   status = "disabled";
+   };
+
+   mmc2: mmc@4250 {
+   compatible = "marvell,pxa-mmc";
+   reg = <0x4250 0x1000>;
+   interrupts = <55>;
+   clocks = <&clks CLK_MMC2>;
+   dmas = <&pdma 46 3
+   &pdma 47 3>;
+   dma-names = "rx", "tx";
+   status = "disabled";
+   };
};
 
clocks {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 1/6] ARM: dts: pxa: add dma controller

2015-06-20 Thread Robert Jarzmik
Add the SoC embedded DMA controller, shared with the mmp architecture.

Signed-off-by: Robert Jarzmik 
---
 arch/arm/boot/dts/pxa27x.dtsi | 9 +
 arch/arm/boot/dts/pxa3xx.dtsi | 9 +
 2 files changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
index 90b9971..506db86 100644
--- a/arch/arm/boot/dts/pxa27x.dtsi
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -7,6 +7,15 @@
compatible = "marvell,pxa27x";
 
pxabus {
+   pdma: dma-controller@4000 {
+   compatible = "marvell,pdma-1.0";
+   reg = <0x4000 0x1>;
+   interrupts = <25>;
+   #dma-channels = <32>;
+   #dma-cells = <2>;
+   status = "okay";
+   };
+
pxairq: interrupt-controller@40d0 {
marvell,intc-priority;
marvell,intc-nr-irqs = <34>;
diff --git a/arch/arm/boot/dts/pxa3xx.dtsi b/arch/arm/boot/dts/pxa3xx.dtsi
index 7ad0b17..4eb1563 100644
--- a/arch/arm/boot/dts/pxa3xx.dtsi
+++ b/arch/arm/boot/dts/pxa3xx.dtsi
@@ -6,6 +6,15 @@
compatible = "marvell,pxa3xx";
 
pxabus {
+   pdma: dma-controller@4000 {
+   compatible = "marvell,pdma-1.0";
+   reg = <0x4000 0x1>;
+   interrupts = <25>;
+   #dma-channels = <32>;
+   #dma-cells = <2>;
+   status = "okay";
+   };
+
pwri2c: i2c@40f500c0 {
compatible = "mrvl,pwri2c";
reg = <0x40f500c0 0x30>;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 4/6] ARM: dts: pxa: add embedded pxa camera capture interface

2015-06-20 Thread Robert Jarzmik
The pxa27x SoCs have an embedded camera host controller. Add the
description to the family description.

Signed-off-by: Robert Jarzmik 
---
Since v1: Sergey's comment on ePAR standard: "imaging"
---
 arch/arm/boot/dts/pxa27x.dtsi | 17 +
 1 file changed, 17 insertions(+)

diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
index 506db86..1402e23 100644
--- a/arch/arm/boot/dts/pxa27x.dtsi
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -77,6 +77,23 @@
clocks = <&clks CLK_KEYPAD>;
status = "disabled";
};
+
+   pxa_camera: imaging@5000 {
+   compatible = "marvell,pxa270-qci";
+   reg = <0x5000 0x1000>;
+   interrupts = <33>;
+   dmas = <&pdma 68 0  /* Y channel */
+   &pdma 69 0  /* U channel */
+   &pdma 70 0>;/* V channel */
+   dma-names = "CI_Y", "CI_U", "CI_V";
+
+   clocks = <&clks CLK_CAMERA>;
+   clock-names = "ciclk";
+   clock-frequency = <500>;
+   clock-output-names = "qci_mclk";
+
+   status = "disabled";
+   };
};
 
clocks {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 5/6] ARM: dts: pxa: fix power i2c definition

2015-06-20 Thread Robert Jarzmik
Add the correct address and size to the device-tree description.

Signed-off-by: Robert Jarzmik 
---
 arch/arm/boot/dts/pxa27x.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
index 1402e23..fc79df9 100644
--- a/arch/arm/boot/dts/pxa27x.dtsi
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -59,6 +59,8 @@
reg = <0x40f00180 0x24>;
interrupts = <6>;
clocks = <&clks CLK_PWRI2C>;
+   #address-cells = <0x1>;
+   #size-cells = <0>;
status = "disabled";
};
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v3 6/6] ARM: dts: pxa: add the usb host controller

2015-06-20 Thread Robert Jarzmik
Add the usb host controller to pxa27x and pxa3xx.

Signed-off-by: Robert Jarzmik 
---
Since v2: change node name from ohci to usb (ePAPR)
---
 arch/arm/boot/dts/pxa27x.dtsi | 8 
 arch/arm/boot/dts/pxa3xx.dtsi | 8 
 2 files changed, 16 insertions(+)

diff --git a/arch/arm/boot/dts/pxa27x.dtsi b/arch/arm/boot/dts/pxa27x.dtsi
index fc79df9..7f68a1e 100644
--- a/arch/arm/boot/dts/pxa27x.dtsi
+++ b/arch/arm/boot/dts/pxa27x.dtsi
@@ -26,6 +26,14 @@
clocks = <&clks CLK_NONE>;
};
 
+   pxa27x_ohci: usb@4c00 {
+   compatible = "marvell,pxa-ohci";
+   reg = <0x4c00 0x1>;
+   interrupts = <3>;
+   clocks = <&clks CLK_USBHOST>;
+   status = "disabled";
+   };
+
pwm0: pwm@40b0 {
compatible = "marvell,pxa270-pwm", "marvell,pxa250-pwm";
reg = <0x40b0 0x10>;
diff --git a/arch/arm/boot/dts/pxa3xx.dtsi b/arch/arm/boot/dts/pxa3xx.dtsi
index 29aeac5..cf6998a 100644
--- a/arch/arm/boot/dts/pxa3xx.dtsi
+++ b/arch/arm/boot/dts/pxa3xx.dtsi
@@ -86,6 +86,14 @@
dma-names = "rx", "tx";
status = "disabled";
};
+
+   pxa3xx_ohci: usb@4c00 {
+   compatible = "marvell,pxa-ohci";
+   reg = <0x4c00 0x1>;
+   interrupts = <3>;
+   clocks = <&clks CLK_USBHOST>;
+   status = "disabled";
+   };
};
 
clocks {
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq()

2015-06-20 Thread Sergey Senozhatsky
On (06/20/15 10:13), Thomas Gleixner wrote:
[..]
> > > Can you please send me the dmesg of the second patch as well?
> > > 
> > 
> > I'm sorry, what second patch?
> 
> The one which I forgot to append when I replied yesterday. Appended now.
> 


attached.

[0.197188] [ cut here ]
[0.197250] WARNING: CPU: 0 PID: 1 at kernel/irq/manage.c:213 
irq_set_affinity_locked+0x5b/0xf9()
[0.197329] Modules linked in:
[0.197426] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 
4.1.0-rc8-next-20150619-dbg-00010-g841f367-dirty #234
[0.197507] Hardware name: SAMSUNG ELECTRONICS CO.,LTD Samsung DeskTop 
System/Samsung DeskTop System, BIOS 05CC   04/09/2010
[0.197594]  0009 880133127db8 814f2add 
810851a4
[0.197824]   880133127df8 8103d196 

[0.198052]  8108795c 880133007c00  
880133007c00
[0.198281] Call Trace:
[0.198339]  [] dump_stack+0x4c/0x6e
[0.198401]  [] ? console_unlock+0x400/0x42f
[0.198465]  [] warn_slowpath_common+0x9b/0xb5
[0.198528]  [] ? irq_set_affinity_locked+0x5b/0xf9
[0.198592]  [] warn_slowpath_null+0x1a/0x1c
[0.198654]  [] irq_set_affinity_locked+0x5b/0xf9
[0.198717]  [] __irq_set_affinity+0x4c/0x67
[0.198781]  [] setup_ioapic_dest+0xa7/0xbf
[0.198843]  [] ? console_unlock+0x400/0x42f
[0.198906]  [] native_smp_cpus_done+0xa4/0xae
[0.198970]  [] smp_init+0x75/0x7a
[0.199032]  [] kernel_init_freeable+0x8e/0x198
[0.199096]  [] ? rest_init+0x13a/0x13a
[0.199158]  [] kernel_init+0xe/0xd4
[0.199219]  [] ret_from_fork+0x3f/0x70
[0.199281]  [] ? rest_init+0x13a/0x13a
[0.199359] ---[ end trace 3b2deb957481a854 ]---


-ss
[0.00] Initializing cgroup subsys cpu
[0.00] Linux version 4.1.0-rc8-next-20150619-dbg-00010-g841f367-dirty 
(ss@swordfish) (gcc version 5.1.0 (GCC) ) #234 SMP PREEMPT Sat Jun 20 17:24:02 
KST 2015
[0.00] Command line: 
BOOT_IMAGE=/vmlinuz-4.1.0-rc8-next-20150619-dbg-00010-g841f367-dirty 
root=/dev/sda2 ro rootfstype=ext4 resume=/dev/sda5 libahci.ignore_sss=1 
init=/usr/lib/systemd/systemd
[0.00] KERNEL supported cpus:
[0.00]   Intel GenuineIntel
[0.00] x86/fpu: Legacy x87 FPU detected.
[0.00] x86/fpu: Using 'lazy' FPU context switches.
[0.00] e820: BIOS-provided physical RAM map:
[0.00] BIOS-e820: [mem 0x-0x0009cfff] usable
[0.00] BIOS-e820: [mem 0x0009d000-0x0009] reserved
[0.00] BIOS-e820: [mem 0x000ce000-0x000c] reserved
[0.00] BIOS-e820: [mem 0x000dc000-0x000f] reserved
[0.00] BIOS-e820: [mem 0x0010-0xc3ff] usable
[0.00] BIOS-e820: [mem 0xc400-0xc5ff] reserved
[0.00] BIOS-e820: [mem 0xc77c-0xc77d3fff] ACPI data
[0.00] BIOS-e820: [mem 0xc77d4000-0xc77d6fff] ACPI NVS
[0.00] BIOS-e820: [mem 0xc77d7000-0xc7ff] reserved
[0.00] BIOS-e820: [mem 0xe000-0xefff] reserved
[0.00] BIOS-e820: [mem 0xfec0-0xfec0] reserved
[0.00] BIOS-e820: [mem 0xfee0-0xfee00fff] reserved
[0.00] BIOS-e820: [mem 0xff00-0x] reserved
[0.00] BIOS-e820: [mem 0x0001-0x000137ff] usable
[0.00] NX (Execute Disable) protection: active
[0.00] SMBIOS 2.6 present.
[0.00] DMI: SAMSUNG ELECTRONICS CO.,LTD Samsung DeskTop System/Samsung 
DeskTop System, BIOS 05CC   04/09/2010
[0.00] e820: update [mem 0x-0x0fff] usable ==> reserved
[0.00] e820: remove [mem 0x000a-0x000f] usable
[0.00] e820: last_pfn = 0x138000 max_arch_pfn = 0x4
[0.00] MTRR default type: uncachable
[0.00] MTRR fixed ranges enabled:
[0.00]   0-9 write-back
[0.00]   A-B uncachable
[0.00]   C-C write-protect
[0.00]   D-D uncachable
[0.00]   E-F write-protect
[0.00] MTRR variable ranges enabled:
[0.00]   0 base 0C800 mask FF800 uncachable
[0.00]   1 base 0D000 mask FF000 uncachable
[0.00]   2 base 0E000 mask FE000 uncachable
[0.00]   3 base 0 mask F write-back
[0.00]   4 base 1 mask FE000 write-back
[0.00]   5 base 12000 mask FF000 write-back
[0.00]   6 base 13000 mask FF800 write-back
[0.00]   7 base 0C780 mask FFF80 uncachable
[0.00] x86/PAT: Configuration [0-7]: WB  WC  UC- UC  WB  WC  UC- WT  
[0.00] e820: update [mem 0xc780-0x] usable ==> reserved
[0.00] e820: last_pfn = 0xc4000 max_arc

[PATCH] block: nvme-scsi: Catch kcalloc failure

2015-06-20 Thread Axel Lin
res variable was initialized to -ENOMEM, but it's override by
nvme_trans_copy_from_user(). So current code returns 0 if kcalloc fails.
Fix it to return proper error code.

Signed-off-by: Axel Lin 
---
 drivers/block/nvme-scsi.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/block/nvme-scsi.c b/drivers/block/nvme-scsi.c
index a0fade9..e5a63f0 100644
--- a/drivers/block/nvme-scsi.c
+++ b/drivers/block/nvme-scsi.c
@@ -2377,7 +2377,7 @@ static int nvme_trans_unmap(struct nvme_ns *ns, struct 
sg_io_hdr *hdr,
struct scsi_unmap_parm_list *plist;
struct nvme_dsm_range *range;
struct nvme_command c;
-   int i, nvme_sc, res = -ENOMEM;
+   int i, nvme_sc, res;
u16 ndesc, list_len;
 
list_len = get_unaligned_be16(&cmd[7]);
@@ -2399,8 +2399,10 @@ static int nvme_trans_unmap(struct nvme_ns *ns, struct 
sg_io_hdr *hdr,
}
 
range = kcalloc(ndesc, sizeof(*range), GFP_KERNEL);
-   if (!range)
+   if (!range) {
+   res = -ENOMEM;
goto out;
+   }
 
for (i = 0; i < ndesc; i++) {
range[i].nlb = cpu_to_le32(be32_to_cpu(plist->desc[i].nlb));
-- 
2.1.0



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the tip tree with the modules tree

2015-06-20 Thread Stephen Rothwell
Hi all,

Today's linux-next merge of the tip tree got a conflict in:

  include/linux/seqlock.h

between commit:

  7fc26327b756 ("seqlock: Introduce raw_read_seqcount_latch()")

from the modules tree and commit:

  c4bfa3f5f906 ("seqcount: Introduce raw_write_seqcount_barrier()")

from the tip tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc include/linux/seqlock.h
index 890c7ef709d5,486e685a226a..
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@@ -234,87 -233,50 +234,128 @@@ static inline void raw_write_seqcount_e
s->sequence++;
  }
  
+ /**
+  * raw_write_seqcount_barrier - do a seq write barrier
+  * @s: pointer to seqcount_t
+  *
+  * This can be used to provide an ordering guarantee instead of the
+  * usual consistency guarantee. It is one wmb cheaper, because we can
+  * collapse the two back-to-back wmb()s.
+  *
+  *  seqcount_t seq;
+  *  bool X = true, Y = false;
+  *
+  *  void read(void)
+  *  {
+  *  bool x, y;
+  *
+  *  do {
+  *  int s = read_seqcount_begin(&seq);
+  *
+  *  x = X; y = Y;
+  *
+  *  } while (read_seqcount_retry(&seq, s));
+  *
+  *  BUG_ON(!x && !y);
+  *  }
+  *
+  *  void write(void)
+  *  {
+  *  Y = true;
+  *
+  *  raw_write_seqcount_barrier(seq);
+  *
+  *  X = false;
+  *  }
+  */
+ static inline void raw_write_seqcount_barrier(seqcount_t *s)
+ {
+   s->sequence++;
+   smp_wmb();
+   s->sequence++;
+ }
+ 
 -/*
 +static inline int raw_read_seqcount_latch(seqcount_t *s)
 +{
 +  return lockless_dereference(s->sequence);
 +}
 +
 +/**
   * raw_write_seqcount_latch - redirect readers to even/odd copy
   * @s: pointer to seqcount_t
 + *
 + * The latch technique is a multiversion concurrency control method that 
allows
 + * queries during non-atomic modifications. If you can guarantee queries never
 + * interrupt the modification -- e.g. the concurrency is strictly between CPUs
 + * -- you most likely do not need this.
 + *
 + * Where the traditional RCU/lockless data structures rely on atomic
 + * modifications to ensure queries observe either the old or the new state the
 + * latch allows the same for non-atomic updates. The trade-off is doubling the
 + * cost of storage; we have to maintain two copies of the entire data
 + * structure.
 + *
 + * Very simply put: we first modify one copy and then the other. This ensures
 + * there is always one copy in a stable state, ready to give us an answer.
 + *
 + * The basic form is a data structure like:
 + *
 + * struct latch_struct {
 + *seqcount_t  seq;
 + *struct data_struct  data[2];
 + * };
 + *
 + * Where a modification, which is assumed to be externally serialized, does 
the
 + * following:
 + *
 + * void latch_modify(struct latch_struct *latch, ...)
 + * {
 + *smp_wmb();  <- Ensure that the last data[1] update is visible
 + *latch->seq++;
 + *smp_wmb();  <- Ensure that the seqcount update is visible
 + *
 + *modify(latch->data[0], ...);
 + *
 + *smp_wmb();  <- Ensure that the data[0] update is visible
 + *latch->seq++;
 + *smp_wmb();  <- Ensure that the seqcount update is visible
 + *
 + *modify(latch->data[1], ...);
 + * }
 + *
 + * The query will have a form like:
 + *
 + * struct entry *latch_query(struct latch_struct *latch, ...)
 + * {
 + *struct entry *entry;
 + *unsigned seq, idx;
 + *
 + *do {
 + *seq = lockless_dereference(latch->seq);
 + *
 + *idx = seq & 0x01;
 + *entry = data_query(latch->data[idx], ...);
 + *
 + *smp_rmb();
 + *} while (seq != latch->seq);
 + *
 + *return entry;
 + * }
 + *
 + * So during the modification, queries are first redirected to data[1]. Then 
we
 + * modify data[0]. When that is complete, we redirect queries back to data[0]
 + * and we can modify data[1].
 + *
 + * NOTE: The non-requirement for atomic modifications does _NOT_ include
 + *   the publishing of new entries in the case where data is a dynamic
 + *   data structure.
 + *
 + *   An iteration might start in data[0] and get suspended long enough
 + *   to miss an entire modification sequence, once it resumes it might
 + *   observe the new entry.
 + *
 + * NOTE: When data is a dynamic data structure; one should use regular RCU
 + *   patterns to manage the lifetimes of the objects within.
   */
  static inline void raw_write_seqcount_latch(seqcount_t *s)
  {


pgp10X46fIeKa.pgp
Description: OpenPGP digital signature


[PATCH 0/4] staging: sm750fb: checkpatch.pl fixes

2015-06-20 Thread Juston Li
This patch set includes 4 patches fixing indentation, spacing, brace placement
and missing blank lines from checkpatch.pl warnings/errors in staging/sm750fb.

Regards
Juston

-
 drivers/staging/sm750fb/ddk750_chip.c|  15 +--
 drivers/staging/sm750fb/ddk750_chip.h|  12 +-
 drivers/staging/sm750fb/ddk750_display.c | 168 +---
 drivers/staging/sm750fb/ddk750_display.h |  11 +-
 drivers/staging/sm750fb/ddk750_dvi.c |  75 +--
 drivers/staging/sm750fb/ddk750_dvi.h |   3 +-
 drivers/staging/sm750fb/ddk750_help.c|   2 +-
 drivers/staging/sm750fb/ddk750_help.h|   4 +-
 drivers/staging/sm750fb/ddk750_hwi2c.c   | 244
++-
 drivers/staging/sm750fb/ddk750_mode.c| 164 +++
 drivers/staging/sm750fb/ddk750_mode.h|  52 
 drivers/staging/sm750fb/ddk750_power.c   | 254
++--
 drivers/staging/sm750fb/ddk750_power.h   |  11 +-
 drivers/staging/sm750fb/ddk750_reg.h |  18 +--
 drivers/staging/sm750fb/ddk750_sii164.c  | 394
+---
 drivers/staging/sm750fb/ddk750_sii164.h  |  32 ++---
 drivers/staging/sm750fb/sm750.c  |   2 +-
 drivers/staging/sm750fb/sm750.h  |  58 -
 drivers/staging/sm750fb/sm750_accel.c| 374
-
 drivers/staging/sm750fb/sm750_accel.h|   4 +-
 drivers/staging/sm750fb/sm750_cursor.c   |  49 +++
 drivers/staging/sm750fb/sm750_help.h |  28 ++--
 drivers/staging/sm750fb/sm750_hw.c   | 205 +++--
 drivers/staging/sm750fb/sm750_hw.h   |  42 +++---
 24 files changed, 1163 insertions(+), 1058 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/4] staging: sm750fb: use tabs for indentation

2015-06-20 Thread Juston Li
Replace spaces with tabs for indentation to fix the checkpatch.pl error
ERROR: code indent should use tabs where possible
WARNING: please, no spaces at the start of a line

Signed-off-by: Juston Li 
---
 drivers/staging/sm750fb/ddk750_display.c | 100 
 drivers/staging/sm750fb/ddk750_display.h |   2 +-
 drivers/staging/sm750fb/ddk750_dvi.c |  66 ++---
 drivers/staging/sm750fb/ddk750_help.h|   4 +-
 drivers/staging/sm750fb/ddk750_hwi2c.c   | 246 +--
 drivers/staging/sm750fb/ddk750_mode.c| 142 +--
 drivers/staging/sm750fb/ddk750_mode.h|  46 ++--
 drivers/staging/sm750fb/ddk750_power.c   | 254 ++--
 drivers/staging/sm750fb/ddk750_power.h   |   8 +-
 drivers/staging/sm750fb/ddk750_reg.h |  18 +-
 drivers/staging/sm750fb/ddk750_sii164.c  | 399 +++
 drivers/staging/sm750fb/ddk750_sii164.h  |  29 ++-
 drivers/staging/sm750fb/sm750.h  |  24 +-
 drivers/staging/sm750fb/sm750_accel.c| 364 ++--
 drivers/staging/sm750fb/sm750_accel.h|   4 +-
 drivers/staging/sm750fb/sm750_help.h |  26 +-
 drivers/staging/sm750fb/sm750_hw.c   |  70 +++---
 drivers/staging/sm750fb/sm750_hw.h   |  28 +--
 18 files changed, 908 insertions(+), 922 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_display.c 
b/drivers/staging/sm750fb/ddk750_display.c
index a3e6720..1c4049f 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -24,7 +24,7 @@ static void setDisplayControl(int ctrl, int dispState)
/* Timing should be enabled first before enabling the 
plane
 * because changing at the same time does not guarantee 
that
 * the plane will also enabled or disabled.
-*/
+*/
ulDisplayCtrlReg = FIELD_SET(ulDisplayCtrlReg,

PANEL_DISPLAY_CTRL, TIMING, ENABLE);
POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
@@ -135,8 +135,8 @@ static void waitNextVerticalSync(int ctrl, int delay)
if(!ctrl){
/* primary controller */
 
-/* Do not wait when the Primary PLL is off or display control is 
already off.
-  This will prevent the software to wait forever. */
+   /* Do not wait when the Primary PLL is off or display control 
is already off.
+  This will prevent the software to wait forever. */
if ((FIELD_GET(PEEK32(PANEL_PLL_CTRL), PANEL_PLL_CTRL, POWER) ==
 PANEL_PLL_CTRL_POWER_OFF) ||
(FIELD_GET(PEEK32(PANEL_DISPLAY_CTRL), 
PANEL_DISPLAY_CTRL, TIMING) ==
@@ -145,26 +145,26 @@ static void waitNextVerticalSync(int ctrl, int delay)
return;
}
 
-while (delay-- > 0)
-{
-/* Wait for end of vsync. */
-do
-{
-status = FIELD_GET(PEEK32(SYSTEM_CTRL),
-   SYSTEM_CTRL,
-   PANEL_VSYNC);
-}
-while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE);
-
-/* Wait for start of vsync. */
-do
-{
-status = FIELD_GET(PEEK32(SYSTEM_CTRL),
-   SYSTEM_CTRL,
-   PANEL_VSYNC);
-}
-while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE);
-}
+   while (delay-- > 0)
+   {
+   /* Wait for end of vsync. */
+   do
+   {
+   status = FIELD_GET(PEEK32(SYSTEM_CTRL),
+  SYSTEM_CTRL,
+  PANEL_VSYNC);
+   }
+   while (status == SYSTEM_CTRL_PANEL_VSYNC_ACTIVE);
+
+   /* Wait for start of vsync. */
+   do
+   {
+   status = FIELD_GET(PEEK32(SYSTEM_CTRL),
+  SYSTEM_CTRL,
+  PANEL_VSYNC);
+   }
+   while (status == SYSTEM_CTRL_PANEL_VSYNC_INACTIVE);
+   }
 
}else{
 
@@ -275,33 +275,33 @@ void ddk750_setLogicalDispOut(disp_output_t output)
 
 int ddk750_initDVIDisp(void)
 {
-/* Initialize DVI. If the dviInit fail and the VendorID or the DeviceID are
-   not zeroed, then set the failure flag. If it is zeroe, it might mean
-   that the system is in Dual CRT Monitor configuration. */
-
-/* De-skew enabled with default 111b value.
-   This will fix some artifacts problem in some mode on board 2.2.
-   Somehow this fix does n

[PATCH] staging: comedi: fix sparse warning in ni_mio_common.c

2015-06-20 Thread Geliang Tang
This patch fixes the following sparse warning:

drivers/staging/comedi/drivers/ni_mio_common.c:573:26: warning: shift
too big (4294967295) for type int

Signed-off-by: Geliang Tang 
---
 drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 6cc304a..420f752 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -570,7 +570,7 @@ static inline void ni_set_bitfield(struct comedi_device 
*dev, int reg,
 static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
 {
if (channel < 4)
-   return 1 << channel;
+   return 1 << (channel & 0x03);
if (channel == 4)
return 0x3;
if (channel == 5)
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/4] staging: sm750fb: fix spacing issues

2015-06-20 Thread Juston Li
Fix spacing errors and warnings caught by checkpatch.pl
ERROR: space prohibited after that open parenthesis '('
ERROR: space required before the open brace '{'
ERROR: need consistent spacing around
ERROR: trailing whitespace
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Juston Li 
---
 drivers/staging/sm750fb/ddk750_chip.c|  14 ++--
 drivers/staging/sm750fb/ddk750_display.c |  22 +++---
 drivers/staging/sm750fb/ddk750_display.h |   6 +-
 drivers/staging/sm750fb/ddk750_dvi.c |   4 +-
 drivers/staging/sm750fb/ddk750_help.c|   2 +-
 drivers/staging/sm750fb/ddk750_mode.c|  16 ++---
 drivers/staging/sm750fb/ddk750_power.c   |  18 ++---
 drivers/staging/sm750fb/sm750.c  |   2 +-
 drivers/staging/sm750fb/sm750.h  |  34 -
 drivers/staging/sm750fb/sm750_accel.c|  26 +++
 drivers/staging/sm750fb/sm750_cursor.c   |  40 +--
 drivers/staging/sm750fb/sm750_help.h |   4 +-
 drivers/staging/sm750fb/sm750_hw.c   | 120 +++
 drivers/staging/sm750fb/sm750_hw.h   |  14 ++--
 14 files changed, 158 insertions(+), 164 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c 
b/drivers/staging/sm750fb/ddk750_chip.c
index f4975d2..d7435d7 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -268,7 +268,7 @@ int ddk750_initHw(initchip_param_t *pInitParam)
 #endif
 
 
-   if (pInitParam->powerMode != 0 )
+   if (pInitParam->powerMode != 0)
pInitParam->powerMode = 0;
setPowerMode(pInitParam->powerMode);
 
@@ -464,17 +464,17 @@ unsigned int calcPllValue(unsigned int request_orig, 
pll_value_t *pll)
RN = N * request;
quo = RN / input;
rem = RN % input;/* rem always small than 14318181 */
-   fl_quo = (rem * 1 /input);
+   fl_quo = (rem * 1 / input);
 
for (d = xcnt - 1; d >= 0; d--) {
X = xparm[d].value;
M = quo*X;
M += fl_quo * X / 1;
/* round step */
-   M += (fl_quo*X % 1)>5000?1:0;
+   M += (fl_quo*X % 1) > 5000?1:0;
if (M < 256 && M > 0) {
unsigned int diff;
-   tmpClock = pll->inputFreq *M / N / X;
+   tmpClock = pll->inputFreq * M / N / X;
diff = absDiff(tmpClock, request_orig);
if (diff < miniDiff) {
pll->M = M;
@@ -599,9 +599,9 @@ unsigned int formatPllReg(pll_value_t *pPLL)
On returning a 32 bit number, the value can be applied to any PLL in 
the calling function.
 */
ulPllReg =
-   FIELD_SET(  0, PANEL_PLL_CTRL, BYPASS, OFF)
-   | FIELD_SET(  0, PANEL_PLL_CTRL, POWER,  ON)
-   | FIELD_SET(  0, PANEL_PLL_CTRL, INPUT,  OSC)
+   FIELD_SET(0, PANEL_PLL_CTRL, BYPASS, OFF)
+   | FIELD_SET(0, PANEL_PLL_CTRL, POWER,  ON)
+   | FIELD_SET(0, PANEL_PLL_CTRL, INPUT,  OSC)
 #ifndef VALIDATION_CHIP
| FIELD_VALUE(0, PANEL_PLL_CTRL, POD,pPLL->POD)
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_display.c 
b/drivers/staging/sm750fb/ddk750_display.c
index 1c4049f..4a3cb86 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -49,7 +49,7 @@ static void setDisplayControl(int ctrl, int dispState)
{
cnt++;
POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
-   } while((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) 
!=
+   } while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) 
!=
(ulDisplayCtrlReg & ~ulReservedBits));
printk("Set Panel Plane enbit:after tried %d times\n", 
cnt);
}
@@ -104,7 +104,7 @@ static void setDisplayControl(int ctrl, int dispState)
{
cnt++;
POKE32(CRT_DISPLAY_CTRL, ulDisplayCtrlReg);
-   } while((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) !=
+   } while ((PEEK32(CRT_DISPLAY_CTRL) & ~ulReservedBits) !=
(ulDisplayCtrlReg & ~ulReservedBits));
printk("Set Crt Plane enbit:after tried %d 
times\n", cnt);
}
@@ -132,7 +132,7 @@ static void setDisplayControl(int ctrl, int dispState)
 static void waitNextVerticalSync(int ctrl, int delay)
 {
unsigned int status;
-   if(!ctrl){
+   if (!ctrl) {
/* primary controller */
 
/* Do not wait when the Primary PLL is off or display control 
is already off.
@@ -166,7 +166,7

[PATCH 3/4] staging: sm750fb: fix brace placement

2015-06-20 Thread Juston Li
Fix brace placement errors and warnings caught by checkpatch.pl
ERROR: that open brace { should be on the previous line
WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Juston Li 
---
 drivers/staging/sm750fb/ddk750_chip.h| 12 ++
 drivers/staging/sm750fb/ddk750_display.c | 66 ++--
 drivers/staging/sm750fb/ddk750_display.h |  3 +-
 drivers/staging/sm750fb/ddk750_dvi.c |  6 +--
 drivers/staging/sm750fb/ddk750_dvi.h |  3 +-
 drivers/staging/sm750fb/ddk750_hwi2c.c   |  6 +--
 drivers/staging/sm750fb/ddk750_mode.c| 13 ++-
 drivers/staging/sm750fb/ddk750_mode.h|  6 +--
 drivers/staging/sm750fb/ddk750_power.c   | 27 -
 drivers/staging/sm750fb/ddk750_power.h   |  3 +-
 drivers/staging/sm750fb/ddk750_sii164.c  | 16 +++-
 drivers/staging/sm750fb/ddk750_sii164.h  |  3 +-
 drivers/staging/sm750fb/sm750_accel.c| 46 +++---
 drivers/staging/sm750fb/sm750_cursor.c   | 23 +--
 drivers/staging/sm750fb/sm750_hw.c   | 33 ++--
 15 files changed, 86 insertions(+), 180 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.h 
b/drivers/staging/sm750fb/ddk750_chip.h
index 4e030e8..6ff0436 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -8,8 +8,7 @@
 #include 
 
 /* This is all the chips recognized by this library */
-typedef enum _logical_chip_type_t
-{
+typedef enum _logical_chip_type_t {
SM_UNKNOWN,
SM718,
SM750,
@@ -18,8 +17,7 @@ typedef enum _logical_chip_type_t
 logical_chip_type_t;
 
 
-typedef enum _clock_type_t
-{
+typedef enum _clock_type_t {
MXCLK_PLL,
PRIMARY_PLL,
SECONDARY_PLL,
@@ -28,8 +26,7 @@ typedef enum _clock_type_t
 }
 clock_type_t;
 
-typedef struct _pll_value_t
-{
+typedef struct _pll_value_t {
clock_type_t clockType;
unsigned long inputFreq; /* Input clock frequency to the PLL */
 
@@ -42,8 +39,7 @@ typedef struct _pll_value_t
 pll_value_t;
 
 /* input struct to initChipParam() function */
-typedef struct _initchip_param_t
-{
+typedef struct _initchip_param_t {
unsigned short powerMode;/* Use power mode 0 or 1 */
unsigned short chipClock;/**
  * Speed of main chip clock in MHz unit
diff --git a/drivers/staging/sm750fb/ddk750_display.c 
b/drivers/staging/sm750fb/ddk750_display.c
index 4a3cb86..90c5c9e 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -15,12 +15,10 @@ static void setDisplayControl(int ctrl, int dispState)
cnt = 0;
 
/* Set the primary display control */
-   if (!ctrl)
-   {
+   if (!ctrl) {
ulDisplayCtrlReg = PEEK32(PANEL_DISPLAY_CTRL);
/* Turn on/off the Panel display control */
-   if (dispState)
-   {
+   if (dispState) {
/* Timing should be enabled first before enabling the 
plane
 * because changing at the same time does not guarantee 
that
 * the plane will also enabled or disabled.
@@ -45,16 +43,13 @@ static void setDisplayControl(int ctrl, int dispState)
 * until a few delay. Need to write
 * and read it a couple times
 */
-   do
-   {
+   do {
cnt++;
POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
} while ((PEEK32(PANEL_DISPLAY_CTRL) & ~ulReservedBits) 
!=
(ulDisplayCtrlReg & ~ulReservedBits));
printk("Set Panel Plane enbit:after tried %d times\n", 
cnt);
-   }
-   else
-   {
+   } else {
/* When turning off, there is no rule on the programming
 * sequence since whenever the clock is off, then it 
does not
 * matter whether the plane is enabled or disabled.
@@ -71,14 +66,11 @@ static void setDisplayControl(int ctrl, int dispState)
POKE32(PANEL_DISPLAY_CTRL, ulDisplayCtrlReg);
}
 
-   }
/* Set the secondary display control */
-   else
-   {
+   } else {
ulDisplayCtrlReg = PEEK32(CRT_DISPLAY_CTRL);
 
-   if (dispState)
-   {
+   if (dispState) {
/* Timing should be enabled first before enabling the 
plane because changing at the
   same time does not guarantee that the plane will 
also enabled or disabled.
   */
@@ -100,16 +92,13 @@ static void setDisplayControl(int ctrl, int dispState)
FIELD_SET(0, CRT_DISPLAY_CTRL, RESERVED_3_MASK, 

[PATCH] staging: comedi: fix sparse warning in comedi_compat32.c

2015-06-20 Thread Geliang Tang
This patch fixes the following sparse warning:

drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
address space of expression

Signed-off-by: Geliang Tang 
---
 drivers/staging/comedi/comedi_compat32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_compat32.c 
b/drivers/staging/comedi/comedi_compat32.c
index 2584824..29a10fe4 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -202,7 +202,7 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
err |= __get_user(temp.uint, &cmd32->stop_arg);
err |= __put_user(temp.uint, &cmd->stop_arg);
err |= __get_user(temp.uptr, &cmd32->chanlist);
-   err |= __put_user(compat_ptr(temp.uptr), &cmd->chanlist);
+   err |= __put_user((unsigned int __force *)compat_ptr(temp.uptr), 
&cmd->chanlist);
err |= __get_user(temp.uint, &cmd32->chanlist_len);
err |= __put_user(temp.uint, &cmd->chanlist_len);
err |= __get_user(temp.uptr, &cmd32->data);
-- 
1.9.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/4] staging: sm750fb: add missing blank line after declarations

2015-06-20 Thread Juston Li
fixes checkpatch.pl WARNING: Missing a blank line after declarations

Signed-off-by: Juston Li 
---
 drivers/staging/sm750fb/ddk750_chip.c| 1 +
 drivers/staging/sm750fb/ddk750_display.c | 2 ++
 drivers/staging/sm750fb/ddk750_dvi.c | 1 +
 drivers/staging/sm750fb/ddk750_mode.c| 3 +++
 drivers/staging/sm750fb/ddk750_power.c   | 1 +
 drivers/staging/sm750fb/ddk750_sii164.c  | 1 +
 6 files changed, 9 insertions(+)

diff --git a/drivers/staging/sm750fb/ddk750_chip.c 
b/drivers/staging/sm750fb/ddk750_chip.c
index d7435d7..5e6798e 100644
--- a/drivers/staging/sm750fb/ddk750_chip.c
+++ b/drivers/staging/sm750fb/ddk750_chip.c
@@ -474,6 +474,7 @@ unsigned int calcPllValue(unsigned int request_orig, 
pll_value_t *pll)
M += (fl_quo*X % 1) > 5000?1:0;
if (M < 256 && M > 0) {
unsigned int diff;
+
tmpClock = pll->inputFreq * M / N / X;
diff = absDiff(tmpClock, request_orig);
if (diff < miniDiff) {
diff --git a/drivers/staging/sm750fb/ddk750_display.c 
b/drivers/staging/sm750fb/ddk750_display.c
index 90c5c9e..70e7f10 100644
--- a/drivers/staging/sm750fb/ddk750_display.c
+++ b/drivers/staging/sm750fb/ddk750_display.c
@@ -121,6 +121,7 @@ static void setDisplayControl(int ctrl, int dispState)
 static void waitNextVerticalSync(int ctrl, int delay)
 {
unsigned int status;
+
if (!ctrl) {
/* primary controller */
 
@@ -210,6 +211,7 @@ static void swPanelPowerSequence(int disp, int delay)
 void ddk750_setLogicalDispOut(disp_output_t output)
 {
unsigned int reg;
+
if (output & PNL_2_USAGE) {
/* set panel path controller select */
reg = PEEK32(PANEL_DISPLAY_CTRL);
diff --git a/drivers/staging/sm750fb/ddk750_dvi.c 
b/drivers/staging/sm750fb/ddk750_dvi.c
index a18bb4c..a7a2351 100644
--- a/drivers/staging/sm750fb/ddk750_dvi.c
+++ b/drivers/staging/sm750fb/ddk750_dvi.c
@@ -43,6 +43,7 @@ int dviInit(
)
 {
dvi_ctrl_device_t *pCurrentDviCtrl;
+
pCurrentDviCtrl = g_dcftSupportedDviController;
if (pCurrentDviCtrl->pfnInit != NULL) {
return pCurrentDviCtrl->pfnInit(edgeSelect, busSelect, 
dualEdgeClkSelect, hsyncEnable,
diff --git a/drivers/staging/sm750fb/ddk750_mode.c 
b/drivers/staging/sm750fb/ddk750_mode.c
index 9d10446..2399b17 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -80,6 +80,7 @@ static int programModeRegisters(mode_parameter_t *pModeParam, 
pll_value_t *pll)
int ret = 0;
int cnt = 0;
unsigned int ulTmpValue, ulReg;
+
if (pll->clockType == SECONDARY_PLL) {
/* programe secondary pixel clock */
POKE32(CRT_PLL_CTRL, formatPllReg(pll));
@@ -120,6 +121,7 @@ static int programModeRegisters(mode_parameter_t 
*pModeParam, pll_value_t *pll)
 
} else if (pll->clockType == PRIMARY_PLL) {
unsigned int ulReservedBits;
+
POKE32(PANEL_PLL_CTRL, formatPllReg(pll));
 
POKE32(PANEL_HORIZONTAL_TOTAL,
@@ -184,6 +186,7 @@ int ddk750_setModeTiming(mode_parameter_t *parm, 
clock_type_t clock)
 {
pll_value_t pll;
unsigned int uiActualPixelClk;
+
pll.inputFreq = DEFAULT_INPUT_CLOCK;
pll.clockType = clock;
 
diff --git a/drivers/staging/sm750fb/ddk750_power.c 
b/drivers/staging/sm750fb/ddk750_power.c
index c545c2d..c8c51be 100644
--- a/drivers/staging/sm750fb/ddk750_power.c
+++ b/drivers/staging/sm750fb/ddk750_power.c
@@ -5,6 +5,7 @@
 void ddk750_setDPMS(DPMS_t state)
 {
unsigned int value;
+
if (getChipType() == SM750LE) {
value = PEEK32(CRT_DISPLAY_CTRL);
POKE32(CRT_DISPLAY_CTRL, FIELD_VALUE(value, CRT_DISPLAY_CTRL, 
DPMS, state));
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 3c55df1..e476584 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -334,6 +334,7 @@ static void 
sii164SelectHotPlugDetectionMode(sii164_hot_plug_mode_t hotPlugMode)
 void sii164EnableHotPlugDetection(unsigned char enableHotPlug)
 {
unsigned char detectReg;
+
detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT);
 
/* Depending on each DVI controller, need to enable the hot plug based 
on each
-- 
2.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] staging: media: lirc: fix coding style error

2015-06-20 Thread Sunil Shahu
Fix code indentation error by replacing tab in place of spaces.

Signed-off-by: Sunil Shahu 
---
 drivers/staging/media/lirc/lirc_sasem.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/lirc/lirc_sasem.c 
b/drivers/staging/media/lirc/lirc_sasem.c
index 8ebee96..c14ca7e 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -185,7 +185,7 @@ static void deregister_from_lirc(struct sasem_context 
*context)
   __func__, retval);
else
dev_info(&context->dev->dev,
-"Deregistered Sasem driver (minor:%d)\n", minor);
+"Deregistered Sasem driver (minor:%d)\n", minor);
 
 }
 
-- 
1.7.9.5


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: manual merge of the tip tree with the modules tree

2015-06-20 Thread Peter Zijlstra
On Sat, Jun 20, 2015 at 06:35:58PM +1000, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the tip tree got a conflict in:
> 
>   include/linux/seqlock.h
> 
> between commit:
> 
>   7fc26327b756 ("seqlock: Introduce raw_read_seqcount_latch()")
> 
> from the modules tree and commit:
> 
>   c4bfa3f5f906 ("seqcount: Introduce raw_write_seqcount_barrier()")
> 
> from the tip tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Oh my that's unfortunate, those two patches just touching at the edge.
Resolution looks good.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [-next] !irqd_can_balance() WARNINGs at irq_move_masked_irq()

2015-06-20 Thread Thomas Gleixner
On Sat, 20 Jun 2015, Sergey Senozhatsky wrote:
> On (06/20/15 10:13), Thomas Gleixner wrote:
> [..]
> > > > Can you please send me the dmesg of the second patch as well?
> > > > 
> > > 
> > > I'm sorry, what second patch?
> > 
> > The one which I forgot to append when I replied yesterday. Appended now.
> > 
> [0.198654]  [] irq_set_affinity_locked+0x5b/0xf9
> [0.198717]  [] __irq_set_affinity+0x4c/0x67
> [0.198781]  [] setup_ioapic_dest+0xa7/0xbf
> [0.198843]  [] ? console_unlock+0x400/0x42f
> [0.198906]  [] native_smp_cpus_done+0xa4/0xae
> [0.198970]  [] smp_init+0x75/0x7a

OK. It's setup_ioapic_dest() and I understand now where this all comes
from.

One last request. Can you please provide /proc/timer_list and dmesg
from a mainline kernel for comparison?

Thanks,

tglx


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


From Madam Assetou Kuku Dearest One ,

2015-06-20 Thread Assetou Kuku
Greetings!!

>From Madam Assetou Kuku Dearest One ,

I am Madam.Assetou Kuku
I am a widow being that I lost my husband  Last Year  by the political
uprising here in Burkina Faso ,My husband was a serving director of
the Gold exporting board until his death .He was assassinated by the
rebels following the political uprising, before his death he made a
deposit of Six Million Five Hundred Dollars ($ 6,500,000.00) here in
Ouagadougou Burkina Faso in one of the Security Company ,I want you to
help me for us to retrieve this fund and transfer it to your account
in your country or any safer place as you will be the beneficiary and
recipient of the fund which we will use for joint investment in your
country .

Please if you are willing to assist me and my only Daughter Linda
Kuku,  Kindly Reply To me.  In  my Confidential  Email Address  (
assetouk...@gmail.com   For The Confidentiality Of This  Proposal. I
will Give You The Complete Details How We Shall Proceed.

May Almighty God Bless You!
Thanks  and  best  regards .
Madam Assetou Kuku
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/6] clk: add CLK_RECALC_NEW_RATES clock flag for Exynos cpu clock support

2015-06-20 Thread Krzysztof Kozlowski
W dniu 19.06.2015 o 23:53, Michael Turquette pisze:
> Quoting Bartlomiej Zolnierkiewicz (2015-06-19 05:35:23)
>> On Friday, June 19, 2015 01:19:06 PM Bartlomiej Zolnierkiewicz wrote:
>>>
>>> Hi,
>>>
>>> On Thursday, June 18, 2015 12:58:46 PM Michael Turquette wrote:
 Quoting Sylwester Nawrocki (2015-05-13 07:13:13)
> On 03/04/15 18:43, Bartlomiej Zolnierkiewicz wrote:
>> This flag is needed to fix the issue with wrong dividers being setup
>> by Common Clock Framework when using the new Exynos cpu clock support.
>>
>> The issue happens because clk_core_set_rate_nolock()  calls
>> clk_calc_new_rates(clk, rate) before both pre/post clock notifiers have
>> a chance to run.  In case of Exynos cpu clock support pre/post clock
>> notifiers are registered for mout_apll clock which is a parent of armclk
>> cpu clock and dividers are modified in both pre and post clock notifier.
>> This results in wrong dividers values being later programmed by
>> clk_change_rate(top).  To workaround the problem CLK_RECALC_NEW_RATES
>> flag is added and it is set for mout_apll clock later so the correct
>> divider values are re-calculated after both pre and post clock notifiers
>> had run.
>>
>> For example when using "performance" governor on Exynos4210 Origen board
>> the cpufreq-dt driver requests to change the frequency from 1000MHz to
>> 1200MHz and after the change state of the relevant clocks is following:
>>
>> Without use of CLK_GET_RATE_NOCACHE flag:
>>
>>  fout_apll rate: 12
>>  fout_apll_div_2 rate: 6
>>  mout_clkout_cpu rate: 6
>>  div_clkout_cpu rate: 6
>>  clkout_cpu rate: 6
>>  mout_apll rate: 12
>>  armclk rate: 12
>>  mout_hpm rate: 12
>>  div_copy rate: 3
>>  div_hpm rate: 3
>>  mout_core rate: 12
>>  div_core rate: 12
>>  div_core2 rate: 12
>>  arm_clk_div_2 rate: 6
>>  div_corem0 rate: 3
>>  div_corem1 rate: 15000
>>  div_periph rate: 3
>>  div_atb rate: 3
>>  div_pclk_dbg rate: 15000
>>  sclk_apll rate: 12
>>  sclk_apll_div_2 rate: 6
>>
>>
>> With use of CLK_GET_RATE_NOCACHE flag:
>>
>>  fout_apll rate: 12
>>  fout_apll_div_2 rate: 6
>>  mout_clkout_cpu rate: 6
>>  div_clkout_cpu rate: 6
>>  clkout_cpu rate: 6
>>  mout_apll rate: 12
>>  armclk rate: 12
>>  mout_hpm rate: 12
>>  div_copy rate: 2
>>  div_hpm rate: 2
>>  mout_core rate: 12
>>  div_core rate: 12
>>  div_core2 rate: 12
>>  arm_clk_div_2 rate: 6
>>  div_corem0 rate: 3
>>  div_corem1 rate: 15000
>>  div_periph rate: 3
>>  div_atb rate: 24000
>>  div_pclk_dbg rate: 12000
>>  sclk_apll rate: 15000
>>  sclk_apll_div_2 rate: 7500
>>
>> Without this change cpufreq-dt driver showed ~10 mA larger energy
>> consumption when compared to cpufreq-exynos one when "performance"
>> cpufreq governor was used on Exynos4210 SoC based Origen board.
>>
>> This issue was probably meant to be workarounded by use of
>> CLK_GET_RATE_NOCACHE and CLK_DIVIDER_READ_ONLY clock flags in
>> the original Exynos cpu clock patchset (in "[PATCH v12 6/6] clk:
>> samsung: remove unused clock aliases and update clock flags" patch)
>> but usage of these flags is not sufficient to fix the issue observed.
>>
>> Cc: Thomas Abraham 
>> Cc: Tomasz Figa 
>> Cc: Mike Turquette 
>> Cc: Javier Martinez Canillas 
>> Signed-off-by: Bartlomiej Zolnierkiewicz 
>> ---
>>  drivers/clk/clk.c|3 +++
>>  include/linux/clk-provider.h |1 +
>>  2 files ch

[tip:x86/apic] x86/hpet: Check for irq== 0 when allocating hpet MSI interrupts

2015-06-20 Thread tip-bot for Jiang Liu
Commit-ID:  bafac298fb20e9ae1305c710d4fd8d20c5911afa
Gitweb: http://git.kernel.org/tip/bafac298fb20e9ae1305c710d4fd8d20c5911afa
Author: Jiang Liu 
AuthorDate: Sat, 20 Jun 2015 11:50:50 +0200
Committer:  Thomas Gleixner 
CommitDate: Sat, 20 Jun 2015 12:00:58 +0200

x86/hpet: Check for irq==0 when allocating hpet MSI interrupts

irq == 0 is not a valid irq for a irqdomain MSI allocation, but hpet
code checks only for negative return values.

Reported-by: Sergey Senozhatsky 
Cc: Borislav Petkov 
Link: http://lkml.kernel.org/r/558447af.30...@linux.intel.com
Signed-off-by: Thomas Gleixner 
---
 arch/x86/kernel/hpet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index e2449cf..c47aab3 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -578,7 +578,7 @@ static void hpet_msi_capability_lookup(unsigned int 
start_timer)
continue;
 
irq = hpet_assign_irq(hpet_domain, hdev, hdev->num);
-   if (irq < 0)
+   if (irq <= 0)
continue;
 
sprintf(hdev->name, "hpet%d", i);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


careful review of kdbus

2015-06-20 Thread Martin Steigerwald
Hello!

In the light of

* kdbus support is no longer compile-time optional. It is now
  always built-in. However, it can still be disabled at
  runtime using the kdbus=0 kernel command line setting, and
  that setting may be changed to default to off, by specifying
  --disable-kdbus at build-time. Note though that the kernel
  command line setting has no effect if the kdbus.ko kernel
  module is not installed, in which case kdbus is (obviously)
  also disabled. We encourage all downstream distributions to
  begin testing kdbus by adding it to the kernel images in the
  development distributions, and leaving kdbus support in
  systemd enabled.

Lennart Poettering: [systemd-devel] [ANNOUNCE] systemd v221
http://lists.freedesktop.org/archives/systemd-devel/2015-June/033170.html

I hope you kernel developers will still review kdbus carefully as you did so 
far, instead of giving in to any downstream pressure by distros.

It is exactly this attitude and this approach of systemd upstream that I 
feel uneasy about. Instead of humbly waiting and working towards having 
kdbus accepted to the kernel, systemd developers seem to use any means to 
create indirect pressure to have it included eventually.

I hope that it will still be technical excellence as entry barrier for 
anything that goes into the kernel.

Please note: I do not judge upon the technical quality of kdbus. I think 
others are more knowledgeable to do it.

Thank you,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build failure after merge of the workqueues tree

2015-06-20 Thread Stephen Rothwell
Hi Tejun,

After merging the workqueues tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:

kernel/workqueue.c: In function 'unbound_pwq_by_node':
kernel/workqueue.c:570:2: error: implicit declaration of function 
'rcu_lockdep_assert' [-Werror=implicit-function-declaration]
  assert_rcu_or_wq_mutex_or_pool_mutex(wq);
  ^
kernel/workqueue.c:570:2: error: implicit declaration of function 
'lockdep_is_held' [-Werror=implicit-function-declaration]

Caused by commit:

  5b95e1af8d17 ("workqueue: wq_pool_mutex protects the attrs-installation")

from the workqueues tree interacting with commit:

  eeacf8982637 ("rcu: Rename rcu_lockdep_assert() to RCU_LOCKDEP_WARN()")

from the rcu tree.

I applied the followinf merge fix patch:

From: Stephen Rothwell 
Date: Sat, 20 Jun 2015 19:39:43 +1000
Subject: [PATCH] workqueue: fix up for rcu_lockdep_assert() rename

Signed-off-by: Stephen Rothwell 
---
 kernel/workqueue.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 837427cc5bdf..44cd4144ebcb 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -348,10 +348,10 @@ static void workqueue_sysfs_unregister(struct 
workqueue_struct *wq);
 "sched RCU or wq->mutex should be held")
 
 #define assert_rcu_or_wq_mutex_or_pool_mutex(wq)   \
-   rcu_lockdep_assert(rcu_read_lock_sched_held() ||\
-  lockdep_is_held(&wq->mutex) ||   \
-  lockdep_is_held(&wq_pool_mutex), \
-  "sched RCU, wq->mutex or wq_pool_mutex should be 
held")
+   RCU_LOCKDEP_WARN(!rcu_read_lock_sched_held() && \
+!lockdep_is_held(&wq->mutex) &&\
+!lockdep_is_held(&wq_pool_mutex),  \
+"sched RCU, wq->mutex or wq_pool_mutex should be held")
 
 #define for_each_cpu_worker_pool(pool, cpu)\
for ((pool) = &per_cpu(cpu_worker_pools, cpu)[0];   \
-- 
2.1.4

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgprstvLI0KkB.pgp
Description: OpenPGP digital signature


Re: [PATCH] staging: comedi: fix sparse warning in comedi_compat32.c

2015-06-20 Thread Sudip Mukherjee
On Sat, Jun 20, 2015 at 04:49:13PM +, Geliang Tang wrote:
> This patch fixes the following sparse warning:
> 
> drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
> address space of expression
> 
> Signed-off-by: Geliang Tang 
> ---
>  drivers/staging/comedi/comedi_compat32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/comedi_compat32.c 
> b/drivers/staging/comedi/comedi_compat32.c
> index 2584824..29a10fe4 100644
> --- a/drivers/staging/comedi/comedi_compat32.c
> +++ b/drivers/staging/comedi/comedi_compat32.c
> @@ -202,7 +202,7 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
>   err |= __get_user(temp.uint, &cmd32->stop_arg);
>   err |= __put_user(temp.uint, &cmd->stop_arg);
>   err |= __get_user(temp.uptr, &cmd32->chanlist);
> - err |= __put_user(compat_ptr(temp.uptr), &cmd->chanlist);
> + err |= __put_user((unsigned int __force *)compat_ptr(temp.uptr), 
> &cmd->chanlist);
compat_ptr is already a typecast.
static inline void __user *compat_ptr(compat_uptr_t uptr)
{
return (void __user *)(unsigned long)uptr;
}

so you are adding another typecast to an already exitsing typecast. :(

and besides, this also introduces one new checkpatch warning of
line more than 80 char.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/4] staging: sm750fb: use tabs for indentation

2015-06-20 Thread Sudip Mukherjee
On Sat, Jun 20, 2015 at 01:48:32AM -0700, Juston Li wrote:
> Replace spaces with tabs for indentation to fix the checkpatch.pl error
> ERROR: code indent should use tabs where possible
> WARNING: please, no spaces at the start of a line
> 
> Signed-off-by: Juston Li 
> ---

> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
> b/drivers/staging/sm750fb/ddk750_sii164.c
> index b6395b8..c09748c 100644
> --- a/drivers/staging/sm750fb/ddk750_sii164.c
> +++ b/drivers/staging/sm750fb/ddk750_sii164.c

>  
> @@ -279,27 +279,25 @@ char *sii164GetChipString(void)
>   *  Input:
>   *  powerUp - Flag to set the power down or up
>   */
> -void sii164SetPower(
> -unsigned char powerUp
> -)
> +void sii164SetPower(unsigned char powerUp)
is it that same patch again? different kind of change should go in a separate 
patch.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/4] staging: sm750fb: fix spacing issues

2015-06-20 Thread Sudip Mukherjee
On Sat, Jun 20, 2015 at 01:48:33AM -0700, Juston Li wrote:
> Fix spacing errors and warnings caught by checkpatch.pl
> ERROR: space prohibited after that open parenthesis '('
> ERROR: space required before the open brace '{'
> ERROR: need consistent spacing around
> ERROR: trailing whitespace
> WARNING: unnecessary whitespace before a quoted newline
these are again too many changes in a single patch. please break them
up so that each patch does a single type of change.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: build warnings after merge of the staging tree

2015-06-20 Thread Stephen Rothwell
Hi Greg,

On Mon, 1 Jun 2015 18:50:12 +1000 Stephen Rothwell  
wrote:
>
> On Fri, 29 May 2015 20:40:02 +1000 Stephen Rothwell  
> wrote:
> >
> > After merging the staging tree, today's linux-next build (x86_64
> > allmodconfig) produced a large number of warnings in
> > drivers/staging/wilc1000.
> 
> Since there are so many warnings, I have disabled the driver for now.

I tried building this with the driver enabled but it still produces and
inordinate number of warnings, so I have disabled it again.  Please
either get them sorted out or disable this driver before asking Linus
to merge it.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgps9Yu1C6XLd.pgp
Description: OpenPGP digital signature


Re: [PATCH v4 12/12] MIPS: Add basic support for the TL-WR1043ND version 1

2015-06-20 Thread Alban
On Mon, 15 Jun 2015 10:42:13 +0300
Antony Pavlov  wrote:

> On Wed, 10 Jun 2015 23:58:11 +0200
> Alban  wrote:
> 
> > On Mon, 8 Jun 2015 13:17:58 +0300
> > Antony Pavlov  wrote:
> > 
> > > IMHO AR9132 SoC can't work without external oscilator.
> > > 
> > > Can we just move basic extosc declaration to SoC dt file
> > > (ar9132.dtsi)? So board dt file ar9132_tl_wr1043nd_v1.dts will
> > > contain only oscilator clock frequency value.
> > 
> > I would prefer to keep the split between the files in sync with the
> > hardware. I understand that most simple board designs use a fixed
> > oscillator, but that might not always be the case.
> > 
> 
> The AR9132 SoC __always__ use one external oscilator.

Yes, but what I don't like is to impose the clock source being a
fixed-oscillator. What if the board use a clock from another
component that need to be represented in the DT as something else
than a fixed-oscillator?

> So it's reasonable to have the first mention of extosc in
> ar9132.dtsi not in a board file. This description style is always
> sync with hardware.

In your proposal it wouldn't as the AR9132 doesn't have a
fixed-oscillator on chip. So boards using another type of clock would
still have that fixed-oscillator hanging around.

> On the other hand pll-controller is always part
> of the SoC not a part of a board. So pll-controller on extosc
> dependency have to go to SoC dts file not to a board file. In your dts
> description pll-controller is a part of a dts board file.

The PLL controller shows up in the board DTS as the connection between
the SoC and the other components on boards has to be represented. We
could use a label and reference it in the board file but that is the
same in the end.

But that's not really the point, more important is the fact that DTS
don't allow to delete nodes. This mean that DTSI should really not
start to define more than is strictly needed.

Alban
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [x86/mm/pat, drivers/media/ivtv] WARNING: CPU: 0 PID: 1 at drivers/media/pci/ivtv/ivtvfb.c:1270 ivtvfb_init()

2015-06-20 Thread Borislav Petkov
On Sat, Jun 20, 2015 at 03:17:56PM +0800, Fengguang Wu wrote:
> Greetings,
> 
> 0day kernel testing robot got the below dmesg and the first bad commit is
> 
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
> 
> commit 1bf1735b478008c30acaff18ec6f4a3ff211c28a
> Author: Luis R. Rodriguez 
> AuthorDate: Mon Jun 15 10:28:16 2015 +0200
> Commit: Ingo Molnar 
> CommitDate: Thu Jun 18 11:23:41 2015 +0200
> 
> x86/mm/pat, drivers/media/ivtv: Use arch_phys_wc_add() and require PAT 
> disabled

...

> [   12.956506] ivtv: Start initialization, version 1.4.3
> [   12.958238] ivtv: End initialization
> [   12.959438] [ cut here ]
> [   12.974076] WARNING: CPU: 0 PID: 1 at drivers/media/pci/ivtv/ivtvfb.c:1270 
> ivtvfb_init+0x32/0xa3()
> [   12.978017] ivtvfb needs PAT disabled, boot with nopat kernel parameter

Warning says it all. You need to boot with "nopat". Apparently, those
devices are very seldom now and users should boot with "nopat".

Luis, what is the plan, is this driver supposed to be converted to
reserve_memtype(..., _PAGE_CACHE_MODE_WC, ...) at some point?

Thanks.

-- 
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: doubt about sm7xxfb (was: Re: [PATCH v4 0/7] staging: fsl-mc: New functionality to the MC bus driver)

2015-06-20 Thread Sudip Mukherjee
On Fri, Jun 19, 2015 at 01:29:13PM +0300, Dan Carpenter wrote:
> On Sat, Jun 13, 2015 at 02:16:18PM +0530, Sudip Mukherjee wrote:
> >
> > can you please have a look (when you are free) at it to see if anything
> > else needs to be done.
> 
> Remove any unused macros.
I will check.
> Cleanup indenting in the .h file.
done.
> drivers/staging/sm7xxfb/sm7xxfb.c:821 smtcfb_pci_probe() warn: 
> 'smtc_regbaseaddress' can't be NULL.
i dont see this warning. Is it smatch?
> move the BIG_ENDIAN ifdefs to the .h file.  I don't understand why only
> big endian systems get a fb_read/write?
Greg asked to remove the BIG_ENDIAN ifdefs. for BIG_ENDIAN some
calculations are involved that is why the functions are defined.
LITTLE_ENDIAN will use the default read/write provided by fb core.
> cleanup comments.  make sure they are up to date and make sense.
will do.
> cleanup function declarations.  Make the style consistent.
i think its already done, with Joe's help.
> run checkpatch.pl --strict
done.
> Remind me we need the #ifndef MODULE?
This one I introduced with the plan that if it is built-in then it will
use the commandline to get the mode, but if it is a module then it will
use module parameters. But later Greg told that framebuffers should not
use module_param. I dont see any reason why a module can nor get the mode
values from the command line. I will test that during this period of the
merge window and prepare the final patch.

regards
sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [Intel-gfx] [PATCH 6/8] drivers/pwm: Add Crystalcove (CRC) PWM driver

2015-06-20 Thread Paul Bolle
[Added Paul Gortmaker.]

Hi Shobhit,

On Fri, 2015-06-19 at 12:16 +0530, Shobhit Kumar wrote:
> So what is the exact big problem with this ?

The main problem I have is that it's hard to read a submitter's mind.
And, I think, in cases like this we need to know if the submitter just
made some silly mistake or that the mismatch (between Kconfig type and
code) was intentional. So each time such a mismatch is spotted the
submitter ought to be asked about it.

(I'd guess that one or two new drivers are submitted _each_ day. And
these mismatches are quite common. I'd say I receive answers like:
- "Oops, yes bool should have been tristate"; or
- "Oops, forgot to clean up after noticing tristate didn't work"; or
- "I just copy-and-pasted a similar driver, the module stuff isn't
  actually needed"
at least once a week. Not sure, I don't keep track of this stuff.)

Furthermore, it appears that Paul Gortmaker is on a mission to, badly
summarized, untangle the module and init code. See for instance
https://lkml.org/lkml/2015/5/28/809 and
https://lkml.org/lkml/2015/5/31/205 .

Now, I don't know whether (other) Paul is bothered by these MODULE_*
macros. But Paul did submit a series that adds
builtin_platform_driver(), see https://lkml.org/lkml/2015/5/10/131 .
That new macro ensures built-in only code doesn't have to use
module_platform_driver(), which your patch also uses. So perhaps Paul
can explain some of the non-obvious issues caused by built-in only code
using module specific constructs.

> I can anyway shove out these macros to end the discussion.

I'd rather convince you than annoy you into doing as I suggested.

> BTW whether you  buy the argument or not, please do treat yourself
> with ice cream for being able to make such a comment.

Will do.

Thanks,


Paul Bolle

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[RFC v2 0/3] mm: make swapin readahead to gain more thp performance

2015-06-20 Thread Ebru Akagunduz
This patch series makes swapin readahead up to a
certain number to gain more thp performance and adds
tracepoint for khugepaged_scan_pmd, collapse_huge_page,
__collapse_huge_page_isolate.

This patch series was written to deal with programs
that access most, but not all, of their memory after
they get swapped out. Currently these programs do not
get their memory collapsed into THPs after the system
swapped their memory out, while they would get THPs
before swapping happened.

This patch series was tested with a test program,
it allocates 800MB of memory, writes to it, and
then sleeps. I force the system to swap out all.
Afterwards, the test program touches the area by
writing and leaves a piece of it without writing.
This shows how much swap in readahead made by the
patch.

Test results:

After swapped out
---
  | Anonymous | AnonHugePages | Swap  | Fraction  |
---
With patch| 265772 kB | 264192 kB | 534232 kB |%99|
---
Without patch | 238160 kB | 235520 kB | 561844 kB |%98|
---

After swapped in
---
  | Anonymous | AnonHugePages | Swap  | Fraction  |
---
With patch| 532756 kB | 528384 kB | 267248 kB |%99|
---
Without patch | 499956 kB | 235520 kB | 300048 kB |%47|
---

Ebru Akagunduz (3):
  mm: add tracepoint for scanning pages
  mm: make optimistic check for swapin readahead
  mm: make swapin readahead to improve thp collapse rate

 include/linux/mm.h |   4 ++
 include/trace/events/huge_memory.h | 123 +
 mm/huge_memory.c   |  58 -
 mm/memory.c|   2 +-
 4 files changed, 183 insertions(+), 4 deletions(-)
 create mode 100644 include/trace/events/huge_memory.h

-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[RFC v2 1/3] mm: add tracepoint for scanning pages

2015-06-20 Thread Ebru Akagunduz
Using static tracepoints, data of functions is recorded.
It is good to automatize debugging without doing a lot
of changes in the source code.

This patch adds tracepoint for khugepaged_scan_pmd,
collapse_huge_page and __collapse_huge_page_isolate.

Signed-off-by: Ebru Akagunduz 
Acked-by: Rik van Riel 
---
Changes in v2:
 - Nothing changed

 include/trace/events/huge_memory.h | 96 ++
 mm/huge_memory.c   | 10 +++-
 2 files changed, 105 insertions(+), 1 deletion(-)
 create mode 100644 include/trace/events/huge_memory.h

diff --git a/include/trace/events/huge_memory.h 
b/include/trace/events/huge_memory.h
new file mode 100644
index 000..4b9049b
--- /dev/null
+++ b/include/trace/events/huge_memory.h
@@ -0,0 +1,96 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM huge_memory
+
+#if !defined(__HUGE_MEMORY_H) || defined(TRACE_HEADER_MULTI_READ)
+#define __HUGE_MEMORY_H
+
+#include  
+
+TRACE_EVENT(mm_khugepaged_scan_pmd,
+
+   TP_PROTO(struct mm_struct *mm, unsigned long vm_start, bool writable,
+   bool referenced, int none_or_zero, int collapse),
+
+   TP_ARGS(mm, vm_start, writable, referenced, none_or_zero, collapse),
+
+   TP_STRUCT__entry(
+   __field(struct mm_struct *, mm)
+   __field(unsigned long, vm_start)
+   __field(bool, writable)
+   __field(bool, referenced)
+   __field(int, none_or_zero)
+   __field(int, collapse)
+   ),
+
+   TP_fast_assign(
+   __entry->mm = mm;
+   __entry->vm_start = vm_start;
+   __entry->writable = writable;
+   __entry->referenced = referenced;
+   __entry->none_or_zero = none_or_zero;
+   __entry->collapse = collapse;
+   ),
+
+   TP_printk("mm=%p, vm_start=%04lx, writable=%d, referenced=%d, 
none_or_zero=%d, collapse=%d",
+   __entry->mm,
+   __entry->vm_start,
+   __entry->writable,
+   __entry->referenced,
+   __entry->none_or_zero,
+   __entry->collapse)
+);
+
+TRACE_EVENT(mm_collapse_huge_page,
+
+   TP_PROTO(struct mm_struct *mm, unsigned long vm_start, int isolated),
+
+   TP_ARGS(mm, vm_start, isolated),
+
+   TP_STRUCT__entry(
+   __field(struct mm_struct *, mm)
+   __field(unsigned long, vm_start)
+   __field(int, isolated)
+   ),
+
+   TP_fast_assign(
+   __entry->mm = mm;
+   __entry->vm_start = vm_start;
+   __entry->isolated = isolated;
+   ),
+
+   TP_printk("mm=%p, vm_start=%04lx, isolated=%d",
+   __entry->mm,
+   __entry->vm_start,
+   __entry->isolated)
+);
+
+TRACE_EVENT(mm_collapse_huge_page_isolate,
+
+   TP_PROTO(unsigned long vm_start, int none_or_zero,
+   bool referenced, bool  writable),
+
+   TP_ARGS(vm_start, none_or_zero, referenced, writable),
+
+   TP_STRUCT__entry(
+   __field(unsigned long, vm_start)
+   __field(int, none_or_zero)
+   __field(bool, referenced)
+   __field(bool, writable)
+   ),
+
+   TP_fast_assign(
+   __entry->vm_start = vm_start;
+   __entry->none_or_zero = none_or_zero;
+   __entry->referenced = referenced;
+   __entry->writable = writable;
+   ),
+
+   TP_printk("vm_start=%04lx, none_or_zero=%d, referenced=%d, writable=%d",
+   __entry->vm_start,
+   __entry->none_or_zero,
+   __entry->referenced,
+   __entry->writable)
+);
+
+#endif /* __HUGE_MEMORY_H */
+#include 
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9671f51..9bb97fc 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -29,6 +29,9 @@
 #include 
 #include "internal.h"
 
+#define CREATE_TRACE_POINTS
+#include 
+
 /*
  * By default transparent hugepage support is disabled in order that avoid
  * to risk increase the memory footprint of applications without a guaranteed
@@ -2266,6 +2269,8 @@ static int __collapse_huge_page_isolate(struct 
vm_area_struct *vma,
if (likely(referenced && writable))
return 1;
 out:
+   trace_mm_collapse_huge_page_isolate(vma->vm_start, none_or_zero,
+   referenced, writable);
release_pte_pages(pte, _pte);
return 0;
 }
@@ -2501,7 +2506,7 @@ static void collapse_huge_page(struct mm_struct *mm,
pgtable_t pgtable;
struct page *new_page;
spinlock_t *pmd_ptl, *pte_ptl;
-   int isolated;
+   int isolated = 0;
unsigned long hstart, hend;
struct mem_cgroup *memcg;
unsigned long mmun_start;   /* For mmu_notifiers */
@@ -2619,6 +2624,7 @@ static void collapse_huge_page(struct mm_struct *mm,
khugepaged_pages_collapsed++;
 out_up_write:
up_write(&mm->mmap_sem

[RFC v2 2/3] mm: make optimistic check for swapin readahead

2015-06-20 Thread Ebru Akagunduz
This patch makes optimistic check for swapin readahead
to increase thp collapse rate. Before getting swapped
out pages to memory, checks them and allows up to a
certain number. It also prints out using tracepoints
amount of unmapped ptes.

Signed-off-by: Ebru Akagunduz 
---
Changes in v2:
 - Nothing changed

 include/trace/events/huge_memory.h | 11 +++
 mm/huge_memory.c   | 13 ++---
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/include/trace/events/huge_memory.h 
b/include/trace/events/huge_memory.h
index 4b9049b..53c9f2e 100644
--- a/include/trace/events/huge_memory.h
+++ b/include/trace/events/huge_memory.h
@@ -9,9 +9,9 @@
 TRACE_EVENT(mm_khugepaged_scan_pmd,
 
TP_PROTO(struct mm_struct *mm, unsigned long vm_start, bool writable,
-   bool referenced, int none_or_zero, int collapse),
+   bool referenced, int none_or_zero, int collapse, int unmapped),
 
-   TP_ARGS(mm, vm_start, writable, referenced, none_or_zero, collapse),
+   TP_ARGS(mm, vm_start, writable, referenced, none_or_zero, collapse, 
unmapped),
 
TP_STRUCT__entry(
__field(struct mm_struct *, mm)
@@ -20,6 +20,7 @@ TRACE_EVENT(mm_khugepaged_scan_pmd,
__field(bool, referenced)
__field(int, none_or_zero)
__field(int, collapse)
+   __field(int, unmapped)
),
 
TP_fast_assign(
@@ -29,15 +30,17 @@ TRACE_EVENT(mm_khugepaged_scan_pmd,
__entry->referenced = referenced;
__entry->none_or_zero = none_or_zero;
__entry->collapse = collapse;
+   __entry->unmapped = unmapped;
),
 
-   TP_printk("mm=%p, vm_start=%04lx, writable=%d, referenced=%d, 
none_or_zero=%d, collapse=%d",
+   TP_printk("mm=%p, vm_start=%04lx, writable=%d, referenced=%d, 
none_or_zero=%d, collapse=%d, unmapped=%d",
__entry->mm,
__entry->vm_start,
__entry->writable,
__entry->referenced,
__entry->none_or_zero,
-   __entry->collapse)
+   __entry->collapse,
+   __entry->unmapped)
 );
 
 TRACE_EVENT(mm_collapse_huge_page,
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9bb97fc..22bc0bf 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -2639,11 +2640,11 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
 {
pmd_t *pmd;
pte_t *pte, *_pte;
-   int ret = 0, none_or_zero = 0;
+   int ret = 0, none_or_zero = 0, unmapped = 0;
struct page *page;
unsigned long _address;
spinlock_t *ptl;
-   int node = NUMA_NO_NODE;
+   int node = NUMA_NO_NODE, max_ptes_swap = HPAGE_PMD_NR/8;
bool writable = false, referenced = false;
 
VM_BUG_ON(address & ~HPAGE_PMD_MASK);
@@ -2657,6 +2658,12 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
for (_address = address, _pte = pte; _pte < pte+HPAGE_PMD_NR;
 _pte++, _address += PAGE_SIZE) {
pte_t pteval = *_pte;
+   if (is_swap_pte(pteval)) {
+   if (++unmapped <= max_ptes_swap)
+   continue;
+   else
+   goto out_unmap;
+   }
if (pte_none(pteval) || is_zero_pfn(pte_pfn(pteval))) {
if (!userfaultfd_armed(vma) &&
++none_or_zero <= khugepaged_max_ptes_none)
@@ -2701,7 +2708,7 @@ static int khugepaged_scan_pmd(struct mm_struct *mm,
 out_unmap:
pte_unmap_unlock(pte, ptl);
trace_mm_khugepaged_scan_pmd(mm, vma->vm_start, writable, referenced,
-none_or_zero, ret);
+none_or_zero, ret, unmapped);
if (ret) {
node = khugepaged_find_target_node();
/* collapse_huge_page will return with the mmap_sem released */
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[RFC v2 3/3] mm: make swapin readahead to improve thp collapse rate

2015-06-20 Thread Ebru Akagunduz
This patch makes swapin readahead to improve thp collapse rate.
When khugepaged scanned pages, there can be a few of the pages
in swap area.

With the patch THP can collapse 4kB pages into a THP when
there are up to max_ptes_swap swap ptes in a 2MB range.

The patch was tested with a test program that allocates
800MB of memory, writes to it, and then sleeps. I force
the system to swap out all. Afterwards, the test program
touches the area by writing, it skips a page in each
20 pages of the area.

Without the patch, system did not swap in readahead.
THP rate was %47 of the program of the memory, it
did not change over time.

With this patch, after 10 minutes of waiting khugepaged had
collapsed %99 of the program's memory.

Signed-off-by: Ebru Akagunduz 
Acked-by: Rik van Riel 
---
Changes in v2:
 - Use FAULT_FLAG_ALLOW_RETRY|FAULT_FLAG_RETRY_NOWAIT flag
   instead of 0x0 when called do_swap_page
   from __collapse_huge_page_swapin

Test results:

After swapped out
---
  | Anonymous | AnonHugePages | Swap  | Fraction  |
---
With patch| 265772 kB | 264192 kB | 534232 kB |%99|
---
Without patch | 238160 kB | 235520 kB | 561844 kB |%98|
---

After swapped in
---
  | Anonymous | AnonHugePages | Swap  | Fraction  |
---
With patch| 532756 kB | 528384 kB | 267248 kB |%99|
---
Without patch | 499956 kB | 235520 kB | 300048 kB |%47|
---

 include/linux/mm.h |  4 
 include/trace/events/huge_memory.h | 24 
 mm/huge_memory.c   | 37 +
 mm/memory.c|  2 +-
 4 files changed, 66 insertions(+), 1 deletion(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 7f47178..f66ff8a 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -29,6 +29,10 @@ struct user_struct;
 struct writeback_control;
 struct bdi_writeback;
 
+extern int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
+   unsigned long address, pte_t *page_table, pmd_t *pmd,
+   unsigned int flags, pte_t orig_pte);
+
 #ifndef CONFIG_NEED_MULTIPLE_NODES /* Don't use mapnrs, do it properly */
 extern unsigned long max_mapnr;
 
diff --git a/include/trace/events/huge_memory.h 
b/include/trace/events/huge_memory.h
index 53c9f2e..0117ab9 100644
--- a/include/trace/events/huge_memory.h
+++ b/include/trace/events/huge_memory.h
@@ -95,5 +95,29 @@ TRACE_EVENT(mm_collapse_huge_page_isolate,
__entry->writable)
 );
 
+TRACE_EVENT(mm_collapse_huge_page_swapin,
+
+   TP_PROTO(struct mm_struct *mm, unsigned long vm_start, int swap_pte),
+
+   TP_ARGS(mm, vm_start, swap_pte),
+
+   TP_STRUCT__entry(
+   __field(struct mm_struct *, mm)
+   __field(unsigned long, vm_start)
+   __field(int, swap_pte)
+   ),
+
+   TP_fast_assign(
+   __entry->mm = mm;
+   __entry->vm_start = vm_start;
+   __entry->swap_pte = swap_pte;
+   ),
+
+   TP_printk("mm=%p, vm_start=%04lx, swap_pte=%d",
+   __entry->mm,
+   __entry->vm_start,
+   __entry->swap_pte)
+);
+
 #endif /* __HUGE_MEMORY_H */
 #include 
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 22bc0bf..064fd72 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -2496,6 +2496,41 @@ static bool hugepage_vma_check(struct vm_area_struct 
*vma)
return true;
 }
 
+/*
+ * Bring missing pages in from swap, to complete THP collapse.
+ * Only done if khugepaged_scan_pmd believes it is worthwhile.
+ *
+ * Called and returns without pte mapped or spinlocks held,
+ * but with mmap_sem held to protect against vma changes.
+ */
+
+static void __collapse_huge_page_swapin(struct mm_struct *mm,
+   struct vm_area_struct *vma,
+   unsigned long address, pmd_t *pmd,
+   pte_t *pte)
+{
+   unsigned long _address;
+   pte_t pteval = *pte;
+   int swap_pte = 0;
+
+   pte = pte_offset_map(pmd, address);
+   for (_address = address; _address < address + HPAGE_PMD_NR*PAGE_SIZE;
+pte++, _address += PAGE_SIZE) {
+   pteval = *pte;
+   if (is_swap_pte(pteval)) {
+   swap_pte++;
+   do_sw

Re: [PATCH] perf annotate: With --show-total-period, display total # of samples.

2015-06-20 Thread Martin Liška
On 06/19/2015 09:10 PM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Jun 19, 2015 at 11:35:41AM +0200, Martin Liška escreveu:
>> Thank you for the review, all remarks were reasonable.
>> Feel free to comment next version (v3) of the patch.
> 
> Thanks, there was just one missing s/tuples/samples/g, I did it and
> tried running git-am on the attached patch, it failed, so I applied it
> manually.
> 
> - Arnaldo
> 

Hello Arnaldo.

Thank you for help, as I followed the documentation related to Thunderbird,
all spaces and tabs should gone. I still suspect that's culprit of the failure?

Martin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the rtc tree with the mfd tree

2015-06-20 Thread Stephen Rothwell
Hi Alexandre,

Today's linux-next merge of the rtc tree got a conflict in:

  drivers/rtc/Makefile

between commit:

  b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC")

from the mfd tree and commit:

  766218609678 ("rtc: Properly sort Makefile")

from the rtc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

diff --cc drivers/rtc/Makefile
index ebe2c085d01c,5ea5370f56f2..
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@@ -135,6 -139,6 +139,7 @@@ obj-$(CONFIG_RTC_DRV_SPEAR)+= rtc-spea
  obj-$(CONFIG_RTC_DRV_STARFIRE)+= rtc-starfire.o
  obj-$(CONFIG_RTC_DRV_STK17TA8)+= rtc-stk17ta8.o
  obj-$(CONFIG_RTC_DRV_STMP)+= rtc-stmp3xxx.o
++obj-$(CONFIG_RTC_DRV_ST_LPC)  += rtc-st-lpc.o
  obj-$(CONFIG_RTC_DRV_SUN4V)   += rtc-sun4v.o
  obj-$(CONFIG_RTC_DRV_SUN6I)   += rtc-sun6i.o
  obj-$(CONFIG_RTC_DRV_SUNXI)   += rtc-sunxi.o


pgpZVUkd3R_Ws.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the nvdimm tree with Linus' tree

2015-06-20 Thread Stephen Rothwell
Hi Dan,

Today's linux-next merge of the nvdimm tree got a conflict in:

  drivers/block/Kconfig

between commit:

  b6f2098fb708 ("block: pmem: Add dependency on HAS_IOMEM")

from Linus' tree and commit:

  1ffe3c5dc311 ("libnvdimm, pmem: move pmem to drivers/nvdimm/")

from the nvdimm tree.

I fixed it up (the latter incorporated the change from the former)
and can carry the fix as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpaKJjMKhiFI.pgp
Description: OpenPGP digital signature


Re: [PATCH v7 00/16] libnvdimm: non-volatile memory devices

2015-06-20 Thread Stephen Rothwell
Hi Dan,

On Wed, 17 Jun 2015 19:13:19 -0400 Dan Williams  
wrote:
>
> A new sub-system in support of non-volatile memory storage devices.
> 
> Stephen, please add libnvdimm-for-next to -next:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm libnvdimm-for-next

Thanks for adding your subsystem tree as a participant of linux-next.  As
you may know, this is not a judgment of your code.  The purpose of
linux-next is for integration testing and to lower the impact of
conflicts between subsystems in the next merge window. 

You will need to ensure that the patches/commits in your tree/series have
been:
 * submitted under GPL v2 (or later) and include the Contributor's
Signed-off-by,
 * posted to the relevant mailing list,
 * reviewed by you (or another maintainer of your subsystem tree),
 * successfully unit tested, and 
 * destined for the current or next Linux merge window.

Basically, this should be just what you would send to Linus (or ask him
to fetch).  It is allowed to be rebased if you deem it necessary.

-- 
Cheers,
Stephen Rothwell 
s...@canb.auug.org.au


pgpXJ9kxxbLSd.pgp
Description: OpenPGP digital signature


Re: [PATCH 0/6] Staging: comedi: Simplify a trivial if-return sequence

2015-06-20 Thread Ian Abbott

On 19/06/15 06:59, Abdul, Hussain (H.) wrote:



This patch simplify a trivial if-return sequence. Possibly combine with
a preceding function call.

Abdul Hussain (6):
 staging: comedi: dmm32at: Simplify a trivial if-return sequence
 staging: comedi: fl512: Simplify a trivial if-return sequence
 staging: comedi: daqboard2000: Simplify a trivial if-return sequence
 staging: comedi: dac02: Simplify a trivial if-return sequence
 staging: comedi: daq_dio24: Simplify a trivial if-return sequence
 staging: comedi: s626: Simplify a trivial if-return sequence


drivers/staging/comedi/drivers/dac02.c| 6 +-
drivers/staging/comedi/drivers/daqboard2000.c | 7 +--
drivers/staging/comedi/drivers/dmm32at.c  | 6 +-
drivers/staging/comedi/drivers/fl512.c| 6 +-
drivers/staging/comedi/drivers/ni_daq_dio24.c | 6 +-
drivers/staging/comedi/drivers/s626.c | 6 +-



Looks good apart from the checkpatch warning in patch 3 as pointed out 
by Sudip.


For patches 1-2 and 4-6:
Reviewed-by: Ian Abbott 

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: comedi: fix sparse warning in ni_mio_common.c

2015-06-20 Thread Ian Abbott

On 20/06/15 17:47, Geliang Tang wrote:

This patch fixes the following sparse warning:

drivers/staging/comedi/drivers/ni_mio_common.c:573:26: warning: shift
too big (4294967295) for type int

Signed-off-by: Geliang Tang 
---
  drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
b/drivers/staging/comedi/drivers/ni_mio_common.c
index 6cc304a..420f752 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -570,7 +570,7 @@ static inline void ni_set_bitfield(struct comedi_device 
*dev, int reg,
  static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
  {
if (channel < 4)
-   return 1 << channel;
+   return 1 << (channel & 0x03);
if (channel == 4)
return 0x3;
if (channel == 5)



Surely that's a false positive sparse warning?

--
-=( Ian Abbott @ MEV Ltd.E-mail:  )=-
-=(  Web: http://www.mev.co.uk/  )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging:rtl8723au:odm.c:Removing trailing whitespaces

2015-06-20 Thread Joglekar, Tejas (T.)
From: Joglekar Tejas 

This patch removes the trailing whitespace error given
by checkpatch.pl

Signed-off-by: Joglekar Tejas 
---
 drivers/staging/rtl8723au/hal/odm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/odm.c 
b/drivers/staging/rtl8723au/hal/odm.c
index f354f5e..6b9dbef 100644
--- a/drivers/staging/rtl8723au/hal/odm.c
+++ b/drivers/staging/rtl8723au/hal/odm.c
@@ -985,7 +985,7 @@ void ODM_RF_Saving23a(struct dm_odm_t *pDM_Odm, u8 
bForceInNormal)
val32 = rtl8723au_read32(adapter, 0x874);
val32 |= pDM_PSTable->Reg874;
rtl8723au_write32(adapter, 0x874, val32);
-   
+
val32 = rtl8723au_read32(adapter, 0xc70);
val32 |= pDM_PSTable->RegC70;
rtl8723au_write32(adapter, 0xc70, val32);
-- 
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build warnings after merge of the net-next tree

2015-06-20 Thread Stephen Rothwell
Hi all,

After merging the net-next tree, today's linux-next build (i386 defconfig)
produced these warnings:

In file included from include/net/netfilter/nf_conntrack_tuple.h:13:0,
 from include/linux/netfilter/nf_conntrack_dccp.h:28,
 from include/net/netfilter/nf_conntrack.h:22,
 from net/netfilter/nf_conntrack_core.c:37:
include/linux/netfilter/x_tables.h: In function 'xt_percpu_counter_alloc':
include/linux/netfilter/x_tables.h:373:10: warning: cast from pointer to 
integer of different size [-Wpointer-to-int-cast]
   return (__force u64) res;
  ^
include/linux/netfilter/x_tables.h: In function 'xt_percpu_counter_free':
include/linux/netfilter/x_tables.h:381:15: warning: cast to pointer from 
integer of different size [-Wint-to-pointer-cast]
   free_percpu((void __percpu *) pcnt);
   ^
In file included from include/asm-generic/percpu.h:6:0,
 from arch/x86/include/asm/percpu.h:551,
 from arch/x86/include/asm/preempt.h:5,
 from include/linux/preempt.h:64,
 from include/linux/spinlock.h:50,
 from include/linux/mm_types.h:8,
 from include/linux/kmemcheck.h:4,
 from include/linux/skbuff.h:18,
 from include/linux/netfilter.h:5,
 from net/netfilter/nf_conntrack_core.c:16:
include/linux/netfilter/x_tables.h: In function 'xt_get_this_cpu_counter':
include/linux/netfilter/x_tables.h:388:23: warning: cast to pointer from 
integer of different size [-Wint-to-pointer-cast]
   return this_cpu_ptr((void __percpu *) cnt->pcnt);
   ^
include/linux/percpu-defs.h:206:47: note: in definition of macro 
'__verify_pcpu_ptr'
  const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
   ^
include/linux/percpu-defs.h:239:27: note: in expansion of macro 'raw_cpu_ptr'
 #define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
   ^
include/linux/netfilter/x_tables.h:388:10: note: in expansion of macro 
'this_cpu_ptr'
   return this_cpu_ptr((void __percpu *) cnt->pcnt);
  ^

and many more.

Introduced by commit:

  71ae0dff02d7 ("netfilter: xtables: use percpu rule counters")

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpJIuqtRp4lv.pgp
Description: OpenPGP digital signature


Re: [PATCH 3/4] media: pxa_camera: trivial move of dma irq functions

2015-06-20 Thread Guennadi Liakhovetski
On Sun, 22 Mar 2015, Robert Jarzmik wrote:

> From: Robert Jarzmik 
> 
> This moves the dma irq handling functions up in the source file, so that
> they are available before DMA preparation functions. It prepares the
> conversion to DMA engine, where the descriptors are populated with these
> functions as callbacks.
> 
> Signed-off-by: Robert Jarzmik 
> ---
>  drivers/media/platform/soc_camera/pxa_camera.c | 40 
> ++
>  1 file changed, 22 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c 
> b/drivers/media/platform/soc_camera/pxa_camera.c
> index c0c0f0f..8b39f44 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -311,6 +311,28 @@ static int calculate_dma_sglen(struct scatterlist 
> *sglist, int sglen,
>  
>   BUG_ON(size != 0);
>   return i + 1;
> +static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
> +enum pxa_camera_active_dma act_dma);
> +
> +static void pxa_camera_dma_irq_y(void *data)

Wait, how is this patch trivial? You change pxa_camera_dma_irq_?() 
prototypes, which are used as PXA DMA callbacks. Does this mean, that 
either before or after this patch compilation is broken?

Thanks
Guennadi

> +{
> + struct pxa_camera_dev *pcdev = data;
> +
> + pxa_camera_dma_irq(pcdev, DMA_Y);
> +}
> +
> +static void pxa_camera_dma_irq_u(void *data)
> +{
> + struct pxa_camera_dev *pcdev = data;
> +
> + pxa_camera_dma_irq(pcdev, DMA_U);
> +}
> +
> +static void pxa_camera_dma_irq_v(void *data)
> +{
> + struct pxa_camera_dev *pcdev = data;
> +
> + pxa_camera_dma_irq(pcdev, DMA_V);
>  }
>  
>  /**
> @@ -810,24 +832,6 @@ out:
>   spin_unlock_irqrestore(&pcdev->lock, flags);
>  }
>  
> -static void pxa_camera_dma_irq_y(int channel, void *data)
> -{
> - struct pxa_camera_dev *pcdev = data;
> - pxa_camera_dma_irq(channel, pcdev, DMA_Y);
> -}
> -
> -static void pxa_camera_dma_irq_u(int channel, void *data)
> -{
> - struct pxa_camera_dev *pcdev = data;
> - pxa_camera_dma_irq(channel, pcdev, DMA_U);
> -}
> -
> -static void pxa_camera_dma_irq_v(int channel, void *data)
> -{
> - struct pxa_camera_dev *pcdev = data;
> - pxa_camera_dma_irq(channel, pcdev, DMA_V);
> -}
> -
>  static struct videobuf_queue_ops pxa_videobuf_ops = {
>   .buf_setup  = pxa_videobuf_setup,
>   .buf_prepare= pxa_videobuf_prepare,
> -- 
> 2.1.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the akpm tree with the v4l-dvb tree

2015-06-20 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  drivers/media/v4l2-core/videobuf2-dma-sg.c

between commit:

  511a1b8a4c81 ("[media] Revert "[media] vb2: Push mmap_sem down to memops"")

from the v4l-dvb tree and patch:

  "media: vb2: convert vb2_dma_sg_get_userptr() to use frame vector"

from the akpm tree.

I fixed it up (I just used the akpm tree version) and can carry the fix
as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpgj31EYmXEX.pgp
Description: OpenPGP digital signature


Re: [PATCH v3 08/18] baycom_epp: Replace rdtscl() with native_read_tsc()

2015-06-20 Thread walter harms
Acked-by: walter harms 

Am 17.06.2015 02:35, schrieb Andy Lutomirski:
> This is only used if BAYCOM_DEBUG is defined.
> 
> Cc: walter harms 
> Cc: Ralf Baechle 
> Cc: Thomas Sailer 
> Cc: linux-h...@vger.kernel.org
> Signed-off-by: Andy Lutomirski 
> ---
> 
> I'm hoping for an ack for this to go through -tip.
> 
>  drivers/net/hamradio/baycom_epp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/hamradio/baycom_epp.c 
> b/drivers/net/hamradio/baycom_epp.c
> index 83c7cce0d172..44e5c3b5e0af 100644
> --- a/drivers/net/hamradio/baycom_epp.c
> +++ b/drivers/net/hamradio/baycom_epp.c
> @@ -638,7 +638,7 @@ static int receive(struct net_device *dev, int cnt)
>  #define GETTICK(x)\
>  ({\
>   if (cpu_has_tsc)  \
> - rdtscl(x);\
> + x = (unsigned int)native_read_tsc();  \
>  })
>  #else /* __i386__ */
>  #define GETTICK(x)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the akpm tree with the v4l-dvb tree

2015-06-20 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  drivers/media/v4l2-core/videobuf2-vmalloc.c

between commit:

  511a1b8a4c81 ("[media] Revert "[media] vb2: Push mmap_sem down to memops"")

from the v4l-dvb tree and patch:

  "media: vb2: Convert vb2_vmalloc_get_userptr() to use frame vector"

from the akpm tree.

I fixed it up (I just used the akpm tree version) and can carry the fix
as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp62pvn9f5Qz.pgp
Description: OpenPGP digital signature


linux-next: manual merge of the akpm tree with the v4l-dvb tree

2015-06-20 Thread Stephen Rothwell
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

  drivers/media/v4l2-core/videobuf2-dma-contig.c

between commit:

  511a1b8a4c81 ("[media] Revert "[media] vb2: Push mmap_sem down to memops"")

from the v4l-dvb tree and patch:

  "media: vb2: convert vb2_dc_get_userptr() to use frame vector"

from the akpm tree.

I fixed it up (I just used the akpm tree version) and can carry the fix
as necessary (no action is required).

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp3VCwZaEtar.pgp
Description: OpenPGP digital signature


Re: [PATCH 1/2] genirq: add chip_{suspend,resume} PM support to irq_chip

2015-06-20 Thread Thomas Gleixner
On Fri, 19 Jun 2015, Brian Norris wrote:
> This patch adds a second set of suspend/resume hooks to irq_chip, this
> time to represent *chip* suspend/resume, rather than IRQ suspend/resume.
> These callbacks will always be called for an irqchip and are based on
> the per-chip irq_chip_generic struct, rather than the per-IRQ irq_data
> struct.

There is no per-chip irq_chip_generic struct. It's only there if the
irq chip has been instantiated as a generic chip.
 
>  /**
>   * struct irq_chip - hardware interrupt chip descriptor
>   *
> @@ -317,6 +319,12 @@ static inline irq_hw_number_t irqd_to_hwirq(struct 
> irq_data *d)
>   * @irq_suspend: function called from core code on suspend once per chip
>   * @irq_resume:  function called from core code on resume once 
> per chip
>   * @irq_pm_shutdown: function called from core code on shutdown once per chip
> + * @chip_suspend:function called from core code on suspend once per
> + *   chip; for handling chip details even when no interrupts
> + *   are in use
> + * @chip_resume: function called from core code on resume once per chip;
> + *   for handling chip details even when no interrupts are
> + *   in use
>   * @irq_calc_mask:   Optional function to set irq_data.mask for special cases
>   * @irq_print_chip:  optional to print special chip info in show_interrupts
>   * @irq_request_resources:   optional to request resources before calling
> @@ -357,6 +365,8 @@ struct irq_chip {
>   void(*irq_suspend)(struct irq_data *data);
>   void(*irq_resume)(struct irq_data *data);
>   void(*irq_pm_shutdown)(struct irq_data *data);
> + void(*chip_suspend)(struct irq_chip_generic *gc);
> + void(*chip_resume)(struct irq_chip_generic *gc);

I really don't want to set a precedent for random (*foo)(*bar)
callbacks.
 
> +
> + if (ct->chip.chip_suspend)
> + ct->chip.chip_suspend(gc);

So wouldn't it be the more intuitive solution to make this a callback
in the struct gc itself?

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 08/18] baycom_epp: Replace rdtscl() with native_read_tsc()

2015-06-20 Thread Thomas Gleixner
On Sat, 20 Jun 2015, walter harms wrote:

> Acked-by: walter harms 
> 
> Am 17.06.2015 02:35, schrieb Andy Lutomirski:
> > This is only used if BAYCOM_DEBUG is defined.

So why don't we just replace that by ktime_get() and get rid of the
x86'ism in that driver.
 
Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 0/6] add device tree support for mxc rtc

2015-06-20 Thread Philippe Reynes
This serie add the device tree support for the mxc rtc driver.
To do this, three steps are required :
- define two rtc clocks for imx31 and imx35
- enhance mxc rtc driver to use two clocks (rtc and ipg)
- add device tree support to mxc rtc driver

Changelog:
v2: (thanks Shawn Guo and Alexandre Belloni)
- add a second clock to imx35
- split the add of clock in a separate patches
- split the dt documentation in a separate patch

Philippe Reynes (6):
  imx31: add a second rtc clock
  imx35: define two clocks for rtc
  rtc: mxc: use a second rtc clock
  rtc: mxc: add support of device tree
  dt-binding: document the binding for mxc rtc
  apf27: dt: add support of internal rtc

 Documentation/devicetree/bindings/rtc/rtc-mxc.txt |   27 
 arch/arm/boot/dts/imx27-apf27.dts |4 ++
 arch/arm/boot/dts/imx27.dtsi  |   10 +
 arch/arm/mach-imx/clk-imx31.c |3 +-
 arch/arm/mach-imx/clk-imx35.c |6 ++-
 drivers/rtc/rtc-mxc.c |   45 -
 6 files changed, 83 insertions(+), 12 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mxc.txt

-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 2/6] imx35: define two clocks for rtc

2015-06-20 Thread Philippe Reynes
The imx35 don't define clocks for rtc.
This patch add two clocks, as needed
by the mxc rtc driver.

Signed-off-by: Philippe Reynes 
---
 arch/arm/mach-imx/clk-imx35.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index a0d2b57..8c2f507 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -51,7 +51,7 @@ static const char *std_sel[] = {"ppll", "arm"};
 static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};
 
 enum mx35_clks {
-   ckih, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
+   ckih, ckil, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
arm_per_div, ahb_per_div, ipg_per, uart_sel, uart_div, esdhc_sel,
esdhc1_div, esdhc2_div, esdhc3_div, spdif_sel, spdif_div_pre,
spdif_div_post, ssi_sel, ssi1_div_pre, ssi1_div_post, ssi2_div_pre,
@@ -89,6 +89,7 @@ int __init mx35_clocks_init(void)
}
 
clk[ckih] = imx_clk_fixed("ckih", 2400);
+   clk[ckil] = imx_clk_fixed("ckih", 32768);
clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MX35_CCM_MPCTL);
clk[ppll] = imx_clk_pllv1("ppll", "ckih", base + MX35_CCM_PPCTL);
 
@@ -240,6 +241,9 @@ int __init mx35_clocks_init(void)
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
+   /* i.mx35 has the i.mx21 type uart */
+   clk_register_clkdev(clk[ckil], "rtc", "imx21-rtc");
+   clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0");
clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.0");
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 5/6] dt-binding: document the binding for mxc rtc

2015-06-20 Thread Philippe Reynes
This adds documentation of device tree bindings for the
mxc rtc.

Cc: Rob Herring 
Cc: Pawel Moll 
Cc: Mark Rutland 
Cc: Ian Campbell 
Cc: Kumar Gala 
Cc: devicet...@vger.kernel.org
Signed-off-by: Philippe Reynes 
---
 Documentation/devicetree/bindings/rtc/rtc-mxc.txt |   27 +
 1 files changed, 27 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mxc.txt

diff --git a/Documentation/devicetree/bindings/rtc/rtc-mxc.txt 
b/Documentation/devicetree/bindings/rtc/rtc-mxc.txt
new file mode 100644
index 000..5505493
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-mxc.txt
@@ -0,0 +1,27 @@
+* Real Time Clock of the i.MX SoCs
+
+RTC controller for the i.MX SoCs
+
+Required properties:
+- compatible: Should be "fsl,imx1-rtc" or "fsl,imx21-rtc".
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- interrupts: IRQ line for the RTC.
+- clocks: should contain two entries:
+  * one for the input reference
+  * one for the the SoC RTC
+- clock-names: should contain:
+  * "rtc" for the input reference clock
+  * "ipg" for the SoC RTC clock
+
+Example:
+
+rtc@10007000 {
+   compatible = "fsl,imx21-rtc";
+   reg = <0x10007000 0x1000>;
+   interrupts = <22>;
+   clocks = <&clks IMX27_CLK_CKIL>,
+<&clks IMX27_CLK_RTC_IPG_GATE>;
+   clock-names = "rtc, "ipg";
+   status = "disabled";
+};
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 4/6] rtc: mxc: add support of device tree

2015-06-20 Thread Philippe Reynes
Add device tree support for the mxc rtc driver.

Signed-off-by: Philippe Reynes 
---
 drivers/rtc/rtc-mxc.c |   19 ++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index e916a91..befe2c2 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -16,6 +16,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #define RTC_INPUT_CLK_32768HZ  (0x00 << 5)
 #define RTC_INPUT_CLK_32000HZ  (0x01 << 5)
@@ -98,6 +100,15 @@ static struct platform_device_id imx_rtc_devtype[] = {
 };
 MODULE_DEVICE_TABLE(platform, imx_rtc_devtype);
 
+#ifdef CONFIG_OF
+static const struct of_device_id imx_rtc_dt_ids[] = {
+   { .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC },
+   { .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC },
+   {}
+};
+MODULE_DEVICE_TABLE(of, imx_rtc_dt_ids);
+#endif
+
 static inline int is_imx1_rtc(struct rtc_plat_data *data)
 {
return data->devtype == IMX1_RTC;
@@ -362,12 +373,17 @@ static int mxc_rtc_probe(struct platform_device *pdev)
u32 reg;
unsigned long rate;
int ret;
+   const struct of_device_id *of_id;
 
pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;
 
-   pdata->devtype = pdev->id_entry->driver_data;
+   of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
+   if (of_id)
+   pdata->devtype = (enum imx_rtc_type)of_id->data;
+   else
+   pdata->devtype = pdev->id_entry->driver_data;
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res);
@@ -481,6 +497,7 @@ static SIMPLE_DEV_PM_OPS(mxc_rtc_pm_ops, mxc_rtc_suspend, 
mxc_rtc_resume);
 static struct platform_driver mxc_rtc_driver = {
.driver = {
   .name= "mxc_rtc",
+  .of_match_table = of_match_ptr(imx_rtc_dt_ids),
   .pm  = &mxc_rtc_pm_ops,
},
.id_table = imx_rtc_devtype,
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 3/6] rtc: mxc: use a second rtc clock

2015-06-20 Thread Philippe Reynes
The mxc RTC needs two clocks, one for the input
reference, and one for the IP. But this driver
was only using one clock (for the reference).
This patch add the second clock (for the IP).

Signed-off-by: Philippe Reynes 
---
 drivers/rtc/rtc-mxc.c |   26 +-
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 09d422b..e916a91 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -79,7 +79,8 @@ struct rtc_plat_data {
struct rtc_device *rtc;
void __iomem *ioaddr;
int irq;
-   struct clk *clk;
+   struct clk *clk_rtc;
+   struct clk *clk_ipg;
struct rtc_time g_rtc_alarm;
enum imx_rtc_type devtype;
 };
@@ -373,17 +374,24 @@ static int mxc_rtc_probe(struct platform_device *pdev)
if (IS_ERR(pdata->ioaddr))
return PTR_ERR(pdata->ioaddr);
 
-   pdata->clk = devm_clk_get(&pdev->dev, NULL);
-   if (IS_ERR(pdata->clk)) {
-   dev_err(&pdev->dev, "unable to get clock!\n");
-   return PTR_ERR(pdata->clk);
+   pdata->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
+   if (IS_ERR(pdata->clk_ipg)) {
+   dev_err(&pdev->dev, "unable to get ipg clock!\n");
+   return PTR_ERR(pdata->clk_ipg);
}
 
-   ret = clk_prepare_enable(pdata->clk);
+   ret = clk_prepare_enable(pdata->clk_ipg);
if (ret)
return ret;
 
-   rate = clk_get_rate(pdata->clk);
+   pdata->clk_rtc = devm_clk_get(&pdev->dev, "rtc");
+   if (IS_ERR(pdata->clk_rtc)) {
+   dev_err(&pdev->dev, "unable to get rtc clock!\n");
+   ret = PTR_ERR(pdata->clk_rtc);
+   goto exit_put_clk;
+   }
+
+   rate = clk_get_rate(pdata->clk_rtc);
 
if (rate == 32768)
reg = RTC_INPUT_CLK_32768HZ;
@@ -432,7 +440,7 @@ static int mxc_rtc_probe(struct platform_device *pdev)
return 0;
 
 exit_put_clk:
-   clk_disable_unprepare(pdata->clk);
+   clk_disable_unprepare(pdata->clk_ipg);
 
return ret;
 }
@@ -441,7 +449,7 @@ static int mxc_rtc_remove(struct platform_device *pdev)
 {
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
 
-   clk_disable_unprepare(pdata->clk);
+   clk_disable_unprepare(pdata->clk_ipg);
 
return 0;
 }
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 1/6] imx31: add a second rtc clock

2015-06-20 Thread Philippe Reynes
The mxc rtc driver needs two clock.
It was defined only one clock, so we
define the second clock.

Signed-off-by: Philippe Reynes 
---
 arch/arm/mach-imx/clk-imx31.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 286ef42..480c54f 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -130,7 +130,8 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
-   clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
+   clk_register_clkdev(clk[ckil], "rtc", "imx21-rtc");
+   clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
clk_register_clkdev(clk[epit1_gate], "epit", NULL);
clk_register_clkdev(clk[epit2_gate], "epit", NULL);
clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2 6/6] apf27: dt: add support of internal rtc

2015-06-20 Thread Philippe Reynes
Enable the internal mxc rtc driver on apf27.

Signed-off-by: Philippe Reynes 
---
 arch/arm/boot/dts/imx27-apf27.dts |4 
 arch/arm/boot/dts/imx27.dtsi  |   10 ++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/imx27-apf27.dts 
b/arch/arm/boot/dts/imx27-apf27.dts
index 73aae4f..590d37a 100644
--- a/arch/arm/boot/dts/imx27-apf27.dts
+++ b/arch/arm/boot/dts/imx27-apf27.dts
@@ -122,3 +122,7 @@
reg = <0x80 0xf80>;
};
 };
+
+&rtc {
+   status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx27.dtsi b/arch/arm/boot/dts/imx27.dtsi
index bc215e4..57fda6c 100644
--- a/arch/arm/boot/dts/imx27.dtsi
+++ b/arch/arm/boot/dts/imx27.dtsi
@@ -144,6 +144,16 @@
clock-names = "ipg", "per";
};
 
+   rtc: rtc@10007000 {
+   compatible = "fsl,imx21-rtc";
+   reg = <0x10007000 0x1000>;
+   interrupts = <22>;
+   clocks = <&clks IMX27_CLK_CKIL>,
+<&clks IMX27_CLK_RTC_IPG_GATE>;
+   clock-names = "rtc", "ipg";
+   status = "disabled";
+   };
+
kpp: kpp@10008000 {
compatible = "fsl,imx27-kpp", "fsl,imx21-kpp";
reg = <0x10008000 0x1000>;
-- 
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 08/18] baycom_epp: Replace rdtscl() with native_read_tsc()

2015-06-20 Thread Andy Lutomirski
On Sat, Jun 20, 2015 at 7:14 AM, Thomas Gleixner  wrote:
> On Sat, 20 Jun 2015, walter harms wrote:
>
>> Acked-by: walter harms 
>>
>> Am 17.06.2015 02:35, schrieb Andy Lutomirski:
>> > This is only used if BAYCOM_DEBUG is defined.
>
> So why don't we just replace that by ktime_get() and get rid of the
> x86'ism in that driver.
>

I don't have the hardware, and I don't see any good reason to make an
rdtsc cleanup depend on a more complicated driver change.  On the
other hand, if the maintainers want to clean it up, I think it would
be a great idea.

This really seems to be debugging code, though.  A normal kernel won't
even compile it.

--Andy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: build failure after merge of the akpm tree

2015-06-20 Thread Stephen Rothwell
Hi Andrew,

After merging the akpm tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/crypto/marvell/cesa.c: In function 'mv_cesa_get_sram':
drivers/crypto/marvell/cesa.c:324:2: error: implicit declaration of function 
'of_get_named_gen_pool' [-Werror=implicit-function-declaration]
  engine->pool = of_get_named_gen_pool(cesa->dev->of_node,
  ^
drivers/crypto/marvell/cesa.c:324:15: warning: assignment makes pointer from 
integer without a cast
  engine->pool = of_get_named_gen_pool(cesa->dev->of_node,
   ^

Caused by commit:

  f63601fd616a ("crypto: marvell/cesa - add a new driver for Marvell's CESA")

from the crypto tree interacting with patch:

  "genalloc: rename of_get_named_gen_pool() to of_gen_pool_get()"

from the akpm tree.

I added this merge fix patch:

From: Stephen Rothwell 
Date: Sun, 21 Jun 2015 00:23:08 +1000
Subject: [PATCH] crypto: marvell/cesa - fix up for of_get_named_gen_pool()
 rename

Signed-off-by: Stephen Rothwell 
---
 drivers/crypto/marvell/cesa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/marvell/cesa.c b/drivers/crypto/marvell/cesa.c
index a432633bced4..1c6f98dd88f4 100644
--- a/drivers/crypto/marvell/cesa.c
+++ b/drivers/crypto/marvell/cesa.c
@@ -321,9 +321,8 @@ static int mv_cesa_get_sram(struct platform_device *pdev, 
int idx)
const char *res_name = "sram";
struct resource *res;
 
-   engine->pool = of_get_named_gen_pool(cesa->dev->of_node,
-"marvell,crypto-srams",
-idx);
+   engine->pool = of_gen_pool_get(cesa->dev->of_node,
+  "marvell,crypto-srams", idx);
if (engine->pool) {
engine->sram = gen_pool_dma_alloc(engine->pool,
  cesa->sram_size,

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgpqTqbY7erSL.pgp
Description: OpenPGP digital signature


[PATCH v2] staging: comedi: fix cast warning in comedi_compat32.c

2015-06-20 Thread Geliang Tang
This patch fixes the following sparse warning:

drivers/staging/comedi/comedi_compat32.c:205:16: warning: cast removes
address space of expression

Signed-off-by: Geliang Tang 
---
Changes in v2:
  - compat_ptr() is substituted by 'unsigned long'.
---
 drivers/staging/comedi/comedi_compat32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_compat32.c 
b/drivers/staging/comedi/comedi_compat32.c
index 2584824..894a50c 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -202,7 +202,7 @@ static int get_compat_cmd(struct comedi_cmd __user *cmd,
err |= __get_user(temp.uint, &cmd32->stop_arg);
err |= __put_user(temp.uint, &cmd->stop_arg);
err |= __get_user(temp.uptr, &cmd32->chanlist);
-   err |= __put_user(compat_ptr(temp.uptr), &cmd->chanlist);
+   err |= __put_user((unsigned long)(temp.uptr), &cmd->chanlist);
err |= __get_user(temp.uint, &cmd32->chanlist_len);
err |= __put_user(temp.uint, &cmd->chanlist_len);
err |= __get_user(temp.uptr, &cmd32->data);
-- 
2.3.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: comedi: fix sparse warning in comedi_compat32.c

2015-06-20 Thread Geliang Tang
On Sat, Jun 20, 2015 at 04:08:19PM +0530, Sudip Mukherjee wrote:
> compat_ptr is already a typecast.
> static inline void __user *compat_ptr(compat_uptr_t uptr)
> {
>   return (void __user *)(unsigned long)uptr;
> }
> 
> so you are adding another typecast to an already exitsing typecast. :(
> 
> and besides, this also introduces one new checkpatch warning of
> line more than 80 char.
> 
> regards
> sudip

Thank you for your review. I revised the patch as you suggested. Here it is.

Geliang Tang (1):
  staging: comedi: fix cast warning in comedi_compat32.c

 drivers/staging/comedi/comedi_compat32.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.3.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/6] imx35: define two clocks for rtc

2015-06-20 Thread Fabio Estevam
On Sat, Jun 20, 2015 at 11:15 AM, Philippe Reynes  wrote:

> @@ -240,6 +241,9 @@ int __init mx35_clocks_init(void)
> clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
> clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
> clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
> +   /* i.mx35 has the i.mx21 type uart */

I think you meant rtc, not uart :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 4.0 000/105] 4.0.6-stable review

2015-06-20 Thread Greg Kroah-Hartman
On Sat, Jun 20, 2015 at 09:58:55AM +0200, Heinz Diehl wrote:
> On 19.06.2015, Greg Kroah-Hartman wrote: 
> 
> > This is the start of the stable review cycle for the 4.0.6 release.
> > There are 105 patches in this series
> 
> Since a few -stable releases I'm missing this one (it's already in
> mainline):
> 
> https://www.mail-archive.com/linux-crypto%40vger.kernel.org/msg14118.html

I need some kind of hint as to _what_ patch that is in mainline.  What's
the git id of it in Linus's tree?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] staging: comedi: fix sparse warning in ni_mio_common.c

2015-06-20 Thread Greg KH
On Sat, Jun 20, 2015 at 04:47:33PM +, Geliang Tang wrote:
> This patch fixes the following sparse warning:
> 
> drivers/staging/comedi/drivers/ni_mio_common.c:573:26: warning: shift
> too big (4294967295) for type int
> 
> Signed-off-by: Geliang Tang 
> ---
>  drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c 
> b/drivers/staging/comedi/drivers/ni_mio_common.c
> index 6cc304a..420f752 100644
> --- a/drivers/staging/comedi/drivers/ni_mio_common.c
> +++ b/drivers/staging/comedi/drivers/ni_mio_common.c
> @@ -570,7 +570,7 @@ static inline void ni_set_bitfield(struct comedi_device 
> *dev, int reg,
>  static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
>  {
>   if (channel < 4)
> - return 1 << channel;
> + return 1 << (channel & 0x03);

Look at the code, this change makes no sense.

Sometimes tools are wrong, use them as a hint, not as something that has
to be silenced.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kbuild: builddeb: Include dtbs in the Debian package built by "make deb-pkg"

2015-06-20 Thread Karsten Merker
Native Debian kernel packages include any dtbs that were generated
during the kernel build process in /usr/lib/${packagename}.
Do the same for Debian packages built by scripts/package/builddeb
(executed by the "deb-pkg" target).

Signed-off-by: Karsten Merker 
---
 scripts/package/builddeb | 5 +
 1 file changed, 5 insertions(+)

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 88dbf23..944b560 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -143,6 +143,11 @@ else
cp arch/$ARCH/boot/$KBUILD_IMAGE "$tmpdir/$installed_image_path"
 fi
 
+# If dtbs have been built for this arch, include them in the package
+if [ -d "arch/$ARCH/boot/dts" ]; then
+  find "arch/$ARCH/boot/dts" -iname '*.dtb' -exec sh -c "mkdir -p 
'$tmpdir/usr/lib/$packagename'; cp '{}' '$tmpdir/usr/lib/$packagename/'" \;
+fi
+
 if grep -q '^CONFIG_MODULES=y' $KCONFIG_CONFIG ; then
INSTALL_MOD_PATH="$tmpdir" $MAKE KBUILD_SRC= modules_install
rm -f "$tmpdir/lib/modules/$version/build"
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: build warnings after merge of the staging tree

2015-06-20 Thread Greg KH
On Sat, Jun 20, 2015 at 08:48:26PM +1000, Stephen Rothwell wrote:
> Hi Greg,
> 
> On Mon, 1 Jun 2015 18:50:12 +1000 Stephen Rothwell  
> wrote:
> >
> > On Fri, 29 May 2015 20:40:02 +1000 Stephen Rothwell  
> > wrote:
> > >
> > > After merging the staging tree, today's linux-next build (x86_64
> > > allmodconfig) produced a large number of warnings in
> > > drivers/staging/wilc1000.
> > 
> > Since there are so many warnings, I have disabled the driver for now.
> 
> I tried building this with the driver enabled but it still produces and
> inordinate number of warnings, so I have disabled it again.  Please
> either get them sorted out or disable this driver before asking Linus
> to merge it.

Yeah, I know, I keep asking the driver authors for fixes, but nothing
has shown up yet except cosmetic changes.  I'm going to disable it as no
one seems willing to do the work, which is sad.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: Tree for Jun 20

2015-06-20 Thread Stephen Rothwell
Hi all,

Changes since 20150619:

New trees: hwspinlock, nvdimm

The v4l-dvb tree lost its build failure.

The crypto tree gained a conflict against the bluetooth tree.

The tip tree gained a conflict against the modules tree.

The workqueues tree gained a build failure for which I applied a merge
fix patch.

The rtc tree gained a conflict against the mfd tree.

The nvdimm tree gained a conflict against Linus' tree.

The akpm tree gained conflicts against the v4l-dvb tree and a build
failure for which I applied a merge fix patch.

Non-merge commits (relative to Linus' tree): 11621
 9719 files changed, 1020022 insertions(+), 230021 deletions(-)



I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/next/ ).  If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one.  You should use "git fetch" and checkout or reset to the new
master.

You can see which trees have been included by looking in the Next/Trees
file in the source.  There are also quilt-import.log and merge.log files
in the Next directory.  Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64 and a
multi_v7_defconfig for arm. After the final fixups (if any), it is also
built with powerpc allnoconfig (32 and 64 bit), ppc44x_defconfig and
allyesconfig (this fails its final link) and i386, sparc, sparc64 and arm
defconfig.

Below is a summary of the state of the merge.

I am currently merging 221 trees (counting Linus' and 31 trees of patches
pending for Linus' tree).

Stats about the size of the tree over time can be seen at
http://neuling.org/linux-next-size.html .

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next .  If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Randy Dunlap for doing many randconfig builds.  And to Paul
Gortmaker for triage and bug fixes.

-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au

$ git checkout master
$ git reset --hard stable
Merging origin/master (bb16140a2cab Merge tag 'clk-fixes-for-linus' of 
git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux)
Merging fixes/master (b94d525e58dc Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net)
Merging kbuild-current/rc-fixes (c517d838eb7d Linux 4.0-rc1)
Merging arc-current/for-curr (e4140819dadc ARC: signal handling robustify)
Merging arm-current/fixes (0bbe6b5a73c0 ARM: 8388/1: tcm: Don't crash when TCM 
banks are protected by TrustZone)
Merging m68k-current/for-linus (b24f670b7f5b m68k/mac: Fix out-of-bounds array 
index in OSS IRQ source initialization)
Merging metag-fixes/fixes (0164a711c97b metag: Fix ioremap_wc/ioremap_cached 
build errors)
Merging mips-fixes/mips-fixes (1795cd9b3a91 Linux 3.16-rc5)
Merging powerpc-merge-mpe/fixes (c65b99f04684 Linux 4.1-rc6)
Merging powerpc-merge/merge (c517d838eb7d Linux 4.0-rc1)
Merging sparc/master (c46a024ea5eb Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net)
Merging net/master (2dab80a8b486 bridge: fix br_stp_set_bridge_priority race 
conditions)
Merging ipsec/master (31a418986a58 xen: netback: read hotplug script once at 
start of day.)
Merging sound-current/for-linus (145c0e914d2c ALSA: hda - Fix unused label 
skip_i915)
Merging pci-current/for-linus (552bc94ebeeb PCI: Preserve resource size during 
alignment reordering)
Merging wireless-drivers/master (38fe44e61a89 Merge tag 
'iwlwifi-for-kalle-2015-05-28' of 
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes)
Merging driver-core.current/driver-core-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging tty.current/tty-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging usb.current/usb-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging usb-gadget-fixes/fixes (c94e289f195e usb: gadget: remove incorrect 
__init/__exit annotations)
Merging usb-serial-fixes/usb-linus (0f57d86787d8 Linux 4.1-rc8)
Merging staging.current/staging-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging char-misc.current/char-misc-linus (e26081808eda Linux 4.1-rc4)
Merging input-current/for-linus (469d7d22cea1 Input: pixcir_i2c_ts - fix 
receive error)
Merging crypto-current/master (412c98c1bef6 crypto: caam - fix RNG buffer cache 
alignment)
Merging ide/master (d681f1166919 ide: remove deprecated use of pci api)
Merging devicetree-current/devicetree/merge (f76502aa9140 of/dynamic: Fix test 
for PPC_PSERIES)
Merging rr-fixes/fixes (f36963c9d3f6 cpumask_set_cpu_local_first => 
cpumask_local_spread, lament)
Merging vfio-fixes/for-linus (db7d4d7f4021 vfio: Fix runaway interruptible 
timeout)
Merging kselftest-fixes/fixes (ba155e2d21f6 Linux 4.1-rc5)
Merging backlight-fixes/for-backlight-fixes (68feaca0b13e backlight: pwm: 
Handle EPROBE_DEF

Re: [PATCH 1/4] staging: sm750fb: use tabs for indentation

2015-06-20 Thread Juston Li
My apologies, I thought I removed all of those. Fixed for real this
time, resending.

Regards
Juston

On Sat, Jun 20, 2015 at 3:45 AM, Sudip Mukherjee
 wrote:
> On Sat, Jun 20, 2015 at 01:48:32AM -0700, Juston Li wrote:
>> Replace spaces with tabs for indentation to fix the checkpatch.pl error
>> ERROR: code indent should use tabs where possible
>> WARNING: please, no spaces at the start of a line
>>
>> Signed-off-by: Juston Li 
>> ---
> 
>> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
>> b/drivers/staging/sm750fb/ddk750_sii164.c
>> index b6395b8..c09748c 100644
>> --- a/drivers/staging/sm750fb/ddk750_sii164.c
>> +++ b/drivers/staging/sm750fb/ddk750_sii164.c
> 
>>
>> @@ -279,27 +279,25 @@ char *sii164GetChipString(void)
>>   *  Input:
>>   *  powerUp - Flag to set the power down or up
>>   */
>> -void sii164SetPower(
>> -unsigned char powerUp
>> -)
>> +void sii164SetPower(unsigned char powerUp)
> is it that same patch again? different kind of change should go in a separate 
> patch.
>
> regards
> sudip
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] can: fix loss of frames due to wrong assumption in raw_rcv

2015-06-20 Thread manfred.schla...@gmx.at
I've detected a massive loss of can frames on i.MX6 using flexcan
driver with 4.1-rc8 and tracked this down to following commit:
514ac99c64b22d83b52dfee3b8becaa69a92bc4a - "can: fix multiple delivery
of a single CAN frame for overlapping CAN filters"

514ac99c64b22d83b52dfee3b8becaa69a92bc4a introduces a frame equality
check. Since the sk_buff pointer is not sufficient to do this (buffers
are reused), the check also compares time stamps.
In short: pointer+time stamp was assumed as unique key to a specific
frame.
The problem with this is, that the time stamp is an optional property
and not set per default.
In our case (flexcan) the time stamp is always zero, so the equality
check is reduced to equality of buffer pointers, resulting in a lot of
dropped frames.

Possible solutions I thought of:
 1. Every driver has to set a time stamp
(possibly error prone and hard to enforce?)
 2. Change the equality check
 3. Fulfil the requirements of the equality check by setting a
time stamp per default.

This patch fixes the problem with solution 3. A time stamp is set at
time of allocation in alloc_can_skb.
The time stamp may be overridden later, but the function of the equality
check is ensured.

I'm not really deep in linux network subsystem, so there may exists
more elegant solutions for the problem.

Signed-off-by: Manfred Schlaegl 
---
 drivers/net/can/dev.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c
index b0f6924..282e2e7 100644
--- a/drivers/net/can/dev.c
+++ b/drivers/net/can/dev.c
@@ -575,6 +575,7 @@ struct sk_buff *alloc_can_skb(struct net_device
*dev, struct can_frame **cf)
if (unlikely(!skb))
return NULL;
 +  __net_timestamp(skb);
skb->protocol = htons(ETH_P_CAN);
skb->pkt_type = PACKET_BROADCAST;
skb->ip_summed = CHECKSUM_UNNECESSARY;
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFC][PATCH 1/5] mm/slab_common: allow NULL cache pointer in kmem_cache_destroy()

2015-06-20 Thread Julia Lawall


On Thu, 18 Jun 2015, Sergey Senozhatsky wrote:

> On (06/17/15 16:14), David Rientjes wrote:
> [..]
> > > 
> > > Signed-off-by: Sergey Senozhatsky 
> > > Reported-by: Andrew Morton 
> > > LKML-reference: https://lkml.org/lkml/2015/6/8/583
> > 
> > Acked-by: David Rientjes 
> > 
> > kmem_cache_destroy() isn't a fastpath, this is long overdue.  Now where's 
> > the patch to remove the NULL checks from the callers? ;)
> > 
> 
> Thanks.
> 
> Yes, Julia Lawall (Cc'd) already has a patch set ready for submission.

The patch for making these functions able to tolerate NULL doesn't seem to 
be in linux-next yet, so I will wait until it appears.

julia
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 08/18] baycom_epp: Replace rdtscl() with native_read_tsc()

2015-06-20 Thread Thomas Gleixner
On Sat, 20 Jun 2015, Andy Lutomirski wrote:
> On Sat, Jun 20, 2015 at 7:14 AM, Thomas Gleixner  wrote:
> > On Sat, 20 Jun 2015, walter harms wrote:
> >
> >> Acked-by: walter harms 
> >>
> >> Am 17.06.2015 02:35, schrieb Andy Lutomirski:
> >> > This is only used if BAYCOM_DEBUG is defined.
> >
> > So why don't we just replace that by ktime_get() and get rid of the
> > x86'ism in that driver.
> >
> 
> I don't have the hardware, and I don't see any good reason to make an
> rdtsc cleanup depend on a more complicated driver change.  On the
> other hand, if the maintainers want to clean it up, I think it would
> be a great idea.
> 
> This really seems to be debugging code, though.  A normal kernel won't
> even compile it.

Right, but there is no reason that we have rdtsc outside of arch/x86
at all.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] block: nvme-scsi: Catch kcalloc failure

2015-06-20 Thread Jens Axboe

On 06/20/2015 02:29 AM, Axel Lin wrote:

res variable was initialized to -ENOMEM, but it's override by
nvme_trans_copy_from_user(). So current code returns 0 if kcalloc fails.
Fix it to return proper error code.


Looks good to me, applied for 4.2.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] serial: imx: count tty buffer overruns

2015-06-20 Thread manfred.schla...@gmx.at
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

As can be seen in function uart_insert_char (serial_core) the element
buf_overrun of struct uart_icount is used to count overruns of
tty-buffer.
Added support for counting of overruns in imx driver analogue to
serial_core.

Signed-off-by: Manfred Schlaegl 
- ---
 drivers/tty/serial/imx.c |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 8825039..384cf1d 100644
- --- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -700,7 +700,8 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
if (sport->port.ignore_status_mask & URXD_DUMMY_READ)
goto out;
 -  tty_insert_flip_char(port, rx, flg);
+   if (tty_insert_flip_char(port, rx, flg) == 0)
+   sport->port.icount.buf_overrun++;
}
  out:
@@ -922,8 +923,13 @@ static void dma_rx_callback(void *data)
dev_dbg(sport->port.dev, "We get %d bytes.\n", count);
if (count) {
- - if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ))
- - tty_insert_flip_string(port, sport->rx_buf, count);
+   if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) {
+   int bytes = tty_insert_flip_string(port, sport->rx_buf,
+   count);
+
+   if (bytes != count)
+   sport->port.icount.buf_overrun++;
+   }
tty_flip_buffer_push(port);
start_rx_dma(sport);
- -- 
1.7.10.4

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJVhZevAAoJEGS1eKPM78WhYlIP/1xUn8g37afejHntKdRgYOGZ
V5izKDvCWNNxIIWQ3Rw1NtN9+695LO4WsZX7n4FYzBQbZHE8F5bzVM9bGnSJOjie
4imHKaGrzWhHy9uP/Z6j6aGqdqGHD6QtxcJ6A0u4A8CrYbUZKjEXk0YUH8BPawb4
8oKwm8Gn4N+ispHL9SDtV+q4yoOZApd6OcXdIpxrtKSunHWuSigJ66Fs7416liuh
D90q4zEENvfdMqpBf5w5IxYUkhQHDCzE3NAgVUCeOqnFa84daq+H51GPEsbFdGlo
MsFsu/qU0lQ1S+EnkbSoFQ/519ujMhi0pdxvcgHlijEFtLUmibh1jvIYdsw9et0o
v3Xp5xGro7r9GOUhjiiTazVR0jPCt+owjAc/7PPiiBqaToeSeiSa7sJk8FBSkMPF
sr2/4UStomLVZgnm/KY2O+HTTyw2insH7iVxJeHf7ZBEeQeRL+jgn2cgeyE8e8Vt
x8jYXPhwYnWWh4C6wC1lidlCLfgDZGQI6DnnyTb2W7DEHNwGXJHPTA3N/liz5Kox
LxNA5KA/l0gzsRZdv9iCuJVlxAWHBH5/wRE4+ojurNcyI5gGcOaiLzGqYc5QL7gz
1ODtX0RoP1guMkq6w1LSBSIWVIGXoFn8AcWkdDgpqBp0jXWo5s2ivGXaa3OKX80y
NMGTG7+2PxXQ9aPtk3gv
=BuFt
-END PGP SIGNATURE-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


randconfig build error with next-20150620, in drivers/media/v4l2-core/videobuf2-core.c

2015-06-20 Thread Jim Davis
Building with the attached random configuration file,

drivers/media/v4l2-core/videobuf2-core.c: In function ‘vb2_warn_zero_bytesused’:
drivers/media/v4l2-core/videobuf2-core.c:1253:2: error: implicit declaration of
function ‘__WARN’ [-Werror=implicit-function-declaration]
  __WARN();
  ^
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.1.0-rc8 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_MMU=y
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_GENERIC_CALIBRATE_DELAY=y
CONFIG_ARCH_HAS_CPU_RELAX=y
CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y
CONFIG_HAVE_SETUP_PER_CPU_AREA=y
CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_ARCH_HWEIGHT_CFLAGS="-fcall-saved-rdi -fcall-saved-rsi -fcall-saved-rdx 
-fcall-saved-rcx -fcall-saved-r8 -fcall-saved-r9 -fcall-saved-r10 
-fcall-saved-r11"
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=4
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y
CONFIG_IRQ_WORK=y
CONFIG_BUILDTIME_EXTABLE_SORT=y

#
# General setup
#
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
CONFIG_COMPILE_TEST=y
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_BZIP2=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_HAVE_KERNEL_LZ4=y
CONFIG_KERNEL_GZIP=y
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
CONFIG_DEFAULT_HOSTNAME="(none)"
CONFIG_SWAP=y
CONFIG_SYSVIPC=y
CONFIG_CROSS_MEMORY_ATTACH=y
# CONFIG_FHANDLE is not set
# CONFIG_USELIB is not set
CONFIG_HAVE_ARCH_AUDITSYSCALL=y

#
# IRQ subsystem
#
CONFIG_GENERIC_IRQ_PROBE=y
CONFIG_GENERIC_IRQ_SHOW=y
CONFIG_IRQ_DOMAIN=y
CONFIG_IRQ_DOMAIN_HIERARCHY=y
CONFIG_IRQ_DOMAIN_DEBUG=y
CONFIG_IRQ_FORCED_THREADING=y
CONFIG_SPARSE_IRQ=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_ARCH_CLOCKSOURCE_DATA=y
CONFIG_CLOCKSOURCE_VALIDATE_LAST_CYCLE=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
CONFIG_GENERIC_CLOCKEVENTS_MIN_ADJUST=y
CONFIG_GENERIC_CMOS_UPDATE=y

#
# Timers subsystem
#
CONFIG_HZ_PERIODIC=y
# CONFIG_NO_HZ_IDLE is not set
# CONFIG_NO_HZ is not set
# CONFIG_HIGH_RES_TIMERS is not set

#
# CPU/Task time and stats accounting
#
CONFIG_TICK_CPU_ACCOUNTING=y
# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
# CONFIG_IRQ_TIME_ACCOUNTING is not set
CONFIG_BSD_PROCESS_ACCT=y
# CONFIG_BSD_PROCESS_ACCT_V3 is not set

#
# RCU Subsystem
#
CONFIG_TINY_RCU=y
# CONFIG_RCU_EXPERT is not set
CONFIG_SRCU=y
# CONFIG_TASKS_RCU is not set
CONFIG_RCU_STALL_COMMON=y
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_RCU_EXPEDITE_BOOT is not set
CONFIG_BUILD_BIN2C=y
CONFIG_IKCONFIG=y
CONFIG_LOG_BUF_SHIFT=17
CONFIG_HAVE_UNSTABLE_SCHED_CLOCK=y
CONFIG_ARCH_SUPPORTS_NUMA_BALANCING=y
CONFIG_ARCH_SUPPORTS_INT128=y
# CONFIG_CGROUPS is not set
CONFIG_CHECKPOINT_RESTORE=y
CONFIG_NAMESPACES=y
CONFIG_UTS_NS=y
# CONFIG_IPC_NS is not set
# CONFIG_USER_NS is not set
CONFIG_PID_NS=y
# CONFIG_SCHED_AUTOGROUP is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
CONFIG_RELAY=y
# CONFIG_BLK_DEV_INITRD is not set
# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
CONFIG_ANON_INODES=y
CONFIG_SYSCTL_EXCEPTION_TRACE=y
CONFIG_HAVE_PCSPKR_PLATFORM=y
CONFIG_EXPERT=y
CONFIG_MULTIUSER=y
# CONFIG_SGETMASK_SYSCALL is not set
CONFIG_SYSFS_SYSCALL=y
CONFIG_KALLSYMS=y
CONFIG_KALLSYMS_ALL=y
CONFIG_PRINTK=y
# CONFIG_BUG is not set
# CONFIG_PCSPKR_PLATFORM is not set
# CONFIG_BASE_FULL is not set
CONFIG_FUTEX=y
# CONFIG_EPOLL is not set
# CONFIG_SIGNALFD is not set
# CONFIG_TIMERFD is not set
# CONFIG_EVENTFD is not set
# CONFIG_BPF_SYSCALL is not set
# CONFIG_SHMEM is not set
# CONFIG_AIO is not set
CONFIG_ADVISE_SYSCALLS=y
CONFIG_USERFAULTFD=y
CONFIG_EMBEDDED=y
CONFIG_HAVE_PERF_EVENTS=y

#
# Kernel Performance Events And Counters
#
CONFIG_PERF_EVENTS=y
# CONFIG_DEBUG_PERF_USE_VMALLOC is not set
# CONFIG_VM_EVENT_COUNTERS is not set
CONFIG_SLUB_DEBUG=y
CONFIG_COMPAT_BRK=y
# CONFIG_SLAB is not set
CONFIG_SLUB=y
# CONFIG_SLOB is not set
CONFIG_SYSTEM_TRUSTED_KEYRING=y
CONFIG_PROFILING=y
CONFIG_TRACEPOINTS=y
CONFIG_OPROFILE=y
CONFIG_OPROFILE_EVENT_MULTIPLEX=y
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_NMI_TIMER=y
# CONFIG_KPROBES is not set
CONFIG_JUMP_LABEL=y
CONFIG_UPRO

[PATCH] serial: imx: reduce irq-latency after rx overflow

2015-06-20 Thread manfred.schla...@gmx.at
To prevent problems with interrupt latency, and due to the fact, that
the error will be counted anyway (icount.overrun), the dev_err is simply
removed.

Background:
If an rx-fifo overflow occurs a dev_err message was called in interrupt
context. Since dev_err messages are written to console in a synchronous way
(unbuffered), and console may be a serial terminal, this leads to a
highly increased interrupt-latency (several milliseconds).
As a result of the high latency more rx-fifo overflows will happen, and
therefore a feedback loop of errors is created.

Signed-off-by: Manfred Schlaegl 
---
 drivers/tty/serial/imx.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 384cf1d..40fd32c 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -767,7 +767,6 @@ static irqreturn_t imx_int(int irq, void *dev_id)
writel(USR1_AWAKE, sport->port.membase + USR1);
if (sts2 & USR2_ORE) {
-   dev_err(sport->port.dev, "Rx FIFO overrun\n");
sport->port.icount.overrun++;
writel(USR2_ORE, sport->port.membase + USR2);
}
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v2 2/6] imx35: define two clocks for rtc

2015-06-20 Thread Philippe Reynes

Hi Fabio,

On 20/06/15 16:43, Fabio Estevam wrote:

On Sat, Jun 20, 2015 at 11:15 AM, Philippe Reynes  wrote:


@@ -240,6 +241,9 @@ int __init mx35_clocks_init(void)
 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
 clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
 clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
+   /* i.mx35 has the i.mx21 type uart */


I think you meant rtc, not uart :-)


Yes, of course, sorry for this silly mistake.
I fix it in a V3.

Thanks a lot,
Philippe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] serial: imx: count tty buffer overruns

2015-06-20 Thread Greg Kroah-Hartman
On Sat, Jun 20, 2015 at 06:41:20PM +0200, manfred.schla...@gmx.at wrote:
> As can be seen in function uart_insert_char (serial_core) the element
> buf_overrun of struct uart_icount is used to count overruns of
> tty-buffer.
> Added support for counting of overruns in imx driver analogue to
> serial_core.
> 
> Signed-off-by: Manfred Schlaegl 

Your From: line in your email doesn't match this, please fix up and
resend.

Same goes for your other serial patch.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] serial: imx: count tty buffer overruns

2015-06-20 Thread manfred.schla...@gmx.at
As can be seen in function uart_insert_char (serial_core) the element
buf_overrun of struct uart_icount is used to count overruns of
tty-buffer.
Added support for counting of overruns in imx driver analogue to
serial_core.

Signed-off-by: Manfred Schlaegl 
---
 drivers/tty/serial/imx.c |   12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 8825039..384cf1d 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -700,7 +700,8 @@ static irqreturn_t imx_rxint(int irq, void *dev_id)
if (sport->port.ignore_status_mask & URXD_DUMMY_READ)
goto out;
 -  tty_insert_flip_char(port, rx, flg);
+   if (tty_insert_flip_char(port, rx, flg) == 0)
+   sport->port.icount.buf_overrun++;
}
  out:
@@ -922,8 +923,13 @@ static void dma_rx_callback(void *data)
dev_dbg(sport->port.dev, "We get %d bytes.\n", count);
if (count) {
-   if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ))
-   tty_insert_flip_string(port, sport->rx_buf, count);
+   if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) {
+   int bytes = tty_insert_flip_string(port, sport->rx_buf,
+   count);
+
+   if (bytes != count)
+   sport->port.icount.buf_overrun++;
+   }
tty_flip_buffer_push(port);
start_rx_dma(sport);
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 00/12] Use !x to check for kzalloc failure

2015-06-20 Thread Julia Lawall
Use !x to check for kzalloc failure, as is more normal in the kernel.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 03/12] staging: lustre: lclient: Use !x to check for kzalloc failure

2015-06-20 Thread Julia Lawall
!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// 

Signed-off-by: Julia Lawall 

---
 drivers/staging/lustre/lustre/lclient/lcommon_cl.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c 
b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
--- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
+++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c
@@ -203,7 +203,7 @@ struct lu_device *ccc_device_alloc(const
int rc;
 
vdv = kzalloc(sizeof(*vdv), GFP_NOFS);
-   if (vdv == NULL)
+   if (!vdv)
return ERR_PTR(-ENOMEM);
 
lud = &vdv->cdv_cl.cd_lu_dev;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 08/12] staging: lustre: mgc: Use !x to check for kzalloc failure

2015-06-20 Thread Julia Lawall
!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// 

Signed-off-by: Julia Lawall 

---
 drivers/staging/lustre/lustre/mgc/mgc_request.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -u -p a/drivers/staging/lustre/lustre/mgc/mgc_request.c 
b/drivers/staging/lustre/lustre/mgc/mgc_request.c
--- a/drivers/staging/lustre/lustre/mgc/mgc_request.c
+++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c
@@ -1128,7 +1128,7 @@ static int mgc_apply_recover_logs(struct
LASSERT(cfg->cfg_sb == cfg->cfg_instance);
 
inst = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS);
-   if (inst == NULL)
+   if (!inst)
return -ENOMEM;
 
if (!IS_SERVER(lsi)) {
@@ -1493,7 +1493,7 @@ static int mgc_process_cfg_log(struct ob
lsi = s2lsi(cld->cld_cfg.cfg_sb);
 
env = kzalloc(sizeof(*env), GFP_NOFS);
-   if (env == NULL)
+   if (!env)
return -ENOMEM;
 
rc = lu_env_init(env, LCT_MG_THREAD);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 05/12] staging: lustre: lmv: Use !x to check for kzalloc failure

2015-06-20 Thread Julia Lawall
!x is more normal for kzalloc failure in the kernel.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// 
@@
expression x;
statement S1, S2;
@@

x = kzalloc(...);
if (
- x == NULL
+ !x
 ) S1 else S2
// 

Signed-off-by: Julia Lawall 

---
 drivers/staging/lustre/lustre/lmv/lmv_intent.c |2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff -u -p a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -716,7 +716,7 @@ repeat_fid2path:
if (remote_gf == NULL) {
remote_gf_size = sizeof(*remote_gf) + PATH_MAX;
remote_gf = kzalloc(remote_gf_size, GFP_NOFS);
-   if (remote_gf == NULL) {
+   if (!remote_gf) {
rc = -ENOMEM;
goto out_fid2path;
}
@@ -1398,7 +1398,7 @@ static int lmv_statfs(const struct lu_en
return rc;
 
temp = kzalloc(sizeof(*temp), GFP_NOFS);
-   if (temp == NULL)
+   if (!temp)
return -ENOMEM;
 
for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
@@ -1730,7 +1730,7 @@ lmv_enqueue_remote(struct obd_export *ex
}
 
rdata = kzalloc(sizeof(*rdata), GFP_NOFS);
-   if (rdata == NULL) {
+   if (!rdata) {
rc = -ENOMEM;
goto out;
}
diff -u -p a/drivers/staging/lustre/lustre/lmv/lmv_intent.c 
b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
--- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c
@@ -100,7 +100,7 @@ static int lmv_intent_remote(struct obd_
}
 
op_data = kzalloc(sizeof(*op_data), GFP_NOFS);
-   if (op_data == NULL) {
+   if (!op_data) {
rc = -ENOMEM;
goto out;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


  1   2   3   >