Re: [PATCH v5 1/2] mfd: update Intel soc PMIC header file to support Broxton WC PMIC

2015-08-23 Thread Lee Jones
Why have you sent this set 3 times?

> IRQ control registers of Intel Broxton Whisky Cove PMIC are
> separated in two parts, so add secondary IRQ chip.
> And the new member of device will be used in PMC IPC regmap APIs.
> 
> Signed-off-by: Qipeng Zha 
> ---
>  include/linux/mfd/intel_soc_pmic.h | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/mfd/intel_soc_pmic.h 
> b/include/linux/mfd/intel_soc_pmic.h
> index abcbfcf..a730f14 100644
> --- a/include/linux/mfd/intel_soc_pmic.h
> +++ b/include/linux/mfd/intel_soc_pmic.h
> @@ -21,10 +21,15 @@
>  
>  #include 
>  
> +#define INIT_REGMAP_IRQ(_irq, _off, _mask)   \
> + [_irq] = { .reg_offset = (_off), .mask = (_mask) }
> +
>  struct intel_soc_pmic {
>   int irq;
>   struct regmap *regmap;
>   struct regmap_irq_chip_data *irq_chip_data;
> + struct regmap_irq_chip_data *irq_chip_data_level2;
> + struct device *dev;
>  };
>  
>  #endif   /* __INTEL_SOC_PMIC_H__ */

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3/3 v3] mm/vmalloc: Cache the vmalloc memory info

2015-08-23 Thread Ingo Molnar

* Rasmus Villemoes  wrote:

> On Sun, Aug 23 2015, Ingo Molnar  wrote:
> 
> > Ok, fair enough - so how about the attached approach instead, which
> > uses a 64-bit generation counter to track changes to the vmalloc
> > state.
> 
> How does this invalidation approach compare to the jiffies approach? In
> other words, how often does the vmalloc info actually change (or rather,
> in this approximation, how often is vmap_area_lock taken)? In
> particular, does it also solve the problem with git's test suite and
> similar situations with lots of short-lived processes?

The two approaches are pretty similar, and in a typical distro with typical 
workload vmalloc() is mostly a boot time affair.

But vmalloc() can be used more often in certain corner cases - neither of the 
patches makes that in any way slower, just the optimization won't trigger that 
often.

Since vmalloc() use is suboptimal for several reasons (it does not use large 
pages 
for kernel space allocations, etc.), this is all pretty OK IMHO.

> > ==>
> > From f9fd770e75e2edb4143f32ced0b53d7a77969c94 Mon Sep 17 00:00:00 2001
> > From: Ingo Molnar 
> > Date: Sat, 22 Aug 2015 12:28:01 +0200
> > Subject: [PATCH] mm/vmalloc: Cache the vmalloc memory info
> >
> > Linus reported that glibc (rather stupidly) reads /proc/meminfo
> > for every sysinfo() call,
> 
> Not quite: It is done by the two functions get_{av,}phys_pages
> functions; and get_phys_pages is called (once per process) by glibc's
> qsort implementation. In fact, sysinfo() is (at least part of) the cure,
> not the disease. Whether qsort should care about the total amount of
> memory is another discussion.
> 
> 

Thanks, is the fixed up changelog below better?

Ingo

===>

mm/vmalloc: Cache the vmalloc memory info

Linus reported that for scripting-intense workloads such as the
Git build, glibc's qsort will read /proc/meminfo for every process
created (by way of get_phys_pages()), which causes the Git build 
to generate a surprising amount of kernel overhead.

A fair chunk of the overhead is due to get_vmalloc_info() - which 
walks a potentially long list to do its statistics.

Modify Linus's jiffies based patch to use generation counters
to cache the vmalloc info: vmap_unlock() increases the generation
counter, and the get_vmalloc_info() reads it and compares it
against a cached generation counter.

Also use a seqlock to make sure we always print a consistent
set of vmalloc statistics.

Reported-by: Linus Torvalds 
Cc: Andrew Morton 
Cc: Rik van Riel 
Cc: linux...@kvack.org
Signed-off-by: Ingo Molnar 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] of: add vendor prefix for Socionext Inc.

2015-08-23 Thread Lee Jones
On Wed, 29 Jul 2015, Masahiro Yamada wrote:

> Signed-off-by: Masahiro Yamada 
> ---
> 
>  Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
>  1 file changed, 1 insertion(+)

Patch has been around for nearly a month and is pretty trivial, so I'm
just going to go ahead an apply it.

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: linux-next: build failure after merge of the slave-dma tree

2015-08-23 Thread Maxime Ripard
Hi Vinod,

On Thu, Aug 06, 2015 at 08:30:27AM +0530, Vinod Koul wrote:
> On Thu, Aug 06, 2015 at 12:22:03PM +1000, Stephen Rothwell wrote:
> > Hi Vinod,
> > 
> > After merging the slave-dma tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> > 
> > drivers/dma/at_hdmac.c: In function 'atc_prep_dma_memset':
> > drivers/dma/at_hdmac.c:960:6: error: 'struct at_desc' has no member named 
> > 'tx_width'
> >   desc->tx_width = 2;
> >   ^
> > 
> > Caused by commit
> > 
> >   25fed8c2fff1 ("dmaengine: hdmac: Add memset capabilities")
> > 
> > interacting with commit
> > 
> >   93dce3a6434f ("dmaengine: at_hdmac: fix residue computation")
> Thanks Stephen,
> 
> I am dropping this commit now, it need to be fixed to take into account
> Cyrille work on remove tx_width and this patch should be updated to reflect
> that

I'll send an updated version today, is there some time left for this
to be part of 4.3?

Thanks,
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


Re: [PATCH] x86/math-emu: Add support for FCMOVcc and F[U]COMI[P] insns

2015-08-23 Thread Ingo Molnar

* Ingo Molnar  wrote:

> 
> * Denys Vlasenko  wrote:
> 
> > I propose the table to be commented like shown below:
> > 
> > /*Opcode: d8  d9da  db   dc  dd  de  df */
> > /*c0..f*/ fadd__, fld_i_,   fcmovb, fcmovnb, fadd_i, ffree_, faddp_, 
> > _df_c0_,
> > /*c8..f*/ fmul__, fxch_i,   fcmove, fcmovne, fmul_i, _dd_c8_,fmulp_, 
> > _df_c8_,
> > /*d0..7*/ fcom_st,fp_nop,   fcmovbe,fcmovnbe,_dc_d0_,fst_i_, 
> > _de_d0_,_df_d0_,
> > /*d8..f*/ fcompst,_d9_d8_,  fcmovu, fcmovnu, _dc_d8_,fstp_i, fcompp, 
> > _df_d8_,
> > /*e0..7*/ fsub__, FPU_etc,  __BAD__,finit_,  fsubri, fucom_, fsubrp, fstsw_,
> > /*e8..f*/ fsubr_, fconst,   fucompp,fucomi_, fsub_i, fucomp, fsubp_, 
> > fucomip,
> > /*f0..7*/ fdiv__, FPU_triga,__BAD__,fcomi_,  fdivri, __BAD__,fdivrp, fcomip,
> > /*f8..f*/ fdivr_, FPU_trigb,__BAD__,__BAD__, fdiv_i, __BAD__,fdivp_, 
> > __BAD__,
> 
> I agree with that, but please fix the vertical alignment (like my patch did), 
> as 
> the table is pretty hard to navigate in this form.

and by that I mean to split each line into two, to have groups of 4 
instructions 
and enough tabs between them.

> Also, the first patch in the series should remove the 'undocumented' #ifdef. 
> That define was fully justified ~20 years ago but let's not complicate new 
> code 
> with it.

The formerly undocumented opcodes could also grow real names.

All in nicely separate patches.

Thanks,

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


Re: [PATCH v2] x86/entry/32: Remove duplicate initialization of tss.ss1

2015-08-23 Thread Ingo Molnar

* Andy Lutomirski  wrote:

> On Sun, Aug 23, 2015 at 4:26 AM, Ingo Molnar  wrote:
> >
> > * Andy Lutomirski  wrote:
> >
> >> It's statically initialized, so we don't need to dynamically
> >> initialize it too.
> >>
> >> Reported-by: Brian Gerst 
> >> Signed-off-by: Andy Lutomirski 
> >> ---
> >>
> >> Changes since v1: Delete the code :)
> >>
> >> arch/x86/kernel/cpu/common.c | 8 
> >>  1 file changed, 8 deletions(-)
> >>
> >> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> >> index e2ed2513a51e..e08eee98a5f8 100644
> >> --- a/arch/x86/kernel/cpu/common.c
> >> +++ b/arch/x86/kernel/cpu/common.c
> >> @@ -1005,14 +1005,6 @@ void enable_sep_cpu(void)
> >>   if (IS_ENABLED(CONFIG_X86_32) && !boot_cpu_has(X86_FEATURE_SEP))
> >>   goto out;
> >>
> >> -#ifdef CONFIG_X86_32
> >> - /*
> >> -  * We cache MSR_IA32_SYSENTER_CS's value in the TSS's ss1 field --
> >> -  * see the big comment in struct x86_hw_tss's definition.
> >> -  */
> >> - tss->x86_tss.ss1 = __KERNEL_CS;
> >> -#endif
> >> -
> >>   wrmsrl_safe(MSR_IA32_SYSENTER_CS, __KERNEL_CS);
> >>   wrmsrl_safe(MSR_IA32_SYSENTER_ESP,
> >>   (unsigned long)tss +
> >
> > So this code changed substantially in tip:x86/asm - do we still need this 
> > patch?
> >
> 
> Yes, although I think it's actually the other way around -- I think
> this patch may have applied on top of something that never made it
> into tip/x86/asm.  I can re-check or I could just rebase the patch (or
> you could apply it with the obvious fixup).

Yeah, so I noticed that it fell amongst the cracks - please incorporate it into 
your next (v4.4 targeted) series once we get to that, so it doesn't get lost.

> It's obviously not a critical fix.

Yeah.

Thanks,

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


Re: [PATCH] x86/math-emu: Add support for FCMOVcc and F[U]COMI[P] insns

2015-08-23 Thread Ingo Molnar

* Denys Vlasenko  wrote:

> I propose the table to be commented like shown below:
> 
> /*Opcode: d8  d9da  db   dc  dd  de  df */
> /*c0..f*/ fadd__, fld_i_,   fcmovb, fcmovnb, fadd_i, ffree_, faddp_, _df_c0_,
> /*c8..f*/ fmul__, fxch_i,   fcmove, fcmovne, fmul_i, _dd_c8_,fmulp_, _df_c8_,
> /*d0..7*/ fcom_st,fp_nop,   fcmovbe,fcmovnbe,_dc_d0_,fst_i_, _de_d0_,_df_d0_,
> /*d8..f*/ fcompst,_d9_d8_,  fcmovu, fcmovnu, _dc_d8_,fstp_i, fcompp, _df_d8_,
> /*e0..7*/ fsub__, FPU_etc,  __BAD__,finit_,  fsubri, fucom_, fsubrp, fstsw_,
> /*e8..f*/ fsubr_, fconst,   fucompp,fucomi_, fsub_i, fucomp, fsubp_, fucomip,
> /*f0..7*/ fdiv__, FPU_triga,__BAD__,fcomi_,  fdivri, __BAD__,fdivrp, fcomip,
> /*f8..f*/ fdivr_, FPU_trigb,__BAD__,__BAD__, fdiv_i, __BAD__,fdivp_, __BAD__,

I agree with that, but please fix the vertical alignment (like my patch did), 
as 
the table is pretty hard to navigate in this form.

Also, the first patch in the series should remove the 'undocumented' #ifdef. 
That 
define was fully justified ~20 years ago but let's not complicate new code with 
it.

Thanks,

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


Re: [PATCH RESEND] sched/nohz: Affine unpinned timers to housekeepers

2015-08-23 Thread Ingo Molnar

* Paul E. McKenney  wrote:

> > here it's fully set - triggering the bug I'm worried about. So what am I 
> > missing, what prevents CONFIG_NO_HZ_FULL_ALL from crashing?
> 
> The boot CPU is excluded from tick_nohz_full_mask in tick_nohz_init(), which 
> is 
> called from tick_init() which is called from start_kernel() shortly after 
> rcu_init():
> 
>   cpu = smp_processor_id();
> 
>   if (cpumask_test_cpu(cpu, tick_nohz_full_mask)) {
>   pr_warning("NO_HZ: Clearing %d from nohz_full range for 
> timekeeping\n", cpu);
>   cpumask_clear_cpu(cpu, tick_nohz_full_mask);
>   }
> 
> This happens after the call to tick_nohz_init_all() that does the 
> cpumask_setall() that you called out above.

Ah, indeed - I somehow missed that.

This brings up two other questions:

1)

the 'housekeeping CPU' is essentially the boot CPU. Yet we dedicate a full mask 
to 
it (housekeeping_mask - a variable mask to begin with) and recover the 
housekeeping CPU via:

+   return cpumask_any_and(housekeeping_mask, cpu_online_mask);

which can be pretty expensive, and which gets executed in two hotpaths:

kernel/time/hrtimer.c:  return &per_cpu(hrtimer_bases, get_nohz_timer_target());
kernel/time/timer.c:return per_cpu_ptr(&tvec_bases, 
get_nohz_timer_target());

... why not just use a single housekeeping_cpu which would be way faster to 
pass 
down to the timer code?

2)

What happens if the boot CPU is offlined? (under 
CONFIG_BOOTPARAM_HOTPLUG_CPU0=y)

I don't see CPU hotplug callbacks fixing up the housekeeping_mask if the boot 
CPU 
is offlined.

Thanks,

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


Re: [PATCH-v6 0/6] mfd: 88pm800: Add Device tree support

2015-08-23 Thread Vaibhav Hiremath



On Tuesday 14 July 2015 12:27 AM, Vaibhav Hiremath wrote:



On Wednesday 08 July 2015 05:56 PM, Vaibhav Hiremath wrote:

This patch-series adds support for Device tree to 88PM800 mfd driver.
It also sets default configuration of irq clear method if board file
doesn't exist.

Testing::
  - Boot tested on PXA1928 based platform.
  - probe of mfd, rtc and regulator function passing successfully.
  - Basic read operations on registers
  - irq clear configuration

V5 => V6
===


I hope this will be queued for 4.2




Lee,

This patch-series is pending since long time, reviewed and acked.
Request to queue it up for next merge window.

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


Re: [PATCH] doc: dt: Add interrupt parent to Xilinx AXI DMA instantation example.

2015-08-23 Thread Michal Simek
On 08/21/2015 06:32 PM, Moritz Fischer wrote:
> This patch adds 'interrupt-parent' properties to the instantation example in
> the docs for the devicetree bindings of the Xilinx AXI DMA driver.
> 
> Signed-off-by: Moritz Fischer 
> ---
>  Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt 
> b/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt
> index 2291c40..7c956e9 100644
> --- a/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt
> +++ b/Documentation/devicetree/bindings/dma/xilinx/xilinx_dma.txt
> @@ -19,6 +19,7 @@ Required child node properties:
>  - compatible: It should be either "xlnx,axi-dma-mm2s-channel" or
>   "xlnx,axi-dma-s2mm-channel".
>  - interrupts: Should contain per channel DMA interrupts.
> +- interrupt-parent: Should contain interrupt parent.
>  - xlnx,datawidth: Should contain the stream data width, take values
>   {32,64...1024}.
>  
> @@ -36,11 +37,13 @@ axi_dma_0: axidma@4040 {
>   dma-channel@4040 {
>   compatible = "xlnx,axi-dma-mm2s-channel";
>   interrupts = < 0 59 4 >;
> + interrupt-parent = <&intc>;
>   xlnx,datawidth = <0x40>;
>   } ;
>   dma-channel@40400030 {
>   compatible = "xlnx,axi-dma-s2mm-channel";
>   interrupts = < 0 58 4 >;
> + interrupt-parent = <&intc>;
>   xlnx,datawidth = <0x40>;
>   } ;
>  } ;
> 

Acked-by: Michal Simek 

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


[PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

2015-08-23 Thread Xiao, Nan (Nan@HPS Performance, Beijing)
Hi David & joerg,

In iommu_context_addr() function, we always use lower extended-context-table
even though upper-half of the extended root-entry is present.

Signed-off-by: Nan Xiao 
---
 drivers/iommu/intel-iommu.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 0649b94..4213598 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -759,10 +759,11 @@ static inline struct context_entry 
*iommu_context_addr(struct intel_iommu *iommu
if (devfn >= 0x80) {
devfn -= 0x80;
entry = &root->hi;
-   }
+   } else
+   entry = &root->lo;
devfn *= 2;
-   }
-   entry = &root->lo;
+   } else
+   entry = &root->lo;
if (*entry & 1)
context = phys_to_virt(*entry & VTD_PAGE_MASK);
else {
-- 
2.4.3

Best Regards
Nan Xiao

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


Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes

2015-08-23 Thread Dave Chinner
On Mon, Aug 24, 2015 at 11:18:16AM +0800, Eryu Guan wrote:
> On Mon, Aug 24, 2015 at 11:11:23AM +1000, Dave Chinner wrote:
> > 
> > Eryu, can you change the way you run the event trace to be:
> > 
> > $ sudo trace-cmd  -o  ./check 
> > 
> > rather than running the trace as a background operation elsewhere?
> > Maybe that will give better results.
> 
> The results are here
> 
> http://128.199.137.77/writeback-v3/

OK, the trace is still missing a few events, but it's much more
complete, and contains the events that tell more of the story:

$ ls -li /mnt/scr
total 51196
15688955 -rw--- 1 root root 10481664 Aug 24 13:06 985
15688959 -rw--- 1 root root0 Aug 24 13:06 989
15688961 -rw--- 1 root root0 Aug 24 13:06 991
15688964 -rw--- 1 root root0 Aug 24 13:06 994
15688966 -rw--- 1 root root0 Aug 24 13:06 996
$


 Inode #  Sizeblock count  flushiter
   dec  hex   inode loginode   log  inode  log
15688955  0xef64fb  0x9ff000  0x9ff000 0x9ff  0xa00  1  0
15688959  0xef64ff  00 0xa00  0xa00  0  0
15688961  0xef6501  00 0xa00  0xa00  0  0
15688964  0xef6504  00 0xa00  0xa00  0  0
15688966  0xef6506  00 0xa00  0xa00  0  0


Ok, that tallies with the previous symptoms. However, the trace
tells us something different. the xfs_setfilesize events. here's the
last 12 xfs_setfilesize events delivered in the trace (trimmed for
brevity and focus):

ino 0xef64fa isize 0xa0 disize 0x0 offset 0x0 count 10481664
ino 0xef64fa isize 0xa0 disize 0x9ff000 offset 0x9ff000 count 409
ino 0xef64fb isize 0xa0 disize 0x0 offset 0x0 count 10481664
ino 0xef64fb isize 0xa0 disize 0x9ff000 offset 0x9ff000 count 4096
ino 0xef64ff isize 0xa0 disize 0x0 offset 0x0 count 10481664
ino 0xef64ff isize 0xa0 disize 0x9ff000 offset 0x9ff000 count 4096
ino 0xef6501 isize 0xa0 disize 0x0 offset 0x0 count 10481664
ino 0xef6501 isize 0xa0 disize 0x9ff000 offset 0x9ff000 count 4096
ino 0xef6504 isize 0xa0 disize 0x0 offset 0x0 count 10481664
ino 0xef6504 isize 0xa0 disize 0x9ff000 offset 0x9ff000 count 4096
ino 0xef6506 isize 0xa0 disize 0x0 offset 0x0 count 10481664
ino 0xef6506 isize 0xa0 disize 0x9ff000 offset 0x9ff000 count 4096

Yeah, the last 9 transactions corresponding to these events are not
in the log.  Which means, most likely, that they occurred after
->sync_fs forced the log out. THe next thing that happens is the fs
is shut down, and that's preventing the dirty log from being written
to disk.

Eryu, this can be confirmed by add the xfs_log_force event to the
trace.

What I can't see in the traces is where sync is doing a blocking
sync pass on the fileystem. The wbc control structure being passed
to XFS is:

wbc_writepage:bdi 253:0: towrt=45569 skip=0 mode=0 kupd=0 bgrd=0 
reclm=0 cyclic=0 start=0x0 end=0x7fff

Which is not coming from sync_inodes_sb() as the sync mode is
incorrect (i.e. not WB_SYNC_ALL). It looks to me that writeback is
coming from a generic bdi flusher command rather than a directed
superblock sync. i.e. through wakeup_flusher_threads() which sets:

work->sync_mode = WB_SYNC_NONE;
work->nr_pages  = nr_pages;
work->range_cyclic = range_cyclic;
work->reason= reason;
work->auto_free = 1;

as the reason is "sync":

sync-18849  writeback_queue:  bdi 253:0: sb_dev 0:0 
nr_pages=308986 sync_mode=0 kupdate=0 range_cyclic=0 background=0 reason=sync
sync-18849  writeback_queue:  bdi 253:0: sb_dev 253:1 
nr_pages=9223372036854775807 sync_mode=1 kupdate=0 range_cyclic=0 background=0 
reason=sync

kworker/u8:1-1563   writeback_exec:   bdi 253:0: sb_dev 0:0 
nr_pages=308986 sync_mode=0 kupdate=0 range_cyclic=0 background=0 reason=sync
kworker/u8:1-1563   writeback_start:  bdi 253:0: sb_dev 0:0 
nr_pages=308986 sync_mode=0 kupdate=0 range_cyclic=0 background=0 reason=sync

The next writeback_queue/writeback_exec tracepoint pair are:


 kworker/2:1-17163  xfs_setfilesize:  dev 253:6 ino 0xef6506 isize 
0xa0 disize 0x0 offset 0x0 count 10481664
 kworker/2:1-17163  xfs_setfilesize:  dev 253:6 ino 0xef6506 isize 
0xa0 disize 0x9ff000 offset 0x9ff000 count 4096
sync-18849  wbc_writepage:bdi 253:0: 
towrt=9223372036854775798 skip=0 mode=1 kupd=0 bgrd=0 reclm=0 cyclic=0 
start=0x0 end=0x7fff
sync-18849  wbc_writepage:bdi 253:0: 
towrt=9223372036854775797 skip=0 mode=1 kupd=0 bgrd=0 reclm=0 cyclic=0 
start=0x0 end=0x7fff
sync-18849  wbc_writepage:bdi 253:0: 
towrt=9223372036854775796 skip=0 mode=1 kupd=0 bgrd=0 reclm=0 cyclic=0 
start=0x0 end=0x7fff
sync-18849  wbc_writepage:bdi 253:0: 
towrt=9223372036854775795 skip=0 mode=1 kupd=0 bgrd=0 reclm=0 

Re: [PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations

2015-08-23 Thread Maxime Ripard
On Mon, Aug 24, 2015 at 01:36:14PM +0900, Masahiro Yamada wrote:
> The smp_operations structure is not over-written, so add const
> qualifier and replace __initdata with __initconst.
> 
> Also, add static to sun8i_smp_ops.
> 
> Signed-off-by: Masahiro Yamada 

Acked-by: Maxime Ripard 

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


signature.asc
Description: Digital signature


RE: [PATCH 3/8][v3]usb:fsl:otg: Add support to add/remove usb host driver

2015-08-23 Thread Ramneek Mehresh


> -Original Message-
> From: Alan Stern [mailto:st...@rowland.harvard.edu]
> Sent: Thursday, August 20, 2015 7:40 PM
> To: Mehresh Ramneek-B31383 
> Cc: linux-kernel@vger.kernel.org; ba...@ti.com;
> gre...@linuxfoundation.org; linux-...@vger.kernel.org; Li Yang-Leo-R58472
> 
> Subject: RE: [PATCH 3/8][v3]usb:fsl:otg: Add support to add/remove usb
> host driver
> 
> On Thu, 20 Aug 2015, Ramneek Mehresh wrote:
> 
> > > > --- a/drivers/usb/host/ehci-fsl.h
> > > > +++ b/drivers/usb/host/ehci-fsl.h
> > > > @@ -63,4 +63,22 @@
> > > >  #define UTMI_PHY_EN (1<<9)
> > > >  #define ULPI_PHY_CLK_SEL(1<<10)
> > > >  #define PHY_CLK_VALID  (1<<17)
> > > > +
> > > > +struct ehci_fsl {
> > > > +#ifdef CONFIG_PM
> > > > +   /* Saved USB PHY settings, need to restore after deep sleep. */
> > > > +   u32 usb_ctrl;
> > > > +#endif
> > >
> > > Do you need this #ifdef?
> > >
> > Yes, this is required for deep-sleep support...we need to save/restore
> controller
> > registers during deep-sleep when usb controller power is shut-off. Don't
> need this
> > during normal usb operation...saving/restoring usb controller registers in
> non deep-sleep
> > scenario will add unnecessary delays
> 
> What I meant was, can you keep the "u32 usb_ctrl;" line but get rid of
> the "#ifdef CONFIG_PM" and "#endif" lines?
> 
> Alan Stern
I do understand that. However, USB suspend/resume functionality work in context 
of
PM. Only in this context, we need to save/restore usb controller register
for deep-sleep functionality. If you see usage of this in ehci-fsl.c file, it's 
used in 
ehci_fsl_drv_suspend() under CONFIG_PM to save USB CNTL register.
If I remove CONFIG_PM from struct ehci_fsl{}, I'll need to change the entire 
driver
also to make suspend and resume functionalities compile by default.
   
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH-v5 RESEND 3/5] i2c: pxa: Add support for pxa910/988 & new configuration features

2015-08-23 Thread Vaibhav Hiremath
TWSI_ILCR & TWSI_IWCR registers are used to adjust clock rate
of standard & fast mode in pxa910/988; so this patch adds these two new
entries to "struct pxa_reg_layout" and "struct pxa_i2c".

As discussed in the previous patch-series, the idea here is to add standard
DT properties for ilcr and iwcr configuration fields.
In case of Master ilcr is used for low/high time and in case of slave mode
of operation iwcr is used for setup/hold time.

Signed-off-by: Jett.Zhou 
Signed-off-by: Yi Zhang 
Signed-off-by: Vaibhav Hiremath 
Tested-by: Robert Jarzmik 
---
 drivers/i2c/busses/i2c-pxa.c | 42 +-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index abf04f2..8d76197 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -46,12 +46,15 @@ struct pxa_reg_layout {
u32 icr;
u32 isr;
u32 isar;
+   u32 ilcr;
+   u32 iwcr;
 };
 
 enum pxa_i2c_types {
REGS_PXA2XX,
REGS_PXA3XX,
REGS_CE4100,
+   REGS_PXA910,
 };
 
 /*
@@ -79,12 +82,22 @@ static struct pxa_reg_layout pxa_reg_layout[] = {
.isr =  0x04,
/* no isar register */
},
+   [REGS_PXA910] = {
+   .ibmr = 0x00,
+   .idbr = 0x08,
+   .icr =  0x10,
+   .isr =  0x18,
+   .isar = 0x20,
+   .ilcr = 0x28,
+   .iwcr = 0x30,
+   },
 };
 
 static const struct platform_device_id i2c_pxa_id_table[] = {
{ "pxa2xx-i2c", REGS_PXA2XX },
{ "pxa3xx-pwri2c",  REGS_PXA3XX },
{ "ce4100-i2c", REGS_CE4100 },
+   { "pxa910-i2c", REGS_PXA910 },
{ },
 };
 MODULE_DEVICE_TABLE(platform, i2c_pxa_id_table);
@@ -124,6 +137,24 @@ MODULE_DEVICE_TABLE(platform, i2c_pxa_id_table);
 #define ISR_SAD(1 << 9)   /* slave address detected */
 #define ISR_BED(1 << 10)  /* bus error no ACK/NAK */
 
+/* bit field shift & mask */
+#define ILCR_SLV_SHIFT 0
+#define ILCR_SLV_MASK  (0x1FF << ILCR_SLV_SHIFT)
+#define ILCR_FLV_SHIFT 9
+#define ILCR_FLV_MASK  (0x1FF << ILCR_FLV_SHIFT)
+#define ILCR_HLVL_SHIFT18
+#define ILCR_HLVL_MASK (0x1FF << ILCR_HLVL_SHIFT)
+#define ILCR_HLVH_SHIFT27
+#define ILCR_HLVH_MASK (0x1F << ILCR_HLVH_SHIFT)
+
+#define IWCR_CNT_SHIFT 0
+#define IWCR_CNT_MASK  (0x1F << IWCR_CNT_SHIFT)
+#define IWCR_HS_CNT1_SHIFT 5
+#define IWCR_HS_CNT1_MASK  (0x1F << IWCR_HS_CNT1_SHIFT)
+#define IWCR_HS_CNT2_SHIFT 10
+#define IWCR_HS_CNT2_MASK  (0x1F << IWCR_HS_CNT2_SHIFT)
+
+
 struct pxa_i2c {
spinlock_t  lock;
wait_queue_head_t   wait;
@@ -150,6 +181,8 @@ struct pxa_i2c {
void __iomem*reg_icr;
void __iomem*reg_isr;
void __iomem*reg_isar;
+   void __iomem*reg_ilcr;
+   void __iomem*reg_iwcr;
 
unsigned long   iobase;
unsigned long   iosize;
@@ -169,6 +202,8 @@ struct pxa_i2c {
 #define _ICR(i2c)  ((i2c)->reg_icr)
 #define _ISR(i2c)  ((i2c)->reg_isr)
 #define _ISAR(i2c) ((i2c)->reg_isar)
+#define _ILCR(i2c) ((i2c)->reg_ilcr)
+#define _IWCR(i2c) ((i2c)->reg_iwcr)
 
 /*
  * I2C Slave mode address
@@ -1135,7 +1170,7 @@ static const struct i2c_algorithm i2c_pxa_pio_algorithm = 
{
 static const struct of_device_id i2c_pxa_dt_ids[] = {
{ .compatible = "mrvl,pxa-i2c", .data = (void *)REGS_PXA2XX },
{ .compatible = "mrvl,pwri2c", .data = (void *)REGS_PXA3XX },
-   { .compatible = "mrvl,mmp-twsi", .data = (void *)REGS_PXA2XX },
+   { .compatible = "mrvl,mmp-twsi", .data = (void *)REGS_PXA910 },
{}
 };
 MODULE_DEVICE_TABLE(of, i2c_pxa_dt_ids);
@@ -1243,6 +1278,11 @@ static int i2c_pxa_probe(struct platform_device *dev)
if (i2c_type != REGS_CE4100)
i2c->reg_isar = i2c->reg_base + pxa_reg_layout[i2c_type].isar;
 
+   if (i2c_type == REGS_PXA910) {
+   i2c->reg_ilcr = i2c->reg_base + pxa_reg_layout[i2c_type].ilcr;
+   i2c->reg_iwcr = i2c->reg_base + pxa_reg_layout[i2c_type].iwcr;
+   }
+
i2c->iobase = res->start;
i2c->iosize = resource_size(res);
 
-- 
1.9.1

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


[PATCH-v5 RESEND 2/5] i2c: pxa: enable/disable i2c module across msg xfer

2015-08-23 Thread Vaibhav Hiremath
From: Yi Zhang 

Enable i2c module/unit before transmission and disable when it
finishes.

why?
It's because the i2c bus may be disturbed if the slave device,
typically a touch, powers on.

As we do not want to break slave mode support, this patch introduces
DT property to control disable of the I2C module after xfer in master
mode of operation.

i2c-disable-after-xfer : If set, driver will disable I2C module after
msg xfer

Signed-off-by: Yi Zhang 
Signed-off-by: Vaibhav Hiremath 
---
 drivers/i2c/busses/i2c-pxa.c | 43 +--
 1 file changed, 41 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 66cf437..abf04f2 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -161,6 +161,7 @@ struct pxa_i2c {
unsigned char   master_code;
unsigned long   rate;
boolhighmode_enter;
+   booldisable_after_xfer;
 };
 
 #define _IBMR(i2c) ((i2c)->reg_ibmr)
@@ -284,6 +285,24 @@ static void i2c_pxa_scream_blue_murder(struct pxa_i2c 
*i2c, const char *why)
 static void i2c_pxa_master_complete(struct pxa_i2c *i2c, int ret);
 static irqreturn_t i2c_pxa_handler(int this_irq, void *dev_id);
 
+/* enable/disable i2c unit */
+static inline int i2c_pxa_is_enabled(struct pxa_i2c *i2c)
+{
+   return (readl(_ICR(i2c)) & ICR_IUE);
+}
+
+static inline void i2c_pxa_enable(struct pxa_i2c *i2c, bool enable)
+{
+   if (enable) {
+   if (!i2c_pxa_is_enabled(i2c)) {
+   writel(readl(_ICR(i2c)) | ICR_IUE, _ICR(i2c));
+   udelay(100);
+   }
+   } else {
+   writel(readl(_ICR(i2c)) & ~ICR_IUE, _ICR(i2c));
+   }
+}
+
 static inline int i2c_pxa_is_slavemode(struct pxa_i2c *i2c)
 {
return !(readl(_ICR(i2c)) & ICR_SCLE);
@@ -480,8 +499,7 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c)
i2c_pxa_set_slave(i2c, 0);
 
/* enable unit */
-   writel(readl(_ICR(i2c)) | ICR_IUE, _ICR(i2c));
-   udelay(100);
+   i2c_pxa_enable(i2c, true);
 }
 
 
@@ -832,6 +850,9 @@ static int i2c_pxa_pio_xfer(struct i2c_adapter *adap,
struct pxa_i2c *i2c = adap->algo_data;
int ret, i;
 
+   /* Enable i2c unit */
+   i2c_pxa_enable(i2c, true);
+
/* If the I2C controller is disabled we need to reset it
  (probably due to a suspend/resume destroying state). We do
  this here as we can then avoid worrying about resuming the
@@ -852,6 +873,11 @@ static int i2c_pxa_pio_xfer(struct i2c_adapter *adap,
ret = -EREMOTEIO;
  out:
i2c_pxa_set_slave(i2c, ret);
+
+   /* disable i2c unit */
+   if (i2c->disable_after_xfer)
+   i2c_pxa_enable(i2c, false);
+
return ret;
 }
 
@@ -1067,6 +1093,9 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct 
i2c_msg msgs[], int num
struct pxa_i2c *i2c = adap->algo_data;
int ret, i;
 
+   /* Enable i2c unit */
+   i2c_pxa_enable(i2c, true);
+
for (i = adap->retries; i >= 0; i--) {
ret = i2c_pxa_do_xfer(i2c, msgs, num);
if (ret != I2C_RETRY)
@@ -1080,6 +1109,10 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct 
i2c_msg msgs[], int num
ret = -EREMOTEIO;
  out:
i2c_pxa_set_slave(i2c, ret);
+   /* disable i2c unit */
+   if (i2c->disable_after_xfer)
+   i2c_pxa_enable(i2c, false);
+
return ret;
 }
 
@@ -1120,6 +1153,9 @@ static int i2c_pxa_probe_dt(struct platform_device *pdev, 
struct pxa_i2c *i2c,
/* For device tree we always use the dynamic or alias-assigned ID */
i2c->adap.nr = -1;
 
+   i2c->disable_after_xfer = of_property_read_bool(np,
+   "i2c-disable-after-xfer");
+
if (of_get_property(np, "mrvl,i2c-polling", NULL))
i2c->use_pio = 1;
if (of_get_property(np, "mrvl,i2c-fast-mode", NULL))
@@ -1264,6 +1300,9 @@ static int i2c_pxa_probe(struct platform_device *dev)
 
platform_set_drvdata(dev, i2c);
 
+   if (i2c->disable_after_xfer)
+   i2c_pxa_enable(i2c, false);
+
 #ifdef CONFIG_I2C_PXA_SLAVE
dev_info(&i2c->adap.dev, " PXA I2C adapter, slave address %d\n",
i2c->slave_addr);
-- 
1.9.1

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


[PATCH-v5 RESEND 4/5] Documentation: binding: add sclk adjustment properties to i2c-pxa

2015-08-23 Thread Vaibhav Hiremath
With addition of PXA910 family of devices, the TWSI module supports
new feature which allows us to adjust SCLK. i2c-pxa driver takes input
configuration in nsec and converts it to respective bit-fields,

 - i2c-sclk-low-time-ns : SCLK low time (tlow)
   This property is used along with mode selection.
 - i2c-sclk-high-time-ns : SCLK high time (thigh)
 - i2c-start-hold-time-ns : Used in case of high speed mode for start bit
   hold/setup wait counter.
 - i2c-stop-hold-time-ns : Used in case of high speed mode for stop bit
   hold/setup wait counter.
 - i2c-sda-hold-time-ns : Used to calculate hold/setup wait counter for
   standard and fast mode.

Signed-off-by: Vaibhav Hiremath 
---
 Documentation/devicetree/bindings/i2c/i2c-pxa.txt | 13 +
 1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt 
b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
index 9657db5..bb4df60 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
@@ -23,12 +23,25 @@ Optional properties :
  - i2c-disable-after-xfer : If set, driver will disable I2C module
after msg xfer and enable it again before xfer.
 
+   (Applicable to PXA910 family):
+
+ - i2c-sclk-low-time-ns : SCLK low time (tlow), for standard/fast/high
+   speed mode.
+   This property is used along with mode selection. Driver uses this property
+   to set low/high time for standard and fast speed mode, as HW counter
+   bit-field is same for both.
+ - i2c-sclk-high-time-ns : SCLK high time (thigh), Used in case of high speed
+   mode only.
+
 Examples:
twsi1: i2c@d4011000 {
compatible = "mrvl,mmp-twsi";
reg = <0xd4011000 0x1000>;
interrupts = <7>;
mrvl,i2c-fast-mode;
+
+   i2c-sclk-low-time-ns = <988>;
+   i2c-sclk-high-time-ns = <988>;
};

twsi2: i2c@d4025000 {
-- 
1.9.1

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


[PATCH-v5 RESEND 5/5] i2c: pxa: Add ILCR (tLow & tHigh) configuration support

2015-08-23 Thread Vaibhav Hiremath
With addition of PXA910 family of devices, the TWSI module supports
SCL clock adjustment using ILCR register.

This patch enables the control and configuration of ICLR through DT
properties,

i2c-sclk-high-time-ns:
  SCLK high time (tHigh), for standard/fast/high speed mode
i2c-sclk-low-time-ns:
  SCLK low time (tLow), for standard/fast/high speed mode

Note that in case of standard and fast mod, the tLow and tHigh counters
are same, and software will use tLow value.

Also, brought up devm_clk_get() fn above i2c_pxa_probe_dt(), as it
uses clk rate for timing calculations.

Signed-off-by: Vaibhav Hiremath 
Signed-off-by: Jett.Zhou 
Signed-off-by: Yi Zhang 
Tested-by: Robert Jarzmik 
---
 drivers/i2c/busses/i2c-pxa.c | 69 
 1 file changed, 63 insertions(+), 6 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 8d76197..6012ae5 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -195,6 +195,9 @@ struct pxa_i2c {
unsigned long   rate;
boolhighmode_enter;
booldisable_after_xfer;
+
+   unsigned intsclk_thigh_load_cnt;
+   unsigned intsclk_tlow_load_cnt;
 };
 
 #define _IBMR(i2c) ((i2c)->reg_ibmr)
@@ -507,6 +510,36 @@ static void i2c_pxa_set_slave(struct pxa_i2c *i2c, int 
errcode)
 #define i2c_pxa_set_slave(i2c, err)do { } while (0)
 #endif
 
+static void i2c_pxa_do_sclk_adj(struct pxa_i2c *i2c)
+{
+   unsigned int reg_ilcr;
+
+   if (!i2c->reg_ilcr)
+   return;
+
+   reg_ilcr = readl(_ILCR(i2c));
+
+   /* For standard/fast mode tlow and thigh counters are same */
+   if (i2c->sclk_tlow_load_cnt) {
+   unsigned int mask, shift;
+
+   mask = i2c->high_mode ? ILCR_HLVL_MASK :
+   i2c->fast_mode ? ILCR_FLV_MASK : ILCR_SLV_MASK;
+   shift = i2c->high_mode ? ILCR_HLVL_SHIFT :
+   i2c->fast_mode ? ILCR_FLV_SHIFT : ILCR_SLV_SHIFT;
+
+   reg_ilcr &= ~mask;
+   reg_ilcr |= i2c->sclk_tlow_load_cnt << shift;
+   }
+
+   if (i2c->high_mode && i2c->sclk_thigh_load_cnt) {
+   reg_ilcr &= ~ILCR_HLVH_MASK;
+   reg_ilcr |= i2c->sclk_thigh_load_cnt << ILCR_HLVH_SHIFT;
+   }
+
+   writel(reg_ilcr, _ILCR(i2c));
+}
+
 static void i2c_pxa_reset(struct pxa_i2c *i2c)
 {
pr_debug("Resetting I2C Controller Unit\n");
@@ -526,6 +559,8 @@ static void i2c_pxa_reset(struct pxa_i2c *i2c)
writel(I2C_ICR_INIT | (i2c->fast_mode ? ICR_FM : 0), _ICR(i2c));
writel(readl(_ICR(i2c)) | (i2c->high_mode ? ICR_HS : 0), _ICR(i2c));
 
+   i2c_pxa_do_sclk_adj(i2c);
+
 #ifdef CONFIG_I2C_PXA_SLAVE
dev_info(&i2c->adap.dev, "Enabling slave mode\n");
writel(readl(_ICR(i2c)) | ICR_SADIE | ICR_ALDIE | ICR_SSDIE, _ICR(i2c));
@@ -1198,6 +1233,26 @@ static int i2c_pxa_probe_dt(struct platform_device 
*pdev, struct pxa_i2c *i2c,
 
*i2c_types = (enum pxa_i2c_types)(of_id->data);
 
+   /* optional properties */
+   if (of_device_is_compatible(np, "mrvl,mmp-twsi")) {
+   unsigned int tlow = 0, thigh = 0;
+   unsigned int clk_ns;
+
+   /* clock time in nsec */
+   clk_ns = 100 / (i2c->rate / 1000);
+
+   of_property_read_u32(np, "i2c-sclk-high-time-ns", &thigh);
+   i2c->sclk_thigh_load_cnt = thigh / clk_ns;
+
+   of_property_read_u32(np, "i2c-sclk-low-time-ns", &tlow);
+   i2c->sclk_tlow_load_cnt = tlow / clk_ns;
+
+   /* For std/fast mode tlow & thigh have same bit-fields */
+   if (!i2c->high_mode &&
+   (i2c->sclk_tlow_load_cnt != i2c->sclk_thigh_load_cnt))
+   dev_warn(&i2c->adap.dev,
+   "mismatch of tLow & tHigh values, using 
tLow\n");
+   }
return 0;
 }
 
@@ -1248,6 +1303,14 @@ static int i2c_pxa_probe(struct platform_device *dev)
return irq;
}
 
+   i2c->clk = devm_clk_get(&dev->dev, NULL);
+   if (IS_ERR(i2c->clk)) {
+   dev_err(&dev->dev, "failed to get the clk: %ld\n", 
PTR_ERR(i2c->clk));
+   return PTR_ERR(i2c->clk);
+   }
+
+   i2c->rate = clk_get_rate(i2c->clk);
+
/* Default adapter num to device id; i2c_pxa_probe_dt can override. */
i2c->adap.nr = dev->id;
 
@@ -1265,12 +1328,6 @@ static int i2c_pxa_probe(struct platform_device *dev)
 
strlcpy(i2c->adap.name, "pxa_i2c-i2c", sizeof(i2c->adap.name));
 
-   i2c->clk = devm_clk_get(&dev->dev, NULL);
-   if (IS_ERR(i2c->clk)) {
-   dev_err(&dev->dev, "failed to get the clk: %ld\n", 
PTR_ERR(i2c->clk));
-   return PTR_ERR(i2c->clk);
-   }
-
i2c->reg_ibmr = i2c->reg_base + pxa_reg_layout[i2c_type].ibmr;
i2c->reg_idbr = i2c->re

[PATCH-v5 RESEND 1/5] Documentation: binding: add new property 'disable_after_xfer' to i2c-pxa

2015-08-23 Thread Vaibhav Hiremath
Driver will now supports enable/disable across msg xfer, which user
can control it by new DT property -

i2c-disable-after-xfer : If set, driver will disable I2C module after msg
 xfer and enable it back before xfer.

Signed-off-by: Vaibhav Hiremath 
---
 Documentation/devicetree/bindings/i2c/i2c-pxa.txt | 5 +
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt 
b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
index 12b78ac..9657db5 100644
--- a/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c-pxa.txt
@@ -18,6 +18,11 @@ Recommended properties :
status register of i2c controller instead.
  - mrvl,i2c-fast-mode : Enable fast mode of i2c controller.
 
+Optional properties :
+
+ - i2c-disable-after-xfer : If set, driver will disable I2C module
+   after msg xfer and enable it again before xfer.
+
 Examples:
twsi1: i2c@d4011000 {
compatible = "mrvl,mmp-twsi";
-- 
1.9.1

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


[PATCH-v5 RESEND 0/5] i2c: pxa: Add support for PXA910 family of device

2015-08-23 Thread Vaibhav Hiremath
Sorry for not following up on this aggressively, was quit busy with some
other stuff. Resending this patch with Robert's Tested-By.


This patch-series is subset of the original patch-series, submitted
on 14 Jul 2015.
Link to Original Patch-series - https://lkml.org/lkml/2015/7/14/80

The first six patches have been already queued up for upstream. So this
patch-series is respin of remaining 5 patches.

Testing:
  - Basic testing on PMIC device on I2C-0 interface
  - Boot tested on platform based on PXA1928
  - Read few registers of PMIC (RTC, ID, etc...) during boot

V4 => V5
===
Link to V3: https://lkml.org/lkml/2015/7/14/80
  - Dropped First 6 patches as they are already accepted, queued for upstream
  - Fixed a bug in PATCH [5/5], where for non PXA910 devices it as resulting 
into
NULL pointer dereference.


For the record, pasting all the details from original patch-series -

V3 => V4
===
Link to V3: http://www.spinics.net/lists/devicetree/msg85904.html
  - [PATCH 06/11] Removed unnecessary dev_err on devm_kzalloc() check
  - [PATCH 06/11] Removed return check on platform_get_resource(), as 
devm_ioremap_resource() does it for us.
Also, brought up the devm_ioremap_resource() function call in the execution
sequence, as no point in delaying it if we do not have resource.
It make sense, after this change.
  - [PATCH 04/11] Typecast changed to 'enum pxa_i2c_types'
Also updated the subject line "Removed ==> Fix"

V2 => V3
===
Link to V2: http://www.spinics.net/lists/linux-i2c/msg20059.html
  - Removed PATCH [4/12] related to reset of I2C module.
Suggested by "Robert Jarzmik"
  - Updated commit description for,
  PATCH [11/12]: Mentioned reasoning about moment of clk_get code.
  PATCH [12/12]: for DT property node.
  - Added Acked by "Robert Jarzmik" to patched which he acked.

V1 => V2:

Link to V1 - 
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-May/347012.html
  - Fixed all comments from "Robert Jarzmik" and "Wolfram Sang"
 - Dropped Patch
 05/12: using core bus reset implementation - under work.
 08/12: NAKed and dropped
 - Separated DT binding patch from driver changes, for easy merge


Vaibhav Hiremath (4):
  Documentation: binding: add new property 'disable_after_xfer' to
i2c-pxa
  i2c: pxa: Add support for pxa910/988 & new configuration features
  Documentation: binding: add sclk adjustment properties to i2c-pxa
  i2c: pxa: Add ILCR (tLow & tHigh) configuration support

Yi Zhang (1):
  i2c: pxa: enable/disable i2c module across msg xfer

 Documentation/devicetree/bindings/i2c/i2c-pxa.txt |  18 +++
 drivers/i2c/busses/i2c-pxa.c  | 154 --
 2 files changed, 163 insertions(+), 9 deletions(-)

-- 
1.9.1

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


linux-next: manual merge of the kvm-ppc tree with the tip tree

2015-08-23 Thread Stephen Rothwell
Hi Alexander,

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

  arch/powerpc/kvm/book3s_hv.c

between commit:

  c56dadf39761 ("sched/preempt, powerpc, kvm: Use need_resched() instead of 
should_resched()")

from the tip tree and commit:

  ec2571650826 ("KVM: PPC: Book3S HV: Make use of unused threads when running 
guests")

from the kvm-ppc 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 arch/powerpc/kvm/book3s_hv.c
index a9f753fb73a8,fad52f226c12..
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@@ -2178,11 -2670,12 +2670,13 @@@ static int kvmppc_run_vcpu(struct kvm_r
vc->runner = vcpu;
if (n_ceded == vc->n_runnable) {
kvmppc_vcore_blocked(vc);
 -  } else if (should_resched()) {
 +  } else if (need_resched()) {
 +  vc->vcore_state = VCORE_PREEMPT;
+   kvmppc_vcore_preempt(vc);
/* Let something else run */
cond_resched_lock(&vc->lock);
-   vc->vcore_state = VCORE_INACTIVE;
+   if (vc->vcore_state == VCORE_PREEMPT)
+   kvmppc_vcore_end_preempt(vc);
} else {
kvmppc_run_core(vc);
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [RFT PATCH] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-08-23 Thread Keerthy



On Tuesday 18 August 2015 05:24 PM, Keerthy wrote:



On Tuesday 18 August 2015 03:40 PM, Keerthy wrote:

Currently apart from dra7, omap5 and amx3 all the other SoCs
are identified using cpu_is_* functions which is not right since
they are all SoCs(System on Chips). Hence changing the SoC
identificätion code to use soc_is instead of cpu_is and keeping
defines for cpu_is where needed. This allows us to replace the
rest of cpu_is usage along with other fixes as needed.

Signed-off-by: Keerthy 
---


Boot tested on dra7-evm, omap4-panda, am437x-gp-evm.


Also boot tested on OMAP3 BeagleBoard xM and AM335x BeagleBone.




  arch/arm/mach-omap2/id.c  |  30 +++
  arch/arm/mach-omap2/soc.h | 193
++
  2 files changed, 123 insertions(+), 100 deletions(-)

diff --git a/arch/arm/mach-omap2/id.c b/arch/arm/mach-omap2/id.c
index e3f713f..24f24d4 100644
--- a/arch/arm/mach-omap2/id.c
+++ b/arch/arm/mach-omap2/id.c
@@ -57,15 +57,15 @@ int omap_type(void)
  if (val < OMAP2_DEVICETYPE_MASK)
  return val;

-if (cpu_is_omap24xx()) {
+if (soc_is_omap24xx()) {
  val = omap_ctrl_readl(OMAP24XX_CONTROL_STATUS);
-} else if (cpu_is_ti81xx()) {
+} else if (soc_is_ti81xx()) {
  val = omap_ctrl_readl(TI81XX_CONTROL_STATUS);
  } else if (soc_is_am33xx() || soc_is_am43xx()) {
  val = omap_ctrl_readl(AM33XX_CONTROL_STATUS);
-} else if (cpu_is_omap34xx()) {
+} else if (soc_is_omap34xx()) {
  val = omap_ctrl_readl(OMAP343X_CONTROL_STATUS);
-} else if (cpu_is_omap44xx()) {
+} else if (soc_is_omap44xx()) {
  val = omap_ctrl_readl(OMAP4_CTRL_MODULE_CORE_STATUS);
  } else if (soc_is_omap54xx() || soc_is_dra7xx()) {
  val = omap_ctrl_readl(OMAP5XXX_CONTROL_STATUS);
@@ -122,7 +122,7 @@ static u16 tap_prod_id;

  void omap_get_die_id(struct omap_die_id *odi)
  {
-if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
+if (soc_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
  odi->id_0 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_0);
  odi->id_1 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_1);
  odi->id_2 = read_tap_reg(OMAP_TAP_DIE_ID_44XX_2);
@@ -218,17 +218,17 @@ static void __init omap3_cpuinfo(void)
   * on available features. Upon detection, update the CPU id
   * and CPU class bits.
   */
-if (cpu_is_omap3630()) {
+if (soc_is_omap3630()) {
  cpu_name = "OMAP3630";
  } else if (soc_is_am35xx()) {
  cpu_name = (omap3_has_sgx()) ? "AM3517" : "AM3505";
-} else if (cpu_is_ti816x()) {
+} else if (soc_is_ti816x()) {
  cpu_name = "TI816X";
  } else if (soc_is_am335x()) {
  cpu_name =  "AM335X";
  } else if (soc_is_am437x()) {
  cpu_name =  "AM437x";
-} else if (cpu_is_ti814x()) {
+} else if (soc_is_ti814x()) {
  cpu_name = "TI814X";
  } else if (omap3_has_iva() && omap3_has_sgx()) {
  /* OMAP3430, OMAP3525, OMAP3515, OMAP3503 devices */
@@ -275,11 +275,11 @@ void __init omap3xxx_check_features(void)
  OMAP3_CHECK_FEATURE(status, SGX);
  OMAP3_CHECK_FEATURE(status, NEON);
  OMAP3_CHECK_FEATURE(status, ISP);
-if (cpu_is_omap3630())
+if (soc_is_omap3630())
  omap_features |= OMAP3_HAS_192MHZ_CLK;
-if (cpu_is_omap3430() || cpu_is_omap3630())
+if (soc_is_omap3430() || soc_is_omap3630())
  omap_features |= OMAP3_HAS_IO_WAKEUP;
-if (cpu_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
+if (soc_is_omap3630() || omap_rev() == OMAP3430_REV_ES3_1 ||
  omap_rev() == OMAP3430_REV_ES3_1_2)
  omap_features |= OMAP3_HAS_IO_CHAIN_CTRL;

@@ -697,7 +697,7 @@ void __init omap2_set_globals_tap(u32 class, void
__iomem *tap)
  tap_base = tap;

  /* XXX What is this intended to do? */
-if (cpu_is_omap34xx())
+if (soc_is_omap34xx())
  tap_prod_id = 0x0210;
  else
  tap_prod_id = 0x0208;
@@ -715,11 +715,11 @@ static const char * const omap_types[] = {

  static const char * __init omap_get_family(void)
  {
-if (cpu_is_omap24xx())
+if (soc_is_omap24xx())
  return kasprintf(GFP_KERNEL, "OMAP2");
-else if (cpu_is_omap34xx())
+else if (soc_is_omap34xx())
  return kasprintf(GFP_KERNEL, "OMAP3");
-else if (cpu_is_omap44xx())
+else if (soc_is_omap44xx())
  return kasprintf(GFP_KERNEL, "OMAP4");
  else if (soc_is_omap54xx())
  return kasprintf(GFP_KERNEL, "OMAP5");
diff --git a/arch/arm/mach-omap2/soc.h b/arch/arm/mach-omap2/soc.h
index f97654d..bb824ae 100644
--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -148,13 +148,13 @@ static inline int soc_is_omap(void)
  /*
   * Macros to group OMAP into cpu classes.
   * These can be used in most places.
- * cpu_is_omap24xx():True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
- * cpu_is_omap242x():True for OMAP2420, OMAP2422, OMAP2423
- * cpu_is_omap243x():T

Re: [PATCH] soc: mediatek: add scpsys support active_wakeup

2015-08-23 Thread Eddie Huang
On Thu, 2015-07-23 at 14:00 +0800, Eddie Huang wrote:
> Register gpd_dev_ops.active_wakeup function to support keep power
> during suspend state. And add flag to each power domain to
> decide whether keep power during suspend or not.
> 
> Signed-off-by: Chunfeng Yun 
> Signed-off-by: Eddie Huang 
> ---
>  drivers/soc/mediatek/mtk-scpsys.c | 28 
>  1 file changed, 28 insertions(+)
> 
> diff --git a/drivers/soc/mediatek/mtk-scpsys.c 
> b/drivers/soc/mediatek/mtk-scpsys.c
> index 43a79ed..fc78b70 100644
> --- a/drivers/soc/mediatek/mtk-scpsys.c
> +++ b/drivers/soc/mediatek/mtk-scpsys.c
> @@ -67,6 +67,7 @@ struct scp_domain_data {
> u32 sram_pdn_ack_bits;
> u32 bus_prot_mask;
> enum clk_id clk_id;
> +   bool active_wakeup;
>  };
> 
>  static const struct scp_domain_data scp_domain_data[] __initconst = {
> @@ -77,6 +78,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(12, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_VENC] = {
> .name = "venc",
> @@ -85,6 +87,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_ISP] = {
> .name = "isp",
> @@ -93,6 +96,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(13, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_MM] = {
> .name = "mm",
> @@ -101,6 +105,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(12, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MM_M0 |
> MT8173_TOP_AXI_PROT_EN_MM_M1,
> },
> @@ -111,6 +116,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_MM,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_AUDIO] = {
> .name = "audio",
> @@ -119,6 +125,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_USB] = {
> .name = "usb",
> @@ -127,6 +134,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(15, 12),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = true,
> },
> [MT8173_POWER_DOMAIN_MFG_ASYNC] = {
> .name = "mfg_async",
> @@ -135,6 +143,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = 0,
> .clk_id = MT8173_CLK_MFG,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_MFG_2D] = {
> .name = "mfg_2d",
> @@ -143,6 +152,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(11, 8),
> .sram_pdn_ack_bits = GENMASK(13, 12),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = false,
> },
> [MT8173_POWER_DOMAIN_MFG] = {
> .name = "mfg",
> @@ -151,6 +161,7 @@ static const struct scp_domain_data scp_domain_data[] 
> __initconst = {
> .sram_pdn_bits = GENMASK(13, 8),
> .sram_pdn_ack_bits = GENMASK(21, 16),
> .clk_id = MT8173_CLK_NONE,
> +   .active_wakeup = false,
> .bus_prot_mask = MT8173_TOP_AXI_PROT_EN_MFG_S |
> MT8173_TOP_AXI_PROT_EN_MFG_M0 |
> MT8173_TOP_AXI_PROT_EN_MFG_M1 |
> @@ -171,6 +182,7 @@ struct scp_domain {
> u32 sram_pdn_bits;
> u32 sram_pdn_ack_bits;
> u32 bus_prot_mask;
> +   bool active_wakeup;
>  };
> 
>  struct scp {
> @@ -370,6 +382,20 @@ out:
> return ret;
>  }
> 
>

Re: two RCU torture bugs

2015-08-23 Thread Paul E. McKenney
On Sun, Aug 23, 2015 at 10:07:49PM -0700, David Miller wrote:
> 
> 1) Doc bug, documentation mentions torture_type such as "rcu_sync",
>but those don't seem to exist.
> 
> 2) If you specify an unrecognized type, the module cannot be unloaded.
>Amusingly it says that it cannot unload because the unrecognized
>torture test type you requested is "running" :-)

Clearly Iftekhar was mutating the wrong code.  ;-)

And clearly I need to occasionally test failure cases.  There is code that
is supposed to unwind upon failure, but it has apparently bitrotted...

Thanx, Paul

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


[PATCH 05/17] staging: sm750fb: ddk750_hwi2c: rename CamelCase static functions

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index e6d31db..0677ff0 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -60,7 +60,7 @@ void sm750_hw_i2c_close(void)
 }
 
 
-static long hwI2CWaitTXDone(void)
+static long sm750_hw_i2c_wait_tx_done(void)
 {
unsigned int timeout;
 
@@ -90,7 +90,7 @@ static long hwI2CWaitTXDone(void)
  *  Return Value:
  *  Total number of bytes those are actually written.
  */
-static unsigned int hwI2CWriteData(
+static unsigned int sm750_hw_i2c_write_data(
unsigned char deviceAddress,
unsigned int length,
unsigned char *pBuffer
@@ -125,7 +125,7 @@ static unsigned int hwI2CWriteData(
POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
 
/* Wait until the transfer is completed. */
-   if (hwI2CWaitTXDone() != 0)
+   if (sm750_hw_i2c_wait_tx_done() != 0)
break;
 
/* Substract length */
@@ -156,7 +156,7 @@ static unsigned int hwI2CWriteData(
  *  Return Value:
  *  Total number of actual bytes read from the slave device
  */
-static unsigned int hwI2CReadData(
+static unsigned int sm750_hw_i2c_read_data(
unsigned char deviceAddress,
unsigned int length,
unsigned char *pBuffer
@@ -187,7 +187,7 @@ static unsigned int hwI2CReadData(
POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
 
/* Wait until transaction done. */
-   if (hwI2CWaitTXDone() != 0)
+   if (sm750_hw_i2c_wait_tx_done() != 0)
break;
 
/* Save the data to the given buffer */
@@ -226,8 +226,8 @@ unsigned char sm750_hw_i2c_read_reg(
 {
unsigned char value = (0xFF);
 
-   if (hwI2CWriteData(deviceAddress, 1, ®isterIndex) == 1)
-   hwI2CReadData(deviceAddress, 1, &value);
+   if (sm750_hw_i2c_write_data(deviceAddress, 1, ®isterIndex) == 1)
+   sm750_hw_i2c_read_data(deviceAddress, 1, &value);
 
return value;
 }
@@ -259,7 +259,7 @@ int sm750_hw_i2c_write_reg(
 
value[0] = registerIndex;
value[1] = data;
-   if (hwI2CWriteData(deviceAddress, 2, value) == 2)
+   if (sm750_hw_i2c_write_data(deviceAddress, 2, value) == 2)
return 0;
 
return (-1);
-- 
2.1.0

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


[PATCH 06/17] staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.h  | 2 +-
 drivers/staging/sm750fb/sm750_hw.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 3d129aa..241b77b 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -132,7 +132,7 @@ long sii164InitChip(
/* Use fast mode. */
sm750_hw_i2c_init(1);
 #else
-   swI2CInit(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA);
+   sm750_sw_i2c_init(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA);
 #endif
 
/* Check if SII164 Chip exists */
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 5133bcc..ecfd300 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -386,7 +386,7 @@ static long swI2CInit_SM750LE(unsigned char i2cClkGPIO,
  *  -1   - Fail to initialize the i2c
  *   0   - Success
  */
-long swI2CInit(
+long sm750_sw_i2c_init(
unsigned char i2cClkGPIO,
unsigned char i2cDataGPIO
 )
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 4af2b7a..1e18b80 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -28,7 +28,7 @@
  *  -1   - Fail to initialize the i2c
  *   0   - Success
  */
-long swI2CInit(
+long sm750_sw_i2c_init(
unsigned char i2cClkGPIO,
unsigned char i2cDataGPIO
 );
diff --git a/drivers/staging/sm750fb/sm750_hw.c 
b/drivers/staging/sm750fb/sm750_hw.c
index 7317ba9..522736e 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -169,7 +169,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct 
pci_dev *pdev)
/* Set up GPIO for software I2C to program DVI chip in the
   Xilinx SP605 board, in order to have video signal.
 */
-   swI2CInit(0, 1);
+   sm750_sw_i2c_init(0, 1);
 
 
/* Customer may NOT use CH7301 DVI chip, which has to be
-- 
2.1.0

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


[PATCH 01/17] staging: sm750fb: rename hwI2CInit to sm750_hw_i2c_init

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h  | 2 +-
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 5ddac43..7eb122e 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -9,7 +9,7 @@
 #define HWI2C_WAIT_TIMEOUT  0xF
 
 
-int hwI2CInit(
+int sm750_hw_i2c_init(
 unsigned char busSpeedMode
 )
 {
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 0b830ba6..11381eb 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -2,7 +2,7 @@
 #define DDK750_HWI2C_H__
 
 /* hwi2c functions */
-int hwI2CInit(unsigned char busSpeedMode);
+int sm750_hw_i2c_init(unsigned char busSpeedMode);
 void hwI2CClose(void);
 
 unsigned char hwI2CReadReg(unsigned char deviceAddress, unsigned char 
registerIndex);
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 0bdf3db..1803b74 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -130,7 +130,7 @@ long sii164InitChip(
/* Initialize the i2c bus */
 #ifdef USE_HW_I2C
/* Use fast mode. */
-   hwI2CInit(1);
+   sm750_hw_i2c_init(1);
 #else
swI2CInit(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA);
 #endif
-- 
2.1.0

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


[PATCH 03/17] staging: sm750fb: rename hwI2CReadReg to sm750_hw_i2c_read_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h  | 2 +-
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 8aa83ab..03da0a7 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -219,7 +219,7 @@ static unsigned int hwI2CReadData(
  *  Return Value:
  *  Register value
  */
-unsigned char hwI2CReadReg(
+unsigned char sm750_hw_i2c_read_reg(
unsigned char deviceAddress,
unsigned char registerIndex
 )
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index a8d23d2..70a6007 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -5,6 +5,6 @@
 int sm750_hw_i2c_init(unsigned char busSpeedMode);
 void sm750_hw_i2c_close(void);
 
-unsigned char hwI2CReadReg(unsigned char deviceAddress, unsigned char 
registerIndex);
+unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
 int hwI2CWriteReg(unsigned char deviceAddress, unsigned char registerIndex, 
unsigned char data);
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 1803b74..20dbc05 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -12,7 +12,7 @@
 
 #ifdef USE_HW_I2C
 #define i2cWriteReg hwI2CWriteReg
-#define i2cReadReg  hwI2CReadReg
+#define i2cReadReg  sm750_hw_i2c_read_reg
 #else
 #define i2cWriteReg swI2CWriteReg
 #define i2cReadReg  swI2CReadReg
-- 
2.1.0

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


[PATCH 07/17] staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.h | 2 +-
 drivers/staging/sm750fb/sm750_hw.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index ecfd300..765edd6 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -443,7 +443,7 @@ long sm750_sw_i2c_init(
  *  Return Value:
  *  Register value
  */
-unsigned char swI2CReadReg(
+unsigned char sm750_sw_i2c_read_reg(
unsigned char deviceAddress,
unsigned char registerIndex
 )
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 1e18b80..2e87a63 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -44,7 +44,7 @@ long sm750_sw_i2c_init(
  *  Return Value:
  *  Register value
  */
-unsigned char swI2CReadReg(
+unsigned char sm750_sw_i2c_read_reg(
unsigned char deviceAddress,
unsigned char registerIndex
 );
diff --git a/drivers/staging/sm750fb/sm750_hw.c 
b/drivers/staging/sm750fb/sm750_hw.c
index 522736e..b8b5e00 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -175,7 +175,7 @@ int hw_sm750_inithw(struct lynx_share *share, struct 
pci_dev *pdev)
/* Customer may NOT use CH7301 DVI chip, which has to be
   initialized differently.
*/
-   if (swI2CReadReg(0xec, 0x4a) == 0x95) {
+   if (sm750_sw_i2c_read_reg(0xec, 0x4a) == 0x95) {
/* The following register values for CH7301 are from
   Chrontel app note and our experiment.
*/
-- 
2.1.0

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


[PATCH 12/17] staging: sm750fb: hw_i2c_{read,write}: rename CamelCase variables

2015-08-23 Thread Mike Rapoport
Rename longCamelCase variables deviceAddress and registerIndex to
shorter addr and reg

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 16 
 drivers/staging/sm750fb/ddk750_hwi2c.h |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index c4c2dad..616c42f 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -220,14 +220,14 @@ static unsigned int sm750_hw_i2c_read_data(
  *  Register value
  */
 unsigned char sm750_hw_i2c_read_reg(
-   unsigned char deviceAddress,
-   unsigned char registerIndex
+   unsigned char addr,
+   unsigned char reg
 )
 {
unsigned char value = (0xFF);
 
-   if (sm750_hw_i2c_write_data(deviceAddress, 1, ®isterIndex) == 1)
-   sm750_hw_i2c_read_data(deviceAddress, 1, &value);
+   if (sm750_hw_i2c_write_data(addr, 1, ®) == 1)
+   sm750_hw_i2c_read_data(addr, 1, &value);
 
return value;
 }
@@ -250,16 +250,16 @@ unsigned char sm750_hw_i2c_read_reg(
  * -1   - Fail
  */
 int sm750_hw_i2c_write_reg(
-   unsigned char deviceAddress,
-   unsigned char registerIndex,
+   unsigned char addr,
+   unsigned char reg,
unsigned char data
 )
 {
unsigned char value[2];
 
-   value[0] = registerIndex;
+   value[0] = reg;
value[1] = data;
-   if (sm750_hw_i2c_write_data(deviceAddress, 2, value) == 2)
+   if (sm750_hw_i2c_write_data(addr, 2, value) == 2)
return 0;
 
return (-1);
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 5872f9c..2827865 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -5,6 +5,6 @@
 int sm750_hw_i2c_init(unsigned char bus_speed_mode);
 void sm750_hw_i2c_close(void);
 
-unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
-int sm750_hw_i2c_write_reg(unsigned char deviceAddress, unsigned char 
registerIndex, unsigned char data);
+unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg);
+int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, unsigned 
char data);
 #endif
-- 
2.1.0

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


[PATCH 10/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static functions

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 116 -
 1 file changed, 58 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 6a10ae3..b3f64c4 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -82,7 +82,7 @@ static unsigned long g_i2cDataGPIODataDirReg = 
GPIO_DATA_DIRECTION;
 /*
  *  This function puts a delay between command
  */
-static void swI2CWait(void)
+static void sm750_sw_i2c_wait(void)
 {
/* find a bug:
 * peekIO method works well before suspend/resume
@@ -119,7 +119,7 @@ static void swI2CWait(void)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-static void swI2CSCL(unsigned char value)
+static void sm750_sw_i2c_scl(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
@@ -153,7 +153,7 @@ static void swI2CSCL(unsigned char value)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-static void swI2CSDA(unsigned char value)
+static void sm750_sw_i2c_sda(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
@@ -181,7 +181,7 @@ static void swI2CSDA(unsigned char value)
  *  Return Value:
  *  The SDA data bit sent by the Slave
  */
-static unsigned char swI2CReadSDA(void)
+static unsigned char sm750_sw_i2c_read_sda(void)
 {
unsigned long ulGPIODirection;
unsigned long ulGPIOData;
@@ -204,7 +204,7 @@ static unsigned char swI2CReadSDA(void)
 /*
  *  This function sends ACK signal
  */
-static void swI2CAck(void)
+static void sm750_sw_i2c_ack(void)
 {
return;  /* Single byte read is ok without it. */
 }
@@ -212,23 +212,23 @@ static void swI2CAck(void)
 /*
  *  This function sends the start command to the slave device
  */
-static void swI2CStart(void)
+static void sm750_sw_i2c_start(void)
 {
/* Start I2C */
-   swI2CSDA(1);
-   swI2CSCL(1);
-   swI2CSDA(0);
+   sm750_sw_i2c_sda(1);
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_sda(0);
 }
 
 /*
  *  This function sends the stop command to the slave device
  */
-static void swI2CStop(void)
+static void sm750_sw_i2c_stop(void)
 {
/* Stop the I2C */
-   swI2CSCL(1);
-   swI2CSDA(0);
-   swI2CSDA(1);
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_sda(0);
+   sm750_sw_i2c_sda(1);
 }
 
 /*
@@ -241,7 +241,7 @@ static void swI2CStop(void)
  *   0   - Success
  *  -1   - Fail to write byte
  */
-static long swI2CWriteByte(unsigned char data)
+static long sm750_sw_i2c_write_byte(unsigned char data)
 {
unsigned char value = data;
int i;
@@ -249,47 +249,47 @@ static long swI2CWriteByte(unsigned char data)
/* Sending the data bit by bit */
for (i = 0; i < 8; i++) {
/* Set SCL to low */
-   swI2CSCL(0);
+   sm750_sw_i2c_scl(0);
 
/* Send data bit */
if ((value & 0x80) != 0)
-   swI2CSDA(1);
+   sm750_sw_i2c_sda(1);
else
-   swI2CSDA(0);
+   sm750_sw_i2c_sda(0);
 
-   swI2CWait();
+   sm750_sw_i2c_wait();
 
/* Toggle clk line to one */
-   swI2CSCL(1);
-   swI2CWait();
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_wait();
 
/* Shift byte to be sent */
value = value << 1;
}
 
/* Set the SCL Low and SDA High (prepare to get input) */
-   swI2CSCL(0);
-   swI2CSDA(1);
+   sm750_sw_i2c_scl(0);
+   sm750_sw_i2c_sda(1);
 
/* Set the SCL High for ack */
-   swI2CWait();
-   swI2CSCL(1);
-   swI2CWait();
+   sm750_sw_i2c_wait();
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_wait();
 
/* Read SDA, until SDA==0 */
for (i = 0; i < 0xff; i++) {
-   if (!swI2CReadSDA())
+   if (!sm750_sw_i2c_read_sda())
break;
 
-   swI2CSCL(0);
-   swI2CWait();
-   swI2CSCL(1);
-   swI2CWait();
+   sm750_sw_i2c_scl(0);
+   sm750_sw_i2c_wait();
+   sm750_sw_i2c_scl(1);
+   sm750_sw_i2c_wait();
}
 
/* Set the SCL Low and SDA High */
-   swI2CSCL(0);
-   swI2CSDA(1);
+   sm750_sw_i2c_scl(0);
+   sm750_sw_i2c_sda(1);
 
if (i < 0xff)
return 0;
@@ -307,31 +307,31 @@ static long swI2CWriteByte(unsigned char data)
  *  Return Value:
  *  One byte data read from the Slave device
  */
-static unsigned char swI2CReadByte(unsigned char ack)
+static un

[PATCH 13/17] staging: sm750fb: ddk750_hwi2c: reduce amount of CamelCase

2015-08-23 Thread Mike Rapoport
Rename camel case variables deviceAddress, pBuffer and totalBytes to
addr, buf and total_bytes respectively in sm750_hw_i2c_{read,write}_data
functions.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 36 +-
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 616c42f..fa1a4d4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -82,25 +82,25 @@ static long sm750_hw_i2c_wait_tx_done(void)
  *  This function writes data to the i2c slave device registers.
  *
  *  Parameters:
- *  deviceAddress   - i2c Slave device address
+ *  addr- i2c Slave device address
  *  length  - Total number of bytes to be written to the device
- *  pBuffer - The buffer that contains the data to be written to 
the
+ *  buf - The buffer that contains the data to be written to 
the
  * i2c device.
  *
  *  Return Value:
  *  Total number of bytes those are actually written.
  */
 static unsigned int sm750_hw_i2c_write_data(
-   unsigned char deviceAddress,
+   unsigned char addr,
unsigned int length,
-   unsigned char *pBuffer
+   unsigned char *buf
 )
 {
unsigned char count, i;
-   unsigned int totalBytes = 0;
+   unsigned int total_bytes = 0;
 
/* Set the Device Address */
-   POKE32(I2C_SLAVE_ADDRESS, deviceAddress & ~0x01);
+   POKE32(I2C_SLAVE_ADDRESS, addr & ~0x01);
 
/* Write data.
 * Note:
@@ -119,7 +119,7 @@ static unsigned int sm750_hw_i2c_write_data(
 
/* Move the data to the I2C data register */
for (i = 0; i <= count; i++)
-   POKE32(I2C_DATA0 + i, *pBuffer++);
+   POKE32(I2C_DATA0 + i, *buf++);
 
/* Start the I2C */
POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
@@ -132,11 +132,11 @@ static unsigned int sm750_hw_i2c_write_data(
length -= (count + 1);
 
/* Total byte written */
-   totalBytes += (count + 1);
+   total_bytes += (count + 1);
 
} while (length > 0);
 
-   return totalBytes;
+   return total_bytes;
 }
 
 
@@ -147,9 +147,9 @@ static unsigned int sm750_hw_i2c_write_data(
  *  in the given buffer
  *
  *  Parameters:
- *  deviceAddress   - i2c Slave device address
+ *  addr- i2c Slave device address
  *  length  - Total number of bytes to be read
- *  pBuffer - Pointer to a buffer to be filled with the data read
+ *  buf - Pointer to a buffer to be filled with the data read
  * from the slave device. It has to be the same size as the
  * length to make sure that it can keep all the data read.
  *
@@ -157,16 +157,16 @@ static unsigned int sm750_hw_i2c_write_data(
  *  Total number of actual bytes read from the slave device
  */
 static unsigned int sm750_hw_i2c_read_data(
-   unsigned char deviceAddress,
+   unsigned char addr,
unsigned int length,
-   unsigned char *pBuffer
+   unsigned char *buf
 )
 {
unsigned char count, i;
-   unsigned int totalBytes = 0;
+   unsigned int total_bytes = 0;
 
/* Set the Device Address */
-   POKE32(I2C_SLAVE_ADDRESS, deviceAddress | 0x01);
+   POKE32(I2C_SLAVE_ADDRESS, addr | 0x01);
 
/* Read data and save them to the buffer.
 * Note:
@@ -192,17 +192,17 @@ static unsigned int sm750_hw_i2c_read_data(
 
/* Save the data to the given buffer */
for (i = 0; i <= count; i++)
-   *pBuffer++ = PEEK32(I2C_DATA0 + i);
+   *buf++ = PEEK32(I2C_DATA0 + i);
 
/* Substract length by 16 */
length -= (count + 1);
 
/* Number of bytes read. */
-   totalBytes += (count + 1);
+   total_bytes += (count + 1);
 
} while (length > 0);
 
-   return totalBytes;
+   return total_bytes;
 }
 
 
-- 
2.1.0

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


[PATCH 15/17] staging: sm750fb: ddk750_swi2c: further reduce CamelCase

2015-08-23 Thread Mike Rapoport
Rename remaining CamelCase variables

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 122 -
 drivers/staging/sm750fb/ddk750_swi2c.h |  20 +++---
 2 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 94f4c46..ed14277 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -98,11 +98,11 @@ static void sm750_sw_i2c_wait(void)
*/
while (peekIO(0x3ce, 0x61) & 0x10);
 #else
-   int i, Temp;
+   int i, tmp;
 
for (i = 0; i < 600; i++) {
-   Temp = i;
-   Temp += i;
+   tmp = i;
+   tmp += i;
}
 #endif
 }
@@ -121,23 +121,23 @@ static void sm750_sw_i2c_wait(void)
  */
 static void sm750_sw_i2c_scl(unsigned char value)
 {
-   unsigned long ulGPIOData;
-   unsigned long ulGPIODirection;
+   unsigned long gpio_data;
+   unsigned long gpio_dir;
 
-   ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
+   gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << sw_i2c_clk_gpio);
-   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg);
-   ulGPIOData &= ~(1 << sw_i2c_clk_gpio);
-   POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData);
+   gpio_data = PEEK32(sw_i2c_clk_gpio_data_reg);
+   gpio_data &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_reg, gpio_data);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << sw_i2c_clk_gpio);
-   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir |= (1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
}
 }
 
@@ -155,23 +155,23 @@ static void sm750_sw_i2c_scl(unsigned char value)
  */
 static void sm750_sw_i2c_sda(unsigned char value)
 {
-   unsigned long ulGPIOData;
-   unsigned long ulGPIODirection;
+   unsigned long gpio_data;
+   unsigned long gpio_dir;
 
-   ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+   gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
-   ulGPIOData &= ~(1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData);
+   gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+   gpio_data &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_reg, gpio_data);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir |= (1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
}
 }
 
@@ -183,19 +183,19 @@ static void sm750_sw_i2c_sda(unsigned char value)
  */
 static unsigned char sm750_sw_i2c_read_sda(void)
 {
-   unsigned long ulGPIODirection;
-   unsigned long ulGPIOData;
+   unsigned long gpio_dir;
+   unsigned long gpio_data;
 
/* Make sure that the direction is input (High) */
-   ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
-   if ((ulGPIODirection & (1 << sw_i2c_data_gpio)) != (~(1 << 
sw_i2c_data_gpio))) {
-   ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
-   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
+   gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
+   if ((gpio_dir & (1 << sw_i2c_data_gpio)) != (~(1 << sw_i2c_data_gpio))) 
{
+   gpio_dir &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
}
 
/* Now read the SDA line */
-   ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
-   if (ulGPIOData & (1 << sw_i2c_data_gpio))
+   gpio_data = PEEK32(sw_i2c_data_gpio_data_reg);
+   if (gpio_data & (1 << sw_i2c_data_gpio))
return 1;
else
 

[PATCH 08/17] staging: sm750fb: rename swI2CWriteReg to sm750_sw_i2c_write_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 2 +-
 drivers/staging/sm750fb/ddk750_swi2c.h | 2 +-
 drivers/staging/sm750fb/sm750_hw.c | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index 765edd6..e3f60eb 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -483,7 +483,7 @@ unsigned char sm750_sw_i2c_read_reg(
  *  0   - Success
  * -1   - Fail
  */
-long swI2CWriteReg(
+long sm750_sw_i2c_write_reg(
unsigned char deviceAddress,
unsigned char registerIndex,
unsigned char data
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 2e87a63..37335dd 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -62,7 +62,7 @@ unsigned char sm750_sw_i2c_read_reg(
  *  0   - Success
  * -1   - Fail
  */
-long swI2CWriteReg(
+long sm750_sw_i2c_write_reg(
unsigned char deviceAddress,
unsigned char registerIndex,
unsigned char data
diff --git a/drivers/staging/sm750fb/sm750_hw.c 
b/drivers/staging/sm750fb/sm750_hw.c
index b8b5e00..de30429 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -180,9 +180,9 @@ int hw_sm750_inithw(struct lynx_share *share, struct 
pci_dev *pdev)
   Chrontel app note and our experiment.
*/
pr_info("yes,CH7301 DVI chip found\n");
-   swI2CWriteReg(0xec, 0x1d, 0x16);
-   swI2CWriteReg(0xec, 0x21, 0x9);
-   swI2CWriteReg(0xec, 0x49, 0xC0);
+   sm750_sw_i2c_write_reg(0xec, 0x1d, 0x16);
+   sm750_sw_i2c_write_reg(0xec, 0x21, 0x9);
+   sm750_sw_i2c_write_reg(0xec, 0x49, 0xC0);
pr_info("okay,CH7301 DVI chip setup done\n");
}
}
-- 
2.1.0

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


[PATCH 16/17] staging: sm750fb: ddk750_*i2c: remove multiple blank lines

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 16 
 drivers/staging/sm750fb/ddk750_swi2c.c |  1 -
 2 files changed, 17 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index fa1a4d4..a07aca4 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -8,7 +8,6 @@
 #define MAX_HWI2C_FIFO  16
 #define HWI2C_WAIT_TIMEOUT  0xF
 
-
 int sm750_hw_i2c_init(
 unsigned char bus_speed_mode
 )
@@ -39,7 +38,6 @@ unsigned char bus_speed_mode
return 0;
 }
 
-
 void sm750_hw_i2c_close(void)
 {
unsigned int value;
@@ -59,7 +57,6 @@ void sm750_hw_i2c_close(void)
POKE32(GPIO_MUX, value);
 }
 
-
 static long sm750_hw_i2c_wait_tx_done(void)
 {
unsigned int timeout;
@@ -76,8 +73,6 @@ static long sm750_hw_i2c_wait_tx_done(void)
return 0;
 }
 
-
-
 /*
  *  This function writes data to the i2c slave device registers.
  *
@@ -139,9 +134,6 @@ static unsigned int sm750_hw_i2c_write_data(
return total_bytes;
 }
 
-
-
-
 /*
  *  This function reads data from the slave device and stores them
  *  in the given buffer
@@ -205,9 +197,6 @@ static unsigned int sm750_hw_i2c_read_data(
return total_bytes;
 }
 
-
-
-
 /*
  *  This function reads the slave device's register
  *
@@ -232,10 +221,6 @@ unsigned char sm750_hw_i2c_read_reg(
return value;
 }
 
-
-
-
-
 /*
  *  This function writes a value to the slave device's register
  *
@@ -265,5 +250,4 @@ int sm750_hw_i2c_write_reg(
return (-1);
 }
 
-
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index ed14277..d5f01d3 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -15,7 +15,6 @@
 #include "ddk750_swi2c.h"
 #include "ddk750_power.h"
 
-
 /***
  * I2C Software Master Driver:
  * ===
-- 
2.1.0

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


[PATCH 14/17] staging: sm750fb: ddk750_swi2c: rename CamelCase static variables

2015-08-23 Thread Mike Rapoport
Rename static variables defining I2C GPIO pins and their control registers from
CamelCase.

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c | 96 +-
 1 file changed, 48 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index b3f64c4..94f4c46 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -55,8 +55,8 @@
  **/
 
 /* GPIO pins used for this I2C. It ranges from 0 to 63. */
-static unsigned char g_i2cClockGPIO = DEFAULT_I2C_SCL;
-static unsigned char g_i2cDataGPIO = DEFAULT_I2C_SDA;
+static unsigned char sw_i2c_clk_gpio = DEFAULT_I2C_SCL;
+static unsigned char sw_i2c_data_gpio = DEFAULT_I2C_SDA;
 
 /*
  *  Below is the variable declaration for the GPIO pin register usage
@@ -70,14 +70,14 @@ static unsigned char g_i2cDataGPIO = DEFAULT_I2C_SDA;
  */
 
 /* i2c Clock GPIO Register usage */
-static unsigned long g_i2cClkGPIOMuxReg = GPIO_MUX;
-static unsigned long g_i2cClkGPIODataReg = GPIO_DATA;
-static unsigned long g_i2cClkGPIODataDirReg = GPIO_DATA_DIRECTION;
+static unsigned long sw_i2c_clk_gpio_mux_reg = GPIO_MUX;
+static unsigned long sw_i2c_clk_gpio_data_reg = GPIO_DATA;
+static unsigned long sw_i2c_clk_gpio_data_dir_reg = GPIO_DATA_DIRECTION;
 
 /* i2c Data GPIO Register usage */
-static unsigned long g_i2cDataGPIOMuxReg = GPIO_MUX;
-static unsigned long g_i2cDataGPIODataReg = GPIO_DATA;
-static unsigned long g_i2cDataGPIODataDirReg = GPIO_DATA_DIRECTION;
+static unsigned long sw_i2c_data_gpio_mux_reg = GPIO_MUX;
+static unsigned long sw_i2c_data_gpio_data_reg = GPIO_DATA;
+static unsigned long sw_i2c_data_gpio_data_dir_reg = GPIO_DATA_DIRECTION;
 
 /*
  *  This function puts a delay between command
@@ -124,20 +124,20 @@ static void sm750_sw_i2c_scl(unsigned char value)
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
 
-   ulGPIODirection = PEEK32(g_i2cClkGPIODataDirReg);
+   ulGPIODirection = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << g_i2cClockGPIO);
-   POKE32(g_i2cClkGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(g_i2cClkGPIODataReg);
-   ulGPIOData &= ~(1 << g_i2cClockGPIO);
-   POKE32(g_i2cClkGPIODataReg, ulGPIOData);
+   ulGPIOData = PEEK32(sw_i2c_clk_gpio_data_reg);
+   ulGPIOData &= ~(1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_reg, ulGPIOData);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << g_i2cClockGPIO);
-   POKE32(g_i2cClkGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection |= (1 << sw_i2c_clk_gpio);
+   POKE32(sw_i2c_clk_gpio_data_dir_reg, ulGPIODirection);
}
 }
 
@@ -158,20 +158,20 @@ static void sm750_sw_i2c_sda(unsigned char value)
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
 
-   ulGPIODirection = PEEK32(g_i2cDataGPIODataDirReg);
+   ulGPIODirection = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) {/* High */
/* Set direction as input. This will automatically pull the 
signal up. */
-   ulGPIODirection &= ~(1 << g_i2cDataGPIO);
-   POKE32(g_i2cDataGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
} else {/* Low */
/* Set the signal down */
-   ulGPIOData = PEEK32(g_i2cDataGPIODataReg);
-   ulGPIOData &= ~(1 << g_i2cDataGPIO);
-   POKE32(g_i2cDataGPIODataReg, ulGPIOData);
+   ulGPIOData = PEEK32(sw_i2c_data_gpio_data_reg);
+   ulGPIOData &= ~(1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_reg, ulGPIOData);
 
/* Set direction as output */
-   ulGPIODirection |= (1 << g_i2cDataGPIO);
-   POKE32(g_i2cDataGPIODataDirReg, ulGPIODirection);
+   ulGPIODirection |= (1 << sw_i2c_data_gpio);
+   POKE32(sw_i2c_data_gpio_data_dir_reg, ulGPIODirection);
}
 }
 
@@ -187,15 +187,15 @@ static unsigned char sm750_sw_i2c_read_sda(void)
unsigned long ulGPIOData;
 
/* Make sure that the direction is input (High) */
-   ulGPIODirection = PEEK32(g_i2cDataGPIODataDirReg);
-   if ((ulGPIODirection & (1 << g_i2cDataGPIO)) != (~(1 << 
g_i2cDataGPIO))) {
-   ulGPI

[PATCH 17/17] staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 19 ++-
 drivers/staging/sm750fb/ddk750_hwi2c.h |  3 ++-
 drivers/staging/sm750fb/ddk750_swi2c.c | 22 --
 3 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index a07aca4..949e03a 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -63,7 +63,8 @@ static long sm750_hw_i2c_wait_tx_done(void)
 
/* Wait until the transfer is completed. */
timeout = HWI2C_WAIT_TIMEOUT;
-   while ((FIELD_GET(PEEK32(I2C_STATUS), I2C_STATUS, TX) != 
I2C_STATUS_TX_COMPLETED) &&
+   while ((FIELD_GET(PEEK32(I2C_STATUS),
+ I2C_STATUS, TX) != I2C_STATUS_TX_COMPLETED) &&
   (timeout != 0))
timeout--;
 
@@ -102,7 +103,10 @@ static unsigned int sm750_hw_i2c_write_data(
 *  Only 16 byte can be accessed per i2c start instruction.
 */
do {
-   /* Reset I2C by writing 0 to I2C_RESET register to clear the 
previous status. */
+   /*
+* Reset I2C by writing 0 to I2C_RESET register to
+* clear the previous status.
+*/
POKE32(I2C_RESET, 0);
 
/* Set the number of bytes to be written */
@@ -117,7 +121,8 @@ static unsigned int sm750_hw_i2c_write_data(
POKE32(I2C_DATA0 + i, *buf++);
 
/* Start the I2C */
-   POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
+   POKE32(I2C_CTRL,
+  FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START));
 
/* Wait until the transfer is completed. */
if (sm750_hw_i2c_wait_tx_done() != 0)
@@ -165,7 +170,10 @@ static unsigned int sm750_hw_i2c_read_data(
 *  Only 16 byte can be accessed per i2c start instruction.
 */
do {
-   /* Reset I2C by writing 0 to I2C_RESET register to clear all 
the status. */
+   /*
+* Reset I2C by writing 0 to I2C_RESET register to
+* clear all the status.
+*/
POKE32(I2C_RESET, 0);
 
/* Set the number of bytes to be read */
@@ -176,7 +184,8 @@ static unsigned int sm750_hw_i2c_read_data(
POKE32(I2C_BYTE_COUNT, count);
 
/* Start the I2C */
-   POKE32(I2C_CTRL, FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, 
START));
+   POKE32(I2C_CTRL,
+  FIELD_SET(PEEK32(I2C_CTRL), I2C_CTRL, CTRL, START));
 
/* Wait until transaction done. */
if (sm750_hw_i2c_wait_tx_done() != 0)
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 2827865..46e22dc 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -6,5 +6,6 @@ int sm750_hw_i2c_init(unsigned char bus_speed_mode);
 void sm750_hw_i2c_close(void);
 
 unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg);
-int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, unsigned 
char data);
+int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg,
+  unsigned char data);
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index d5f01d3..b154568 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -125,7 +125,10 @@ static void sm750_sw_i2c_scl(unsigned char value)
 
gpio_dir = PEEK32(sw_i2c_clk_gpio_data_dir_reg);
if (value) {/* High */
-   /* Set direction as input. This will automatically pull the 
signal up. */
+   /*
+* Set direction as input. This will automatically
+* pull the signal up.
+*/
gpio_dir &= ~(1 << sw_i2c_clk_gpio);
POKE32(sw_i2c_clk_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
@@ -159,7 +162,10 @@ static void sm750_sw_i2c_sda(unsigned char value)
 
gpio_dir = PEEK32(sw_i2c_data_gpio_data_dir_reg);
if (value) {/* High */
-   /* Set direction as input. This will automatically pull the 
signal up. */
+   /*
+* Set direction as input. This will automatically
+* pull the signal up.
+*/
gpio_dir &= ~(1 << sw_i2c_data_gpio);
POKE32(sw_i2c_data_gpio_data_dir_reg, gpio_dir);
} else {/* Low */
@@ -184,10 +190,11 @@ static unsigned char sm750_sw_i2c_read_sda(void)
 {
unsigned long gpio_dir;
unsigned long gpio_data;
+   unsigned long dir_mask = 1 << sw_i2c_data_gpio;
 
/* Make sure that the d

[PATCH 04/17] staging: sm750fb: rename hwI2CWriteReg to sm750_hw_i2c_write_reg

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c  | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h  | 2 +-
 drivers/staging/sm750fb/ddk750_sii164.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 03da0a7..e6d31db 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -249,7 +249,7 @@ unsigned char sm750_hw_i2c_read_reg(
  *  0   - Success
  * -1   - Fail
  */
-int hwI2CWriteReg(
+int sm750_hw_i2c_write_reg(
unsigned char deviceAddress,
unsigned char registerIndex,
unsigned char data
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 70a6007..29ce48d 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -6,5 +6,5 @@ int sm750_hw_i2c_init(unsigned char busSpeedMode);
 void sm750_hw_i2c_close(void);
 
 unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
-int hwI2CWriteReg(unsigned char deviceAddress, unsigned char registerIndex, 
unsigned char data);
+int sm750_hw_i2c_write_reg(unsigned char deviceAddress, unsigned char 
registerIndex, unsigned char data);
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_sii164.c 
b/drivers/staging/sm750fb/ddk750_sii164.c
index 20dbc05..3d129aa 100644
--- a/drivers/staging/sm750fb/ddk750_sii164.c
+++ b/drivers/staging/sm750fb/ddk750_sii164.c
@@ -11,7 +11,7 @@
 #define USE_HW_I2C
 
 #ifdef USE_HW_I2C
-#define i2cWriteReg hwI2CWriteReg
+#define i2cWriteReg sm750_hw_i2c_write_reg
 #define i2cReadReg  sm750_hw_i2c_read_reg
 #else
 #define i2cWriteReg swI2CWriteReg
-- 
2.1.0

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


[PATCH 09/17] staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA}

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_swi2c.c |  4 ++--
 drivers/staging/sm750fb/ddk750_swi2c.h | 21 -
 2 files changed, 2 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_swi2c.c 
b/drivers/staging/sm750fb/ddk750_swi2c.c
index e3f60eb..6a10ae3 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.c
+++ b/drivers/staging/sm750fb/ddk750_swi2c.c
@@ -119,7 +119,7 @@ static void swI2CWait(void)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-void swI2CSCL(unsigned char value)
+static void swI2CSCL(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
@@ -153,7 +153,7 @@ void swI2CSCL(unsigned char value)
  *  signal because the i2c will fail when other device try to drive the
  *  signal due to SM50x will drive the signal to always high.
  */
-void swI2CSDA(unsigned char value)
+static void swI2CSDA(unsigned char value)
 {
unsigned long ulGPIOData;
unsigned long ulGPIODirection;
diff --git a/drivers/staging/sm750fb/ddk750_swi2c.h 
b/drivers/staging/sm750fb/ddk750_swi2c.h
index 37335dd..27a04f3a 100644
--- a/drivers/staging/sm750fb/ddk750_swi2c.h
+++ b/drivers/staging/sm750fb/ddk750_swi2c.h
@@ -68,25 +68,4 @@ long sm750_sw_i2c_write_reg(
unsigned char data
 );
 
-/*
- *  These two functions toggle the data on the SCL and SDA I2C lines.
- *  The use of these two functions is not recommended unless it is necessary.
- */
-
-/*
- *  This function set/reset the SCL GPIO pin
- *
- *  Parameters:
- *  value  - Bit value to set to the SCL or SDA (0 = low, 1 = high)
- */
-void swI2CSCL(unsigned char value);
-
-/*
- *  This function set/reset the SDA GPIO pin
- *
- *  Parameters:
- *  value  - Bit value to set to the SCL or SDA (0 = low, 1 = high)
- */
-void swI2CSDA(unsigned char value);
-
 #endif  /* _SWI2C_H_ */
-- 
2.1.0

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


[PATCH 11/17] staging: sm750fb: ddk750_hw_i2c: rename busSpeedMode

2015-08-23 Thread Mike Rapoport
rename CamelCase parameter in sm750_hw_i2c_init()

Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 4 ++--
 drivers/staging/sm750fb/ddk750_hwi2c.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 0677ff0..c4c2dad 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -10,7 +10,7 @@
 
 
 int sm750_hw_i2c_init(
-unsigned char busSpeedMode
+unsigned char bus_speed_mode
 )
 {
unsigned int value;
@@ -29,7 +29,7 @@ unsigned char busSpeedMode
 
/* Enable the I2C Controller and set the bus speed mode */
value = PEEK32(I2C_CTRL);
-   if (busSpeedMode == 0)
+   if (bus_speed_mode == 0)
value = FIELD_SET(value, I2C_CTRL, MODE, STANDARD);
else
value = FIELD_SET(value, I2C_CTRL, MODE, FAST);
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 29ce48d..5872f9c 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -2,7 +2,7 @@
 #define DDK750_HWI2C_H__
 
 /* hwi2c functions */
-int sm750_hw_i2c_init(unsigned char busSpeedMode);
+int sm750_hw_i2c_init(unsigned char bus_speed_mode);
 void sm750_hw_i2c_close(void);
 
 unsigned char sm750_hw_i2c_read_reg(unsigned char deviceAddress, unsigned char 
registerIndex);
-- 
2.1.0

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


[PATCH 00/17] staging: sm750fb: coding style fixes

2015-08-23 Thread Mike Rapoport
Hi,

These patches are fixing coding style issues in ddk750_*i2c* files of the
sm750fb driver

Mike Rapoport (17):
  staging: sm750fb: rename hwI2CInit to sm750_hw_i2c_init
  staging: sm750fb: rename hwI2CClose to sm750_hw_i2c_close
  staging: sm750fb: rename hwI2CReadReg to sm750_hw_i2c_read_reg
  staging: sm750fb: rename hwI2CWriteReg to sm750_hw_i2c_write_reg
  staging: sm750fb: ddk750_hwi2c: rename CamelCase static functions
  staging: sm750fb: rename swI2CInit to sm750_sw_i2c_init
  staging: sm750fb: rename swI2CReadReg to sm750_sw_i2c_read_reg
  staging: sm750fb: rename swI2CWriteReg to sm750_sw_i2c_write_reg
  staging: sm750fb: ddk750_swi2c: staticize swI2C{SCL,SDA}
  staging: sm750fb: ddk750_swi2c: rename CamelCase static functions
  staging: sm750fb: ddk750_hw_i2c: rename busSpeedMode
  staging: sm750fb: hw_i2c_{read,write}: rename CamelCase variables
  staging: sm750fb: ddk750_hwi2c: reduce amount of CamelCase
  staging: sm750fb: ddk750_swi2c: rename CamelCase static variables
  staging: sm750fb: ddk750_swi2c: further reduce CamelCase
  staging: sm750fb: ddk750_*i2c: remove multiple blank lines
  staging: sm750fb: ddk750_*i2c: shorten lines to under 80 characters

 drivers/staging/sm750fb/ddk750_hwi2c.c  | 109 ++--
 drivers/staging/sm750fb/ddk750_hwi2c.h  |   9 +-
 drivers/staging/sm750fb/ddk750_sii164.c |   8 +-
 drivers/staging/sm750fb/ddk750_swi2c.c  | 291 
 drivers/staging/sm750fb/ddk750_swi2c.h  |  47 ++
 drivers/staging/sm750fb/sm750_hw.c  |  10 +-
 6 files changed, 228 insertions(+), 246 deletions(-)

-- 
2.1.0

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


[PATCH 02/17] staging: sm750fb: rename hwI2CClose to sm750_hw_i2c_close

2015-08-23 Thread Mike Rapoport
Signed-off-by: Mike Rapoport 
---
 drivers/staging/sm750fb/ddk750_hwi2c.c | 2 +-
 drivers/staging/sm750fb/ddk750_hwi2c.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c 
b/drivers/staging/sm750fb/ddk750_hwi2c.c
index 7eb122e..8aa83ab 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.c
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.c
@@ -40,7 +40,7 @@ unsigned char busSpeedMode
 }
 
 
-void hwI2CClose(void)
+void sm750_hw_i2c_close(void)
 {
unsigned int value;
 
diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h 
b/drivers/staging/sm750fb/ddk750_hwi2c.h
index 11381eb..a8d23d2 100644
--- a/drivers/staging/sm750fb/ddk750_hwi2c.h
+++ b/drivers/staging/sm750fb/ddk750_hwi2c.h
@@ -3,7 +3,7 @@
 
 /* hwi2c functions */
 int sm750_hw_i2c_init(unsigned char busSpeedMode);
-void hwI2CClose(void);
+void sm750_hw_i2c_close(void);
 
 unsigned char hwI2CReadReg(unsigned char deviceAddress, unsigned char 
registerIndex);
 int hwI2CWriteReg(unsigned char deviceAddress, unsigned char registerIndex, 
unsigned char data);
-- 
2.1.0

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


two RCU torture bugs

2015-08-23 Thread David Miller

1) Doc bug, documentation mentions torture_type such as "rcu_sync",
   but those don't seem to exist.

2) If you specify an unrecognized type, the module cannot be unloaded.
   Amusingly it says that it cannot unload because the unrecognized
   torture test type you requested is "running" :-)

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


Re: [f2fs-dev] [PATCH 1/2] f2fs: handle failed bio allocation

2015-08-23 Thread Jaegeuk Kim
Hi Chao,

[snip]

> > > >
> > > > -   /* No failure on bio allocation */
> > > > -   bio = bio_alloc(GFP_NOIO, npages);
> > >
> > > How about using __GFP_NOFAIL flag to avoid failing in bio_alloc instead
> > > of adding opencode endless loop in code?
> > >
> > > We can see the reason in this commit  647757197cd3
> > > ("mm: clarify __GFP_NOFAIL deprecation status ")
> > >
> > > "__GFP_NOFAIL is documented as a deprecated flag since commit
> > > 478352e789f5 ("mm: add comment about deprecation of __GFP_NOFAIL").
> > >
> > > This has discouraged people from using it but in some cases an opencoded
> > > endless loop around allocator has been used instead. So the allocator
> > > is not aware of the de facto __GFP_NOFAIL allocation because this
> > > information was not communicated properly.
> > >
> > > Let's make clear that if the allocation context really cannot afford
> > > failure because there is no good failure policy then using __GFP_NOFAIL
> > > is preferable to opencoding the loop outside of the allocator."
> > >
> > > BTW, I found that f2fs_kmem_cache_alloc also could be replaced, we could
> > > fix them together.
> > 
> > Agreed. I think that can be another patch like this.
> > 
> > From 1579e0d1ada96994c4ec6619fb5b5d9386e77ab3 Mon Sep 17 00:00:00 2001
> > From: Jaegeuk Kim 
> > Date: Thu, 20 Aug 2015 08:51:56 -0700
> > Subject: [PATCH] f2fs: use __GFP_NOFAIL to avoid infinite loop
> > 
> > __GFP_NOFAIL can avoid retrying the whole path of kmem_cache_alloc and
> > bio_alloc.
> > 
> > Suggested-by: Chao Yu 
> > Signed-off-by: Jaegeuk Kim 
> > ---
> >  fs/f2fs/f2fs.h | 16 +---
> >  1 file changed, 5 insertions(+), 11 deletions(-)
> > 
> > diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> > index 00591f7..c78b599 100644
> > --- a/fs/f2fs/f2fs.h
> > +++ b/fs/f2fs/f2fs.h
> > @@ -1244,13 +1244,10 @@ static inline void *f2fs_kmem_cache_alloc(struct 
> > kmem_cache *cachep,
> > gfp_t flags)
> >  {
> > void *entry;
> > -retry:
> > -   entry = kmem_cache_alloc(cachep, flags);
> > -   if (!entry) {
> > -   cond_resched();
> > -   goto retry;
> > -   }
> > 
> > +   entry = kmem_cache_alloc(cachep, flags);
> > +   if (!entry)
> > +   entry = kmem_cache_alloc(cachep, flags | __GFP_NOFAIL);
> 
> The fast + slow path model looks good to me, expect one thing:
> In several paths of checkpoint, caller will grab slab cache with GFP_ATOMIC,
> so in slow path, our flags will be GFP_ATOMIC | __GFP_NOFAIL, I'm not sure
> that the two flags can be used together.
> 
> Should we replace GFP_ATOMIC with GFP_NOFS in flags if caller passed
> GFP_ATOMIC?

Indeed, we need to avoid GFP_ATOMIC as much as possible to mitigate memory
pressure at this moment. Too much abused.

I wrote a patch like this.

>From a9209556d024cdce490695586ecee3164efda49c Mon Sep 17 00:00:00 2001
From: Jaegeuk Kim 
Date: Thu, 20 Aug 2015 08:51:56 -0700
Subject: [PATCH] f2fs: use __GFP_NOFAIL to avoid infinite loop

__GFP_NOFAIL can avoid retrying the whole path of kmem_cache_alloc and
bio_alloc.
And, it also fixes the use cases of GFP_ATOMIC correctly.

Suggested-by: Chao Yu 
Signed-off-by: Jaegeuk Kim 
---
 fs/f2fs/checkpoint.c | 21 -
 fs/f2fs/f2fs.h   | 16 +---
 fs/f2fs/node.c   |  4 ++--
 fs/f2fs/segment.c|  2 +-
 4 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 890e4d4..c5a38e3 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -336,26 +336,18 @@ const struct address_space_operations f2fs_meta_aops = {
 static void __add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)
 {
struct inode_management *im = &sbi->im[type];
-   struct ino_entry *e;
+   struct ino_entry *e, *tmp;
+
+   tmp = f2fs_kmem_cache_alloc(ino_entry_slab, GFP_NOFS);
 retry:
-   if (radix_tree_preload(GFP_NOFS)) {
-   cond_resched();
-   goto retry;
-   }
+   radix_tree_preload(GFP_NOFS | __GFP_NOFAIL);
 
spin_lock(&im->ino_lock);
-
e = radix_tree_lookup(&im->ino_root, ino);
if (!e) {
-   e = kmem_cache_alloc(ino_entry_slab, GFP_ATOMIC);
-   if (!e) {
-   spin_unlock(&im->ino_lock);
-   radix_tree_preload_end();
-   goto retry;
-   }
+   e = tmp;
if (radix_tree_insert(&im->ino_root, ino, e)) {
spin_unlock(&im->ino_lock);
-   kmem_cache_free(ino_entry_slab, e);
radix_tree_preload_end();
goto retry;
}
@@ -368,6 +360,9 @@ retry:
}
spin_unlock(&im->ino_lock);
radix_tree_preload_end();
+
+   if (e != tmp)
+   kmem_cache_free(ino_entry_slab, tmp);
 }
 
 static void __remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type)

[PATCH 02/18] ARM: add const qualifier to smp_operations member in structures

2015-08-23 Thread Masahiro Yamada
The core framework does not modify smp_operations structures.
To clarify it, this commit adds 'const' qualifier to the 'ops'
member of struct of_cpu_method and the 'smp' member of struct
machine_desc.

This change allows each SoC code to add 'const' qualifier to its
smp_operation structure.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/include/asm/mach/arch.h | 2 +-
 arch/arm/include/asm/smp.h   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index cb3a407..5c1ad11 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -47,7 +47,7 @@ struct machine_desc {
unsignedl2c_aux_val;/* L2 cache aux value   */
unsignedl2c_aux_mask;   /* L2 cache aux mask*/
void(*l2c_write_sec)(unsigned long, unsigned);
-   struct smp_operations   *smp;   /* SMP operations   */
+   const struct smp_operations *smp;   /* SMP operations   */
bool(*smp_init)(void);
void(*fixup)(struct tag *, char **);
void(*dt_fixup)(void);
diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index cd81540..50aff58 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -112,7 +112,7 @@ struct smp_operations {
 
 struct of_cpu_method {
const char *method;
-   struct smp_operations *ops;
+   const struct smp_operations *ops;
 };
 
 #define CPU_METHOD_OF_DECLARE(name, _method, _ops) \
-- 
1.9.1

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


[PATCH 09/18] ARM: hisi: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-hisi/platsmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 3c5237d..47ed32c 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -89,7 +89,7 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-static struct smp_operations hi3xxx_smp_ops __initdata = {
+static const struct smp_operations hi3xxx_smp_ops __initconst = {
.smp_prepare_cpus   = hi3xxx_smp_prepare_cpus,
.smp_boot_secondary = hi3xxx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
 }
 
 
-static struct smp_operations hix5hd2_smp_ops __initdata = {
+static const struct smp_operations hix5hd2_smp_ops __initconst = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hix5hd2_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -176,7 +176,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-static struct smp_operations hip01_smp_ops __initdata = {
+static const struct smp_operations hip01_smp_ops __initconst = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hip01_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 07/18] ARM: EXYNOS: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-exynos/common.h  | 2 +-
 arch/arm/mach-exynos/platsmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 1534925..e349a03 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -149,7 +149,7 @@ static inline void exynos_pm_init(void) {}
 extern void exynos_cpu_resume(void);
 extern void exynos_cpu_resume_ns(void);
 
-extern struct smp_operations exynos_smp_ops;
+extern const struct smp_operations exynos_smp_ops;
 
 extern void exynos_cpu_power_down(int cpu);
 extern void exynos_cpu_power_up(int cpu);
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 98a2c0c..5bd9559 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -479,7 +479,7 @@ static void exynos_cpu_die(unsigned int cpu)
 }
 #endif /* CONFIG_HOTPLUG_CPU */
 
-struct smp_operations exynos_smp_ops __initdata = {
+const struct smp_operations exynos_smp_ops __initconst = {
.smp_init_cpus  = exynos_smp_init_cpus,
.smp_prepare_cpus   = exynos_smp_prepare_cpus,
.smp_secondary_init = exynos_secondary_init,
-- 
1.9.1

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


[PATCH 08/18] ARM: hisi: do not export smp_operations structures

2015-08-23 Thread Masahiro Yamada
These three structures are only defined and referenced in
mach-hisi/platsmp.c.

Drop the declarations from the header and add static qualifier
to the definitions.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-hisi/core.h| 3 ---
 arch/arm/mach-hisi/platsmp.c | 6 +++---
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-hisi/core.h b/arch/arm/mach-hisi/core.h
index c7648ef..e883583 100644
--- a/arch/arm/mach-hisi/core.h
+++ b/arch/arm/mach-hisi/core.h
@@ -6,17 +6,14 @@
 extern void hi3xxx_set_cpu_jump(int cpu, void *jump_addr);
 extern int hi3xxx_get_cpu_jump(int cpu);
 extern void secondary_startup(void);
-extern struct smp_operations hi3xxx_smp_ops;
 
 extern void hi3xxx_cpu_die(unsigned int cpu);
 extern int hi3xxx_cpu_kill(unsigned int cpu);
 extern void hi3xxx_set_cpu(int cpu, bool enable);
 
-extern struct smp_operations hix5hd2_smp_ops;
 extern void hix5hd2_set_cpu(int cpu, bool enable);
 extern void hix5hd2_cpu_die(unsigned int cpu);
 
-extern struct smp_operations hip01_smp_ops;
 extern void hip01_set_cpu(int cpu, bool enable);
 extern void hip01_cpu_die(unsigned int cpu);
 #endif
diff --git a/arch/arm/mach-hisi/platsmp.c b/arch/arm/mach-hisi/platsmp.c
index 5174412..3c5237d 100644
--- a/arch/arm/mach-hisi/platsmp.c
+++ b/arch/arm/mach-hisi/platsmp.c
@@ -89,7 +89,7 @@ static int hi3xxx_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-struct smp_operations hi3xxx_smp_ops __initdata = {
+static struct smp_operations hi3xxx_smp_ops __initdata = {
.smp_prepare_cpus   = hi3xxx_smp_prepare_cpus,
.smp_boot_secondary = hi3xxx_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static int hix5hd2_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
 }
 
 
-struct smp_operations hix5hd2_smp_ops __initdata = {
+static struct smp_operations hix5hd2_smp_ops __initdata = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hix5hd2_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -176,7 +176,7 @@ static int hip01_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-struct smp_operations hip01_smp_ops __initdata = {
+static struct smp_operations hip01_smp_ops __initdata = {
.smp_prepare_cpus   = hisi_common_smp_prepare_cpus,
.smp_boot_secondary = hip01_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 12/18] ARM: rockchip: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-rockchip/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
index 3e7a4b7..93f 100644
--- a/arch/arm/mach-rockchip/platsmp.c
+++ b/arch/arm/mach-rockchip/platsmp.c
@@ -340,7 +340,7 @@ static void rockchip_cpu_die(unsigned int cpu)
 }
 #endif
 
-static struct smp_operations rockchip_smp_ops __initdata = {
+static const struct smp_operations rockchip_smp_ops __initconst = {
.smp_prepare_cpus   = rockchip_smp_prepare_cpus,
.smp_boot_secondary = rockchip_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 17/18] ARM: zynq: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-zynq/common.h  | 2 +-
 arch/arm/mach-zynq/platsmp.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-zynq/common.h b/arch/arm/mach-zynq/common.h
index 79cda2e..e771933 100644
--- a/arch/arm/mach-zynq/common.h
+++ b/arch/arm/mach-zynq/common.h
@@ -30,7 +30,7 @@ extern char zynq_secondary_trampoline;
 extern char zynq_secondary_trampoline_jump;
 extern char zynq_secondary_trampoline_end;
 extern int zynq_cpun_start(u32 address, int cpu);
-extern struct smp_operations zynq_smp_ops __initdata;
+extern const struct smp_operations zynq_smp_ops;
 #endif
 
 extern void __iomem *zynq_scu_base;
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c
index f66816c..7cd9865 100644
--- a/arch/arm/mach-zynq/platsmp.c
+++ b/arch/arm/mach-zynq/platsmp.c
@@ -157,7 +157,7 @@ static void zynq_cpu_die(unsigned int cpu)
 }
 #endif
 
-struct smp_operations zynq_smp_ops __initdata = {
+const struct smp_operations zynq_smp_ops __initconst = {
.smp_init_cpus  = zynq_smp_init_cpus,
.smp_prepare_cpus   = zynq_smp_prepare_cpus,
.smp_boot_secondary = zynq_boot_secondary,
-- 
1.9.1

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


[PATCH 14/18] ARM: sunxi: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to sun8i_smp_ops.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-sunxi/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-sunxi/platsmp.c b/arch/arm/mach-sunxi/platsmp.c
index e8483ec..6642267 100644
--- a/arch/arm/mach-sunxi/platsmp.c
+++ b/arch/arm/mach-sunxi/platsmp.c
@@ -116,7 +116,7 @@ static int sun6i_smp_boot_secondary(unsigned int cpu,
return 0;
 }
 
-static struct smp_operations sun6i_smp_ops __initdata = {
+static const struct smp_operations sun6i_smp_ops __initconst = {
.smp_prepare_cpus   = sun6i_smp_prepare_cpus,
.smp_boot_secondary = sun6i_smp_boot_secondary,
 };
@@ -185,7 +185,7 @@ static int sun8i_smp_boot_secondary(unsigned int cpu,
return 0;
 }
 
-struct smp_operations sun8i_smp_ops __initdata = {
+static const struct smp_operations sun8i_smp_ops __initconst = {
.smp_prepare_cpus   = sun8i_smp_prepare_cpus,
.smp_boot_secondary = sun8i_smp_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 05/18] ARM: BCM: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to bcm63138_smp_ops.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-bcm/bcm63xx_smp.c | 2 +-
 arch/arm/mach-bcm/kona_smp.c| 2 +-
 arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-bcm/bcm63xx_smp.c b/arch/arm/mach-bcm/bcm63xx_smp.c
index 19be904..9b6727e 100644
--- a/arch/arm/mach-bcm/bcm63xx_smp.c
+++ b/arch/arm/mach-bcm/bcm63xx_smp.c
@@ -161,7 +161,7 @@ static void __init bcm63138_smp_prepare_cpus(unsigned int 
max_cpus)
}
 }
 
-struct smp_operations bcm63138_smp_ops __initdata = {
+static const struct smp_operations bcm63138_smp_ops __initconst = {
.smp_prepare_cpus   = bcm63138_smp_prepare_cpus,
.smp_boot_secondary = bcm63138_smp_boot_secondary,
 };
diff --git a/arch/arm/mach-bcm/kona_smp.c b/arch/arm/mach-bcm/kona_smp.c
index 66a0465..da8328b 100644
--- a/arch/arm/mach-bcm/kona_smp.c
+++ b/arch/arm/mach-bcm/kona_smp.c
@@ -194,7 +194,7 @@ static int bcm_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return -ENOSYS;
 }
 
-static struct smp_operations bcm_smp_ops __initdata = {
+static const struct smp_operations bcm_smp_ops __initconst = {
.smp_prepare_cpus   = bcm_smp_prepare_cpus,
.smp_boot_secondary = bcm_boot_secondary,
 };
diff --git a/arch/arm/mach-bcm/platsmp-brcmstb.c 
b/arch/arm/mach-bcm/platsmp-brcmstb.c
index 44d6bddf..40dc844 100644
--- a/arch/arm/mach-bcm/platsmp-brcmstb.c
+++ b/arch/arm/mach-bcm/platsmp-brcmstb.c
@@ -356,7 +356,7 @@ static int brcmstb_boot_secondary(unsigned int cpu, struct 
task_struct *idle)
return 0;
 }
 
-static struct smp_operations brcmstb_smp_ops __initdata = {
+static const struct smp_operations brcmstb_smp_ops __initconst = {
.smp_prepare_cpus   = brcmstb_cpu_ctrl_setup,
.smp_boot_secondary = brcmstb_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 10/18] ARM: mvebu: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-mvebu/armada-370-xp.h | 2 +-
 arch/arm/mach-mvebu/platsmp-a9.c| 4 ++--
 arch/arm/mach-mvebu/platsmp.c   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-mvebu/armada-370-xp.h 
b/arch/arm/mach-mvebu/armada-370-xp.h
index c55bbf8..09413b6 100644
--- a/arch/arm/mach-mvebu/armada-370-xp.h
+++ b/arch/arm/mach-mvebu/armada-370-xp.h
@@ -17,7 +17,7 @@
 
 #ifdef CONFIG_SMP
 void armada_xp_secondary_startup(void);
-extern struct smp_operations armada_xp_smp_ops;
+extern const struct smp_operations armada_xp_smp_ops;
 #endif
 
 #endif /* __MACH_ARMADA_370_XP_H */
diff --git a/arch/arm/mach-mvebu/platsmp-a9.c b/arch/arm/mach-mvebu/platsmp-a9.c
index 3d50004..d715dec 100644
--- a/arch/arm/mach-mvebu/platsmp-a9.c
+++ b/arch/arm/mach-mvebu/platsmp-a9.c
@@ -93,11 +93,11 @@ static int armada_38x_cpu_kill(unsigned int cpu)
 }
 #endif
 
-static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = {
+static const struct smp_operations mvebu_cortex_a9_smp_ops __initconst = {
.smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
 };
 
-static struct smp_operations armada_38x_smp_ops __initdata = {
+static const struct smp_operations armada_38x_smp_ops __initconst = {
.smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
.smp_secondary_init = armada_38x_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c
index 58cc8c1..f9597b7 100644
--- a/arch/arm/mach-mvebu/platsmp.c
+++ b/arch/arm/mach-mvebu/platsmp.c
@@ -170,7 +170,7 @@ static int armada_xp_cpu_kill(unsigned int cpu)
 }
 #endif
 
-struct smp_operations armada_xp_smp_ops __initdata = {
+const struct smp_operations armada_xp_smp_ops __initconst = {
.smp_init_cpus  = armada_xp_smp_init_cpus,
.smp_prepare_cpus   = armada_xp_smp_prepare_cpus,
.smp_boot_secondary = armada_xp_boot_secondary,
-- 
1.9.1

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


[PATCH 00/18] ARM: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada

Currently, SoC code can not add const qualifier to smp_operations
structures although they are never over-written.

01/18 and 02/18 add small changes to the ARM core to fix that.
The rest of this series replace "__initdata" with "const ... __initconst"
for each of SoC code.

I split this series into per-SoC so that each sub-arch maintainer
can easily give their Acked-by.  (Is this better?)

Russell, Olof, and Arnd:

How should this series be applied (if it looks good)?
The first two are ARM-tree wide and looks like in the field of Russell.
The rest are highly SoC-related.



Masahiro Yamada (18):
  ARM: add const qualifier to the argument of smp_set_ops()
  ARM: add const qualifier to smp_operations member in structures
  ARM: alpine: use const and __initconst for smp_operations
  ARM: axxia: use const and __initconst for smp_operations
  ARM: BCM: use const and __initconst for smp_operations
  ARM: berlin: use const and __initconst for smp_operations
  ARM: EXYNOS: use const and __initconst for smp_operations
  ARM: hisi: do not export smp_operations structures
  ARM: hisi: use const and __initconst for smp_operations
  ARM: mvebu: use const and __initconst for smp_operations
  ARM: qcom: use const and __initconst for smp_operations
  ARM: rockchip: use const and __initconst for smp_operations
  ARM: socfpga: use const and __initconst for smp_operations
  ARM: sunxi: use const and __initconst for smp_operations
  ARM: uniphier: use const and __initconst for smp_operations
  ARM: zx: use const and __initconst for smp_operations
  ARM: zynq: use const and __initconst for smp_operations
  ARM: mcpm: use const and __initconst for smp_operations

 arch/arm/common/mcpm_platsmp.c  | 2 +-
 arch/arm/include/asm/mach/arch.h| 2 +-
 arch/arm/include/asm/smp.h  | 4 ++--
 arch/arm/kernel/smp.c   | 2 +-
 arch/arm/mach-alpine/platsmp.c  | 2 +-
 arch/arm/mach-axxia/platsmp.c   | 2 +-
 arch/arm/mach-bcm/bcm63xx_smp.c | 2 +-
 arch/arm/mach-bcm/kona_smp.c| 2 +-
 arch/arm/mach-bcm/platsmp-brcmstb.c | 2 +-
 arch/arm/mach-berlin/platsmp.c  | 2 +-
 arch/arm/mach-exynos/common.h   | 2 +-
 arch/arm/mach-exynos/platsmp.c  | 2 +-
 arch/arm/mach-hisi/core.h   | 3 ---
 arch/arm/mach-hisi/platsmp.c| 6 +++---
 arch/arm/mach-mvebu/armada-370-xp.h | 2 +-
 arch/arm/mach-mvebu/platsmp-a9.c| 4 ++--
 arch/arm/mach-mvebu/platsmp.c   | 2 +-
 arch/arm/mach-qcom/platsmp.c| 6 +++---
 arch/arm/mach-rockchip/platsmp.c| 2 +-
 arch/arm/mach-socfpga/platsmp.c | 4 ++--
 arch/arm/mach-sunxi/platsmp.c   | 4 ++--
 arch/arm/mach-uniphier/platsmp.c| 2 +-
 arch/arm/mach-zx/platsmp.c  | 2 +-
 arch/arm/mach-zynq/common.h | 2 +-
 arch/arm/mach-zynq/platsmp.c| 2 +-
 25 files changed, 32 insertions(+), 35 deletions(-)

-- 
1.9.1

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


[PATCH 16/18] ARM: zx: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, add static to the structure.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-zx/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-zx/platsmp.c b/arch/arm/mach-zx/platsmp.c
index a369398..0297f92 100644
--- a/arch/arm/mach-zx/platsmp.c
+++ b/arch/arm/mach-zx/platsmp.c
@@ -176,7 +176,7 @@ static void zx_secondary_init(unsigned int cpu)
scu_power_mode(scu_base, SCU_PM_NORMAL);
 }
 
-struct smp_operations zx_smp_ops __initdata = {
+static const struct smp_operations zx_smp_ops __initconst = {
.smp_prepare_cpus   = zx_smp_prepare_cpus,
.smp_secondary_init = zx_secondary_init,
.smp_boot_secondary = zx_boot_secondary,
-- 
1.9.1

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


[PATCH 18/18] ARM: mcpm: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Also, __initconst has been moved after mcpm_smp_ops because
scripts/checkpatch.pl suggests to do so.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/common/mcpm_platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/common/mcpm_platsmp.c b/arch/arm/common/mcpm_platsmp.c
index 92e54d7..1011b0e 100644
--- a/arch/arm/common/mcpm_platsmp.c
+++ b/arch/arm/common/mcpm_platsmp.c
@@ -87,7 +87,7 @@ static void mcpm_cpu_die(unsigned int cpu)
 
 #endif
 
-static struct smp_operations __initdata mcpm_smp_ops = {
+static const struct smp_operations mcpm_smp_ops __initconst = {
.smp_boot_secondary = mcpm_boot_secondary,
.smp_secondary_init = mcpm_secondary_init,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 01/18] ARM: add const qualifier to the argument of smp_set_ops()

2015-08-23 Thread Masahiro Yamada
This function just copies '*ops' to 'smp_ops', so the given
structure '*ops' is not modified at all.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/include/asm/smp.h | 2 +-
 arch/arm/kernel/smp.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/smp.h b/arch/arm/include/asm/smp.h
index 2f3ac1b..cd81540 100644
--- a/arch/arm/include/asm/smp.h
+++ b/arch/arm/include/asm/smp.h
@@ -122,6 +122,6 @@ struct of_cpu_method {
 /*
  * set platform specific SMP operations
  */
-extern void smp_set_ops(struct smp_operations *);
+extern void smp_set_ops(const struct smp_operations *);
 
 #endif /* ifndef __ASM_ARM_SMP_H */
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 3d6b782..bb63a4e 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -78,7 +78,7 @@ static DECLARE_COMPLETION(cpu_running);
 
 static struct smp_operations smp_ops;
 
-void __init smp_set_ops(struct smp_operations *ops)
+void __init smp_set_ops(const struct smp_operations *ops)
 {
if (ops)
smp_ops = *ops;
-- 
1.9.1

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


[PATCH 11/18] ARM: qcom: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-qcom/platsmp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-qcom/platsmp.c b/arch/arm/mach-qcom/platsmp.c
index 5cde63a..11847cd 100644
--- a/arch/arm/mach-qcom/platsmp.c
+++ b/arch/arm/mach-qcom/platsmp.c
@@ -332,7 +332,7 @@ static void __init qcom_smp_prepare_cpus(unsigned int 
max_cpus)
}
 }
 
-static struct smp_operations smp_msm8660_ops __initdata = {
+static const struct smp_operations smp_msm8660_ops __initconst = {
.smp_prepare_cpus   = qcom_smp_prepare_cpus,
.smp_secondary_init = qcom_secondary_init,
.smp_boot_secondary = msm8660_boot_secondary,
@@ -342,7 +342,7 @@ static struct smp_operations smp_msm8660_ops __initdata = {
 };
 CPU_METHOD_OF_DECLARE(qcom_smp, "qcom,gcc-msm8660", &smp_msm8660_ops);
 
-static struct smp_operations qcom_smp_kpssv1_ops __initdata = {
+static const struct smp_operations qcom_smp_kpssv1_ops __initconst = {
.smp_prepare_cpus   = qcom_smp_prepare_cpus,
.smp_secondary_init = qcom_secondary_init,
.smp_boot_secondary = kpssv1_boot_secondary,
@@ -352,7 +352,7 @@ static struct smp_operations qcom_smp_kpssv1_ops __initdata 
= {
 };
 CPU_METHOD_OF_DECLARE(qcom_smp_kpssv1, "qcom,kpss-acc-v1", 
&qcom_smp_kpssv1_ops);
 
-static struct smp_operations qcom_smp_kpssv2_ops __initdata = {
+static const struct smp_operations qcom_smp_kpssv2_ops __initconst = {
.smp_prepare_cpus   = qcom_smp_prepare_cpus,
.smp_secondary_init = qcom_secondary_init,
.smp_boot_secondary = kpssv2_boot_secondary,
-- 
1.9.1

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


[PATCH 06/18] ARM: berlin: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-berlin/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-berlin/platsmp.c b/arch/arm/mach-berlin/platsmp.c
index 34a3753..41a626b 100644
--- a/arch/arm/mach-berlin/platsmp.c
+++ b/arch/arm/mach-berlin/platsmp.c
@@ -91,7 +91,7 @@ unmap_scu:
iounmap(scu_base);
 }
 
-static struct smp_operations berlin_smp_ops __initdata = {
+static const struct smp_operations berlin_smp_ops __initconst = {
.smp_prepare_cpus   = berlin_smp_prepare_cpus,
.smp_boot_secondary = berlin_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 04/18] ARM: axxia: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-axxia/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-axxia/platsmp.c b/arch/arm/mach-axxia/platsmp.c
index 959d4df..ffbd71d 100644
--- a/arch/arm/mach-axxia/platsmp.c
+++ b/arch/arm/mach-axxia/platsmp.c
@@ -82,7 +82,7 @@ static void __init axxia_smp_prepare_cpus(unsigned int 
max_cpus)
}
 }
 
-static struct smp_operations axxia_smp_ops __initdata = {
+static const struct smp_operations axxia_smp_ops __initconst = {
.smp_prepare_cpus   = axxia_smp_prepare_cpus,
.smp_boot_secondary = axxia_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 15/18] ARM: uniphier: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-uniphier/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-uniphier/platsmp.c b/arch/arm/mach-uniphier/platsmp.c
index 4b784f7..da5359c 100644
--- a/arch/arm/mach-uniphier/platsmp.c
+++ b/arch/arm/mach-uniphier/platsmp.c
@@ -76,7 +76,7 @@ static int uniphier_boot_secondary(unsigned int cpu,
return ret;
 }
 
-struct smp_operations uniphier_smp_ops __initdata = {
+static const struct smp_operations uniphier_smp_ops __initconst = {
.smp_prepare_cpus   = uniphier_smp_prepare_cpus,
.smp_boot_secondary = uniphier_boot_secondary,
 };
-- 
1.9.1

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


[PATCH 13/18] ARM: socfpga: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-socfpga/platsmp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-socfpga/platsmp.c b/arch/arm/mach-socfpga/platsmp.c
index 15c8ce8..cbb0a54 100644
--- a/arch/arm/mach-socfpga/platsmp.c
+++ b/arch/arm/mach-socfpga/platsmp.c
@@ -117,7 +117,7 @@ static int socfpga_cpu_kill(unsigned int cpu)
return 1;
 }
 
-static struct smp_operations socfpga_smp_ops __initdata = {
+static const struct smp_operations socfpga_smp_ops __initconst = {
.smp_prepare_cpus   = socfpga_smp_prepare_cpus,
.smp_boot_secondary = socfpga_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
@@ -126,7 +126,7 @@ static struct smp_operations socfpga_smp_ops __initdata = {
 #endif
 };
 
-static struct smp_operations socfpga_a10_smp_ops __initdata = {
+static const struct smp_operations socfpga_a10_smp_ops __initconst = {
.smp_prepare_cpus   = socfpga_smp_prepare_cpus,
.smp_boot_secondary = socfpga_a10_boot_secondary,
 #ifdef CONFIG_HOTPLUG_CPU
-- 
1.9.1

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


[PATCH 03/18] ARM: alpine: use const and __initconst for smp_operations

2015-08-23 Thread Masahiro Yamada
The smp_operations structure is not over-written, so add const
qualifier and replace __initdata with __initconst.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-alpine/platsmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-alpine/platsmp.c b/arch/arm/mach-alpine/platsmp.c
index f78429f..dd77ea2 100644
--- a/arch/arm/mach-alpine/platsmp.c
+++ b/arch/arm/mach-alpine/platsmp.c
@@ -42,7 +42,7 @@ static void __init alpine_smp_prepare_cpus(unsigned int 
max_cpus)
alpine_cpu_pm_init();
 }
 
-static struct smp_operations alpine_smp_ops __initdata = {
+static const struct smp_operations alpine_smp_ops __initconst = {
.smp_prepare_cpus   = alpine_smp_prepare_cpus,
.smp_boot_secondary = alpine_boot_secondary,
 };
-- 
1.9.1

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


Re: [PATCH v4 3/3] touchscreen: colibri-vf50-ts: Add touchscreen support for Colibri VF50

2015-08-23 Thread maitysanchayan
Hello Dmitry,

On 15-08-21 18:30:57, Dmitry Torokhov wrote:
> Hi Sanchayan,
> 
> On Fri, Aug 21, 2015 at 06:56:32PM +0530, Sanchayan Maity wrote:
> > The Colibri Vybrid VF50 module supports 4-wire touchscreens using
> > FETs and ADC inputs. This driver uses the IIO consumer interface
> > and relies on the vf610_adc driver based on the IIO framework.
> > 
> 
> Thank you for making changes. I have a few comments still.

It has really improved with your comments. Thanks for your feedback.

> 
> > Signed-off-by: Sanchayan Maity 
> > ---
> >  drivers/input/touchscreen/Kconfig   |  12 +
> >  drivers/input/touchscreen/Makefile  |   1 +
> >  drivers/input/touchscreen/colibri-vf50-ts.c | 370 
> > 
> >  3 files changed, 383 insertions(+)
> >  create mode 100644 drivers/input/touchscreen/colibri-vf50-ts.c
> > 
> > diff --git a/drivers/input/touchscreen/Kconfig 
> > b/drivers/input/touchscreen/Kconfig
> > index 80f6386..28948ca 100644
> > --- a/drivers/input/touchscreen/Kconfig
> > +++ b/drivers/input/touchscreen/Kconfig
> > @@ -1027,4 +1027,16 @@ config TOUCHSCREEN_ZFORCE
> >   To compile this driver as a module, choose M here: the
> >   module will be called zforce_ts.
> >  
> > +config TOUCHSCREEN_COLIBRI_VF50
> > +   tristate "Toradex Colibri on board touchscreen driver"
> > +   depends on GPIOLIB && IIO && VF610_ADC
> 
> Can we possibly add "|| COMPILE_TEST" dependency? Will it compile
> without IIO or VF610_ADC enabled?

I will add and do the checks. It should compile without VF610_ADC
atleast, I don't see how it will without the others. I will check
once at my end also with other configs.

> 
> 
> > +   help
> > + Say Y here if you have a Colibri VF50 and plan to use
> > + the on-board provided 4-wire touchscreen driver.
> > +
> > + If unsure, say N.
> > +
> > + To compile this driver as a module, choose M here: the
> > + module will be called colibri_vf50_ts.
> > +
> >  endif
> > diff --git a/drivers/input/touchscreen/Makefile 
> > b/drivers/input/touchscreen/Makefile
> > index 44deea7..93746a0 100644
> > --- a/drivers/input/touchscreen/Makefile
> > +++ b/drivers/input/touchscreen/Makefile
> > @@ -84,3 +84,4 @@ obj-$(CONFIG_TOUCHSCREEN_W90X900) += w90p910_ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_SX8654)   += sx8654.o
> >  obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
> >  obj-$(CONFIG_TOUCHSCREEN_ZFORCE)   += zforce_ts.o
> > +obj-$(CONFIG_TOUCHSCREEN_COLIBRI_VF50) += colibri-vf50-ts.o
> > diff --git a/drivers/input/touchscreen/colibri-vf50-ts.c 
> > b/drivers/input/touchscreen/colibri-vf50-ts.c
> > new file mode 100644
> > index 000..0793fdc
> > --- /dev/null
> > +++ b/drivers/input/touchscreen/colibri-vf50-ts.c
> > @@ -0,0 +1,370 @@
> > +/* Copyright 2015 Toradex AG
> > + *
> > + * Toradex Colibri VF50 Touchscreen driver
> > + *
> > + * Originally authored by Stefan Agner for 3.0 kernel
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> 
> Don't you need gpio/consumer.h?

Yes.

> 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#define DRIVER_NAME "colibri-vf50-ts"
> > +#define DRV_VERSION "1.0"
> > +
> > +#define VF_ADC_MAX ((1 << 12) - 1)
> > +
> > +#define COLI_TOUCH_MIN_DELAY_US 1000
> > +#define COLI_TOUCH_MAX_DELAY_US 2000
> > +#define COLI_TOUCH_NO_OF_AVGS  5
> > +
> > +struct vf50_touch_device {
> > +   struct platform_device  *pdev;
> > +   struct input_dev*ts_input;
> > +   struct iio_channel  *channels;
> > +   struct gpio_desc *gpio_xp;
> > +   struct gpio_desc *gpio_xm;
> > +   struct gpio_desc *gpio_yp;
> > +   struct gpio_desc *gpio_ym;
> > +   struct gpio_desc *gpio_pen_detect;
> 
> I do not see gpio_pen_detect being used anymore.

Sorry. My mistake. It needs to be deleted. Will fix.

> 
> > +   int pen_irq;
> > +   int min_pressure;
> > +   bool stop_touchscreen;
> > +};
> > +
> > +/*
> > + * Enables given plates and measures touch parameters using ADC
> > + */
> > +static int adc_ts_measure(struct iio_channel *channel,
> > + struct gpio_desc *plate_p, struct gpio_desc *plate_m)
> > +{
> > +   int i, value = 0, val = 0;
> > +   int ret;
> > +
> > +   gpiod_set_value(plate_p, 1);
> > +   gpiod_set_value(plate_m, 1);
> > +
> > +   usleep_range(COLI_TOUCH_MIN_DELAY_US, COLI_TOUCH_MAX_DELAY_US);
> > +
> > +   for (i = 0; i < COLI_TOUCH_NO_OF_AVGS; i++) {
> > +   ret = iio_read_channel_raw(channel, &val);
> > +   if (ret < 0) {
> > +   value = ret;
> > +   goto error_iio_read;
> > +   }
> > +
> > +   value += val;
> > +   }
> > +
> 

Re: [PATCH 1/1] fix cpufreq/cpufreq.c some coding style issues

2015-08-23 Thread Vaishali Thakkar
On Mon, Aug 24, 2015 at 9:53 AM, Viresh Kumar  wrote:
> On 23-08-15, 21:19, Vaishali Thakkar wrote:
>>
>> On 23 Aug 2015 21:05, "Muhammad Falak R Wani"  wrote:
>> >
>> > Hi,
>> >
>> > This patch fixes issues in coding style, of a missing blank line
>> after
>> > declarations.
>> >
>> > Best,
>> > mfrw
>>
>> Please use subject lines and commit log matching the kernel coding style for
>> the subsystem on patches.
>
> And Vaishali, please don't send any mails in html. Please configure
> your gmail client to send mails only in text.

Yes. Sorry. I realized my mistake. Will keep in mind.

> --
> viresh



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


Re: [RESEND PATCH] cpufreq: cpufreq: Fix coding style issues

2015-08-23 Thread Viresh Kumar
On 23-08-15, 22:13, Muhammad Falak R Wani wrote:
> This patch introduces a blank line after declarations, which
> fix the checkpatch.pl warnings at 3 places.
> 
> Signed-off-by: Muhammad Falak R Wani 
> ---
>  drivers/cpufreq/cpufreq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 8ae655c..5aea659 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -718,6 +718,7 @@ static ssize_t show_bios_limit(struct cpufreq_policy 
> *policy, char *buf)
>  {
>   unsigned int limit;
>   int ret;
> +
>   if (cpufreq_driver->bios_limit) {
>   ret = cpufreq_driver->bios_limit(policy->cpu, &limit);
>   if (!ret)
> @@ -815,6 +816,7 @@ unlock:
>  static void cpufreq_sysfs_release(struct kobject *kobj)
>  {
>   struct cpufreq_policy *policy = to_policy(kobj);
> +
>   pr_debug("last reference is dropped\n");
>   complete(&policy->kobj_unregister);
>  }
> @@ -2129,6 +2131,7 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
>  int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
>  {
>   struct cpufreq_policy *cpu_policy;
> +
>   if (!policy)
>   return -EINVAL;

We don't really need a patch for this, unless Rafael wants to apply
this one :)

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


Re: [PATCH 1/1] fix cpufreq/cpufreq.c some coding style issues

2015-08-23 Thread Viresh Kumar
On 23-08-15, 21:09, Muhammad Falak R Wani wrote:
> Hi,
> 
>   This patch fixes issues in coding style, of a missing blank line after
> declarations.
> 
> Best,
> mfrw

This is as ugly as it could be. Please go through
Documentation/SubmittingPatches and other related stuff to see you to
send patches.

> Signed-off-by: Muhammad Falak R Wani 
> ---
>  drivers/cpufreq/cpufreq.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index 8ae655c..5aea659 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -718,6 +718,7 @@ static ssize_t show_bios_limit(struct cpufreq_policy 
> *policy, char *buf)
>  {
>   unsigned int limit;
>   int ret;
> +
>   if (cpufreq_driver->bios_limit) {
>   ret = cpufreq_driver->bios_limit(policy->cpu, &limit);
>   if (!ret)
> @@ -815,6 +816,7 @@ unlock:
>  static void cpufreq_sysfs_release(struct kobject *kobj)
>  {
>   struct cpufreq_policy *policy = to_policy(kobj);
> +
>   pr_debug("last reference is dropped\n");
>   complete(&policy->kobj_unregister);
>  }
> @@ -2129,6 +2131,7 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
>  int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
>  {
>   struct cpufreq_policy *cpu_policy;
> +
>   if (!policy)
>   return -EINVAL;

And then these changes are all trivial and not at all important. We
don't want a patch for that even if checkpatch complains.

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


Re: is this a problem of numactl in RedHat7.0 ?

2015-08-23 Thread Xishi Qiu
On 2015/8/22 4:53, Rik van Riel wrote:

> On 08/21/2015 05:27 AM, Xishi Qiu wrote:
>> I use numactl(--localalloc) tool run a test case, but it shows that
>> the numa policy is prefer, I don't know why.
> 
> The kernel implements MPOL_PREFERRED and MPOL_LOCAL
> in the same way. Look at this code in mpol_new(),
> in mm/mempolicy.c:
> 

user:
"numactl --localalloc" wil call
main()
  numa_set_localalloc()
setpol(MPOL_DEFAULT, numa_no_nodes_ptr);
  set_mempolicy()
syscall(__NR_set_mempolicy,mode,nmask,maxnode);

kernel:
do_set_mempolicy()
  mpol_new()
if (mode == MPOL_DEFAULT) {
if (nodes && !nodes_empty(*nodes))
return ERR_PTR(-EINVAL);
return NULL;  // return from here
}

> /*
>  * MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
>  * MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
>  * All other modes require a valid pointer to a non-empty nodemask.
>  */
> if (mode == MPOL_PREFERRED) {
> if (nodes_empty(*nodes)) {
> if (((flags & MPOL_F_STATIC_NODES) ||
>  (flags & MPOL_F_RELATIVE_NODES)))
> return ERR_PTR(-EINVAL);
> }
> } else if (mode == MPOL_LOCAL) {
> if (!nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> mode = MPOL_PREFERRED;
> } else if (nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> 
> 
> 
> 



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


Re: [PATCH 1/1] fix cpufreq/cpufreq.c some coding style issues

2015-08-23 Thread Viresh Kumar
On 23-08-15, 21:19, Vaishali Thakkar wrote:
> 
> On 23 Aug 2015 21:05, "Muhammad Falak R Wani"  wrote:
> >
> > Hi,
> >
> >         This patch fixes issues in coding style, of a missing blank line
> after
> > declarations.
> >
> > Best,
> > mfrw
> 
> Please use subject lines and commit log matching the kernel coding style for
> the subsystem on patches.

And Vaishali, please don't send any mails in html. Please configure
your gmail client to send mails only in text.

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


.. one more last -rc after all

2015-08-23 Thread Linus Torvalds
So 4.2-rc8 is out, and that obviously means that I ended up deciding
to chicken out after all, and delay the 4.2 release one week.

It's not like there are any real outstanding issues, and I waffled
between just doing the release and doing another -rc. But we did have
another low-level x86 issue come up this week, and together with the
fact that a number of people are on vacation, I decided that waiting
an extra week isn't going to hurt. But it was close. It's a fairly
small rc8, and I really feel like it could have gone either way.

So rc8 isn't a big rc, and most of it is actually some last-minute
reverts for stuff that just wasn't quite ready. Mostly drivers, with
some networking, an x86 fix, and a smattering of perf tooling fixes.
The shortlog gives an overview of the details.

Linus
---

Adrian Hunter (3):
  perf tools: Avoid deadlock when map_groups are broken
  perf tools: Make fork event processing more resilient
  perf tools: Fix buildid processing

Adrien Schildknecht (1):
  mac80211: fix invalid read in minstrel_sort_best_tp_rates()

Alan Stern (1):
  SCSI: Fix NULL pointer dereference in runtime PM

Alban Crequy (1):
  cpuset: use trialcs->mems_allowed as a temp variable

Alexei Potashnik (1):
  target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT

Andy Lutomirski (1):
  Revert "sched/x86_64: Don't save flags on context switch"

Andy Whitcroft (1):
  ipv4: off-by-one in continuation handling in /proc/net/route

Arnaldo Carvalho de Melo (1):
  perf top: Show backtrace when handling a SIGSEGV on --stdio mode

Axel Lin (2):
  ata: ahci_brcmstb: Fix misuse of IS_ENABLED
  FIRMWARE: bcm47xx_nvram: Fix module license.

Bjorn Helgaas (1):
  PCI: Don't use 64-bit bus addresses on PA-RISC

Calvin Owens (1):
  Revert "net: limit tcp/udp rmem/wmem to SOCK_{RCV,SND}BUF_MIN"

Chris Wilson (1):
  drm/i915: Flag the execlists context object as dirty after every use

Christoph Hellwig (1):
  Add hch to .get_maintainer.ignore

Claudiu Manoil (1):
  gianfar: Restore link state settings after MAC reset

Dan Carpenter (1):
  net: ethernet: micrel: fix an error code

Daniel Vetter (1):
  drm/i915: Only dither on 6bpc panels

Dave Airlie (1):
  drm/radeon: fix hotplug race at startup

David Härdeman (7):
  Revert "[media] rc: nuvoton-cir: Add support for writing wakeup
samples via sysfs filter callback"
  Revert "[media] rc: rc-loopback: Add loopback of filter scancodes"
  Revert "[media] rc: rc-core: Add support for encode_wakeup drivers"
  Revert "[media] rc: ir-rc6-decoder: Add encode capability"
  Revert "[media] rc: ir-rc5-decoder: Add encode capability"
  Revert "[media] rc: rc-ir-raw: Add Manchester encoder (phase
encoder) helper"
  Revert "[media] rc: rc-ir-raw: Add scancode encoder callback"

David Vrabel (1):
  x86/xen: make CONFIG_XEN depend on CONFIG_X86_LOCAL_APIC

David Ward (1):
  net: qmi_wwan: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module

Dmitry Torokhov (1):
  thermal: power_allocator: do not use devm* interfaces

Eric Dumazet (2):
  inet: fix potential deadlock in reqsk_queue_unlink()
  timer: Write timer->flags atomically

Fabio Estevam (1):
  [media] mantis: Fix error handling in mantis_dma_init()

Florian Fainelli (1):
  ata: ahci_brcmstb: Fix warnings with CONFIG_PM_SLEEP=n

Grygorii Strashko (6):
  genirq: Don't return ENOSYS in irq_chip_retrigger_hierarchy
  genirq: Introduce irq_chip_set_type_parent() helper
  irqchip/crossbar: Restore the irq_set_type() mechanism
  ARM: OMAP: wakeupgen: Restore the irq_set_type() mechanism
  irqchip/crossbar: Restore the mask on suspend behaviour
  irqchip/crossbar: Restore set_wake functionality

Guenter Roeck (1):
  clocksource/imx: Fix boot with non-DT systems

Guillaume Nault (1):
  ppp: fix device unregistration upon netns deletion

Hans de Goede (1):
  ACPI / video: Fix circular lock dependency issue in the video-detect code

Hariprasad S (1):
  iw_cxgb4: gracefully handle unknown CQE status errors

Herbert Xu (1):
  crypto: authencesn - Fix breakage with new ESP code

Hiral Shah (1):
  fnic: Use the local variable instead of I/O flag to acquire
io_req_lock in fnic_queuecommand() to avoid deadloack

Horia Geant? (1):
  crypto: caam - fix memory corruption in ahash_final_ctx

Igor Plyatov (1):
  net: phy: workaround for buggy cable detection by LAN8700 after
cable plugging

Ingo Molnar (2):
  x86/fpu/math-emu: Fix math-emu boot crash
  x86/fpu/math-emu: Fix crash in fork()

Ivan Vecera (1):
  be2net: avoid vxlan offloading on multichannel configs

Jan Stancek (1):
  crypto: nx - respect sg limit bounds when building sg lists for SHA

Jani Nikula (1):
  Revert "drm/i915: Allow parsing of variable size child device
entries from VBT"

Jiang Liu (1):
  x86/irq: Build correct vector mapping for multiple MSI inte

Re: [PATCH v3 06/14] Documentation: drm/bridge: add document for analogix_dp

2015-08-23 Thread Krzysztof Kozlowski
On 24.08.2015 11:42, Yakir Yang wrote:
> Hi Krzysztof,
> 
> 在 08/23/2015 07:43 PM, Krzysztof Kozlowski 写道:
>> 2015-08-24 8:23 GMT+09:00 Rob Herring :
>>> On Wed, Aug 19, 2015 at 9:50 AM, Yakir Yang  wrote:
 Analogix dp driver is split from exynos dp driver, so we just
 make an copy of exynos_dp.txt, and then simplify exynos_dp.txt

 Beside update some exynos dtsi file with the latest change
 according to the devicetree binding documents.
>>> You can't just change the exynos bindings and break compatibility. Is
>>> there some agreement with exynos folks to do this?
>> No, there is no agreement. This wasn't even sent to Exynos maintainers.
> 
> Sorry about this one, actually I have add Exynos maintainers in version
> 1 & version 2,
> but lose some maintainers in version 3, I would fix it in bellow versions.
> 
>> Additionally the patchset did not look interesting to me because of
>> misleading subject - Documentation instead of "ARM: dts:".
>>
>> Yakir, please:
>> 1. Provide backward compatibility. Mark old properties as deprecated
>> but still support them.
> 
> Do you mean that I should keep the old properties declare in exynos-dp.txt,
> but just mark them as deprecated flag.

That is one of ways how to do this. However more important is that
driver should still support old bindings so such code:

-   if (of_property_read_u32(dp_node, "samsung,color-space",
+   if (of_property_read_u32(dp_node, "analogix,color-space",

is probably wrong. Will the driver support old DTB in the same way as it
was supporting before the change?

> Let me show same examples, make
> me understand your suggest rightly.

exynos-dp already contains deprecated properties. Other ways of doing
this would be:
Documentation/devicetree/bindings/input/touchscreen/touchscreen.txt
Documentation/devicetree/bindings/rtc/s3c-rtc.txt

It depends up to you. The "touchscreen" looks good because it organizes
old properties in a common section. In case of exynos-dp.txt you can add
at beginning of file information about new bindings and mark everything
deprecated.

> 
> 1. "samsung,ycbcr-coeff" is abandoned in latest analogix-dp driver,
> absolutely
> I should not carry this to analogix-dp.txt document. But I should
> keep this in
> exynos-dp.txt document, and mark them with an little "deprecated" flag.
> 
> [Documentation/devicetree/bindings/video/exynos_dp.txt]
> Required properties for dp-controller:
>[...]
> -samsung,ycbcr-coeff (DEPRECATED):
> YCbCr co-efficients for input video.
> COLOR_YCBCR601 = 0, COLOR_YCBCR709 = 1
> 
> Is it right ?

Yes, this is right.

> 
>> 2. Separate all DTS changes to a separate patch, unless bisectability
>> would be hurt. Anyway you should prepare it in a such way that
>> separation would be possible without breaking bisectability.
> 
> So I should separate this patch into two parts, one is name "Document:",
> the other is "ARM: dts: ".

Yes.

> 
> Honestly, I don't understand what the "bisectability" means in this case.

I was referring to bisectability in general. The patchset should be
fully bisectable which means that it does not introduce any issues
during "git bisect". This effectively means that at each intermediate
step (after applying each patch, one by one) every existing stuff works
the same as previously without any regression. Including booting with
old DTB.

> 
>> 3. Use proper subject for the patch changing DTS. This is not
>> documentation change!
> 
> Hmm... when I separate this patch into two parts, I though I can keep
> "Documentation" proper subject in this patch, and the other is the "ARM:
> dts"
> proper subject. Am I right ?

Yes, you're right.

> 
>> 4. Please use script get_maintainers to obtain list of valid
>> maintainers and CC-them with at least cover letter and patches
>> requiring their attention.
> 
> Yeah, thanks.

Sure. Now I found older versions of the patchset but previously there
were no changes to the bindings. Again the prefix in subject is
important to easily filter out and find necessary emails.

BTW, I like the patchset because I like in general works which merge
code and reduce duplicate stuff.

Best regards,
Krzysztof


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


Re: linux-next: build failure after merge of the net-next tree

2015-08-23 Thread Stephen Rothwell
Hi Dave,

On Sun, 23 Aug 2015 20:33:25 -0700 (PDT) David Miller  
wrote:
>
> From: Stephen Rothwell 
> Date: Mon, 24 Aug 2015 13:21:11 +1000
> 
> > After merging the net-next tree, today's linux-next build (arm
> > multi_v7_defconfig) failed like this:
> 
> Fixed by:
> 
> 
> [PATCH] route: fix breakage after moving lwtunnel state

Thanks, I will get that tomorrow.  I must try to remember to check to
see if you have added fixes to your tree when I get these errors (not
that it happens all that often).

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


linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

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

  fs/btrfs/inode.c

between commit:

  da2f0f74cf7d ("Btrfs: add support for blkio controllers")

from the btrfs tree and commit:

  b54ffb73cadc ("block: remove bio_get_nr_vecs()")

from the block tree.

I fixed it up (following Chris's example merge - see below) and can
carry the fix as necessary (no action is required).

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

diff --cc fs/btrfs/inode.c
index bda3c41dc9d5,f924d9a62700..
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@@ -7986,12 -7958,7 +7987,11 @@@ out
  static struct bio *btrfs_dio_bio_alloc(struct block_device *bdev,
   u64 first_sector, gfp_t gfp_flags)
  {
-   int nr_vecs = bio_get_nr_vecs(bdev);
 -  return btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 +  struct bio *bio;
-   bio = btrfs_bio_alloc(bdev, first_sector, nr_vecs, gfp_flags);
++  bio = btrfs_bio_alloc(bdev, first_sector, BIO_MAX_PAGES, gfp_flags);
 +  if (bio)
 +  bio_associate_current(bio);
 +  return bio;
  }
  
  static inline int btrfs_lookup_and_bind_dio_csum(struct btrfs_root *root,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

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

  fs/btrfs/scrub.c

between commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")

from the btrfs tree and commit:

  03679ade86b2 ("Btrfs: remove misleading handling of missing device scrub")

from the block tree.

I fixed it up (using Chris' example merge - see below) and can carry
the fix as necessary (no action is required).

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

diff --cc fs/btrfs/scrub.c
index c69c75e7b841,9c146d8307b5..
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@@ -2174,134 -2165,6 +2161,134 @@@ again
return 0;
  }
  
- static void scrub_missing_raid56_end_io(struct bio *bio, int error)
++static void scrub_missing_raid56_end_io(struct bio *bio)
 +{
 +  struct scrub_block *sblock = bio->bi_private;
 +  struct btrfs_fs_info *fs_info = sblock->sctx->dev_root->fs_info;
 +
-   if (error)
++  if (bio->bi_error)
 +  sblock->no_io_error_seen = 0;
 +
 +  btrfs_queue_work(fs_info->scrub_workers, &sblock->work);
 +}
 +
 +static void scrub_missing_raid56_worker(struct btrfs_work *work)
 +{
 +  struct scrub_block *sblock = container_of(work, struct scrub_block, 
work);
 +  struct scrub_ctx *sctx = sblock->sctx;
 +  struct btrfs_fs_info *fs_info = sctx->dev_root->fs_info;
 +  unsigned int is_metadata;
 +  unsigned int have_csum;
 +  u8 *csum;
 +  u64 generation;
 +  u64 logical;
 +  struct btrfs_device *dev;
 +
 +  is_metadata = !(sblock->pagev[0]->flags & BTRFS_EXTENT_FLAG_DATA);
 +  have_csum = sblock->pagev[0]->have_csum;
 +  csum = sblock->pagev[0]->csum;
 +  generation = sblock->pagev[0]->generation;
 +  logical = sblock->pagev[0]->logical;
 +  dev = sblock->pagev[0]->dev;
 +
 +  if (sblock->no_io_error_seen) {
 +  scrub_recheck_block_checksum(fs_info, sblock, is_metadata,
 +   have_csum, csum, generation,
 +   sctx->csum_size);
 +  }
 +
 +  if (!sblock->no_io_error_seen) {
 +  spin_lock(&sctx->stat_lock);
 +  sctx->stat.read_errors++;
 +  spin_unlock(&sctx->stat_lock);
 +  printk_ratelimited_in_rcu(KERN_ERR
 +  "BTRFS: I/O error rebulding logical %llu for dev %s\n",
 +  logical, rcu_str_deref(dev->name));
 +  } else if (sblock->header_error || sblock->checksum_error) {
 +  spin_lock(&sctx->stat_lock);
 +  sctx->stat.uncorrectable_errors++;
 +  spin_unlock(&sctx->stat_lock);
 +  printk_ratelimited_in_rcu(KERN_ERR
 +  "BTRFS: failed to rebuild valid logical %llu for dev 
%s\n",
 +  logical, rcu_str_deref(dev->name));
 +  } else {
 +  scrub_write_block_to_dev_replace(sblock);
 +  }
 +
 +  scrub_block_put(sblock);
 +
 +  if (sctx->is_dev_replace &&
 +  atomic_read(&sctx->wr_ctx.flush_all_writes)) {
 +  mutex_lock(&sctx->wr_ctx.wr_lock);
 +  scrub_wr_submit(sctx);
 +  mutex_unlock(&sctx->wr_ctx.wr_lock);
 +  }
 +
 +  scrub_pending_bio_dec(sctx);
 +}
 +
 +static void scrub_missing_raid56_pages(struct scrub_block *sblock)
 +{
 +  struct scrub_ctx *sctx = sblock->sctx;
 +  struct btrfs_fs_info *fs_info = sctx->dev_root->fs_info;
 +  u64 length = sblock->page_count * PAGE_SIZE;
 +  u64 logical = sblock->pagev[0]->logical;
 +  struct btrfs_bio *bbio;
 +  struct bio *bio;
 +  struct btrfs_raid_bio *rbio;
 +  int ret;
 +  int i;
 +
 +  ret = btrfs_map_sblock(fs_info, REQ_GET_READ_MIRRORS, logical, &length,
 + &bbio, 0, 1);
 +  if (ret || !bbio || !bbio->raid_map)
 +  goto bbio_out;
 +
 +  if (WARN_ON(!sctx->is_dev_replace ||
 +  !(bbio->map_type & BTRFS_BLOCK_GROUP_RAID56_MASK))) {
 +  /*
 +   * We shouldn't be scrubbing a missing device. Even for dev
 +   * replace, we should only get here for RAID 5/6. We either
 +   * managed to mount something with no mirrors remaining or
 +   * there's a bug in scrub_remap_extent()/btrfs_map_block().
 +   */
 +  goto bbio_out;
 +  }
 +
 +  bio = btrfs_io_bio_alloc(GFP_NOFS, 0);
 +  if (!bio)
 +  goto bbio_out;
 +
 +  bio->bi_iter.bi_sector = logical >> 9;
 +  bio->bi_private = sblock;
 +  bio->bi_end_io = scrub_missing_raid56_end_io;
 +
 +  rbio = raid56_alloc_missing_rbio(sctx->dev_root, bio, bbio, length);
 +  if (!rbio)
 +  goto rbio_out;
 +
 +  for (i = 0; i < sblock->page_count; i++) {
 +  struct scrub_page *spage = sblock->pagev[i];
 +
 +  raid56_add_scrub_pages(rbio, spage->page, spage->logical);
 +  }
 +
 +

linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

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

  fs/btrfs/raid56.c

between commit:

  b4ee1782686d ("Btrfs: add RAID 5/6 BTRFS_RBIO_REBUILD_MISSING operation")

from the btrfs tree and commit:

  4246a0b63bd8 ("block: add a bi_error field to struct bio")

from the block tree.

I fixed it up (using Chris's example merge - see below) and can carry
the fix as necessary (no action is required).

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

diff --cc fs/btrfs/raid56.c
index 6fe2613ef288,0a02e24900aa..
--- a/fs/btrfs/raid56.c
+++ b/fs/btrfs/raid56.c
@@@ -1975,9 -1960,7 +1971,9 @@@ cleanup_io
else
clear_bit(RBIO_CACHE_READY_BIT, &rbio->flags);
  
-   rbio_orig_end_io(rbio, err, err == 0);
+   rbio_orig_end_io(rbio, err);
 +  } else if (rbio->operation == BTRFS_RBIO_REBUILD_MISSING) {
-   rbio_orig_end_io(rbio, err, err == 0);
++  rbio_orig_end_io(rbio, err);
} else if (err == 0) {
rbio->faila = -1;
rbio->failb = -1;
@@@ -2114,9 -2096,8 +2109,9 @@@ out
return 0;
  
  cleanup:
 -  if (rbio->operation == BTRFS_RBIO_READ_REBUILD)
 +  if (rbio->operation == BTRFS_RBIO_READ_REBUILD ||
 +  rbio->operation == BTRFS_RBIO_REBUILD_MISSING)
-   rbio_orig_end_io(rbio, -EIO, 0);
+   rbio_orig_end_io(rbio, -EIO);
return -EIO;
  }
  
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


linux-next: manual merge of the block tree with the btrfs tree

2015-08-23 Thread Stephen Rothwell
Hi Jens,

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

  fs/btrfs/volumes.c

between commits:

  da2f0f74cf7d ("Btrfs: add support for blkio controllers")
  3a9508b0221d ("btrfs: fix compile when block cgroups are not enabled")

from the btrfs tree and commit:

  0e28997ec476 ("btrfs: remove bio splitting and merge_bvec_fn() calls")

from the block tree.

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

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


Re: drm/layerscape: Add Freescale DCU DRM driver

2015-08-23 Thread Jianwei Wang
Hi Andreas,

Sorry for the late reply. Yes, this driver should also work on the
arm64 SOCs using DCU in the future. So I did some prepare for adapting
arm64 SOCs. But for now, It only support 32bit arm SOCs.

Regards,

Jianwei.

On Fri, Aug 21, 2015 at 9:41 PM, Andreas Ruprecht
 wrote:
> Hi Jianwei,
>
> your commit 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM
> driver") showed up in linux-next today (i.e., next-20150821). I noticed
> it because we are running a daily analysis on the newest linux-next tree
> as part of our research.
>
> In the source code of fsl_dcu_drm_drv.c, there is the following #ifdef:
>  #ifdef CONFIG_COMPAT
> .compat_ioctl   = drm_compat_ioctl,
>  #endif
>
> The Kconfig option for the driver, however, states that the driver can
> only be built with CONFIG_ARM enabled:
>
> config DRM_FSL_DCU
>tristate "DRM Support for Freescale DCU"
>depends on DRM && OF && ARM
>[...]
>
> Inside arch/arm/, however, there is no definition of CONFIG_COMPAT (note
> that there is one in arch/arm64/, but the driver explicitely needs
> CONFIG_ARM), so the #ifdef block above can never be compiled in the
> current state. Is this intended?
>
> Regards,
>
> Andreas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: drm/layerscape: Add Freescale DCU DRM driver

2015-08-23 Thread Jianwei Wang
On Fri, Aug 21, 2015 at 9:41 PM, Andreas Ruprecht
 wrote:
> Hi Jianwei,
>
> your commit 109eee2f2a18 ("drm/layerscape: Add Freescale DCU DRM
> driver") showed up in linux-next today (i.e., next-20150821). I noticed
> it because we are running a daily analysis on the newest linux-next tree
> as part of our research.
>
> In the source code of fsl_dcu_drm_drv.c, there is the following #ifdef:
>  #ifdef CONFIG_COMPAT
> .compat_ioctl   = drm_compat_ioctl,
>  #endif
>
> The Kconfig option for the driver, however, states that the driver can
> only be built with CONFIG_ARM enabled:
>
> config DRM_FSL_DCU
>tristate "DRM Support for Freescale DCU"
>depends on DRM && OF && ARM
>[...]
>
> Inside arch/arm/, however, there is no definition of CONFIG_COMPAT (note
> that there is one in arch/arm64/, but the driver explicitely needs
> CONFIG_ARM), so the #ifdef block above can never be compiled in the
> current state. Is this intended?
>
> Regards,
>
> Andreas


Hi Andreas,

Sorry for the late reply. Yes, this driver should also work on the
arm64 SOCs using DCU in the future. So I did some prepare for adapting
arm64 SOCs. But for now, It only support 32bit arm SOCs.

Regards,

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


Re: [PATCH 2/7] selftests: add CFLAGS_EXTRA

2015-08-23 Thread Michael Ellerman
On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> One may pass the "-I /path/to/headers -L /path/to/lib" through
> CFLAGS_EXTRA for cross compiling. mqueue could compile pass
> in this way when we provide the popt.h and libpopt.so. And kdbus
> could compile pass with sys/capability and libcap.so

There should be no need to define a new variable.

You should just update the relevant Makefiles to use CFLAGS += rather than
CFLAGS =. And then you can just specifiy CFLAGS on the command line.

cheers


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


Re: [PATCH 5/7] selftests: disable seccomp for arm64

2015-08-23 Thread Michael Ellerman
On Fri, 2015-08-14 at 21:43 +0800, Bamvor Jian Zhang wrote:
> Currently, seccomp need the __NR_poll which is not supported
> by arm64(There is only __NR_ppoll). I am not sure we should
> skip this test testcase or update the seccomp without __NR_poll.

You should fix or skip the test that needs __NR_poll, not skip the entire test
suite.

You should also CC the author of the tests, they might be able to help you.

cheers



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


Re: [PATCH] net/wireless: enable wiphy device to suspend/resume asynchronously

2015-08-23 Thread Fu, Zhonghui


On 2015/8/17 16:46, Arend van Spriel wrote:
> + Rafael
>
> On 08/17/2015 09:29 AM, Johannes Berg wrote:
>> On Mon, 2015-08-17 at 09:48 +0800, Fu, Zhonghui wrote:
>>>
>>> The suspend/resume timing of wiphy device and related devices will be
>>> ensured by their parent/child relationship. So, enabling wiphy device
>>> to suspend/resume asynchronously does not change any  dependency. It
>>> can only take advantage of multicore and improve system
>>> suspend/resume speed.
>>>
>>
>> You're going to have to explain that to me, because I don't see that.
>> All I see is that when looking at a device, if async is possible, it
>> gets added to an async work, and if async is not possible then it gets
>> done immediately. Even putting aside the question of whether or not
>> async is ordered or not (I don't know), if the wiphy is async and the
>> PCI (or other bus) device isn't, then it seems they could get handled
>> out of order, no? Or is there some magic code somewhere that I'm
>> missing that explicitly waits for the async of the parent/child
>> relationship?
>
> This patch got me worried as well. Can't find the magic either. Maybe Rafael 
> can give some hints here.

"dpm_wait_for_children" function will be invoked in "__device_suspend", 
"__device_suspend_late", and "__device_suspend_noirq" functions to synchronize 
the child relationship. "dpm_wait" function will be invoked in 
"device_resume_noirq", "device_resume_early", and "device_resume" functions to 
synchronize the parent relationship. If two devices have parent/child 
relationship, but different suspend/resume mode(sync or async), this will have 
no impact to PM timing order between them. Because all devices will use 
"__device_suspend", "__device_suspend_late" ... functions to complete their PM 
transition.


Thanks,
Zhonghui 
>
> Regards,
> Arend
>
>> johannes
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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


[PATCH v3 2/4] spi: mediatek: replace int with u32, delete TAB and define MTK_SPI_PAUSE_INT_STATUS marco

2015-08-23 Thread Leilk Liu
this patch replaces int with u32, deletes TAB, and defines
MTK_SPI_PAUSE_INT_STATUS marco.

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index fe4eda3..f81618c 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -67,6 +67,8 @@
 
 #define MT8173_SPI_MAX_PAD_SEL 3
 
+#define MTK_SPI_PAUSE_INT_STATUS 0x2
+
 #define MTK_SPI_IDLE 0
 #define MTK_SPI_PAUSED 1
 
@@ -179,7 +181,7 @@ static int mtk_spi_prepare_hardware(struct spi_master 
*master)
 
trans = list_first_entry(&msg->transfers, struct spi_transfer,
 transfer_list);
-   if (trans->cs_change == 0) {
+   if (!trans->cs_change) {
mdata->state = MTK_SPI_IDLE;
mtk_spi_reset(mdata);
}
@@ -269,11 +271,11 @@ static void mtk_spi_setup_packet(struct spi_master 
*master)
u32 packet_size, packet_loop, reg_val;
struct mtk_spi *mdata = spi_master_get_devdata(master);
 
-   packet_size = min_t(unsigned, mdata->xfer_len, MTK_SPI_PACKET_SIZE);
+   packet_size = min_t(u32, mdata->xfer_len, MTK_SPI_PACKET_SIZE);
packet_loop = mdata->xfer_len / packet_size;
 
reg_val = readl(mdata->base + SPI_CFG1_REG);
-   reg_val &= ~(SPI_CFG1_PACKET_LENGTH_MASK + SPI_CFG1_PACKET_LOOP_MASK);
+   reg_val &= ~(SPI_CFG1_PACKET_LENGTH_MASK | SPI_CFG1_PACKET_LOOP_MASK);
reg_val |= (packet_size - 1) << SPI_CFG1_PACKET_LENGTH_OFFSET;
reg_val |= (packet_loop - 1) << SPI_CFG1_PACKET_LOOP_OFFSET;
writel(reg_val, mdata->base + SPI_CFG1_REG);
@@ -281,7 +283,7 @@ static void mtk_spi_setup_packet(struct spi_master *master)
 
 static void mtk_spi_enable_transfer(struct spi_master *master)
 {
-   int cmd;
+   u32 cmd;
struct mtk_spi *mdata = spi_master_get_devdata(master);
 
cmd = readl(mdata->base + SPI_CMD_REG);
@@ -292,9 +294,9 @@ static void mtk_spi_enable_transfer(struct spi_master 
*master)
writel(cmd, mdata->base + SPI_CMD_REG);
 }
 
-static int mtk_spi_get_mult_delta(int xfer_len)
+static int mtk_spi_get_mult_delta(u32 xfer_len)
 {
-   int mult_delta;
+   u32 mult_delta;
 
if (xfer_len > MTK_SPI_PACKET_SIZE)
mult_delta = xfer_len % MTK_SPI_PACKET_SIZE;
@@ -435,7 +437,7 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)
struct spi_transfer *trans = mdata->cur_transfer;
 
reg_val = readl(mdata->base + SPI_STATUS0_REG);
-   if (reg_val & 0x2)
+   if (reg_val & MTK_SPI_PAUSE_INT_STATUS)
mdata->state = MTK_SPI_PAUSED;
else
mdata->state = MTK_SPI_IDLE;
@@ -498,7 +500,7 @@ static int mtk_spi_probe(struct platform_device *pdev)
struct mtk_spi *mdata;
const struct of_device_id *of_id;
struct resource *res;
-   int irq, ret;
+   int irq, ret;
 
master = spi_alloc_master(&pdev->dev, sizeof(*mdata));
if (!master) {
-- 
1.8.1.1.dirty

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


[PATCH v3 3/4] spi: mediatek: add PM clk_prepare_enable fail flow

2015-08-23 Thread Leilk Liu
This patch adds PM clk_prepare_enable fail flow.

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index f81618c..e14f583 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -665,8 +665,10 @@ static int mtk_spi_resume(struct device *dev)
 
if (!pm_runtime_suspended(dev)) {
ret = clk_prepare_enable(mdata->spi_clk);
-   if (ret < 0)
+   if (ret < 0) {
+   dev_err(dev, "failed to enable spi_clk (%d)\n", ret);
return ret;
+   }
}
 
ret = spi_master_resume(master);
@@ -692,8 +694,15 @@ static int mtk_spi_runtime_resume(struct device *dev)
 {
struct spi_master *master = dev_get_drvdata(dev);
struct mtk_spi *mdata = spi_master_get_devdata(master);
+   int ret;
+
+   ret = clk_prepare_enable(mdata->spi_clk);
+   if (ret < 0) {
+   dev_err(dev, "failed to enable spi_clk (%d)\n", ret);
+   return ret;
+   }
 
-   return clk_prepare_enable(mdata->spi_clk);
+   return 0;
 }
 #endif /* CONFIG_PM */
 
-- 
1.8.1.1.dirty

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


[PATCH v3 4/4] spi: mediatek: replace *_time name

2015-08-23 Thread Leilk Liu
This patch replaces *_time name in mtk_spi_prepare_transfer().

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index e14f583..eaadc7e 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -238,8 +238,7 @@ static void mtk_spi_set_cs(struct spi_device *spi, bool 
enable)
 static void mtk_spi_prepare_transfer(struct spi_master *master,
 struct spi_transfer *xfer)
 {
-   u32 spi_clk_hz, div, high_time, low_time, holdtime,
-   setuptime, cs_idletime, reg_val = 0;
+   u32 spi_clk_hz, div, sck_time, cs_time, reg_val = 0;
struct mtk_spi *mdata = spi_master_get_devdata(master);
 
spi_clk_hz = clk_get_rate(mdata->spi_clk);
@@ -248,21 +247,18 @@ static void mtk_spi_prepare_transfer(struct spi_master 
*master,
else
div = 1;
 
-   high_time = (div + 1) / 2;
-   low_time = (div + 1) / 2;
-   holdtime = (div + 1) / 2 * 2;
-   setuptime = (div + 1) / 2 * 2;
-   cs_idletime = (div + 1) / 2 * 2;
+   sck_time = (div + 1) / 2;
+   cs_time = sck_time * 2;
 
-   reg_val |= (((high_time - 1) & 0xff) << SPI_CFG0_SCK_HIGH_OFFSET);
-   reg_val |= (((low_time - 1) & 0xff) << SPI_CFG0_SCK_LOW_OFFSET);
-   reg_val |= (((holdtime - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
-   reg_val |= (((setuptime - 1) & 0xff) << SPI_CFG0_CS_SETUP_OFFSET);
+   reg_val |= (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_HIGH_OFFSET);
+   reg_val |= (((sck_time - 1) & 0xff) << SPI_CFG0_SCK_LOW_OFFSET);
+   reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG0_CS_HOLD_OFFSET);
+   reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG0_CS_SETUP_OFFSET);
writel(reg_val, mdata->base + SPI_CFG0_REG);
 
reg_val = readl(mdata->base + SPI_CFG1_REG);
reg_val &= ~SPI_CFG1_CS_IDLE_MASK;
-   reg_val |= (((cs_idletime - 1) & 0xff) << SPI_CFG1_CS_IDLE_OFFSET);
+   reg_val |= (((cs_time - 1) & 0xff) << SPI_CFG1_CS_IDLE_OFFSET);
writel(reg_val, mdata->base + SPI_CFG1_REG);
 }
 
-- 
1.8.1.1.dirty

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


[PATCHi v3 0/4] Fixup mediatek spi driver

2015-08-23 Thread Leilk Liu
From: Leilk Liu 

This series are based on 4.2-rc1 and provide four patches to fix mediatek spi 
driver.

Change in v3:
1. The follow patches are applied, so remove them from series:
  - spi: mediatek: fix spi incorrect endian usage
  - spi: medaitek: revise quirks compatibility style
  - spi: mediatek: use BIT() to instead of SPI_CMD_*_OFFSET
2. The patch "spi: mediatek: revise coding style" title is not clear, so split 
it to four patches.

Change in v2:
1. The patch "spi: mediatek: remove redundant clock in 
prepare_hardware/unprepare_hardware" 
   is applied, so remove it from series.
2. fix incorrect endian usage to support little-endian and big-endian system.
3. revise quirks style to bool.
4. use BIT() to instead of SPI_CMD_*_OFFSET.
5. revise coding style, such as time name, and variable type. 

Leilk Liu (4):
  spi: mediatek: add linux/io.h include file
  spi: mediatek: replace int with u32, delete TAB and define
MTK_SPI_PAUSE_INT_STATUS marco
  spi: mediatek: add PM clk_prepare_enable fail flow
  spi: mediatek: replace *_time name

 drivers/spi/spi-mt65xx.c | 52 
 1 file changed, 30 insertions(+), 22 deletions(-)

--
1.8.1.1.dirty

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


[PATCH v3 1/4] spi: mediatek: add linux/io.h include file

2015-08-23 Thread Leilk Liu
mediatek spi driver uses readl/writel, so add linux/io.h,
even so it's implicitly imported by spi/spi.h

Signed-off-by: Leilk Liu 
---
 drivers/spi/spi-mt65xx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c
index 43c1dd5..fe4eda3 100644
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -16,6 +16,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
1.8.1.1.dirty

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


drm/radeon: take the mode_config mutex when dealing with hpds (v2) crashes

2015-08-23 Thread Joerg Platte

Dear Alex,

on my old P4 based non-SMP router your patch (commit 
32d12fc20e3c726ca858d0e5055fb596fce2f8bc in linux stable) crashes on 
Linux 4.1.4 and above. I was only able to take a picture of the whole 
trace https://ferdi.naasa.net/url/jplatte/IMG_3116.JPG


Reverting the patch resolves the issue.

This is my old graphics hardware:
01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. 
[AMD/ATI] RV100 [Radeon 7000 / Radeon VE]


Just for the reference, here is the full patch:
commit 32d12fc20e3c726ca858d0e5055fb596fce2f8bc
Author: Alex Deucher 
Date:   Fri May 15 11:48:52 2015 -0400

drm/radeon: take the mode_config mutex when dealing with hpds (v2)

commit 39fa10f7e21574a70cecf1fed0f9b36535aa68a0 upstream.

Since we are messing with state in the worker.

v2: drop the changes in the mst worker

Signed-off-by: Alex Deucher 
Signed-off-by: Greg Kroah-Hartman 

diff --git a/drivers/gpu/drm/radeon/radeon_irq_kms.c 
b/drivers/gpu/drm/radeon/radeon_irq_kms.c

index 7162c93..f682e53 100644
--- a/drivers/gpu/drm/radeon/radeon_irq_kms.c
+++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c
@@ -79,10 +79,12 @@ static void radeon_hotplug_work_func(struct 
work_struct *work)

struct drm_mode_config *mode_config = &dev->mode_config;
struct drm_connector *connector;

+   mutex_lock(&mode_config->mutex);
if (mode_config->num_connector) {
list_for_each_entry(connector, 
&mode_config->connector_list, head)

radeon_connector_hotplug(connector);
}
+   mutex_unlock(&mode_config->mutex);
/* Just fire off a uevent and let userspace tell us what to do */
drm_helper_hpd_irq_event(dev);
 }

Is it possible that the mutex is not defined on non-SMP systems? Can you 
help to resolve this regression?


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


Re: linux-next: build failure after merge of the net-next tree

2015-08-23 Thread David Miller
From: Stephen Rothwell 
Date: Mon, 24 Aug 2015 13:21:11 +1000

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

Fixed by:


[PATCH] route: fix breakage after moving lwtunnel state

__recnt and related fields need to be in its own cacheline for performance
reasons. Commit 61adedf3e3f1 ("route: move lwtunnel state to dst_entry")
broke that on 32bit archs, causing BUILD_BUG_ON in dst_hold to be triggered.

This patch fixes the breakage by moving the lwtunnel state to the end of
dst_entry on 32bit archs. Unfortunately, this makes it share the cacheline
with __refcnt and may affect performance, thus further patches may be
needed.

Reported-by: kbuild test robot 
Fixes: 61adedf3e3f1 ("route: move lwtunnel state to dst_entry")
Signed-off-by: Jiri Benc 
Signed-off-by: David S. Miller 
---
 include/net/dst.h | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index 0a9a723..ef8f1d4 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -44,7 +44,6 @@ struct dst_entry {
 #else
void*__pad1;
 #endif
-   struct lwtunnel_state   *lwtstate;
int (*input)(struct sk_buff *);
int (*output)(struct sock *sk, struct sk_buff *skb);
 
@@ -85,11 +84,12 @@ struct dst_entry {
__u32   __pad2;
 #endif
 
+#ifdef CONFIG_64BIT
+   struct lwtunnel_state   *lwtstate;
/*
 * Align __refcnt to a 64 bytes alignment
 * (L1_CACHE_SIZE would be too much)
 */
-#ifdef CONFIG_64BIT
long__pad_to_align_refcnt[1];
 #endif
/*
@@ -99,6 +99,9 @@ struct dst_entry {
atomic_t__refcnt;   /* client references*/
int __use;
unsigned long   lastuse;
+#ifndef CONFIG_64BIT
+   struct lwtunnel_state   *lwtstate;
+#endif
union {
struct dst_entry*next;
struct rtable __rcu *rt_next;
-- 
2.1.0

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


Re: [PATCH 1/2] watchdog: bcm7038: add device tree binding documentation

2015-08-23 Thread Guenter Roeck

Hi Justin,

On 08/20/2015 10:41 AM, Justin Chen wrote:

Add device tree binding docmentation for the watchdog hardware block
on bcm7038 and newer SoCs.

Signed-off-by: Justin Chen 
---
  .../devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt | 19 +++
  1 file changed, 19 insertions(+)
  create mode 100644 
Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt

diff --git a/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt 
b/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt
new file mode 100644
index 000..adb8260
--- /dev/null
+++ b/Documentation/devicetree/bindings/watchdog/brcm,bcm7038-wdt.txt
@@ -0,0 +1,19 @@
+BCM7038 Watchdog timer
+
+Required properties:
+
+- compatible : should be "brcm,bcm7038-wdt"
+- reg : Specifies base physical address and size of the registers.
+
+Optional properties:
+
+- clocks: the clock running the watchdog
+- clock-frequency: the rate of the clock


Is 'clock-frequency' really needed (and useful), or would it make more sense
to expect the user to configure a fixed clock if nothing else is available ?
How do other drivers handle this ?

Thanks,
Guenter


+
+Example:
+
+watchdog {
+   compatible = "brcm,bcm7038-wdt";
+   clocks = <&upg_fixed>;
+   reg = <0xf040a7e8 0x16>;
+};



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


Re: is this a problem of numactl in RedHat7.0 ?

2015-08-23 Thread Xishi Qiu
On 2015/8/22 4:53, Rik van Riel wrote:

> On 08/21/2015 05:27 AM, Xishi Qiu wrote:
>> I use numactl(--localalloc) tool run a test case, but it shows that
>> the numa policy is prefer, I don't know why.
> 
> The kernel implements MPOL_PREFERRED and MPOL_LOCAL
> in the same way. Look at this code in mpol_new(),
> in mm/mempolicy.c:
> 
> /*
>  * MPOL_PREFERRED cannot be used with MPOL_F_STATIC_NODES or
>  * MPOL_F_RELATIVE_NODES if the nodemask is empty (local allocation).
>  * All other modes require a valid pointer to a non-empty nodemask.
>  */
> if (mode == MPOL_PREFERRED) {
> if (nodes_empty(*nodes)) {
> if (((flags & MPOL_F_STATIC_NODES) ||
>  (flags & MPOL_F_RELATIVE_NODES)))
> return ERR_PTR(-EINVAL);
> }
> } else if (mode == MPOL_LOCAL) {
> if (!nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> mode = MPOL_PREFERRED;
> } else if (nodes_empty(*nodes))
> return ERR_PTR(-EINVAL);
> 

Hi Rik,

Thank you for your reply. I find the reason is this patch,
and it is not backport to RedHat 7.0

8790c71a18e5d2d93532ae250bcf5eddbba729cd

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 873de7e..ae3c8f3 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2930,7 +2930,7 @@ void mpol_to_str(char *buffer, int maxlen, struct 
mempolicy *pol)
unsigned short mode = MPOL_DEFAULT;
unsigned short flags = 0;

-   if (pol && pol != &default_policy) {
+   if (pol && pol != &default_policy && !(pol->flags & MPOL_F_MORON)) {
mode = pol->mode;
flags = pol->flags;
}

Thanks,
Xishi Qiu

> 
> 
> 



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


Re: [PATCH 2/3] kvm: don't register wildcard MMIO EVENTFD on two buses

2015-08-23 Thread Jason Wang


On 08/21/2015 05:29 PM, Cornelia Huck wrote:
> On Fri, 21 Aug 2015 16:03:52 +0800
> Jason Wang  wrote:
>
>
>> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
>> index 9ff4193..834a409 100644
>> --- a/virt/kvm/eventfd.c
>> +++ b/virt/kvm/eventfd.c
>> @@ -838,11 +838,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct 
>> kvm_ioeventfd *args)
>>  
>>  kvm_iodevice_init(&p->dev, &ioeventfd_ops);
>>  
>> -ret = kvm_io_bus_register_dev(kvm, bus_idx, p->addr, p->length,
>> -  &p->dev);
>> -if (ret < 0)
>> -goto unlock_fail;
>> -
>>  /* When length is ignored, MMIO is also put on a separate bus, for
>>   * faster lookups.
> You probably want to change this comment as well?

Yes.

>
>>   */
>> @@ -850,9 +845,15 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct 
>> kvm_ioeventfd *args)
> Unfortunately snipped by diff, but the check here is on !len && !PIO,
> which only does the desired thing as VIRTIO_CCW always uses len == 8.
> Should the check be for !len && MMIO instead?

I think the answer depends on whether len == 0 is valid for ccw. If not
we can fail the assign earlier. Since even without this patch, if
userspace tries to register a dev with len equals to zero, it will also
be registered to KVM_FAST_MMIO_BUS. If yes, we need check as you
suggested here.

>
>>  ret = kvm_io_bus_register_dev(kvm, KVM_FAST_MMIO_BUS,
>>p->addr, 0, &p->dev);
>>  if (ret < 0)
>> -goto register_fail;
>> +goto unlock_fail;
>> +} else {
>> +ret = kvm_io_bus_register_dev(kvm, bus_idx, p->addr, p->length,
>> +  &p->dev);
>> +if (ret < 0)
>> +goto unlock_fail;
>>  }
> Hm... maybe the following would be more obvious:
>
> my_bus = (p->length == 0) && (bus_idx == KVM_MMIO_BUS) ? KVM_FAST_MMIO_BUS : 
> bus_idx;
> ret = kvm_io_bus_register_dev(kvm, my_bus, p->addr, p->length, &pdev->dev); 
>
>>  
>> +
>>  kvm->buses[bus_idx]->ioeventfd_count++;
>>  list_add_tail(&p->list, &kvm->ioeventfds);
> (...)
>
>> @@ -900,10 +899,11 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct 
>> kvm_ioeventfd *args)
>>  if (!p->wildcard && p->datamatch != args->datamatch)
>>  continue;
>>  
>> -kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev);
>>  if (!p->length) {
>>  kvm_io_bus_unregister_dev(kvm, KVM_FAST_MMIO_BUS,
>>&p->dev);
>> +} else {
>> +kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev);
>>  }
> Similar comments here... do you want to check for bus_idx ==
> KVM_MMIO_BUS as well?

Good catch. I think keep the original code as is will be also ok to
solve this. (with changing the bus_idx to KVM_FAST_MMIO_BUS during
registering if it was an wildcard mmio).

>
>>  kvm->buses[bus_idx]->ioeventfd_count--;
>>  ioeventfd_release(p);

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


Re: [PATCH 2/2] watchdog: Watchdog driver for Broadcom Set-Top Box

2015-08-23 Thread Guenter Roeck

Hi Justin,

On 08/20/2015 10:41 AM, Justin Chen wrote:

Watchdog driver for Broadcom 7038 and newer chips.

Signed-off-by: Justin Chen 


Looks pretty good. Couple of comments below.

Thanks,
Guenter


---
  drivers/watchdog/Kconfig   |   8 ++
  drivers/watchdog/Makefile  |   1 +
  drivers/watchdog/bcm7038_wdt.c | 253 +
  3 files changed, 262 insertions(+)
  create mode 100644 drivers/watchdog/bcm7038_wdt.c

diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index 241fafd..4fbe8ab 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -1291,6 +1291,14 @@ config BCM_KONA_WDT_DEBUG

  If in doubt, say 'N'.

+config BCM7038_WDT
+   tristate "BCM7038 Watchdog"
+   select WATCHDOG_CORE
+   help
+Watchdog driver for the built-in hardware in Broadcom 7038 SoCs.
+
+Say 'Y or 'M' here to enable the driver.
+
  config IMGPDC_WDT
tristate "Imagination Technologies PDC Watchdog Timer"
depends on HAS_IOMEM
diff --git a/drivers/watchdog/Makefile b/drivers/watchdog/Makefile
index 59ea9a1..65d4169 100644
--- a/drivers/watchdog/Makefile
+++ b/drivers/watchdog/Makefile
@@ -66,6 +66,7 @@ obj-$(CONFIG_TEGRA_WATCHDOG) += tegra_wdt.o
  obj-$(CONFIG_MESON_WATCHDOG) += meson_wdt.o
  obj-$(CONFIG_MEDIATEK_WATCHDOG) += mtk_wdt.o
  obj-$(CONFIG_DIGICOLOR_WATCHDOG) += digicolor_wdt.o
+obj-$(CONFIG_BCM7038_WDT) += bcm7038_wdt.o


Can you try to insert this in alphabetic order ?


  # AVR32 Architecture
  obj-$(CONFIG_AT32AP700X_WDT) += at32ap700x_wdt.o
diff --git a/drivers/watchdog/bcm7038_wdt.c b/drivers/watchdog/bcm7038_wdt.c
new file mode 100644
index 000..a70730b
--- /dev/null
+++ b/drivers/watchdog/bcm7038_wdt.c
@@ -0,0 +1,253 @@
+/*
+ * Copyright (C) 2015 Broadcom Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+

Please order include files in alphabetic order.


+#define WDT_START_10xff00
+#define WDT_START_20x00ff
+#define WDT_STOP_1 0xee00
+#define WDT_STOP_2 0x00ee
+
+#define WDT_TIMEOUT_REG0x0
+#define WDT_CMD_REG0x4
+
+#define WDT_MIN_TIMEOUT1 /* seconds */
+#define WDT_DEFAULT_TIMEOUT30 /* seconds */
+#define WDT_DEFAULT_RATE   2700
+
+struct bcm7038_watchdog {
+   void __iomem*reg;


'base' would be a better name for this variable.


+   struct clk  *wdt_clk;
+   struct watchdog_device  wdd;
+   u32 hz;


How about "rate" ?


+};
+
+static bool nowayout = WATCHDOG_NOWAYOUT;
+
+static unsigned long bcm7038_wdt_get_rate(struct bcm7038_watchdog *wdt)
+{
+   /* if clock is missing return hz */
+   if (!wdt->wdt_clk)
+   return wdt->hz;
+
+   return clk_get_rate(wdt->wdt_clk);
+

Unnecessary empty line.

This is unnecessary complex. See below.


+}
+
+static void bcm7038_wdt_set_timeout_reg(struct watchdog_device *wdog)
+{
+   struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog);
+   u32 timeout;
+
+   timeout = bcm7038_wdt_get_rate(wdt) * wdog->timeout;
+
+   writel(timeout, wdt->reg + WDT_TIMEOUT_REG);
+}
+
+static int bcm7038_wdt_ping(struct watchdog_device *wdog)
+{
+   struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog);
+
+   writel(WDT_START_1, wdt->reg + WDT_CMD_REG);
+   writel(WDT_START_2, wdt->reg + WDT_CMD_REG);
+
+   return 0;
+}
+
+static int bcm7038_wdt_start(struct watchdog_device *wdog)
+{
+   bcm7038_wdt_set_timeout_reg(wdog);
+   bcm7038_wdt_ping(wdog);
+
+   return 0;
+}
+
+static int bcm7038_wdt_stop(struct watchdog_device *wdog)
+{
+   struct bcm7038_watchdog *wdt = watchdog_get_drvdata(wdog);
+
+   writel(WDT_STOP_1, wdt->reg + WDT_CMD_REG);
+   writel(WDT_STOP_2, wdt->reg + WDT_CMD_REG);
+
+   return 0;
+}
+
+static int bcm7038_wdt_set_timeout(struct watchdog_device *wdog,
+   unsigned int t)


Please align continuation lines to '('.


+{
+   if (watchdog_timeout_invalid(wdog, t))
+   return -EINVAL;
+

Unnecessary; checked by infrastructure.


+   /* Can't modify timeout value if watchdog timer is running */
+   bcm7038_wdt_stop(wdog);
+   wdog->timeout = t;
+   bcm7038_wdt_start(wdog);
+
+   return 0;
+}
+
+static unsigned int bcm7038_wdt_get_timeleft(struct watchdog_device *wdog)

RE: [PATCH] [v2] x86, suspend: Save/restore extra MSR registers for suspend

2015-08-23 Thread Chen, Yu C
Hi, Pavel,
> Plus, I acked V2 when V3 was available.
> 
V3 is to only save/restore THERM_CONTRO msr,  
so I think I'll do some check based on V2, It is more extensible.
Thanks,
Best Regards,
Yu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v1 3/3] arm64: dts: add Hi6220 mailbox node

2015-08-23 Thread Leo Yan
Hi Mark,

On Sat, Aug 22, 2015 at 09:30:50PM +0800, Leo Yan wrote:
> On Fri, Aug 21, 2015 at 07:40:59PM +0100, Mark Rutland wrote:
> > On Wed, Aug 19, 2015 at 10:37:35AM +0100, Leo Yan wrote:
> > > On Hi6220, below memory regions in DDR have specific purpose:
> > > 
> > >   0x05e0, - 0x05ef,: For MCU firmware using at runtime;
> > >   0x0740,f000 - 0x0740,: For MCU firmware's section;
> > >   0x06df,f000 - 0x06df,: For mailbox message data.
> > > 
> > > This patch reserves these memory regions and add device node for
> > > mailbox in dts.
> > > 
> > > Signed-off-by: Leo Yan 
> > > ---
> > >  arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts | 20 +---
> > >  arch/arm64/boot/dts/hisilicon/hi6220.dtsi  |  8 
> > >  2 files changed, 25 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts 
> > > b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> > > index e36a539..d5470d3 100644
> > > --- a/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> > > +++ b/arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts
> > > @@ -7,9 +7,6 @@
> > >  
> > >  /dts-v1/;
> > >  
> > > -/*Reserved 1MB memory for MCU*/
> > > -/memreserve/ 0x05e0 0x0010;
> > > -
> > >  #include "hi6220.dtsi"
> > >  
> > >  / {
> > > @@ -28,4 +25,21 @@
> > >   device_type = "memory";
> > >   reg = <0x0 0x0 0x0 0x4000>;
> > >   };
> > > +
> > > + reserved-memory {
> > > + #address-cells = <2>;
> > > + #size-cells = <2>;
> > > + ranges;
> > > +
> > > + mcu-buf@05e0 {
> > > + no-map;
> > > + reg = <0x0 0x05e0 0x0 0x0010>,  /* MCU firmware 
> > > buffer */
> > > +   <0x0 0x0740f000 0x0 0x1000>;  /* MCU firmware 
> > > section */
> > > + };
> > > +
> > > + mbox-buf@06dff000 {
> > > + no-map;
> > > + reg = <0x0 0x06dff000 0x0 0x1000>;  /* Mailbox 
> > > message buf */
> > > + };
> > > + };
> > 
> > As far as I can see, it would be simpler to simply carve these out of the
> > memory node.
> 
> Will modify for MCU firmware buffer and section.
> 
> > I don't see why you need reserved-memory here, given you're not referring to
> > these regions by phandle anyway.
> 
> mbox-buf is used by below mailbox's node, but the start address has
> been truncated with 4KB alignment; so should keep it, right?

I think i got your point, all these nodes can be removed and just use
memory node to carve them out; but currently i saw the memory node
cannot be passed correctly from UEFI to kernel, we will check for
this. So will follow your suggestion if without any unknown reason.

Thanks,
Leo Yan

> > >  };
> > > diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi 
> > > b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > > index 3f03380..9ff25bc 100644
> > > --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > > +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > > @@ -167,5 +167,13 @@
> > >   clocks = <&ao_ctrl 36>, <&ao_ctrl 36>;
> > >   clock-names = "uartclk", "apb_pclk";
> > >   };
> > > +
> > > + mailbox: mailbox@f751 {
> > > + #mbox-cells = <1>;
> > > + compatible = "hisilicon,hi6220-mbox";
> > > + reg = <0x0 0xf751 0x0 0x1000>, /* IPC_S */
> > > +   <0x0 0x06dff800 0x0 0x0800>; /* Mailbox buffer */
> > > + interrupts = ;
> > > + };
> > >   };
> > >  };
> > > -- 
> > > 1.9.1
> > > 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


RE: [PATCH] [v2] x86, suspend: Save/restore extra MSR registers for suspend

2015-08-23 Thread Chen, Yu C
Hi Ingo, thanks for your reply,
 
> So I like the general structure of the patch and I like the MSR saving
> mechanism it introduces, but it is full of typos and small stylistic
> uncleanlinesses which need to be fixed before this patch can be applied.
> Please don't ack incomplete patches.
> 
Sorry for my poor English, I'll check these typos.

Best Regards,
Yu

> Thanks,
> 
>   Ingo

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


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

2015-08-23 Thread Stephen Rothwell
Hi all,

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

In function 'dst_hold',
inlined from '__ipv6_dev_ac_dec' at 
/home/sfr/next/next/net/ipv6/anycast.c:328:2:
/home/sfr/next/next/include/linux/compiler.h:447:38: error: call to 
'__compiletime_assert_243' declared with attribute error: BUILD_BUG_ON failed: 
offsetof(struct dst_entry, __refcnt) & 63
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
/home/sfr/next/next/include/linux/compiler.h:430:4: note: in definition of 
macro '__compiletime_assert'
prefix ## suffix();\
^
/home/sfr/next/next/include/linux/compiler.h:447:2: note: in expansion of macro 
'_compiletime_assert'
  _compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
  ^
/home/sfr/next/next/include/linux/bug.h:50:37: note: in expansion of macro 
'compiletime_assert'
 #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
 ^
/home/sfr/next/next/include/linux/bug.h:74:2: note: in expansion of macro 
'BUILD_BUG_ON_MSG'
  BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
  ^
/home/sfr/next/next/include/net/dst.h:243:2: note: in expansion of macro 
'BUILD_BUG_ON'
  BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
  ^

And many more :-(

Caused by commit

  61adedf3e3f1 ("route: move lwtunnel state to dst_entry")

I have used the net-next tree from next-20150821 for today.

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


Re: [PATCH block/for-linus] writeback: fix syncing of I_DIRTY_TIME inodes

2015-08-23 Thread Eryu Guan
On Mon, Aug 24, 2015 at 11:11:23AM +1000, Dave Chinner wrote:
> 
> Eryu, can you change the way you run the event trace to be:
> 
> $ sudo trace-cmd  -o  ./check 
> 
> rather than running the trace as a background operation elsewhere?
> Maybe that will give better results.

The results are here

http://128.199.137.77/writeback-v3/

> 
> Also, it would be informative to us if you can reproduce this with a
> v5 filesystem (i.e. mkfs.xfs -m crc=1) because it has much better
> on-disk information for sequence-of-event triage like this. If you
> can reproduce it with a v5 filesystem, can you post the trace and
> metadump?

This seems to be harder to reproduce with tracepoints enabled, but I'll
keep trying, and the tests below.

Thanks,
Eryu

> 
> Other things to check (separately):
> 
>   - change godown to godown -f
>   - add a "sleep 5" before running godown after sync
>   - add a "sleep 5; sync" before running godown
> 
> i.e. I'm wondering if sync is not waiting for everything, and so we
> aren't capturing the IO completions because the filesystem is
> already shut down by the time they are delivered...
> 
> Cheers,
> 
> Dave.
> -- 
> Dave Chinner
> da...@fromorbit.com
> 
> ___
> xfs mailing list
> x...@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/3] ARM: uniphier: add outer cache support

2015-08-23 Thread Masahiro Yamada
Hi Joe,


2015-08-24 11:29 GMT+09:00 Joe Perches :
> On Mon, 2015-08-24 at 11:18 +0900, Masahiro Yamada wrote:
>> This commit adds support for UniPhier outer cache controller.
>> All the UniPhier SoCs are equipped with the L2 cache, while the L3
>> cache is currently only integrated on PH1-Pro5 SoC.
>
> style trivia:
>
> You might add and use
> #define pr_fmt(fmt) "uniphier: " fmt
> before any other #include so all of the pr_
> uses are automatically prefixed.


I did not know that.  Thanks!

I will do so for the whole series in v2.





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


Re: [BUG] arm: kgdb: patch_text() in kgdb_arch_set_breakpoint() may sleep

2015-08-23 Thread Doug Anderson
Aapo,

Including the stack trace with this would have been helpful, though
it's not too hard to reproduce.  Here it is:

[  416.510559] BUG: scheduling while atomic: swapper/0/0/0x00010007
[  416.516554] Modules linked in:
[  416.519614] CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.2.0-rc7-00133-geb63b34 #1073
[  416.527341] Hardware name: Rockchip (Device Tree)
[  416.532042] [] (unwind_backtrace) from []
(show_stack+0x20/0x24)
[  416.539772] [] (show_stack) from []
(dump_stack+0x84/0xb8)
[  416.546983] [] (dump_stack) from []
(__schedule_bug+0x54/0x6c)
[  416.554540] [] (__schedule_bug) from []
(__schedule+0x80/0x668)
[  416.562183] [] (__schedule) from [] (schedule+0xb8/0xd4)
[  416.569219] [] (schedule) from []
(schedule_timeout+0x2c/0x234)
[  416.576861] [] (schedule_timeout) from []
(wait_for_common+0xf4/0x188)
[  416.585109] [] (wait_for_common) from []
(wait_for_completion+0x20/0x24)
[  416.593531] [] (wait_for_completion) from []
(__stop_cpus+0x58/0x70)
[  416.601608] [] (__stop_cpus) from []
(stop_cpus+0x3c/0x54)
[  416.608817] [] (stop_cpus) from []
(__stop_machine+0xcc/0xe8)
[  416.616286] [] (__stop_machine) from []
(stop_machine+0x34/0x44)
[  416.624016] [] (stop_machine) from []
(patch_text+0x28/0x34)
[  416.631399] [] (patch_text) from []
(kgdb_arch_set_breakpoint+0x40/0x4c)
[  416.639823] [] (kgdb_arch_set_breakpoint) from
[] (kgdb_validate_break_address+0x2c/0x60)
[  416.649719] [] (kgdb_validate_break_address) from
[] (dbg_set_sw_break+0x1c/0xdc)
[  416.658922] [] (dbg_set_sw_break) from []
(gdb_serial_stub+0x9c4/0xba4)
[  416.667259] [] (gdb_serial_stub) from []
(kgdb_cpu_enter+0x1f8/0x60c)
[  416.675423] [] (kgdb_cpu_enter) from []
(kgdb_handle_exception+0x19c/0x1d0)
[  416.684106] [] (kgdb_handle_exception) from []
(kgdb_compiled_brk_fn+0x30/0x3c)
[  416.693135] [] (kgdb_compiled_brk_fn) from []
(do_undefinstr+0x1a4/0x20c)
[  416.701643] [] (do_undefinstr) from []
(__und_svc_finish+0x0/0x34)
[  416.709543] Exception stack(0xc07c1ce8 to 0xc07c1d30)
[  416.714584] 1ce0:    c07c6504 c086e290
c086e294 c086e294 c086e290
[  416.722745] 1d00: c07c6504 0067 0001 c07c2100 0027
c07c1d4c c07c1d50 c07c1d30
[  416.730905] 1d20: c00a0990 c00a08d0 6193 
[  416.735947] [] (__und_svc_finish) from []
(kgdb_breakpoint+0x58/0x94)
[  416.744110] [] (kgdb_breakpoint) from []
(sysrq_handle_dbg+0x58/0x6c)
[  416.752273] [] (sysrq_handle_dbg) from []
(__handle_sysrq+0xac/0x15c)
[  416.760437] [] (__handle_sysrq) from []
(handle_sysrq+0x30/0x34)


Kees: I think you've dealt with a lot more of these types of issues
than I have.  Any quick thoughts?  If not I can put it on my long-term
list of things to do, but until then we could always just post a
Revert...


-Doug


On Wed, Aug 5, 2015 at 8:50 AM, Aapo Vienamo  wrote:
> Hi,
>
> The breakpoint setting code in arch/arm/kernel/kgdb.c calls
> patch_text(), which ends up trying to sleep while in interrupt context.
> The bug was introduced by commit: 23a4e40 arm: kgdb: Handle read-only
> text / modules. The resulting behavior is "BUG: scheduling while
> atomic..." when setting a breakpoint in kgdb. This was tested on an
> Nvidia Jetson TK1 board with 4.2.0-rc5-next-20150805 kernel.
>
> Regards,
> Aapo Vienamo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH v3 06/14] Documentation: drm/bridge: add document for analogix_dp

2015-08-23 Thread Yakir Yang

Hi Krzysztof,

在 08/23/2015 07:43 PM, Krzysztof Kozlowski 写道:

2015-08-24 8:23 GMT+09:00 Rob Herring :

On Wed, Aug 19, 2015 at 9:50 AM, Yakir Yang  wrote:

Analogix dp driver is split from exynos dp driver, so we just
make an copy of exynos_dp.txt, and then simplify exynos_dp.txt

Beside update some exynos dtsi file with the latest change
according to the devicetree binding documents.

You can't just change the exynos bindings and break compatibility. Is
there some agreement with exynos folks to do this?

No, there is no agreement. This wasn't even sent to Exynos maintainers.


Sorry about this one, actually I have add Exynos maintainers in version 
1 & version 2,

but lose some maintainers in version 3, I would fix it in bellow versions.


Additionally the patchset did not look interesting to me because of
misleading subject - Documentation instead of "ARM: dts:".

Yakir, please:
1. Provide backward compatibility. Mark old properties as deprecated
but still support them.


Do you mean that I should keep the old properties declare in exynos-dp.txt,
but just mark them as deprecated flag. Let me show same examples, make
me understand your suggest rightly.

1. "samsung,ycbcr-coeff" is abandoned in latest analogix-dp driver, 
absolutely
I should not carry this to analogix-dp.txt document. But I should 
keep this in

exynos-dp.txt document, and mark them with an little "deprecated" flag.

[Documentation/devicetree/bindings/video/exynos_dp.txt]
Required properties for dp-controller:
   [...]
-samsung,ycbcr-coeff (DEPRECATED):
YCbCr co-efficients for input video.
COLOR_YCBCR601 = 0, COLOR_YCBCR709 = 1

Is it right ?


2. Separate all DTS changes to a separate patch, unless bisectability
would be hurt. Anyway you should prepare it in a such way that
separation would be possible without breaking bisectability.


So I should separate this patch into two parts, one is name "Document:",
the other is "ARM: dts: ".

Honestly, I don't understand what the "bisectability" means in this case.


3. Use proper subject for the patch changing DTS. This is not
documentation change!


Hmm... when I separate this patch into two parts, I though I can keep
"Documentation" proper subject in this patch, and the other is the "ARM: 
dts"

proper subject. Am I right ?


4. Please use script get_maintainers to obtain list of valid
maintainers and CC-them with at least cover letter and patches
requiring their attention.


Yeah, thanks.


Thanks a lot,
- Yakir


Best regards,
Krzysztof





Signed-off-by: Yakir Yang 
---
Changes in v3:
- Take Heiko suggest, add devicetree binding documents.
- Take Thierry Reding suggest, remove sync pol & colorimetry properies
   from the new analogix dp driver devicetree binding.
- Update the exist exynos dtsi file with the latest DP DT properies.

Changes in v2: None

  .../devicetree/bindings/drm/bridge/analogix_dp.txt | 70 ++
  .../devicetree/bindings/video/exynos_dp.txt| 50 ++--
  arch/arm/boot/dts/exynos5250-arndale.dts   | 10 ++--
  arch/arm/boot/dts/exynos5250-smdk5250.dts  | 10 ++--
  arch/arm/boot/dts/exynos5250-snow.dts  | 12 ++--
  arch/arm/boot/dts/exynos5250-spring.dts| 12 ++--
  arch/arm/boot/dts/exynos5420-peach-pit.dts | 12 ++--
  arch/arm/boot/dts/exynos5420-smdk5420.dts  | 10 ++--
  arch/arm/boot/dts/exynos5800-peach-pi.dts  | 12 ++--
  9 files changed, 119 insertions(+), 79 deletions(-)
  create mode 100644 
Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt

diff --git a/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt 
b/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt
new file mode 100644
index 000..6127018
--- /dev/null
+++ b/Documentation/devicetree/bindings/drm/bridge/analogix_dp.txt
@@ -0,0 +1,70 @@
+Analogix Display Port bridge bindings
+
+Required properties for dp-controller:
+   -compatible:
+   platform specific such as:
+* "samsung,exynos5-dp"
+* "rockchip,rk3288-dp"
+   -reg:
+   physical base address of the controller and length
+   of memory mapped region.
+   -interrupts:
+   interrupt combiner values.
+   -clocks:
+   from common clock binding: handle to dp clock.
+   -clock-names:
+   from common clock binding: Shall be "dp".
+   -interrupt-parent:
+   phandle to Interrupt combiner node.
+   -phys:
+   from general PHY binding: the phandle for the PHY device.
+   -phy-names:
+   from general PHY binding: Should be "dp".
+   -analogix,color-space:
+   input video data format.
+   COLOR_RGB = 0, COLOR_YCBCR422 = 1, COLOR_YCBCR444 = 2
+   -analogix,color-depth:
+   number of bits per colour component.
+   COLOR_6 = 0, COLOR_8 = 1, COLOR_10 = 2, COLOR_12 = 3

T

  1   2   3   >