[PATCH 5/5] stop_machine: cpu_stop_park() should remove cpu_stop_work's from list

2015-06-29 Thread Oleg Nesterov
cpu_stop_park() does cpu_stop_signal_done() but leaves the work on
stopper->works. The owner of this work can free/reuse this memory
right after that and corrupt the list, so if this CPU becomes online
again cpu_stopper_thread() will crash.

Signed-off-by: Oleg Nesterov 
---
 kernel/stop_machine.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 9a70def..12484e5 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -462,13 +462,15 @@ static void cpu_stop_create(unsigned int cpu)
 static void cpu_stop_park(unsigned int cpu)
 {
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);
-   struct cpu_stop_work *work;
+   struct cpu_stop_work *work, *tmp;
unsigned long flags;
 
/* drain remaining works */
spin_lock_irqsave(&stopper->lock, flags);
-   list_for_each_entry(work, &stopper->works, list)
+   list_for_each_entry_safe(work, tmp, &stopper->works, list) {
+   list_del_init(&work->list);
cpu_stop_signal_done(work->done, false);
+   }
stopper->enabled = false;
spin_unlock_irqrestore(&stopper->lock, flags);
 }
-- 
1.5.5.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 3/5] stop_machine: unexport __stop_machine()

2015-06-29 Thread Oleg Nesterov
The only caller outside of stop_machine.c is _cpu_down(), it can use
stop_machine(). get_online_cpus() is fine under cpu_hotplug_begin().

Signed-off-by: Oleg Nesterov 
---
 include/linux/stop_machine.h |   22 ++
 kernel/cpu.c |3 +--
 kernel/stop_machine.c|2 +-
 3 files changed, 4 insertions(+), 23 deletions(-)

diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index d2abbdb..0fca276 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -114,23 +114,11 @@ static inline int try_stop_cpus(const struct cpumask 
*cpumask,
  * grabbing every spinlock in the kernel. */
 int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
 
-/**
- * __stop_machine: freeze the machine on all CPUs and run this function
- * @fn: the function to run
- * @data: the data ptr for the @fn
- * @cpus: the cpus to run the @fn() on (NULL = any online cpu)
- *
- * Description: This is a special version of the above, which assumes cpus
- * won't come or go while it's being called.  Used by hotplug cpu.
- */
-int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
-
 int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
   const struct cpumask *cpus);
-
 #else   /* CONFIG_STOP_MACHINE && CONFIG_SMP */
 
-static inline int __stop_machine(int (*fn)(void *), void *data,
+static inline int stop_machine(int (*fn)(void *), void *data,
 const struct cpumask *cpus)
 {
unsigned long flags;
@@ -141,16 +129,10 @@ static inline int __stop_machine(int (*fn)(void *), void 
*data,
return ret;
 }
 
-static inline int stop_machine(int (*fn)(void *), void *data,
-  const struct cpumask *cpus)
-{
-   return __stop_machine(fn, data, cpus);
-}
-
 static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
 const struct cpumask *cpus)
 {
-   return __stop_machine(fn, data, cpus);
+   return stop_machine(fn, data, cpus);
 }
 
 #endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 94bbe46..68c8324 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -394,8 +394,7 @@ static int __ref _cpu_down(unsigned int cpu, int 
tasks_frozen)
/*
 * So now all preempt/rcu users must observe !cpu_active().
 */
-
-   err = __stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
+   err = stop_machine(take_cpu_down, &tcd_param, cpumask_of(cpu));
if (err) {
/* CPU didn't die: tell everyone.  Can't complain. */
smpboot_unpark_threads(cpu);
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
index 6212208..b50910d 100644
--- a/kernel/stop_machine.c
+++ b/kernel/stop_machine.c
@@ -513,7 +513,7 @@ early_initcall(cpu_stop_init);
 
 #ifdef CONFIG_STOP_MACHINE
 
-int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus)
+static int __stop_machine(int (*fn)(void *), void *data, const struct cpumask 
*cpus)
 {
struct multi_stop_data msdata = {
.fn = fn,
-- 
1.5.5.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: [RFC v2 PATCH 7/8] mm: add the buddy system interface

2015-06-29 Thread Xishi Qiu
On 2015/6/30 9:01, Kamezawa Hiroyuki wrote:

> On 2015/06/30 8:11, Luck, Tony wrote:
>>> @@ -814,7 +814,7 @@ int __init_memblock memblock_clear_hotplug(phys_addr_t 
>>> base, phys_addr_t size)
>>>*/
>>>   int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t 
>>> size)
>>>   {
>>> -system_has_some_mirror = true;
>>> +static_key_slow_inc(&system_has_mirror);
>>>
>>>   return memblock_setclr_flag(base, size, 1, MEMBLOCK_MIRROR);
>>>   }
>>
>> This generates some WARN_ON noise when called from efi_find_mirror():
>>
> 
> It seems jump_label_init() is called after memory initialization. 
> (init/main.c::start_kernel())
> So, it may be difficut to use static_key function for our purpose because
> kernel memory allocation may occur before jump_label is ready.
> 
> Thanks,
> -Kame
> 

Hi Kame,

How about like this? Use static bool in bootmem, and use jump label in buddy 
system.
This means we use two variable to do it.

Thanks,
Xishi Qiu

>> [0.00] e820: last_pfn = 0x7b800 max_arch_pfn = 0x4
>> [0.00] [ cut here ]
>> [0.00] WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:61 
>> static_key_slow_inc+0x57/0xc0()
>> [0.00] static_key_slow_inc used before call to jump_label_init
>> [0.00] Modules linked in:
>>
>> [0.00] CPU: 0 PID: 0 Comm: swapper Not tainted 4.1.0 #4
>> [0.00] Hardware name: Intel Corporation BRICKLAND/BRICKLAND, BIOS 
>> BRHSXSD1.86B.0065.R01.1505011640 05/01/2015
>> [0.00]   ee366a8dff38f745 81997d68 
>> 816683b4
>> [0.00]   81997dc0 81997da8 
>> 8107b0aa
>> [0.00]  81d48822 81f281a0 4000 
>> 001fcb7a4000
>> [0.00] Call Trace:
>> [0.00]  [] dump_stack+0x45/0x57
>> [0.00]  [] warn_slowpath_common+0x8a/0xc0
>> [0.00]  [] warn_slowpath_fmt+0x55/0x70
>> [0.00]  [] ? memblock_add_range+0x175/0x19e
>> [0.00]  [] static_key_slow_inc+0x57/0xc0
>> [0.00]  [] memblock_mark_mirror+0x19/0x33
>> [0.00]  [] efi_find_mirror+0x59/0xdd
>> [0.00]  [] setup_arch+0x642/0xccf
>> [0.00]  [] ? early_idt_handler_array+0x120/0x120
>> [0.00]  [] ? printk+0x55/0x6b
>> [0.00]  [] ? early_idt_handler_array+0x120/0x120
>> [0.00]  [] start_kernel+0xe8/0x4eb
>> [0.00]  [] ? early_idt_handler_array+0x120/0x120
>> [0.00]  [] ? early_idt_handler_array+0x120/0x120
>> [0.00]  [] x86_64_start_reservations+0x2a/0x2c
>> [0.00]  [] x86_64_start_kernel+0x14c/0x16f
>> [0.00] ---[ end trace baa7fa0514e3bc58 ]---
>> [0.00] [ cut here ]
>>
>>
>>
>>
>>
> 
> 
> 
> .
> 



--
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] lib/bitmap.c: return -EINVAL for grouping errors in __bitmap_parselist

2015-06-29 Thread Pan Xinhui

hi, Yury
thanks for your nice reply.

On 2015年06月29日 21:39, Yury Norov wrote:

Sometimes the input from user may cause an unexpected result.


Could you please provide specific example?


I wrote some scripts to do some tests about irqs.
echo "1-3," > /proc/irq//smp_affinity_list
this command ends with ',' by mistake.
actually __bitmap_parselist() will report "0-3" for the final result which is 
wrong.



just like __bitmap_parse, we return -EINVAL if there is no avaiable digit in 
each
parsing procedures.

Signed-off-by: Pan Xinhui 


Hello, Pan.

(Adding Alexey Klimov, Rasmus Villemoes)


---
   lib/bitmap.c | 7 +--
   1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bitmap.c b/lib/bitmap.c
index 64c0926..995fca2 100644
--- a/lib/bitmap.c
+++ b/lib/bitmap.c
@@ -504,7 +504,7 @@ static int __bitmap_parselist(const char *buf, unsigned int 
buflen,
   int nmaskbits)
   {
   unsigned a, b;
-int c, old_c, totaldigits;
+int c, old_c, totaldigits, ndigits;
   const char __user __force *ubuf = (const char __user __force *)buf;
   int exp_digit, in_range;

@@ -514,6 +514,7 @@ static int __bitmap_parselist(const char *buf, unsigned int 
buflen,
   exp_digit = 1;
   in_range = 0;
   a = b = 0;
+ndigits = 0;

   /* Get the next cpu# or a range of cpu#'s */
   while (buflen) {
@@ -555,8 +556,10 @@ static int __bitmap_parselist(const char *buf, unsigned 
int buflen,
   if (!in_range)
   a = b;
   exp_digit = 0;
-totaldigits++;
+ndigits++; totaldigits++;


I'm not happy with joining two statements to a single line.
Maybe sometimes it's OK for loop iterators like

 while (a[i][j]) {
 i++; j++;
 }

But here it looks nasty. Anyway, it's minor.



thanks for pointing out my mistake about the code style :)


   }
+if (ndigits == 0)
+return -EINVAL;


You can avoid in-loop incrementation of ndigits if you'll
save current totaldigits to ndigits before loop, and check
ndigits against totaldigits after the loop:

 ndigits = totaldigits;
 while (...) {
  ...
 totaldigits++;
 }

 if (ndigits == totaldigits)
 return -EINVAL;

Maybe it's a good point to rework initial __bitmap_parse() similar way...



your advice is a good idea, thanks.
I am also thinking if we can rewrite them into one function for common codes.

thanks for your reply again :)

thanks
xinhui


   if (!(a <= b))
   return -EINVAL;
   if (b >= nmaskbits)
--
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: [RFC PATCH v9 49/50 -fix] perf probe: Init symbol as kprobe if any event is kprobe

2015-06-29 Thread Wangnan (F)



On 2015/6/29 22:33, Arnaldo Carvalho de Melo wrote:

Em Sat, Jun 27, 2015 at 12:25:45PM +, Wang Nan escreveu:

Before this patch, add_perf_probe_events() init symbol maps only for
uprobe if the first 'struct perf_probe_event' passed to it is a uprobe
event. This is a trick because 'perf probe''s command line syntax
constrains the first elements of the probe_event arrays must be kprobes
if there is one.

However, with the incoming BPF uprobe support, the constrain is not
hold since 'perf record' will also probe on k/u probes through BPF
object, and is possible to pass an array with kprobe but the first
element is uprobe.

This patch init symbol maps for kprobes even if all of events are
uprobes, because the extra cost should be small enough.

Signed-off-by: Wang Nan 
---

Please add more info here, i.e. is this to be applied on top of the
original 49/50? I guess so, but please state this in the future to speed
things up.

- Arnaldo


You should replace the original 49/50, and also for the other -fix 
patches sent

by me. Sorry for the lacking of information.

I posted the modified patches only because I don't want to be noisy. If 
posting

them all makes your work easier I'll do that next time.

Thank you.


  tools/perf/util/probe-event.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index ea08015..e74ca8f 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -2804,7 +2804,7 @@ int add_perf_probe_events(struct perf_probe_event *pevs, 
int npevs,
  {
int i, ret;
  
-	ret = init_symbol_maps(pevs->uprobes);

+   ret = init_symbol_maps(false);
if (ret < 0)
return ret;
  
--

1.8.3.4



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


Re: [RFC v2 PATCH 0/8] mm: mirrored memory support for page buddy allocations

2015-06-29 Thread Dave Hansen
On 06/29/2015 06:26 PM, Xishi Qiu wrote:
>> > Has there been any performance analysis done on this code?  I'm always
>> > nervous when I see page_alloc.c churn.
>> > 
> Not yet, which benchmark do you suggest?

mmtests is always a good place to start.  aim9.  I'm partial to
will-it-scale.


--
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] usb: xhci: Add support for URB_ZERO_PACKET to bulk/sg transfers

2015-06-29 Thread Reyad Attiyat
Hey Mathias,

The intention is to send an extra endpoint packet of length zero as my
wireless card needs this to function properly. I have skimmed through
the xhci spec and assumed that each td would generate a packet. That
is why I do not chain the last trb or add a interrupt flag, since I
don't want to call the urb completion function called twice or called
with the incorrect td or length.

I have since tried a patch that just chains the trbs together, with
the zero-length trb, and this still creates a zero-length packet. I
was thinking I could remove the use of the last_trb variable I was
using and simply chain all the trbs together and place the interupt
flag on the zero-length trb if it exsits. Also I noticed that the
other host controller drivers (ehci and ohci) check to ensure that the
endpoint is sending data out and that the urb length is greater than
zero. I will add these checks as well to keep in line with the their
implementation.

Do you think this is the best method for creating a zero-length
packet, will every trb convert into at least one endpoint packet?

Thank you,
Reyad Attiyat



On Mon, Jun 29, 2015 at 10:48 AM, Mathias Nyman  wrote:
> Hi
>
> On 29.06.2015 03:53, Reyad Attiyat wrote:
>> This commmit checks for the URB_ZERO_PACKET flag and creates an extra
>> zero-length td if the urb transfer length is a multiple of the endpoint's
>> max packet length.
>>
>> Signed-off-by: Reyad Attiyat 
>> ---
>
> Thanks for the patch.
> Generic idea and implementation looks good, there are some opens though
> See comments and questions inline.
>
>>  drivers/usb/host/xhci-ring.c | 43 
>> +--
>>  1 file changed, 33 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
>> index 7d34cbf..3d57a7a 100644
>> --- a/drivers/usb/host/xhci-ring.c
>> +++ b/drivers/usb/host/xhci-ring.c
>> @@ -3040,7 +3040,9 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, 
>> gfp_t mem_flags,
>>   int num_sgs;
>>   int trb_buff_len, this_sg_len, running_total;
>>   unsigned int total_packet_count;
>> + bool zero_length_needed;
>>   bool first_trb;
>> + int last_trb;
>
> last_trb isn't a really a good name as it might be confused with td->last_trb.
> It's used for different purposes here.
>
>>   u64 addr;
>>   bool more_trbs_coming;
>>
>> @@ -3056,6 +3058,14 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, 
>> gfp_t mem_flags,
>>   total_packet_count = DIV_ROUND_UP(urb->transfer_buffer_length,
>>   usb_endpoint_maxp(&urb->ep->desc));
>>
>> + /* Deal with URB_ZERO_PACKET - need one more td/trb */
>> + zero_length_needed = (urb->transfer_flags & URB_ZERO_PACKET)
>> +  && !(urb->transfer_buffer_length % usb_endpoint_maxp(&urb->ep->desc));
>
> Please move the "&&" to end of previous line.
> (minor thing but helps readability)
>
> Checkpatch also complains about missing whitespaces in the if () statements.
>
>> + if(zero_length_needed){
>> + num_trbs++;
>> + xhci_dbg(xhci, "Creating zero length td.\n");
>> + }
>> +
>>   trb_buff_len = prepare_transfer(xhci, xhci->devs[slot_id],
>>   ep_index, urb->stream_id,
>>   num_trbs, urb, 0, mem_flags);
>> @@ -3092,6 +3102,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, 
>> gfp_t mem_flags,
>>   trb_buff_len = urb->transfer_buffer_length;
>>
>>   first_trb = true;
>> + last_trb = zero_length_needed ? 2 : 1;
>>   /* Queue the first TRB, even if it's zero-length */
>>   do {
>>   u32 field = 0;
>> @@ -3109,12 +3120,13 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, 
>> gfp_t mem_flags,
>>   /* Chain all the TRBs together; clear the chain bit in the last
>>* TRB to indicate it's the last TRB in the chain.
>>*/
>> - if (num_trbs > 1) {
>> + if (num_trbs > last_trb) {
>>   field |= TRB_CHAIN;
>> - } else {
>> - /* FIXME - add check for ZERO_PACKET flag before this 
>> */
>> + } else if (num_trbs == last_trb) {
>>   td->last_trb = ep_ring->enqueue;
>>   field |= TRB_IOC;
>> + } else if (zero_length_needed && num_trbs == 1) {
>> + trb_buff_len = 0;
>>   }
>
> Normally chain bits are set for all TRBs except the last TRB, and the IOC 
> (interrupt on completion)
> is usually set for only the last TRB.
>
> In case last_trb == 2, the chain bit is now not set between the TRB 
> containing the last data
> and the actual last zero TRB, which is the last TRB in the TD.
> It now also sets the interrupt on completion (IOC) for the TRB with the last 
> data,
> but not for the final last, zero lengt TRB in the TD.
>
> Is this intentional and how we want zero packet bulk transfers to behave?
>
> -Mathias

Hello

2015-06-29 Thread brian . girling
Am writing you regarding a deceased clients of ours that shares the same 
surname as yours. Please reply to siegelsanth...@hotmail.com for more info.

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


Re: [RFC v2 PATCH 7/8] mm: add the buddy system interface

2015-06-29 Thread Kamezawa Hiroyuki

On 2015/06/30 10:31, Xishi Qiu wrote:

On 2015/6/30 9:01, Kamezawa Hiroyuki wrote:


On 2015/06/30 8:11, Luck, Tony wrote:

@@ -814,7 +814,7 @@ int __init_memblock memblock_clear_hotplug(phys_addr_t 
base, phys_addr_t size)
*/
   int __init_memblock memblock_mark_mirror(phys_addr_t base, phys_addr_t size)
   {
-system_has_some_mirror = true;
+static_key_slow_inc(&system_has_mirror);

   return memblock_setclr_flag(base, size, 1, MEMBLOCK_MIRROR);
   }


This generates some WARN_ON noise when called from efi_find_mirror():



It seems jump_label_init() is called after memory initialization. 
(init/main.c::start_kernel())
So, it may be difficut to use static_key function for our purpose because
kernel memory allocation may occur before jump_label is ready.

Thanks,
-Kame



Hi Kame,

How about like this? Use static bool in bootmem, and use jump label in buddy 
system.
This means we use two variable to do it.



I think it can be done but it should be done in separated patch with enough 
comment/changelog.

Thanks,
-Kame



--
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] ARM: dts: vf610: Extend I2C support to all available buses.

2015-06-29 Thread Cory Tusar
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/16/2015 04:50 AM, Stefan Agner wrote:
> On 2015-06-15 02:19, Cory Tusar wrote:
>> This commit extends the existing Vybrid I2C support to cover buses i2c1,
>> i2c2, and i2c3.  Based in (very) large part on an initial patch by
>> Stefan Agner that was just lacking a couple of DMA assignments.
>>
>> Signed-off-by: Cory Tusar 
> 
> Thx Cory for picking that up.
> 
> So with that patch we use the second Mux of DMA0 the first time. Another
> option would have been to use the first Mux of DMA1, however I think its
> better to leave DMA1 for dedicated purposes or the secondary Cortex-M4
> core... If a board needs different configuration, one would also have
> the option to overwrite the properties.
> 
> Acked-by: Stefan Agner 

Just a status check on this...any additional comments?

Regards,
- -Cory


>> ---
>>  arch/arm/boot/dts/vfxxx.dtsi | 41 +
>>  1 file changed, 41 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/vfxxx.dtsi b/arch/arm/boot/dts/vfxxx.dtsi
>> index 4aa3351..25f2615 100644
>> --- a/arch/arm/boot/dts/vfxxx.dtsi
>> +++ b/arch/arm/boot/dts/vfxxx.dtsi
>> @@ -347,6 +347,20 @@
>>  status = "disabled";
>>  };
>>  
>> +i2c1: i2c@40067000 {
>> +#address-cells = <1>;
>> +#size-cells = <0>;
>> +compatible = "fsl,vf610-i2c";
>> +reg = <0x40067000 0x1000>;
>> +interrupts = <72 IRQ_TYPE_LEVEL_HIGH>;
>> +clocks = <&clks VF610_CLK_I2C1>;
>> +clock-names = "ipg";
>> +dmas = <&edma0 0 52>,
>> +<&edma0 0 53>;
>> +dma-names = "rx","tx";
>> +status = "disabled";
>> +};
>> +
>>  clks: ccm@4006b000 {
>>  compatible = "fsl,vf610-ccm";
>>  reg = <0x4006b000 0x1000>;
>> @@ -520,6 +534,33 @@
>>  status = "disabled";
>>  };
>>  
>> +i2c2: i2c@400e6000 {
>> +#address-cells = <1>;
>> +#size-cells = <0>;
>> +compatible = "fsl,vf610-i2c";
>> +reg = <0x400e6000 0x1000>;
>> +interrupts = <73 IRQ_TYPE_LEVEL_HIGH>;
>> +clocks = <&clks VF610_CLK_I2C2>;
>> +clock-names = "ipg";
>> +dmas = <&edma0 1 36>,
>> +<&edma0 1 37>;
>> +dma-names = "rx","tx";
>> +status = "disabled";
>> +};
>> +
>> +i2c3: i2c@400e7000 {
>> +#address-cells = <1>;
>> +#size-cells = <0>;
>> +compatible = "fsl,vf610-i2c";
>> +reg = <0x400e7000 0x1000>;
>> +interrupts = <74 IRQ_TYPE_LEVEL_HIGH>;
>> +clocks = <&clks VF610_CLK_I2C3>;
>> +clock-names = "ipg";
>> +dmas = <&edma0 1 38>,
>> +<&edma0 1 39>;
>> +dma-names = "rx","tx";
>> +status = "disabled";
>> +};
>>  };
>>  };
>>  };
> 


- -- 
Cory Tusar
Principal
PID 1 Solutions, Inc.


"There are two ways of constructing a software design.  One way is to
 make it so simple that there are obviously no deficiencies, and the
 other way is to make it so complicated that there are no obvious
 deficiencies."  --Sir Charles Anthony Richard Hoare

-BEGIN PGP SIGNATURE-
Version: GnuPG v2

iEYEARECAAYFAlWR/O0ACgkQHT1tsfGwHJ9+zgCfRPTTiszNMsDy8nVnfdjIYGGO
iv0An2go86s+1hbrpAF1VbpCrKmYqF0J
=EatS
-END PGP SIGNATURE-
--
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][RESEND] btrfs: fix search key advancing condition

2015-06-29 Thread Naohiro Aota
The search key advancing condition used in copy_to_sk() is loose. It can
advance the key even if it reaches sk->max_*: e.g. when the max key = (512,
1024, -1) and the current key = (512, 1025, 10), it increments the
offset by 1, continues hopeless search from (512, 1025, 11). This issue
make ioctl() to take unexpectedly long time scanning all the leaf a blocks
one by one.

This commit fix the problem using standard way of key comparison:
btrfs_comp_cpu_keys()

Signed-off-by: Naohiro Aota 
---
 fs/btrfs/ioctl.c | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 1c22c65..07dc01d 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1932,6 +1932,7 @@ static noinline int copy_to_sk(struct btrfs_root *root,
u64 found_transid;
struct extent_buffer *leaf;
struct btrfs_ioctl_search_header sh;
+   struct btrfs_key test;
unsigned long item_off;
unsigned long item_len;
int nritems;
@@ -2015,12 +2016,17 @@ static noinline int copy_to_sk(struct btrfs_root *root,
}
 advance_key:
ret = 0;
-   if (key->offset < (u64)-1 && key->offset < sk->max_offset)
+   test.objectid = sk->max_objectid;
+   test.type = sk->max_type;
+   test.offset = sk->max_offset;
+   if (btrfs_comp_cpu_keys(key, &test) >= 0)
+   ret = 1;
+   else if (key->offset < (u64)-1)
key->offset++;
-   else if (key->type < (u8)-1 && key->type < sk->max_type) {
+   else if (key->type < (u8)-1) {
key->offset = 0;
key->type++;
-   } else if (key->objectid < (u64)-1 && key->objectid < sk->max_objectid) 
{
+   } else if (key->objectid < (u64)-1) {
key->offset = 0;
key->type = 0;
key->objectid++;
-- 
2.4.4

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


Re: [RFC PATCH v9 02/50] tools build: Add feature check for eBPF API

2015-06-29 Thread Wangnan (F)



On 2015/6/30 3:41, Arnaldo Carvalho de Melo wrote:

Em Mon, Jun 29, 2015 at 04:21:51PM -0300, Arnaldo Carvalho de Melo escreveu:

Em Fri, Jun 26, 2015 at 02:15:07PM +, Wang Nan escreveu:

In this patch, eBPF API is checked by compiling a c source file which
uses fields in bpf_attr which will be used by libbpf.

Signed-off-by: Wang Nan 
Acked-by: Alexei Starovoitov 

So, I just applied this and after trying:

[acme@felicio linux]$ rm -rf /tmp/build/perf ; mkdir -p /tmp/build/perf
; make O=/tmp/build/perf -C tools/perf  install-bin
make: Entering directory `/home/acme/git/linux/tools/perf'
   BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
... dwarf: [ on  ]
... glibc: [ on  ]
...  gtk2: [ on  ]
...  libaudit: [ on  ]
...libbfd: [ on  ]
...libelf: [ on  ]
...   libnuma: [ on  ]
...   libperl: [ on  ]
... libpython: [ on  ]
...  libslang: [ on  ]
... libunwind: [ on  ]
...libdw-dwarf-unwind: [ on  ]
...  zlib: [ on  ]
...  lzma: [ on  ]
...   bpf: [ OFF ]

   MKDIR/tmp/build/perf/util/
   CC   /tmp/build/perf/util/abspath.o



So, what should I do now? I want to have that OFF line turned to "on",
so that I can test this stuff.

But the changelog says nothing about it, lemme check the cover letter,
but having to do that is annoying, one expects to have instructions
related to some specific changeset in its comments...

So, when such build tests fail, we can see why by looking for a file
with a special name in the O= output dir:

[acme@felicio linux]$ cat /tmp/build/perf/feature/test-bpf.make.output
test-bpf.c:1:23: fatal error: linux/bpf.h: No such file or directory
  #include 
^
compilation terminated.
[acme@felicio linux]$


This patch tries to check the version of bpf.h, because old bpf.h doesn't
define 'kern_version' field for 'union bpf_attr'.

I think the problem you meet is caused by missing of kernel headers in your
host system environment. After patch 'perf tools: Make perf depend on 
libbpf'

this checking should always success because it adds required headers
into MANIFEST and setup FEATURE_CHECK_CFLAGS-bpf.

Also, after applying 3/50 you should see this:

# make O=/tmp/build/bpf/ -C tools/lib/bpf/

Auto-detecting system features:
...libelf: [ on  ]
... libelf-getphdrnum: [ on  ]
...   libelf-mmap: [ on  ]
...   bpf: [ on  ]

make: Entering directory `/home/wn/kernel-hydrogen/tools/lib/bpf'
  CC   /tmp/build/bpf/libbpf.o
  LD   /tmp/build/bpf/libbpf-in.o
  LINK /tmp/build/bpf/libbpf.a
  LINK /tmp/build/bpf/libbpf.so
make: Leaving directory `/home/wn/kernel/tools/lib/bpf'

Even if in perf checking bpf should fail in your machine now, checking 
bpf feature in
libbpf should success because when build libbpf I have added following 
setting to

tools/lib/bpf/Makefile:

  INCLUDES = -I. -I$(srctree)/tools/include 
-I$(srctree)/arch/$(ARCH)/include/uapi -I$(srctree)/include/uapi

  FEATURE_CHECK_CFLAGS-bpf = $(INCLUDES)

Do you want me to squash 2/30 and 3/50 together and append 'bpf' checker 
into FEATURE_TESTS in
tools/build/Makefile.feature in 23/50? Then there should be less 
confusion: when compiling perf

before 23/50, bpf feature will never be checked then.

Thank you.


Right, one of the few things that could explain the failure, but:

[acme@felicio linux]$ find . -name bpf.h
./include/linux/bpf.h
./include/uapi/linux/bpf.h
[acme@felicio linux]$

So lemme try doing it in place:

[acme@felicio linux]$ make -C tools/perf/
make: Entering directory `/home/acme/git/linux/tools/perf'
   BUILD:   Doing 'make -j4' parallel build

Auto-detecting system features:
... dwarf: [ on  ]
... glibc: [ on  ]
...  gtk2: [ on  ]
...  libaudit: [ on  ]
...libbfd: [ on  ]
...libelf: [ on  ]
...   libnuma: [ on  ]
...   libperl: [ on  ]
... libpython: [ on  ]
...  libslang: [ on  ]
... libunwind: [ on  ]
...libdw-dwarf-unwind: [ on  ]
...  zlib: [ on  ]
...  lzma: [ on  ]
...   bpf: [ OFF ]


Doesn't work as well :-\

Looking at the following patches...

- Arnaldo



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

Re: [RFC v2 PATCH 2/8] mm: introduce MIGRATE_MIRROR to manage the mirrored pages

2015-06-29 Thread Xishi Qiu
On 2015/6/29 15:32, Kamezawa Hiroyuki wrote:

> On 2015/06/27 11:24, Xishi Qiu wrote:
>> This patch introduces a new migratetype called "MIGRATE_MIRROR", it is used 
>> to
>> allocate mirrored pages.
>> When cat /proc/pagetypeinfo, you can see the count of free mirrored blocks.
>>
>> Signed-off-by: Xishi Qiu 
> 
> My fear about this approarch is that this may break something existing.
> 
> Now, when we add MIGRATE_MIRROR type, we'll hide attributes of pageblocks as
> MIGRATE_UNMOVABOLE, MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE.
> 
> Logically, MIRROR attribute is independent from page mobility and this 
> overwrites
> will make some information lost.
> 
> Then,
> 
>> ---
>>   include/linux/mmzone.h | 9 +
>>   mm/page_alloc.c| 3 +++
>>   mm/vmstat.c| 3 +++
>>   3 files changed, 15 insertions(+)
>>
>> diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
>> index 54d74f6..54e891a 100644
>> --- a/include/linux/mmzone.h
>> +++ b/include/linux/mmzone.h
>> @@ -39,6 +39,9 @@ enum {
>>   MIGRATE_UNMOVABLE,
>>   MIGRATE_RECLAIMABLE,
>>   MIGRATE_MOVABLE,
>> +#ifdef CONFIG_MEMORY_MIRROR
>> +MIGRATE_MIRROR,
>> +#endif
> 
> I think
> MIGRATE_MIRROR_UNMOVABLE,
> MIGRATE_MIRROR_RECLAIMABLE,
> MIGRATE_MIRROR_MOVABLE, <== adding this may need discuss.
> MIGRATE_MIRROR_RESERVED,<== reserved pages should be 
> maintained per mirrored/unmirrored.
> 

Hi Kame,

You mean add 3 or 4 new migratetype?

> should be added with the following fallback list.
> 
> /*
>  * MIRROR page range is defined by firmware at boot. The range is limited
>  * and is used only for kernel memory mirroring.
>  */
> [MIGRATE_UNMOVABLE_MIRROR]   = {MIGRATE_RECLAIMABLE_MIRROR, MIGRATE_RESERVE}
> [MIGRATE_RECLAIMABLE_MIRROR] = {MIGRATE_UNMOVABLE_MIRROR, MIGRATE_RESERVE}
> 

Why not like this:
{MIGRATE_RECLAIMABLE_MIRROR, MIGRATE_MIRROR_RESERVED, MIGRATE_RESERVE}

> Then, we'll not lose the original information of "Reclaiable Pages".
> 
> One problem here is whteher we should have MIGRATE_RESERVE_MIRROR.
> 
> If we never allow users to allocate mirrored memory, we should have 
> MIGRATE_RESERVE_MIRROR.
> But it seems to require much more code change to do that.
> 
> Creating a zone or adding an attribues to zones are another design choice.
> 

If we add a new zone, mirror_zone will span others, I'm worry about this
maybe have problems.

Thanks,
Xishi Qiu

> Anyway, your patch doesn't takes care of reserved memory calculation at this 
> point.
> Please check setup_zone_migrate_reserve() That will be a problem.
> 
> Thanks,
> -Kame
> 



--
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 01/12] f2fs: avoid freed stat information

2015-06-29 Thread Chao Yu
 -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:39 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 01/12] f2fs: avoid freed stat information
> 
> The write_checkpoint can update stat information, so we should destroy the 
> stat
> structure after it.
> 
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao 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/


[PULL] modules-next

2015-06-29 Thread Rusty Russell
The following changes since commit a8b253b9f253c05e5e10b829b8d1fb24556f4b56:

  Merge tag 'pinctrl-v4.1-4' of 
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl (2015-05-25 
15:15:54 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git 
tags/modules-next-for-linus

for you to fetch changes up to 20bdc2cfdbc484777b30b96fcdbb8994038f3ce1:

  modules: only use mod->param_lock if CONFIG_MODULES (2015-06-28 14:50:12 
+0930)


Minor merge needed, due to function move.

Main excitement here is Peter Zijlstra's lockless rbtree optimization to
speed module address lookup.  He found some abusers of the module lock
doing that too.

A little bit of parameter work here too; including Dan Streetman's breaking
up the big param mutex so writing a parameter can load another module (yeah,
really).  Unfortunately that broke the usual suspects, !CONFIG_MODULES and
!CONFIG_SYSFS, so those fixes were appended too.

Cheers,
Rusty.


Dan Streetman (2):
  module: make perm const
  module: add per-module param_lock

Gobinda Charan Maji (1):
  sysfs: tightened sysfs permission checks

Luis R. Rodriguez (6):
  kernel/params: constify struct kernel_param_ops uses
  kernel/module.c: use generic module param operaters for sig_enforce
  kernel/params.c: generalize bool_enable_only
  kernel/params.c: export param_ops_bool_enable_only
  kernel/workqueue.c: remove ifdefs over wq_power_efficient
  kernel/module.c: avoid ifdefs for sig_enforce declaration

Peter Zijlstra (12):
  module: Annotate module version magic
  module, jump_label: Fix module locking
  module: Sanitize RCU usage and locking
  rbtree: Make lockless searches non-fatal
  seqlock: Better document raw_write_seqcount_latch()
  rcu: Move lockless_dereference() out of rcupdate.h
  seqlock: Introduce raw_read_seqcount_latch()
  rbtree: Implement generic latch_tree
  module: Optimize __module_address() using a latched RB-tree
  module: Make the mod_tree stuff conditional on PERF_EVENTS || TRACING
  module: Use __module_address() for module_address_lookup()
  module: Rework module_addr_{min,max}

Rusty Russell (3):
  modules: clarify CONFIG_MODULE_COMPRESS help, suggest 'N'.
  params: suppress unused variable error, warn once just in case code 
changes.
  param: fix module param locks when !CONFIG_SYSFS.

Stephen Rothwell (2):
  rcu: merge fix for Convert ACCESS_ONCE() to READ_ONCE() and WRITE_ONCE()
  modules: only use mod->param_lock if CONFIG_MODULES

 arch/s390/kernel/perf_cpum_sf.c  |   2 +-
 arch/um/drivers/hostaudio_kern.c |  20 +-
 arch/x86/kvm/mmu_audit.c |   2 +-
 arch/x86/platform/uv/uv_nmi.c|   2 +-
 drivers/block/null_blk.c |   4 +-
 drivers/char/ipmi/ipmi_watchdog.c|   6 +-
 drivers/dma/dmatest.c|   4 +-
 drivers/ide/ide.c|   2 +-
 drivers/infiniband/ulp/srp/ib_srp.c  |   4 +-
 drivers/input/misc/ati_remote2.c |   4 +-
 drivers/input/mouse/psmouse-base.c   |   2 +-
 drivers/misc/lis3lv02d/lis3lv02d.c   |   2 +-
 drivers/mtd/ubi/block.c  |   2 +-
 drivers/net/ethernet/myricom/myri10ge/myri10ge.c |   6 +-
 drivers/net/wireless/ath/wil6210/main.c  |   4 +-
 drivers/net/wireless/libertas_tf/if_usb.c|   6 +-
 drivers/power/test_power.c   |  16 +-
 drivers/thermal/intel_powerclamp.c   |   4 +-
 drivers/tty/hvc/hvc_iucv.c   |   2 +-
 drivers/tty/sysrq.c  |   2 +-
 drivers/usb/atm/ueagle-atm.c |   4 +-
 drivers/video/fbdev/uvesafb.c|   2 +-
 drivers/video/fbdev/vt8623fb.c   |   4 +-
 drivers/virtio/virtio_mmio.c |   2 +-
 fs/nfs/super.c   |   2 +-
 include/linux/compiler.h |  15 ++
 include/linux/kernel.h   |  18 +-
 include/linux/module.h   |  46 +++-
 include/linux/moduleparam.h  |  99 +++-
 include/linux/rbtree.h   |  16 +-
 include/linux/rbtree_augmented.h |  21 +-
 include/linux/rbtree_latch.h | 212 
 include/linux/rcupdate.h |  15 --
 include/linux/seqlock.h  |  81 +-
 init/Kconfig |  29 +--
 kernel/jump_label.c  |  10 +-
 kernel/module.c  | 309 +--
 kernel/params.c

Re: [RFC v2 PATCH 0/8] mm: mirrored memory support for page buddy allocations

2015-06-29 Thread Xishi Qiu
On 2015/6/30 9:52, Dave Hansen wrote:

> On 06/29/2015 06:26 PM, Xishi Qiu wrote:
 Has there been any performance analysis done on this code?  I'm always
 nervous when I see page_alloc.c churn.

>> Not yet, which benchmark do you suggest?
> 
> mmtests is always a good place to start.  aim9.  I'm partial to
> will-it-scale.
> 

I see, thank you.

> 
> 
> .
> 



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


Re: [GIT PULL] ext4 changes for 4.2-rc1

2015-06-29 Thread Theodore Ts'o
On Mon, Jun 29, 2015 at 11:04:37AM +0200, Jan Kara wrote:
> 
> BTW, what did you use to trigger the error for you? The ext4 path where the
> assertion triggered for Linus is definitely correct so the assertion
> failure was a false positive.

I've managed to trigger it twice in about 5 or 6 full runs of
"./kvm-xfstests -g auto".  Once it was with generic/233 in 1k block
file system mode, the second time it was generic/233 in ext3 compat
mode.  i've tried running just generic/233, and it doesn't trigger.
"i.e., "./kvm-xfstests -C 10 generic/233" didn't trigger the bug.

(I'm currently on vacation, so I've been kicking off the run each
morning or evening and then checking to see if it blew up or not.)

Cheers,

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


Re: [RFC v2 PATCH 1/8] mm: add a new config to manage the code

2015-06-29 Thread Xishi Qiu
On 2015/6/29 14:50, Kamezawa Hiroyuki wrote:

> On 2015/06/27 11:23, Xishi Qiu wrote:
>> This patch introduces a new config called "CONFIG_ACPI_MIRROR_MEMORY", set it
>  CONFIG_MEMORY_MIRROR
>> off by default.
>>
>> Signed-off-by: Xishi Qiu 
>> ---
>>   mm/Kconfig | 8 
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/mm/Kconfig b/mm/Kconfig
>> index 390214d..c40bb8b 100644
>> --- a/mm/Kconfig
>> +++ b/mm/Kconfig
>> @@ -200,6 +200,14 @@ config MEMORY_HOTREMOVE
>>   depends on MEMORY_HOTPLUG && ARCH_ENABLE_MEMORY_HOTREMOVE
>>   depends on MIGRATION
>>
>> +config MEMORY_MIRROR
> 
>   In following patches, you use CONFIG_MEMORY_MIRROR.
> 
> I think the name is too generic besides it's depends on ACPI.
> But I'm not sure address based memory mirror is planned in other platform.
> 
> So, hmm. How about dividing the config into 2 parts like attached ? (just an 
> example)
> 

Seems like a good idea, thank you.

> Thanks,
> -Kame



--
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 02/12] f2fs: avoid to use failed inode immediately

2015-06-29 Thread Chao Yu
> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:39 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 02/12] f2fs: avoid to use failed inode immediately
> 
> Before iput is called, the inode number used by a bad inode can be reassigned
> to other new inode, resulting in any abnormal behaviors on the new inode.
> This should not happen for the new inode.

Nice catch!

Reviewed-by: Chao 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/


[PATCH v2 0/4] Add Mediatek MT8173 subsystem clocks support

2015-06-29 Thread James Liao
This patchset is based on 4.1-rc1 plus [1], and contains subsystem
clocks support for Mediatek MT8173.

There are many different implementation suggestions due to each subsystem
HW contains multiple functions, such as clock and reset controllers.

In this patch, I still put subsystem clock implementations in
drivers/clk/mediatek, no mater reset controllers may need to implement
in the same directory in the future. That's because many other vendors
also implement clock and reset controllers in drivers/clk, and it looks
like an acceptible way.

changes since v1:
- Add CA7PLL and CA15PLL as critical clocks.
- Use the same register descriptor for imgsys, vensys and vencltsys.
- Generalize apmixedsys special clocks registration.

[1] https://lkml.org/lkml/2015/5/21/97

James Liao (3):
  dt-bindings: ARM: Mediatek: Document devicetree bindings for clock
controllers
  clk: mediatek: Add subsystem clocks of MT8173
  clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS

Sascha Hauer (1):
  clk: mediatek: mt8173: Fix enabling of critical clocks

 .../bindings/arm/mediatek/mediatek,imgsys.txt  |  22 +
 .../bindings/arm/mediatek/mediatek,mmsys.txt   |  22 +
 .../bindings/arm/mediatek/mediatek,vdecsys.txt |  22 +
 .../bindings/arm/mediatek/mediatek,vencltsys.txt   |  22 +
 .../bindings/arm/mediatek/mediatek,vencsys.txt |  22 +
 drivers/clk/mediatek/clk-mt8173.c  | 467 -
 drivers/clk/mediatek/clk-pll.c |   7 +-
 include/dt-bindings/clock/mt8173-clk.h |  94 -
 8 files changed, 664 insertions(+), 14 deletions(-)
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,vencltsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt

--
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 v2 3/4] clk: mediatek: Add subsystem clocks of MT8173

2015-06-29 Thread James Liao
Most multimedia subsystem clocks will be accessed by multiple
drivers, so it's a better way to manage these clocks in CCF.
This patch adds clock support for MM, IMG, VDEC, VENC and VENC_LT
subsystems.

Signed-off-by: James Liao 
---
 drivers/clk/mediatek/clk-mt8173.c  | 298 +
 include/dt-bindings/clock/mt8173-clk.h |  91 +-
 2 files changed, 387 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8173.c 
b/drivers/clk/mediatek/clk-mt8173.c
index c483336..75be757 100644
--- a/drivers/clk/mediatek/clk-mt8173.c
+++ b/drivers/clk/mediatek/clk-mt8173.c
@@ -700,6 +700,183 @@ static const struct mtk_composite peri_clks[] __initconst 
= {
MUX(CLK_PERI_UART3_SEL, "uart3_ck_sel", uart_ck_sel_parents, 0x40c, 3, 
1),
 };
 
+static struct mtk_gate_regs cg_regs_4_8_0 = {
+   .set_ofs = 0x0004,
+   .clr_ofs = 0x0008,
+   .sta_ofs = 0x,
+};
+
+#define GATE_IMG(_id, _name, _parent, _shift) {\
+   .id = _id,  \
+   .name = _name,  \
+   .parent_name = _parent, \
+   .regs = &cg_regs_4_8_0, \
+   .shift = _shift,\
+   .ops = &mtk_clk_gate_ops_setclr,\
+   }
+
+static struct mtk_gate img_clks[] __initdata = {
+   GATE_IMG(CLK_IMG_LARB2_SMI, "img_larb2_smi", "mm_sel", 0),
+   GATE_IMG(CLK_IMG_CAM_SMI, "img_cam_smi", "mm_sel", 5),
+   GATE_IMG(CLK_IMG_CAM_CAM, "img_cam_cam", "mm_sel", 6),
+   GATE_IMG(CLK_IMG_SEN_TG, "img_sen_tg", "camtg_sel", 7),
+   GATE_IMG(CLK_IMG_SEN_CAM, "img_sen_cam", "mm_sel", 8),
+   GATE_IMG(CLK_IMG_CAM_SV, "img_cam_sv", "mm_sel", 9),
+   GATE_IMG(CLK_IMG_FD, "img_fd", "mm_sel", 11),
+};
+
+static struct mtk_gate_regs mm0_cg_regs = {
+   .set_ofs = 0x0104,
+   .clr_ofs = 0x0108,
+   .sta_ofs = 0x0100,
+};
+
+static struct mtk_gate_regs mm1_cg_regs = {
+   .set_ofs = 0x0114,
+   .clr_ofs = 0x0118,
+   .sta_ofs = 0x0110,
+};
+
+#define GATE_MM0(_id, _name, _parent, _shift) {\
+   .id = _id,  \
+   .name = _name,  \
+   .parent_name = _parent, \
+   .regs = &mm0_cg_regs,   \
+   .shift = _shift,\
+   .ops = &mtk_clk_gate_ops_setclr,\
+   }
+
+#define GATE_MM1(_id, _name, _parent, _shift) {\
+   .id = _id,  \
+   .name = _name,  \
+   .parent_name = _parent, \
+   .regs = &mm1_cg_regs,   \
+   .shift = _shift,\
+   .ops = &mtk_clk_gate_ops_setclr,\
+   }
+
+static struct mtk_gate mm_clks[] __initdata = {
+   /* MM0 */
+   GATE_MM0(CLK_MM_SMI_COMMON, "mm_smi_common", "mm_sel", 0),
+   GATE_MM0(CLK_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 1),
+   GATE_MM0(CLK_MM_CAM_MDP, "mm_cam_mdp", "mm_sel", 2),
+   GATE_MM0(CLK_MM_MDP_RDMA0, "mm_mdp_rdma0", "mm_sel", 3),
+   GATE_MM0(CLK_MM_MDP_RDMA1, "mm_mdp_rdma1", "mm_sel", 4),
+   GATE_MM0(CLK_MM_MDP_RSZ0, "mm_mdp_rsz0", "mm_sel", 5),
+   GATE_MM0(CLK_MM_MDP_RSZ1, "mm_mdp_rsz1", "mm_sel", 6),
+   GATE_MM0(CLK_MM_MDP_RSZ2, "mm_mdp_rsz2", "mm_sel", 7),
+   GATE_MM0(CLK_MM_MDP_TDSHP0, "mm_mdp_tdshp0", "mm_sel", 8),
+   GATE_MM0(CLK_MM_MDP_TDSHP1, "mm_mdp_tdshp1", "mm_sel", 9),
+   GATE_MM0(CLK_MM_MDP_WDMA, "mm_mdp_wdma", "mm_sel", 11),
+   GATE_MM0(CLK_MM_MDP_WROT0, "mm_mdp_wrot0", "mm_sel", 12),
+   GATE_MM0(CLK_MM_MDP_WROT1, "mm_mdp_wrot1", "mm_sel", 13),
+   GATE_MM0(CLK_MM_FAKE_ENG, "mm_fake_eng", "mm_sel", 14),
+   GATE_MM0(CLK_MM_MUTEX_32K, "mm_mutex_32k", "rtc_sel", 15),
+   GATE_MM0(CLK_MM_DISP_OVL0, "mm_disp_ovl0", "mm_sel", 16),
+   GATE_MM0(CLK_MM_DISP_OVL1, "mm_disp_ovl1", "mm_sel", 17),
+   GATE_MM0(CLK_MM_DISP_RDMA0, "mm_disp_rdma0", "mm_sel", 18),
+   GATE_MM0(CLK_MM_DISP_RDMA1, "mm_disp_rdma1", "mm_sel", 19),
+   GATE_MM0(CLK_MM_DISP_RDMA2, "mm_disp_rdma2", "mm_sel", 20),
+   GATE_MM0(CLK_MM_DISP_WDMA0, "mm_disp_wdma0", "mm_sel", 21),
+   GATE_MM0(CLK_MM_DISP_WDMA1, "mm_disp_wdma1", "mm_sel", 22),
+   GATE_MM0(CLK_MM_DISP_COLOR0, "mm_disp_color0", "mm_sel", 23),
+   GATE_MM0(CLK_MM_DISP_COLOR1, "mm_disp_color1", "mm_sel", 24),
+   GATE_MM0(CLK_MM_DISP_AAL, "mm_disp_aal", "mm_sel", 25),
+   GATE_MM0(CLK_MM_DISP_GAMMA, "mm_disp_gamma", "mm_sel", 26),
+   GATE_MM0(CLK_MM_DISP_UFOE, "mm_disp_ufoe", "mm_sel", 27),
+   GATE_MM0(CLK_M

RE: [f2fs-dev] [PATCH 03/12] f2fs: convert inline_data for various fallocate

2015-06-29 Thread Chao Yu
> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:39 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 03/12] f2fs: convert inline_data for various 
> fallocate
> 
> For newly added fallocate types, it should convert inline_data before handling
> block swapping.
> 
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao 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/


[PATCH v2 4/4] clk: mediatek: Add USB clock support in MT8173 APMIXEDSYS

2015-06-29 Thread James Liao
Add REF2USB_TX clock support into MT8173 APMIXEDSYS. This clock
is needed by USB 3.0.

Signed-off-by: James Liao 
---
 drivers/clk/mediatek/clk-mt8173.c  | 143 +
 drivers/clk/mediatek/clk-pll.c |   7 +-
 include/dt-bindings/clock/mt8173-clk.h |   3 +-
 3 files changed, 146 insertions(+), 7 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8173.c 
b/drivers/clk/mediatek/clk-mt8173.c
index 75be757..333b6af 100644
--- a/drivers/clk/mediatek/clk-mt8173.c
+++ b/drivers/clk/mediatek/clk-mt8173.c
@@ -12,6 +12,7 @@
  * GNU General Public License for more details.
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -968,6 +969,141 @@ static void __init mtk_pericfg_init(struct device_node 
*node)
 }
 CLK_OF_DECLARE(mtk_pericfg, "mediatek,mt8173-pericfg", mtk_pericfg_init);
 
+#define REF2USB_TX_EN  BIT(0)
+#define REF2USB_TX_LPF_EN  BIT(1)
+#define REF2USB_TX_OUT_EN  BIT(2)
+#define REF2USB_EN_MASK(REF2USB_TX_EN | REF2USB_TX_LPF_EN | \
+REF2USB_TX_OUT_EN)
+
+struct mtk_ref2usb_tx {
+   struct clk_hw   hw;
+   void __iomem*base_addr;
+};
+
+static inline struct mtk_ref2usb_tx *to_mtk_ref2usb_tx(struct clk_hw *hw)
+{
+   return container_of(hw, struct mtk_ref2usb_tx, hw);
+}
+
+static int mtk_ref2usb_tx_is_prepared(struct clk_hw *hw)
+{
+   struct mtk_ref2usb_tx *tx = to_mtk_ref2usb_tx(hw);
+
+   return (readl(tx->base_addr) & REF2USB_EN_MASK) == REF2USB_EN_MASK;
+}
+
+static int mtk_ref2usb_tx_prepare(struct clk_hw *hw)
+{
+   struct mtk_ref2usb_tx *tx = to_mtk_ref2usb_tx(hw);
+   u32 val;
+
+   val = readl(tx->base_addr);
+
+   val |= REF2USB_TX_EN;
+   writel(val, tx->base_addr);
+   udelay(100);
+
+   val |= REF2USB_TX_LPF_EN;
+   writel(val, tx->base_addr);
+
+   val |= REF2USB_TX_OUT_EN;
+   writel(val, tx->base_addr);
+
+   return 0;
+}
+
+static void mtk_ref2usb_tx_unprepare(struct clk_hw *hw)
+{
+   struct mtk_ref2usb_tx *tx = to_mtk_ref2usb_tx(hw);
+   u32 val;
+
+   val = readl(tx->base_addr);
+   val &= ~REF2USB_EN_MASK;
+   writel(val, tx->base_addr);
+}
+
+static const struct clk_ops mtk_ref2usb_tx_ops = {
+   .is_prepared= mtk_ref2usb_tx_is_prepared,
+   .prepare= mtk_ref2usb_tx_prepare,
+   .unprepare  = mtk_ref2usb_tx_unprepare,
+};
+
+static struct clk *mtk_clk_register_ref2usb_tx(const char *name,
+   const char *parent_name, void __iomem *reg)
+{
+   struct mtk_ref2usb_tx *tx;
+   struct clk_init_data init = {};
+   struct clk *clk;
+
+   tx = kzalloc(sizeof(*tx), GFP_KERNEL);
+   if (!tx)
+   return ERR_PTR(-ENOMEM);
+
+   tx->base_addr = reg;
+   tx->hw.init = &init;
+
+   init.name = name;
+   init.ops = &mtk_ref2usb_tx_ops;
+   init.parent_names = &parent_name;
+   init.num_parents = 1;
+
+   clk = clk_register(NULL, &tx->hw);
+
+   if (IS_ERR(clk)) {
+   pr_err("Failed to register clk %s: %ld\n", name, PTR_ERR(clk));
+   kfree(tx);
+   }
+
+   return clk;
+}
+
+struct mtk_apmixed_ex {
+   int id;
+   const char *name;
+   const char *parent;
+   u32 reg_ofs;
+};
+
+#define APMIXED_EX(_id, _name, _parent, _reg_ofs) {\
+   .id = _id,  \
+   .name = _name,  \
+   .parent = _parent,  \
+   .reg_ofs = _reg_ofs,\
+   }
+
+static const struct mtk_apmixed_ex apmixed_ex[] = {
+   APMIXED_EX(CLK_APMIXED_REF2USB_TX, "ref2usb_tx", "clk26m", 0x8),
+};
+
+static void __init mtk_clk_register_apmixedsys_special(struct device_node 
*node,
+   struct clk_onecell_data *clk_data)
+{
+   void __iomem *base;
+   struct clk *clk;
+   int i;
+
+   base = of_iomap(node, 0);
+   if (!base) {
+   pr_err("%s(): ioremap failed\n", __func__);
+   return;
+   }
+
+   for (i = 0; i < ARRAY_SIZE(apmixed_ex); i++) {
+   const struct mtk_apmixed_ex *ape = &apmixed_ex[i];
+
+   clk = mtk_clk_register_ref2usb_tx(ape->name, ape->parent,
+   base + ape->reg_ofs);
+
+   if (IS_ERR(clk)) {
+   pr_err("Failed to register clk %s: %ld\n", ape->name,
+   PTR_ERR(clk));
+   continue;
+   }
+
+   clk_data->clks[CLK_APMIXED_REF2USB_TX] = clk;
+   }
+}
+
 #define MT8173_PLL_FMAX(3000UL * MHZ)
 
 #define CON0_MT8173_RST_BARBIT(24)
@@ -1010,12 +1146,19 @@ static const struct mtk_pll_data plls[] = {
 static void __init mtk_apmixedsys_init(struct device_node *node)
 {
struct c

[PATCH v2 1/4] clk: mediatek: mt8173: Fix enabling of critical clocks

2015-06-29 Thread James Liao
From: Sascha Hauer 

On the MT8173 the clocks are provided by different units. To enable
the critical clocks we must be sure that all parent clocks are already
registered, otherwise the parents of the critical clocks end up being
unused and get disabled later. To find a place where all parents are
registered we try each time after we've registered some clocks if
all known providers are present now and only then we enable the critical
clocks

Signed-off-by: Sascha Hauer 
Signed-off-by: James Liao 
---
 drivers/clk/mediatek/clk-mt8173.c | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/mediatek/clk-mt8173.c 
b/drivers/clk/mediatek/clk-mt8173.c
index 4b9e04c..c483336 100644
--- a/drivers/clk/mediatek/clk-mt8173.c
+++ b/drivers/clk/mediatek/clk-mt8173.c
@@ -700,6 +700,22 @@ static const struct mtk_composite peri_clks[] __initconst 
= {
MUX(CLK_PERI_UART3_SEL, "uart3_ck_sel", uart_ck_sel_parents, 0x40c, 3, 
1),
 };
 
+static struct clk_onecell_data *mt8173_top_clk_data;
+static struct clk_onecell_data *mt8173_pll_clk_data;
+
+static void mtk_clk_enable_critical(void)
+{
+   if (!mt8173_top_clk_data || !mt8173_pll_clk_data)
+   return;
+
+   clk_prepare_enable(mt8173_pll_clk_data->clks[CLK_APMIXED_ARMCA15PLL]);
+   clk_prepare_enable(mt8173_pll_clk_data->clks[CLK_APMIXED_ARMCA7PLL]);
+   clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_MEM_SEL]);
+   clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_DDRPHYCFG_SEL]);
+   clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_CCI400_SEL]);
+   clk_prepare_enable(mt8173_top_clk_data->clks[CLK_TOP_RTC_SEL]);
+}
+
 static void __init mtk_topckgen_init(struct device_node *node)
 {
struct clk_onecell_data *clk_data;
@@ -712,19 +728,19 @@ static void __init mtk_topckgen_init(struct device_node 
*node)
return;
}
 
-   clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
+   mt8173_top_clk_data = clk_data = mtk_alloc_clk_data(CLK_TOP_NR_CLK);
 
mtk_clk_register_factors(root_clk_alias, ARRAY_SIZE(root_clk_alias), 
clk_data);
mtk_clk_register_factors(top_divs, ARRAY_SIZE(top_divs), clk_data);
mtk_clk_register_composites(top_muxes, ARRAY_SIZE(top_muxes), base,
&mt8173_clk_lock, clk_data);
 
-   clk_prepare_enable(clk_data->clks[CLK_TOP_CCI400_SEL]);
-
r = of_clk_add_provider(node, of_clk_src_onecell_get, clk_data);
if (r)
pr_err("%s(): could not register clock provider: %d\n",
__func__, r);
+
+   mtk_clk_enable_critical();
 }
 CLK_OF_DECLARE(mtk_topckgen, "mediatek,mt8173-topckgen", mtk_topckgen_init);
 
@@ -818,13 +834,13 @@ static void __init mtk_apmixedsys_init(struct device_node 
*node)
 {
struct clk_onecell_data *clk_data;
 
-   clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
+   mt8173_pll_clk_data = clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
if (!clk_data)
return;
 
mtk_clk_register_plls(node, plls, ARRAY_SIZE(plls), clk_data);
 
-   clk_prepare_enable(clk_data->clks[CLK_APMIXED_ARMCA15PLL]);
+   mtk_clk_enable_critical();
 }
 CLK_OF_DECLARE(mtk_apmixedsys, "mediatek,mt8173-apmixedsys",
mtk_apmixedsys_init);
-- 
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 v2 2/4] dt-bindings: ARM: Mediatek: Document devicetree bindings for clock controllers

2015-06-29 Thread James Liao
This adds the binding documentation for the mmsys, imgsys, vdecsys,
vencsys and vencltsys controllers found on Mediatek SoCs.

Signed-off-by: James Liao 
---
 .../bindings/arm/mediatek/mediatek,imgsys.txt  | 22 ++
 .../bindings/arm/mediatek/mediatek,mmsys.txt   | 22 ++
 .../bindings/arm/mediatek/mediatek,vdecsys.txt | 22 ++
 .../bindings/arm/mediatek/mediatek,vencltsys.txt   | 22 ++
 .../bindings/arm/mediatek/mediatek,vencsys.txt | 22 ++
 5 files changed, 110 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,vencltsys.txt
 create mode 100644 
Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt

diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
new file mode 100644
index 000..7612bac
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,imgsys.txt
@@ -0,0 +1,22 @@
+Mediatek imgsys controller
+
+
+The Mediatek imgsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt8173-imgsys", "syscon"
+- #clock-cells: Must be 1
+
+The imgsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+imgsys: imgsys@1500 {
+   compatible = "mediatek,mt8173-imgsys", "syscon";
+   reg = <0 0x1500 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt
new file mode 100644
index 000..b51e417
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mmsys.txt
@@ -0,0 +1,22 @@
+Mediatek mmsys controller
+
+
+The Mediatek mmsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt8173-mmsys", "syscon"
+- #clock-cells: Must be 1
+
+The mmsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+mmsys: mmsys@1400 {
+   compatible = "mediatek,mt8173-mmsys", "syscon";
+   reg = <0 0x1400 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git 
a/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt
new file mode 100644
index 000..a5b94a7
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vdecsys.txt
@@ -0,0 +1,22 @@
+Mediatek vdecsys controller
+
+
+The Mediatek vdecsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt8173-vdecsys", "syscon"
+- #clock-cells: Must be 1
+
+The vdecsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+vdecsys: vdecsys@1600 {
+   compatible = "mediatek,mt8173-vdecsys", "syscon";
+   reg = <0 0x1600 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git 
a/Documentation/devicetree/bindings/arm/mediatek/mediatek,vencltsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vencltsys.txt
new file mode 100644
index 000..3d4e8d8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vencltsys.txt
@@ -0,0 +1,22 @@
+Mediatek vencltsys controller
+
+
+The Mediatek vencltsys controller provides various clocks to the system.
+
+Required Properties:
+
+- compatible: Should be:
+   - "mediatek,mt8173-vencltsys", "syscon"
+- #clock-cells: Must be 1
+
+The vencltsys controller uses the common clk binding from
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+The available clocks are defined in dt-bindings/clock/mt*-clk.h.
+
+Example:
+
+vencltsys: vencltsys@1900 {
+   compatible = "mediatek,mt8173-vencltsys", "syscon";
+   reg = <0 0x1900 0 0x1000>;
+   #clock-cells = <1>;
+};
diff --git 
a/Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt 
b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt
new file mode 100644
index 000..e5b72f5
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,vencsys.txt
@@ -0,0 +1,22 @@
+M

RE: [f2fs-dev] [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging extents

2015-06-29 Thread Chao Yu
Hi Jaegeuk,

> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:39 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 04/12] f2fs: remove wrong f2fs_bug_on when merging 
> extents
> 
> In f2fs_update_extent_tree, if there is existing extent, f2fs tries to split
> it with two parts.
> In each trial, __insert_extent_tree checks __is_front/back_mergeable, and then
> if it hits to go, there is f2fs_bug_on(!den), which triggers a kernel panic.
> 
> Actually, we don't need to check this. Instead, we can do __try_back_merge 
> only
> when there exists a den pointer.
> 
> Signed-off-by: Jaegeuk Kim 
> ---
>  fs/f2fs/data.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 9bedfa8..7817167 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -519,19 +519,19 @@ static struct extent_node *__insert_extent_tree(struct 
> f2fs_sb_info *sbi,
> 
>   if (ei->fofs < en->ei.fofs) {
>   if (__is_front_mergeable(ei, &en->ei)) {
> - f2fs_bug_on(sbi, !den);

I add a BUG_ON here because we assume that in extent cache there is no such 
two extents whose mapping address is continuous but without being merged,
since whenever we add a new extent(not splitted one) into cache, we tries to
merge it frontward/backward, then all extent with continuous mapping should be
merged. So when we split one extent to two parts, each part should not be able
to merge with others. Otherwise it should be a bug.

Is there some special case to trigger this BUG_ON?

Thanks,

>   en->ei.fofs = ei->fofs;
>   en->ei.blk = ei->blk;
>   en->ei.len += ei->len;
> - *den = __try_back_merge(sbi, et, en);
> + if (den)
> + *den = __try_back_merge(sbi, et, en);
>   return en;
>   }
>   p = &(*p)->rb_left;
>   } else if (ei->fofs >= en->ei.fofs + en->ei.len) {
>   if (__is_back_mergeable(ei, &en->ei)) {
> - f2fs_bug_on(sbi, !den);
>   en->ei.len += ei->len;
> - *den = __try_front_merge(sbi, et, en);
> + if (den)
> + *den = __try_front_merge(sbi, et, en);
>   return en;
>   }
>   p = &(*p)->rb_right;
> --
> 2.1.1
> 
> 
> --
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> ___
> Linux-f2fs-devel mailing list
> linux-f2fs-de...@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

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


[PATCH 2/2] perf,tools: check and re-organize evsel cpu maps

2015-06-29 Thread kan . liang
From: Kan Liang 

Some PMU events have cpumask, e.g uncore events. The cpu list set by
user may be incompatible with event's cpumask.
This patch will check the user defined cpu list. If the incompatible cpu
is found, it will warn the user and discard the incompatible cpu. Only
available cpu can be stored in evsel->cpus->map. If there is no cpu from
cpu list compatible with event's cpumask. It will error out.

Here is an example.
According to cpumask, uncore should only available on CPU0 and CPU18.
So the S0-C1 for uncore should not count.

Without this patch
 $ sudo ./perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,1,18
--per-core sleep 2

 Performance counter stats for 'CPU(s) 0,1,18':

S0-C0   16749638  cycles
S0-C0   1   0.83 MiB  uncore_imc_0/cas_count_read/
(100.00%)
S0-C1   1 232421  cycles
S0-C1   1   0.83 MiB  uncore_imc_0/cas_count_read/
S1-C0   1 236997  cycles
S1-C0   1   0.35 MiB  uncore_imc_0/cas_count_read/

   2.001094019 seconds time elapsed

With this patch
 $ perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,1,18 --per-core
sleep 2
event uncore_imc_0/cas_count_read/ can only be monitored on CPU 0 18.
Other CPUs will be discard.

 Performance counter stats for 'CPU(s) 0,1,18':

S0-C0   15557406  cycles
S0-C0   1   0.21 MiB  uncore_imc_0/cas_count_read/
S0-C1   11012534  cycles
S0-C1   0   MiB  uncore_imc_0/cas_count_read/
S1-C0   1 916130  cycles
S1-C0   1   0.08 MiB  uncore_imc_0/cas_count_read/

   2.001110843 seconds time elapsed

Signed-off-by: Kan Liang 
---
 tools/perf/util/evlist.c | 77 
 1 file changed, 72 insertions(+), 5 deletions(-)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 6cfdee6..f179379 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1101,6 +1101,71 @@ int perf_evlist__mmap(struct perf_evlist *evlist, 
unsigned int pages,
return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false);
 }
 
+static int cmp_ids(const void *a, const void *b)
+{
+   return *(int *)a - *(int *)b;
+}
+
+static int perf_evlist__check_evsel_cpus(struct perf_evlist *evlist, struct 
perf_evsel *evsel)
+{
+   const struct cpu_map *cpus = evlist->cpus;
+   const int ncpus = cpu_map__nr(evlist->cpus);
+   int j = 0, cpu_nr = 0, tmp = 0;
+   int i;
+
+   /* ensure we process id in increasing order */
+   qsort(evlist->cpus->map, evlist->cpus->nr, sizeof(int), cmp_ids);
+
+   /* find the common cpus between evsel and evlist. */
+   for (i = 0; i < cpu_map__nr(evsel->cpus);)  {
+
+   if (j >= ncpus) {
+   evsel->cpus->map[i++] = -1;
+   continue;
+   }
+   for (; j < ncpus; j++) {
+   if (cpus->map[j] < evsel->cpus->map[i])
+   continue;
+   if (cpus->map[j] == evsel->cpus->map[i]) {
+   cpu_nr++;
+   j++;
+   i++;
+   } else
+   evsel->cpus->map[i++] = -1;
+   break;
+   }
+   }
+
+   if (cpu_nr == 0) {
+   pr_warning("event %s cannot be monitored on the given cpus."
+  "Please check cpumask\n", evsel->name);
+   return -1;
+   }
+
+   if (ncpus > cpu_nr)
+   pr_warning("event %s can only be monitored on CPU", 
evsel->name);
+
+   /* order evsel cpus */
+   for (i = 0; i < cpu_nr; i++) {
+   if (evsel->cpus->map[i] == -1) {
+   while (evsel->cpus->map[tmp] == -1) {
+   tmp++;
+   BUG_ON(tmp >= cpu_map__nr(evsel->cpus));
+   }
+   evsel->cpus->map[i] = evsel->cpus->map[tmp];
+   evsel->cpus->map[tmp] = -1;
+   }
+   if (ncpus > cpu_nr)
+   pr_warning(" %d", evsel->cpus->map[i]);
+   tmp++;
+   }
+   evsel->cpus->nr = cpu_nr;
+   if (ncpus > cpu_nr)
+   pr_warning(". Other CPUs will be discard.\n");
+
+   return 0;
+}
+
 static int perf_evlist__propagate_maps(struct perf_evlist *evlist,
   struct target *target)
 {
@@ -1108,13 +1173,15 @@ static int perf_evlist__propagate_maps(struct 
perf_evlist *evlist,
 
evlist__for_each(evlist, evsel) {
/*
-* We already have cpus for evsel (via PMU sysfs) so
-* keep it, if there's no target cpu list defined.
+* We already have cpus for evsel

[PATCH 1/2] perf,tools: get correct cpu id for print_aggr

2015-06-29 Thread kan . liang
From: Kan Liang 

print_aggr fails to print per-core/per-socket statistics after commit
b7f0c203586b ("perf evlist: Propagate cpu maps to evsels in an evlist"),
if events have differnt cpus. Because in print_aggr, aggr_get_id needs
index (not cpu id) to find core/pkg id.
This patch introduced perf_evsel__get_cpumap_index to get the index by
cpu id for a given event. The index can be used to find correct cpu id
for print_aggr.

Here is an example.
Counting events cycles,uncore_imc_0/cas_count_read/. (Uncore event has
cpumask 0,18)

"perf stat -e cycles,uncore_imc_0/cas_count_read/ -C0,18 --per-core
sleep 2"

Without this patch, it failes to get CPU 18 result.
 Performance counter stats for 'CPU(s) 0,18':

S0-C0   17526851  cycles
S0-C0   1   1.05 MiB  uncore_imc_0/cas_count_read/
S1-C0   0cycles
S1-C0   0   MiB  uncore_imc_0/cas_count_read/

With this patch, it can get both CPU0 and CPU18 result.
 Performance counter stats for 'CPU(s) 0,18':

S0-C0   16327768  cycles
S0-C0   1   0.47 MiB  uncore_imc_0/cas_count_read/
S1-C0   1 330228  cycles
S1-C0   1   0.29 MiB  uncore_imc_0/cas_count_read/

Signed-off-by: Kan Liang 
---
 tools/perf/builtin-stat.c |  1 +
 tools/perf/util/cpumap.c  |  4 ++--
 tools/perf/util/evsel.c   | 14 ++
 tools/perf/util/evsel.h   |  2 ++
 4 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 37e301a..a3ea735 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -708,6 +708,7 @@ static void print_aggr(char *prefix)
nr = 0;
for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); 
cpu++) {
cpu2 = perf_evsel__cpus(counter)->map[cpu];
+   cpu2 = perf_evsel__get_cpumap_index(cpu2, 
evsel_list->cpus);
s2 = aggr_get_id(evsel_list->cpus, cpu2);
if (s2 != id)
continue;
diff --git a/tools/perf/util/cpumap.c b/tools/perf/util/cpumap.c
index 3667e21..34843e5 100644
--- a/tools/perf/util/cpumap.c
+++ b/tools/perf/util/cpumap.c
@@ -232,7 +232,7 @@ int cpu_map__get_socket(struct cpu_map *map, int idx)
char path[PATH_MAX];
int cpu, ret;
 
-   if (idx > map->nr)
+   if ((idx > map->nr) || (idx < 0))
return -1;
 
cpu = map->map[idx];
@@ -296,7 +296,7 @@ int cpu_map__get_core(struct cpu_map *map, int idx)
char path[PATH_MAX];
int cpu, ret, s;
 
-   if (idx > map->nr)
+   if ((idx > map->nr) || (idx < 0))
return -1;
 
cpu = map->map[idx];
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 2936b30..32094d3 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -974,6 +974,20 @@ int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
return 0;
 }
 
+int perf_evsel__get_cpumap_index(int cpu, struct cpu_map *evsel_cpus)
+{
+   int i;
+
+   if (evsel_cpus == NULL)
+   return -1;
+
+   for (i = 0; i < evsel_cpus->nr; i++) {
+   if (cpu == evsel_cpus->map[i])
+   return i;
+   }
+   return -1;
+}
+
 static int get_group_fd(struct perf_evsel *evsel, int cpu, int thread)
 {
struct perf_evsel *leader = evsel->leader;
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 4a7ed56..05e68a0 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -355,4 +355,6 @@ typedef int (*attr__fprintf_f)(FILE *, const char *, const 
char *, void *);
 int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr,
 attr__fprintf_f attr__fprintf, void *priv);
 
+int perf_evsel__get_cpumap_index(int cpu, struct cpu_map *evsel_cpus);
+
 #endif /* __PERF_EVSEL_H */
-- 
1.8.3.1

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


RE: [f2fs-dev] [PATCH 05/12] f2fs: fix wrong block address calculation for a split extent

2015-06-29 Thread Chao Yu
Hi Jaegeuk,

> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:39 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 05/12] f2fs: fix wrong block address calculation 
> for a split extent
> 
> This patch fixes wrong calculation on block address field when an extent is
> split.

Oh, that's a terrible mistake, sorry about it.
Thank you for fixing this.

> 
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao 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: [f2fs-dev] [PATCH 06/12] f2fs: update on-disk extents even under extent_cache

2015-06-29 Thread Chao Yu
> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:40 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 06/12] f2fs: update on-disk extents even under 
> extent_cache
> 
> Previously, f2fs_update_extent_cache() updates in-memory extent_cache all the
> time, and then finally preserves its up-to-date extent into on-disk one during
> f2fs_evict_inode.
> 
> But, in the following scenario:
> 
> 1. mount
> 2. open & write an extent X
> 3. f2fs_evict_inode; on-disk extent is X
> 4. open & update the extent X with Y
> 5. sync; trigger checkpoint
> 6. power-cut
> 
> after power-on, f2fs should serve extent Y, but we have an on-disk extent X.
> 
> This causes a failure on xfstests/311.
> 
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao 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: drm/mgag200: doesn't work in panic context

2015-06-29 Thread Rui Wang
On Monday, June 29, 2015 5:25 PM, Daniel Vetter  wrote:
> As long as the display is up and running we should have a fair stab at
> showing the oops - it's just that no one has seriously bothered with
> the necessary infastructure, automated testing (it won't work
> otherwise) and driver work.

I think testing can be done by injecting a fatal machine check exception
via einj's debugfs interface. I can reproduce the hard hang every time.
I think It can be a simple script or C program do to the automated testing.
If anyone has any patch I'll be happy to help test it out.

Thanks
Rui
--
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] usb: chipidea: Wait 50 ms before reading ID bit

2015-06-29 Thread Peter Chen
On Fri, Jun 26, 2015 at 03:47:04PM +0200, Mike Looijmans wrote:
> The datasheet for the USB343x PHY mentions a 50ms wait time before
> reading back the ID bit after enabling the internal pull-up or a
> reset:
> "To monitor the status of the ID pin, the Link activates the IdPullup
> bit in the OTG Control register, waits 50mS and then reads the status
> of the IdGnd bit in the USB Interrupt Status register."
> Implement this by adding a 50ms sleep at the only point in the code
> where the ID status is being read without IRQ trigger.

This 50mS delay is dedicated for this PHY, you may add it at the
PHY driver.

> 
> When starting the board with a USB cable connected to a PC, the
> system would activate host mode, then in ~20ms get an ID IRQ and
> attempt to switch to gadget mode. This then failed because the
> VBUS will not drop to zero (because the host is supplying it).
> 
> After this patch, the system starts up correctly and selects
> gadget mode immediately, and the USB link works. It also fixes
> the issue that the VBUS supply was being activated while already
> being supplied from the host PC.
> 
> Signed-off-by: Mike Looijmans 
> ---
>  drivers/usb/chipidea/core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index c865abe..4c6cf48 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -801,6 +801,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
>  
>   if (ci->roles[CI_ROLE_HOST] && ci->roles[CI_ROLE_GADGET]) {
>   if (ci->is_otg) {
> + msleep(50); /* Datasheet: Wait 50ms to read ID */
>   ci->role = ci_otg_role(ci);
>   /* Enable ID change irq */
>   hw_write_otgsc(ci, OTGSC_IDIE, OTGSC_IDIE);
> -- 
> 1.9.1
> 

-- 

Best Regards,
Peter Chen
--
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 07/12] f2fs: set cached_en after checking finally

2015-06-29 Thread Chao Yu
> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:40 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 07/12] f2fs: set cached_en after checking finally
> 
> This patch relocates cached_en not only to be covered by spin_lock, but also
> to set once after checking out completely.
> 
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao 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 1/1] cxl/vphb.c: Use phb pointer after NULL check

2015-06-29 Thread Ian Munsie
Acked-by: Ian Munsie 

--
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] Update kernel math-emu code from current glibc soft-fp

2015-06-29 Thread Michael Ellerman
On Mon, 2015-06-22 at 13:26 +, Joseph Myers wrote:
> From: Joseph Myers 
> 
> The include/math-emu code (used for alpha powerpc sh sparc, and to a
> very limited extent for s390) was taken from an old version of glibc's
> soft-fp code around 15 years ago (in the pre-git era, anyway, and some

...

> This patch is unchanged from that posted at 
> , still applies to current sources 
> and is proposed for 4.2.


Hi Joseph,

This is an awesome effort, and greatly appreciated.

However in it's current form it's not easily mergeable, because it touches five
architectures and has the potential to cause breakage on all of them.

It's also too late for 4.2. The merge window for 4.2 is open now, which means
arch maintainers have stopped taking intrusive patches 1-2 weeks ago.

Is there some way you can imagine of splitting this up into smaller chunks, so
that different arches can merge the pieces separately?

cheers


 arch/alpha/include/asm/sfp-machine.h|3 
 arch/alpha/math-emu/math.c  |  131 -
 arch/powerpc/include/asm/sfp-machine.h  |   39 
 arch/powerpc/math-emu/fadd.c|6 
 arch/powerpc/math-emu/fadds.c   |6 
 arch/powerpc/math-emu/fcmpo.c   |2 
 arch/powerpc/math-emu/fcmpu.c   |2 
 arch/powerpc/math-emu/fctiw.c   |2 
 arch/powerpc/math-emu/fctiwz.c  |2 
 arch/powerpc/math-emu/fmadd.c   |8 
 arch/powerpc/math-emu/fmadds.c  |8 
 arch/powerpc/math-emu/fmsub.c   |8 
 arch/powerpc/math-emu/fmsubs.c  |8 
 arch/powerpc/math-emu/fnmadd.c  |8 
 arch/powerpc/math-emu/fnmadds.c |8 
 arch/powerpc/math-emu/fnmsub.c  |8 
 arch/powerpc/math-emu/fnmsubs.c |8 
 arch/powerpc/math-emu/fsub.c|6 
 arch/powerpc/math-emu/fsubs.c   |6 
 arch/powerpc/math-emu/lfs.c |   11 
 arch/powerpc/math-emu/math_efp.c|  254 +-
 arch/powerpc/math-emu/stfs.c|6 
 arch/s390/include/asm/sfp-machine.h |   10 
 arch/s390/kernel/sysinfo.c  |   11 
 arch/sh/include/asm/sfp-machine.h   |   10 
 arch/sh/math-emu/math.c |   51 
 arch/sparc/include/asm/sfp-machine_32.h |3 
 arch/sparc/include/asm/sfp-machine_64.h |3 
 arch/sparc/math-emu/math_32.c   |  144 -
 arch/sparc/math-emu/math_64.c   |  140 -
 include/math-emu/double.h   |  398 ++--
 include/math-emu/op-1.h |  554 +++---
 include/math-emu/op-2.h | 1136 ++--
 include/math-emu/op-4.h | 1457 ---
 include/math-emu/op-8.h |  211 +-
 include/math-emu/op-common.h| 2927 ++--
 include/math-emu/quad.h |  434 +++-
 include/math-emu/single.h   |  233 +-
 include/math-emu/soft-fp.h  |  367 ++--
 39 files changed, 5433 insertions(+), 3196 deletions(-)




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


Re: [PATCH 1/2] Move the pt_regs_offset struct definition from arch to common include file

2015-06-29 Thread Michael Ellerman
On Wed, 2015-06-17 at 14:30 -0400, David Long wrote:
> On 06/16/15 09:17, Rob Herring wrote:
> > On Mon, Jun 15, 2015 at 11:42 AM, David Long  wrote:
> >>
> >>   #define REG_OFFSET_NAME(r) \
> >>  {.name = #r, .offset = offsetof(struct pt_regs, ARM_##r)}
> >>   #define REG_OFFSET_END {.name = NULL, .offset = 0}
> >
> > Can't you also move these? ARM is complicated with the "ARM_"
> > prefixing, but the others appear to be the same. Maybe you can remove
> > the prefix or redefine the macro for ARM.
> 
> That would mandate that all the architecture-specific pt_regs structures 
> would have to use a top-level named field for each named register.

Why does it mandate that?

See eg. powerpc where we use REG_OFFSET_NAME for the top-level named fields and
then a different macro for the array elements:

  #define REG_OFFSET_NAME(r) {.name = #r, .offset = offsetof(struct pt_regs, r)}
  #define GPR_OFFSET_NAME(num)  \
{.name = STR(gpr##num), .offset = offsetof(struct pt_regs, gpr[num])}
  
  static const struct pt_regs_offset regoffset_table[] = {
GPR_OFFSET_NAME(0),
GPR_OFFSET_NAME(1),
GPR_OFFSET_NAME(2),
GPR_OFFSET_NAME(3),
...
REG_OFFSET_NAME(nip),
REG_OFFSET_NAME(msr),


So I don't see why REG_OFFSET_NAME couldn't be common.

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 1/2] usb: chipidea: Reduce ULPI PHY reset pulse to datasheet spec of 1us

2015-06-29 Thread Peter Chen
On Fri, Jun 26, 2015 at 03:47:03PM +0200, Mike Looijmans wrote:
> The datasheet for the 334x PHY mentions that a reset can be performed:
> "... by bringing the pin low for a minimum of 1 microsecond and
> then high."
> A delay of 5ms to implement that seems overly long, so reduce it to
> just 1us.
> As for the delay after reset, the datasheet only mentioned that the
> chip will assert the DIR output. 1ms seems like a safe time to wait
> for that to happen, so no change there.
> 
> Signed-off-by: Mike Looijmans 
> ---
>  drivers/usb/chipidea/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index e970863..c865abe 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -664,7 +664,7 @@ static int ci_hdrc_create_ulpi_phy(struct device *dev, 
> struct ci_hdrc *ci)
>   dev_err(dev, "Failed to request ULPI reset gpio: %d\n", 
> ret);
>   return ret;
>   }
> - msleep(5);
> + udelay(1);
>   gpio_set_value_cansleep(reset_gpio, 1);
>   msleep(1);
>   }
> -- 
> 1.9.1
> 

We have no such function at mainline code.

-- 

Best Regards,
Peter Chen
--
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: Official bugreport 4.1 kernel (audio gadget and ChipIdea)

2015-06-29 Thread Peter Chen
On Fri, Jun 26, 2015 at 07:15:18PM +0200, Sébastien Pruvost wrote:
> Hello,
> 
> I'm sending this mail to report a bug concerning the latest kernel 4.1.
> 
> Here is the problem (and the test I've done):
> 
> I have firstly used the 3.10.53 kernel for my two sabrelites 
> in
> order to use the audio gadget driver with the Dual Role ChipIdea Controller 
> (in
> order to switch roles between my two IMX6 sabreLite).
> After loading g_audio in my two sabreLite and plugging the cable (microA –
> microB), there is an error “ci_hdrc.0 request length too big for isochronous
> snd_uac2.0 1116 Error”.
> And even after running aplay command, I still got this error and there is no
> sound getting out of the jack port.
> I've switched roles between the two boards by following this: https://
> www.kernel.org/doc/Documentation/usb/chipidea.txt.
> This works fine with the serial driver, I can see a new serial interface (host
> side) and after switching role a new serial interfaces at device side. Same
> thing for ethernet gadget: this works fine too. But not with the audio gadget.
> In fact, there is a new audio interface at host side but I can not interact
> with it (even alsamixer doesn’t see any controls on this new sound card). I’ve
> tested that audio gadget works fine if I don’t use ChipIdea HighSpeed Dual 
> Role
> Controller.
> 
>  
> 
> Secondly I have tested this audio gadget with the latest 
> Kernel
> 4.1 for my two IMX6 sabrelites (imx_v6_v7_defconfig). Now these previous 
> errors
> are gone but there are still no sound getting out of the jack port (even if
> there are a new sound card in host side)
> 

It is may not a role switch problem, please check if the g_audio can
work well with an ubuntu PC (make sure your codec works well).

> 
> I think this needs a patch to fix that.
> Best regards
> 
> Sébastien Pruvost.
> 

-- 

Best Regards,
Peter Chen
--
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 08/12] f2fs: introduce a shrinker for mounted fs

2015-06-29 Thread Chao Yu
> -Original Message-
> From: Jaegeuk Kim [mailto:jaeg...@kernel.org]
> Sent: Tuesday, June 30, 2015 2:40 AM
> To: linux-kernel@vger.kernel.org; linux-fsde...@vger.kernel.org;
> linux-f2fs-de...@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [PATCH 08/12] f2fs: introduce a shrinker for mounted fs
> 
> This patch introduces a shrinker targeting to reduce memory footprint consumed
> by a number of in-memory f2fs data structures.
> 
> In addition, it newly adds:
>  - sbi->umount_mutex to avoid data races on shrinker and put_super
>  - sbi->shruinker_run_no to not revisit objects
> 
> Noteh that the basic implementation was copied from fs/btrfs/shrinker.c

Great! Good to see it's being implemented in f2fs.

> 
> Signed-off-by: Jaegeuk Kim 

Reviewed-by: Chao Yu 

[snip]

> @@ -1406,6 +1425,9 @@ static int __init init_f2fs_fs(void)
>   err = f2fs_init_crypto();
>   if (err)
>   goto free_kset;
> +
> + register_shrinker(&f2fs_shrinker_info);

This function can fail due to no memory, please check the return value here.

Thanks,

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


linux-next: build warning in the origin tree

2015-06-29 Thread Stephen Rothwell
Hi Linus,

Building the origin tree, today's linux-next build (powerpc allyesconfig)
produced this warning:

WARNING: mm/built-in.o(.text.unlikely+0xc22): Section mismatch in reference 
from the function .new_kmalloc_cache() to the variable .init.rodata:kmalloc_info
The function .new_kmalloc_cache() references
the variable __initconst kmalloc_info.
This is often because .new_kmalloc_cache lacks a __initconst 
annotation or the annotation of kmalloc_info is wrong.

Caused by commit a9730fca9946 ("Fix kmalloc slab creation sequence").

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


pgpLTK6epQ6ab.pgp
Description: OpenPGP digital signature


[GIT PULL] xfs: updates for 4.2-rc1

2015-06-29 Thread Dave Chinner
Hi Linus,

Can you please pull the XFS updates from the tag below? There's a
couple of small API changes to the core DAX code which required
small changes to the ext2 and ext4 code bases, but otherwise
everything is within the XFS codebase. See the tag below for more
detail on the individual changes.

-Dave.

The following changes since commit 22419ac9fe5e79483596cebdbd1d1209c18bac1a:

  xfs: fix broken i_nlink accounting for whiteout tmpfile inode (2015-05-29 
08:14:55 +1000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/dgc/linux-xfs.git 
tags/xfs-for-linus-4.2-rc1

for you to fetch changes up to de50e16ffabf64d30ca9372f39dc855a7553e305:

  Merge branch 'xfs-misc-fixes-for-4.2-3' into for-next (2015-06-23 08:49:01 
+1000)



xfs: update for 4.2-rc1

This update contains:

o A new sparse on-disk inode record format to allow small extents to
  be used for inode allocation when free space is fragmented.
o DAX support. This includes minor changes to the DAX core code to
  fix problems with lock ordering and bufferhead mapping abuse.
o transaction commit interface cleanup
o removal of various unnecessary XFS specific type definitions
o cleanup and optimisation of freelist preparation before allocation
o various minor cleanups
o bug fixes for
- transaction reservation leaks
- incorrect inode logging in unwritten extent conversion
- mmap lock vs freeze ordering
- remote symlink mishandling
- attribute fork removal issues.


Brian Foster (23):
  xfs: create individual inode alloc. helper
  xfs: update free inode record logic to support sparse inode records
  xfs: support min/max agbno args in block allocator
  xfs: add sparse inode chunk alignment superblock field
  xfs: use sparse chunk alignment for min. inode allocation requirement
  xfs: sparse inode chunks feature helpers and mount requirements
  xfs: add fs geometry bit for sparse inode chunks
  xfs: introduce inode record hole mask for sparse inode chunks
  xfs: use actual inode count for sparse records in bulkstat/inumbers
  xfs: pass inode count through ordered icreate log item
  xfs: handle sparse inode chunks in icreate log recovery
  xfs: helper to convert holemask to inode alloc. bitmap
  xfs: allocate sparse inode chunks on full chunk allocation failure
  xfs: randomly do sparse inode allocations in DEBUG mode
  xfs: filter out sparse regions from individual inode allocation
  xfs: only free allocated regions of inode chunks
  xfs: skip unallocated regions of inode chunks in xfs_ifree_cluster()
  xfs: enable sparse inode chunks for v5 superblocks
  xfs: always log the inode on unwritten extent conversion
  xfs: fix quota block reservation leak when tp allocates and frees blocks
  xfs: fix sparse inodes 32-bit compile failure
  xfs: check min blks for random debug mode sparse allocations
  xfs: don't truncate attribute extents if no extents exist

Christoph Hellwig (10):
  xfs: switch remaining xfs_trans_dup users to xfs_trans_roll
  xfs: pass a boolean flag to xfs_trans_free_items
  xfs: remove the flags argument to xfs_trans_cancel
  xfs: saner xfs_trans_commit interface
  xfs: fix xfs_log_done interface
  xfs: remove __psint_t and __psunsigned_t
  xfs: remove inst_t
  xfs: return a void pointer from xfs_buf_offset
  xfs: use void pointers in log validation helpers
  xfs: remove xfs_caddr_t

Dave Chinner (19):
  Merge branch 'xfs-misc-fixes-for-4.2' into for-next
  Merge branch 'xfs-sparse-inode' into for-next
  xfs: mmap lock needs to be inside freeze protection
  dax: don't abuse get_block mapping for endio callbacks
  dax: expose __dax_fault for filesystems with locking constraints
  xfs: add DAX file operations support
  xfs: add DAX block zeroing support
  xfs: add DAX truncate support
  xfs: add DAX IO path support
  xfs: add initial DAX support
  Merge branch 'xfs-dax-support' into for-next
  Merge branch 'xfs-misc-fixes-for-4.2-2' into for-next
  Merge branch 'xfs-commit-cleanup' into for-next
  xfs: xfs_alloc_fix_freelist() can use incore perag structures
  xfs: factor out free space extent length check
  xfs: sanitise error handling in xfs_alloc_fix_freelist
  xfs: clean up XFS_MIN_FREELIST macros
  Merge branch 'xfs-freelist-cleanup' into for-next
  Merge branch 'xfs-misc-fixes-for-4.2-3' into for-next

Eric Sandeen (2):
  xfs: don't cast string literals
  xfs: fix remote symlinks on V5/CRC filesystems

Fanael Linithien (1):
  xfs: fix kernel version in docs

Nan Jia (1):
  xfs: Clean up xfs_trans_dup_dqinfo

 Documentation/filesystems/xfs.txt |   12 +-
 fs/dax.c  |   34 ++-
 fs/ext2/f

Re: [PATCH] dmaengine: pl330: Really fix choppy sound because of wrong residue calculation

2015-06-29 Thread Vinod Koul
On Mon, Jun 22, 2015 at 11:14:42AM +0900, Krzysztof Kozłowski wrote:
> 2015-06-15 23:00 GMT+09:00 Krzysztof Kozlowski :
> > When pl330 driver was used during sound playback, after some time or
> > after a number of plays the sound became choppy or totally noisy. For
> > example on Odroid XU3 board the first four executions of aplay with
> > small WAVE worked fine, but fifth was unrecognizable with errors:
> > $ aplay /usr/share/sounds/alsa/Front_Right.wava
> > underrun!!! (at least 0.095 ms long)
> >
> > Issue was caused by wrong residue reported by pl330 driver to
> > pcm_dmaengine for its cyclic dma transfers.
> >
> > The pl330_tx_status(), residue reporting function, used a "last" flag in
> > a descriptor to indicate that there is no more data to send.
> >
> > The pl330_tx_submit() iterated over descriptors trying to remove this
> > flag from them and then mark last descriptor as "last".  However when
> > iterating it actually removed the flag not from descriptors but always
> > from last of it (and then reset it). Thus effectively once some
> > descriptor was marked as last, then it stayed like this forever causing
> > residue to be reported too low.
> >
> > Signed-off-by: Krzysztof Kozlowski 
> > Fixes: aee4d1fac887 ("dmaengine: pl330: improve pl330_tx_status() function")
> > Cc: 
> > Reported-by: gabr...@unseen.is
> > Suggested-by: Marek Szyprowski 
> 
> Gabriel, could you give this patch a try? It helped for my Odroid XU3,
> which has the same audio codec. Nevertheless it would be great to hear
> that it solves the initial bug report.

So is there a word on  what finally fixes this

-- 
~Vinod

--
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] rtl8712:Fix checkpatch warning

2015-06-29 Thread Sudip Mukherjee
On Tue, Jun 30, 2015 at 01:27:47AM +0530, Ravi Teja Darbha wrote:
> 
> 1. Fix line over 80 characters warning.
> 2. The checkpatch warning at line 499 seems to be false positive.
> WARNING: else is not generally useful after a break or return
> #499: FILE: rtl8712_recv.c:499:
> +return false;
> +else
> 
> while(condition1) {
> if(condition2)
> foo();
> else if(condition3)
> return false;
> else
> break;
> }
> 
> The else condition here cannot be eliminated
You can try something like this to eliminate the else:

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c 
b/drivers/staging/rtl8712/rtl8712_recv.c
index fcb8c61..165161b 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -492,12 +492,13 @@ static int enqueue_reorder_recvframe(struct 
recv_reorder_ctrl *preorder_ctrl,
while (end_of_queue_search(phead, plist) == false) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnextattrib = &pnextrframe->u.hdr.attrib;
-   if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
+   if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) {
plist = plist->next;
+   continue;
+   }
else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
return false;
-   else
-   break;
+   break;
}
list_del_init(&(prframe->u.hdr.list));
list_add_tail(&(prframe->u.hdr.list), plist);

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


Re: [PATCH 11/28] ARCv2: extable: Enable sorting at build time

2015-06-29 Thread Vineet Gupta
On Tuesday 30 June 2015 02:08 AM, David Daney wrote:
>>
>> Sorry for missing you in the CC in orig post of this patch. Can I get your 
>> Ack on
>> this one !
>>
> 
> OK:
> 
> Acked-by: David Daney 

Thx David. Although I had put the patch as it is in the end as I need to send a
pull request to Linus soon for hat stuff.


> Really this is obvious, and only effects ARCv2, so the corresponding 
> maintainers
> shouldn't need my Ack.

Indeed it was obvious, but last few commits in that file had ACK's from you so I
thought of retaining the tradition so to speak :-)

-Vineet
--
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 4/4] arm64: dts: Add spi bus dts

2015-06-29 Thread Daniel Kurtz
Hi Leilk,

On Mon, Jun 29, 2015 at 9:04 PM, Leilk Liu  wrote:
> This patch adds MT8173 spi bus controllers into device tree.
>
> Signed-off-by: Leilk Liu 
> ---
>  arch/arm64/boot/dts/mediatek/mt8173.dtsi | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/mt8173.dtsi 
> b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> index 512e4eb..923d2eb 100644
> --- a/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> +++ b/arch/arm64/boot/dts/mediatek/mt8173.dtsi
> @@ -259,6 +259,15 @@
> status = "disabled";
> };
>
> +   spi: spi@1100a000 {

This should be between i2c2: i2c@11009000 and i2c3: i2c3@1101.

Thanks,
-Dan

> +   compatible = "mediatek,mt8173-spi";
> +   reg = <0 0x1100a000 0 0x1000>;
> +   interrupts = ;
> +   clocks = <&pericfg CLK_PERI_SPI0>;
> +   clock-names = "main";
> +   status = "disabled";
> +   };
> +
> mmsys: mmsys@1400 {
> compatible = "mediatek,mt8173-mmsys", "syscon";
> reg = <0 0x1400 0 0x1000>;
> --
> 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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [GIT PULL 00/24] perf/core improvements and fixes

2015-06-29 Thread Ingo Molnar

* Arnaldo Carvalho de Melo  wrote:

> From: Arnaldo Carvalho de Melo 
> 
> Hi Ingo,
> 
>   Please consider pulling,
> 
> - Arnaldo
> 
> The following changes since commit 6eedf416429a32e0216f61b8b690d25577b2b91e:
> 
>   Merge tag 'perf-core-for-mingo' of 
> git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent 
> (2015-06-26 10:38:11 +0200)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git 
> tags/perf-core-for-mingo
> 
> for you to fetch changes up to 36c8bb56a9f718a9a5f35d1834ca9dcec95deb4a:
> 
>   perf symbols: Check access permission when reading symbol files (2015-06-26 
> 12:11:53 -0300)
> 
> 
> perf/core improvements and fixes:
> 
> User visible:
> 
> - Validate syscall list passed via -e argument to 'perf trace' (Arnaldo 
> Carvalho de Melo)
> 
> - Introduce 'perf stat --per-thread' (Jiri Olsa)
> 
> - Check access permission for --kallsyms and --vmlinux (Li Zhang)
> 
> Infrastructure:
> 
> - Move stuff out of 'perf stat' and into the lib for further use (Jiri Olsa)
> 
> Signed-off-by: Arnaldo Carvalho de Melo 
> 
> 
> Arnaldo Carvalho de Melo (1):
>   perf trace: Validate syscall list passed via -e argument
> 
> Jiri Olsa (22):
>   perf thread_map: Introduce thread_map__reset function
>   perf thrad_map: Add comm string into array
>   perf tests: Add thread_map object tests
>   perf stat: Introduce perf_counts function
>   perf stat: Use xyarray for cpu evsel counts
>   perf stat: Make stats work over the thread dimension
>   perf stat: Rename struct perf_counts::cpu member to values
>   perf stat: Introduce perf_evlist__reset_stats
>   perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat 
> object
>   perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat 
> object
>   perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object
>   perf stat: Introduce perf_evsel__alloc_stats function
>   perf stat: Introduce perf_evsel__read function
>   perf stat: Introduce read_counters function
>   perf stat: Separate counters reading and processing
>   perf stat: Move zero_per_pkg into counter process code
>   perf stat: Move perf_stat initialization counter process code
>   perf stat: Remove perf_evsel__read_cb function
>   perf stat: Rename print_interval to process_interval
>   perf stat: Using init_stats instead of memset
>   perf stat: Introduce print_counters function
>   perf stat: Introduce --per-thread option
> 
> Li Zhang (1):
>   perf symbols: Check access permission when reading symbol files
> 
>  tools/perf/Documentation/perf-stat.txt |   4 +
>  tools/perf/builtin-report.c|  11 +
>  tools/perf/builtin-stat.c  | 402 
> +++--
>  tools/perf/builtin-trace.c |  32 +++
>  tools/perf/tests/Build |   1 +
>  tools/perf/tests/builtin-test.c|   4 +
>  tools/perf/tests/openat-syscall-all-cpus.c |   6 +-
>  tools/perf/tests/openat-syscall.c  |   4 +-
>  tools/perf/tests/tests.h   |   1 +
>  tools/perf/tests/thread-map.c  |  38 +++
>  tools/perf/util/evlist.h   |   1 -
>  tools/perf/util/evsel.c|  24 +-
>  tools/perf/util/evsel.h|  28 +-
>  tools/perf/util/python-ext-sources |   1 +
>  tools/perf/util/stat.c | 132 +-
>  tools/perf/util/stat.h |  47 +++-
>  tools/perf/util/symbol.c   |   5 +-
>  tools/perf/util/thread_map.c   |  76 +-
>  tools/perf/util/thread_map.h   |   8 +
>  19 files changed, 570 insertions(+), 255 deletions(-)
>  create mode 100644 tools/perf/tests/thread-map.c

Pulled, thanks a lot Arnaldo!

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] dmaengine: pl330: Really fix choppy sound because of wrong residue calculation

2015-06-29 Thread Krzysztof Kozłowski
2015-06-30 13:14 GMT+09:00 Vinod Koul :
> On Mon, Jun 22, 2015 at 11:14:42AM +0900, Krzysztof Kozłowski wrote:
>> 2015-06-15 23:00 GMT+09:00 Krzysztof Kozlowski :
>> > When pl330 driver was used during sound playback, after some time or
>> > after a number of plays the sound became choppy or totally noisy. For
>> > example on Odroid XU3 board the first four executions of aplay with
>> > small WAVE worked fine, but fifth was unrecognizable with errors:
>> > $ aplay /usr/share/sounds/alsa/Front_Right.wava
>> > underrun!!! (at least 0.095 ms long)
>> >
>> > Issue was caused by wrong residue reported by pl330 driver to
>> > pcm_dmaengine for its cyclic dma transfers.
>> >
>> > The pl330_tx_status(), residue reporting function, used a "last" flag in
>> > a descriptor to indicate that there is no more data to send.
>> >
>> > The pl330_tx_submit() iterated over descriptors trying to remove this
>> > flag from them and then mark last descriptor as "last".  However when
>> > iterating it actually removed the flag not from descriptors but always
>> > from last of it (and then reset it). Thus effectively once some
>> > descriptor was marked as last, then it stayed like this forever causing
>> > residue to be reported too low.
>> >
>> > Signed-off-by: Krzysztof Kozlowski 
>> > Fixes: aee4d1fac887 ("dmaengine: pl330: improve pl330_tx_status() 
>> > function")
>> > Cc: 
>> > Reported-by: gabr...@unseen.is
>> > Suggested-by: Marek Szyprowski 
>>
>> Gabriel, could you give this patch a try? It helped for my Odroid XU3,
>> which has the same audio codec. Nevertheless it would be great to hear
>> that it solves the initial bug report.
>
> So is there a word on  what finally fixes this

This fixes sound issue on my Odroid XU3 board, which is good. My board
has the same audio codec and DMA driver as the board used by Gabriel
so there is high chance that his issue is also fixed.

However it is sad that I did not receive any reviews or tests from
anyone, apparently no one cares enough about it :) .

Anyway the patch was also merged to Tizen kernel tree:
https://review.tizen.org/git/?p=platform/kernel/linux-exynos.git;a=shortlog;h=refs/heads/tizen
https://review.tizen.org/git/?p=platform/kernel/linux-exynos.git;a=commit;h=41dec9884a82443da1b7814ae42efe65895ff3af

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/


[tip:perf/urgent] perf trace: Validate syscall list passed via -e argument

2015-06-29 Thread tip-bot for Arnaldo Carvalho de Melo
Commit-ID:  d0cc439b30be638c3a606767e9469c300d397433
Gitweb: http://git.kernel.org/tip/d0cc439b30be638c3a606767e9469c300d397433
Author: Arnaldo Carvalho de Melo 
AuthorDate: Thu, 25 Jun 2015 19:32:33 -0300
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 10:47:41 -0300

perf trace: Validate syscall list passed via -e argument

The 'trace' tool was accepting any names passed and just looking if
syscalls returned via the raw_syscalls:* tracepoints were in that list,
leading to it accepting perf events and then never finding any, as those
are not valid syscall names, confusing users.

Fix it by checking each entry in the list using audit_name_to_syscall,
telling the user which entries are invalid and suggesting where to look
for valid syscall names.

E.g:

  [root@zoo ~]# trace -e open,foo,bar,close,baz
  Error: Invalid syscall bar, baz, foo
  Hint:  try 'perf list syscalls:sys_enter_*'
  Hint:  and: 'man syscalls'
  [root@zoo ~]#

Reported-by: Flavio Leitner 
Cc: Adrian Hunter 
Cc: Borislav Petkov 
Cc: David Ahern 
Cc: Don Zickus 
Cc: Frederic Weisbecker 
Cc: Jiri Olsa 
Cc: Namhyung Kim 
Link: http://lkml.kernel.org/n/tip-4g1i3m1z6fzsrznn2umi0...@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-trace.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 2bf2ca7..39ad4d0 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -1617,6 +1617,34 @@ static int trace__read_syscall_info(struct trace *trace, 
int id)
return syscall__set_arg_fmts(sc);
 }
 
+static int trace__validate_ev_qualifier(struct trace *trace)
+{
+   int err = 0;
+   struct str_node *pos;
+
+   strlist__for_each(pos, trace->ev_qualifier) {
+   const char *sc = pos->s;
+
+   if (audit_name_to_syscall(sc, trace->audit.machine) < 0) {
+   if (err == 0) {
+   fputs("Error:\tInvalid syscall ", 
trace->output);
+   err = -EINVAL;
+   } else {
+   fputs(", ", trace->output);
+   }
+
+   fputs(sc, trace->output);
+   }
+   }
+
+   if (err < 0) {
+   fputs("\nHint:\ttry 'perf list syscalls:sys_enter_*'"
+ "\nHint:\tand: 'man syscalls'\n", trace->output);
+   }
+
+   return err;
+}
+
 /*
  * args is to be interpreted as a series of longs but we need to handle
  * 8-byte unaligned accesses. args points to raw_data within the event
@@ -2862,6 +2890,10 @@ int cmd_trace(int argc, const char **argv, const char 
*prefix __maybe_unused)
err = -ENOMEM;
goto out_close;
}
+
+   err = trace__validate_ev_qualifier(&trace);
+   if (err)
+   goto out_close;
}
 
err = target__validate(&trace.opts.target);
--
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/


[tip:perf/urgent] perf thread_map: Introduce thread_map__reset function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  62eea464380633b88902da35bf9cbd8515289703
Gitweb: http://git.kernel.org/tip/62eea464380633b88902da35bf9cbd8515289703
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:06 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:03:41 -0300

perf thread_map: Introduce thread_map__reset function

We need to reset newly allocated 'struct thread_map_data' entries,
because we will introduce new comm memeber, which will get set later or
not at all.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-2-git-send-email-jo...@kernel.org
[ Use sizeof(map->map[0]) to be independent of the array entry type ]
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/thread_map.c | 17 -
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index 368cc58..ed76c17 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -21,11 +21,26 @@ static int filter(const struct dirent *dir)
return 1;
 }
 
+static void thread_map__reset(struct thread_map *map, int start, int nr)
+{
+   size_t size = (nr - start) * sizeof(map->map[0]);
+
+   memset(&map->map[start], 0, size);
+}
+
 static struct thread_map *thread_map__realloc(struct thread_map *map, int nr)
 {
size_t size = sizeof(*map) + sizeof(map->map[0]) * nr;
+   int start = map ? map->nr : 0;
 
-   return realloc(map, size);
+   map = realloc(map, size);
+   /*
+* We only realloc to add more items, let's reset new items.
+*/
+   if (map)
+   thread_map__reset(map, start, nr);
+
+   return map;
 }
 
 #define thread_map__alloc(__nr) thread_map__realloc(NULL, __nr)
--
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/


[tip:perf/urgent] perf tests: Add thread_map object tests

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  134aa44f6bff6b967efb85255ee9e8982cb8e486
Gitweb: http://git.kernel.org/tip/134aa44f6bff6b967efb85255ee9e8982cb8e486
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:08 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:09:38 -0300

perf tests: Add thread_map object tests

Adding thread_map object tests for comm name values.

Signed-off-by: Jiri Olsa 
Tested-by: Arnaldo Carvalho de Melo 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-4-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/tests/Build  |  1 +
 tools/perf/tests/builtin-test.c |  4 
 tools/perf/tests/tests.h|  1 +
 tools/perf/tests/thread-map.c   | 38 ++
 4 files changed, 44 insertions(+)

diff --git a/tools/perf/tests/Build b/tools/perf/tests/Build
index ee41e70..d20d6e6 100644
--- a/tools/perf/tests/Build
+++ b/tools/perf/tests/Build
@@ -31,6 +31,7 @@ perf-y += code-reading.o
 perf-y += sample-parsing.o
 perf-y += parse-no-sample-id-all.o
 perf-y += kmod-path.o
+perf-y += thread-map.o
 
 perf-$(CONFIG_X86) += perf-time-to-tsc.o
 
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 87b9961..c1dde73 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -171,6 +171,10 @@ static struct test {
.func = test__kmod_path__parse,
},
{
+   .desc = "Test thread map",
+   .func = test__thread_map,
+   },
+   {
.func = NULL,
},
 };
diff --git a/tools/perf/tests/tests.h b/tools/perf/tests/tests.h
index 8e5038b..ebb47d9 100644
--- a/tools/perf/tests/tests.h
+++ b/tools/perf/tests/tests.h
@@ -61,6 +61,7 @@ int test__switch_tracking(void);
 int test__fdarray__filter(void);
 int test__fdarray__add(void);
 int test__kmod_path__parse(void);
+int test__thread_map(void);
 
 #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || 
defined(__aarch64__)
 #ifdef HAVE_DWARF_UNWIND_SUPPORT
diff --git a/tools/perf/tests/thread-map.c b/tools/perf/tests/thread-map.c
new file mode 100644
index 000..5acf000
--- /dev/null
+++ b/tools/perf/tests/thread-map.c
@@ -0,0 +1,38 @@
+#include 
+#include 
+#include "tests.h"
+#include "thread_map.h"
+#include "debug.h"
+
+int test__thread_map(void)
+{
+   struct thread_map *map;
+
+   /* test map on current pid */
+   map = thread_map__new_by_pid(getpid());
+   TEST_ASSERT_VAL("failed to alloc map", map);
+
+   thread_map__read_comms(map);
+
+   TEST_ASSERT_VAL("wrong nr", map->nr == 1);
+   TEST_ASSERT_VAL("wrong pid",
+   thread_map__pid(map, 0) == getpid());
+   TEST_ASSERT_VAL("wrong comm",
+   thread_map__comm(map, 0) &&
+   !strcmp(thread_map__comm(map, 0), "perf"));
+   thread_map__put(map);
+
+   /* test dummy pid */
+   map = thread_map__new_dummy();
+   TEST_ASSERT_VAL("failed to alloc map", map);
+
+   thread_map__read_comms(map);
+
+   TEST_ASSERT_VAL("wrong nr", map->nr == 1);
+   TEST_ASSERT_VAL("wrong pid", thread_map__pid(map, 0) == -1);
+   TEST_ASSERT_VAL("wrong comm",
+   thread_map__comm(map, 0) &&
+   !strcmp(thread_map__comm(map, 0), "dummy"));
+   thread_map__put(map);
+   return 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/


[tip:perf/urgent] perf thrad_map: Add comm string into array

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  792402fd5c0a5a5300868e9dfc8ee569f3a39169
Gitweb: http://git.kernel.org/tip/792402fd5c0a5a5300868e9dfc8ee569f3a39169
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:07 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:07:01 -0300

perf thrad_map: Add comm string into array

Adding support to hold comm name together with pids in 'struct
thread_map'. It will be useful for --per-thread option to display task
pid together with task name.

Adding thread_map__read_comms function that reads/set
comm string for the 'struct thread_map'.

Getting the task name from /proc/$pid/comm.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-3-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/python-ext-sources |  1 +
 tools/perf/util/thread_map.c   | 59 ++
 tools/perf/util/thread_map.h   |  8 ++
 3 files changed, 68 insertions(+)

diff --git a/tools/perf/util/python-ext-sources 
b/tools/perf/util/python-ext-sources
index 5925fec..e23ded4 100644
--- a/tools/perf/util/python-ext-sources
+++ b/tools/perf/util/python-ext-sources
@@ -20,3 +20,4 @@ util/stat.c
 util/strlist.c
 util/trace-event.c
 ../../lib/rbtree.c
+util/string.c
diff --git a/tools/perf/util/thread_map.c b/tools/perf/util/thread_map.c
index ed76c17..da7646d 100644
--- a/tools/perf/util/thread_map.c
+++ b/tools/perf/util/thread_map.c
@@ -8,9 +8,11 @@
 #include 
 #include "strlist.h"
 #include 
+#include 
 #include "asm/bug.h"
 #include "thread_map.h"
 #include "util.h"
+#include "debug.h"
 
 /* Skip "." and ".." directories */
 static int filter(const struct dirent *dir)
@@ -319,8 +321,12 @@ struct thread_map *thread_map__new_str(const char *pid, 
const char *tid,
 static void thread_map__delete(struct thread_map *threads)
 {
if (threads) {
+   int i;
+
WARN_ONCE(atomic_read(&threads->refcnt) != 0,
  "thread map refcnt unbalanced\n");
+   for (i = 0; i < threads->nr; i++)
+   free(thread_map__comm(threads, i));
free(threads);
}
 }
@@ -348,3 +354,56 @@ size_t thread_map__fprintf(struct thread_map *threads, 
FILE *fp)
 
return printed + fprintf(fp, "\n");
 }
+
+static int get_comm(char **comm, pid_t pid)
+{
+   char *path;
+   size_t size;
+   int err;
+
+   if (asprintf(&path, "%s/%d/comm", procfs__mountpoint(), pid) == -1)
+   return -ENOMEM;
+
+   err = filename__read_str(path, comm, &size);
+   if (!err) {
+   /*
+* We're reading 16 bytes, while filename__read_str
+* allocates data per BUFSIZ bytes, so we can safely
+* mark the end of the string.
+*/
+   (*comm)[size] = 0;
+   rtrim(*comm);
+   }
+
+   free(path);
+   return err;
+}
+
+static void comm_init(struct thread_map *map, int i)
+{
+   pid_t pid = thread_map__pid(map, i);
+   char *comm = NULL;
+
+   /* dummy pid comm initialization */
+   if (pid == -1) {
+   map->map[i].comm = strdup("dummy");
+   return;
+   }
+
+   /*
+* The comm name is like extra bonus ;-),
+* so just warn if we fail for any reason.
+*/
+   if (get_comm(&comm, pid))
+   pr_warning("Couldn't resolve comm name for pid %d\n", pid);
+
+   map->map[i].comm = comm;
+}
+
+void thread_map__read_comms(struct thread_map *threads)
+{
+   int i;
+
+   for (i = 0; i < threads->nr; ++i)
+   comm_init(threads, i);
+}
diff --git a/tools/perf/util/thread_map.h b/tools/perf/util/thread_map.h
index 6b0cd2d..af679d8 100644
--- a/tools/perf/util/thread_map.h
+++ b/tools/perf/util/thread_map.h
@@ -7,6 +7,7 @@
 
 struct thread_map_data {
pid_tpid;
+   char*comm;
 };
 
 struct thread_map {
@@ -44,4 +45,11 @@ thread_map__set_pid(struct thread_map *map, int thread, 
pid_t pid)
 {
map->map[thread].pid = pid;
 }
+
+static inline char *thread_map__comm(struct thread_map *map, int thread)
+{
+   return map->map[thread].comm;
+}
+
+void thread_map__read_comms(struct thread_map *threads);
 #endif /* __PERF_THREAD_MAP_H */
--
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/


[tip:perf/urgent] perf stat: Introduce perf_counts function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  1ac77e1ce8654ec94ada0c508d58ba80a4647fba
Gitweb: http://git.kernel.org/tip/1ac77e1ce8654ec94ada0c508d58ba80a4647fba
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:09 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:11:26 -0300

perf stat: Introduce perf_counts function

Introducing perf_counts function, that returns
'struct perf_counts_values' pointer for given cpu.

Also moving perf_counts* structures into stat.h.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-5-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c  | 14 +++---
 tools/perf/tests/openat-syscall-all-cpus.c |  4 ++--
 tools/perf/tests/openat-syscall.c  |  2 +-
 tools/perf/util/evsel.c|  6 +++---
 tools/perf/util/evsel.h| 18 +-
 tools/perf/util/stat.h | 23 +++
 6 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 3e1636c..49b9037 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -316,7 +316,7 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int 
thread __maybe_unused,
if (!evsel->snapshot)
perf_evsel__compute_deltas(evsel, cpu, count);
perf_counts_values__scale(count, scale, NULL);
-   evsel->counts->cpu[cpu] = *count;
+   *perf_counts(evsel->counts, cpu) = *count;
if (aggr_mode == AGGR_NONE)
perf_stat__update_shadow_stats(evsel, count->values, 
cpu);
break;
@@ -805,9 +805,9 @@ static void print_aggr(char *prefix)
s2 = aggr_get_id(evsel_list->cpus, cpu2);
if (s2 != id)
continue;
-   val += counter->counts->cpu[cpu].val;
-   ena += counter->counts->cpu[cpu].ena;
-   run += counter->counts->cpu[cpu].run;
+   val += perf_counts(counter->counts, cpu)->val;
+   ena += perf_counts(counter->counts, cpu)->ena;
+   run += perf_counts(counter->counts, cpu)->run;
nr++;
}
if (prefix)
@@ -915,9 +915,9 @@ static void print_counter(struct perf_evsel *counter, char 
*prefix)
int cpu;
 
for (cpu = 0; cpu < perf_evsel__nr_cpus(counter); cpu++) {
-   val = counter->counts->cpu[cpu].val;
-   ena = counter->counts->cpu[cpu].ena;
-   run = counter->counts->cpu[cpu].run;
+   val = perf_counts(counter->counts, cpu)->val;
+   ena = perf_counts(counter->counts, cpu)->ena;
+   run = perf_counts(counter->counts, cpu)->run;
 
if (prefix)
fprintf(output, "%s", prefix);
diff --git a/tools/perf/tests/openat-syscall-all-cpus.c 
b/tools/perf/tests/openat-syscall-all-cpus.c
index b8d552b..e8d944f 100644
--- a/tools/perf/tests/openat-syscall-all-cpus.c
+++ b/tools/perf/tests/openat-syscall-all-cpus.c
@@ -98,9 +98,9 @@ int test__openat_syscall_event_on_all_cpus(void)
}
 
expected = nr_openat_calls + cpu;
-   if (evsel->counts->cpu[cpu].val != expected) {
+   if (perf_counts(evsel->counts, cpu)->val != expected) {
pr_debug("perf_evsel__read_on_cpu: expected to 
intercept %d calls on cpu %d, got %" PRIu64 "\n",
-expected, cpus->map[cpu], 
evsel->counts->cpu[cpu].val);
+expected, cpus->map[cpu], 
perf_counts(evsel->counts, cpu)->val);
err = -1;
}
}
diff --git a/tools/perf/tests/openat-syscall.c 
b/tools/perf/tests/openat-syscall.c
index bdfa1f4..e86fc47 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -44,7 +44,7 @@ int test__openat_syscall_event(void)
goto out_close_fd;
}
 
-   if (evsel->counts->cpu[0].val != nr_openat_calls) {
+   if (perf_counts(evsel->counts, 0)->val != nr_openat_calls) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d 
calls, got %" PRIu64 "\n",
 nr_openat_calls, evsel->counts->cpu[0].val);
goto out_close_fd;
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 1b2f480..8401b04 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -910,8 +910,8 @@ void perf_evsel__compute_deltas(struct perf_evsel *evsel, 
int cpu,
   

[tip:perf/urgent] perf stat: Use xyarray for cpu evsel counts

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  a8e02324dfe6bcafc15d02b790f33321ec4facb0
Gitweb: http://git.kernel.org/tip/a8e02324dfe6bcafc15d02b790f33321ec4facb0
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:10 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:19:19 -0300

perf stat: Use xyarray for cpu evsel counts

Switching single dimensional array of 'struct perf_counts_values'
with xyarray object, so we could store thread dimension counts.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-6-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c |  2 +-
 tools/perf/tests/openat-syscall.c |  2 +-
 tools/perf/util/stat.c| 31 ++-
 tools/perf/util/stat.h|  7 ---
 4 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 49b9037..055ce83 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -218,7 +218,7 @@ static void perf_stat__reset_stats(struct perf_evlist 
*evlist)
 
evlist__for_each(evlist, evsel) {
perf_evsel__reset_stat_priv(evsel);
-   perf_evsel__reset_counts(evsel, perf_evsel__nr_cpus(evsel));
+   perf_evsel__reset_counts(evsel);
}
 
perf_stat__reset_shadow_stats();
diff --git a/tools/perf/tests/openat-syscall.c 
b/tools/perf/tests/openat-syscall.c
index e86fc47..bd882f0 100644
--- a/tools/perf/tests/openat-syscall.c
+++ b/tools/perf/tests/openat-syscall.c
@@ -46,7 +46,7 @@ int test__openat_syscall_event(void)
 
if (perf_counts(evsel->counts, 0)->val != nr_openat_calls) {
pr_debug("perf_evsel__read_on_cpu: expected to intercept %d 
calls, got %" PRIu64 "\n",
-nr_openat_calls, evsel->counts->cpu[0].val);
+nr_openat_calls, perf_counts(evsel->counts, 0)->val);
goto out_close_fd;
}
 
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 4014b70..453480a 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -97,26 +97,39 @@ void perf_stat_evsel_id_init(struct perf_evsel *evsel)
 
 struct perf_counts *perf_counts__new(int ncpus)
 {
-   int size = sizeof(struct perf_counts) +
-  ncpus * sizeof(struct perf_counts_values);
+   struct perf_counts *counts = zalloc(sizeof(*counts));
 
-   return zalloc(size);
+   if (counts) {
+   struct xyarray *cpu;
+
+   cpu = xyarray__new(ncpus, 1, sizeof(struct perf_counts_values));
+   if (!cpu) {
+   free(counts);
+   return NULL;
+   }
+
+   counts->cpu = cpu;
+   }
+
+   return counts;
 }
 
 void perf_counts__delete(struct perf_counts *counts)
 {
-   free(counts);
+   if (counts) {
+   xyarray__delete(counts->cpu);
+   free(counts);
+   }
 }
 
-static void perf_counts__reset(struct perf_counts *counts, int ncpus)
+static void perf_counts__reset(struct perf_counts *counts)
 {
-   memset(counts, 0, (sizeof(*counts) +
-  (ncpus * sizeof(struct perf_counts_values;
+   xyarray__reset(counts->cpu);
 }
 
-void perf_evsel__reset_counts(struct perf_evsel *evsel, int ncpus)
+void perf_evsel__reset_counts(struct perf_evsel *evsel)
 {
-   perf_counts__reset(evsel->counts, ncpus);
+   perf_counts__reset(evsel->counts);
 }
 
 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus)
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 5e43348..6d07612 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -3,6 +3,7 @@
 
 #include 
 #include 
+#include "xyarray.h"
 
 struct stats
 {
@@ -45,13 +46,13 @@ struct perf_counts_values {
 struct perf_counts {
s8scaled;
struct perf_counts_values aggr;
-   struct perf_counts_values cpu[];
+   struct xyarray*cpu;
 };
 
 static inline struct perf_counts_values*
 perf_counts(struct perf_counts *counts, int cpu)
 {
-   return &counts->cpu[cpu];
+   return xyarray__entry(counts->cpu, cpu, 0);
 }
 
 void update_stats(struct stats *stats, u64 val);
@@ -88,7 +89,7 @@ void perf_stat__print_shadow_stats(FILE *out, struct 
perf_evsel *evsel,
 struct perf_counts *perf_counts__new(int ncpus);
 void perf_counts__delete(struct perf_counts *counts);
 
-void perf_evsel__reset_counts(struct perf_evsel *evsel, int ncpus);
+void perf_evsel__reset_counts(struct perf_evsel *evsel);
 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus);
 void perf_evsel__free_counts(struct perf_evsel *evsel);
 #endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel

[tip:perf/urgent] perf stat: Rename struct perf_counts:: cpu member to values

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  57b289159ab4fe1f7b2b531464cf67f65e48dd00
Gitweb: http://git.kernel.org/tip/57b289159ab4fe1f7b2b531464cf67f65e48dd00
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:12 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:25:03 -0300

perf stat: Rename struct perf_counts::cpu member to values

Renaming 'struct xyarray *cpu' pointer to more fitting/generic values,
because now we store both cpu and thread values.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-8-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/stat.c | 12 ++--
 tools/perf/util/stat.h |  4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 7bcc19b..197a2db 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -100,15 +100,15 @@ struct perf_counts *perf_counts__new(int ncpus, int 
nthreads)
struct perf_counts *counts = zalloc(sizeof(*counts));
 
if (counts) {
-   struct xyarray *cpu;
+   struct xyarray *values;
 
-   cpu = xyarray__new(ncpus, nthreads, sizeof(struct 
perf_counts_values));
-   if (!cpu) {
+   values = xyarray__new(ncpus, nthreads, sizeof(struct 
perf_counts_values));
+   if (!values) {
free(counts);
return NULL;
}
 
-   counts->cpu = cpu;
+   counts->values = values;
}
 
return counts;
@@ -117,14 +117,14 @@ struct perf_counts *perf_counts__new(int ncpus, int 
nthreads)
 void perf_counts__delete(struct perf_counts *counts)
 {
if (counts) {
-   xyarray__delete(counts->cpu);
+   xyarray__delete(counts->values);
free(counts);
}
 }
 
 static void perf_counts__reset(struct perf_counts *counts)
 {
-   xyarray__reset(counts->cpu);
+   xyarray__reset(counts->values);
 }
 
 void perf_evsel__reset_counts(struct perf_evsel *evsel)
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index e0b8dc5..295d1e2 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -46,13 +46,13 @@ struct perf_counts_values {
 struct perf_counts {
s8scaled;
struct perf_counts_values aggr;
-   struct xyarray*cpu;
+   struct xyarray*values;
 };
 
 static inline struct perf_counts_values*
 perf_counts(struct perf_counts *counts, int cpu, int thread)
 {
-   return xyarray__entry(counts->cpu, cpu, thread);
+   return xyarray__entry(counts->values, cpu, thread);
 }
 
 void update_stats(struct stats *stats, u64 val);
--
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/


[tip:perf/urgent] perf stat: Make stats work over the thread dimension

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  a6fa003855d38d53d90c1a8a5827102e62702334
Gitweb: http://git.kernel.org/tip/a6fa003855d38d53d90c1a8a5827102e62702334
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:11 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:20:02 -0300

perf stat: Make stats work over the thread dimension

Now that we have space for thread dimension counts, let's store it.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-7-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c  | 32 +-
 tools/perf/tests/openat-syscall-all-cpus.c |  6 +++---
 tools/perf/tests/openat-syscall.c  |  4 ++--
 tools/perf/util/evsel.c| 12 +--
 tools/perf/util/evsel.h|  2 +-
 tools/perf/util/stat.c |  8 
 tools/perf/util/stat.h |  8 
 7 files changed, 38 insertions(+), 34 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 055ce83..983bcbb 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -166,11 +166,12 @@ static void perf_evsel__free_stat_priv(struct perf_evsel 
*evsel)
zfree(&evsel->priv);
 }
 
-static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel)
+static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
+int ncpus, int nthreads)
 {
struct perf_counts *counts;
 
-   counts = perf_counts__new(perf_evsel__nr_cpus(evsel));
+   counts = perf_counts__new(ncpus, nthreads);
if (counts)
evsel->prev_raw_counts = counts;
 
@@ -197,11 +198,14 @@ static void perf_evlist__free_stats(struct perf_evlist 
*evlist)
 static int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw)
 {
struct perf_evsel *evsel;
+   int nthreads = thread_map__nr(evsel_list->threads);
 
evlist__for_each(evlist, evsel) {
+   int ncpus = perf_evsel__nr_cpus(evsel);
+
if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
-   perf_evsel__alloc_counts(evsel, perf_evsel__nr_cpus(evsel)) 
< 0 ||
-   (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel) < 0))
+   perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
+   (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, 
ncpus, nthreads) < 0))
goto out_free;
}
 
@@ -294,7 +298,7 @@ static int check_per_pkg(struct perf_evsel *counter, int 
cpu, bool *skip)
return 0;
 }
 
-static int read_cb(struct perf_evsel *evsel, int cpu, int thread 
__maybe_unused,
+static int read_cb(struct perf_evsel *evsel, int cpu, int thread,
   struct perf_counts_values *count)
 {
struct perf_counts_values *aggr = &evsel->counts->aggr;
@@ -314,9 +318,9 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int 
thread __maybe_unused,
case AGGR_SOCKET:
case AGGR_NONE:
if (!evsel->snapshot)
-   perf_evsel__compute_deltas(evsel, cpu, count);
+   perf_evsel__compute_deltas(evsel, cpu, thread, count);
perf_counts_values__scale(count, scale, NULL);
-   *perf_counts(evsel->counts, cpu) = *count;
+   *perf_counts(evsel->counts, cpu, thread) = *count;
if (aggr_mode == AGGR_NONE)
perf_stat__update_shadow_stats(evsel, count->values, 
cpu);
break;
@@ -352,7 +356,7 @@ static int read_counter_aggr(struct perf_evsel *counter)
return -1;
 
if (!counter->snapshot)
-   perf_evsel__compute_deltas(counter, -1, aggr);
+   perf_evsel__compute_deltas(counter, -1, -1, aggr);
perf_counts_values__scale(aggr, scale, &counter->counts->scaled);
 
for (i = 0; i < 3; i++)
@@ -805,9 +809,9 @@ static void print_aggr(char *prefix)
s2 = aggr_get_id(evsel_list->cpus, cpu2);
if (s2 != id)
continue;
-   val += perf_counts(counter->counts, cpu)->val;
-   ena += perf_counts(counter->counts, cpu)->ena;
-   run += perf_counts(counter->counts, cpu)->run;
+   val += perf_counts(counter->counts, cpu, 
0)->val;
+   ena += perf_counts(counter->counts, cpu, 
0)->ena;
+   run += perf_counts(counter->counts, cpu, 
0)->run;
nr++;
}
if (prefix)
@@ -915,9 +919,9 @@ static void print_counter(struc

[tip:perf/urgent] perf stat: Introduce perf_evlist__reset_stats

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  254ecbc7474dfa08155c5595e90cd4a0fa9d14ce
Gitweb: http://git.kernel.org/tip/254ecbc7474dfa08155c5595e90cd4a0fa9d14ce
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:13 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:25:39 -0300

perf stat: Introduce perf_evlist__reset_stats

To fit in with the rest of the helpers (alloc and free).

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-9-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 983bcbb..188cd98a 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -216,7 +216,7 @@ out_free:
return -1;
 }
 
-static void perf_stat__reset_stats(struct perf_evlist *evlist)
+static void perf_evlist__reset_stats(struct perf_evlist *evlist)
 {
struct perf_evsel *evsel;
 
@@ -224,7 +224,11 @@ static void perf_stat__reset_stats(struct perf_evlist 
*evlist)
perf_evsel__reset_stat_priv(evsel);
perf_evsel__reset_counts(evsel);
}
+}
 
+static void perf_stat__reset_stats(void)
+{
+   perf_evlist__reset_stats(evsel_list);
perf_stat__reset_shadow_stats();
 }
 
@@ -1473,7 +1477,7 @@ int cmd_stat(int argc, const char **argv, const char 
*prefix __maybe_unused)
status = run_perf_stat(argc, argv);
if (forever && status != -1) {
print_stat(argc, argv);
-   perf_stat__reset_stats(evsel_list);
+   perf_stat__reset_stats();
}
}
 
--
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/


[tip:perf/urgent] perf stat: Move perf_evsel__(alloc|free|reset) _stat_priv into stat object

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  9689edfabc1547155a7cdd1304fd294107054291
Gitweb: http://git.kernel.org/tip/9689edfabc1547155a7cdd1304fd294107054291
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:14 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:26:44 -0300

perf stat: Move perf_evsel__(alloc|free|reset)_stat_priv into stat object

Moving perf_evsel__(alloc|free|reset)_stat_priv into stat object, so it
could be used outside stat command in following patches.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-10-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 25 -
 tools/perf/util/stat.c| 25 +
 tools/perf/util/stat.h|  4 
 3 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 188cd98a..8a7fd0c 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -141,31 +141,6 @@ static inline void diff_timespec(struct timespec *r, 
struct timespec *a,
}
 }
 
-static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
-{
-   int i;
-   struct perf_stat *ps = evsel->priv;
-
-   for (i = 0; i < 3; i++)
-   init_stats(&ps->res_stats[i]);
-
-   perf_stat_evsel_id_init(evsel);
-}
-
-static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel)
-{
-   evsel->priv = zalloc(sizeof(struct perf_stat));
-   if (evsel->priv == NULL)
-   return -ENOMEM;
-   perf_evsel__reset_stat_priv(evsel);
-   return 0;
-}
-
-static void perf_evsel__free_stat_priv(struct perf_evsel *evsel)
-{
-   zfree(&evsel->priv);
-}
-
 static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
 int ncpus, int nthreads)
 {
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 197a2db..b8c329f 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -143,3 +143,28 @@ void perf_evsel__free_counts(struct perf_evsel *evsel)
perf_counts__delete(evsel->counts);
evsel->counts = NULL;
 }
+
+void perf_evsel__reset_stat_priv(struct perf_evsel *evsel)
+{
+   int i;
+   struct perf_stat *ps = evsel->priv;
+
+   for (i = 0; i < 3; i++)
+   init_stats(&ps->res_stats[i]);
+
+   perf_stat_evsel_id_init(evsel);
+}
+
+int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel)
+{
+   evsel->priv = zalloc(sizeof(struct perf_stat));
+   if (evsel->priv == NULL)
+   return -ENOMEM;
+   perf_evsel__reset_stat_priv(evsel);
+   return 0;
+}
+
+void perf_evsel__free_stat_priv(struct perf_evsel *evsel)
+{
+   zfree(&evsel->priv);
+}
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 295d1e2..c441cb3 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -92,4 +92,8 @@ void perf_counts__delete(struct perf_counts *counts);
 void perf_evsel__reset_counts(struct perf_evsel *evsel);
 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int 
nthreads);
 void perf_evsel__free_counts(struct perf_evsel *evsel);
+
+void perf_evsel__reset_stat_priv(struct perf_evsel *evsel);
+int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel);
+void perf_evsel__free_stat_priv(struct perf_evsel *evsel);
 #endif
--
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/


[tip:perf/urgent] perf stat: Move perf_evsel__(alloc|free) _prev_raw_counts into stat object

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  a939512d10a5583a32ae85c1bff6c4ae63a8a517
Gitweb: http://git.kernel.org/tip/a939512d10a5583a32ae85c1bff6c4ae63a8a517
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:15 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:34:43 -0300

perf stat: Move perf_evsel__(alloc|free)_prev_raw_counts into stat object

Moving perf_evsel__(alloc|free)_prev_raw_counts into stat object, so it
could be used in following patches.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-11-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 18 --
 tools/perf/util/stat.c| 18 ++
 tools/perf/util/stat.h|  4 
 3 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 8a7fd0c..0ccba5c 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -141,24 +141,6 @@ static inline void diff_timespec(struct timespec *r, 
struct timespec *a,
}
 }
 
-static int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
-int ncpus, int nthreads)
-{
-   struct perf_counts *counts;
-
-   counts = perf_counts__new(ncpus, nthreads);
-   if (counts)
-   evsel->prev_raw_counts = counts;
-
-   return counts ? 0 : -ENOMEM;
-}
-
-static void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel)
-{
-   perf_counts__delete(evsel->prev_raw_counts);
-   evsel->prev_raw_counts = NULL;
-}
-
 static void perf_evlist__free_stats(struct perf_evlist *evlist)
 {
struct perf_evsel *evsel;
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index b8c329f..6221c38 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -168,3 +168,21 @@ void perf_evsel__free_stat_priv(struct perf_evsel *evsel)
 {
zfree(&evsel->priv);
 }
+
+int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
+ int ncpus, int nthreads)
+{
+   struct perf_counts *counts;
+
+   counts = perf_counts__new(ncpus, nthreads);
+   if (counts)
+   evsel->prev_raw_counts = counts;
+
+   return counts ? 0 : -ENOMEM;
+}
+
+void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel)
+{
+   perf_counts__delete(evsel->prev_raw_counts);
+   evsel->prev_raw_counts = NULL;
+}
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index c441cb3..454b268 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -96,4 +96,8 @@ void perf_evsel__free_counts(struct perf_evsel *evsel);
 void perf_evsel__reset_stat_priv(struct perf_evsel *evsel);
 int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel);
 void perf_evsel__free_stat_priv(struct perf_evsel *evsel);
+
+int perf_evsel__alloc_prev_raw_counts(struct perf_evsel *evsel,
+ int ncpus, int nthreads);
+void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel);
 #endif
--
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/


[tip:perf/urgent] perf stat: Move perf_evlist__(alloc|free|reset) _stats into stat object

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  24e34f68e21a47a582b3cc2eccdb835b80b1830a
Gitweb: http://git.kernel.org/tip/24e34f68e21a47a582b3cc2eccdb835b80b1830a
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:16 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:44:37 -0300

perf stat: Move perf_evlist__(alloc|free|reset)_stats into stat object

Moving perf_evlist__(alloc|free|reset)_stats into stat object,
so it could be used in following patches.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-12-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 42 --
 tools/perf/util/evlist.h  |  1 -
 tools/perf/util/stat.c| 44 
 tools/perf/util/stat.h|  6 ++
 4 files changed, 50 insertions(+), 43 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 0ccba5c..3e385f9 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -141,48 +141,6 @@ static inline void diff_timespec(struct timespec *r, 
struct timespec *a,
}
 }
 
-static void perf_evlist__free_stats(struct perf_evlist *evlist)
-{
-   struct perf_evsel *evsel;
-
-   evlist__for_each(evlist, evsel) {
-   perf_evsel__free_stat_priv(evsel);
-   perf_evsel__free_counts(evsel);
-   perf_evsel__free_prev_raw_counts(evsel);
-   }
-}
-
-static int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw)
-{
-   struct perf_evsel *evsel;
-   int nthreads = thread_map__nr(evsel_list->threads);
-
-   evlist__for_each(evlist, evsel) {
-   int ncpus = perf_evsel__nr_cpus(evsel);
-
-   if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
-   perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
-   (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, 
ncpus, nthreads) < 0))
-   goto out_free;
-   }
-
-   return 0;
-
-out_free:
-   perf_evlist__free_stats(evlist);
-   return -1;
-}
-
-static void perf_evlist__reset_stats(struct perf_evlist *evlist)
-{
-   struct perf_evsel *evsel;
-
-   evlist__for_each(evlist, evsel) {
-   perf_evsel__reset_stat_priv(evsel);
-   perf_evsel__reset_counts(evsel);
-   }
-}
-
 static void perf_stat__reset_stats(void)
 {
perf_evlist__reset_stats(evsel_list);
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index a8489b9..037633c 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -289,5 +289,4 @@ void perf_evlist__to_front(struct perf_evlist *evlist,
 
 void perf_evlist__set_tracking_event(struct perf_evlist *evlist,
 struct perf_evsel *tracking_evsel);
-
 #endif /* __PERF_EVLIST_H */
diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 6221c38..818cb02 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -1,6 +1,8 @@
 #include 
 #include "stat.h"
+#include "evlist.h"
 #include "evsel.h"
+#include "thread_map.h"
 
 void update_stats(struct stats *stats, u64 val)
 {
@@ -186,3 +188,45 @@ void perf_evsel__free_prev_raw_counts(struct perf_evsel 
*evsel)
perf_counts__delete(evsel->prev_raw_counts);
evsel->prev_raw_counts = NULL;
 }
+
+int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw)
+{
+   struct perf_evsel *evsel;
+   int nthreads = thread_map__nr(evlist->threads);
+
+   evlist__for_each(evlist, evsel) {
+   int ncpus = perf_evsel__nr_cpus(evsel);
+
+   if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
+   perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
+   (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, 
ncpus, nthreads) < 0))
+   goto out_free;
+   }
+
+   return 0;
+
+out_free:
+   perf_evlist__free_stats(evlist);
+   return -1;
+}
+
+void perf_evlist__free_stats(struct perf_evlist *evlist)
+{
+   struct perf_evsel *evsel;
+
+   evlist__for_each(evlist, evsel) {
+   perf_evsel__free_stat_priv(evsel);
+   perf_evsel__free_counts(evsel);
+   perf_evsel__free_prev_raw_counts(evsel);
+   }
+}
+
+void perf_evlist__reset_stats(struct perf_evlist *evlist)
+{
+   struct perf_evsel *evsel;
+
+   evlist__for_each(evlist, evsel) {
+   perf_evsel__reset_stat_priv(evsel);
+   perf_evsel__reset_counts(evsel);
+   }
+}
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 454b268..5f62db2 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -70,6 +70,8 @@ static inline void init_stats(struct stats *stats)
 }
 
 struct perf_evsel;
+struct perf_evlist;
+
 b

[PATCH 1/1] igb: Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0])

2015-06-29 Thread Maninder Singh
Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0])

Signed-off-by: Maninder Singh 
Reviewed-by: Yogesh Narayan Gaur 
---
 drivers/net/ethernet/intel/igb/e1000_phy.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c 
b/drivers/net/ethernet/intel/igb/e1000_phy.c
index c1bb64d..e399b3c 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
@@ -37,8 +37,7 @@ static s32  igb_set_master_slave_mode(struct e1000_hw *hw);
 static const u16 e1000_m88_cable_length_table[] = {
0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
 #define M88E1000_CABLE_LENGTH_TABLE_SIZE \
-   (sizeof(e1000_m88_cable_length_table) / \
-   sizeof(e1000_m88_cable_length_table[0]))
+   ARRAY_SIZE(e1000_m88_cable_length_table)
 
 static const u16 e1000_igp_2_cable_length_table[] = {
0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21,
@@ -50,8 +49,7 @@ static const u16 e1000_igp_2_cable_length_table[] = {
83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124,
104, 109, 114, 118, 121, 124};
 #define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \
-   (sizeof(e1000_igp_2_cable_length_table) / \
-sizeof(e1000_igp_2_cable_length_table[0]))
+   ARRAY_SIZE(e1000_igp_2_cable_length_table)
 
 /**
  *  igb_check_reset_block - Check if PHY reset is blocked
-- 
1.7.9.5

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


[tip:perf/urgent] perf stat: Introduce perf_evsel__alloc_stats function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  a7d0a102e4ae46b75b70a9500979e7ed3cdf183f
Gitweb: http://git.kernel.org/tip/a7d0a102e4ae46b75b70a9500979e7ed3cdf183f
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:17 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:46:00 -0300

perf stat: Introduce perf_evsel__alloc_stats function

Move all stat allocation logic related to stat object under single
function. This way we can use it separately for stat object out of
evlist object.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-13-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/stat.c | 20 ++--
 tools/perf/util/stat.h |  2 ++
 2 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c
index 818cb02..f2a0d15 100644
--- a/tools/perf/util/stat.c
+++ b/tools/perf/util/stat.c
@@ -189,17 +189,25 @@ void perf_evsel__free_prev_raw_counts(struct perf_evsel 
*evsel)
evsel->prev_raw_counts = NULL;
 }
 
+int perf_evsel__alloc_stats(struct perf_evsel *evsel, bool alloc_raw)
+{
+   int ncpus = perf_evsel__nr_cpus(evsel);
+   int nthreads = thread_map__nr(evsel->threads);
+
+   if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
+   perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
+   (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, ncpus, 
nthreads) < 0))
+   return -ENOMEM;
+
+   return 0;
+}
+
 int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw)
 {
struct perf_evsel *evsel;
-   int nthreads = thread_map__nr(evlist->threads);
 
evlist__for_each(evlist, evsel) {
-   int ncpus = perf_evsel__nr_cpus(evsel);
-
-   if (perf_evsel__alloc_stat_priv(evsel) < 0 ||
-   perf_evsel__alloc_counts(evsel, ncpus, nthreads) < 0 ||
-   (alloc_raw && perf_evsel__alloc_prev_raw_counts(evsel, 
ncpus, nthreads) < 0))
+   if (perf_evsel__alloc_stats(evsel, alloc_raw))
goto out_free;
}
 
diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h
index 5f62db2..9f05c57 100644
--- a/tools/perf/util/stat.h
+++ b/tools/perf/util/stat.h
@@ -103,6 +103,8 @@ int perf_evsel__alloc_prev_raw_counts(struct perf_evsel 
*evsel,
  int ncpus, int nthreads);
 void perf_evsel__free_prev_raw_counts(struct perf_evsel *evsel);
 
+int perf_evsel__alloc_stats(struct perf_evsel *evsel, bool alloc_raw);
+
 int perf_evlist__alloc_stats(struct perf_evlist *evlist, bool alloc_raw);
 void perf_evlist__free_stats(struct perf_evlist *evlist);
 void perf_evlist__reset_stats(struct perf_evlist *evlist);
--
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/


[tip:perf/urgent] perf stat: Introduce read_counters function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  106a94a0f8c207ef4113ce7e32f34a00b3b174e7
Gitweb: http://git.kernel.org/tip/106a94a0f8c207ef4113ce7e32f34a00b3b174e7
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:19 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:48:02 -0300

perf stat: Introduce read_counters function

Moving read counters logic into single read_counters function, which
will be called for both interval and overall processing legs.

The reason is to split reading and processing (following patches)
counters code, so we could read counters from other sources (like
perf.data) and process them in the same way as 'perf stat' command does.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-15-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 47 ++-
 1 file changed, 22 insertions(+), 25 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 3e385f9..158859e 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -323,27 +323,35 @@ static int read_counter(struct perf_evsel *counter)
return 0;
 }
 
-static void print_interval(void)
+static void read_counters(bool close)
 {
-   static int num_print_interval;
struct perf_evsel *counter;
struct perf_stat *ps;
-   struct timespec ts, rs;
-   char prefix[64];
 
-   if (aggr_mode == AGGR_GLOBAL) {
-   evlist__for_each(evsel_list, counter) {
-   ps = counter->priv;
-   memset(ps->res_stats, 0, sizeof(ps->res_stats));
+   evlist__for_each(evsel_list, counter) {
+   ps = counter->priv;
+   memset(ps->res_stats, 0, sizeof(ps->res_stats));
+
+   if (aggr_mode == AGGR_GLOBAL)
read_counter_aggr(counter);
-   }
-   } else  {
-   evlist__for_each(evsel_list, counter) {
-   ps = counter->priv;
-   memset(ps->res_stats, 0, sizeof(ps->res_stats));
+   else
read_counter(counter);
+
+   if (close) {
+   perf_evsel__close_fd(counter, 
perf_evsel__nr_cpus(counter),
+
thread_map__nr(evsel_list->threads));
}
}
+}
+
+static void print_interval(void)
+{
+   static int num_print_interval;
+   struct perf_evsel *counter;
+   struct timespec ts, rs;
+   char prefix[64];
+
+   read_counters(false);
 
clock_gettime(CLOCK_MONOTONIC, &ts);
diff_timespec(&rs, &ts, &ref_time);
@@ -525,18 +533,7 @@ static int __run_perf_stat(int argc, const char **argv)
 
update_stats(&walltime_nsecs_stats, t1 - t0);
 
-   if (aggr_mode == AGGR_GLOBAL) {
-   evlist__for_each(evsel_list, counter) {
-   read_counter_aggr(counter);
-   perf_evsel__close_fd(counter, 
perf_evsel__nr_cpus(counter),
-
thread_map__nr(evsel_list->threads));
-   }
-   } else {
-   evlist__for_each(evsel_list, counter) {
-   read_counter(counter);
-   perf_evsel__close_fd(counter, 
perf_evsel__nr_cpus(counter), 1);
-   }
-   }
+   read_counters(true);
 
return WEXITSTATUS(status);
 }
--
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/


[tip:perf/urgent] perf stat: Introduce perf_evsel__read function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  f99f4719b841a9745d6a7652eef3956aaf2db66a
Gitweb: http://git.kernel.org/tip/f99f4719b841a9745d6a7652eef3956aaf2db66a
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:18 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:46:57 -0300

perf stat: Introduce perf_evsel__read function

Adding simple read function that reads/store data into given struct
perf_counts_values *count object.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-14-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evsel.c | 14 ++
 tools/perf/util/evsel.h |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index cd6ce70..2e0a4e0 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -955,6 +955,20 @@ int perf_evsel__read_cb(struct perf_evsel *evsel, int cpu, 
int thread,
return cb(evsel, cpu, thread, &count);
 }
 
+int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
+struct perf_counts_values *count)
+{
+   memset(count, 0, sizeof(*count));
+
+   if (FD(evsel, cpu, thread) < 0)
+   return -EINVAL;
+
+   if (readn(FD(evsel, cpu, thread), count, sizeof(*count)) < 0)
+   return -errno;
+
+   return 0;
+}
+
 int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
  int cpu, int thread, bool scale)
 {
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index 020f7e1..a79944a 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -236,6 +236,9 @@ typedef int (perf_evsel__read_cb_t)(struct perf_evsel 
*evsel,
 int perf_evsel__read_cb(struct perf_evsel *evsel, int cpu, int thread,
perf_evsel__read_cb_t cb);
 
+int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
+struct perf_counts_values *count);
+
 int __perf_evsel__read_on_cpu(struct perf_evsel *evsel,
  int cpu, int thread, bool scale);
 
--
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/


[tip:perf/urgent] perf stat: Move zero_per_pkg into counter process code

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  32ce0a47aaa401a7dd27dfe65210f3e3aa809682
Gitweb: http://git.kernel.org/tip/32ce0a47aaa401a7dd27dfe65210f3e3aa809682
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:21 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:49:45 -0300

perf stat: Move zero_per_pkg into counter process code

Moving zero_per_pkg into counter process code,
to make the reading path free of processing logic.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-17-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 74ac92b..b7c184b 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -285,6 +285,9 @@ static int process_counter(struct perf_evsel *counter)
 
aggr->val = aggr->ena = aggr->run = 0;
 
+   if (counter->per_pkg)
+   zero_per_pkg(counter);
+
ret = process_counter_maps(counter);
if (ret)
return ret;
@@ -328,9 +331,6 @@ static int read_counter(struct perf_evsel *counter)
if (counter->system_wide)
nthreads = 1;
 
-   if (counter->per_pkg)
-   zero_per_pkg(counter);
-
for (thread = 0; thread < nthreads; thread++) {
for (cpu = 0; cpu < ncpus; cpu++) {
struct perf_counts_values *count;
--
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/


[tip:perf/urgent] perf stat: Separate counters reading and processing

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  3b3eb044519ac4c422dbc6084303c470b8d2dc61
Gitweb: http://git.kernel.org/tip/3b3eb044519ac4c422dbc6084303c470b8d2dc61
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:20 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:49:03 -0300

perf stat: Separate counters reading and processing

Separating counters reading and processing so we could use the
processing part in following patches.

Using simple reading via perf_evsel__read function to read counters now,
because part of the processing was in the read_cb callback.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-16-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 56 +--
 1 file changed, 39 insertions(+), 17 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 158859e..74ac92b 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -217,8 +217,9 @@ static int check_per_pkg(struct perf_evsel *counter, int 
cpu, bool *skip)
return 0;
 }
 
-static int read_cb(struct perf_evsel *evsel, int cpu, int thread,
-  struct perf_counts_values *count)
+static int
+process_counter_values(struct perf_evsel *evsel, int cpu, int thread,
+  struct perf_counts_values *count)
 {
struct perf_counts_values *aggr = &evsel->counts->aggr;
static struct perf_counts_values zero;
@@ -239,7 +240,6 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int 
thread,
if (!evsel->snapshot)
perf_evsel__compute_deltas(evsel, cpu, thread, count);
perf_counts_values__scale(count, scale, NULL);
-   *perf_counts(evsel->counts, cpu, thread) = *count;
if (aggr_mode == AGGR_NONE)
perf_stat__update_shadow_stats(evsel, count->values, 
cpu);
break;
@@ -256,23 +256,41 @@ static int read_cb(struct perf_evsel *evsel, int cpu, int 
thread,
return 0;
 }
 
-static int read_counter(struct perf_evsel *counter);
+static int process_counter_maps(struct perf_evsel *counter)
+{
+   int nthreads = thread_map__nr(counter->threads);
+   int ncpus = perf_evsel__nr_cpus(counter);
+   int cpu, thread;
 
-/*
- * Read out the results of a single counter:
- * aggregate counts across CPUs in system-wide mode
- */
-static int read_counter_aggr(struct perf_evsel *counter)
+   if (counter->system_wide)
+   nthreads = 1;
+
+   for (thread = 0; thread < nthreads; thread++) {
+   for (cpu = 0; cpu < ncpus; cpu++) {
+   if (process_counter_values(counter, cpu, thread,
+  perf_counts(counter->counts, 
cpu, thread)))
+   return -1;
+   }
+   }
+
+   return 0;
+}
+
+static int process_counter(struct perf_evsel *counter)
 {
struct perf_counts_values *aggr = &counter->counts->aggr;
struct perf_stat *ps = counter->priv;
u64 *count = counter->counts->aggr.values;
-   int i;
+   int i, ret;
 
aggr->val = aggr->ena = aggr->run = 0;
 
-   if (read_counter(counter))
-   return -1;
+   ret = process_counter_maps(counter);
+   if (ret)
+   return ret;
+
+   if (aggr_mode != AGGR_GLOBAL)
+   return 0;
 
if (!counter->snapshot)
perf_evsel__compute_deltas(counter, -1, -1, aggr);
@@ -315,7 +333,10 @@ static int read_counter(struct perf_evsel *counter)
 
for (thread = 0; thread < nthreads; thread++) {
for (cpu = 0; cpu < ncpus; cpu++) {
-   if (perf_evsel__read_cb(counter, cpu, thread, read_cb))
+   struct perf_counts_values *count;
+
+   count = perf_counts(counter->counts, cpu, thread);
+   if (perf_evsel__read(counter, cpu, thread, count))
return -1;
}
}
@@ -332,10 +353,11 @@ static void read_counters(bool close)
ps = counter->priv;
memset(ps->res_stats, 0, sizeof(ps->res_stats));
 
-   if (aggr_mode == AGGR_GLOBAL)
-   read_counter_aggr(counter);
-   else
-   read_counter(counter);
+   if (read_counter(counter))
+   pr_warning("failed to read counter %s\n", 
counter->name);
+
+   if (process_counter(counter))
+   pr_warning("failed to process counter %s\n", 
counter->name);
 
if (close) {
perf_evsel__close_fd(counter, 
perf_evsel__nr_cpus(counter),
--
To unsubscribe from this list: send the lin

Re: [RFC PATCH 1/2] regmap: add configurable lock class key for lockdep

2015-06-29 Thread Nicolas Boichat
On Mon, Jun 29, 2015 at 04:34:11PM +0100, Mark Brown wrote:
> On Mon, Jun 29, 2015 at 04:18:11PM +0200, Lars-Peter Clausen wrote:
> > Leaves us pretty much with only two options. Either add a lock key pointer
> > to regmap_config which needs to be manually initialized. Or wrap all
> > regmap_init() variants to create a static lock key. I'd slightly prefer the
> > later. We can avoid most of the boiler-plate code by using some helper
> > macros to generate the wrappers.
> 
> It's better to keep the bodges in the core, yes.

Partial attempt below. Of course all other _init functions will need to be
converted as well. I'd like to get feedback before I do the rest of the work.
The macro part is quite repetitive and I don't think it can be simplified.

Thanks!

>8--8<
Subject: [PATCH] regmap: Use different lockdep classes for each regmap init
 call

Lockdep validator complains about recursive locking and deadlock
when two different regmap instances are called in a nested order.
That happens anytime a regmap read/write call needs to access
another regmap.

This is because, for performance reason, lockdep groups all locks
initialized by the same mutex_init() in the same lock class.
Therefore all regmap mutexes are in the same lock class, leading
to lockdep "nested locking" warnings if a regmap accesses another
regmap.

In general, it is impossible to establish in advance the hierarchy
of regmaps, so we make sure that each regmap init call initializes
its own static lock_class_key. This is done by wrapping all
regmap_init calls into macros.

This also allows us to give meaningful names to the lock_class_key.
For example, in rt5677 case, we have in /proc/lockdep_chains:
irq_context: 0
[ffc0018d2198] &dev->mutex
[ffc0018d2198] &dev->mutex
[ffc001bd7f60] rt5677:5104:(&rt5677_regmap)->_lock
[ffc001bd7f58] rt5677:5096:(&rt5677_regmap_physical)->_lock
[ffc001b95448] &(&base->lock)->rlock

The above would have resulted in a lockdep recursive warning
previously. This is not the case anymore as the lockdep validator
now clearly identifies the 2 locks as separate.

Signed-off-by: Nicolas Boichat 
---
 drivers/base/regmap/regmap-i2c.c | 22 ++
 drivers/base/regmap/regmap.c | 31 +-
 include/linux/regmap.h   | 91 ++--
 3 files changed, 113 insertions(+), 31 deletions(-)

diff --git a/drivers/base/regmap/regmap-i2c.c b/drivers/base/regmap/regmap-i2c.c
index 053150a..c1f9396 100644
--- a/drivers/base/regmap/regmap-i2c.c
+++ b/drivers/base/regmap/regmap-i2c.c
@@ -198,17 +198,20 @@ static const struct regmap_bus *regmap_get_i2c_bus(struct 
i2c_client *i2c,
  * The return value will be an ERR_PTR() on error or a valid pointer to
  * a struct regmap.
  */
-struct regmap *regmap_init_i2c(struct i2c_client *i2c,
-  const struct regmap_config *config)
+struct regmap *__regmap_init_i2c(struct i2c_client *i2c,
+const struct regmap_config *config,
+struct lock_class_key *lock_key,
+const char *lock_name)
 {
const struct regmap_bus *bus = regmap_get_i2c_bus(i2c, config);
 
if (IS_ERR(bus))
return ERR_CAST(bus);
 
-   return regmap_init(&i2c->dev, bus, &i2c->dev, config);
+   return __regmap_init(&i2c->dev, bus, &i2c->dev, config,
+lock_key, lock_name);
 }
-EXPORT_SYMBOL_GPL(regmap_init_i2c);
+EXPORT_SYMBOL_GPL(__regmap_init_i2c);
 
 /**
  * devm_regmap_init_i2c(): Initialise managed register map
@@ -220,16 +223,19 @@ EXPORT_SYMBOL_GPL(regmap_init_i2c);
  * to a struct regmap.  The regmap will be automatically freed by the
  * device management code.
  */
-struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
-   const struct regmap_config *config)
+struct regmap *__devm_regmap_init_i2c(struct i2c_client *i2c,
+ const struct regmap_config *config,
+ struct lock_class_key *lock_key,
+ const char *lock_name)
 {
const struct regmap_bus *bus = regmap_get_i2c_bus(i2c, config);
 
if (IS_ERR(bus))
return ERR_CAST(bus);
 
-   return devm_regmap_init(&i2c->dev, bus, &i2c->dev, config);
+   return __devm_regmap_init(&i2c->dev, bus, &i2c->dev, config,
+ lock_key, lock_name);
 }
-EXPORT_SYMBOL_GPL(devm_regmap_init_i2c);
+EXPORT_SYMBOL_GPL(__devm_regmap_init_i2c);
 
 MODULE_LICENSE("GPL");
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index d2f8a81..b8e26af 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -526,10 +526,12 @@ static enum regmap_endian regmap_get_val_endian(struct 
device *dev,
  * a struct regmap.  This function should generally not be called

[tip:perf/urgent] perf stat: Move perf_stat initialization counter process code

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  7ddb1b6bbf1e614e6700f226cb0a559c5c635336
Gitweb: http://git.kernel.org/tip/7ddb1b6bbf1e614e6700f226cb0a559c5c635336
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:22 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:50:19 -0300

perf stat: Move perf_stat initialization counter process code

Moving perf_stat initialization counter process code,
to make the reading path free of processing logic.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-18-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index b7c184b..526f677 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -284,6 +284,7 @@ static int process_counter(struct perf_evsel *counter)
int i, ret;
 
aggr->val = aggr->ena = aggr->run = 0;
+   memset(ps->res_stats, 0, sizeof(ps->res_stats));
 
if (counter->per_pkg)
zero_per_pkg(counter);
@@ -347,12 +348,8 @@ static int read_counter(struct perf_evsel *counter)
 static void read_counters(bool close)
 {
struct perf_evsel *counter;
-   struct perf_stat *ps;
 
evlist__for_each(evsel_list, counter) {
-   ps = counter->priv;
-   memset(ps->res_stats, 0, sizeof(ps->res_stats));
-
if (read_counter(counter))
pr_warning("failed to read counter %s\n", 
counter->name);
 
--
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/


[tip:perf/urgent] perf stat: Using init_stats instead of memset

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  5835e2286583e4fa6c2a609446e1320e7da2b161
Gitweb: http://git.kernel.org/tip/5835e2286583e4fa6c2a609446e1320e7da2b161
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:25 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:51:49 -0300

perf stat: Using init_stats instead of memset

The init_stats function is meant to init 'struct stats'.

Reported-by: David Ahern 
Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-21-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index aa706fc..39a97ade 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -284,7 +284,7 @@ static int process_counter(struct perf_evsel *counter)
int i, ret;
 
aggr->val = aggr->ena = aggr->run = 0;
-   memset(ps->res_stats, 0, sizeof(ps->res_stats));
+   init_stats(ps->res_stats);
 
if (counter->per_pkg)
zero_per_pkg(counter);
--
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/


[tip:perf/urgent] perf stat: Remove perf_evsel__read_cb function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  d8ee3b54d0458cbed0a31a410458f4bfd38fc147
Gitweb: http://git.kernel.org/tip/d8ee3b54d0458cbed0a31a410458f4bfd38fc147
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:23 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:50:51 -0300

perf stat: Remove perf_evsel__read_cb function

It's no longer used, the stat command uses perf_evsel__read now.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-19-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/util/evsel.c | 16 
 tools/perf/util/evsel.h |  7 ---
 2 files changed, 23 deletions(-)

diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index 2e0a4e0..2936b30 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -939,22 +939,6 @@ void perf_counts_values__scale(struct perf_counts_values 
*count,
*pscaled = scaled;
 }
 
-int perf_evsel__read_cb(struct perf_evsel *evsel, int cpu, int thread,
-   perf_evsel__read_cb_t cb)
-{
-   struct perf_counts_values count;
-
-   memset(&count, 0, sizeof(count));
-
-   if (FD(evsel, cpu, thread) < 0)
-   return -EINVAL;
-
-   if (readn(FD(evsel, cpu, thread), &count, sizeof(count)) < 0)
-   return -errno;
-
-   return cb(evsel, cpu, thread, &count);
-}
-
 int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
 struct perf_counts_values *count)
 {
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index a79944a..4a7ed56 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -229,13 +229,6 @@ static inline bool perf_evsel__match2(struct perf_evsel 
*e1,
 (a)->attr.type == (b)->attr.type &&\
 (a)->attr.config == (b)->attr.config)
 
-typedef int (perf_evsel__read_cb_t)(struct perf_evsel *evsel,
-   int cpu, int thread,
-   struct perf_counts_values *count);
-
-int perf_evsel__read_cb(struct perf_evsel *evsel, int cpu, int thread,
-   perf_evsel__read_cb_t cb);
-
 int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
 struct perf_counts_values *count);
 
--
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/


[tip:perf/urgent] perf stat: Rename print_interval to process_interval

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  ba411a954eae3e88c02667a5670cac97fb9c3f58
Gitweb: http://git.kernel.org/tip/ba411a954eae3e88c02667a5670cac97fb9c3f58
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:24 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 11:51:23 -0300

perf stat: Rename print_interval to process_interval

It suits better, because the function also reads counter's data.

Also the 'print_interval' name will be used in following generalization
of counters display.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-20-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 526f677..aa706fc 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -363,7 +363,7 @@ static void read_counters(bool close)
}
 }
 
-static void print_interval(void)
+static void process_interval(void)
 {
static int num_print_interval;
struct perf_evsel *counter;
@@ -526,7 +526,7 @@ static int __run_perf_stat(int argc, const char **argv)
if (interval) {
while (!waitpid(child_pid, &status, WNOHANG)) {
nanosleep(&ts, NULL);
-   print_interval();
+   process_interval();
}
}
wait(&status);
@@ -544,7 +544,7 @@ static int __run_perf_stat(int argc, const char **argv)
while (!done) {
nanosleep(&ts, NULL);
if (interval)
-   print_interval();
+   process_interval();
}
}
 
--
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/


[tip:perf/urgent] perf stat: Introduce print_counters function

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  d4f63a4741a808c0bf25d92884713008706fca16
Gitweb: http://git.kernel.org/tip/d4f63a4741a808c0bf25d92884713008706fca16
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:26 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 12:00:50 -0300

perf stat: Introduce print_counters function

Centralize counters print code into single print_counters function.

Signed-off-by: Jiri Olsa 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-22-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-stat.c | 127 +++---
 1 file changed, 64 insertions(+), 63 deletions(-)

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 39a97ade..56dc888 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -67,10 +67,7 @@
 #define CNTR_NOT_SUPPORTED ""
 #define CNTR_NOT_COUNTED   ""
 
-static void print_stat(int argc, const char **argv);
-static void print_counter_aggr(struct perf_evsel *counter, char *prefix);
-static void print_counter(struct perf_evsel *counter, char *prefix);
-static void print_aggr(char *prefix);
+static void print_counters(struct timespec *ts, int argc, const char **argv);
 
 /* Default events used for perf stat -T */
 static const char *transaction_attrs = {
@@ -365,53 +362,14 @@ static void read_counters(bool close)
 
 static void process_interval(void)
 {
-   static int num_print_interval;
-   struct perf_evsel *counter;
struct timespec ts, rs;
-   char prefix[64];
 
read_counters(false);
 
clock_gettime(CLOCK_MONOTONIC, &ts);
diff_timespec(&rs, &ts, &ref_time);
-   sprintf(prefix, "%6lu.%09lu%s", rs.tv_sec, rs.tv_nsec, csv_sep);
-
-   if (num_print_interval == 0 && !csv_output) {
-   switch (aggr_mode) {
-   case AGGR_SOCKET:
-   fprintf(output, "#   time socket cpus   
  counts %*s events\n", unit_width, "unit");
-   break;
-   case AGGR_CORE:
-   fprintf(output, "#   time core cpus 
counts %*s events\n", unit_width, "unit");
-   break;
-   case AGGR_NONE:
-   fprintf(output, "#   time CPU
counts %*s events\n", unit_width, "unit");
-   break;
-   case AGGR_GLOBAL:
-   default:
-   fprintf(output, "#   time counts 
%*s events\n", unit_width, "unit");
-   }
-   }
-
-   if (++num_print_interval == 25)
-   num_print_interval = 0;
 
-   switch (aggr_mode) {
-   case AGGR_CORE:
-   case AGGR_SOCKET:
-   print_aggr(prefix);
-   break;
-   case AGGR_NONE:
-   evlist__for_each(evsel_list, counter)
-   print_counter(counter, prefix);
-   break;
-   case AGGR_GLOBAL:
-   default:
-   evlist__for_each(evsel_list, counter)
-   print_counter_aggr(counter, prefix);
-   }
-
-   fflush(output);
+   print_counters(&rs, 0, NULL);
 }
 
 static void handle_initial_delay(void)
@@ -901,9 +859,35 @@ static void print_counter(struct perf_evsel *counter, char 
*prefix)
}
 }
 
-static void print_stat(int argc, const char **argv)
+static void print_interval(char *prefix, struct timespec *ts)
+{
+   static int num_print_interval;
+
+   sprintf(prefix, "%6lu.%09lu%s", ts->tv_sec, ts->tv_nsec, csv_sep);
+
+   if (num_print_interval == 0 && !csv_output) {
+   switch (aggr_mode) {
+   case AGGR_SOCKET:
+   fprintf(output, "#   time socket cpus   
  counts %*s events\n", unit_width, "unit");
+   break;
+   case AGGR_CORE:
+   fprintf(output, "#   time core cpus 
counts %*s events\n", unit_width, "unit");
+   break;
+   case AGGR_NONE:
+   fprintf(output, "#   time CPU
counts %*s events\n", unit_width, "unit");
+   break;
+   case AGGR_GLOBAL:
+   default:
+   fprintf(output, "#   time counts 
%*s events\n", unit_width, "unit");
+   }
+   }
+
+   if (++num_print_interval == 25)
+   num_print_interval = 0;
+}
+
+static void print_header(int argc, const char **argv)
 {
-   struct perf_evsel *counter;
int i;
 
fflush(stdout);
@@ -929,36 +913,53 @@ static void print_stat(int argc, const char **argv)
fprintf(output, " (%d runs)", run_count);
fprintf(output

[tip:perf/urgent] perf symbols: Check access permission when reading symbol files

2015-06-29 Thread tip-bot for Li Zhang
Commit-ID:  36c8bb56a9f718a9a5f35d1834ca9dcec95deb4a
Gitweb: http://git.kernel.org/tip/36c8bb56a9f718a9a5f35d1834ca9dcec95deb4a
Author: Li Zhang 
AuthorDate: Fri, 19 Jun 2015 16:57:33 +0800
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 12:11:53 -0300

perf symbols: Check access permission when reading symbol files

There 2 problems when reading symbols files:

*  It doesn't report any errors even if when users specify symbol
   files which don't exist with --kallsyms or --vmlinux. The result
   just shows the address without symbols, which is not what is expected.
   So it's better to report errors and exit the program.

*  When using command perf report --kallsyms=/proc/kallsyms with a
   non-root user, symbols are resolved. Then select one symbol and
   annotate it, it reports the error as the following:
   Can't annotate __clear_user: No vmlinux file with build id xxx was
   found.

   The problem is caused by reading /proc/kcore without access permission.
   /proc/kcore requires CAP_SYS_RAWIO capability to access, so it needs to
   change access permission to allow a specific user to read /proc/kcore or
   use root to execute the perf command.

This patch is to report errors when symbol files specified by users
don't exist. And check access permission of /proc/kcore when reading it.

Signed-off-by: Li Zhang 
Cc: Sukadev Bhattiprolu 
Link: 
http://lkml.kernel.org/r/1434704253-2632-1-git-send-email-zhlci...@linux.vnet.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/builtin-report.c | 11 +++
 tools/perf/util/symbol.c|  5 -
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 32626ea..348bed4 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -742,6 +742,17 @@ int cmd_report(int argc, const char **argv, const char 
*prefix __maybe_unused)
 
argc = parse_options(argc, argv, options, report_usage, 0);
 
+   if (symbol_conf.vmlinux_name &&
+   access(symbol_conf.vmlinux_name, R_OK)) {
+   pr_err("Invalid file: %s\n", symbol_conf.vmlinux_name);
+   return -EINVAL;
+   }
+   if (symbol_conf.kallsyms_name &&
+   access(symbol_conf.kallsyms_name, R_OK)) {
+   pr_err("Invalid file: %s\n", symbol_conf.kallsyms_name);
+   return -EINVAL;
+   }
+
if (report.use_stdio)
use_browser = 0;
else if (report.use_tui)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 504f2d7..48b588c 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1132,8 +1132,11 @@ static int dso__load_kcore(struct dso *dso, struct map 
*map,
INIT_LIST_HEAD(&md.maps);
 
fd = open(kcore_filename, O_RDONLY);
-   if (fd < 0)
+   if (fd < 0) {
+   pr_err("%s requires CAP_SYS_RAWIO capability to access.\n",
+   kcore_filename);
return -EINVAL;
+   }
 
/* Read new maps into temporary lists */
err = file__read_maps(fd, md.type == MAP__FUNCTION, kcore_mapfn, &md,
--
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/


[tip:perf/urgent] perf stat: Introduce --per-thread option

2015-06-29 Thread tip-bot for Jiri Olsa
Commit-ID:  32b8af82e3708bc19af75c31fa773a98449f0edc
Gitweb: http://git.kernel.org/tip/32b8af82e3708bc19af75c31fa773a98449f0edc
Author: Jiri Olsa 
AuthorDate: Fri, 26 Jun 2015 11:29:27 +0200
Committer:  Arnaldo Carvalho de Melo 
CommitDate: Fri, 26 Jun 2015 12:05:04 -0300

perf stat: Introduce --per-thread option

Currently all the -p option PID arguments tasks values get aggregated
and printed as single values.

Adding --per-tasks option to print values per task.

  $ perf stat  -e cycles,instructions --per-thread -p 30190,30242
  ^C
   Performance counter stats for process id '30190,30242':

   cat-30190 0  cycles
   yes-30242 3,842,525,421  cycles
   cat-30190 0  instructions
   yes-3024210,370,817,010  instructions

 1.143155657 seconds time elapsed

Also works under interval mode:

  $ perf stat  -e cycles,instructions --per-thread -p 30190,30242 -I 1000
  #   time comm-pid  counts unit events
   1.73435  cat-3019089,058  cycles
   1.73435  yes-30242 3,360,786,902  cycles 
(100.00%)
   1.73435  cat-3019014,066  
instructions
   1.73435  yes-30242 9,069,937,462  
instructions
   2.000204830  cat-30190 0  cycles
   2.000204830  yes-30242 3,351,667,626  cycles
   2.000204830  cat-30190 0  
instructions
   2.000204830  yes-30242 9,045,796,885  
instructions
  ^C 2.771286639  cat-30190 0  cycles
   2.771286639  yes-30242 2,593,884,166  cycles
   2.771286639  cat-30190 0  
instructions
   2.771286639  yes-30242 7,001,171,191  
instructions

It works only with -t and -p options, otherwise following error is
printed:

  $ perf stat  -e cycles --per-thread  -I 1000 ls
  The --per-thread option is only available when monitoring via -p -t options.
  -p, --pidstat events on existing process id
  -t, --tidstat events on existing thread id

Signed-off-by: Jiri Olsa 
Tested-by: Arnaldo Carvalho de Melo 
Cc: Adrian Hunter 
Cc: Andi Kleen 
Cc: David Ahern 
Cc: Namhyung Kim 
Cc: Peter Zijlstra 
Cc: Stephane Eranian 
Link: 
http://lkml.kernel.org/r/1435310967-14570-23-git-send-email-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo 
---
 tools/perf/Documentation/perf-stat.txt |  4 ++
 tools/perf/builtin-stat.c  | 76 +-
 tools/perf/util/stat.h |  1 +
 3 files changed, 79 insertions(+), 2 deletions(-)

diff --git a/tools/perf/Documentation/perf-stat.txt 
b/tools/perf/Documentation/perf-stat.txt
index 04e150d..47469ab 100644
--- a/tools/perf/Documentation/perf-stat.txt
+++ b/tools/perf/Documentation/perf-stat.txt
@@ -144,6 +144,10 @@ is a useful mode to detect imbalance between physical 
cores.  To enable this mod
 use --per-core in addition to -a. (system-wide).  The output includes the
 core number and the number of online logical processors on that physical 
processor.
 
+--per-thread::
+Aggregate counts per monitored threads, when monitoring threads (-t option)
+or processes (-p option).
+
 -D msecs::
 --delay msecs::
 After starting the program, wait msecs before measuring. This is useful to
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 56dc888..37e301a 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -231,6 +231,7 @@ process_counter_values(struct perf_evsel *evsel, int cpu, 
int thread,
count = &zero;
 
switch (aggr_mode) {
+   case AGGR_THREAD:
case AGGR_CORE:
case AGGR_SOCKET:
case AGGR_NONE:
@@ -602,6 +603,14 @@ static void aggr_printout(struct perf_evsel *evsel, int 
id, int nr)
csv_output ? 0 : -4,
perf_evsel__cpus(evsel)->map[id], csv_sep);
break;
+   case AGGR_THREAD:
+   fprintf(output, "%*s-%*d%s",
+   csv_output ? 0 : 16,
+   thread_map__comm(evsel->threads, id),
+   csv_output ? 0 : -8,
+   thread_map__pid(evsel->threads, id),
+   csv_sep);
+   break;
case AGGR_GLOBAL:
default:
break;
@@ -750,6 +759,40 @@ static void print_aggr(char *prefix)
}
 }
 
+static void print_aggr_thread(struct perf_evsel *counter, char *prefix)
+{
+   int nthreads = thread_map__nr(counter->threads);
+   int ncpus = cpu_map__nr(counter->cpus);
+   int cpu, thread;
+   double uval;
+
+   for (threa

Re: [GIT PULL 0/8] perf/pt -> Intel PT/BTS

2015-06-29 Thread Ingo Molnar

* Arnaldo Carvalho de Melo  wrote:

> Hi Ingo,
> 
>   Please consider pulling, there are several other patches after this,
> but I think that this may be acceptable to showcase the capabilities already
> present, look at the output of 'perf script' and callchains for userspace
> without using any extra debugging info (no need for DWARF, CFI, nothing),
> really cool capabilities... :-)
> 
>   Adrian wrote some docs and I tested it both on a Ivy Bridge machine
> where there is only BTS and on a Broadwell machine with the whole shebang,
> adding the output of the commands to the csets, to further showcase what is
> there already.
> 
>   This is on top of my last perf-core-for-mingo tag.
> 
>   Up to you, please let us know what you think and we'll continue working
> on having this in an acceptable form for merging,
> 
> Regards,
> 
> - Arnaldo
> 
> P.S. Kudos for Adrian for the patience with this process, way more is needed 
> to
> polish this, but the promise is there, cool stuff indeed! :-)
> 
> The following changes since commit 36c8bb56a9f718a9a5f35d1834ca9dcec95deb4a:
> 
>   perf symbols: Check access permission when reading symbol files (2015-06-26 
> 12:11:53 -0300)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git 
> tags/perf-pt-for-mingo
> 
> for you to fetch changes up to 04759f172270afb28c8004f5cad62ed55710a499:
> 
>   perf tools: Add Intel BTS support (2015-06-26 18:36:11 -0300)
> 
> 
> Put Intel PT and BTS into initial use (Adrian Hunter)
> 
> Signed-off-by: Arnaldo Carvalho de Melo 
> 
> 
> Adrian Hunter (8):
>   perf auxtrace: Add Intel PT as an AUX area tracing type
>   perf tools: Add Intel PT packet decoder
>   perf tools: Add Intel PT instruction decoder
>   perf tools: Add Intel PT log
>   perf tools: Add Intel PT decoder
>   perf tools: Add Intel PT support
>   perf tools: Take Intel PT into use
>   perf tools: Add Intel BTS support
> 
>  tools/build/Makefile.build |2 +
>  tools/perf/.gitignore  |2 +
>  tools/perf/Documentation/intel-bts.txt |   86 +
>  tools/perf/Documentation/intel-pt.txt  |  588 ++
>  tools/perf/MANIFEST|7 +
>  tools/perf/Makefile.perf   |   12 +-
>  tools/perf/arch/x86/util/Build |5 +
>  tools/perf/arch/x86/util/auxtrace.c|   83 +
>  tools/perf/arch/x86/util/intel-bts.c   |  458 +
>  tools/perf/arch/x86/util/intel-pt.c|  752 
>  tools/perf/arch/x86/util/pmu.c |   18 +
>  tools/perf/util/Build  |3 +
>  tools/perf/util/auxtrace.c |9 +-
>  tools/perf/util/auxtrace.h |2 +
>  tools/perf/util/intel-bts.c|  791 
>  tools/perf/util/intel-bts.h|   43 +
>  tools/perf/util/intel-pt-decoder/Build |   14 +
>  .../perf/util/intel-pt-decoder/intel-pt-decoder.c  | 1759 ++
>  .../perf/util/intel-pt-decoder/intel-pt-decoder.h  |  102 ++
>  .../util/intel-pt-decoder/intel-pt-insn-decoder.c  |  246 +++
>  .../util/intel-pt-decoder/intel-pt-insn-decoder.h  |   65 +
>  tools/perf/util/intel-pt-decoder/intel-pt-log.c|  155 ++
>  tools/perf/util/intel-pt-decoder/intel-pt-log.h|   52 +
>  .../util/intel-pt-decoder/intel-pt-pkt-decoder.c   |  400 +
>  .../util/intel-pt-decoder/intel-pt-pkt-decoder.h   |   64 +
>  tools/perf/util/intel-pt.c | 1889 
> 
>  tools/perf/util/intel-pt.h |   51 +
>  tools/perf/util/pmu.c  |4 -
>  28 files changed, 7655 insertions(+), 7 deletions(-)
>  create mode 100644 tools/perf/Documentation/intel-bts.txt
>  create mode 100644 tools/perf/Documentation/intel-pt.txt
>  create mode 100644 tools/perf/arch/x86/util/auxtrace.c
>  create mode 100644 tools/perf/arch/x86/util/intel-bts.c
>  create mode 100644 tools/perf/arch/x86/util/intel-pt.c
>  create mode 100644 tools/perf/arch/x86/util/pmu.c
>  create mode 100644 tools/perf/util/intel-bts.c
>  create mode 100644 tools/perf/util/intel-bts.h
>  create mode 100644 tools/perf/util/intel-pt-decoder/Build
>  create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-decoder.c
>  create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-decoder.h
>  create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.c
>  create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-insn-decoder.h
>  create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-log.c
>  create mode 100644 tools/perf/util/intel-pt-decoder/intel-pt-log.h
>  create mode 100644 to

Re: [PATCH] fs/file.c: __fget() and dup2() atomicity rules

2015-06-29 Thread Eric Dumazet
On Mon, 2015-06-29 at 18:46 +0100, Al Viro wrote:
> On Mon, Jun 29, 2015 at 05:10:30PM +0200, Eric Dumazet wrote:
> > From: Eric Dumazet 
> > 
> > __fget() makes sure a file refcount is not zero before
> > taking a reference. It should also fetch again file pointer
> > in order to respect dup2() atomicity requirements.
> > 
> > It should either read a NULL pointer or a file on which
> > a refcount can be taken.
> 
> Hmm...   The problem is real, but I wonder if one could trigger a long
> spin there...

I do not believe we can spin a long time.

By the time do_dup2() calls filp_close(tofree, files), we already have a
stable fdt->fd[fd], because of spin_unlock(&files->file_lock) was called
before filp_close()

A loop would require threads doing dup2() calls like crazy on same
destination fd.





--
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] igb: Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0])

2015-06-29 Thread Joe Perches
On Tue, 2015-06-30 at 10:25 +0530, Maninder Singh wrote:
> Use ARRAY_SIZE instead fo sizeof(a)/sizeof(a[0])

I think all of these #defines should be removed instead
as they are all used only once.

> diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c 
> b/drivers/net/ethernet/intel/igb/e1000_phy.c
[]
> @@ -37,8 +37,7 @@ static s32  igb_set_master_slave_mode(struct e1000_hw *hw);
>  static const u16 e1000_m88_cable_length_table[] = {
>   0, 50, 80, 110, 140, 140, E1000_CABLE_LENGTH_UNDEFINED };
>  #define M88E1000_CABLE_LENGTH_TABLE_SIZE \
> - (sizeof(e1000_m88_cable_length_table) / \
> - sizeof(e1000_m88_cable_length_table[0]))
> + ARRAY_SIZE(e1000_m88_cable_length_table)
>  
>  static const u16 e1000_igp_2_cable_length_table[] = {
>   0, 0, 0, 0, 0, 0, 0, 0, 3, 5, 8, 11, 13, 16, 18, 21,
> @@ -50,8 +49,7 @@ static const u16 e1000_igp_2_cable_length_table[] = {
>   83, 89, 95, 100, 105, 109, 113, 116, 119, 122, 124,
>   104, 109, 114, 118, 121, 124};
>  #define IGP02E1000_CABLE_LENGTH_TABLE_SIZE \
> - (sizeof(e1000_igp_2_cable_length_table) / \
> -  sizeof(e1000_igp_2_cable_length_table[0]))
> + ARRAY_SIZE(e1000_igp_2_cable_length_table)
>  
>  /**
>   *  igb_check_reset_block - Check if PHY reset is blocked



--
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: [all better] Re: regression: massive trouble with fpu rework

2015-06-29 Thread Ingo Molnar

* H. Peter Anvin  wrote:

> On 06/29/2015 02:35 AM, Ingo Molnar wrote:
> > 
> > Indeed, I bet that makes a difference!
> > 
> > I wish that 'unmasking' logic came with more comments:
> > 
> >   - Why do BIOSen ever mask CPUIDs?
> > 
> 
> To work around bugs in legacy operating systems.
>
> >   - Why do we unmask the masking?
> 
> Because we don't have those specific bugs.

Great - would be nice to put those reasons between /* */ markers, to keep 
future 
generations (and overworked maintainers!) from wondering.

> >   - Why doesn't the kernel keep on working just fine even if certain CPUID 
> > aspects 
> > are turned off?
> 
> Because it exercises code paths that are otherwise impossible, for example, 
> it 
> exposes the XSAVE capability without exposing the XSAVE information in higher 
> CPUID leaves.
> 
> The other option would be to have a list of CPU features that should be 
> turned 
> off whenever the CPUID leaf maximum is too low, but it gives a better user 
> experience to just override the BIOS capping and then we have fewer code 
> paths 
> in the kernel to worry about.

1)

As a side note, I think we should generally be robust enough to recognize 
pretty 
much any CPUID 'mischief' and at minimum not crash.

2)

But this FPU crash is different, here the reason for the crash is the following 
bug in the FPU code:

fpu__init_system(); /* inits the FPU based on masked CPUID */

... CPUID *extends* ...

fpu__init_cpu(); /* Actually uses the FPU now based on the expanded 
CPUID */

*KABOOM*

I.e. we (obviously) should not base half on the FPU logic on different CPUID 
bits 
than the other half of the FPU logic.

I'll queue up the fix, which is to do the early FPU init after our CPUID state 
stabilizes. (i.e. the second patch I sent to Mike.)

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: [all better] Re: regression: massive trouble with fpu rework

2015-06-29 Thread Ingo Molnar

* Borislav Petkov  wrote:

> On Mon, Jun 29, 2015 at 02:27:23PM +0200, Mike Galbraith wrote:
> > With it commented out, and fpu__init_system() either back at previously
> > booting position [5] or at original [0], doesn't matter, box is dead,
> > but differently.  It stalls after setting clocksource to tsc, and just
> > sits there.
> 
> ... which means that unmasking the CPUID features is absolutely needed
> on Linux. Not unmasking probably triggers this original bug which
> 
>   066941bd4eeb ("x86: unmask CPUID levels on Intel CPUs")
> 
> fixed.

Yes.

And I'd consider us hanging a separate (but not high prio) bug: the kernel 
should 
be robust as long as the CPUID data is stable. In that sense the original fix 
is 
right (we really want to unmask all available CPUID leaves), but it also masked 
another (less severe) kernel bug.

For example virtualization is known to tweak CPUID details creatively, and 
firmware (as this example shows it) can mess it up a well, so we generally want 
to 
treat it as untrusted input data that needs to be validated.

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: [all better] Re: regression: massive trouble with fpu rework

2015-06-29 Thread Ingo Molnar

* H. Peter Anvin  wrote:

> On 06/28/2015 11:40 PM, Ingo Molnar wrote:
> > 
> > Ok, so could you please move the fpu__init_system() further up and see 
> > which 
> > position is that starts breaking with the BIOS option set?
> > 
> > here's the current, broken layout of the code:
> > 
> > get_cpu_cap(c);
> > [0] fpu__init_system(c);
> > 
> > if (this_cpu->c_early_init)
> > this_cpu->c_early_init(c);
> > 
> > [1]
> > c->cpu_index = 0;
> > [2]
> > filter_cpuid_features(c, false);
> > 
> > [3]
> > if (this_cpu->c_bsp_init)
> > this_cpu->c_bsp_init(c);
> > 
> > [4]
> > setup_force_cpu_cap(X86_FEATURE_ALWAYS);
> > [5]
> > }
> > 
> > and we know it from your testing that moving [0] to [5] fixes the crash.
> > 
> > The question is, can we move it to [4], [3], [2] or even [1] instead, 
> > without 
> > breaking the system?
> > 
> > I still don't see where the breakage comes from, but this would help us 
> > narrow it 
> > down.
> > 
> 
> It should be moved to [4] or [5].  I would argue that the line setting
> X86_FEATURE_ALWAYS should moved up and then fpu__init_system(c) should
> be moved after the c_bsp_init() line.

Yeah, so the patch I sent to Mike (and which solved the bug) moved it to [5].

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: [v2,2/3] watchdog: max63xx: add GPIO support

2015-06-29 Thread Vivien Didelot
Hi Guenter,

On Jun 27, 2015, at 12:17 PM, Guenter Roeck li...@roeck-us.net wrote:

> On 06/22/2015 01:43 PM, Vivien Didelot wrote:
>> Hi Guenter,
>>
>> On Jun 22, 2015, at 12:53 PM, Guenter Roeck li...@roeck-us.net wrote:
>>> On Wed, Jun 17, 2015 at 06:58:59PM -0400, Vivien Didelot wrote:
 Introduce a new struct max63xx_platform_data to support MAX63xx watchdog
 chips connected via GPIO. A platform code can fill this structure with
 GPIO numbers for WDI and WDSET pins to enable GPIO support in the code.

 The driver takes care of requesting and releasing the GPIOs.

 Signed-off-by: Vivien Didelot 
>>>
>>> would it be possible to use gpiod functions ?
>>
>> It might be, but I never played with it yet though. I'm using integer-based
>> GPIOs from a TCA6424 on an x86 platform (no Device Tree). Is it ok to keep
>> max63xx_gpio_{ping,set} for legacy GPIOs, and let someone add
>> max63xx_gpiod_{ping,set} if there is a need?
>>
> 
> Hi Vivien,
> 
> That would pretty much defeat the purpose. The gpiod API is supposed
> to replace the gpio API, not to augment it. Having both at the same time
> does not really make sense.
> 
> There is a mapping from integer based pins to name based pins; check out
> gpiod_add_lookup_table(). Essentially platform initialization code
> (in your case probably the code which instantiates the tca6424) would
> set up a pin lookup table, and then you would request pins using
> a name instead of a number. That would also solve the "is the pin
> valid" problem in patch 3/3 since you would have a string to identify
> the gpio pin.

Unless I'm missing something, it seems like it won't work in my case. Here's my
setup. I have 2 TCA6424 I2C I/O expanders, exposing 24 GPIOs each. They are
registered like this:

static struct i2c_board_info i2c_devices[] = {
{
I2C_BOARD_INFO("tca6424", 0x22),
.platform_data = &tca6424_1_pdata, // base = 100
}, {
I2C_BOARD_INFO("tca6424", 0x23),
.platform_data = &tca6424_2_pdata, // base = 200
}
};

Then the pca953x driver adds two gpio chips, both labeled with the device name,
i.e. "tca6424".

I have to pass pins 219 to 222 to the max63xx_platform_data. I can declare a
GPIO lookup table like this:

static struct gpiod_lookup_table lookup_table = {
.dev_id = "max6373_wdt",
.table = {
GPIOD_LOOKUP("tca6424", 19, "MAX6373 WDI", GPIO_ACTIVE_HIGH),
GPIOD_LOOKUP_IDX("tca6424", 20, "MAX6373 SET", 0, GPIO_ACTIVE_HIGH),
GPIOD_LOOKUP_IDX("tca6424", 21, "MAX6373 SET", 1, GPIO_ACTIVE_HIGH),
GPIOD_LOOKUP_IDX("tca6424", 22, "MAX6373 SET", 2, GPIO_ACTIVE_HIGH),
}
};

but from what I've seen, the gpio_chip lookup by name will always return the
first TCA6424 instance.

To me, it looks like the gpiod API doesn't support several GPIO chips with the
same name. Either this must be fixed, or I should find a way to give the 2 I/O
expanders different names (e.g. "tca6424.0" and "tca6424.1").

As struct gpiod_lookup are meant for platform code, would that be bad if they 
ignore the chip_label and care about a global GPIO number (i.e. base + hwnum)?

Do you have an idea for this setup?

Thanks,
-v
--
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] x86_64: kasan: add message about kasan being initialized

2015-06-29 Thread Ingo Molnar

* Andrey Ryabinin  wrote:

> On 06/20/2015 04:18 PM, Ingo Molnar wrote:
> > 
> > Please call it 'kasan' or 'KASAN', and also explain it in the message and 
> > prefix 
> > it properly with the subsystem name (kasan), so something like:
> > 
> > pr_info("kasan: Kernel Address SANitizer (KASAN) initialized\n");
> > 
> > Other kasan messages should also carry a 'kasan: ' prefix, so that it's 
> > unambiguous what generated the message, and also to make it easier to grep 
> > out of 
> > logs.
> > 
> 
> This patch adds "kasan: " prefix for all messages from this file ( +#define 
> pr_fmt(fmt) "kasan: " fmt )
> 
> I'm agree with Dmitry, I would choose kasan name too.
> In this case, adding explanation in the message will produce too much kasans 
> in one short message:
> 
>   kasan: Kernel address sanitizer (kasan) initialized
> 
> Perhaps it would be better to keep this patch as is. Ok?

So if there's a latest series of fixes to apply, please send 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/


[RFC 0/2] drm/dsi: DSI for devices with different control bus

2015-06-29 Thread Archit Taneja
We are currently restricted when it comes to supporting DSI on devices
that have a non-DSI control bus. For example, DSI encoder chips are
available in the market that are configured via i2c. Configuring their
registers via DSI bus is either optional or not available at all.

These devices still need to pass DSI parameters (data lanes, mode flags
etc) to the DSI host they are connected to. We don't have a way to do
that at the moment.

The method presented in these patches is to provide an API to create a
'dummy' mipi_dsi_device. This device is populated with the desired DSI
params, which are passed on to the host via mipi_dsi_attach().

This method will require the device driver to get a phandle to the DSI
host since there is no parent-child relation between the two.

Is there a better way to do this? Please let me know!

Archit Taneja (2):
  drm/dsi: Create dummy DSI devices
  drm/dsi: Get DSI host by DT device node

 drivers/gpu/drm/drm_mipi_dsi.c | 108 -
 include/drm/drm_mipi_dsi.h |   4 ++
 2 files changed, 110 insertions(+), 2 deletions(-)

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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


[RFC 1/2] drm/dsi: Create dummy DSI devices

2015-06-29 Thread Archit Taneja
We can have devices where the data bus is MIPI DSI, but the control bus
is something else (i2c, spi etc). A typical example is i2c controlled
encoder bridge chips.

Such devices too require passing DSI specific parameters (number of data
lanes, DSI mode flags, color format etc) to their DSI host. For a device
that isn't 'mipi_dsi_device', there is no way of passing such parameters.

Provide the option of creating a dummy DSI device. The main purpose of
this would be to attach to a DSI host by calling mipi_dsi_attach, and
pass DSI params.

Create mipi_dsi_new_dummy for creating a dummy dsi device. The driver
calling this needs to be aware of the mipi_dsi_host it wants to attach
to, and also the DSI virtual channel the DSI device intends to use.

Signed-off-by: Archit Taneja 
---
 drivers/gpu/drm/drm_mipi_dsi.c | 78 --
 include/drm/drm_mipi_dsi.h |  2 ++
 2 files changed, 78 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 2d5ca8ee..9bfe215 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -47,7 +47,14 @@
 
 static int mipi_dsi_device_match(struct device *dev, struct device_driver *drv)
 {
-   return of_driver_match_device(dev, drv);
+   if (of_driver_match_device(dev, drv))
+   return 1;
+
+   if (!strcmp(drv->name, "mipi_dsi_dummy") &&
+   strstr(dev_name(dev), "dummy_dev"))
+   return 1;
+
+   return 0;
 }
 
 static const struct dev_pm_ops mipi_dsi_device_pm_ops = {
@@ -171,6 +178,67 @@ of_mipi_dsi_device_add(struct mipi_dsi_host *host, struct 
device_node *node)
return dsi;
 }
 
+static int dummy_probe(struct mipi_dsi_device *dsi)
+{
+   return 0;
+}
+
+static int dummy_remove(struct mipi_dsi_device *dsi)
+{
+   return 0;
+}
+
+static void dummy_shutdown(struct mipi_dsi_device *dsi)
+{
+}
+
+static struct mipi_dsi_driver dummy_dsi_driver = {
+   .probe = dummy_probe,
+   .remove = dummy_remove,
+   .shutdown = dummy_shutdown,
+   .driver.name = "mipi_dsi_dummy",
+};
+
+static int mipi_dsi_device_add_dummy(struct mipi_dsi_device *dsi)
+{
+   struct mipi_dsi_host *host = dsi->host;
+
+   dev_set_name(&dsi->dev, "%s.dummy_dev.%d", dev_name(host->dev),
+   dsi->channel);
+
+   return device_add(&dsi->dev);
+}
+
+struct mipi_dsi_device *mipi_dsi_new_dummy(struct mipi_dsi_host *host, u32 reg)
+{
+   struct mipi_dsi_device *dsi;
+   struct device *dev = host->dev;
+   int ret;
+
+   if (reg > 3) {
+   dev_err(dev, "invalid reg property %u\n", reg);
+   return ERR_PTR(-EINVAL);
+   }
+
+   dsi = mipi_dsi_device_alloc(host);
+   if (IS_ERR(dsi)) {
+   dev_err(dev, "failed to allocate dummy DSI device %ld\n",
+   PTR_ERR(dsi));
+   return dsi;
+   }
+
+   dsi->channel = reg;
+
+   ret = mipi_dsi_device_add_dummy(dsi);
+   if (ret) {
+   dev_err(dev, "failed to add dummy DSI device %d\n", ret);
+   kfree(dsi);
+   return ERR_PTR(ret);
+   }
+
+   return dsi;
+}
+
 int mipi_dsi_host_register(struct mipi_dsi_host *host)
 {
struct device_node *node;
@@ -924,7 +992,13 @@ EXPORT_SYMBOL(mipi_dsi_driver_unregister);
 
 static int __init mipi_dsi_bus_init(void)
 {
-   return bus_register(&mipi_dsi_bus_type);
+   int ret;
+
+   ret = bus_register(&mipi_dsi_bus_type);
+   if (ret < 0)
+   return ret;
+
+   return mipi_dsi_driver_register(&dummy_dsi_driver);
 }
 postcore_initcall(mipi_dsi_bus_init);
 
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index f1d8d0d..d06ba99 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -174,6 +174,8 @@ ssize_t mipi_dsi_generic_write(struct mipi_dsi_device *dsi, 
const void *payload,
 ssize_t mipi_dsi_generic_read(struct mipi_dsi_device *dsi, const void *params,
  size_t num_params, void *data, size_t size);
 
+struct mipi_dsi_device *mipi_dsi_new_dummy(struct mipi_dsi_host *host, u32 
reg);
+
 /**
  * enum mipi_dsi_dcs_tear_mode - Tearing Effect Output Line mode
  * @MIPI_DSI_DCS_TEAR_MODE_VBLANK: the TE output line consists of V-Blanking
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

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


[RFC 2/2] drm/dsi: Get DSI host by DT device node

2015-06-29 Thread Archit Taneja
mipi_dsi_devices are inherently aware of their host because they
share a parent-child hierarchy in the device tree.

Non-dsi drivers that create a dummy dsi device don't have this data.
In order to get this information, they require to a phandle to the dsi
host in the device tree.

Maintain a list of all the hosts DSI that are currently registered.

This list will be used to find the mipi_dsi_host corresponding to the
device_node passed in of_find_mipi_dsi_host_by_node.

Signed-off-by: Archit Taneja 
---
 drivers/gpu/drm/drm_mipi_dsi.c | 30 ++
 include/drm/drm_mipi_dsi.h |  2 ++
 2 files changed, 32 insertions(+)

diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index 9bfe215..81ddb73 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -239,6 +239,28 @@ struct mipi_dsi_device *mipi_dsi_new_dummy(struct 
mipi_dsi_host *host, u32 reg)
return dsi;
 }
 
+static DEFINE_MUTEX(host_lock);
+static LIST_HEAD(host_list);
+
+struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node)
+{
+   struct mipi_dsi_host *host;
+
+   mutex_lock(&host_lock);
+
+   list_for_each_entry(host, &host_list, list) {
+   if (host->dev->of_node == node) {
+   mutex_unlock(&host_lock);
+   return host;
+   }
+   }
+
+   mutex_unlock(&host_lock);
+
+   return NULL;
+}
+EXPORT_SYMBOL(of_find_mipi_dsi_host_by_node);
+
 int mipi_dsi_host_register(struct mipi_dsi_host *host)
 {
struct device_node *node;
@@ -250,6 +272,10 @@ int mipi_dsi_host_register(struct mipi_dsi_host *host)
of_mipi_dsi_device_add(host, node);
}
 
+   mutex_lock(&host_lock);
+   list_add_tail(&host->list, &host_list);
+   mutex_unlock(&host_lock);
+
return 0;
 }
 EXPORT_SYMBOL(mipi_dsi_host_register);
@@ -266,6 +292,10 @@ static int mipi_dsi_remove_device_fn(struct device *dev, 
void *priv)
 void mipi_dsi_host_unregister(struct mipi_dsi_host *host)
 {
device_for_each_child(host->dev, NULL, mipi_dsi_remove_device_fn);
+
+   mutex_lock(&host_lock);
+   list_del_init(&host->list);
+   mutex_unlock(&host_lock);
 }
 EXPORT_SYMBOL(mipi_dsi_host_unregister);
 
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index d06ba99..1684a0e 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -100,10 +100,12 @@ struct mipi_dsi_host_ops {
 struct mipi_dsi_host {
struct device *dev;
const struct mipi_dsi_host_ops *ops;
+   struct list_head list;
 };
 
 int mipi_dsi_host_register(struct mipi_dsi_host *host);
 void mipi_dsi_host_unregister(struct mipi_dsi_host *host);
+struct mipi_dsi_host *of_find_mipi_dsi_host_by_node(struct device_node *node);
 
 /* DSI mode flags */
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

--
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/


[tip:x86/urgent] x86/fpu: Fix FPU related boot regression when CPUID masking BIOS feature is enabled

2015-06-29 Thread tip-bot for Ingo Molnar
Commit-ID:  db52ef74b35dcb91fd154fa52c618bdd1b90e28e
Gitweb: http://git.kernel.org/tip/db52ef74b35dcb91fd154fa52c618bdd1b90e28e
Author: Ingo Molnar 
AuthorDate: Sat, 27 Jun 2015 10:25:14 +0200
Committer:  Ingo Molnar 
CommitDate: Tue, 30 Jun 2015 07:22:10 +0200

x86/fpu: Fix FPU related boot regression when CPUID masking BIOS feature is 
enabled

Mike Galbraith reported:

  " My i7-4790 box is having one hell of a time with this merge
window, dead in the water.

BIOS setting "Limit CPUID Maximum" upsets new fpu code
mightily. "

It turns out that Linux does a double workaround here, as per:

  066941bd4eeb ("x86: unmask CPUID levels on Intel CPUs")

it undoes the BIOS workaround - but as a side effect the CPUID
state is not completely constant during early init anymore,
and the new FPU init code did not take this into account.

So what happened is that the xstate init code did not have full
CPUID available, which broke subsequent attempts to use xstate
features.

Fix this by ordering the early FPU init code to after we've
stabilized the CPUID state.

Reported-bisected-and-tested-by: Mike Galbraith 
Cc: Andrew Morton 
Cc: Borislav Petkov 
Cc: H. Peter Anvin 
Cc: Linus Torvalds 
Cc: Mike Galbraith 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Link: http://lkml.kernel.org/r/20150627082514.ga10...@gmail.com
Signed-off-by: Ingo Molnar 
---
 arch/x86/kernel/cpu/common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
index 9fc5e3d..922c5e0 100644
--- a/arch/x86/kernel/cpu/common.c
+++ b/arch/x86/kernel/cpu/common.c
@@ -742,7 +742,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
cpu_detect(c);
get_cpu_vendor(c);
get_cpu_cap(c);
-   fpu__init_system(c);
 
if (this_cpu->c_early_init)
this_cpu->c_early_init(c);
@@ -754,6 +753,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
this_cpu->c_bsp_init(c);
 
setup_force_cpu_cap(X86_FEATURE_ALWAYS);
+   fpu__init_system(c);
 }
 
 void __init early_cpu_init(void)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH-V5 4/4] mfd: devicetree: bindings: Add new 88pm800 mfd binding

2015-06-29 Thread Vaibhav Hiremath



On Tuesday 30 June 2015 06:01 AM, Krzysztof Kozlowski wrote:

2015-06-30 0:31 GMT+09:00 Vaibhav Hiremath :

With addition of DT support to 88pm800 mfd driver, this patch
adds new DT binding documentation along with respective properties.

Signed-off-by: Vaibhav Hiremath 


(once again, too early hit return)

Looks okay. Just a hint - put the binding at beginning of the patchset.



OK, next time onwards will take care of it.


Reviewed-by: Krzysztof Kozlowski 



Thanks for your review.


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/


[PATCH v2] kexec: Make a pair of map and unmap reserved pages when kdump fails to start

2015-06-29 Thread Minfei Huang
For some arch, kexec shall map the reserved pages, then use them, when
we try to start the kdump service.

Now kexec will never unmap the reserved pages, once it fails to continue
starting the kdump service.

Make a pair of reserved pages in kdump starting path, whatever kexec
fails or not.

Signed-off-by: Minfei Huang 
---
 kernel/kexec.c | 26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/kernel/kexec.c b/kernel/kexec.c
index 4589899..68f6dfb 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1291,35 +1291,37 @@ SYSCALL_DEFINE4(kexec_load, unsigned long, entry, 
unsigned long, nr_segments,
 */
 
kimage_free(xchg(&kexec_crash_image, NULL));
-   result = kimage_alloc_init(&image, entry, nr_segments,
-  segments, flags);
-   crash_map_reserved_pages();
-   } else {
-   /* Loading another kernel to reboot into. */
-
-   result = kimage_alloc_init(&image, entry, nr_segments,
-  segments, flags);
}
+
+   result = kimage_alloc_init(&image, entry, nr_segments,
+   segments, flags);
if (result)
goto out;
 
+   if (flags & KEXEC_ON_CRASH)
+   crash_map_reserved_pages();
+
if (flags & KEXEC_PRESERVE_CONTEXT)
image->preserve_context = 1;
result = machine_kexec_prepare(image);
if (result)
-   goto out;
+   goto failure;
 
for (i = 0; i < nr_segments; i++) {
result = kimage_load_segment(image, &image->segment[i]);
if (result)
-   goto out;
+   goto failure;
}
kimage_terminate(image);
+
+failure:
if (flags & KEXEC_ON_CRASH)
crash_unmap_reserved_pages();
}
-   /* Install the new kernel, and  Uninstall the old */
-   image = xchg(dest_image, image);
+
+   if (result == 0)
+   /* Install the new kernel, and  Uninstall the old */
+   image = xchg(dest_image, image);
 
 out:
mutex_unlock(&kexec_mutex);
-- 
2.2.2

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


[PATCH V1] regulator: da9211: support da9215

2015-06-29 Thread James Ban
This is a patch for supporting da9215 buck converter.

Signed-off-by: James Ban 
---

This patch is relative to linux-next repository tag next-20150625.


 .../devicetree/bindings/regulator/da9211.txt   |   32 +++-
 drivers/regulator/Kconfig  |6 +--
 drivers/regulator/da9211-regulator.c   |   40 ++--
 drivers/regulator/da9211-regulator.h   |   18 -
 include/linux/regulator/da9211.h   |   19 +-
 5 files changed, 81 insertions(+), 34 deletions(-)

diff --git a/Documentation/devicetree/bindings/regulator/da9211.txt 
b/Documentation/devicetree/bindings/regulator/da9211.txt
index eb61890..c620493 100644
--- a/Documentation/devicetree/bindings/regulator/da9211.txt
+++ b/Documentation/devicetree/bindings/regulator/da9211.txt
@@ -1,7 +1,7 @@
-* Dialog Semiconductor DA9211/DA9213 Voltage Regulator
+* Dialog Semiconductor DA9211/DA9213/DA9215 Voltage Regulator
 
 Required properties:
-- compatible: "dlg,da9211" or "dlg,da9213".
+- compatible: "dlg,da9211" or "dlg,da9213" or "dlg,da9215"
 - reg: I2C slave address, usually 0x68.
 - interrupts: the interrupt outputs of the controller
 - regulators: A node that houses a sub-node for each regulator within the
@@ -66,3 +66,31 @@ Example 2) DA9213
};
};
};
+
+
+Example 3) DA9215
+   pmic: da9215@68 {
+   compatible = "dlg,da9215";
+   reg = <0x68>;
+   interrupts = <3 27>;
+
+   regulators {
+   BUCKA {
+   regulator-name = "VBUCKA";
+   regulator-min-microvolt = < 30>;
+   regulator-max-microvolt = <157>;
+   regulator-min-microamp  = <400>;
+   regulator-max-microamp  = <700>;
+   enable-gpios = <&gpio 27 0>;
+   };
+   BUCKB {
+   regulator-name = "VBUCKB";
+   regulator-min-microvolt = < 30>;
+   regulator-max-microvolt = <157>;
+   regulator-min-microamp  = <400>;
+   regulator-max-microamp  = <700>;
+   enable-gpios = <&gpio 17 0>;
+   };
+   };
+   };
+
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index bef3bde..23496da 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -209,13 +209,13 @@ config REGULATOR_DA9210
  interface.
 
 config REGULATOR_DA9211
-   tristate "Dialog Semiconductor DA9211/DA9212/DA9213/DA9214 regulator"
+   tristate "Dialog Semiconductor DA9211/DA9212/DA9213/DA9214/DA9215 
regulator"
depends on I2C
select REGMAP_I2C
help
  Say y here to support for the Dialog Semiconductor DA9211/DA9212
- /DA9213/DA9214.
- The DA9211/DA9212/DA9213/DA9214 is a multi-phase synchronous
+ /DA9213/DA9214/DA9215.
+ The DA9211/DA9212/DA9213/DA9214/DA9215 is a multi-phase synchronous
  step down converter 12A or 16A DC-DC Buck controlled through an I2C
  interface.
 
diff --git a/drivers/regulator/da9211-regulator.c 
b/drivers/regulator/da9211-regulator.c
index df79e4b..0858100 100644
--- a/drivers/regulator/da9211-regulator.c
+++ b/drivers/regulator/da9211-regulator.c
@@ -1,6 +1,6 @@
 /*
- * da9211-regulator.c - Regulator device driver for DA9211/DA9213
- * Copyright (C) 2014  Dialog Semiconductor Ltd.
+ * da9211-regulator.c - Regulator device driver for DA9211/DA9213/DA9215
+ * Copyright (C) 2015  Dialog Semiconductor Ltd.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -32,6 +32,7 @@
 /* DEVICE IDs */
 #define DA9211_DEVICE_ID   0x22
 #define DA9213_DEVICE_ID   0x23
+#define DA9215_DEVICE_ID   0x24
 
 #define DA9211_BUCK_MODE_SLEEP 1
 #define DA9211_BUCK_MODE_SYNC  2
@@ -90,6 +91,13 @@ static const int da9213_current_limits[] = {
300, 320, 340, 360, 380, 400, 420, 440,
460, 480, 500, 520, 540, 560, 580, 600
 };
+/* Current limits for DA9215 buck (uA) indices
+ * corresponds with register values
+ */
+static const int da9215_current_limits[] = {
+   400, 420, 440, 460, 480, 500, 520, 540,
+   560, 580, 600, 620, 640, 660, 680, 700
+};
 
 static unsigned int da9211_buck_get_mode(struct regulator_dev *rdev)
 {
@@ -157,6 +165,10 @@ static int da9211_set_current_limit(struct regulator_dev 
*rdev, int min,
current_limits = da9213_current_limits;
max_size = ARRAY_SIZE(da9213_current_limits

linux-next: Tree for Jun 30

2015-06-29 Thread Stephen Rothwell
Hi all,

Changes since 20150629:

I added a supplied patch to the akpm tree to fix a build problem.

Non-merge commits (relative to Linus' tree): 1766
 1583 files changed, 96150 insertions(+), 24683 deletions(-)



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

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

Below is a summary of the state of the merge.

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

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

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

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

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

$ git checkout master
$ git reset --hard stable
Merging origin/master (6aaf0da8728c Merge tag 'md/4.2' of 
git://neil.brown.name/md)
Merging fixes/master (e0dd880a545c Merge branch 'for-4.2' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq)
Merging kbuild-current/rc-fixes (c517d838eb7d Linux 4.0-rc1)
Merging arc-current/for-curr (e4140819dadc ARC: signal handling robustify)
Merging arm-current/fixes (0bbe6b5a73c0 ARM: 8388/1: tcm: Don't crash when TCM 
banks are protected by TrustZone)
Merging m68k-current/for-linus (1214c525484c m68k: Use for_each_sg())
Merging metag-fixes/fixes (0164a711c97b metag: Fix ioremap_wc/ioremap_cached 
build errors)
Merging mips-fixes/mips-fixes (1795cd9b3a91 Linux 3.16-rc5)
Merging powerpc-merge-mpe/fixes (b953c0d234bc Linux 4.1)
Merging powerpc-merge/merge (c517d838eb7d Linux 4.0-rc1)
Merging sparc/master (4a10a91756ef Merge branch 'upstream' of 
git://git.infradead.org/users/pcmoore/audit)
Merging net/master (1625fecf56e0 net: icplus: fix typo in constant name)
Merging ipsec/master (31a418986a58 xen: netback: read hotplug script once at 
start of day.)
Merging sound-current/for-linus (0755e74b8f04 ALSA: Fix uninintialized error 
return)
Merging pci-current/for-linus (552bc94ebeeb PCI: Preserve resource size during 
alignment reordering)
Merging wireless-drivers/master (38fe44e61a89 Merge tag 
'iwlwifi-for-kalle-2015-05-28' of 
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-fixes)
Merging driver-core.current/driver-core-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging tty.current/tty-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging usb.current/usb-linus (d4a4f75cd8f2 Linux 4.1-rc7)
Merging usb-gadget-fixes/fixes (c94e289f195e usb: gadget: remove incorrect 
__init/__exit annotations)
Merging usb-serial-fixes/usb-linus (0f57d86787d8 Linux 4.1-rc8)
Merging staging.current/staging-linus (2a298679b411 Merge tag 'usb-4.2-rc1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb)
Merging char-misc.current/char-misc-linus (2a298679b411 Merge tag 'usb-4.2-rc1' 
of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb)
Merging input-current/for-linus (f7ebc4dcdeb1 Merge branch 'next' into 
for-linus)
Merging crypto-current/master (0fbafd06bdde crypto: aesni - fix failing setkey 
for rfc4106-gcm-aesni)
Merging ide/master (d681f1166919 ide: remove deprecated use of pci api)
Merging devicetree-current/devicetree/merge (f76502aa9140 of/dynamic: Fix test 
for PPC_PSERIES)
Merging rr-fixes/fixes (f36963c9d3f6 cpumask_set_cpu_local_first => 
cpumask_local_spread, lament)
Merging vfio-fixes/for-linus (db7d4d7f4021 vfio: Fix runaway interruptible 
timeout)
Merging kselftest-fixes/fixes (ba155e2d21f6 Linux 4.1-rc5)
Merging backlight-fixes/for-backlight-fixes (68feaca0b13e backlight: pwm: 
Handle EPROBE_DEFER while requesting the PWM)
Merging drm-intel-fixes/for-linux-next-fixes (b953c0d234bc Linux 4.1)
Merging asm-generic/master (643165c8bbc8 Merge tag 'uaccess_for_upstream' of 
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost into asm-generic

[PATCH] rts5208:Fix checkpatch warnings

2015-06-29 Thread Ravi Teja Darbha
Else condition after if statement is not necessary, hence removed.

Signed-off-by: Ravi Teja Darbha 
---
 drivers/staging/rts5208/xd.c | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c
index 10fea7b..42d8d82 100644
--- a/drivers/staging/rts5208/xd.c
+++ b/drivers/staging/rts5208/xd.c
@@ -1689,10 +1689,9 @@ static int xd_read_multiple_pages(struct rtsx_chip 
*chip, u32 phy_blk,
xd_set_err_code(chip, XD_TO_ERROR);
rtsx_trace(chip);
return STATUS_FAIL;
-   } else {
-   rtsx_trace(chip);
-   goto Fail;
}
+   rtsx_trace(chip);
+   goto Fail;
}
 
return STATUS_SUCCESS;
@@ -1905,10 +1904,9 @@ static int xd_write_multiple_pages(struct rtsx_chip 
*chip, u32 old_blk,
xd_set_err_code(chip, XD_TO_ERROR);
rtsx_trace(chip);
return STATUS_FAIL;
-   } else {
-   rtsx_trace(chip);
-   goto Fail;
}
+   rtsx_trace(chip);
+   goto Fail;
}
 
if (end_page == (xd_card->page_off + 1)) {
-- 
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] rtl8712:Fix checkpatch warning

2015-06-29 Thread Larry Finger

On 06/29/2015 11:29 PM, Sudip Mukherjee wrote:

On Tue, Jun 30, 2015 at 01:27:47AM +0530, Ravi Teja Darbha wrote:


1. Fix line over 80 characters warning.
2. The checkpatch warning at line 499 seems to be false positive.
WARNING: else is not generally useful after a break or return
#499: FILE: rtl8712_recv.c:499:
+return false;
+else

while(condition1) {
 if(condition2)
 foo();
 else if(condition3)
 return false;
 else
 break;
}

The else condition here cannot be eliminated

You can try something like this to eliminate the else:

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c 
b/drivers/staging/rtl8712/rtl8712_recv.c
index fcb8c61..165161b 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -492,12 +492,13 @@ static int enqueue_reorder_recvframe(struct 
recv_reorder_ctrl *preorder_ctrl,
while (end_of_queue_search(phead, plist) == false) {
pnextrframe = LIST_CONTAINOR(plist, union recv_frame, u);
pnextattrib = &pnextrframe->u.hdr.attrib;
-   if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num))
+   if (SN_LESS(pnextattrib->seq_num, pattrib->seq_num)) {
plist = plist->next;
+   continue;
+   }
else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num))
return false;
-   else
-   break;
+   break;
}
list_del_init(&(prframe->u.hdr.list));
list_add_tail(&(prframe->u.hdr.list), plist);


NACK on this idea. Checkpatch is not the complete arbiter of style. Just leave 
the code alone.


Larry


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


Re: [PATCH v2 2/2] schedstat: Expose /proc/pid/schedstat if CONFIG_SCHED_INFO is set

2015-06-29 Thread Srikar Dronamraju
* Naveen N. Rao  [2015-06-25 23:53:38]:

>  /*
>   * Provides /proc/PID/schedstat
>   */
>  static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns,
> struct pid *pid, struct task_struct *task)
>  {
> - seq_printf(m, "%llu %llu %lu\n",
> + if (unlikely(!sched_info_on()))
> + seq_printf(m, "0 0 0\n");
> + else
> + seq_printf(m, "%llu %lld %ld\n",

Should the above be seq_printf(m, "%llu %llu %lu\n", ?

>  (unsigned long long)task->se.sum_exec_runtime,
>  (unsigned long long)task->sched_info.run_delay,
>  task->sched_info.pcount);
> -- 
> 2.4.0
> 

-- 
Thanks and Regards
Srikar Dronamraju

--
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] watchdog: omap_wdt: early_enable module parameter

2015-06-29 Thread Paul Gortmaker
On Thu, Jun 25, 2015 at 9:46 AM, Guenter Roeck  wrote:
> On 06/25/2015 03:21 AM, poesc...@lemonage.de wrote:
>>
>> From: Lars Poeschel 
>>
>> Add a early_enable module parameter to the omap_wdt that starts the
>> watchdog on module insertion. The default value is 0 which does not
>> start the watchdog - which also does not change the behavior if the
>> parameter is not given.
>>
>> Signed-off-by: Lars Poeschel 
>
>
> Reviewed-by: Guenter Roeck 

In case the info hasn't looped back around yet, this breaks the
omap builds in linux-next:

drivers/watchdog/omap_wdt.c:288:18: error: 'omap_wdt' undeclared
(first use in this function)

(Not sure how this could have ever worked as-is.)

http://kisskb.ellerman.id.au/kisskb/buildresult/12452335/

I see a patch has already been posted to arm-kernel but not
Cc'd to all originally involved so figured I'd mention it.

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/
--
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: vfio: powerpc/spapr: One function call less in tce_iommu_attach_group() after kzalloc() failure

2015-06-29 Thread SF Markus Elfring
>>> than the existing one should have been renamed to "free_exit" or 
>>> "free_unlock_exit"
>>> and new one would be "unlock_exit".
>>
>> I chose a smaller change at this place.
> 
> I'd just drop this patch.

How do you think about to improve the affected jump labels
a bit more there?

Regards,
Markus
--
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] mfd: Remove MFD_CROS_EC depends on X86 || ARM

2015-06-29 Thread Paul Gortmaker
[Re: [PATCH 2/3] mfd: Remove MFD_CROS_EC depends on X86 || ARM] On 25/06/2015 
(Thu 10:44) Javier Martinez Canillas wrote:

> Hello Lee,
> 
> On 06/25/2015 10:38 AM, Lee Jones wrote:
> > On Thu, 25 Jun 2015, Javier Martinez Canillas wrote:
> > 
> >> A dependency on X86 || ARM for MFD_CROS_EC was added to fix the warning:
> >> 
> >> (MFD_CROS_EC) selects CHROME_PLATFORMS which has unmet direct dependencies 
> >> (X86 || ARM)
> >> 
> >> This happened because CHROME_PLATFORMS had a dependency on X86 || ARM but
> >> that dependency was removed since there isn't a reason why the option can
> >> not be selected on other architectures. So now the above warning will not
> >> happen and the MFD_CROS_EC dependency can be removed since is not needed.
> >> 
> >> Signed-off-by: Javier Martinez Canillas 
> >> ---
> >> 
> >>  drivers/mfd/Kconfig | 1 -
> >>  1 file changed, 1 deletion(-)
> > 
> > Applied for v4.3, thanks.
> > 
> 
> Thanks a lot.
> 
> Olof,
> 
> Could you please ack patch 1/3 so Lee can pick it through the mfd tree?
> Since both patches 1/3 and 2/3 are needed to fix the build warning for
> !X86 and !ARM architectures.

Checking this didn't fall through the cracks ; still seeing the issue
in xtensa (and other arch) builds of linux-next currently:

http://kisskb.ellerman.id.au/kisskb/buildresult/12452368/

Paul.
--

> 
> Best regards,
> Javier
--
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] rts5208:Fix checkpatch warnings

2015-06-29 Thread Sudip Mukherjee
On Tue, Jun 30, 2015 at 11:25:24AM +0530, Ravi Teja Darbha wrote:
> Else condition after if statement is not necessary, hence removed.
else is not necessary after if??? then what it is supposed to be used? :)

I think your commit message should have been:
"else is not necessary after return statement."

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


[PATCH] backlight: lp855x: use private data for regulator control

2015-06-29 Thread Milo Kim
LP855x backlight device can be enabled by external VDD input.
The 'supply' data is used for this purpose.
It's kind of private data which runs internally, so there is no reason to
expose to the platform data.

And LP855x DT property, 'power-supply' is unnecessary.
If a regulator is registered correctly, then lp855x driver can get
regulator resource by using devm_regulator_get().
So devm_regulator_get() is moved from _parse_dt() to _probe().
Ex) The following device tree works without 'power-supply' property.

i2c0: i2c@10002000 {
(snip)

backlight@2c {
compatible = "ti,lp8556";
reg = <0x2c>;

bl-name = "lcd-bl";
dev-ctrl = /bits/ 8 <0x85>;
init-brt = /bits/ 8 <0x10>;
};
};

/* 'power' regulator for LP8556 VDD */
bl_vdd: fixed-regulator@1 {
compatible = "regulator-fixed";
regulator-name = "power";
regulator-min-microvolt = <330>;
regulator-max-microvolt = <330>;

(snip)
};

Cc: Sean Paul 
Cc: Jingoo Han 
Cc: Lee Jones 
Cc: devicet...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Milo Kim 
---
 .../devicetree/bindings/video/backlight/lp855x.txt   |  2 --
 drivers/video/backlight/lp855x_bl.c  | 20 +---
 include/linux/platform_data/lp855x.h |  2 --
 3 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/Documentation/devicetree/bindings/video/backlight/lp855x.txt 
b/Documentation/devicetree/bindings/video/backlight/lp855x.txt
index 0a3ecbc..96e83a5 100644
--- a/Documentation/devicetree/bindings/video/backlight/lp855x.txt
+++ b/Documentation/devicetree/bindings/video/backlight/lp855x.txt
@@ -12,7 +12,6 @@ Optional properties:
   - pwm-period: PWM period value. Set only PWM input mode used (u32)
   - rom-addr: Register address of ROM area to be updated (u8)
   - rom-val: Register value to be updated (u8)
-  - power-supply: Regulator which controls the 3V rail
 
 Example:
 
@@ -57,7 +56,6 @@ Example:
backlight@2c {
compatible = "ti,lp8557";
reg = <0x2c>;
-   power-supply = <&backlight_vdd>;
 
dev-ctrl = /bits/ 8 <0x41>;
init-brt = /bits/ 8 <0x0a>;
diff --git a/drivers/video/backlight/lp855x_bl.c 
b/drivers/video/backlight/lp855x_bl.c
index a26d3bb..277d5ca 100644
--- a/drivers/video/backlight/lp855x_bl.c
+++ b/drivers/video/backlight/lp855x_bl.c
@@ -73,6 +73,7 @@ struct lp855x {
struct device *dev;
struct lp855x_platform_data *pdata;
struct pwm_device *pwm;
+   struct regulator *supply;   /* regulator for VDD input */
 };
 
 static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data)
@@ -384,13 +385,6 @@ static int lp855x_parse_dt(struct lp855x *lp)
pdata->rom_data = &rom[0];
}
 
-   pdata->supply = devm_regulator_get(dev, "power");
-   if (IS_ERR(pdata->supply)) {
-   if (PTR_ERR(pdata->supply) == -EPROBE_DEFER)
-   return -EPROBE_DEFER;
-   pdata->supply = NULL;
-   }
-
lp->pdata = pdata;
 
return 0;
@@ -431,8 +425,12 @@ static int lp855x_probe(struct i2c_client *cl, const 
struct i2c_device_id *id)
else
lp->mode = REGISTER_BASED;
 
-   if (lp->pdata->supply) {
-   ret = regulator_enable(lp->pdata->supply);
+   lp->supply = devm_regulator_get(lp->dev, "power");
+   if (IS_ERR(lp->supply))
+   lp->supply = NULL;
+
+   if (lp->supply) {
+   ret = regulator_enable(lp->supply);
if (ret < 0) {
dev_err(&cl->dev, "failed to enable supply: %d\n", ret);
return ret;
@@ -470,8 +468,8 @@ static int lp855x_remove(struct i2c_client *cl)
 
lp->bl->props.brightness = 0;
backlight_update_status(lp->bl);
-   if (lp->pdata->supply)
-   regulator_disable(lp->pdata->supply);
+   if (lp->supply)
+   regulator_disable(lp->supply);
sysfs_remove_group(&lp->dev->kobj, &lp855x_attr_group);
 
return 0;
diff --git a/include/linux/platform_data/lp855x.h 
b/include/linux/platform_data/lp855x.h
index 9c7fd1e..1b2ba24 100644
--- a/include/linux/platform_data/lp855x.h
+++ b/include/linux/platform_data/lp855x.h
@@ -136,7 +136,6 @@ struct lp855x_rom_data {
Only valid when mode is PWM_BASED.
  * @size_program : total size of lp855x_rom_data
  * @rom_data : list of new eeprom/eprom registers
- * @supply : regulator that supplies 3V input
  */
 struct lp855x_platform_data {
const char *name;
@@ -145,7 +144,6 @@ struct lp855x_platform_data {
unsigned int period_ns;
int size_program;
struct lp855x_rom_data *rom_data;
-   st

Re: [PATCH v2 2/2] schedstat: Expose /proc/pid/schedstat if CONFIG_SCHED_INFO is set

2015-06-29 Thread Naveen N. Rao
On 2015/06/30 11:25AM, Srikar Dronamraju wrote:
> * Naveen N. Rao  [2015-06-25 23:53:38]:
> 
> >  /*
> >   * Provides /proc/PID/schedstat
> >   */
> >  static int proc_pid_schedstat(struct seq_file *m, struct pid_namespace *ns,
> >   struct pid *pid, struct task_struct *task)
> >  {
> > -   seq_printf(m, "%llu %llu %lu\n",
> > +   if (unlikely(!sched_info_on()))
> > +   seq_printf(m, "0 0 0\n");
> > +   else
> > +   seq_printf(m, "%llu %lld %ld\n",
> 
> Should the above be seq_printf(m, "%llu %llu %lu\n", ?

Yikes! Nice catch, thanks! This looks to be left over from my tests with 
returning -1. Fixed patch on the way...

Regards,
Naveen

--
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] gpio: generic: add get_direction support

2015-06-29 Thread Linus Walleij
On Fri, Jun 12, 2015 at 6:20 PM, Philipp Zabel  wrote:

> Allow to determine the current direction configuration by
> reading back from the direction register.
>
> Signed-off-by: Philipp Zabel 

Patch applied for the next kernel cycle (4.3).

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


Re: [PATCH] pinctrl: samsung: Remove old unused defines

2015-06-29 Thread Linus Walleij
On Mon, Jun 15, 2015 at 6:54 AM, Krzysztof Kozlowski
 wrote:

> Since 9a2c1c3b91aa ("pinctrl: samsung: Allow grouping multiple
> pinmux/pinconf nodes") the defines for GPIO group and function names are
> not used anywhere in the driver.
>
> Signed-off-by: Krzysztof Kozlowski 
> Inspired-by: Dan Carpenter 

Patch applied.

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


  1   2   3   4   5   6   7   8   >