Re: [ANNOUNCE] 3.18.7-rt1

2015-02-26 Thread Sebastian Andrzej Siewior
On 02/27/2015 07:40 AM, Daniel Wagner wrote:
> Hi Sebastian

Hi Daniel,

> On 02/26/2015 09:48 AM, Sebastian Andrzej Siewior wrote:
>> * Sebastian Andrzej Siewior | 2015-02-25 14:55:01 [+0100]:
>> +
>> +static int thermal_notify_work_init(void)
>> +{
>> +int err;
>> +
>> +err = swork_get();
>> +if (!err)
>> +return err;
> 
> It think this should be:
> 
>   if (err)
>   return err;

Makes sense.

> 
> cheers,
> daniel

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 1/1] proc: introduce /proc//lbr_stack

2015-02-26 Thread Peter Zijlstra
On Mon, Feb 23, 2015 at 09:44:48AM -0800, Andi Kleen wrote:
> On Mon, Feb 23, 2015 at 05:49:57PM +0100, Peter Zijlstra wrote:
> > On Mon, Feb 23, 2015 at 03:43:41AM +, kan.li...@intel.com wrote:
> > > From: Kan Liang 
> > > 
> > > Haswell has a new feature that utilizes the existing Last Branch Record
> > > facility to record call chains. It has been implemented in perf. The
> > > call chains information is saved during perf event context.
> > > 
> > > This patch exposes a /proc//lbr_stack file that shows the saved LBR
> > > call chain information.
> > 
> > But why? I mean, this thing is only useful if you have a concurrently
> > running perf record that selects the LBR-stack stuff.
> > 
> > And if you have that, you might as well look at its output instead. Why
> > add this unconditional proc file that doesn't function on its own?
> 
> perf record doesn't show where you're currently blocked.

Of course it does; look at perf inject -s.

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


Re: [PATCH v3] brcmfmac: avoid duplicated suspend/resume operation

2015-02-26 Thread Fu, Zhonghui

On 2015/2/16 17:35, Arend van Spriel wrote:
> On 02/16/15 08:34, Fu, Zhonghui wrote:
>>
>> On 2015/2/15 22:54, Kalle Valo wrote:
>>> Arend van Spriel  writes:
>>>
 On 02/15/15 04:27, Pat Erley wrote:
> On 02/14/2015 08:40 PM, Fu, Zhonghui wrote:
>> Any comments to this patch? Can it be accepted?
 I assume that patches are queued up until after the merge window that
 we are currently in.
>>> That's right. In the future I will most likely apply patches also during
>>> the merge window, but as I'm still a greenhorn I'll be on the safe and
>>> wait for the merge window to end.
>> I am very glad to see this.
>> Could you please tell which release candidate this patch will be likely 
>> merged into now?
>
> For which tree are you asking this? When the merge window ends and linus' 
> tree has moved to 3.20-rc1, the wireless-drivers-next will move to that -rc1 
> as well and pending/accepted patches will be applied for the next kernel 
> release. If you are asking when they will be in linus' tree than the answer 
> is 3.21-rc1. Now if you say this patch solves a real problem for you 
> (providing usual proof like log with stack trace) you can request it to go on 
> the wireless-drivers tree to be fixed for 3.20.

I was in Chinese new-year vacation these few days. So sorry for late response.

Many thanks for your explanation first. 

Now that there is not 3.20 version. My understanding is that this patch will be 
in linus' tree 4.1-rc1, right?


Thanks,
Zhonghui

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

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


Re: [PATCH 0/3] lib/vsprintf: Doc improvements and clock support

2015-02-26 Thread Geert Uytterhoeven
Hi Stephen,

On Fri, Feb 27, 2015 at 1:02 AM, Stephen Boyd  wrote:
> On 02/26/15 03:13, Geert Uytterhoeven wrote:
>> From: Geert Uytterhoeven 
>> This patch series improves the documentation for printk() formats, and
>> adds support for printing clocks. The latter has always been a hassle if
>> you wanted to support both the common and legacy clock frameworks.
>
> Would the hassle go away if everyone moved to the common framework? I'm

Not anymore, now clk->name is gone ;-)

> mostly trying to understand the justification.

As a driver writer, once in a while I need to print out names and rates for
clocks and their parents from driver debug code.
As before this involved including clk_private.h and having #ifdefs to
support both
legacy and CCF, that debug code was alwas stripped from drivers before
submission, and never went upstream.

> Also, I wonder why we wouldn't want to add formats for all the other
> handle based frameworks that we have nowdays (gpio, regulator, pinctrl,
> etc.).

If someone feels the need to print those, support can be added.

Gr{oetje,eeting}s,

Geert

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

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] mm: change mm_advise_free to clear page dirty

2015-02-26 Thread Wang, Yalin
> -Original Message-
> From: Minchan Kim [mailto:minchan@gmail.com] On Behalf Of Minchan Kim
> Sent: Friday, February 27, 2015 2:44 PM
> To: Wang, Yalin
> Cc: Michal Hocko; Andrew Morton; linux-kernel@vger.kernel.org; linux-
> m...@kvack.org; Rik van Riel; Johannes Weiner; Mel Gorman; Shaohua Li
> Subject: Re: [RFC] mm: change mm_advise_free to clear page dirty
> 
> On Fri, Feb 27, 2015 at 01:48:48PM +0800, Wang, Yalin wrote:
> > > -Original Message-
> > > From: Minchan Kim [mailto:minchan@gmail.com] On Behalf Of Minchan
> Kim
> > > Sent: Friday, February 27, 2015 1:28 PM
> > > To: Wang, Yalin
> > > Cc: Michal Hocko; Andrew Morton; linux-kernel@vger.kernel.org; linux-
> > > m...@kvack.org; Rik van Riel; Johannes Weiner; Mel Gorman; Shaohua Li
> > > Subject: Re: [RFC] mm: change mm_advise_free to clear page dirty
> > >
> > > Hello,
> > >
> > > On Fri, Feb 27, 2015 at 11:37:18AM +0800, Wang, Yalin wrote:
> > > > This patch add ClearPageDirty() to clear AnonPage dirty flag,
> > > > the Anonpage mapcount must be 1, so that this page is only used by
> > > > the current process, not shared by other process like fork().
> > > > if not clear page dirty for this anon page, the page will never be
> > > > treated as freeable.
> > >
> > > In case of anonymous page, it has PG_dirty when VM adds it to
> > > swap cache and clear it in clear_page_dirty_for_io. That's why
> > > I added ClearPageDirty if we found it in swapcache.
> > > What case am I missing? It would be better to understand if you
> > > describe specific scenario.
> > >
> > > Thanks.
> > >
> > > >
> > > > Signed-off-by: Yalin Wang 
> > > > ---
> > > >  mm/madvise.c | 15 +--
> > > >  1 file changed, 5 insertions(+), 10 deletions(-)
> > > >
> > > > diff --git a/mm/madvise.c b/mm/madvise.c
> > > > index 6d0fcb8..257925a 100644
> > > > --- a/mm/madvise.c
> > > > +++ b/mm/madvise.c
> > > > @@ -297,22 +297,17 @@ static int madvise_free_pte_range(pmd_t *pmd,
> > > unsigned long addr,
> > > > continue;
> > > >
> > > > page = vm_normal_page(vma, addr, ptent);
> > > > -   if (!page)
> > > > +   if (!page || !PageAnon(page) || !trylock_page(page))
> > > > continue;
> > > >
> > > > if (PageSwapCache(page)) {
> > > > -   if (!trylock_page(page))
> > > > +   if (!try_to_free_swap(page))
> > > > continue;
> > > > -
> > > > -   if (!try_to_free_swap(page)) {
> > > > -   unlock_page(page);
> > > > -   continue;
> > > > -   }
> > > > -
> > > > -   ClearPageDirty(page);
> > > > -   unlock_page(page);
> > > > }
> > > >
> > > > +   if (page_mapcount(page) == 1)
> > > > +   ClearPageDirty(page);
> > > > +   unlock_page(page);
> > > > /*
> > > >  * Some of architecture(ex, PPC) don't update TLB
> > > >  * with set_pte_at and tlb_remove_tlb_entry so for
> > > > --
> > Yes, for page which is in SwapCache, it is correct,
> > But for anon page which is not in SwapCache, it is always
> > PageDirty(), so we should also clear dirty bit to make it freeable,
> 
> No. Every anon page starts from !PageDirty and it has PG_dirty
> only when it's addeded into swap cache. If vm_swap_full turns on,
> a page in swap cache could have PG_dirty via try_to_free_swap again.

mmm..
sometimes you can see an anon page PageDirty(), but it is not in swapcache,
for example, handle_pte_fault()-->do_swap_page()-->try_to_free_swap(),
at this time, the page is deleted from swapcache and is marked PageDirty(),


> So, Do you have concern about swapped-out pages when MADV_FREE is
> called? If so, please look at my patch.
> 
> https://lkml.org/lkml/2015/2/25/43
> 
> It will zap the swapped out page. So, this is not a issue any more?
> 
> >
> > Another problem  is that if an anon page is shared by more than one
> process,
> > This happened when fork(), the anon page will be copy on write,
> > In this case, we should not clear page dirty,
> > This is not correct for other process which don't call MADV_FREE syscall.
> 
> You mean we shouldn't inherit MADV_FREE attribute?
> Why?

Is it correct behavior if code like this:

Parent:
ptr1 = malloc(len);
memset(ptr1, 'a', len);
fork();
if (I am parent)
madvise_free(ptr1, len);

child:
sleep(10);
parse_data(ptr1, len);  // child may see zero, not 'a',
// is it the right behavior that the programer want?

Because child don't call madvise_free(), so it should see 'a', not zero page.
Isn't it ?
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  

Re: [PATCH v3] brcmfmac: avoid duplicated suspend/resume operation

2015-02-26 Thread Fu, Zhonghui

On 2015/2/16 17:50, David Laight wrote:
>>> WiFi chip has 2 SDIO functions, and PM core will trigger
>>> twice suspend/resume operations for one WiFi chip to do
>>> the same things. This patch avoid this case.
> Do you want to suspend on the first or last request?
>
> In general it might be that one function is in use and
> something wants to suspend the other (as inactive).
>
> If they suspend together you might need to pretend the
> first function is suspended but only do the real power-saving
> device suspend when all the functions have been suspended.
I was in Chinese new-year vacation these few days. So sorry for late response.

Suspend/Resume entry functions of brcmfmac driver does not differentiate 
between two functions, performs the same operations instead.


Thanks,
Zhonghui
>
>   David
>
> N�r��y���b�X��ǧv�^�)޺{.n�+{��*ޕ�,�{ay�ʇڙ�,j��f���h���z��w���
> ���j:+v���w�j�mzZ+�ݢj"��!tml=

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 0/2] HID: wacom: add support of Bamboo PAD

2015-02-26 Thread Jiri Kosina
On Wed, 25 Feb 2015, Benjamin Tissoires wrote:

> So here is the v2 of the patch set to support the Bamboo PAD.
> 
> It has been tested by Josep (thanks!) on the wired version and I
> developped it on the wireless version. I guess it should be good
> to go if the reviews goes well.
> 
> Cheers,
> Benjamin
> 
> Benjamin Tissoires (2):
>   HID: wacom: store the hid_device pointers of the sibling devices
>   HID: wacom: add full support of the Wacom Bamboo PAD

The series is now queued in for-4.1/wacom. Thanks,

-- 
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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/5] tty/serial: at91: correct check of buf used in DMA

2015-02-26 Thread Zhao, Leilei
Thanks

Best Regards
Zhao Leilei

-Original Message-
From: Jiri Slaby [mailto:jirisl...@gmail.com] On Behalf Of Jiri Slaby
Sent: Thursday, February 26, 2015 17:30
To: Zhao, Leilei; Ferre, Nicolas; gre...@linuxfoundation.org; 
linux-ser...@vger.kernel.org
Cc: linux-kernel@vger.kernel.org; linux-arm-ker...@lists.infradead.org
Subject: Re: [PATCH 1/5] tty/serial: at91: correct check of buf used in DMA

On 02/26/2015, 07:55 AM, Leilei Zhao wrote:
> We only use buf of ring In DMA rx function while using buf of xmit in 
> DMA tx function. So here we need definitively to check the buf of ring 
> which is corresponding to DMA rx function.
> 
> Signed-off-by: Leilei Zhao 
> Acked-by: Nicolas Ferre 
> ---
>  drivers/tty/serial/atmel_serial.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/atmel_serial.c 
> b/drivers/tty/serial/atmel_serial.c
> index 846552b..460903c 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -1027,7 +1027,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
>   spin_lock_init(_port->lock_rx);
>   sg_init_table(_port->sg_rx, 1);
>   /* UART circular rx buffer is an aligned page. */
> - BUG_ON((int)port->state->xmit.buf & ~PAGE_MASK);
> + BUG_ON((int)ring->buf & ~PAGE_MASK);

Please use PAGE_ALIGNED. This will also make the bad (int) cast to dismiss.

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


Re: [PATCH 2/7] kprobes: Propagate error from arm_kprobe_ftrace()

2015-02-26 Thread Masami Hiramatsu
(2015/02/27 1:13), Petr Mladek wrote:
> arm_kprobe_ftrace() could fail, especially after introducing ftrace IPMODIFY
> flag and LifePatching.
> 
> registry_kprobe() and registry_aggr_kprobe() do not mind about the error
> because the kprobe gets disabled and they keep it registered.
> 
> But enable_kprobe() should propagate the error because its tasks
> fails if ftrace fails.
> 
> Also arm_all_kprobes() should return error if it happens. The behavior
> is a bit questionable here. This patch keeps the existing behavior and does
> the best effort. It tries to enable as many Kprobes as possible. It returns
> only the last error code if any. kprobes_all_disarmed is always cleared and
> the message about finished action is always printed. There is going to be
> a separate patch that will improve the behavior.

When I applied it on -tip/master, there is a hunk which is not cleanly applied.
Please rebase it on the latest tip/master, since some logic are changed.

Here I have some comments on it.

> 
> Signed-off-by: Petr Mladek 
> ---
>  kernel/kprobes.c | 47 ---
>  1 file changed, 32 insertions(+), 15 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index d1b9db690b9c..a69d23add983 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -929,7 +929,7 @@ static int prepare_kprobe(struct kprobe *p)
>  }
>  
>  /* Caller must lock kprobe_mutex */
> -static void arm_kprobe_ftrace(struct kprobe *p)
> +static int arm_kprobe_ftrace(struct kprobe *p)
>  {
>   struct kprobe *kp;
>   int ret;
> @@ -949,7 +949,7 @@ static void arm_kprobe_ftrace(struct kprobe *p)
>   goto err_function;
>   }
>   kprobe_ftrace_enabled++;
> - return;
> + return ret;
>  
>  err_function:
>   ftrace_set_filter_ip(_ftrace_ops, (unsigned long)p->addr, 1, 0);
> @@ -958,6 +958,7 @@ err_filter:
>   if (kprobe_aggrprobe(p))
>   list_for_each_entry_rcu(kp, >list, list)
>   kp->flags |= KPROBE_FLAG_DISABLED;
> + return ret;
>  }
>  
>  /* Caller must lock kprobe_mutex */
> @@ -976,17 +977,15 @@ static void disarm_kprobe_ftrace(struct kprobe *p)
>  }
>  #else/* !CONFIG_KPROBES_ON_FTRACE */
>  #define prepare_kprobe(p)arch_prepare_kprobe(p)
> -#define arm_kprobe_ftrace(p) do {} while (0)
> +#define arm_kprobe_ftrace(p) (0)
>  #define disarm_kprobe_ftrace(p)  do {} while (0)
>  #endif
>  
>  /* Arm a kprobe with text_mutex */
> -static void arm_kprobe(struct kprobe *kp)
> +static int arm_kprobe(struct kprobe *kp)
>  {
> - if (unlikely(kprobe_ftrace(kp))) {
> - arm_kprobe_ftrace(kp);
> - return;
> - }
> + if (unlikely(kprobe_ftrace(kp)))
> + return arm_kprobe_ftrace(kp);
>   /*
>* Here, since __arm_kprobe() doesn't use stop_machine(),
>* this doesn't cause deadlock on text_mutex. So, we don't
> @@ -995,6 +994,7 @@ static void arm_kprobe(struct kprobe *kp)
>   mutex_lock(_mutex);
>   __arm_kprobe(kp);
>   mutex_unlock(_mutex);
> + return 0;
>  }
>  
>  /* Disarm a kprobe with text_mutex */
> @@ -1332,10 +1332,15 @@ out:
>   put_online_cpus();
>   jump_label_unlock();
>  
> + /* Arm when this is the first enabled kprobe at this address */
>   if (ret == 0 && kprobe_disabled(ap) && !kprobe_disabled(p)) {
>   ap->flags &= ~KPROBE_FLAG_DISABLED;
>   if (!kprobes_all_disarmed)
> - /* Arm the breakpoint again. */
> + /*
> +  * The kprobe is disabled and warning is printed
> +  * on error. But we ignore the error code here
> +  * because we keep it registered.
> +  */

Why? if we can't arm it, we'd better make it fail.

>   arm_kprobe(ap);
>   }
>   return ret;
> @@ -1540,6 +1545,11 @@ int register_kprobe(struct kprobe *p)
>  _table[hash_ptr(p->addr, KPROBE_HASH_BITS)]);
>  
>   if (!kprobes_all_disarmed && !kprobe_disabled(p))
> + /*
> +  * The kprobe is disabled and warning is printed on error.
> +  * But we ignore the error code here because we keep it
> +  * registered.
> +  */
>   arm_kprobe(p);

Ditto. If we failed to enable it. We should make it fail and report an error
to caller.

Thank you,

>  
>   /* Try to optimize kprobe */
> @@ -2040,7 +2050,7 @@ int enable_kprobe(struct kprobe *kp)
>  
>   if (!kprobes_all_disarmed && kprobe_disabled(p)) {
>   p->flags &= ~KPROBE_FLAG_DISABLED;
> - arm_kprobe(p);
> + ret = arm_kprobe(p);
>   }
>  out:
>   mutex_unlock(_mutex);
> @@ -2325,11 +2335,12 @@ static const struct file_operations 
> debugfs_kprobe_blacklist_ops = {
>   .release= seq_release,
>  };
>  
> -static void arm_all_kprobes(void)
> +static int 

Re: [patch 1/2] mm: remove GFP_THISNODE

2015-02-26 Thread Vlastimil Babka
On 02/27/2015 04:09 AM, David Rientjes wrote:
> On Thu, 26 Feb 2015, Vlastimil Babka wrote:
> 
>> > to restrict an allocation to a local node, but remove GFP_TRANSHUGE and
>> > it's obscurity.  Instead, we require that a caller clear __GFP_WAIT if it
>> > wants to avoid reclaim.
>> > 
>> > This allows the aforementioned functions to actually reclaim as they
>> > should.  It also enables any future callers that want to do
>> > __GFP_THISNODE but also __GFP_NORETRY && __GFP_NOWARN to reclaim.  The
>> > rule is simple: if you don't want to reclaim, then don't set __GFP_WAIT.
>> 
>> So, I agree with the intention, but this has some subtle implications that
>> should be mentioned/decided. The check for GFP_THISNODE in
>> __alloc_pages_slowpath() comes earlier than the check for __GFP_WAIT. So the
>> differences will be:
>> 
>> 1) We will now call wake_all_kswapds(), unless __GFP_NO_KSWAPD is passed, 
>> which
>> is only done for hugepages and some type of i915 allocation. Do we want the
>> opportunistic attempts from slab to wake up kswapds or do we pass the flag?
>> 
>> 2) There will be another attempt on get_page_from_freelist() with different
>> alloc_flags than in the fast path attempt. Without __GFP_WAIT (and also, 
>> again,
>> __GFP_KSWAPD, since your commit b104a35d32, which is another subtle check for
>> hugepage allocations btw), it will consider the allocation atomic and add
>> ALLOC_HARDER flag, unless __GFP_NOMEMALLOC is in __gfp_flags - it seems it's
>> generally not. It will also clear ALLOC_CPUSET, which was the concern of
>> b104a35d32. However, if I look at __cpuset_node_allowed(), I see that it's
>> always true for __GFP_THISNODE, which makes me question commit b104a35d32 in
>> light of your patch 2/2 and generally the sanity of all these flags and my
>> career choice.
>> 
> 
> Do we do either of these?  gfp_exact_node() sets __GFP_THISNODE and clears 
> __GFP_WAIT which will make the new conditional trigger immediately for 
> NUMA configs.

Oh, right. I missed the new trigger. My sanity and career is saved!

Well, no... the flags are still a mess. Aren't GFP_TRANSHUGE | __GFP_THISNODE
allocations still problematic after this patch and 2/2? Those do include
__GFP_WAIT (unless !defrag). So with only patch 2/2 without 1/2 they would match
GFP_THISNODE and bail out (not good for khugepaged at least...). With both
patches they won't bail out and __GFP_NO_KSWAPD will prevent most of the stuff
described above, including clearing ALLOC_CPUSET. But __cpuset_node_allowed()
will allow it to allocate anywhere anyway thanks to the newly passed
__GFP_THISNODE, which would be a regression of what b104a35d32 fixed... unless
I'm missing something else that prevents it, which wouldn't surprise me at all.

There's this outdated comment:

 * The __GFP_THISNODE placement logic is really handled elsewhere,
 * by forcibly using a zonelist starting at a specified node, and by
 * (in get_page_from_freelist()) refusing to consider the zones for
 * any node on the zonelist except the first.  By the time any such
 * calls get to this routine, we should just shut up and say 'yes'.

AFAIK the __GFP_THISNODE zonelist contains *only* zones from the single node and
there's no other "refusing". And I don't really see why __GFP_THISNODE should
have this exception, it feels to me like "well we shouldn't reach this but we
are not sure, so let's play it safe". So maybe we could just remove this
exception? I don't think any other user of __GFP_THISNODE | __GFP_WAIT user
relies on this allowed memset violation?

> Existing callers of GFP_KERNEL | __GFP_THISNODE aren't impacted and 
> net/openvswitch/flow.c is mentioned in the changelog as actually wanting 
> GFP_NOWAIT | __GFP_THISNODE so that this early check still fails.
> 
>> Ugh :)
>> 
> 
> Ugh indeed.
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 0/7] kprobe: Handle error when Kprobe ftrace arming fails

2015-02-26 Thread Masami Hiramatsu
Hi Petr,

(2015/02/27 1:13), Petr Mladek wrote:
> arm_kprobe_ftrace() could fail, especially after introducing ftrace IPMODIFY
> flag and LifePatching. This patch set adds the error handling and also some
> related fixes.

Hmm, I'd like to drop IPMODIFY from kprobes except for jprobes,
since it actually doesn't change regs->ip which was sent before.
It seems that this series partly covers that work.

> 1st patch includes the most important change. It helps to keep Kprobes
> in a sane state.
> 
> 2nd and 3rd patch allows to propagate the error where needed.

OK, I think the 1st one could be merged. 2nd and 3rd one still have some
issues as far as I reviewed.

> The other patches fix problems with the global kprobes_all_disarmed flag.
> They were there even before but they become more visible and critical
> after the arming errors became propagated.

Could you separate the series? And also I doubt we need to show global
disable status, since we can check it via debugfs too (and looks redundant).

Thank you,

> The first patch looks rather safe and might be suitable even for 4.0.
> 
> However, I would feel more comfortable if the other patches get some
> testing in linux-next. I did quite some testing and did my best. But
> I started with the three patches and was surprised by the effect of
> the propagated errors. They triggered that BUG_ON() in
> __unregister_kprobe_top() are required the other patches
> to get it working. I wonder if there is any other scenario that
> I have missed.
> 
> Of course, I also wait for feedback how to make things better.
> 
> 
> Petr Mladek (7):
>   kprobes: Disable Kprobe when ftrace arming fails
>   kprobes: Propagate error from arm_kprobe_ftrace()
>   kprobes: Propagate error from disarm_kprobe_ftrace()
>   kprobes: Keep consistent state of kprobes_all_disarmed
>   kprobes: Do not try to disarm already disarmed Kprobe
>   kprobes: Check kprobes_all_disarmed in kprobe_disarmed()
>   kprobes: Mark globally disabled Kprobes in debugfs interface
> 
>  Documentation/kprobes.txt |   5 +-
>  kernel/kprobes.c  | 279 
> ++
>  2 files changed, 213 insertions(+), 71 deletions(-)
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu...@hitachi.com


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] ixgbe: make VLAN filter conditional

2015-02-26 Thread Hiroshi Shimamoto
From: Hiroshi Shimamoto 

Disable hardware VLAN filtering if netdev->features VLAN flag is dropped.

In SR-IOV case, there is a use case which needs to disable VLAN filter.
For example, we need to make a network function with VF in virtualized
environment. That network function may be a software switch, a router
or etc. It means that that network function will be an end point which
terminates many VLANs.

In the current implementation, VLAN filtering always be turned on and
VF can receive only 63 VLANs. It means that only 63 VLANs can be terminated
in one NIC.

With this patch, if the user turns VLAN filtering off on the host, VF
can receive every VLAN packet.

This VLAN filtering can be turned on or off when SR-IOV is disabled, if not
the operation is rejected.

Signed-off-by: Hiroshi Shimamoto 
Reviewed-by: Hayato Momma 
CC: Choi, Sy Jong 
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c  | 23 +++
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c |  4 
 2 files changed, 27 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f690f5d..9593366 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4081,6 +4081,10 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
hw->addr_ctrl.user_set_promisc = false;
}
 
+   /* Disable hardware VLAN filter if the feature flag is dropped */
+   if (!(netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
+   vlnctrl &= ~(IXGBE_VLNCTRL_VFE | IXGBE_VLNCTRL_CFIEN);
+
/*
 * Write addresses to available RAR registers, if there is not
 * sufficient space to store all the addresses then enable
@@ -7734,6 +7738,26 @@ static int ixgbe_set_features(struct net_device *netdev,
netdev_features_t changed = netdev->features ^ features;
bool need_reset = false;
 
+   if (changed & NETIF_F_HW_VLAN_CTAG_FILTER) {
+   int vlan_filter = features & NETIF_F_HW_VLAN_CTAG_FILTER;
+
+   /* Prevent controlling VLAN filter if VFs exist */
+   if (adapter->num_vfs > 0) {
+   e_dev_info("%s HW VLAN filter is not allowed when "
+  "SR-IOV enabled.\n",
+  vlan_filter ? "Enabling" : "Disabling");
+   return -EINVAL;
+   }
+   if (!vlan_filter) {
+   e_dev_warn("Disabling HW VLAN filter. All VFs cannot "
+  "set VLAN filter from VF driver.\n");
+   e_dev_warn("All VLAN packets are delivered to "
+  "every VF.\n");
+   }
+   /* reset if HW VLAN filter is changed */
+   need_reset = true;
+   }
+
/* Make sure RSC matches LRO, reset if change */
if (!(features & NETIF_F_LRO)) {
if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 288f39f..9ad45738 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -839,6 +839,10 @@ static int ixgbe_set_vf_vlan_msg(struct ixgbe_adapter 
*adapter,
u32 bits;
u8 tcs = netdev_get_num_tc(adapter->netdev);
 
+   /* Ignore if VLAN filter is disabled */
+   if (!(adapter->netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
+   return 0;
+
if (adapter->vfinfo[vf].pf_vlan || tcs) {
e_warn(drv,
   "VF %d attempted to override administratively set VLAN 
configuration\n"
-- 
2.1.0



Re: [PATCH v4 0/3] powerpc: Enable seccomp filter support

2015-02-26 Thread Purcareata Bogdan

Ping?

On 18.02.2015 10:16, Bogdan Purcareata wrote:

Add the missing pieces in order to enable SECCOMP_FILTER on PowerPC
architectures, and enable this support.

Testing has been pursued using libseccomp with the latest ppc support patches
[1][2], on Freescale platforms for both ppc and ppc64. Support on ppc64le has
also been tested, courtesy of Mike Strosaker.

[1] https://groups.google.com/forum/#!topic/libseccomp/oz42LfMDsxg
[2] https://groups.google.com/forum/#!topic/libseccomp/TQWfCt_nD7c

v4:
- rebased on top of 3.19

v3:
- keep setting ENOSYS in syscall entry assembly when syscall tracing is disabled

v2:
- move setting ENOSYS from syscall entry assembly to do_syscall_trace_enter

Bogdan Purcareata (3):
   powerpc: Don't force ENOSYS as error on syscall fail
   powerpc: Relax secure computing on syscall entry trace
   powerpc: Enable HAVE_ARCH_SECCOMP_FILTER

  arch/powerpc/Kconfig   | 1 +
  arch/powerpc/kernel/entry_32.S | 7 ++-
  arch/powerpc/kernel/entry_64.S | 5 +++--
  arch/powerpc/kernel/ptrace.c   | 8 ++--
  4 files changed, 16 insertions(+), 5 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/


[PATCH] f2fs: fix max orphan inodes calculation

2015-02-26 Thread Wanpeng Li
cp_payload is introduced for sit bitmap to support large volume, and it is 
just after the block of f2fs_checkpoint + nat bitmap, so the first segment 
should include F2FS_CP_PACKS + NR_CURSEG_TYPE + cp_payload + orphan blocks. 
However, current max orphan inodes calculation don't consider cp_payload, 
this patch fix it by reducing the number of cp_payload from total blocks of 
the first segment when calculate max orphan inodes.

Signed-off-by: Wanpeng Li 
---
 fs/f2fs/checkpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index db82e09..3c9d677 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -1109,7 +1109,7 @@ void init_ino_entry_info(struct f2fs_sb_info *sbi)
 * for cp pack we can have max 1020*504 orphan entries
 */
sbi->max_orphans = (sbi->blocks_per_seg - F2FS_CP_PACKS -
-   NR_CURSEG_TYPE) * F2FS_ORPHANS_PER_BLOCK;
+   NR_CURSEG_TYPE - __cp_payload(sbi)) * 
F2FS_ORPHANS_PER_BLOCK;
 }
 
 int __init create_checkpoint_caches(void)
-- 
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/


[LKP] [mm] 3484b2de949: -46.2% aim7.jobs-per-min

2015-02-26 Thread Huang Ying
FYI, we noticed the below changes on

git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
commit 3484b2de9499df23c4604a513b36f96326ae81ad ("mm: rearrange zone fields 
into read-only, page alloc, statistics and page reclaim lines")

The perf cpu-cycles for spinlock (zone->lock) increased a lot.  I suspect there 
are some cache ping-pong or false sharing.


testbox/testcase/testparams: brickland1/aim7/performance-6000-page_test

24b7e5819ad5cbef  3484b2de9499df23c4604a513b  
  --  
 %stddev %change %stddev
 \  |\  
152288 ±  0% -46.2%  81911 ±  0%  aim7.jobs-per-min
   237 ±  0% +85.6%440 ±  0%  aim7.time.elapsed_time
   237 ±  0% +85.6%440 ±  0%  aim7.time.elapsed_time.max
 25026 ±  0% +70.7%  42712 ±  0%  aim7.time.system_time
   2186645 ±  5% +32.0%2885949 ±  4%  
aim7.time.voluntary_context_switches
   4576561 ±  1% +24.9%5715773 ±  0%  
aim7.time.involuntary_context_switches
   695 ±  0%  -3.7%669 ±  1%  aim7.time.user_time
  5.37 ±  8%+303.5%  21.67 ±  2%  
perf-profile.cpu-cycles._raw_spin_lock.get_page_from_freelist.__alloc_pages_nodemask.alloc_pages_vma.handle_mm_fault
 13.53 ± 18%+244.5%  46.61 ±  2%  
perf-profile.cpu-cycles._raw_spin_lock.free_pcppages_bulk.free_hot_cold_page.free_hot_cold_page_list.release_pages
  7.88 ± 24%+495.3%  46.89 ±  3%  
perf-profile.cpu-cycles.free_pcppages_bulk.free_hot_cold_page.free_hot_cold_page_list.release_pages.free_pages_and_swap_cache
   362 ± 14%+621.7%   2617 ±  8%  numa-vmstat.node2.nr_inactive_anon
  0.22 ± 38%   +8387.7%  18.39 ±  4%  
perf-profile.cpu-cycles.get_page_from_freelist.__alloc_pages_nodemask.alloc_pages_vma.handle_mm_fault.__do_page_fault
  7.99 ±  5% -98.5%   0.12 ± 27%  
perf-profile.cpu-cycles.do_brk.sys_brk.system_call_fastpath
12 ± 29%+352.8% 54 ± 38%  
sched_debug.cfs_rq[86]:/.tg_load_contrib
 2 ± 40%   +2133.3% 44 ± 27%  
sched_debug.cfs_rq[52]:/.nr_spread_over
 2 ± 46%   +1337.5% 38 ± 25%  
sched_debug.cfs_rq[87]:/.nr_spread_over
 2 ± 40%   +2533.3% 52 ± 14%  
sched_debug.cfs_rq[53]:/.nr_spread_over
 3 ±  0%   +1377.8% 44 ± 29%  
sched_debug.cfs_rq[48]:/.nr_spread_over
 1 ± 28%   +2620.0% 45 ± 30%  
sched_debug.cfs_rq[47]:/.nr_spread_over
 4 ± 28%   +1276.9% 59 ± 12%  sched_debug.cfs_rq[117]:/.load
 4 ± 28%   +1276.9% 59 ± 12%  sched_debug.cpu#117.load
  2685 ± 19%+348.6%  12046 ± 48%  sched_debug.cpu#116.ttwu_count
 1 ± 28%   +2240.0% 39 ± 10%  
sched_debug.cfs_rq[63]:/.nr_spread_over
 5 ±  8%+912.5% 54 ± 24%  sched_debug.cpu#65.load
 2 ± 40%   +1950.0% 41 ± 13%  
sched_debug.cfs_rq[113]:/.nr_spread_over
  1508 ± 11%+581.1%  10271 ±  6%  numa-meminfo.node2.Inactive(anon)
 2 ± 35%   +1512.5% 43 ± 21%  
sched_debug.cfs_rq[112]:/.nr_spread_over
 5 ±  8%+912.5% 54 ± 24%  sched_debug.cfs_rq[65]:/.load
 6 ± 41%   +2036.8%135 ± 20%  sched_debug.cpu#0.load
 1 ± 28%   +3220.0% 55 ± 22%  
sched_debug.cfs_rq[66]:/.nr_spread_over
 5 ± 48%   +1093.3% 59 ± 23%  
sched_debug.cfs_rq[0]:/.nr_spread_over
 0 ±  0%  +Inf%  1 ±  0%  sched_debug.cfs_rq[0]:/.nr_running
 6 ± 41%   +2036.8%135 ± 20%  sched_debug.cfs_rq[0]:/.load
14 ± 37%+563.6% 97 ± 43%  
sched_debug.cfs_rq[0]:/.blocked_load_avg
20 ± 20%+437.7%109 ± 40%  
sched_debug.cfs_rq[0]:/.tg_load_contrib
 5 ± 29%   +1752.9%105 ± 48%  sched_debug.cpu#1.load
 7 ± 34%+672.7% 56 ±  7%  
sched_debug.cfs_rq[110]:/.blocked_load_avg
 5 ± 29%   +1752.9%105 ± 48%  sched_debug.cfs_rq[1]:/.load
 5 ± 28%   +1286.7% 69 ± 32%  sched_debug.cpu#2.load
 1 ± 35%   +2975.0% 41 ±  8%  
sched_debug.cfs_rq[68]:/.nr_spread_over
 2 ± 20%   +1685.7% 41 ± 15%  
sched_debug.cfs_rq[109]:/.nr_spread_over
16 ± 49%+446.0% 91 ± 32%  
sched_debug.cfs_rq[68]:/.tg_load_contrib
 5 ± 28%   +1280.0% 69 ± 33%  sched_debug.cfs_rq[2]:/.load
 5 ± 16%+860.0% 48 ± 35%  sched_debug.cpu#3.load
 8 ± 34%+428.0% 44 ± 25%  
sched_debug.cfs_rq[22]:/.blocked_load_avg
 5 ± 31%   +1912.5%107 ± 27%  sched_debug.cfs_rq[39]:/.load
 5 ± 31%   +1912.5%107 ± 27%  sched_debug.cpu#39.load
 5 ± 16%+680.0% 39 ±  7%  sched_debug.cfs_rq[3]:/.load
 4 ± 20%   +1933.3% 81 ± 14%  sched_debug.cfs_rq[38]:/.load
  0.00 ±  0%  +7.2e+14% 7171133.21 ± 29%  
sched_debug.cfs_rq[38]:/.max_vruntime
  0.00 

Re: [PATCH v2] mmc: dw_mmc: fix bug that cause mmc_test failture

2015-02-26 Thread Jaehoon Chung
Hi,

I will apply into my-tree after change the subject and fix typo.

Acked-by: Jaehoon Chung 

Best Regards,
Jaehoon Chung

On 02/26/2015 03:17 AM, Javier Martinez Canillas wrote:
> Hello Addy,
> 
> On 02/20/2015 03:55 AM, Addy Ke wrote:
>> The STOP command can terminate a data transfer between a memory card and
>> mmc controller.
>>
>> As show in Synopsys DesignWare Cores Mobile Stroage Host Databook:
> 
> s/Stroage/Storage but maybe Ulf can amend the typo when applying?
> 
>> Data timeout and Data end-bit error will terminate further data transfer
>> by mmc controller. So we should not send abort command to terminate a
>> data transfer again if we got DRTO and EBE interrupt.
>>
>> After this patch, all mmc_test cases can pass on RK3288-Pink2 board.
>>
>> Signed-off-by: Addy Ke 
> 
> I did not run all the tests listed in /sys/kernel/debug/mmc*/*/testlist
> because some of them will overwrite the data in my card but at least
> the read ones completed successfully and $subject does not cause a
> regression in the Exynos5250 Snow, Exynos5420 Peach Pit and Exynos5800
> Peach Pi Chromebooks where I tested it.
> 
> Tested-by: Javier Martinez Canillas 
> 
> 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: + ocfs2-remove-unneeded-rc-for-kfree.patch added to -mm tree

2015-02-26 Thread Joseph Qi
We can only free conn->cc_private if error occurs. Otherwise it will
trigger a bug in o2cb_cluster_disconnect since conn->cc_private has
already been freed.
So please drop this patch, thanks.

On 2015/2/18 7:32, a...@linux-foundation.org wrote:
> 
> The patch titled
>  Subject: ocfs2: remove unneeded 'rc' for kfree()
> has been added to the -mm tree.  Its filename is
>  ocfs2-remove-unneeded-rc-for-kfree.patch
> 
> This patch should soon appear at
> 
> http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-remove-unneeded-rc-for-kfree.patch
> and later at
> 
> http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-remove-unneeded-rc-for-kfree.patch
> 
> Before you just go and hit "reply", please:
>a) Consider who else should be cc'ed
>b) Prefer to cc a suitable mailing list as well
>c) Ideally: find the original patch on the mailing list and do a
>   reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
> 
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
> 
> --
> From: Daeseok Youn 
> Subject: ocfs2: remove unneeded 'rc' for kfree()
> 
> If kzalloc() failed, just goto 'out' label and 'out_free' label doesn't
> need to check 'rc' variable.
> 
> Signed-off-by: Daeseok Youn 
> Cc: Mark Fasheh 
> Cc: Joel Becker 
> Signed-off-by: Andrew Morton 
> ---
> 
>  fs/ocfs2/stack_o2cb.c |5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff -puN fs/ocfs2/stack_o2cb.c~ocfs2-remove-unneeded-rc-for-kfree 
> fs/ocfs2/stack_o2cb.c
> --- a/fs/ocfs2/stack_o2cb.c~ocfs2-remove-unneeded-rc-for-kfree
> +++ a/fs/ocfs2/stack_o2cb.c
> @@ -347,7 +347,7 @@ static int o2cb_cluster_connect(struct o
>   priv = kzalloc(sizeof(struct o2dlm_private), GFP_KERNEL);
>   if (!priv) {
>   rc = -ENOMEM;
> - goto out_free;
> + goto out;
>   }
>  
>   /* This just fills the structure in.  It is safe to pass conn. */
> @@ -376,8 +376,7 @@ static int o2cb_cluster_connect(struct o
>   dlm_register_eviction_cb(dlm, >op_eviction_cb);
>  
>  out_free:
> - if (rc)
> - kfree(conn->cc_private);
> + kfree(conn->cc_private);
>  
>  out:
>   return rc;
> _
> 
> Patches currently in -mm which might be from daeseok.y...@gmail.com are
> 
> origin.patch
> ocfs2-remove-unneeded-rc-for-kfree.patch
> 
> --
> To unsubscribe from this list: send the line "unsubscribe mm-commits" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> .
> 


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


Re: [PATCH 3/3] leds: Add ktd2692 flash LED driver

2015-02-26 Thread Ingi Kim

hi

On 2015년 02월 27일 12:36, Varka Bhadram wrote:
> On 02/27/2015 06:31 AM, Ingi Kim wrote:
>> This patch adds a driver to support the ktd2692 flash LEDs.
>> ktd2692 can control flash current by ExpressWire interface.
>>
>> Signed-off-by: Ingi Kim 
>> ---
>>   drivers/leds/Kconfig|8 ++
>>   drivers/leds/Makefile   |1 +
>>   drivers/leds/leds-ktd2692.c |  245 
>> +++
>>   3 files changed, 254 insertions(+)
>>   create mode 100644 drivers/leds/leds-ktd2692.c
>>
> (...)
> 
>> +static struct ktd2692_context *ktd2692_parse_dt(struct device *dev)
>> +{
>> + struct device_node *np = dev->of_node;
>> + struct ktd2692_context *led;
>> +
>> + led = devm_kzalloc(dev, sizeof(struct ktd2692_context), GFP_KERNEL);
>> + if (!led)
>> + return ERR_PTR((long)led);
> 
> What about using sizeof(*led) in place of sizeof(struct ktd2692_context)..?
> 
> Also the error return for devm_kzalloc() should be -ENOMEM.
> 

Thanks, I'll check and change sizeof() and error return style.

>> +
>> + led->strobe_gpio = of_get_named_gpio(np, "strobe-gpio", 0);
>> + if (!gpio_is_valid(led->strobe_gpio)) {
>> + dev_err(dev, "no strobe_gpio property found\n");
>> + return ERR_PTR(led->strobe_gpio);
>> + }
>> +
>> + return led;
>> +}
>> +
>> +static int ktd2692_probe(struct platform_device *pdev)
>> +{
>> + struct device *dev = >dev;
>> + struct ktd2692_context *led;
>> + int ret;
>> +
>> + if (!dev->of_node)
>> + return -ENODEV;
>> +
>> + led = ktd2692_parse_dt(dev);
>> + if (IS_ERR(led))
>> + return PTR_ERR(led);
>> +
>> + led->cdev.name = KTD2692_DEFAULT_NAME;
>> + led->cdev.brightness = LED_OFF;
>> + led->cdev.max_brightness = LED_FULL;
>> + led->cdev.flags |= LED_CORE_SUSPENDRESUME;
>> + led->cdev.brightness_set = ktd2692_brightness_set;
>> + led->cdev.brightness_get = ktd2692_brightness_get;
>> + led->mode = KTD2692_REG_MODE_BASE | KTD2692_MODE_DISABLE;
>> +
>> + platform_set_drvdata(pdev, led);
>> +
>> + ret = led_classdev_register(>dev, >cdev);
>> + if (ret) {
>> + dev_err(dev, "couldn't register LED %s\n", led->cdev.name);
>> + return ret;
>> + }
>> +
>> + ret = ktd2692_brightness_set_gpio(led);
>> + if (ret) {
>> + led_classdev_unregister(>cdev);
>> + return ret;
>> + }
>> +
>> + ktd2692_expresswire_reset(led);
>> +
>> + return ret;
> 
> return 0 instead of ret...?
> 
> 
> 

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


[PATCH 0/2] ACPI / EC: Enhance logging/debugging.

2015-02-26 Thread Lv Zheng
This patchset enhances logging/debugging support in EC driver.

Lv Zheng (2):
  ACPI / EC: Cleanup logging/debugging splitter support.
  ACPI / EC: Add GPE reference counting debugging messages.

 drivers/acpi/ec.c |  120 +
 1 file changed, 84 insertions(+), 36 deletions(-)

-- 
1.7.10

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


[PATCH 1/2] ACPI / EC: Cleanup logging/debugging splitter support.

2015-02-26 Thread Lv Zheng
This patch refines logging/debugging splitter support so that when DEBUG is
disabled, splitters won't be visible in the kernel logs while they are
still available for developers when DEBUG is enabled.

This patch also refines the splitters to mark the following handling
process boundaries:
  +: boundary of driver starting/stopping
 boundary of IRQ storming
  =: boundary of transaction advancement
  *: boundary of EC command
 boundary of EC query
  #: boundary of EC _Qxx evaluation

The following 2 log entries are originally logged using pr_info() in order
to be used as the boot/suspend/resume log entries for the EC device, this
patch also restores them to pr_info() logging level:
 ACPI : EC: EC started
 ACPI : EC: EC stopped

In this patch, one log entry around "Polling quirk" is converted into
ec_dbg_raw() which doesn't contain the boundary marker.

Signed-off-by: Lv Zheng 
---
 drivers/acpi/ec.c |  108 -
 1 file changed, 74 insertions(+), 34 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index a8dd2f7..07426c8 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -137,6 +137,48 @@ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs 
acpi_ec_clear() on boot/resume */
 static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
 
 /* --
+ *   Logging/Debugging
+ * -- 
*/
+
+/*
+ * Splitters used by the developers to track the boundary of the EC
+ * handling processes.
+ */
+#ifdef DEBUG
+#define EC_DBG_SEP " "
+#define EC_DBG_DRV "+"
+#define EC_DBG_STM "="
+#define EC_DBG_REQ "*"
+#define EC_DBG_EVT "#"
+#else
+#define EC_DBG_SEP ""
+#define EC_DBG_DRV
+#define EC_DBG_STM
+#define EC_DBG_REQ
+#define EC_DBG_EVT
+#endif
+
+#define ec_log_raw(fmt, ...) \
+   pr_info(fmt "\n", ##__VA_ARGS__)
+#define ec_dbg_raw(fmt, ...) \
+   pr_debug(fmt "\n", ##__VA_ARGS__)
+#define ec_log(filter, fmt, ...) \
+   ec_log_raw(filter EC_DBG_SEP fmt EC_DBG_SEP filter, ##__VA_ARGS__)
+#define ec_dbg(filter, fmt, ...) \
+   ec_dbg_raw(filter EC_DBG_SEP fmt EC_DBG_SEP filter, ##__VA_ARGS__)
+
+#define ec_log_drv(fmt, ...) \
+   ec_log(EC_DBG_DRV, fmt, ##__VA_ARGS__)
+#define ec_dbg_drv(fmt, ...) \
+   ec_dbg(EC_DBG_DRV, fmt, ##__VA_ARGS__)
+#define ec_dbg_stm(fmt, ...) \
+   ec_dbg(EC_DBG_STM, fmt, ##__VA_ARGS__)
+#define ec_dbg_req(fmt, ...) \
+   ec_dbg(EC_DBG_REQ, fmt, ##__VA_ARGS__)
+#define ec_dbg_evt(fmt, ...) \
+   ec_dbg(EC_DBG_EVT, fmt, ##__VA_ARGS__)
+
+/* --
  *   Device Flags
  * -- 
*/
 
@@ -159,14 +201,14 @@ static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
u8 x = inb(ec->command_addr);
 
-   pr_debug("EC_SC(R) = 0x%2.2x "
-"SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d\n",
-x,
-!!(x & ACPI_EC_FLAG_SCI),
-!!(x & ACPI_EC_FLAG_BURST),
-!!(x & ACPI_EC_FLAG_CMD),
-!!(x & ACPI_EC_FLAG_IBF),
-!!(x & ACPI_EC_FLAG_OBF));
+   ec_dbg_raw("EC_SC(R) = 0x%2.2x "
+  "SCI_EVT=%d BURST=%d CMD=%d IBF=%d OBF=%d",
+  x,
+  !!(x & ACPI_EC_FLAG_SCI),
+  !!(x & ACPI_EC_FLAG_BURST),
+  !!(x & ACPI_EC_FLAG_CMD),
+  !!(x & ACPI_EC_FLAG_IBF),
+  !!(x & ACPI_EC_FLAG_OBF));
return x;
 }
 
@@ -175,20 +217,20 @@ static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
u8 x = inb(ec->data_addr);
 
ec->curr->timestamp = jiffies;
-   pr_debug("EC_DATA(R) = 0x%2.2x\n", x);
+   ec_dbg_raw("EC_DATA(R) = 0x%2.2x", x);
return x;
 }
 
 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
-   pr_debug("EC_SC(W) = 0x%2.2x\n", command);
+   ec_dbg_raw("EC_SC(W) = 0x%2.2x", command);
outb(command, ec->command_addr);
ec->curr->timestamp = jiffies;
 }
 
 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
 {
-   pr_debug("EC_DATA(W) = 0x%2.2x\n", data);
+   ec_dbg_raw("EC_DATA(W) = 0x%2.2x", data);
outb(data, ec->data_addr);
ec->curr->timestamp = jiffies;
 }
@@ -240,7 +282,7 @@ static inline void acpi_ec_enable_gpe(struct acpi_ec *ec, 
bool open)
 * software need to manually trigger a pseudo GPE event on
 * EN=1 writes.
 */
-   pr_debug("* Polling quirk *\n");
+   ec_dbg_raw("Polling quirk");
advance_transaction(ec);
}
 }
@@ -299,7 +341,7 @@ static void acpi_ec_set_storm(struct 

[PATCH 2/2] ACPI / EC: Add GPE reference counting debugging messages.

2015-02-26 Thread Lv Zheng
This patch enhances debugging with the GPE reference count messages added.

This kind of log entries can be used by the platform validators to validate
if there is an EC transaction broken because of firmware/driver bugs.

No functional changes.

Signed-off-by: Lv Zheng 
---
 drivers/acpi/ec.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 07426c8..a362f20 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -177,6 +177,8 @@ static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued 
when SCI_EVT set */
ec_dbg(EC_DBG_REQ, fmt, ##__VA_ARGS__)
 #define ec_dbg_evt(fmt, ...) \
ec_dbg(EC_DBG_EVT, fmt, ##__VA_ARGS__)
+#define ec_dbg_ref(ec, fmt, ...) \
+   ec_dbg_raw("%lu: " fmt, ec->reference_count, ## __VA_ARGS__)
 
 /* --
  *   Device Flags
@@ -544,6 +546,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
ret = -EINVAL;
goto unlock;
}
+   ec_dbg_ref(ec, "Increase command");
/* following two actions should be kept atomic */
ec->curr = t;
ec_dbg_req("Command(%s) started", acpi_ec_cmd_string(t->command));
@@ -557,6 +560,7 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
ec->curr = NULL;
/* Disable GPE for command processing (IBF=0/OBF=1) */
acpi_ec_complete_request(ec);
+   ec_dbg_ref(ec, "Decrease command");
 unlock:
spin_unlock_irqrestore(>lock, tmp);
return ret;
@@ -718,8 +722,10 @@ static void acpi_ec_start(struct acpi_ec *ec, bool 
resuming)
if (!test_and_set_bit(EC_FLAGS_STARTED, >flags)) {
ec_dbg_drv("Starting EC");
/* Enable GPE for event processing (SCI_EVT=1) */
-   if (!resuming)
+   if (!resuming) {
acpi_ec_submit_request(ec);
+   ec_dbg_ref(ec, "Increase driver");
+   }
ec_log_drv("EC started");
}
spin_unlock_irqrestore(>lock, flags);
@@ -748,8 +754,10 @@ static void acpi_ec_stop(struct acpi_ec *ec, bool 
suspending)
wait_event(ec->wait, acpi_ec_stopped(ec));
spin_lock_irqsave(>lock, flags);
/* Disable GPE for event processing (SCI_EVT=1) */
-   if (!suspending)
+   if (!suspending) {
acpi_ec_complete_request(ec);
+   ec_dbg_ref(ec, "Decrease driver");
+   }
clear_bit(EC_FLAGS_STARTED, >flags);
clear_bit(EC_FLAGS_STOPPED, >flags);
ec_log_drv("EC stopped");
-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] mm: change mm_advise_free to clear page dirty

2015-02-26 Thread Minchan Kim
On Fri, Feb 27, 2015 at 01:48:48PM +0800, Wang, Yalin wrote:
> > -Original Message-
> > From: Minchan Kim [mailto:minchan@gmail.com] On Behalf Of Minchan Kim
> > Sent: Friday, February 27, 2015 1:28 PM
> > To: Wang, Yalin
> > Cc: Michal Hocko; Andrew Morton; linux-kernel@vger.kernel.org; linux-
> > m...@kvack.org; Rik van Riel; Johannes Weiner; Mel Gorman; Shaohua Li
> > Subject: Re: [RFC] mm: change mm_advise_free to clear page dirty
> > 
> > Hello,
> > 
> > On Fri, Feb 27, 2015 at 11:37:18AM +0800, Wang, Yalin wrote:
> > > This patch add ClearPageDirty() to clear AnonPage dirty flag,
> > > the Anonpage mapcount must be 1, so that this page is only used by
> > > the current process, not shared by other process like fork().
> > > if not clear page dirty for this anon page, the page will never be
> > > treated as freeable.
> > 
> > In case of anonymous page, it has PG_dirty when VM adds it to
> > swap cache and clear it in clear_page_dirty_for_io. That's why
> > I added ClearPageDirty if we found it in swapcache.
> > What case am I missing? It would be better to understand if you
> > describe specific scenario.
> > 
> > Thanks.
> > 
> > >
> > > Signed-off-by: Yalin Wang 
> > > ---
> > >  mm/madvise.c | 15 +--
> > >  1 file changed, 5 insertions(+), 10 deletions(-)
> > >
> > > diff --git a/mm/madvise.c b/mm/madvise.c
> > > index 6d0fcb8..257925a 100644
> > > --- a/mm/madvise.c
> > > +++ b/mm/madvise.c
> > > @@ -297,22 +297,17 @@ static int madvise_free_pte_range(pmd_t *pmd,
> > unsigned long addr,
> > >   continue;
> > >
> > >   page = vm_normal_page(vma, addr, ptent);
> > > - if (!page)
> > > + if (!page || !PageAnon(page) || !trylock_page(page))
> > >   continue;
> > >
> > >   if (PageSwapCache(page)) {
> > > - if (!trylock_page(page))
> > > + if (!try_to_free_swap(page))
> > >   continue;
> > > -
> > > - if (!try_to_free_swap(page)) {
> > > - unlock_page(page);
> > > - continue;
> > > - }
> > > -
> > > - ClearPageDirty(page);
> > > - unlock_page(page);
> > >   }
> > >
> > > + if (page_mapcount(page) == 1)
> > > + ClearPageDirty(page);
> > > + unlock_page(page);
> > >   /*
> > >* Some of architecture(ex, PPC) don't update TLB
> > >* with set_pte_at and tlb_remove_tlb_entry so for
> > > --
> Yes, for page which is in SwapCache, it is correct,
> But for anon page which is not in SwapCache, it is always
> PageDirty(), so we should also clear dirty bit to make it freeable,

No. Every anon page starts from !PageDirty and it has PG_dirty
only when it's addeded into swap cache. If vm_swap_full turns on,
a page in swap cache could have PG_dirty via try_to_free_swap again.
So, Do you have concern about swapped-out pages when MADV_FREE is
called? If so, please look at my patch.

https://lkml.org/lkml/2015/2/25/43

It will zap the swapped out page. So, this is not a issue any more?

> 
> Another problem  is that if an anon page is shared by more than one process,
> This happened when fork(), the anon page will be copy on write,
> In this case, we should not clear page dirty,
> This is not correct for other process which don't call MADV_FREE syscall.

You mean we shouldn't inherit MADV_FREE attribute?
Why?

parent:
ptr1 = malloc(len);
-> allocator calls mmap(len);
memset(ptr1, 'a', len);
free(ptr1);
-> allocator calss madvise_free(ptr1, len);
..
..
-> VM discard hinted pages

fork();

child:

ptr2 = malloc(len)
-> allocator reuses the chunk allocated from parent.
so, child will see zero pages from ptr2 but he doesn't write
anything so garbage|zero page anything is okay to him.


> 
> Thanks
> 
> 

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 v11 4/6] devicetree: Add new SKY81452 backlight binding

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

Signed-off-by: Gyungoh Yoo 
Acked-by: Bryan Wu 
---
Changes v11:
Renamed 'skyworks,en-channels' property to led-sources.
Removed unused property 'skyworks,ovp-level'.

Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO
Made up the example for backlight DT

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Nothing

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Added reg attribute for I2C slave address

 .../video/backlight/sky81452-backlight.txt | 29 ++
 1 file changed, 29 insertions(+)
 create mode 100644 
Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt

diff --git 
a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt 
b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
new file mode 100644
index 000..8bf2940
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
@@ -0,0 +1,29 @@
+SKY81452-backlight bindings
+
+Required properties:
+- compatible   : Must be "skyworks,sky81452-backlight"
+
+Optional properties:
+- name : Name of backlight device. Default is 'lcd-backlight'.
+- gpios: GPIO to use to EN pin.
+   See Documentation/devicetree/bindings/gpio/gpio.txt
+- led-sources  : List of enabled channels from 0 to 5.
+   See Documentation/devicetree/bindings/leds/common.txt
+- skyworks,ignore-pwm  : Ignore both PWM input
+- skyworks,dpwm-mode   : Enable DPWM dimming mode, otherwise Analog dimming.
+- skyworks,phase-shift : Enable phase shift mode
+- skyworks,short-detection-threshold-volt
+   : It should be one of 4, 5, 6 and 7V.
+- skyworks,current-limit-mA
+   : It should be 2300mA or 2750mA.
+
+Example:
+
+   backlight {
+   compatible = "skyworks,sky81452-backlight";
+   name = "pwm-backlight";
+   led-sources = <0 1 2 5>;
+   skyworks,ignore-pwm;
+   skyworks,phase-shift;
+   skyworks,current-limit-mA = <2300>;
+   };
-- 
1.9.1

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


[PATCH v11 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

Signed-off-by: Gyungoh Yoo 
Acked-by: Lee Jones 
---
Changes v11:
Nothing

Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Nothing

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Nothing

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Added vendor prefix for Skyworks Solutions, Inc.

 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 389ca13..c4fe9cc 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -165,6 +165,7 @@ sii Seiko Instruments, Inc.
 silergySilergy Corp.
 sirf   SiRF Technology, Inc.
 sitronix   Sitronix Technology Corporation
+skyworks   Skyworks Solutions, Inc.
 smsc   Standard Microsystems Corporation
 snps   Synopsys, Inc.
 solidrun   SolidRun
-- 
1.9.1

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


[PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

Signed-off-by: Gyungoh Yoo 
Acked-by: Jingoo Han 
Acked-by: Bryan Wu 
---
Changes v11:
Renamed 'skyworks,en-channels' property to led-sources.

Changes v10:
Removed trivial get_brightness implementations

Changes v9:
Nothing

Changes v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO

Changes v7:
Modified licensing text to GPLv2

Changes v6:
Added new line character at the end of line of dev_err()

Changes v5:
Move sky81452-backlight.h to include/linux/platform_data

Changes v4:
Reordering header files for readability
Removed calling to backlight_device_unregister()
Removed MODULE_VERSION()
Modified license to GPLv2

Changes v3:
Modified DBG messages

Changes v2:
Added 'compatible' attribute in the driver
Added message for exception or errors

 drivers/video/backlight/Kconfig  |  10 +
 drivers/video/backlight/Makefile |   1 +
 drivers/video/backlight/sky81452-backlight.c | 353 +++
 include/linux/platform_data/sky81452-backlight.h |  46 +++
 4 files changed, 410 insertions(+)
 create mode 100644 drivers/video/backlight/sky81452-backlight.c
 create mode 100644 include/linux/platform_data/sky81452-backlight.h

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index efb0904..2d9923a 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -408,6 +408,16 @@ config BACKLIGHT_PANDORA
  If you have a Pandora console, say Y to enable the
  backlight driver.
 
+config BACKLIGHT_SKY81452
+   tristate "Backlight driver for SKY81452"
+   depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452
+   help
+ If you have a Skyworks SKY81452, say Y to enable the
+ backlight driver.
+
+ To compile this driver as a module, choose M here: the module will
+ be called sky81452-backlight
+
 config BACKLIGHT_TPS65217
tristate "TPS65217 Backlight"
depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index fcd50b73..d67073f 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA)   += pandora_bl.o
 obj-$(CONFIG_BACKLIGHT_PCF50633)   += pcf50633-backlight.o
 obj-$(CONFIG_BACKLIGHT_PWM)+= pwm_bl.o
 obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
+obj-$(CONFIG_BACKLIGHT_SKY81452)   += sky81452-backlight.o
 obj-$(CONFIG_BACKLIGHT_TOSA)   += tosa_bl.o
 obj-$(CONFIG_BACKLIGHT_TPS65217)   += tps65217_bl.o
 obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
diff --git a/drivers/video/backlight/sky81452-backlight.c 
b/drivers/video/backlight/sky81452-backlight.c
new file mode 100644
index 000..052fa1b
--- /dev/null
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -0,0 +1,353 @@
+/*
+ * sky81452-backlight.cSKY81452 backlight driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* registers */
+#define SKY81452_REG0  0x00
+#define SKY81452_REG1  0x01
+#define SKY81452_REG2  0x02
+#define SKY81452_REG4  0x04
+#define SKY81452_REG5  0x05
+
+/* bit mask */
+#define SKY81452_CS0xFF
+#define SKY81452_EN0x3F
+#define SKY81452_IGPW  0x20
+#define SKY81452_PWMMD 0x10
+#define SKY81452_PHASE 0x08
+#define SKY81452_ILIM  0x04
+#define SKY81452_VSHRT 0x03
+#define SKY81452_OCP   0x80
+#define SKY81452_OTMP  0x40
+#define SKY81452_SHRT  0x3F
+#define SKY81452_OPN   0x3F
+
+#define SKY81452_DEFAULT_NAME "lcd-backlight"
+#define SKY81452_MAX_BRIGHTNESS(SKY81452_CS + 1)
+
+#define CTZ(b) __builtin_ctz(b)
+
+static int sky81452_bl_update_status(struct backlight_device *bd)
+{
+   const struct sky81452_bl_platform_data *pdata =
+   dev_get_platdata(bd->dev.parent);
+   const unsigned int brightness = (unsigned int)bd->props.brightness;
+   struct regmap *regmap = bl_get_data(bd);
+   int ret;
+
+   if (brightness > 0) {
+   ret = regmap_write(regmap, SKY81452_REG0, brightness - 1);
+   if (IS_ERR_VALUE(ret))
+   return ret;
+

[PATCH v11 6/6] devicetree: Add SKY81452 to the Trivial Devices list

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

Signed-off-by: Gyungoh Yoo 
---
Changes v11:
Nothing

Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Nothing

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Nothing

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Add SKY81452 to the Trivial Devices list

 Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt 
b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
index aaa8325..003bd77 100644
--- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
+++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
@@ -89,6 +89,7 @@ ricoh,rv5c386 I2C bus SERIAL INTERFACE REAL-TIME 
CLOCK IC
 ricoh,rv5c387a I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
 samsung,24ad0xd1   S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
 sii,s35390a2-wire CMOS real-time clock
+skyworks,sky81452  Skyworks SKY81452: Six-Channel White LED Driver with 
Touch Panel Bias Supply
 st-micro,24c256i2c serial eeprom  (24cxx)
 stm,m41t00 Serial Access TIMEKEEPER
 stm,m41t62 Serial real-time clock (RTC) with alarm
-- 
1.9.1

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


[PATCH v11 3/6] devicetree: Add new SKY81452 mfd binding

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

Signed-off-by: Gyungoh Yoo 
Acked-by: Lee Jones 
---
Changes v11:
Renamed 'skyworks,en-channels' property to led-sources.
Removed unused property 'skyworks,ovp-level'.

Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Made up the example for backlight DT

Changes v7:
Nothing

Changes v6:
Nothing

Changes v5:
Changed DT for regulator : 'lout' node should be defined under 'regulator'
Removed compatible string from sky81452-regulator driver

Changes v4:
Nothing

Changes v3:
Nothing

Changes v2:
Added reg attribute for I2C slave address

 Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++
 1 file changed, 35 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt

diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt 
b/Documentation/devicetree/bindings/mfd/sky81452.txt
new file mode 100644
index 000..3518179
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/sky81452.txt
@@ -0,0 +1,35 @@
+SKY81452 bindings
+
+Required properties:
+- compatible   : Must be "skyworks,sky81452"
+- reg  : I2C slave address
+
+Required child nodes:
+- backlight: container node for backlight following the binding
+   in video/backlight/sky81452-backlight.txt
+- regulator: container node for regulators following the binding
+   in regulator/sky81452-regulator.txt
+
+Example:
+
+   sky81452@2c {
+   compatible = "skyworks,sky81452";
+   reg = <0x2c>;
+
+   backlight {
+   compatible = "skyworks,sky81452-backlight";
+   name = "pwm-backlight";
+   led-sources = <0 1 2 3 6>;
+   skyworks,ignore-pwm;
+   skyworks,phase-shift;
+   skyworks,current-limit = <2300>;
+   };
+
+   regulator {
+   lout {
+   regulator-name = "sky81452-lout";
+   regulator-min-microvolt = <450>;
+   regulator-max-microvolt = <800>;
+   };
+   };
+   };
-- 
1.9.1

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


[PATCH v11 1/6] mfd: Add support for Skyworks SKY81452 driver

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

Signed-off-by: Gyungoh Yoo 
Acked-by: Lee Jones 
---
Changes v11:
Nothing

Changes v10:
Nothing

Changes v9:
Nothing

Changes v8:
Nothing

Changes v7:
Modified licensing text to GPLv2

Changes v6:
Added new line character at the end of line of dev_err()

Changes v5:
Move sky81452-backlight.h to include/linux/platform_data

Changes v4:
Removed MODULE_VERSION()
Modified license to GPLv2

Changes v3:
Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight'
Assigned mfd_cell.of_compatible for binding device node
Modified error messages

Changes v2:
Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452
Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452
Added message for exception or errors

 drivers/mfd/Kconfig  |  12 +
 drivers/mfd/Makefile |   1 +
 drivers/mfd/sky81452.c   | 108 +++
 include/linux/mfd/sky81452.h |  31 +
 4 files changed, 152 insertions(+)
 create mode 100644 drivers/mfd/sky81452.c
 create mode 100644 include/linux/mfd/sky81452.h

diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 38356e3..bc3b540 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -753,6 +753,18 @@ config MFD_SM501_GPIO
 lines on the SM501. The platform data is used to supply the
 base number for the first GPIO line to register.
 
+config MFD_SKY81452
+   tristate "Skyworks Solutions SKY81452"
+   select MFD_CORE
+   select REGMAP_I2C
+   depends on I2C
+   help
+ This is the core driver for the Skyworks SKY81452 backlight and
+ voltage regulator device.
+
+ This driver can also be built as a module.  If so, the module
+ will be called sky81452.
+
 config MFD_SMSC
bool "SMSC ECE1099 series chips"
depends on I2C=y
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 19f3d74..75b3ffb 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -178,6 +178,7 @@ obj-$(CONFIG_MFD_MENF21BMC) += menf21bmc.o
 obj-$(CONFIG_MFD_HI6421_PMIC)  += hi6421-pmic-core.o
 obj-$(CONFIG_MFD_DLN2) += dln2.o
 obj-$(CONFIG_MFD_RT5033)   += rt5033.o
+obj-$(CONFIG_MFD_SKY81452) += sky81452.o
 
 intel-soc-pmic-objs:= intel_soc_pmic_core.o intel_soc_pmic_crc.o
 obj-$(CONFIG_INTEL_SOC_PMIC)   += intel-soc-pmic.o
diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c
new file mode 100644
index 000..b0c9b04
--- /dev/null
+++ b/drivers/mfd/sky81452.c
@@ -0,0 +1,108 @@
+/*
+ * sky81452.c  SKY81452 MFD driver
+ *
+ * Copyright 2014 Skyworks Solutions Inc.
+ * Author : Gyungoh Yoo 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, see .
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static const struct regmap_config sky81452_config = {
+   .reg_bits = 8,
+   .val_bits = 8,
+};
+
+static int sky81452_probe(struct i2c_client *client,
+   const struct i2c_device_id *id)
+{
+   struct device *dev = >dev;
+   const struct sky81452_platform_data *pdata = dev_get_platdata(dev);
+   struct mfd_cell cells[2];
+   struct regmap *regmap;
+   int ret;
+
+   if (!pdata) {
+   pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
+   if (!pdata)
+   return -ENOMEM;
+   }
+
+   regmap = devm_regmap_init_i2c(client, _config);
+   if (IS_ERR(regmap)) {
+   dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap));
+   return PTR_ERR(regmap);
+   }
+
+   i2c_set_clientdata(client, regmap);
+
+   memset(cells, 0, sizeof(cells));
+   cells[0].name = "sky81452-backlight";
+   cells[0].of_compatible = "skyworks,sky81452-backlight";
+   cells[0].platform_data = pdata->bl_pdata;
+   cells[0].pdata_size = sizeof(*pdata->bl_pdata);
+   cells[1].name = "sky81452-regulator";
+   cells[1].platform_data = pdata->regulator_init_data;
+   cells[1].pdata_size = sizeof(*pdata->regulator_init_data);
+
+   ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL);
+   if (ret)
+   dev_err(dev, "failed to add child devices. err=%d\n", ret);
+
+   return ret;
+}
+
+static int sky81452_remove(struct i2c_client *client)
+{
+   mfd_remove_devices(>dev);
+   return 0;
+}
+
+static const struct i2c_device_id 

[PATCH v11 0/6] Add Skyworks SKY81452 device drivers

2015-02-26 Thread gyungoh
From: Gyungoh Yoo 

This patch set includes regulator and backlight driver for SKY81452.
Also it includes documents for device tree and module.
sky81452-regulator was already applied. So this series doesn't
include it.

v11:
Renamed 'skyworks,en-channels' property to led-sources.
Removed unused property 'skyworks,ovp-level'.

v10:
Removed trivial get_brightness implementations for sky81452-backlight

v9:
Removed the change to remove MODULE_VERSION() for sky81452-regulator

v8:
Renamed property names for backlight with vendor prefix
Modified gpio-enable property to generic property for GPIO
Made up the example for backlight DT
Changed the DT parsing of regulator using regulator_node and of_match

v7:
Modified licensing text to GPLv2
Split Kconfig renaming from DT patch

v6:
Added new line character at the end of line of dev_err()

v5:
Changed DT for regulator : 'lout' node should be defined under 'regulator'
Removed compatible string from sky81452-regulator driver
Modified sky81452-regulator to return EINVAL when of_node is NULL
Move sky81452-backlight.h to include/linux/platform_data

v4:
Removed MODULE_VERSION()
Modified license to GPLv2
Removed calling to backlight_device_unregister() in sky81452-backlight

v3:
Cleaned-up DBG messages
Cleaned-up DT
Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight'
Assigned mfd_cell.of_compatible for binding device node
Modified error messages
Modified sky81452-regulator to return ENODATA when of_node is NULL

v2:
Split the patches for each sub-system
Added 'reg' attribute for I2C address in device tree documents
Added 'compatible' attribute in child drivers
Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452
Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452
Added message for exception or errors.
Added vendor prefix for Skyworks Solutions, Inc.
Add SKY81452 to the Trivial Devices list

Gyungoh Yoo (6):
  mfd: Add support for Skyworks SKY81452 driver
  backlight: Add support Skyworks SKY81452 backlight driver
  devicetree: Add new SKY81452 mfd binding
  devicetree: Add new SKY81452 backlight binding
  devicetree: Add vendor prefix for Skyworks Solutions, Inc.
  devicetree: Add SKY81452 to the Trivial Devices list

 .../devicetree/bindings/i2c/trivial-devices.txt|   1 +
 Documentation/devicetree/bindings/mfd/sky81452.txt |  35 ++
 .../devicetree/bindings/vendor-prefixes.txt|   1 +
 .../video/backlight/sky81452-backlight.txt |  29 ++
 drivers/mfd/Kconfig|  12 +
 drivers/mfd/Makefile   |   1 +
 drivers/mfd/sky81452.c | 108 +++
 drivers/video/backlight/Kconfig|  10 +
 drivers/video/backlight/Makefile   |   1 +
 drivers/video/backlight/sky81452-backlight.c   | 353 +
 include/linux/mfd/sky81452.h   |  31 ++
 include/linux/platform_data/sky81452-backlight.h   |  46 +++
 12 files changed, 628 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt
 create mode 100644 
Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
 create mode 100644 drivers/mfd/sky81452.c
 create mode 100644 drivers/video/backlight/sky81452-backlight.c
 create mode 100644 include/linux/mfd/sky81452.h
 create mode 100644 include/linux/platform_data/sky81452-backlight.h

-- 
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: [ANNOUNCE] 3.18.7-rt1

2015-02-26 Thread Daniel Wagner
Hi Sebastian

On 02/26/2015 09:48 AM, Sebastian Andrzej Siewior wrote:
> * Sebastian Andrzej Siewior | 2015-02-25 14:55:01 [+0100]:
> +
> +static int thermal_notify_work_init(void)
> +{
> + int err;
> +
> + err = swork_get();
> + if (!err)
> + return err;

It think this should be:

if (err)
return err;


cheers,
daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 3/6] arm64: Kprobes with single stepping support

2015-02-26 Thread David Long
On 02/18/15 09:59, Masami Hiramatsu wrote:
> Hi,
> 
> (2015/02/18 8:11), David Long wrote:
>> From: Sandeepa Prabhu 
>>
>> Add support for basic kernel probes(kprobes) and jump probes
>> (jprobes) for ARM64.
>>
>> Kprobes will utilize software breakpoint and single step debug
>> exceptions supported on ARM v8.
>>
>> Software breakpoint is placed at the probe address to trap the
>> kernel execution into kprobe handler.
>>
>> ARM v8 supports single stepping to be enabled while exception return
>> (ERET) with next PC in exception return address (ELR_EL1). The
>> kprobe handler prepares an executable memory slot for out-of-line
>> execution with a copy of the original instruction being probed, and
>> enables single stepping from the instruction slot. With this scheme,
>> the instruction is executed with the exact same register context
>> 'except PC' that points to instruction slot.
>>
>> Debug mask(PSTATE.D) is enabled only when single stepping a recursive
> 
> Is that same as "debug flag" in the code commment?
> 

Yes. The description in the commit might benefit from a little rewording.

>> kprobe, e.g.: during kprobes reenter so that probed instruction can be
>> single stepped within the kprobe handler -exception- context.
>> The recursion depth of kprobe is always 2, i.e. upon probe re-entry,
>> any further re-entry is prevented by not calling handlers and the case
>> counted as a missed kprobe).
> 
> So, would this mean the debug mask is required for single-stepping
> in exception context by specification?
> 

Not positive I exactly understand the question but:

1) We can't single-step at all until we've both set the SS mode bit
(PSTATE.SS) and unmasked debug exceptions (PSTATE.D).  The debug
exception is normally masked.
2) PSTATE.D will be set at exception entry.
3) We can't single-step again until we RTE from the current single-step.

>>
>> Single stepping from slot has a drawback on PC-relative accesses
>> like branching and symbolic literals access as offset from new PC
>> (slot address) may not be ensured to fit in immediate value of
>> opcode. Such instructions needs simulation, so reject
>> probing such instructions.
> 
> BTW, since while the single stepping IRQs are disabled, does that
> also requires fixups for irq-mask loading instruction or something
> like that? (sorry, I'm not good at aarch64 ISA...)

No, we disable interrupts and reject probing of the special instructions
that could reenable them *or* read the current status (since the
single-step environment will likely see a different value for that bit).
 In previous patches I did not reject the reading of this bit.

> 
>> Instructions generating exceptions or cpu mode change are rejected,
>> and not allowed to insert probe for these instructions.
>>
>> Instructions using Exclusive Monitor are rejected too.
>>
>> System instructions are mostly enabled for stepping, except MSR
>> immediate that updates "daif" flags in PSTATE, which are not safe
>> for probing.
>>
>> Thanks to Steve Capper and Pratyush Anand for several suggested
>> Changes.
> 
> Ok, I have some comments on the code.
> 
> [...]
>> diff --git a/arch/arm64/kernel/kprobes.c b/arch/arm64/kernel/kprobes.c
>> new file mode 100644
>> index 000..1ead41f
>> --- /dev/null
>> +++ b/arch/arm64/kernel/kprobes.c
>> @@ -0,0 +1,551 @@
>> +/*
>> + * arch/arm64/kernel/kprobes.c
>> + *
>> + * Kprobes support for ARM64
>> + *
>> + * Copyright (C) 2013 Linaro Limited.
>> + * Author: Sandeepa Prabhu 
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 as
>> + * published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> + * General Public License for more details.
>> + *
>> + */
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "kprobes.h"
>> +#include "kprobes-arm64.h"
>> +
>> +#define MIN_STACK_SIZE(addr)min((unsigned long)MAX_STACK_SIZE,  
>> \
>> +(unsigned long)current_thread_info() + THREAD_START_SP - (addr))
>> +
>> +DEFINE_PER_CPU(struct kprobe *, current_kprobe) = NULL;
>> +DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk);
>> +
>> +static void __kprobes arch_prepare_ss_slot(struct kprobe *p)
>> +{
>> +/* prepare insn slot */
>> +p->ainsn.insn[0] = p->opcode;
>> +
>> +flush_icache_range((uintptr_t) (p->ainsn.insn),
>> +   (uintptr_t) (p->ainsn.insn) + MAX_INSN_SIZE);
>> +
>> +/*
>> + * Needs restoring of return address after stepping xol.
>> + */
>> +p->ainsn.restore.addr = (unsigned long) p->addr +
>> +  sizeof(kprobe_opcode_t);
>> +p->ainsn.restore.type = RESTORE_PC;
>> 

Re: [PATCH v6 1/3] dmaengine: Add support for APM X-Gene SoC DMA engine driver

2015-02-26 Thread Rameshwar Sahu
Hi


On Fri, Feb 27, 2015 at 9:39 AM, Rameshwar Sahu  wrote:
> Hi,
>
>
> On Thu, Feb 26, 2015 at 7:55 PM, Ben Dooks  wrote:
>> On 26/02/15 12:31, Rameshwar Sahu wrote:
>>> Hi Vinod,
>>>
>>>
>>> On Tue, Feb 24, 2015 at 6:23 PM, Rameshwar Prasad Sahu  
>>> wrote:
 This patch implements the APM X-Gene SoC DMA engine driver. The APM X-Gene
 SoC DMA engine consists of 4 DMA channels for performing DMA operations.
 These DMA operations include memory copy and scatter-gather memory copy
 offloading.

 Signed-off-by: Rameshwar Prasad Sahu 
 Signed-off-by: Loc Ho 
 ---
  drivers/dma/Kconfig |8 +
  drivers/dma/Makefile|1 +
  drivers/dma/xgene-dma.c | 1738 
 +++
  3 files changed, 1747 insertions(+)
  create mode 100755 drivers/dma/xgene-dma.c

 diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
 index a874b6e..0e05831 100644
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
 @@ -425,6 +425,14 @@ config IMG_MDC_DMA
 help
   Enable support for the IMG multi-threaded DMA controller (MDC).

 +config XGENE_DMA
 +   tristate "APM X-Gene DMA support"
 +   depends on ARCH_XGENE
 +   select DMA_ENGINE
 +   select ASYNC_TX_ENABLE_CHANNEL_SWITCH
 +   help
 + Enable support for the APM X-Gene SoC DMA engine.
 +
  config DMA_ENGINE
 bool

 diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
 index f915f61..06c1576 100644
 --- a/drivers/dma/Makefile
 +++ b/drivers/dma/Makefile
 @@ -51,3 +51,4 @@ obj-$(CONFIG_INTEL_MIC_X100_DMA) += mic_x100_dma.o
  obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
  obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o
  obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
 +obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
 diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
 new file mode 100755
 index 000..e736c2e
 --- /dev/null
 +++ b/drivers/dma/xgene-dma.c
 @@ -0,0 +1,1738 @@
 +/*
 + * Applied Micro X-Gene SoC DMA engine Driver
 + *
 + * Copyright (c) 2015, Applied Micro Circuits Corporation
 + * Authors: Rameshwar Prasad Sahu 
 + * Loc Ho 
 + *
 + * This program is free software; you can redistribute  it and/or modify 
 it
 + * under  the terms of  the GNU General  Public License as published by 
 the
 + * Free Software Foundation;  either version 2 of the  License, or (at 
 your
 + * option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program.  If not, see .
 + *
 + * NOTE: PM support is currently not available.
 + */
 +
 +#include 
 +#include 
 +#include 
 +#include 
 +#include 
 +#include 
 +#include 
 +#include 
 +#include 
 +
 +#include "dmaengine.h"
 +
 +/* DMA ring csr registers and bit definations */
 +#define DMA_RING_CONFIG0x04
 +#define DMA_RING_ENABLEBIT(31)
 +#define DMA_RING_ID0x08
 +#define DMA_RING_ID_SETUP(v)   ((v) | BIT(31))
 +#define DMA_RING_ID_BUF0x0C
 +#define DMA_RING_ID_BUF_SETUP(v)   (((v) << 9) | BIT(21))
 +#define DMA_RING_THRESLD0_SET1 0x30
 +#define DMA_RING_THRESLD0_SET1_VAL 0X64
 +#define DMA_RING_THRESLD1_SET1 0x34
 +#define DMA_RING_THRESLD1_SET1_VAL 0xC8
 +#define DMA_RING_HYSTERESIS0x68
 +#define DMA_RING_HYSTERESIS_VAL0x
 +#define DMA_RING_STATE 0x6C
 +#define DMA_RING_STATE_WR_BASE 0x70
 +#define DMA_RING_NE_INT_MODE   0x017C
 +#define DMA_RING_NE_INT_MODE_SET(m, v) \
 +   ((m) = ((m) & ~BIT(31 - (v))) | BIT(31 - (v)))
 +#define DMA_RING_NE_INT_MODE_RESET(m, v)   \
 +   ((m) &= (~BIT(31 - (v
 +#define DMA_RING_CLKEN 0xC208
 +#define DMA_RING_SRST  0xC200
 +#define DMA_RING_MEM_RAM_SHUTDOWN  0xD070
 +#define DMA_RING_BLK_MEM_RDY   0xD074
 +#define DMA_RING_BLK_MEM_RDY_VAL   0x
 +#define DMA_RING_DESC_CNT(v)   (((v) & 0x0001FFFE) >> 1)
 +#define DMA_RING_ID_GET(owner, num)(((owner) << 6) | (num))
 +#define DMA_RING_DST_ID(v) ((1 << 10) | (v))
 +#define DMA_RING_CMD_OFFSET0x2C
 +#define DMA_RING_CMD_BASE_OFFSET(v)((v) << 6)
 +#define 

RE: 0001-media-vb2-Fill-vb2_buffer-with-bytesused-from-user.patch; kernel version 3.10.69

2015-02-26 Thread Sudip JAIN
Thanks for your feedback. I will improve my patch submission.

BR,
Sudip

From: Jeremiah Mahler [jmmah...@gmail.com]
Sent: Thursday, February 26, 2015 10:39 PM
To: Sudip JAIN
Cc: linux-me...@vger.kernel.org; linux-kernel@vger.kernel.org
Subject: Re: 0001-media-vb2-Fill-vb2_buffer-with-bytesused-from-user.patch; 
kernel version 3.10.69

Sudip,

On Thu, Feb 26, 2015 at 01:18:31PM +0800, Sudip JAIN wrote:
> Hello Jeremiah,
>
> Please find the patch  "inline"
>
There are more problems than just not being "inline".

- The subject line wrong.
- The log message is formatted wrong.
- This patch is not in a form that can be applied.
- And there are probably more problems as well...

I would review how to submit patches and then try again.
I recommend watching the video by Greg Kroah-Hartman on how
to submit your first kernel patch [1].

  [1]: https://www.youtube.com/watch?v=LLBrBBImJt4

[...]

--
- Jeremiah Mahler
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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/7] kprobes: Disable Kprobe when ftrace arming fails

2015-02-26 Thread Masami Hiramatsu
(2015/02/27 1:13), Petr Mladek wrote:
> arm_kprobe_ftrace() could fail, especially after introducing ftrace IPMODIFY
> flag and LifePatching. But this situation is not properly handled.
> This patch adds the most important changes.

Hmm, as you know, I actually working on it to drop IPMODIFY from kprobes except 
jprobe.
however, yes, that is not enough. We might better set DISABLED flag as
this does.

> First, it does not make sense to register "kprobe_ftrace_ops" if the filter 
> was
> not set.
> 
> Second, we should remove the filter if the registration of "kprobe_ftrace_ops"
> fails. The failure might be caused by conflict between the Kprobe and
> a life patch via the IPMODIFY flag. If we remove the filter, we will allow
> to register "kprobe_ftrace_ops" for another non-conflicting Kprobe later.
> 
> Third, we need to make sure that "kprobe_ftrace_enabled" is incremented only
> when "kprobe_ftrace_ops" is successfully registered. Otherwise, another
> Kprobe will not try to register it again. Note that we could move the
> manipulation with this counter because it is accessed only under 
> "kprobe_mutex".
> 
> Four, we should mark the probe as disabled if the ftrace stuff is not usable.
> It will be the correct status. Also it will prevent the unregistration code
> from producing another failure.
> 
> It looks more safe to disable the Kprobe directly in "kprobe_ftrace_ops". Note
> that we need to disable also all listed Kprobes in case of an aggregated 
> probe.
> It would be enough to disable only the new one but we do not know which one it
> was. They should be in sync anyway.
> 

Acked-by: Masami Hiramatsu 

Thank you!

> Signed-off-by: Petr Mladek 
> ---
>  kernel/kprobes.c | 25 +
>  1 file changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/kprobes.c b/kernel/kprobes.c
> index ee619929cf90..d1b9db690b9c 100644
> --- a/kernel/kprobes.c
> +++ b/kernel/kprobes.c
> @@ -931,16 +931,33 @@ static int prepare_kprobe(struct kprobe *p)
>  /* Caller must lock kprobe_mutex */
>  static void arm_kprobe_ftrace(struct kprobe *p)
>  {
> + struct kprobe *kp;
>   int ret;
>  
>   ret = ftrace_set_filter_ip(_ftrace_ops,
>  (unsigned long)p->addr, 0, 0);
> - WARN(ret < 0, "Failed to arm kprobe-ftrace at %p (%d)\n", p->addr, ret);
> - kprobe_ftrace_enabled++;
> - if (kprobe_ftrace_enabled == 1) {
> + if (WARN(ret < 0,
> +  "Failed to arm kprobe-ftrace at %p (%d). The kprobe gets 
> disabled.\n",
> +  p->addr, ret))
> + goto err_filter;
> +
> + if (!kprobe_ftrace_enabled) {
>   ret = register_ftrace_function(_ftrace_ops);
> - WARN(ret < 0, "Failed to init kprobe-ftrace (%d)\n", ret);
> + if (WARN(ret < 0,
> +  "Failed to init kprobe-ftrace (%d). The probe at %p 
> gets disabled\n",
> +  ret, p->addr))
> + goto err_function;
>   }
> + kprobe_ftrace_enabled++;
> + return;
> +
> +err_function:
> + ftrace_set_filter_ip(_ftrace_ops, (unsigned long)p->addr, 1, 0);
> +err_filter:
> + p->flags |= KPROBE_FLAG_DISABLED;
> + if (kprobe_aggrprobe(p))
> + list_for_each_entry_rcu(kp, >list, list)
> + kp->flags |= KPROBE_FLAG_DISABLED;
>  }
>  
>  /* Caller must lock kprobe_mutex */
> 


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu...@hitachi.com


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] ARM: exynos_defconfig: Disable IOMMU support

2015-02-26 Thread Javier Martinez Canillas
Hello Kukjin,

On 02/17/2015 12:38 PM, Javier Martinez Canillas wrote:
> Enabling Exynos DRM IOMMU support for Exynos is currently broken and
> causes a BUG on exynos-iommu driver. This was not an issue since the
> options was disabled in exynos_defconfig but after commit 8dcc14f82f06
> ("drm/exynos: IOMMU support should not be selectable by user"), it is
> selected if EXYNOS_IOMMU is enabled which is in exynos_defconfig.
> 
> So a kernel built using exynos_defconfig after the mentioned commit
> fails to boot [0]. Disable IOMMU support in Exynos defconfig until
> things get sorted out.
> 
> [0]:
> [1.242183] [ cut here ]
> [1.246191] kernel BUG at drivers/iommu/exynos-iommu.c:481!
> [1.251747] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
> [1.257561] Modules linked in:
> [1.260603] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 
> 3.19.0-07478-g796e1c55717e #490
> [1.268412] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
> [1.274489] task: ee06c000 ti: ee05a000 task.ti: ee05a000
> [1.279874] PC is at __exynos_sysmmu_enable+0x184/0x190
> [1.285080] LR is at exynos_iommu_attach_device+0x44/0xb0
> [1.290461] pc : []lr : []psr: 6193
> [1.290461] sp : ee05bcf8  ip :   fp : ed84aa40
> [1.301916] r10: ed84a890  r9 : a113  r8 : 6db3
> [1.307125] r7 : ed84aa40  r6 :   r5 :   r4 : ee174e10
> [1.313635] r3 : 6db3  r2 : ed84aa40  r1 : 6db3  r0 : ee174e10
> [1.320147] Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment 
> kernel
> [1.327524] Control: 10c5387d  Table: 4000406a  DAC: 0015
> [1.333252] Process swapper/0 (pid: 1, stack limit = 0xee05a210)
> [1.339241] Stack: (0xee05bcf8 to 0xee05c000)
> [1.343581] bce0:   
> 6db3 ee174e10
> [1.351741] bd00: ed84a880  ed84aa40 ee174e10 a113 ed84a890 
>  c0254a64
> [1.359900] bd20:  6db3 ee174e10 ed84adc0 0005 0034 
> 0001 c0692c1c
> [1.368059] bd40: 0097 c02526c8 ee29f050 c0017210 ee29f050 ee174e10 
> edab6810 c0282558
> [1.376219] bd60: edab6a10 ee1cb000 0005 c0283520 ee29f240 c028f210 
> edab6810 ee2ef280
> [1.384378] bd80: edb24680 ed84a680 ee1cb000 c02883f8 edab6810 ee1cb000 
> ee1cb000 
> [1.392537] bda0: ed84a680 ee2ef450  c027e968 ee1cb000  
>  c0268fd4
> [1.400696] bdc0: edab6800 c06b0de4 ee1cb000 c026a8bc ee2ef0c0 c028f210 
> 0002 ee2ef460
> [1.408855] bde0: ee2ef460 0002 ee2ef280 c0288728 c04af5d0 edab6810 
> ee2ef280 
> [1.417014] be00: c06b1348 c0288918 c06b0f00 c06b0f00 edab6810 0001 
> c06b0da0 c027eaf4
> [1.425173] be20: c070334c edaee190  edab6810 ffed c06b0da0 
>  c028da1c
> [1.42] be40: edab6810 c070334c  c028c5f8 edab6810 c06b0da0 
> edab6844 
> [1.441492] be60: eda3c740 c028c7a4 c06b0da0  c028c718 c028af74 
> ee005274 ee3b7b40
> [1.449652] be80: c06b0da0 ee3b7680 c06b1540 c028bde4 c05b6990 c06b0da0 
> c0703324 c06b0da0
> [1.457811] bea0: c0703324  c069ab18 c028cdc4   
> c0703324 c027ebd8
> [1.465970] bec0:  c05b6990     
>  c00c4574
> [1.474129] bee0:   c069ab18 c027eb1c  c069ab18 
> c069ab18 c0008944
> [1.482288] bf00: 0036 c04770e8 ee049800 c06eace0 ee06c000 6113 
> c069eab0 
> [1.490447] bf20:  c069eab0 6113  ef7fcabc ef7fcaae 
> c061c594 c0038640
> [1.498607] bf40: c05cb1d0 c061bc24 0006 0006 c069ea50 c06724d4 
> 0006 c06724b4
> [1.506766] bf60: c06c7600 c0647588 c0692c1c 0097  c0647d40 
> 0006 0006
> [1.514925] bf80: c0647588 c003d2d8  c046921c   
>  
> [1.523084] bfa0:  c0469224  c000e680   
>  
> [1.531243] bfc0:       
>  
> [1.539402] bfe0:     0013  
>  
> [1.547567] [] (__exynos_sysmmu_enable) from [] 
> (exynos_iommu_attach_device+0x44/0xb0)
> [1.557199] [] (exynos_iommu_attach_device) from [] 
> (iommu_attach_device+0x18/0x24)
> [1.566576] [] (iommu_attach_device) from [] 
> (arm_iommu_attach_device+0x18/0x50)
> [1.575690] [] (arm_iommu_attach_device) from [] 
> (drm_iommu_attach_device+0x50/0xb4)
> [1.585150] [] (drm_iommu_attach_device) from [] 
> (fimd_bind+0x94/0x1b8)
> [1.593483] [] (fimd_bind) from [] 
> (component_bind_all+0xb4/0x214)
> [1.601380] [] (component_bind_all) from [] 
> (exynos_drm_load+0x9c/0x13c)
> [1.609802] [] (exynos_drm_load) from [] 
> (drm_dev_register+0xa0/0xf4)
> [1.617960] [] (drm_dev_register) from [] 
> (drm_platform_init+0x44/0xcc)
> [ 

Re: [patch] mm, mempolicy: migrate_to_node should only migrate to node

2015-02-26 Thread Naoya Horiguchi
On Tue, Feb 24, 2015 at 03:18:06PM -0800, David Rientjes wrote:
> migrate_to_node() is intended to migrate a page from one source node to a 
> target node.
> 
> Today, migrate_to_node() could end up migrating to any node, not only the 
> target node.  This is because the page migration allocator, 
> new_node_page() does not pass __GFP_THISNODE to alloc_pages_exact_node().  
> This causes the target node to be preferred but allows fallback to any 
> other node in order of affinity.
> 
> Prevent this by allocating with __GFP_THISNODE.  If memory is not 
> available, -ENOMEM will be returned as appropriate.
> 
> Signed-off-by: David Rientjes 

Make sense to me.

Reviewed-by: Naoya Horiguchi --
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 0/5] split ET_DYN ASLR from mmap ASLR

2015-02-26 Thread Ingo Molnar

* Kees Cook  wrote:

> This separates ET_DYN ASLR from mmap ASLR, as already 
> done on s390. The various architectures that are already 
> randomizing mmap (arm, arm64, mips, powerpc, s390, and 
> x86), have their various forms of arch_mmap_rnd() made 
> available via the new CONFIG_ARCH_HAS_ELF_RANDOMIZE. For 
> these architectures, arch_randomize_brk() is collapsed as 
> well.
> 
> This is an alternative to the solutions in: 
> https://lkml.org/lkml/2015/2/23/442

Nice!

Acked-by: Ingo Molnar 

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: linux-next: build failure after merge of the rcu tree

2015-02-26 Thread Paul E. McKenney
On Fri, Feb 27, 2015 at 01:18:56PM +1100, Stephen Rothwell wrote:
> Hi Paul,
> 
> After merging the rcu tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> arch/x86/xen/smp.c: In function 'xen_cpu_up':
> arch/x86/xen/smp.c:460:6: error: 'err' undeclared (first use in this function)
>   if (err)
>   ^
> 
> Caused by commit b92c23b083d6 ("x86: Use common
> outgoing-CPU-notification code").
> 
> I have used the rcu tree from next-20150226 for today.

Apologies for the hassle!  I have fixed this.

Thanx, Paul

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


RE: [RFC] mm: change mm_advise_free to clear page dirty

2015-02-26 Thread Wang, Yalin
> -Original Message-
> From: Minchan Kim [mailto:minchan@gmail.com] On Behalf Of Minchan Kim
> Sent: Friday, February 27, 2015 1:28 PM
> To: Wang, Yalin
> Cc: Michal Hocko; Andrew Morton; linux-kernel@vger.kernel.org; linux-
> m...@kvack.org; Rik van Riel; Johannes Weiner; Mel Gorman; Shaohua Li
> Subject: Re: [RFC] mm: change mm_advise_free to clear page dirty
> 
> Hello,
> 
> On Fri, Feb 27, 2015 at 11:37:18AM +0800, Wang, Yalin wrote:
> > This patch add ClearPageDirty() to clear AnonPage dirty flag,
> > the Anonpage mapcount must be 1, so that this page is only used by
> > the current process, not shared by other process like fork().
> > if not clear page dirty for this anon page, the page will never be
> > treated as freeable.
> 
> In case of anonymous page, it has PG_dirty when VM adds it to
> swap cache and clear it in clear_page_dirty_for_io. That's why
> I added ClearPageDirty if we found it in swapcache.
> What case am I missing? It would be better to understand if you
> describe specific scenario.
> 
> Thanks.
> 
> >
> > Signed-off-by: Yalin Wang 
> > ---
> >  mm/madvise.c | 15 +--
> >  1 file changed, 5 insertions(+), 10 deletions(-)
> >
> > diff --git a/mm/madvise.c b/mm/madvise.c
> > index 6d0fcb8..257925a 100644
> > --- a/mm/madvise.c
> > +++ b/mm/madvise.c
> > @@ -297,22 +297,17 @@ static int madvise_free_pte_range(pmd_t *pmd,
> unsigned long addr,
> > continue;
> >
> > page = vm_normal_page(vma, addr, ptent);
> > -   if (!page)
> > +   if (!page || !PageAnon(page) || !trylock_page(page))
> > continue;
> >
> > if (PageSwapCache(page)) {
> > -   if (!trylock_page(page))
> > +   if (!try_to_free_swap(page))
> > continue;
> > -
> > -   if (!try_to_free_swap(page)) {
> > -   unlock_page(page);
> > -   continue;
> > -   }
> > -
> > -   ClearPageDirty(page);
> > -   unlock_page(page);
> > }
> >
> > +   if (page_mapcount(page) == 1)
> > +   ClearPageDirty(page);
> > +   unlock_page(page);
> > /*
> >  * Some of architecture(ex, PPC) don't update TLB
> >  * with set_pte_at and tlb_remove_tlb_entry so for
> > --
Yes, for page which is in SwapCache, it is correct,
But for anon page which is not in SwapCache, it is always
PageDirty(), so we should also clear dirty bit to make it freeable,

Another problem  is that if an anon page is shared by more than one process,
This happened when fork(), the anon page will be copy on write,
In this case, we should not clear page dirty,
Otherwise, other process will get zero page if the page is freed by reclaim 
path,
This is not correct for other process which don't call MADV_FREE syscall.

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/


[RFC PATCH] ARM64: cmpxchg.h: Clear the exclusive access bit on fail

2015-02-26 Thread Pranith Kumar
In cmpxchg(), we do a load exclusive on an address and upon a comparison fail,
we skip the store exclusive instruction. This can result in the exclusive bit
still set. If there was a store exclusive after this to the same address, that
will see the exclusive bit set. This should not happen.

We need to clear the exclusive bit in these cases.

Signed-off-by: Pranith Kumar 
---
 arch/arm64/include/asm/cmpxchg.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h
index cb95930..ed2cf90 100644
--- a/arch/arm64/include/asm/cmpxchg.h
+++ b/arch/arm64/include/asm/cmpxchg.h
@@ -94,7 +94,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, 
unsigned long old,
"   cmp %w1, %w3\n"
"   b.ne1f\n"
"   stxrb   %w0, %w4, %2\n"
-   "1:\n"
+   "1: clrex\n"
: "=" (res), "=" (oldval), "+Q" (*(u8 *)ptr)
: "Ir" (old), "r" (new)
: "cc");
@@ -109,7 +109,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, 
unsigned long old,
"   cmp %w1, %w3\n"
"   b.ne1f\n"
"   stxrh   %w0, %w4, %2\n"
-   "1:\n"
+   "1: clrex\n"
: "=" (res), "=" (oldval), "+Q" (*(u16 
*)ptr)
: "Ir" (old), "r" (new)
: "cc");
@@ -124,7 +124,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, 
unsigned long old,
"   cmp %w1, %w3\n"
"   b.ne1f\n"
"   stxr%w0, %w4, %2\n"
-   "1:\n"
+   "1: clrex\n"
: "=" (res), "=" (oldval), "+Q" (*(u32 
*)ptr)
: "Ir" (old), "r" (new)
: "cc");
@@ -139,7 +139,7 @@ static inline unsigned long __cmpxchg(volatile void *ptr, 
unsigned long old,
"   cmp %1, %3\n"
"   b.ne1f\n"
"   stxr%w0, %4, %2\n"
-   "1:\n"
+   "1: clrex\n"
: "=" (res), "=" (oldval), "+Q" (*(u64 
*)ptr)
: "Ir" (old), "r" (new)
: "cc");
@@ -173,7 +173,7 @@ static inline int __cmpxchg_double(volatile void *ptr1, 
volatile void *ptr2,
"   mov %w0, #0\n"
"   cbnz%1, 1f\n"
"   stxp%w0, %5, %6, %2\n"
-   "1:\n"
+   "1: clrex\n"
: "="(loop), "="(lost), "+Q" (*(u64 *)ptr1)
: "r" (old1), "r"(old2), "r"(new1), "r"(new2));
} while (loop);
-- 
1.9.1

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


[PATCH net-next] wireless: test sscanf return values

2015-02-26 Thread Joe Perches
At some point, it'd be good to make sscanf use __must_check
so make sure the net/ uses of sscanf use the return value.

Signed-off-by: Joe Perches 
---

Compiled, untested.

 net/mac80211/debugfs.c | 4 ++--
 net/wireless/core.c| 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index eeb0bbd..0e44be7 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -160,9 +160,9 @@ static ssize_t sta_tx_latency_stat_write(struct file *file,
tx_latency->n_ranges = n_ranges;
for (i = 0; i < n_ranges; i++) { /* setting bin ranges */
token = strsep(, TX_LATENCY_BIN_DELIMTER_S);
-   sscanf(token, "%d", _latency->ranges[i]);
/* bins values should be in ascending order */
-   if (prev_bin >= tx_latency->ranges[i]) {
+   if (sscanf(token, "%d", _latency->ranges[i]) != 1 ||
+   prev_bin >= tx_latency->ranges[i]) {
ret = -EINVAL;
kfree(tx_latency);
goto unlock;
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 3af0ecf..69a350e 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -95,8 +95,8 @@ static int cfg80211_dev_check_name(struct 
cfg80211_registered_device *rdev,
ASSERT_RTNL();
 
/* prohibit calling the thing phy%d when %d is not its number */
-   sscanf(newname, PHY_NAME "%d%n", _idx, );
-   if (taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) {
+   if (sscanf(newname, PHY_NAME "%d%n", _idx, ) == 1 &&
+   taken == strlen(newname) && wiphy_idx != rdev->wiphy_idx) {
/* count number of places needed to print wiphy_idx */
digits = 1;
while (wiphy_idx /= 10)


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


[PATCH 1/3] platform/chrome: cros_ec_lpc - Include linux/io.h header file

2015-02-26 Thread Javier Martinez Canillas
The driver uses the inb() and outb() I/O functions so should
include the header file that has these functions definitions.

This patch fixes the following error when the header is not
explicitly included:

drivers/platform/chrome//cros_ec_lpc.c: In function ‘ec_response_timed_out’:
drivers/platform/chrome//cros_ec_lpc.c:40:3: error: implicit declaration of 
function ‘inb’ [-Werror=implicit-function-declaration]
drivers/platform/chrome//cros_ec_lpc.c: In function ‘cros_ec_cmd_xfer_lpc’:
drivers/platform/chrome//cros_ec_lpc.c:75:3: error: implicit declaration of 
function ‘outb’ [-Werror=implicit-function-declaration]

Signed-off-by: Javier Martinez Canillas 
---
 drivers/platform/chrome/cros_ec_lpc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c 
b/drivers/platform/chrome/cros_ec_lpc.c
index 822fdb36ded9..f00bf4d246a1 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -23,6 +23,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
-- 
2.1.3

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


[PATCH 3/3] platform/chrome: cros_ec_lpc - Drop owner assignment

2015-02-26 Thread Javier Martinez Canillas
Platform drivers don't need to set an owner
since it will be populated by the driver core.

Signed-off-by: Javier Martinez Canillas 
---
 drivers/platform/chrome/cros_ec_lpc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/platform/chrome/cros_ec_lpc.c 
b/drivers/platform/chrome/cros_ec_lpc.c
index f00bf4d246a1..8f9ac4d7bbd0 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -270,7 +270,6 @@ MODULE_DEVICE_TABLE(dmi, cros_ec_lpc_dmi_table);
 static struct platform_driver cros_ec_lpc_driver = {
.driver = {
.name = DRV_NAME,
-   .owner = THIS_MODULE,
},
.probe = cros_ec_lpc_probe,
.remove = cros_ec_lpc_remove,
-- 
2.1.3

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


[PATCH 0/3] platform/chrome: cros_ec_lpc - Build fixes

2015-02-26 Thread Javier Martinez Canillas
Hello Olof,

This series adds a set of trivial fixes for build issues with the
cros_ec_lpc driver that were reported by Fengguang Wu's build bot.

It is composed of the following patches:

Javier Martinez Canillas (3):
  platform/chrome: cros_ec_lpc - Include linux/io.h header file
  platform/chrome: cros_ec_lpc - Depend on X86 || COMPILE_TEST
  platform/chrome: cros_ec_lpc - Drop owner assignment

 drivers/platform/chrome/Kconfig   | 2 +-
 drivers/platform/chrome/cros_ec_lpc.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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/


[PATCH 2/3] platform/chrome: cros_ec_lpc - Depend on X86 || COMPILE_TEST

2015-02-26 Thread Javier Martinez Canillas
The Low Pin Count bus was introduced by Intel and is only used
in x86 computers so it should depend on the X86 Kconfig option.

But also build the driver if the COMPILE_TEST option is enabled
to have build coverage in other architectures.

Signed-off-by: Javier Martinez Canillas 
---
 drivers/platform/chrome/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/chrome/Kconfig b/drivers/platform/chrome/Kconfig
index d4befbffae85..2a6531a5fde8 100644
--- a/drivers/platform/chrome/Kconfig
+++ b/drivers/platform/chrome/Kconfig
@@ -49,7 +49,7 @@ config CROS_EC_CHARDEV
 
 config CROS_EC_LPC
 tristate "ChromeOS Embedded Controller (LPC)"
-depends on MFD_CROS_EC
+depends on MFD_CROS_EC && (X86 || COMPILE_TEST)
 help
   If you say Y here, you get support for talking to the ChromeOS EC
   over an LPC bus. This uses a simple byte-level protocol with a
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] mm: change mm_advise_free to clear page dirty

2015-02-26 Thread Minchan Kim
Hello,

On Fri, Feb 27, 2015 at 11:37:18AM +0800, Wang, Yalin wrote:
> This patch add ClearPageDirty() to clear AnonPage dirty flag,
> the Anonpage mapcount must be 1, so that this page is only used by
> the current process, not shared by other process like fork().
> if not clear page dirty for this anon page, the page will never be
> treated as freeable.

In case of anonymous page, it has PG_dirty when VM adds it to
swap cache and clear it in clear_page_dirty_for_io. That's why
I added ClearPageDirty if we found it in swapcache.
What case am I missing? It would be better to understand if you
describe specific scenario.

Thanks.

> 
> Signed-off-by: Yalin Wang 
> ---
>  mm/madvise.c | 15 +--
>  1 file changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 6d0fcb8..257925a 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -297,22 +297,17 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned 
> long addr,
>   continue;
>  
>   page = vm_normal_page(vma, addr, ptent);
> - if (!page)
> + if (!page || !PageAnon(page) || !trylock_page(page))
>   continue;
>  
>   if (PageSwapCache(page)) {
> - if (!trylock_page(page))
> + if (!try_to_free_swap(page))
>   continue;
> -
> - if (!try_to_free_swap(page)) {
> - unlock_page(page);
> - continue;
> - }
> -
> - ClearPageDirty(page);
> - unlock_page(page);
>   }
>  
> + if (page_mapcount(page) == 1)
> + ClearPageDirty(page);
> + unlock_page(page);
>   /*
>* Some of architecture(ex, PPC) don't update TLB
>* with set_pte_at and tlb_remove_tlb_entry so for
> -- 
> 2.2.2
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majord...@kvack.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: mailto:"d...@kvack.org;> em...@kvack.org 

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 0/7] platform/chrome: Add user-space dev inferface support

2015-02-26 Thread Javier Martinez Canillas
Hello,

On 02/27/2015 01:11 AM, Olof Johansson wrote:
> On Thu, Feb 26, 2015 at 3:35 PM, Gwendal Grignou  wrote:
>> Tested-by: Gwendal Grignou 
>> Reviewed-by: Gwendal Grignou 
>>
>> Tested on a chromebook pixel with kernel 4.0.0-rc1 and ectool using
>> the enclosed patch in chromiumos platform/ec tree.
>> I checked the lightbar is working, check the calls with "strace ectool
>> ...", check the sysfs interface calls.
> 
> 
> Thanks Gwendal.
>

Thanks a lot Gwendal for testing
 
> Series has been applied and pushed out to for-next now.
> 
> Thanks all. Bring on the next batch. Javier!
>

Thanks, Fengguang's build bot found a couple of issues
though so I'll post the fixes for those now.
 
> 
> -Olof
> 

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] x86, traps: maps all IDTs to fixmap area.

2015-02-26 Thread Wang Nan
On 2015/2/27 2:31, Andy Lutomirski wrote:
> On Thu, Feb 26, 2015 at 8:45 AM, Kees Cook  wrote:
>> On Thu, Feb 26, 2015 at 7:17 AM, Andy Lutomirski  wrote:
>>> On Wed, Feb 25, 2015 at 11:06 PM, Wang Nan  wrote:
 The reason why mapping idt_table to fixmap area should also be applied
 to debug_idt_table and trace_idt_table. This patch does same thing for
 all IDTs.

 Signed-off-by: Wang Nan 
 ---

 I believe trace_idt_table and debug_idt_table should be symmetrical with
 idt_table. However, Like my previous patch 'x86, traps: install gates
 using IST after cpu_init()', I'm not sure whether this is a practical
 fix.
>>>
>>> It shouldn't matter, since we should never enter userspace with these
>>> IDTs loaded.
>>>
>>> --Andy
>>>
>>> [patch kept below for Kees' benefit]
>>
>> Is there a reason to use fixmap entries for these IDTs? Or rather, is
>> there a situation where these IDTs are ever visible to userspace? (The
>> reason to use the fixmap is to hide their "true" location from
>> userspace.)
> 
> There's also the F00F workaround, which IIRC we get for free by using
> the fixmap, but that also shouldn't matter here.
> 

What about a flaw module triggering the F00F bug in kernel space? Instead of
kernel panic, the system will hang. I think tis should be a case for which
my patch can help. However, the trigger condition is critical.

>>
>> -Kees
>>
>>>

 ---
  arch/x86/include/asm/fixmap.h |  6 ++
  arch/x86/kernel/tracepoint.c  |  2 +-
  arch/x86/kernel/traps.c   | 13 +++--
  arch/x86/xen/mmu.c|  6 ++
  4 files changed, 24 insertions(+), 3 deletions(-)

 diff --git a/arch/x86/include/asm/fixmap.h b/arch/x86/include/asm/fixmap.h
 index f80d700..79550f4 100644
 --- a/arch/x86/include/asm/fixmap.h
 +++ b/arch/x86/include/asm/fixmap.h
 @@ -90,6 +90,12 @@ enum fixed_addresses {
 FIX_IO_APIC_BASE_END = FIX_IO_APIC_BASE_0 + MAX_IO_APICS - 1,
  #endif
 FIX_RO_IDT, /* Virtual mapping for read-only IDT */
 +#ifdef CONFIG_X86_64
 +   FIX_RO_DEBUG_IDT,   /* Virtual mapping for read-only 
 debug_idt_table */
 +#endif
 +#ifdef CONFIG_TRACING
 +   FIX_RO_TRACE_IDT,   /* Virtual mapping for read-only 
 trace_idt_table */
 +#endif
  #ifdef CONFIG_X86_32
 FIX_KMAP_BEGIN, /* reserved pte's for temporary kernel mappings */
 FIX_KMAP_END = FIX_KMAP_BEGIN+(KM_TYPE_NR*NR_CPUS)-1,
 diff --git a/arch/x86/kernel/tracepoint.c b/arch/x86/kernel/tracepoint.c
 index 1c113db..296e130 100644
 --- a/arch/x86/kernel/tracepoint.c
 +++ b/arch/x86/kernel/tracepoint.c
 @@ -12,7 +12,7 @@ atomic_t trace_idt_ctr = ATOMIC_INIT(0);
  struct desc_ptr trace_idt_descr = { NR_VECTORS * 16 - 1,
 (unsigned long) trace_idt_table };

 -/* No need to be aligned, but done to keep all IDTs defined the same way. 
 */
 +/* Must be page-aligned because the real IDT is used in a fixmap. */
  gate_desc trace_idt_table[NR_VECTORS] __page_aligned_bss;

  static int trace_irq_vector_refcount;
 diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
 index cf7898e..6d88c37 100644
 --- a/arch/x86/kernel/traps.c
 +++ b/arch/x86/kernel/traps.c
 @@ -67,7 +67,7 @@
  #include 
  #include 

 -/* No need to be aligned, but done to keep all IDTs defined the same way. 
 */
 +/* Must be page-aligned because the real IDT is used in a fixmap. */
  gate_desc debug_idt_table[NR_VECTORS] __page_aligned_bss;
  #else
  #include 
 @@ -998,9 +998,18 @@ void __init trap_init(void)
  * Set the IDT descriptor to a fixed read-only location, so that 
 the
  * "sidt" instruction will not leak the location of the kernel, and
  * to defend the IDT against arbitrary memory write 
 vulnerabilities.
 -* It will be reloaded in cpu_init() */
 +* It will be reloaded in cpu_init()
 +*/
 __set_fixmap(FIX_RO_IDT, __pa_symbol(idt_table), PAGE_KERNEL_RO);
 idt_descr.address = fix_to_virt(FIX_RO_IDT);
 +#ifdef CONFIG_X86_64
 +   __set_fixmap(FIX_RO_DEBUG_IDT, __pa_symbol(debug_idt_table), 
 PAGE_KERNEL_RO);
 +   debug_idt_descr.address = fix_to_virt(FIX_RO_DEBUG_IDT);
 +#endif
 +#ifdef CONFIG_TRACING
 +   __set_fixmap(FIX_RO_TRACE_IDT, __pa_symbol(trace_idt_table), 
 PAGE_KERNEL_RO);
 +   trace_idt_descr.address = fix_to_virt(FIX_RO_TRACE_IDT);
 +#endif

 /*
  * Should be a barrier for any external CPU state:
 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
 index adca9e2..1fd4a4c 100644
 --- a/arch/x86/xen/mmu.c
 +++ b/arch/x86/xen/mmu.c
 @@ -1984,6 +1984,12 @@ static void xen_set_fixmap(unsigned idx, 
 

Re: [PATCH] qla2xxx: Fix trivial typos in ql_log message

2015-02-26 Thread Saurav Kashyap
Acked-by: Saurav Kashyap 


>Change 'Fimware' to 'Firmware'
>Change 'enalbled' to 'enabled'
>
>Signed-off-by: Yannick Guerrini 
>---
> drivers/scsi/qla2xxx/qla_init.c | 4 ++--
> drivers/scsi/qla2xxx/qla_mid.c  | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/scsi/qla2xxx/qla_init.c
>b/drivers/scsi/qla2xxx/qla_init.c
>index e59f25b..5bb57c5 100644
>--- a/drivers/scsi/qla2xxx/qla_init.c
>+++ b/drivers/scsi/qla2xxx/qla_init.c
>@@ -5364,7 +5364,7 @@ qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t
>*srisc_addr)
>   blob = qla2x00_request_firmware(vha);
>   if (!blob) {
>   ql_log(ql_log_info, vha, 0x0083,
>-  "Fimware image unavailable.\n");
>+  "Firmware image unavailable.\n");
>   ql_log(ql_log_info, vha, 0x0084,
>   "Firmware images can be retrieved from: "QLA_FW_URL ".\n");
>   return QLA_FUNCTION_FAILED;
>@@ -5467,7 +5467,7 @@ qla24xx_load_risc_blob(scsi_qla_host_t *vha,
>uint32_t *srisc_addr)
>   blob = qla2x00_request_firmware(vha);
>   if (!blob) {
>   ql_log(ql_log_warn, vha, 0x0090,
>-  "Fimware image unavailable.\n");
>+  "Firmware image unavailable.\n");
>   ql_log(ql_log_warn, vha, 0x0091,
>   "Firmware images can be retrieved from: "
>   QLA_FW_URL ".\n");
>diff --git a/drivers/scsi/qla2xxx/qla_mid.c
>b/drivers/scsi/qla2xxx/qla_mid.c
>index 5c2e031..ca3804e 100644
>--- a/drivers/scsi/qla2xxx/qla_mid.c
>+++ b/drivers/scsi/qla2xxx/qla_mid.c
>@@ -788,7 +788,7 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha,
>uint16_t options,
>   rsp->msix = >msix_entries[que_id + 1];
>   else
>   ql_log(ql_log_warn, base_vha, 0x00e3,
>-  "MSIX not enalbled.\n");
>+  "MSIX not enabled.\n");
> 
>   ha->rsp_q_map[que_id] = rsp;
>   rsp->rid = rid;
>-- 
>1.9.5.msysgit.0
>

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


Re: [PATCH v2 3/3] efi: Capsule update with user helper interface

2015-02-26 Thread Roy Franz
On Sun, Nov 2, 2014 at 7:07 PM, Kweh Hock Leong
 wrote:
> From: "Kweh, Hock Leong" 
>
> Introducing a kernel module to expose user helper interface for
> user to upload capsule binaries. This module leverage the
> request_firmware_nowait() to expose an interface to user.
>
> Example steps to load the capsule binary:
> 1.) echo 1 > /sys/class/firmware/efi-capsule-file/loading
> 2.) cat capsule.bin > /sys/class/firmware/efi-capsule-file/data
> 3.) echo 0 > /sys/class/firmware/efi-capsule-file/loading
>
> Whereas, this module does not allow the capsule binaries to be
> obtained from the request_firmware library search path. If any
> capsule binary loaded from firmware seach path, the module will
> stop functioning.
>
> Besides the request_firmware user helper interface, this module
> also expose a 'capsule_loaded' file note for user to verify
> the number of successfully uploaded capsule binaries. This
> file note has the read only attribute.
>
> Cc: Matt Fleming 
> Signed-off-by: Kweh, Hock Leong 
> ---
>  drivers/firmware/efi/Kconfig   |   13 ++
>  drivers/firmware/efi/Makefile  |1 +
>  drivers/firmware/efi/efi-capsule-user-helper.c |  246 
> 
>  3 files changed, 260 insertions(+)
>  create mode 100644 drivers/firmware/efi/efi-capsule-user-helper.c
>
> diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig
> index f712d47..7dc814e 100644
> --- a/drivers/firmware/efi/Kconfig
> +++ b/drivers/firmware/efi/Kconfig
> @@ -60,6 +60,19 @@ config EFI_RUNTIME_WRAPPERS
>  config EFI_ARMSTUB
> bool
>
> +config EFI_CAPSULE_USER_HELPER
> +   tristate "EFI capsule user mode helper"
> +   depends on EFI
> +   select FW_LOADER
> +   select FW_LOADER_USER_HELPER
> +   help
> + This option exposes the user mode helper interface for user to load
> + EFI capsule binary and update the EFI firmware after system reboot.
> + This feature does not support auto locating capsule binaries at the
> + firmware lib search path.
> +
> + If unsure, say N.
> +
>  endmenu
>
>  config UEFI_CPER
> diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
> index 698846e..63f6910 100644
> --- a/drivers/firmware/efi/Makefile
> +++ b/drivers/firmware/efi/Makefile
> @@ -8,3 +8,4 @@ obj-$(CONFIG_UEFI_CPER) += cper.o
>  obj-$(CONFIG_EFI_RUNTIME_MAP)  += runtime-map.o
>  obj-$(CONFIG_EFI_RUNTIME_WRAPPERS) += runtime-wrappers.o
>  obj-$(CONFIG_EFI_STUB) += libstub/
> +obj-$(CONFIG_EFI_CAPSULE_USER_HELPER)  += efi-capsule-user-helper.o
> diff --git a/drivers/firmware/efi/efi-capsule-user-helper.c 
> b/drivers/firmware/efi/efi-capsule-user-helper.c
> new file mode 100644
> index 000..84a1628
> --- /dev/null
> +++ b/drivers/firmware/efi/efi-capsule-user-helper.c
> @@ -0,0 +1,246 @@
> +/*
> + * EFI capsule user mode helper interface driver.
> + *
> + * Copyright 2014 Intel Corporation
> + *
> + * This file is part of the Linux kernel, and is made available under
> + * the terms of the GNU General Public License version 2.
> + */
> +
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#define CAPSULE_NAME "efi-capsule-file"
> +#define DEV_NAME "efi_capsule_user_helper"
> +#define STRING_INTEGER_MAX_LENGTH 13
> +
> +static DEFINE_MUTEX(user_helper_lock);
> +static int capsule_count;
> +static int stop_request;
> +static struct platform_device *efi_capsule_pdev;
> +
> +/*
> + * This function will store the capsule binary and pass it to
> + * efi_capsule_update() API in capsule.c
> + */
> +static int efi_capsule_store(const struct firmware *fw)
> +{
> +   int i;
> +   int ret;
> +   int count = fw->size;
> +   int copy_size = (fw->size > PAGE_SIZE) ? PAGE_SIZE : fw->size;
> +   int pages_needed = ALIGN(fw->size, PAGE_SIZE) >> PAGE_SHIFT;
> +   struct page **pages;
> +   void *page_data;
> +   efi_capsule_header_t *capsule = NULL;
> +
> +   pages = kmalloc_array(pages_needed, sizeof(void *), GFP_KERNEL);
> +   if (!pages) {
> +   pr_err("%s: kmalloc_array() failed\n", __func__);
> +   return -ENOMEM;
> +   }
> +
> +   for (i = 0; i < pages_needed; i++) {
> +   pages[i] = alloc_page(GFP_KERNEL);
> +   if (!pages[i]) {
> +   pr_err("%s: alloc_page() failed\n", __func__);
> +   --i;
> +   ret = -ENOMEM;
> +   goto failed;
> +   }
> +   }
> +
> +   for (i = 0; i < pages_needed; i++) {
> +   page_data = kmap(pages[i]);
> +   memcpy(page_data, fw->data + (i * PAGE_SIZE), copy_size);
> +
> +   if (i == 0)
> +   capsule = (efi_capsule_header_t *)page_data;
> +   else
> 

[PATCH v2 2/2] x86: mce: comment about MCE synchronization timeout on definition of tolerant

2015-02-26 Thread Naoya Horiguchi
commit 716079f66eac ("mce: Panic when a core has reached a timeout") changed
the behavior of mca_cfg->tolerant. So let's add comment about it.

Signed-off-by: Naoya Horiguchi 
---
 arch/x86/kernel/cpu/mcheck/mce.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git v3.19.orig/arch/x86/kernel/cpu/mcheck/mce.c 
v3.19/arch/x86/kernel/cpu/mcheck/mce.c
index 10359ae1f558..abdd2631036b 100644
--- v3.19.orig/arch/x86/kernel/cpu/mcheck/mce.c
+++ v3.19/arch/x86/kernel/cpu/mcheck/mce.c
@@ -69,8 +69,10 @@ struct mca_config mca_cfg __read_mostly = {
/*
 * Tolerant levels:
 * 0: always panic on uncorrected errors, log corrected errors
-* 1: panic or SIGBUS on uncorrected errors, log corrected errors
-* 2: SIGBUS or log uncorrected errors (if possible), log corr. errors
+* 1: panic or SIGBUS on uncorrected errors, log corrected errors,
+*panic on MCE synchronization timeout.
+* 2: SIGBUS or log uncorrected errors (if possible), log corr. errors,
+*no panic on MCE synchronization timeout.
 * 3: never panic or SIGBUS, log all errors (for testing only)
 */
.tolerant = 1,
-- 
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 1/2] x86: mce: kexec: turn off MCE in kexec

2015-02-26 Thread Naoya Horiguchi
kexec disables (or "shoots down") all CPUs other than a crashing CPU before
entering the 2nd kernel. But the MCE handler is still enabled after that, so
if MCE happens and broadcasts around CPUs after the main thread starts the
2nd kernel (which might not start MCE yet, or might decide not to start MCE,)
MCE handler runs only on the other CPUs (not on the main thread,) leading to
kernel panic with MCE synchronization. The user-visible effect of this bug
is kdump failure.

Note that this problem exists since current MCE handler was implemented in
2.6.32, and recently commit 716079f66eac ("mce: Panic when a core has reached
a timeout") made it more visible by changing the default behavior of the
synchronization timeout from "ignore" to "panic".

This patch adds a global variable representing that the system is running
kdump code in order to "turn off" the MCE handling code in kdump context.

Signed-off-by: Naoya Horiguchi 
Cc: [2.6.32+]
---
ChangeLog v1 -> v2
- clear MSR_IA32_MCG_CTL, MSR_IA32_MCx_CTL, and CR4.MCE instead of using
  global flag to ignore MCE events.
- fixed the description of the problem
---
 arch/x86/include/asm/mce.h   |  1 +
 arch/x86/kernel/cpu/mcheck/mce.c | 17 +
 arch/x86/kernel/crash.c  |  8 
 3 files changed, 26 insertions(+)

diff --git v3.19.orig/arch/x86/include/asm/mce.h 
v3.19/arch/x86/include/asm/mce.h
index 51b26e895933..7ae9927d781a 100644
--- v3.19.orig/arch/x86/include/asm/mce.h
+++ v3.19/arch/x86/include/asm/mce.h
@@ -175,6 +175,7 @@ static inline void mce_amd_feature_init(struct cpuinfo_x86 
*c) { }
 #endif
 
 int mce_available(struct cpuinfo_x86 *c);
+void cpu_emergency_mce_disable(void);
 
 DECLARE_PER_CPU(unsigned, mce_exception_count);
 DECLARE_PER_CPU(unsigned, mce_poll_count);
diff --git v3.19.orig/arch/x86/kernel/cpu/mcheck/mce.c 
v3.19/arch/x86/kernel/cpu/mcheck/mce.c
index 3112b79ace8e..10359ae1f558 100644
--- v3.19.orig/arch/x86/kernel/cpu/mcheck/mce.c
+++ v3.19/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2105,6 +2105,23 @@ static void mce_syscore_shutdown(void)
 }
 
 /*
+ * Called in kdump entering code to turn off MCE handling function. We clear
+ * global switch first to forbid the situation where only portion of CPUs are
+ * responsive to MCE and MCE causes kernel panic with synchronization timeout.
+ */
+void cpu_emergency_mce_disable(void)
+{
+   u64 cap;
+   int i;
+
+   rdmsrl(MSR_IA32_MCG_CAP, cap);
+   if (cap & MCG_CTL_P)
+   wrmsr(MSR_IA32_MCG_CTL, 0, 0);
+   mce_disable_error_reporting();
+   clear_in_cr4(X86_CR4_MCE);
+}
+
+/*
  * On resume clear all MCE state. Don't want to see leftovers from the BIOS.
  * Only one CPU is active at this time, the others get re-added later using
  * CPU hotplug:
diff --git v3.19.orig/arch/x86/kernel/crash.c v3.19/arch/x86/kernel/crash.c
index aceb2f90c716..22451c687fca 100644
--- v3.19.orig/arch/x86/kernel/crash.c
+++ v3.19/arch/x86/kernel/crash.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* Alignment required for elf header segment */
 #define ELF_CORE_HEADER_ALIGN   4096
@@ -112,6 +113,8 @@ static void kdump_nmi_callback(int cpu, struct pt_regs 
*regs)
 #endif
crash_save_cpu(regs, cpu);
 
+   cpu_emergency_mce_disable();
+
/*
 * VMCLEAR VMCSs loaded on all cpus if needed.
 */
@@ -157,6 +160,11 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
/* The kernel is broken so disable interrupts */
local_irq_disable();
 
+   /*
+* We can't expect MCE handling to work any more, so turn it off.
+*/
+   cpu_emergency_mce_disable();
+
kdump_nmi_shootdown_cpus();
 
/*
-- 
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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/


[perf/core PATCH v6 3/3] perf-buildid-cache: Show usage with incorrect params

2015-02-26 Thread Masami Hiramatsu
Show usage if no action is specified or unexpected parameter
is given. In other words, be more user friendly.

Signed-off-by: Masami Hiramatsu 
---
 tools/perf/builtin-buildid-cache.c |5 +
 1 file changed, 5 insertions(+)

diff --git a/tools/perf/builtin-buildid-cache.c 
b/tools/perf/builtin-buildid-cache.c
index 04466c4..d47a0cd 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -343,6 +343,11 @@ int cmd_buildid_cache(int argc, const char **argv,
argc = parse_options(argc, argv, buildid_cache_options,
 buildid_cache_usage, 0);
 
+   if (argc || (!add_name_list_str && !kcore_filename &&
+!remove_name_list_str && !purge_name_list_str &&
+!missing_filename && !update_name_list_str))
+   usage_with_options(buildid_cache_usage, buildid_cache_options);
+
if (missing_filename) {
file.path = missing_filename;
file.force = force;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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/


[perf/core PATCH v6 1/3] perf buildid-cache: Add --purge FILE to remove all caches of FILE

2015-02-26 Thread Masami Hiramatsu
Add --purge FILE to remove all caches of FILE.
Since the current --remove FILE removes a cache which has
same build-id of given FILE. Since the command takes a
FILE path, it can confuse user who tries to remove cache
about FILE path.

  -
  # ./perf buildid-cache -v --add ./perf
  Adding 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
  # (update the ./perf binary)
  # ./perf buildid-cache -v --remove ./perf
  Removing 305bbd1be68f66eca7e2d78db294653031edfa79 ./perf: FAIL
  ./perf wasn't in the cache
  -
Actually, the --remove's FAIL is not shown, it just silently fails.

So, this patch adds --purge FILE action for such usecase.
perf buildid-cache --purge FILE removes all caches which
has same FILE path.
In other words, it removes all caches including old binaries.

  -
  # ./perf buildid-cache -v --add ./perf
  Adding 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
  # (update the ./perf binary)
  # ./perf buildid-cache -v --purge ./perf
  Removing 133b7b5486d987a5ab5c3ebf4ea14941f45d4d4f ./perf: Ok
  -

BTW, if you want to purge all the caches, remove ~/.debug/* .

Signed-off-by: Masami Hiramatsu 
---
 tools/perf/Documentation/perf-buildid-cache.txt |   13 ++-
 tools/perf/builtin-buildid-cache.c  |   48 
 tools/perf/util/build-id.c  |   93 +++
 tools/perf/util/build-id.h  |3 +
 4 files changed, 136 insertions(+), 21 deletions(-)

diff --git a/tools/perf/Documentation/perf-buildid-cache.txt 
b/tools/perf/Documentation/perf-buildid-cache.txt
index cec6b57..dd07b55 100644
--- a/tools/perf/Documentation/perf-buildid-cache.txt
+++ b/tools/perf/Documentation/perf-buildid-cache.txt
@@ -12,9 +12,9 @@ SYNOPSIS
 
 DESCRIPTION
 ---
-This command manages the build-id cache. It can add and remove files to/from
-the cache. In the future it should as well purge older entries, set upper
-limits for the space used by the cache, etc.
+This command manages the build-id cache. It can add, remove, update and purge
+files to/from the cache. In the future it should as well set upper limits for
+the space used by the cache, etc.
 
 OPTIONS
 ---
@@ -36,7 +36,12 @@ OPTIONS
 actually made.
 -r::
 --remove=::
-Remove specified file from the cache.
+Remove a cached binary which has same build-id of specified file
+from the cache.
+-p::
+--purge=::
+Purge all cached binaries including older caches which have specified
+   path from the cache.
 -M::
 --missing=::
List missing build ids in the cache for the specified file.
diff --git a/tools/perf/builtin-buildid-cache.c 
b/tools/perf/builtin-buildid-cache.c
index e7568f5..86f9d78 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -223,6 +223,33 @@ static int build_id_cache__remove_file(const char 
*filename)
return err;
 }
 
+static int build_id_cache__purge_path(const char *pathname)
+{
+   struct strlist *list;
+   struct str_node *pos;
+   int err;
+
+   err = build_id_cache__list_build_ids(pathname, );
+   if (err)
+   goto out;
+
+   strlist__for_each(pos, list) {
+   err = build_id_cache__remove_s(pos->s);
+   if (verbose)
+   pr_info("Removing %s %s: %s\n", pos->s, pathname,
+   err ? "FAIL" : "Ok");
+   if (err)
+   break;
+   }
+   strlist__delete(list);
+
+out:
+   if (verbose)
+   pr_info("Purging %s: %s\n", pathname, err ? "FAIL" : "Ok");
+
+   return err;
+}
+
 static bool dso__missing_buildid_cache(struct dso *dso, int parm 
__maybe_unused)
 {
char filename[PATH_MAX];
@@ -285,6 +312,7 @@ int cmd_buildid_cache(int argc, const char **argv,
bool force = false;
char const *add_name_list_str = NULL,
   *remove_name_list_str = NULL,
+  *purge_name_list_str = NULL,
   *missing_filename = NULL,
   *update_name_list_str = NULL,
   *kcore_filename = NULL;
@@ -302,6 +330,8 @@ int cmd_buildid_cache(int argc, const char **argv,
   "file", "kcore file to add"),
OPT_STRING('r', "remove", _name_list_str, "file list",
"file(s) to remove"),
+   OPT_STRING('p', "purge", _name_list_str, "path list",
+   "path(s) to remove (remove old caches too)"),
OPT_STRING('M', "missing", _filename, "file",
   "to find missing build ids in the cache"),
OPT_BOOLEAN('f', "force", , "don't complain, do it"),
@@ -368,6 +398,24 @@ int cmd_buildid_cache(int argc, const char **argv,
}
}
 
+   if (purge_name_list_str) {
+   list = strlist__new(true, purge_name_list_str);
+   if (list) {
+   strlist__for_each(pos, list)
+   if 

[perf/core PATCH v6 2/3] perf-buildid-cache: Use pr_debug instead of verbose && pr_info

2015-02-26 Thread Masami Hiramatsu
Use pr_debug instead of the combination of verbose and pr_info.

"if (verbose) pr_info(...)" is same as "pr_debug(...)", replace it.

Suggested-by: Namhyung Kim 
Signed-off-by: Masami Hiramatsu 
---
 tools/perf/builtin-buildid-cache.c |   23 +--
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/tools/perf/builtin-buildid-cache.c 
b/tools/perf/builtin-buildid-cache.c
index 86f9d78..04466c4 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -196,9 +196,8 @@ static int build_id_cache__add_file(const char *filename)
build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
err = build_id_cache__add_s(sbuild_id, filename,
false, false);
-   if (verbose)
-   pr_info("Adding %s %s: %s\n", sbuild_id, filename,
-   err ? "FAIL" : "Ok");
+   pr_debug("Adding %s %s: %s\n", sbuild_id, filename,
+err ? "FAIL" : "Ok");
return err;
 }
 
@@ -216,9 +215,8 @@ static int build_id_cache__remove_file(const char *filename)
 
build_id__sprintf(build_id, sizeof(build_id), sbuild_id);
err = build_id_cache__remove_s(sbuild_id);
-   if (verbose)
-   pr_info("Removing %s %s: %s\n", sbuild_id, filename,
-   err ? "FAIL" : "Ok");
+   pr_debug("Removing %s %s: %s\n", sbuild_id, filename,
+err ? "FAIL" : "Ok");
 
return err;
 }
@@ -235,17 +233,15 @@ static int build_id_cache__purge_path(const char 
*pathname)
 
strlist__for_each(pos, list) {
err = build_id_cache__remove_s(pos->s);
-   if (verbose)
-   pr_info("Removing %s %s: %s\n", pos->s, pathname,
-   err ? "FAIL" : "Ok");
+   pr_debug("Removing %s %s: %s\n", pos->s, pathname,
+err ? "FAIL" : "Ok");
if (err)
break;
}
strlist__delete(list);
 
 out:
-   if (verbose)
-   pr_info("Purging %s: %s\n", pathname, err ? "FAIL" : "Ok");
+   pr_debug("Purging %s: %s\n", pathname, err ? "FAIL" : "Ok");
 
return err;
 }
@@ -296,9 +292,8 @@ static int build_id_cache__update_file(const char *filename)
if (!err)
err = build_id_cache__add_s(sbuild_id, filename, false, false);
 
-   if (verbose)
-   pr_info("Updating %s %s: %s\n", sbuild_id, filename,
-   err ? "FAIL" : "Ok");
+   pr_debug("Updating %s %s: %s\n", sbuild_id, filename,
+err ? "FAIL" : "Ok");
 
return err;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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/


[perf/core PATCH v6 0/3] perf-buildid-cache: Enhance --update and add --purge

2015-02-26 Thread Masami Hiramatsu
Hi,

Here is the 6th version of of perf buildid-cache update.
This updates the 1st and 2nd patches according to Arnaldo's comment.

Here are the changes in v6.

 - [1/3] Add verbose error message if failed to list buildid-dir.
 (this also updates build_id_cache__list_build_ids())
 - [2/3] Update for the previous change.

Thank you,


---

Masami Hiramatsu (3):
  perf buildid-cache: Add --purge FILE to remove all caches of FILE
  perf-buildid-cache: Use pr_debug instead of verbose && pr_info
  perf-buildid-cache: Show usage with incorrect params


 tools/perf/Documentation/perf-buildid-cache.txt |   13 ++-
 tools/perf/builtin-buildid-cache.c  |   66 ++--
 tools/perf/util/build-id.c  |   93 +++
 tools/perf/util/build-id.h  |3 +
 4 files changed, 145 insertions(+), 30 deletions(-)

--
Masami HIRAMATSU
Software Platform Research Dpt. Linux Technology Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu...@hitachi.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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: Tree for Feb 27

2015-02-26 Thread Stephen Rothwell
Hi all,

Changes since 20150226:

New Tree: rpi

The drm-intel tree gained a conflict against the drm-intel-fixes tree.

The rcu tree gained a build failure so I used the version from
next-20150226.

The clk tree lost its build failure but gained another so I used the
version from next-20150225.

Non-merge commits (relative to Linus' tree): 1432
 1565 files changed, 41138 insertions(+), 36333 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 207 trees (counting Linus' and 30 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 (b24e2bdde4af Merge tag 'stable/for-linus-4.0-rc1-tag' of 
git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip)
Merging fixes/master (b94d525e58dc Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net)
Merging kbuild-current/rc-fixes (c517d838eb7d Linux 4.0-rc1)
Merging arc-current/for-curr (2ce7598c9a45 Linux 3.17-rc4)
Merging arm-current/fixes (23be7fdafa50 ARM: 8305/1: DMA: Fix kzalloc flags in 
__iommu_alloc_buffer())
Merging m68k-current/for-linus (4436820a98cd m68k/defconfig: Enable Ethernet 
bridging)
Merging metag-fixes/fixes (c2996cb29bfb metag: Fix KSTK_EIP() and KSTK_ESP() 
macros)
Merging mips-fixes/mips-fixes (1795cd9b3a91 Linux 3.16-rc5)
Merging powerpc-merge/merge (c517d838eb7d Linux 4.0-rc1)
Merging powerpc-merge-mpe/fixes (c59c961ca511 Merge branch 'drm-fixes' of 
git://people.freedesktop.org/~airlied/linux)
Merging sparc/master (66d0f7ec9f10 sparc32: destroy_context() and switch_mm() 
needs to disable interrupts.)
Merging net/master (31639b94cadc MAINTAINERS: update my email address)
Merging ipsec/master (ac37e2515c1a xfrm: release dst_orig in case of error in 
xfrm_lookup())
Merging sound-current/for-linus (de5d0ad506cb ALSA: hda - Disable runtime PM 
for Panther Point again)
Merging pci-current/for-linus (4efe874aace5 PCI: Don't read past the end of 
sysfs "driver_override" buffer)
Merging wireless-drivers/master (aeb2d2a4c0ae rtlwifi: Remove logging statement 
that is no longer needed)
Merging driver-core.current/driver-core-linus (c517d838eb7d Linux 4.0-rc1)
Merging tty.current/tty-linus (c517d838eb7d Linux 4.0-rc1)
Merging usb.current/usb-linus (b20b1618b8fc cdc-acm: Add support for Denso 
cradle CU-321)
Merging usb-gadget-fixes/fixes (a0456399fb07 usb: gadget: configfs: don't 
NUL-terminate (sub)compatible ids)
Merging usb-serial-fixes/usb-linus (52772a7fd3d3 USB: pl2303: disable break on 
shutdown)
Merging staging.current/staging-linus (c517d838eb7d Linux 4.0-rc1)
Merging char-misc.current/char-misc-linus (c517d838eb7d Linux 4.0-rc1)
Merging input-current/for-linus (4c971aa78314 Merge branch 'next' into 
for-linus)
Merging crypto-current/master (96692a7305c4 crypto: tcrypt - do not allocate iv 
on stack for aead speed tests)
Merging ide/master (f96fe225677b Merge 
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net)
Merging devicetree-current/devicetree/merge (6b1271de3723 of/unittest: Overlays 
with sub-devices tests)
Merging rr-fixes/fixes (f47689345931 lguest: update help text.)
Merging vfio-fixes/for-linus (7c2e211f3c95 vfio-pci: Fix the check on pci 
device type in vfio_pci_probe())
Merging kselftest-fixes/fixes (f5db310d77ef selftests/vm: fix link error for 
transhuge-stress test)
Merging drm-intel-fixes/for-linux-next-fixes (62e537f8d568 drm/i915: Fix 
frontbuffer false positve.)
Merging asm-generic/master (643165c8bbc8 Merge tag 'uaccess_for_upstream' of 
git://git.kernel.or

[git pull] drm fixes

2015-02-26 Thread Dave Airlie

Hi Linus,

just general fixes pull, radeon, i915, atmel, tegra, amdkfd
and one core fix.

Dave.

The following changes since commit c517d838eb7d07bbe9507871fab3931deccff539:

  Linux 4.0-rc1 (2015-02-22 18:21:14 -0800)

are available in the git repository at:

  git://people.freedesktop.org/~airlied/linux drm-fixes

for you to fetch changes up to 21689a440bdc90650b7ee3803ec11cfabd21409e:

  Merge branch 'drm-atmel-hlcdc-fixes' of 
git://github.com/bbrezillon/linux-at91 into drm-fixes (2015-02-27 10:31:40 
+1000)



Alex Deucher (6):
  drm/radeon: use drm_mode_vrefresh() rather than mode->vrefresh
  drm/radeon: disable mclk switching with 120hz+ monitors
  drm/radeon: dump full IB if we hit a packet error
  drm/radeon: fix 1 RB harvest config setup for TN/RL
  drm/radeon: fix atom aux payload size check for writes (v2)
  drm/radeon: only enable DP audio if the monitor supports it

Boris Brezillon (2):
  drm: atmel-hlcdc: reset layer A2Q and UPDATE bits when disabling it
  drm: atmel-hlcdc: remove useless pm_runtime_put_sync in probe

Chris Wilson (1):
  drm/i915: Check obj->vma_list under the struct_mutex

Christian König (2):
  drm/radeon: enable SRBM timeout interrupt on SI
  drm/radeon: enable SRBM timeout interrupt on EG/NI

Daniel Vetter (2):
  drm: Fix deadlock due to getconnector locking changes
  drm/i915: Align initial plane backing objects correctly

Dave Airlie (5):
  Merge tag 'drm/tegra/for-3.20-rc1-fixes' of 
git://anongit.freedesktop.org/tegra/linux into drm-fixes
  Merge tag 'drm-amdkfd-fixes-2015-02-23' of 
git://people.freedesktop.org/~gabbayo/linux into drm-fixes
  Merge branch 'drm-fixes-4.0' of git://people.freedesktop.org/~agd5f/linux 
into drm-fixes
  Merge tag 'drm-intel-fixes-2015-02-26' of 
git://anongit.freedesktop.org/drm-intel into drm-fixes
  Merge branch 'drm-atmel-hlcdc-fixes' of 
git://github.com/bbrezillon/linux-at91 into drm-fixes

Imre Deak (1):
  drm/i915: avoid processing spurious/shared interrupts in low-power states

Jani Nikula (2):
  drm/i915/skl: handle all pixel formats in skylake_update_primary_plane()
  drm/i915: Dell Chromebook 11 has PWM backlight

Leo Liu (1):
  drm/radeon: enable SRBM timeout interrupt on CIK v2

Nathan-J. Hirschauer (1):
  drm/radeon: enable native backlight control on old macs

Nick Hoath (1):
  drm/i915: Fix a use after free, and unbalanced refcounting

Nicolas Ferre (1):
  drm: atmel-hlcdc: remove clock polarity from crtc driver

Oded Gabbay (2):
  drm/amdkfd: Initialize only amdkfd's assigned pipelines
  drm/amdkfd: don't set get_pipes_num() as inline

Rodrigo Vivi (2):
  drm/i915/bdw: PCI IDs ending in 0xb are ULT.
  drm/i915: Fix frontbuffer false positve.

Thierry Reding (4):
  drm/tegra: hdmi: Explicitly set clock rate
  drm/tegra: dc: Reset state's active_changed field
  drm/tegra: dc: Wire up CRTC parent of atomic state
  drm/tegra: dc: Move more code into ->init()

 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.c  | 10 ++-
 .../gpu/drm/amd/amdkfd/kfd_device_queue_manager.h  |  8 +--
 .../drm/amd/amdkfd/kfd_device_queue_manager_cik.c  |  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_crtc.c |  2 +-
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c   |  2 -
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.c|  3 +-
 drivers/gpu/drm/drm_crtc.c |  3 +-
 drivers/gpu/drm/i915/i915_drv.h| 15 +++-
 drivers/gpu/drm/i915/i915_gem.c|  3 +-
 drivers/gpu/drm/i915/i915_gem_stolen.c |  6 +-
 drivers/gpu/drm/i915/i915_gem_tiling.c |  7 +-
 drivers/gpu/drm/i915/i915_irq.c| 22 ++
 drivers/gpu/drm/i915/intel_display.c   | 33 ++---
 drivers/gpu/drm/i915/intel_lrc.c   |  8 +--
 drivers/gpu/drm/radeon/atombios_dp.c   |  7 ++
 drivers/gpu/drm/radeon/atombios_encoders.c | 21 --
 drivers/gpu/drm/radeon/cik.c   |  8 +++
 drivers/gpu/drm/radeon/cikd.h  |  4 ++
 drivers/gpu/drm/radeon/evergreen.c |  7 ++
 drivers/gpu/drm/radeon/evergreend.h|  4 ++
 drivers/gpu/drm/radeon/ni.c| 10 +--
 drivers/gpu/drm/radeon/nid.h   |  4 ++
 drivers/gpu/drm/radeon/r600_dpm.c  |  2 +-
 drivers/gpu/drm/radeon/radeon_cs.c | 16 -
 drivers/gpu/drm/radeon/radeon_encoders.c   |  3 +
 drivers/gpu/drm/radeon/radeon_pm.c |  6 ++
 drivers/gpu/drm/radeon/si.c| 22 --
 drivers/gpu/drm/radeon/sid.h   |  4 ++
 drivers/gpu/drm/tegra/dc.c | 79 +++---
 drivers/gpu/drm/tegra/hdmi.c   |  8 +++
 include/drm/i915_pciids.h  |  4 +-

Re: [PATCH] x86, traps: install gates using IST after cpu_init().

2015-02-26 Thread Wang Nan
On 2015/2/26 23:14, Andy Lutomirski wrote:
> On Wed, Feb 25, 2015 at 10:15 PM, Wang Nan  wrote:
>> X86_TRAP_NMI, X86_TRAP_DF and X86_TRAP_MC use their own stack. Those
>> stacks are invalid until cpu_init() installs TSS.
>>
>> This patch moves setting of the 3 gates after cpu_init().
>>
>> Signed-off-by: Wang Nan 
>> ---
>>
>> If I understand correctly, logically speaking the original code is
>> incorrect.  However, there is no real bug caused by it for serval years.
>> I'm not sure whether this fix is practical or not. Fix them only for
>> logical correctness.
> 
> Acked-by: Andy Lutomirski 
> 
> That being said, I'm pretty sure you're not fixing a bug here.

Agree.

> Delivery of an exception with no handler is every bit as fatal as
> delivery of an exception with a non-working IST handler.
> 

Just curious: in original code, what will happen if an NMI or MC raises after
'set_intr_gate_ist(X86_TRAP_NMI, , NMI_STACK);' and before cpu_init()?
In my opinion, at that time the interrupt handler is set but IST is not ready.

In addition, why it's never happened for real? Does it means NMI is possible
to be disabled?

Thank you!

> --Andy
> 


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] phy: exynos-dp-video: Kill exynos_dp_video_phy_pwr_isol function

2015-02-26 Thread Axel Lin
If IS_ERR(state->regs) the .probe fails.
So IS_ERR(state->regs) test in exynos_dp_video_phy_pwr_isol() is not necessary.
exynos_dp_video_phy_pwr_isol() simply does a regmap_update_bits() call now,
just call regmap_update_bits() instead and return proper return value.

Signed-off-by: Axel Lin 
---
 drivers/phy/phy-exynos-dp-video.c | 24 
 1 file changed, 4 insertions(+), 20 deletions(-)

diff --git a/drivers/phy/phy-exynos-dp-video.c 
b/drivers/phy/phy-exynos-dp-video.c
index f86cbe6..179cbf9 100644
--- a/drivers/phy/phy-exynos-dp-video.c
+++ b/drivers/phy/phy-exynos-dp-video.c
@@ -30,28 +30,13 @@ struct exynos_dp_video_phy {
const struct exynos_dp_video_phy_drvdata *drvdata;
 };
 
-static void exynos_dp_video_phy_pwr_isol(struct exynos_dp_video_phy *state,
-   unsigned int on)
-{
-   unsigned int val;
-
-   if (IS_ERR(state->regs))
-   return;
-
-   val = on ? 0 : EXYNOS5_PHY_ENABLE;
-
-   regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
-  EXYNOS5_PHY_ENABLE, val);
-}
-
 static int exynos_dp_video_phy_power_on(struct phy *phy)
 {
struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
 
/* Disable power isolation on DP-PHY */
-   exynos_dp_video_phy_pwr_isol(state, 0);
-
-   return 0;
+   return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
+ EXYNOS5_PHY_ENABLE, EXYNOS5_PHY_ENABLE);
 }
 
 static int exynos_dp_video_phy_power_off(struct phy *phy)
@@ -59,9 +44,8 @@ static int exynos_dp_video_phy_power_off(struct phy *phy)
struct exynos_dp_video_phy *state = phy_get_drvdata(phy);
 
/* Enable power isolation on DP-PHY */
-   exynos_dp_video_phy_pwr_isol(state, 1);
-
-   return 0;
+   return regmap_update_bits(state->regs, state->drvdata->phy_ctrl_offset,
+ EXYNOS5_PHY_ENABLE, 0);
 }
 
 static struct phy_ops exynos_dp_video_phy_ops = {
-- 
1.9.1



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


[PATCH v2] x86, traps: separate set_intr_gate() and cleanup early_trap_init().

2015-02-26 Thread Wang Nan
As early_trap_init() doesn't use IST, replace set_intr_gate_ist() and
set_system_intr_gate_ist() with their standard counterparts.

set_intr_gate() requires a trace_debug symbol which we don't have and
won't use. This patch seprates set_intr_gate() into 2 parts, and uses
base version in early_trap_init().

Signed-off-by: Wang Nan 
---

Hi Andy Lutomirski,

   This patch should be less tricky than previous one [1]. I also tried
   to renaming all set_intr_gate(), but it causes too many code changes,
   so I think you will be satisfied with this one.

Thank you!

[1] https://lkml.org/lkml/2015/2/26/770

---
 arch/x86/include/asm/desc.h |  7 ++-
 arch/x86/kernel/traps.c | 20 
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/arch/x86/include/asm/desc.h b/arch/x86/include/asm/desc.h
index a94b82e..a0bf89f 100644
--- a/arch/x86/include/asm/desc.h
+++ b/arch/x86/include/asm/desc.h
@@ -376,11 +376,16 @@ static inline void _set_gate(int gate, unsigned type, 
void *addr,
  * Pentium F0 0F bugfix can have resulted in the mapped
  * IDT being write-protected.
  */
-#define set_intr_gate(n, addr) \
+#define set_intr_gate_notrace(n, addr) \
do {\
BUG_ON((unsigned)n > 0xFF); \
_set_gate(n, GATE_INTERRUPT, (void *)addr, 0, 0,\
  __KERNEL_CS); \
+   } while (0)
+
+#define set_intr_gate(n, addr) \
+   do {\
+   set_intr_gate_notrace(n, addr); \
_trace_set_gate(n, GATE_INTERRUPT, (void *)trace_##addr,\
0, 0, __KERNEL_CS); \
} while (0)
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 4281988..9965bd1 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -926,16 +926,20 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, 
long error_code)
 void __init early_trap_init(void)
 {
/*
-* Don't set ist to DEBUG_STACK as it doesn't work until TSS is
-* ready in cpu_init() <-- trap_init(). Before trap_init(), CPU
-* runs at ring 0 so it is impossible to hit an invalid stack.
-* Using the original stack works well enough at this early
-* stage. DEBUG_STACK will be equipped after cpu_init() in
+* Don't use IST to set DEBUG_STACK as it doesn't work until TSS
+* is ready in cpu_init() <-- trap_init(). Before trap_init(),
+* CPU runs at ring 0 so it is impossible to hit an invalid
+* stack.  Using the original stack works well enough at this
+* early stage. DEBUG_STACK will be equipped after cpu_init() in
 * trap_init().
+*
+* We don't need to set trace_idt_table like set_intr_gate(),
+* since we don't have trace_debug and it will be reset to
+* 'debug' in trap_init() by set_intr_gate_ist().
 */
-   set_intr_gate_ist(X86_TRAP_DB, , 0);
+   set_intr_gate_notrace(X86_TRAP_DB, debug);
/* int3 can be called from all */
-   set_system_intr_gate_ist(X86_TRAP_BP, , 0);
+   set_system_intr_gate(X86_TRAP_BP, );
 #ifdef CONFIG_X86_32
set_intr_gate(X86_TRAP_PF, page_fault);
 #endif
@@ -1015,7 +1019,7 @@ void __init trap_init(void)
 
/*
 * X86_TRAP_DB and X86_TRAP_BP have been set
-* in early_trap_init(). However, DEBUG_STACK works only after
+* in early_trap_init(). However, ITS works only after
 * cpu_init() loads TSS. See comments in early_trap_init().
 */
set_intr_gate_ist(X86_TRAP_DB, , DEBUG_STACK);
-- 
1.8.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/


[PATCH v2 2/2] cgroups: add an nproc subsystem

2015-02-26 Thread Aleksa Sarai
Adds a new single-purpose nproc subsystem to limit the number of
tasks that can run inside a cgroup. Essentially this is an
implementation of RLIMIT_NPROC that will applies to a cgroup rather than
a process tree.

This is a step to being able to limit the global impact of a fork bomb
inside a cgroup, allowing for cgroups to perform fairly basic resource
limitation which it currently doesn't have the capability to do.

Signed-off-by: Aleksa Sarai 
---
 include/linux/cgroup_subsys.h |   4 +
 init/Kconfig  |  10 +++
 kernel/Makefile   |   1 +
 kernel/cgroup_nproc.c | 198 ++
 4 files changed, 213 insertions(+)
 create mode 100644 kernel/cgroup_nproc.c

diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h
index 98c4f9b..e83e0ac 100644
--- a/include/linux/cgroup_subsys.h
+++ b/include/linux/cgroup_subsys.h
@@ -47,6 +47,10 @@ SUBSYS(net_prio)
 SUBSYS(hugetlb)
 #endif
 
+#if IS_ENABLED(CONFIG_CGROUP_NPROC)
+SUBSYS(nproc)
+#endif
+
 /*
  * The following subsystems are not supported on the default hierarchy.
  */
diff --git a/init/Kconfig b/init/Kconfig
index 9afb971..d6315fe 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1047,6 +1047,16 @@ config CGROUP_HUGETLB
  control group is tracked in the third page lru pointer. This means
  that we cannot use the controller with huge page less than 3 pages.
 
+config CGROUP_NPROC
+   bool "Process number limiting on cgroups"
+   depends on PAGE_COUNTER
+   help
+ This options enables the setting of process number limits in the scope
+ of a cgroup. Any attempt to fork more processes than is allowed in the
+ cgroup will fail. This allows for more basic resource limitation that
+ applies to a cgroup, similar to RLIMIT_NPROC (except that instead of
+ applying to a process tree it applies to a cgroup).
+
 config CGROUP_PERF
bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
depends on PERF_EVENTS && CGROUPS
diff --git a/kernel/Makefile b/kernel/Makefile
index a59481a..10c4b40 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -52,6 +52,7 @@ obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.o
 obj-$(CONFIG_COMPAT) += compat.o
 obj-$(CONFIG_CGROUPS) += cgroup.o
 obj-$(CONFIG_CGROUP_FREEZER) += cgroup_freezer.o
+obj-$(CONFIG_CGROUP_NPROC) += cgroup_nproc.o
 obj-$(CONFIG_CPUSETS) += cpuset.o
 obj-$(CONFIG_UTS_NS) += utsname.o
 obj-$(CONFIG_USER_NS) += user_namespace.o
diff --git a/kernel/cgroup_nproc.c b/kernel/cgroup_nproc.c
new file mode 100644
index 000..86de0fe
--- /dev/null
+++ b/kernel/cgroup_nproc.c
@@ -0,0 +1,198 @@
+/*
+ * Process number limiting subsys for cgroups.
+ *
+ * Copyright (C) 2015 Aleksa Sarai 
+ *
+ * Thanks to Frederic Weisbecker for creating the seminal patches which lead to
+ * this being written.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+struct nproc {
+   struct page_counter proc_counter;
+   struct cgroup_subsys_state  css;
+};
+
+static inline struct nproc *css_nproc(struct cgroup_subsys_state *css)
+{
+   return css ? container_of(css, struct nproc, css) : NULL;
+}
+
+static inline struct nproc *task_nproc(struct task_struct *task)
+{
+   return css_nproc(task_css(task, nproc_cgrp_id));
+}
+
+static struct nproc *parent_nproc(struct nproc *nproc)
+{
+   return css_nproc(nproc->css.parent);
+}
+
+static struct cgroup_subsys_state *nproc_css_alloc(struct cgroup_subsys_state 
*parent)
+{
+   struct nproc *nproc;
+
+   nproc = kzalloc(sizeof(struct nproc), GFP_KERNEL);
+   if (!nproc)
+   return ERR_PTR(-ENOMEM);
+
+   return >css;
+}
+
+static int nproc_css_online(struct cgroup_subsys_state *css)
+{
+   struct nproc *nproc = css_nproc(css);
+   struct nproc *parent = parent_nproc(nproc);
+
+   if (!parent) {
+   page_counter_init(>proc_counter, NULL);
+   return 0;
+   }
+
+   page_counter_init(>proc_counter, >proc_counter);
+   return page_counter_limit(>proc_counter, 
parent->proc_counter.limit);
+}
+
+static void nproc_css_free(struct cgroup_subsys_state *css)
+{
+   kfree(css_nproc(css));
+}
+
+static inline void nproc_remove_procs(struct nproc *nproc, int num_procs)
+{
+   page_counter_uncharge(>proc_counter, num_procs);
+}
+
+static inline int nproc_add_procs(struct nproc *nproc, int num_procs)
+{
+   struct page_counter *fail_at;
+   int errcode;
+
+   errcode = page_counter_try_charge(>proc_counter, num_procs, 
_at);
+   if (errcode)
+   return -EAGAIN;
+
+   return 0;
+}
+
+static int nproc_can_attach(struct cgroup_subsys_state *css,
+   struct cgroup_taskset *tset)
+{
+   struct nproc *nproc = css_nproc(css);
+   unsigned long num_tasks = 0;
+   struct task_struct *task;
+
+   cgroup_taskset_for_each(task, tset)
+   

[RFC PATCH v2 0/2] add nproc cgroup subsystem

2015-02-26 Thread Aleksa Sarai
This is an updated version of the nproc patchset[1], in which the forking
cleanup issue has been resolved by adding can_fork and cancel_fork
callbacks to cgroup subsystems. The can_fork callback is run early
enough that it doesn't get called after the "point of no return" where
the process is exposed (which is when fork) is called, and cancel_fork
is run during the cleanup of copy_process if the fork fails due to other
reasons.

[1]: https://lkml.org/lkml/2015/2/22/204

Aleksa Sarai (2):
  cgroups: allow a cgroup subsystem to reject a fork
  cgroups: add an nproc subsystem

 include/linux/cgroup.h|   9 ++
 include/linux/cgroup_subsys.h |   4 +
 init/Kconfig  |  10 +++
 kernel/Makefile   |   1 +
 kernel/cgroup.c   |  80 +
 kernel/cgroup_nproc.c | 198 ++
 kernel/fork.c |  12 ++-
 7 files changed, 296 insertions(+), 18 deletions(-)
 create mode 100644 kernel/cgroup_nproc.c

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


[PATCH v2 1/2] cgroups: allow a cgroup subsystem to reject a fork

2015-02-26 Thread Aleksa Sarai
Add a new cgroup subsystem callback can_fork that conditionally
states whether or not the fork is accepted or rejected with a cgroup
policy.

Make the cgroup subsystem can_fork callback return an error code so
that subsystems can accept or reject a fork from completing with a
custom error value, before the process is exposed.

In addition, add a cancel_fork callback so that if an error occurs later
in the forking process, any state modified by can_fork can be reverted.

In order for can_fork to deal with a task that has an accurate css_set,
move the css_set updating to cgroup_fork (where it belongs).

This is in preparation for implementing the nproc cgroup subsystem.

Signed-off-by: Aleksa Sarai 
---
 include/linux/cgroup.h |  9 ++
 kernel/cgroup.c| 80 +++---
 kernel/fork.c  | 12 +++-
 3 files changed, 83 insertions(+), 18 deletions(-)

diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index da0dae0..9897533 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -32,6 +32,8 @@ struct cgroup;
 extern int cgroup_init_early(void);
 extern int cgroup_init(void);
 extern void cgroup_fork(struct task_struct *p);
+extern int cgroup_can_fork(struct task_struct *p);
+extern void cgroup_cancel_fork(struct task_struct *p);
 extern void cgroup_post_fork(struct task_struct *p);
 extern void cgroup_exit(struct task_struct *p);
 extern int cgroupstats_build(struct cgroupstats *stats,
@@ -649,6 +651,8 @@ struct cgroup_subsys {
  struct cgroup_taskset *tset);
void (*attach)(struct cgroup_subsys_state *css,
   struct cgroup_taskset *tset);
+   int (*can_fork)(struct task_struct *task);
+   void (*cancel_fork)(struct task_struct *task);
void (*fork)(struct task_struct *task);
void (*exit)(struct cgroup_subsys_state *css,
 struct cgroup_subsys_state *old_css,
@@ -946,6 +950,11 @@ struct cgroup_subsys_state 
*css_tryget_online_from_dir(struct dentry *dentry,
 static inline int cgroup_init_early(void) { return 0; }
 static inline int cgroup_init(void) { return 0; }
 static inline void cgroup_fork(struct task_struct *p) {}
+static inline int cgroup_can_fork(struct task_struct *p)
+{
+   return 0;
+}
+static inline void cgroup_cancel_fork(struct task_struct *p) {}
 static inline void cgroup_post_fork(struct task_struct *p) {}
 static inline void cgroup_exit(struct task_struct *p) {}
 
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 04cfe8a..f062350 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4928,7 +4928,7 @@ static void __init cgroup_init_subsys(struct 
cgroup_subsys *ss, bool early)
 * init_css_set is in the subsystem's root cgroup. */
init_css_set.subsys[ss->id] = css;
 
-   need_forkexit_callback |= ss->fork || ss->exit;
+   need_forkexit_callback |= ss->can_fork || ss->cancel_fork || ss->fork 
|| ss->exit;
 
/* At system boot, before all subsystems have been
 * registered, no tasks have been forked, so we don't
@@ -5179,22 +5179,6 @@ void cgroup_fork(struct task_struct *child)
 {
RCU_INIT_POINTER(child->cgroups, _css_set);
INIT_LIST_HEAD(>cg_list);
-}
-
-/**
- * cgroup_post_fork - called on a new task after adding it to the task list
- * @child: the task in question
- *
- * Adds the task to the list running through its css_set if necessary and
- * call the subsystem fork() callbacks.  Has to be after the task is
- * visible on the task list in case we race with the first call to
- * cgroup_task_iter_start() - to guarantee that the new task ends up on its
- * list.
- */
-void cgroup_post_fork(struct task_struct *child)
-{
-   struct cgroup_subsys *ss;
-   int i;
 
/*
 * This may race against cgroup_enable_task_cg_lists().  As that
@@ -5229,6 +5213,68 @@ void cgroup_post_fork(struct task_struct *child)
}
up_write(_set_rwsem);
}
+}
+
+/**
+ * cgroup_can_fork - called on a new task before the process is exposed.
+ * @child: the task in question.
+ *
+ * This calls the subsystem can_fork() callbacks. If the can_fork() callback
+ * returns an error, the fork aborts with that error code. This allows for
+ * a cgroup subsystem to conditionally allow or deny new forks.
+ */
+int cgroup_can_fork(struct task_struct *child)
+{
+   struct cgroup_subsys *ss;
+   int i;
+
+   if (need_forkexit_callback) {
+   int retval;
+
+   for_each_subsys(ss, i)
+   if (ss->can_fork) {
+   retval = ss->can_fork(child);
+   if (retval)
+   return retval;
+   }
+   }
+
+   return 0;
+}
+
+/**
+ * cgroup_cancel_fork - called if a fork failed after cgroup_can_fork()
+ * @child: the task in question
+ *
+ * This calls the cancel_fork() callbacks if a fork 

Re: [PATCH v6 1/3] dmaengine: Add support for APM X-Gene SoC DMA engine driver

2015-02-26 Thread Rameshwar Sahu
Hi,


On Thu, Feb 26, 2015 at 7:55 PM, Ben Dooks  wrote:
> On 26/02/15 12:31, Rameshwar Sahu wrote:
>> Hi Vinod,
>>
>>
>> On Tue, Feb 24, 2015 at 6:23 PM, Rameshwar Prasad Sahu  wrote:
>>> This patch implements the APM X-Gene SoC DMA engine driver. The APM X-Gene
>>> SoC DMA engine consists of 4 DMA channels for performing DMA operations.
>>> These DMA operations include memory copy and scatter-gather memory copy
>>> offloading.
>>>
>>> Signed-off-by: Rameshwar Prasad Sahu 
>>> Signed-off-by: Loc Ho 
>>> ---
>>>  drivers/dma/Kconfig |8 +
>>>  drivers/dma/Makefile|1 +
>>>  drivers/dma/xgene-dma.c | 1738 
>>> +++
>>>  3 files changed, 1747 insertions(+)
>>>  create mode 100755 drivers/dma/xgene-dma.c
>>>
>>> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
>>> index a874b6e..0e05831 100644
>>> --- a/drivers/dma/Kconfig
>>> +++ b/drivers/dma/Kconfig
>>> @@ -425,6 +425,14 @@ config IMG_MDC_DMA
>>> help
>>>   Enable support for the IMG multi-threaded DMA controller (MDC).
>>>
>>> +config XGENE_DMA
>>> +   tristate "APM X-Gene DMA support"
>>> +   depends on ARCH_XGENE
>>> +   select DMA_ENGINE
>>> +   select ASYNC_TX_ENABLE_CHANNEL_SWITCH
>>> +   help
>>> + Enable support for the APM X-Gene SoC DMA engine.
>>> +
>>>  config DMA_ENGINE
>>> bool
>>>
>>> diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile
>>> index f915f61..06c1576 100644
>>> --- a/drivers/dma/Makefile
>>> +++ b/drivers/dma/Makefile
>>> @@ -51,3 +51,4 @@ obj-$(CONFIG_INTEL_MIC_X100_DMA) += mic_x100_dma.o
>>>  obj-$(CONFIG_NBPFAXI_DMA) += nbpfaxi.o
>>>  obj-$(CONFIG_DMA_SUN6I) += sun6i-dma.o
>>>  obj-$(CONFIG_IMG_MDC_DMA) += img-mdc-dma.o
>>> +obj-$(CONFIG_XGENE_DMA) += xgene-dma.o
>>> diff --git a/drivers/dma/xgene-dma.c b/drivers/dma/xgene-dma.c
>>> new file mode 100755
>>> index 000..e736c2e
>>> --- /dev/null
>>> +++ b/drivers/dma/xgene-dma.c
>>> @@ -0,0 +1,1738 @@
>>> +/*
>>> + * Applied Micro X-Gene SoC DMA engine Driver
>>> + *
>>> + * Copyright (c) 2015, Applied Micro Circuits Corporation
>>> + * Authors: Rameshwar Prasad Sahu 
>>> + * Loc Ho 
>>> + *
>>> + * This program is free software; you can redistribute  it and/or modify it
>>> + * under  the terms of  the GNU General  Public License as published by the
>>> + * Free Software Foundation;  either version 2 of the  License, or (at your
>>> + * option) any later version.
>>> + *
>>> + * This program is distributed in the hope that it will be useful,
>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>>> + * GNU General Public License for more details.
>>> + *
>>> + * You should have received a copy of the GNU General Public License
>>> + * along with this program.  If not, see .
>>> + *
>>> + * NOTE: PM support is currently not available.
>>> + */
>>> +
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +#include 
>>> +
>>> +#include "dmaengine.h"
>>> +
>>> +/* DMA ring csr registers and bit definations */
>>> +#define DMA_RING_CONFIG0x04
>>> +#define DMA_RING_ENABLEBIT(31)
>>> +#define DMA_RING_ID0x08
>>> +#define DMA_RING_ID_SETUP(v)   ((v) | BIT(31))
>>> +#define DMA_RING_ID_BUF0x0C
>>> +#define DMA_RING_ID_BUF_SETUP(v)   (((v) << 9) | BIT(21))
>>> +#define DMA_RING_THRESLD0_SET1 0x30
>>> +#define DMA_RING_THRESLD0_SET1_VAL 0X64
>>> +#define DMA_RING_THRESLD1_SET1 0x34
>>> +#define DMA_RING_THRESLD1_SET1_VAL 0xC8
>>> +#define DMA_RING_HYSTERESIS0x68
>>> +#define DMA_RING_HYSTERESIS_VAL0x
>>> +#define DMA_RING_STATE 0x6C
>>> +#define DMA_RING_STATE_WR_BASE 0x70
>>> +#define DMA_RING_NE_INT_MODE   0x017C
>>> +#define DMA_RING_NE_INT_MODE_SET(m, v) \
>>> +   ((m) = ((m) & ~BIT(31 - (v))) | BIT(31 - (v)))
>>> +#define DMA_RING_NE_INT_MODE_RESET(m, v)   \
>>> +   ((m) &= (~BIT(31 - (v
>>> +#define DMA_RING_CLKEN 0xC208
>>> +#define DMA_RING_SRST  0xC200
>>> +#define DMA_RING_MEM_RAM_SHUTDOWN  0xD070
>>> +#define DMA_RING_BLK_MEM_RDY   0xD074
>>> +#define DMA_RING_BLK_MEM_RDY_VAL   0x
>>> +#define DMA_RING_DESC_CNT(v)   (((v) & 0x0001FFFE) >> 1)
>>> +#define DMA_RING_ID_GET(owner, num)(((owner) << 6) | (num))
>>> +#define DMA_RING_DST_ID(v) ((1 << 10) | (v))
>>> +#define DMA_RING_CMD_OFFSET0x2C
>>> +#define DMA_RING_CMD_BASE_OFFSET(v)((v) << 6)
>>> +#define DMA_RING_COHERENT_SET(m)   (((u32 *)(m))[2] |= BIT(4))
>>> +#define DMA_RING_ADDRL_SET(m, v)   (((u32 *)(m))[2] |= (((v) >> 8) << 
>>> 5))
>>> +#define DMA_RING_ADDRH_SET(m, v)   (((u32 *)(m))[3] |= 

Re: [PATCH] staging: lustre: fld_request.c: Remove else after return.

2015-02-26 Thread Alberto Pires de Oliveira Neto
Hi,

  I'm terribly sorry. It's my first patch. I used git send-email to send it.
  It's also my first time using sendgrid as a relay, and it seems that
there was "convert text to html" option turned on by default.
  I tested again and now it seems ok.

I send the patch again.

Thanks, for the patience.


On Thu, Feb 26, 2015 at 10:30 PM, Greg KH  wrote:
> On Thu, Feb 26, 2015 at 10:20:06PM -0300, Alberto Pires de Oliveira Neto 
> wrote:
>> Signed-off-by: Alberto Pires de Oliveira Neto 
>>
>> drivers/staging/lustre/lustre/fld/fld_request.c | 7 +++
>> 1 file changed, 3 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
>> b/drivers/staging/
>> lustre/lustre/fld/fld_request.c index b8d17e1..0b00301 100644 --- a/drivers/
>> staging/lustre/lustre/fld/fld_request.c +++ 
>> b/drivers/staging/lustre/lustre/fld
>> /fld_request.c @@ -217,10 +217,9 @@ int fld_client_add_target(struct
>> lu_client_fld *fld,
>>
>> CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip it\n",
>> fld->lcf_name, name, tar->ft_idx);
>> return 0;
>>
>>   • } else {
>>
>>   • CDEBUG(D_INFO, “%s: Adding target %s (idx %llu)\n”,
>>
>>   • fld->lcf_name, name, tar->ft_idx);
>>
>>   • }
>>
>> + } + CDEBUG(D_INFO, “%s: Adding target %s (idx %llu)\n”, + fld->lcf_name,
>> name, tar->ft_idx);
>>
>> OBD_ALLOC_PTR(target);
>> if (target == NULL)
>>
>> — 1.9.1
>>
>> *
>
> You sent an html patch, which obviously can not be applied :(
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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/4] mm, shmem: Add shmem resident memory accounting

2015-02-26 Thread Hillf Danton
> @@ -501,6 +502,7 @@ static void smaps_pte_entry(pte_t *pte, unsigned long 
> addr,
>   pte_none(*pte) && vma->vm_file) {
>   struct address_space *mapping =
>   file_inode(vma->vm_file)->i_mapping;
> + pgoff_t pgoff = linear_page_index(vma, addr);
> 
>   /*
>* shmem does not use swap pte's so we have to consult

This hunk should go to patch 2/4
Hillf

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 3.18.8

2015-02-26 Thread Greg KH
I'm announcing the release of the 3.18.8 kernel.

All users of the 3.18 kernel series must upgrade.

The updated 3.18.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 
linux-3.18.y
and can be browsed at the normal kernel.org git web browser:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h



 Makefile |2 
 drivers/media/rc/ir-lirc-codec.c |   12 +++--
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c  |2 
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |5 +-
 drivers/net/hyperv/netvsc.c  |   11 +++-
 drivers/net/ppp/ppp_deflate.c|2 
 fs/ext4/super.c  |5 --
 include/net/ip.h |   13 ++---
 include/net/netns/ipv4.h |1 
 include/net/sch_generic.h|   13 ++---
 net/core/dev.c   |   20 ++--
 net/core/rtnetlink.c |6 ++
 net/ipv4/ip_forward.c|3 -
 net/ipv4/ip_output.c |   29 +---
 net/ipv4/ip_sockglue.c   |8 ---
 net/ipv4/ping.c  |5 +-
 net/ipv4/route.c |9 ++-
 net/ipv4/tcp_ipv4.c  |   37 +--
 net/ipv4/udp_diag.c  |4 +
 net/ipv6/datagram.c  |   10 +---
 net/ipv6/ip6_fib.c   |   45 ++-
 net/ipv6/route.c |7 --
 net/sctp/associola.c |1 
 net/sctp/sm_make_chunk.c |2 
 net/socket.c |3 -
 25 files changed, 142 insertions(+), 113 deletions(-)

Austin Lund (1):
  media/rc: Send sync space information on the lirc device

Christoph Hellwig (1):
  net: don't OOPS on socket aio

Daniel Borkmann (1):
  net: sctp: fix slab corruption from use after free on INIT collisions

Eric Dumazet (5):
  net: rps: fix cpu unplug
  netxen: fix netxen_nic_poll() logic
  tcp: ipv4: initialize unicast_sock sk_pacing_rate
  ipv4: tcp: get rid of ugly unicast_sock
  net: sched: fix panic in rate estimators

Eric Sandeen (1):
  ext4: ignore journal checksum on remount; don't fail

Florian Westphal (1):
  ppp: deflate: never return len larger than output buffer

Govindarajulu Varadarajan (1):
  bnx2x: fix napi poll return value for repoll

Greg Kroah-Hartman (1):
  Linux 3.18.8

Hagen Paul Pfeifer (1):
  ipv6: stop sending PTB packets for MTU < 1280

Haiyang Zhang (1):
  hyperv: Fix the error processing in netvsc_send()

Hannes Frederic Sowa (2):
  ipv4: try to cache dst_entries which would cause a redirect
  ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos 
too

Herbert Xu (1):
  udp_diag: Fix socket skipping within chain

Roopa Prabhu (1):
  bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify

Saran Maruti Ramanara (1):
  net: sctp: fix passing wrong parameter header to param_type2af in 
sctp_process_param

Willem de Bruijn (1):
  ip: zero sockaddr returned on error queue

subas...@codeaurora.org (1):
  ping: Fix race in free in receive path



pgpCbxRN_I4nI.pgp
Description: PGP signature


Re: Linux 3.18.8

2015-02-26 Thread Greg KH
diff --git a/Makefile b/Makefile
index 0efae2279fbe..0b3f8a1b3715 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 18
-SUBLEVEL = 7
+SUBLEVEL = 8
 EXTRAVERSION =
 NAME = Diseased Newt
 
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index ed2c8a1ed8ca..98893a8332c7 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -42,11 +42,17 @@ static int ir_lirc_decode(struct rc_dev *dev, struct 
ir_raw_event ev)
return -EINVAL;
 
/* Packet start */
-   if (ev.reset)
-   return 0;
+   if (ev.reset) {
+   /* Userspace expects a long space event before the start of
+* the signal to use as a sync.  This may be done with repeat
+* packets and normal samples.  But if a reset has been sent
+* then we assume that a long time has passed, so we send a
+* space with the maximum time value. */
+   sample = LIRC_SPACE(LIRC_VALUE_MASK);
+   IR_dprintk(2, "delivering reset sync space to lirc_dev\n");
 
/* Carrier reports */
-   if (ev.carrier_report) {
+   } else if (ev.carrier_report) {
sample = LIRC_FREQUENCY(ev.carrier);
IR_dprintk(2, "carrier report (freq: %d)\n", sample);
 
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 40beef5bca88..ec4cebabff49 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3175,7 +3175,7 @@ static int bnx2x_poll(struct napi_struct *napi, int 
budget)
}
 #endif
if (!bnx2x_fp_lock_napi(fp))
-   return work_done;
+   return budget;
 
for_each_cos_in_tx_queue(fp, cos)
if (bnx2x_tx_queue_has_work(fp->txdata_ptr[cos]))
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c 
b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 613037584d08..c531c8ae1be4 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2388,7 +2388,10 @@ static int netxen_nic_poll(struct napi_struct *napi, int 
budget)
 
work_done = netxen_process_rcv_ring(sds_ring, budget);
 
-   if ((work_done < budget) && tx_complete) {
+   if (!tx_complete)
+   work_done = budget;
+
+   if (work_done < budget) {
napi_complete(_ring->napi);
if (test_bit(__NX_DEV_UP, >state))
netxen_nic_enable_int(sds_ring);
diff --git a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
index 7d76c9523395..63d7a642733d 100644
--- a/drivers/net/hyperv/netvsc.c
+++ b/drivers/net/hyperv/netvsc.c
@@ -716,7 +716,7 @@ int netvsc_send(struct hv_device *device,
u64 req_id;
unsigned int section_index = NETVSC_INVALID_INDEX;
u32 msg_size = 0;
-   struct sk_buff *skb;
+   struct sk_buff *skb = NULL;
u16 q_idx = packet->q_idx;
 
 
@@ -743,8 +743,6 @@ int netvsc_send(struct hv_device *device,
   packet);
skb = (struct sk_buff *)
  (unsigned long)packet->send_completion_tid;
-   if (skb)
-   dev_kfree_skb_any(skb);
packet->page_buf_cnt = 0;
}
}
@@ -807,6 +805,13 @@ int netvsc_send(struct hv_device *device,
   packet, ret);
}
 
+   if (ret != 0) {
+   if (section_index != NETVSC_INVALID_INDEX)
+   netvsc_free_send_slot(net_device, section_index);
+   } else if (skb) {
+   dev_kfree_skb_any(skb);
+   }
+
return ret;
 }
 
diff --git a/drivers/net/ppp/ppp_deflate.c b/drivers/net/ppp/ppp_deflate.c
index 602c625d95d5..b5edc7f96a39 100644
--- a/drivers/net/ppp/ppp_deflate.c
+++ b/drivers/net/ppp/ppp_deflate.c
@@ -246,7 +246,7 @@ static int z_compress(void *arg, unsigned char *rptr, 
unsigned char *obuf,
/*
 * See if we managed to reduce the size of the packet.
 */
-   if (olen < isize) {
+   if (olen < isize && olen <= osize) {
state->stats.comp_bytes += olen;
state->stats.comp_packets++;
} else {
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 2c9e6864abd9..fc7391e14c2a 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4849,9 +4849,8 @@ static int ext4_remount(struct super_block *sb, int 
*flags, char *data)
if ((old_opts.s_mount_opt & EXT4_MOUNT_JOURNAL_CHECKSUM) ^
test_opt(sb, JOURNAL_CHECKSUM)) {
ext4_msg(sb, KERN_ERR, "changing journal_checksum "
-"during remount not supported");
-

Linux 3.14.34

2015-02-26 Thread Greg KH
I'm announcing the release of the 3.14.34 kernel.

All users of the 3.14 kernel series must upgrade.

The updated 3.14.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 
linux-3.14.y
and can be browsed at the normal kernel.org git web browser:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h



 Makefile |2 
 drivers/media/rc/ir-lirc-codec.c |   12 +++--
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c  |2 
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |5 +-
 drivers/net/ppp/ppp_deflate.c|2 
 include/net/ip.h |   13 ++---
 include/net/netns/ipv4.h |1 
 net/core/dev.c   |   20 ++--
 net/core/rtnetlink.c |6 ++
 net/ipv4/ip_forward.c|3 -
 net/ipv4/ip_output.c |   29 +---
 net/ipv4/ip_sockglue.c   |8 ---
 net/ipv4/ping.c  |5 +-
 net/ipv4/route.c |9 ++-
 net/ipv4/tcp_ipv4.c  |   37 +--
 net/ipv4/udp_diag.c  |4 +
 net/ipv6/datagram.c  |   10 +---
 net/ipv6/ip6_fib.c   |   45 ++-
 net/ipv6/route.c |7 --
 net/sctp/associola.c |1 
 net/sctp/sm_make_chunk.c |2 
 net/socket.c |3 -
 22 files changed, 127 insertions(+), 99 deletions(-)

Austin Lund (1):
  media/rc: Send sync space information on the lirc device

Christoph Hellwig (1):
  net: don't OOPS on socket aio

Daniel Borkmann (1):
  net: sctp: fix slab corruption from use after free on INIT collisions

Eric Dumazet (4):
  net: rps: fix cpu unplug
  netxen: fix netxen_nic_poll() logic
  tcp: ipv4: initialize unicast_sock sk_pacing_rate
  ipv4: tcp: get rid of ugly unicast_sock

Florian Westphal (1):
  ppp: deflate: never return len larger than output buffer

Govindarajulu Varadarajan (1):
  bnx2x: fix napi poll return value for repoll

Greg Kroah-Hartman (1):
  Linux 3.14.34

Hagen Paul Pfeifer (1):
  ipv6: stop sending PTB packets for MTU < 1280

Hannes Frederic Sowa (2):
  ipv4: try to cache dst_entries which would cause a redirect
  ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos 
too

Herbert Xu (1):
  udp_diag: Fix socket skipping within chain

Roopa Prabhu (1):
  bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify

Saran Maruti Ramanara (1):
  net: sctp: fix passing wrong parameter header to param_type2af in 
sctp_process_param

Willem de Bruijn (1):
  ip: zero sockaddr returned on error queue

subas...@codeaurora.org (1):
  ping: Fix race in free in receive path



pgpoDzscIS90Y.pgp
Description: PGP signature


Re: Linux 3.14.34

2015-02-26 Thread Greg KH
diff --git a/Makefile b/Makefile
index b0963ca2895d..54434817f2a4 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 14
-SUBLEVEL = 33
+SUBLEVEL = 34
 EXTRAVERSION =
 NAME = Remembering Coco
 
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index ed2c8a1ed8ca..98893a8332c7 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -42,11 +42,17 @@ static int ir_lirc_decode(struct rc_dev *dev, struct 
ir_raw_event ev)
return -EINVAL;
 
/* Packet start */
-   if (ev.reset)
-   return 0;
+   if (ev.reset) {
+   /* Userspace expects a long space event before the start of
+* the signal to use as a sync.  This may be done with repeat
+* packets and normal samples.  But if a reset has been sent
+* then we assume that a long time has passed, so we send a
+* space with the maximum time value. */
+   sample = LIRC_SPACE(LIRC_VALUE_MASK);
+   IR_dprintk(2, "delivering reset sync space to lirc_dev\n");
 
/* Carrier reports */
-   if (ev.carrier_report) {
+   } else if (ev.carrier_report) {
sample = LIRC_FREQUENCY(ev.carrier);
IR_dprintk(2, "carrier report (freq: %d)\n", sample);
 
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c 
b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index afa4a1f63270..a830d42e3d9b 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -3131,7 +3131,7 @@ static int bnx2x_poll(struct napi_struct *napi, int 
budget)
}
 #endif
if (!bnx2x_fp_lock_napi(fp))
-   return work_done;
+   return budget;
 
for_each_cos_in_tx_queue(fp, cos)
if (bnx2x_tx_queue_has_work(fp->txdata_ptr[cos]))
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c 
b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index 70849dea32b1..5fa076fd439e 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2390,7 +2390,10 @@ static int netxen_nic_poll(struct napi_struct *napi, int 
budget)
 
work_done = netxen_process_rcv_ring(sds_ring, budget);
 
-   if ((work_done < budget) && tx_complete) {
+   if (!tx_complete)
+   work_done = budget;
+
+   if (work_done < budget) {
napi_complete(_ring->napi);
if (test_bit(__NX_DEV_UP, >state))
netxen_nic_enable_int(sds_ring);
diff --git a/drivers/net/ppp/ppp_deflate.c b/drivers/net/ppp/ppp_deflate.c
index 602c625d95d5..b5edc7f96a39 100644
--- a/drivers/net/ppp/ppp_deflate.c
+++ b/drivers/net/ppp/ppp_deflate.c
@@ -246,7 +246,7 @@ static int z_compress(void *arg, unsigned char *rptr, 
unsigned char *obuf,
/*
 * See if we managed to reduce the size of the packet.
 */
-   if (olen < isize) {
+   if (olen < isize && olen <= osize) {
state->stats.comp_bytes += olen;
state->stats.comp_packets++;
} else {
diff --git a/include/net/ip.h b/include/net/ip.h
index 937f19681426..3446cdd29608 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -38,11 +38,12 @@ struct inet_skb_parm {
struct ip_options   opt;/* Compiled IP options  
*/
unsigned char   flags;
 
-#define IPSKB_FORWARDED1
-#define IPSKB_XFRM_TUNNEL_SIZE 2
-#define IPSKB_XFRM_TRANSFORMED 4
-#define IPSKB_FRAG_COMPLETE8
-#define IPSKB_REROUTED 16
+#define IPSKB_FORWARDEDBIT(0)
+#define IPSKB_XFRM_TUNNEL_SIZE BIT(1)
+#define IPSKB_XFRM_TRANSFORMED BIT(2)
+#define IPSKB_FRAG_COMPLETEBIT(3)
+#define IPSKB_REROUTED BIT(4)
+#define IPSKB_DOREDIRECT   BIT(5)
 
u16 frag_max_size;
 };
@@ -174,7 +175,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct 
ip_reply_arg *arg)
return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0;
 }
 
-void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
   __be32 saddr, const struct ip_reply_arg *arg,
   unsigned int len);
 
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 80f500a29498..57c2da922952 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -47,6 +47,7 @@ struct netns_ipv4 {
struct inet_peer_base   *peers;
struct tcpm_hash_bucket *tcp_metrics_hash;
unsigned inttcp_metrics_hash_log;
+   struct sock  * __percpu *tcp_sk;
struct netns_frags  frags;
 #ifdef CONFIG_NETFILTER
struct xt_table  

Linux 3.10.70

2015-02-26 Thread Greg KH
I'm announcing the release of the 3.10.70 kernel.

All users of the 3.10 kernel series must upgrade.

The updated 3.10.y git tree can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git 
linux-3.10.y
and can be browsed at the normal kernel.org git web browser:

http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary

thanks,

greg k-h



 Makefile |2 
 drivers/block/rbd.c  |1 
 drivers/media/rc/ir-lirc-codec.c |   12 +++--
 drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c |5 +-
 drivers/net/ppp/ppp_deflate.c|2 
 include/net/ip.h |   13 ++---
 include/net/netns/ipv4.h |1 
 net/core/dev.c   |   20 ++--
 net/core/rtnetlink.c |6 ++
 net/ipv4/ip_forward.c|3 -
 net/ipv4/ip_output.c |   29 +---
 net/ipv4/ip_sockglue.c   |8 ---
 net/ipv4/ping.c  |5 +-
 net/ipv4/route.c |9 ++-
 net/ipv4/tcp_ipv4.c  |   37 +--
 net/ipv4/udp_diag.c  |4 +
 net/ipv6/datagram.c  |   10 +---
 net/ipv6/ip6_fib.c   |   45 ++-
 net/ipv6/route.c |7 --
 net/sctp/associola.c |1 
 net/sctp/sm_make_chunk.c |2 
 21 files changed, 126 insertions(+), 96 deletions(-)

Alex Elder (1):
  rbd: drop an unsafe assertion

Austin Lund (1):
  media/rc: Send sync space information on the lirc device

Daniel Borkmann (1):
  net: sctp: fix slab corruption from use after free on INIT collisions

Eric Dumazet (4):
  net: rps: fix cpu unplug
  netxen: fix netxen_nic_poll() logic
  tcp: ipv4: initialize unicast_sock sk_pacing_rate
  ipv4: tcp: get rid of ugly unicast_sock

Florian Westphal (1):
  ppp: deflate: never return len larger than output buffer

Greg Kroah-Hartman (1):
  Linux 3.10.70

Hagen Paul Pfeifer (1):
  ipv6: stop sending PTB packets for MTU < 1280

Hannes Frederic Sowa (2):
  ipv4: try to cache dst_entries which would cause a redirect
  ipv6: replacing a rt6_info needs to purge possible propagated rt6_infos 
too

Herbert Xu (1):
  udp_diag: Fix socket skipping within chain

Roopa Prabhu (1):
  bridge: dont send notification when skb->len == 0 in rtnl_bridge_notify

Saran Maruti Ramanara (1):
  net: sctp: fix passing wrong parameter header to param_type2af in 
sctp_process_param

Willem de Bruijn (1):
  ip: zero sockaddr returned on error queue

subas...@codeaurora.org (1):
  ping: Fix race in free in receive path



pgp5Ivtdq8Y1R.pgp
Description: PGP signature


Re: Linux 3.10.70

2015-02-26 Thread Greg KH
diff --git a/Makefile b/Makefile
index 81ede20061cf..402cbb7c27f1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 3
 PATCHLEVEL = 10
-SUBLEVEL = 69
+SUBLEVEL = 70
 EXTRAVERSION =
 NAME = TOSSUG Baby Fish
 
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 9951e66b8502..7e3f45105f11 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -2149,7 +2149,6 @@ static void rbd_img_obj_callback(struct rbd_obj_request 
*obj_request)
rbd_assert(img_request->obj_request_count > 0);
rbd_assert(which != BAD_WHICH);
rbd_assert(which < img_request->obj_request_count);
-   rbd_assert(which >= img_request->next_completion);
 
spin_lock_irq(_request->completion_lock);
if (which != img_request->next_completion)
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index e4561264e124..a895ed02da86 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -42,11 +42,17 @@ static int ir_lirc_decode(struct rc_dev *dev, struct 
ir_raw_event ev)
return -EINVAL;
 
/* Packet start */
-   if (ev.reset)
-   return 0;
+   if (ev.reset) {
+   /* Userspace expects a long space event before the start of
+* the signal to use as a sync.  This may be done with repeat
+* packets and normal samples.  But if a reset has been sent
+* then we assume that a long time has passed, so we send a
+* space with the maximum time value. */
+   sample = LIRC_SPACE(LIRC_VALUE_MASK);
+   IR_dprintk(2, "delivering reset sync space to lirc_dev\n");
 
/* Carrier reports */
-   if (ev.carrier_report) {
+   } else if (ev.carrier_report) {
sample = LIRC_FREQUENCY(ev.carrier);
IR_dprintk(2, "carrier report (freq: %d)\n", sample);
 
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c 
b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index af951f343ff6..50104a7e963f 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -2315,7 +2315,10 @@ static int netxen_nic_poll(struct napi_struct *napi, int 
budget)
 
work_done = netxen_process_rcv_ring(sds_ring, budget);
 
-   if ((work_done < budget) && tx_complete) {
+   if (!tx_complete)
+   work_done = budget;
+
+   if (work_done < budget) {
napi_complete(_ring->napi);
if (test_bit(__NX_DEV_UP, >state))
netxen_nic_enable_int(sds_ring);
diff --git a/drivers/net/ppp/ppp_deflate.c b/drivers/net/ppp/ppp_deflate.c
index 602c625d95d5..b5edc7f96a39 100644
--- a/drivers/net/ppp/ppp_deflate.c
+++ b/drivers/net/ppp/ppp_deflate.c
@@ -246,7 +246,7 @@ static int z_compress(void *arg, unsigned char *rptr, 
unsigned char *obuf,
/*
 * See if we managed to reduce the size of the packet.
 */
-   if (olen < isize) {
+   if (olen < isize && olen <= osize) {
state->stats.comp_bytes += olen;
state->stats.comp_packets++;
} else {
diff --git a/include/net/ip.h b/include/net/ip.h
index 8695359982d1..0a62365149e2 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -37,11 +37,12 @@ struct inet_skb_parm {
struct ip_options   opt;/* Compiled IP options  
*/
unsigned char   flags;
 
-#define IPSKB_FORWARDED1
-#define IPSKB_XFRM_TUNNEL_SIZE 2
-#define IPSKB_XFRM_TRANSFORMED 4
-#define IPSKB_FRAG_COMPLETE8
-#define IPSKB_REROUTED 16
+#define IPSKB_FORWARDEDBIT(0)
+#define IPSKB_XFRM_TUNNEL_SIZE BIT(1)
+#define IPSKB_XFRM_TRANSFORMED BIT(2)
+#define IPSKB_FRAG_COMPLETEBIT(3)
+#define IPSKB_REROUTED BIT(4)
+#define IPSKB_DOREDIRECT   BIT(5)
 
u16 frag_max_size;
 };
@@ -162,7 +163,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct 
ip_reply_arg *arg)
return (arg->flags & IP_REPLY_ARG_NOSRCCHECK) ? FLOWI_FLAG_ANYSRC : 0;
 }
 
-void ip_send_unicast_reply(struct net *net, struct sk_buff *skb, __be32 daddr,
+void ip_send_unicast_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
   __be32 saddr, const struct ip_reply_arg *arg,
   unsigned int len);
 
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 2ba9de89e8ec..03e6378d5353 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -43,6 +43,7 @@ struct netns_ipv4 {
struct inet_peer_base   *peers;
struct tcpm_hash_bucket *tcp_metrics_hash;
unsigned inttcp_metrics_hash_log;
+   struct sock  * __percpu *tcp_sk;
struct netns_frags  frags;
 #ifdef CONFIG_NETFILTER
struct xt_table *iptable_filter;
diff --git a/net/core/dev.c 

Re: [PATCH v4 4/4] phy: add phy-hi6220-usb

2015-02-26 Thread Peter Chen
On Thu, Feb 26, 2015 at 04:48:30PM +0800, zhangfei wrote:
> Hi, Roger
> 
> On 02/24/2015 06:13 PM, Roger Quadros wrote:
> >>>On Sat, Feb 21, 2015 at 11:03:05PM +0800, zhangfei wrote:
> +static void hi6220_start_peripheral(struct hi6220_priv *priv, bool 
> on)
> +{
> +struct usb_otg *otg = priv->phy.otg;
> +
> +if (!otg->gadget)
> +return;
> +
> +if (on)
> +usb_gadget_connect(otg->gadget);
> +else
> +usb_gadget_disconnect(otg->gadget);
> >>>
> >>>why is the PHY fiddling with pullups ?
> >>
> >>We use this to enable/disable otg gadget mode.
> >
> >I got that, but the pullups don't belong to the PHY, they belong to the
> >gadget.
> >
> >>The gpio_id & gpio_vbus are used to distinguish otg gadget mode or
> >>host mode.
> >>When micro usb or otg device attached to otg, gpio_vbus falling down.
> >>And gpio_id = 1 is micro usb, gpio_id = 0 is otg device.
> >
> >all of that I understood clearly :-)
> >
> >>So when micro usb attached, we enable gadget mode; while micro usb
> >>detached, we disable gadget mode, and dwc2 will automatically set to
> >>host mode.
> >
> >that's all fine, I'm concerned about letting the PHY fiddle with
> >something it doesn't own. If I am to change pullups rules in udc-core,
> >this is likely to break down miserably and I don't want to have to go
> >through that.
> 
> Thanks for the clarifying.
> >>>
> >>>no problem.
> >>>
> How about using usb_gadget_vbus_connect/disconnect, which are used in many
> files under drivers/usb/phy.
> There is no vbus_session in dwc2/gadget.c, I thought it would be same as
> pullup.
> 
> However, usb_gadget_vbus_connect still need para gadget, where should we 
> put
> this file, drivers/usb/phy or drivers/phy
> >>>
> >>>drivers/phy, if the framework misses anything you need, it's a great
> >>>opportunity to give back to the community by extending the framework.
> >>
> >>Sorry, I am a little confused.
> >>I need some concrete suggestion for the next step of this patch, which is 
> >>required for the community board, hikey board.
> >>
> >>Do you mean in the future we need use hsotg->phy instead of hsotg->uphy.
> >> struct phy *phy;
> >> struct usb_phy *uphy;
> >>usb_phy has many members that struct phy does not have, including otg.
> >>struct usb_otg  *otg;
> >>Is that mean we need port such member from usb_phy to phy.
> >
> >In my opinion otg structure should belong to the USB core part that takes 
> >care
> >of the OTG/DRD state machine. We still don't have a clear solution here and
> >I'm currently investigating this.
> >My current work is to get Dual role functionality working with DWC3 
> >controller and TI
> >platforms.
> >
> >Currently phy drivers take care of OTG operation themselves but there is an 
> >opportunity
> >to share code and centralize USB role switching.
> >The USB core should be the owner of the Host controller, Gadget controller 
> >and the OTG phy
> >and should take care of the that.
> 
> Good idea.
> If you have any patch, I will be very happy to verify.
> 
> How about adding these things in drivers/phy/phy-core.c, it is also
> sharable, though not in usb core.
> 
> Just tried adding one member struct usb_otg otg to struct phy, since
> not find any good member can hold usb_otg.
> In drivers/phy/phy-core.c, adding extcon_register_interest,
> phy_vbus_notifier, phy_set_peripheral, it works for me, dwc2 on
> hikey board.

Just thinking if we can follow struct usb_hcd and struct ehci_hcd design
way, the generic phy just like hcd, and the usb phy like ehci hcd which
is a private data for hcd. zhangfei, maybe you can have a try.

-- 

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/


[PATCH RFT] phy: exynos-mipi-video: Use spin_lock to protct state->regmap rmw operations

2015-02-26 Thread Axel Lin
The state->regmap is initialized by devm_regmap_init_mmio().
So it's fine to use spin_lock rather than mutex to protct state->regmap rmw
operations.

Signed-off-by: Axel Lin 
---
Hi Sylwester,
I don't have this hardware handy, so can you test if this patch works.
This patch is on top of my previous patch (phy: exynos-mipi-video: Fixup the 
test for state->regmap)
Thanks,
Axel
 drivers/phy/phy-exynos-mipi-video.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/phy/phy-exynos-mipi-video.c 
b/drivers/phy/phy-exynos-mipi-video.c
index d196493..8d6d117 100644
--- a/drivers/phy/phy-exynos-mipi-video.c
+++ b/drivers/phy/phy-exynos-mipi-video.c
@@ -43,7 +43,6 @@ struct exynos_mipi_video_phy {
} phys[EXYNOS_MIPI_PHYS_NUM];
spinlock_t slock;
void __iomem *regs;
-   struct mutex mutex;
struct regmap *regmap;
 };
 
@@ -59,8 +58,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy 
*state,
else
reset = EXYNOS4_MIPI_PHY_SRESETN;
 
+   spin_lock(>slock);
+
if (!IS_ERR(state->regmap)) {
-   mutex_lock(>mutex);
regmap_read(state->regmap, offset, );
if (on)
val |= reset;
@@ -72,7 +72,6 @@ static int __set_phy_state(struct exynos_mipi_video_phy 
*state,
else if (!(val & EXYNOS4_MIPI_PHY_RESET_MASK))
val &= ~EXYNOS4_MIPI_PHY_ENABLE;
regmap_write(state->regmap, offset, val);
-   mutex_unlock(>mutex);
} else {
addr = state->regs + EXYNOS_MIPI_PHY_CONTROL(id / 2);
 
@@ -90,9 +89,9 @@ static int __set_phy_state(struct exynos_mipi_video_phy 
*state,
val &= ~EXYNOS4_MIPI_PHY_ENABLE;
 
writel(val, addr);
-   spin_unlock(>slock);
}
 
+   spin_unlock(>slock);
return 0;
 }
 
@@ -158,7 +157,6 @@ static int exynos_mipi_video_phy_probe(struct 
platform_device *pdev)
 
dev_set_drvdata(dev, state);
spin_lock_init(>slock);
-   mutex_init(>mutex);
 
for (i = 0; i < EXYNOS_MIPI_PHYS_NUM; i++) {
struct phy *phy = devm_phy_create(dev, NULL,
-- 
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/


Help-desk Service Center requires your immediate re-activation of your Email

2015-02-26 Thread Enders A, Anouk
Help-desk Service Center requires your immediate re-activation of your Email

account. This is to upgrade email account to the new anti spam virus detector

sever 2014. Inability to complete this procedure will render your account

inactivate. Activate by completing the survey procedure.

CLICK LINK:  to activate.

CLICK HERE:

Thank you for using Webmail

Copyright © 2014 Webmail Help Desk

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


[PATCH] clk: qcom: Fix ipq806x LCC frequency tables

2015-02-26 Thread Stephen Boyd
These frequency tables list the wrong rates. Either they don't
have the correct frequency at all, or they're specified in kHz
instead of Hz. Fix it.

Fixes: c99e515a92e9 "clk: qcom: Add IPQ806X LPASS clock controller (LCC) driver"
Cc: Kenneth Westfield 
Signed-off-by: Stephen Boyd 
---
 drivers/clk/qcom/lcc-ipq806x.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/clk/qcom/lcc-ipq806x.c b/drivers/clk/qcom/lcc-ipq806x.c
index fb276522173a..b23f8069fac1 100644
--- a/drivers/clk/qcom/lcc-ipq806x.c
+++ b/drivers/clk/qcom/lcc-ipq806x.c
@@ -294,14 +294,14 @@ static struct clk_regmap_mux pcm_clk = {
 };
 
 static struct freq_tbl clk_tbl_aif_osr[] = {
-   {  22050, P_PLL4, 1, 147, 20480 },
-   {  32000, P_PLL4, 1,   1,96 },
-   {  44100, P_PLL4, 1, 147, 10240 },
-   {  48000, P_PLL4, 1,   1,64 },
-   {  88200, P_PLL4, 1, 147,  5120 },
-   {  96000, P_PLL4, 1,   1,32 },
-   { 176400, P_PLL4, 1, 147,  2560 },
-   { 192000, P_PLL4, 1,   1,16 },
+   {  2822400, P_PLL4, 1, 147, 20480 },
+   {  4096000, P_PLL4, 1,   1,96 },
+   {  5644800, P_PLL4, 1, 147, 10240 },
+   {  6144000, P_PLL4, 1,   1,64 },
+   { 11289600, P_PLL4, 1, 147,  5120 },
+   { 12288000, P_PLL4, 1,   1,32 },
+   { 22579200, P_PLL4, 1, 147,  2560 },
+   { 24576000, P_PLL4, 1,   1,16 },
{ },
 };
 
@@ -360,7 +360,7 @@ static struct clk_branch spdif_clk = {
 };
 
 static struct freq_tbl clk_tbl_ahbix[] = {
-   { 131072, P_PLL4, 1, 1, 3 },
+   { 131072000, P_PLL4, 1, 1, 3 },
{ },
 };
 
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] leds: Add ktd2692 flash LED driver

2015-02-26 Thread Varka Bhadram
On 02/27/2015 06:31 AM, Ingi Kim wrote:
> This patch adds a driver to support the ktd2692 flash LEDs.
> ktd2692 can control flash current by ExpressWire interface.
>
> Signed-off-by: Ingi Kim 
> ---
>   drivers/leds/Kconfig|8 ++
>   drivers/leds/Makefile   |1 +
>   drivers/leds/leds-ktd2692.c |  245 
> +++
>   3 files changed, 254 insertions(+)
>   create mode 100644 drivers/leds/leds-ktd2692.c
>
(...)

> +static struct ktd2692_context *ktd2692_parse_dt(struct device *dev)
> +{
> + struct device_node *np = dev->of_node;
> + struct ktd2692_context *led;
> +
> + led = devm_kzalloc(dev, sizeof(struct ktd2692_context), GFP_KERNEL);
> + if (!led)
> + return ERR_PTR((long)led);

What about using sizeof(*led) in place of sizeof(struct ktd2692_context)..?

Also the error return for devm_kzalloc() should be -ENOMEM.

> +
> + led->strobe_gpio = of_get_named_gpio(np, "strobe-gpio", 0);
> + if (!gpio_is_valid(led->strobe_gpio)) {
> + dev_err(dev, "no strobe_gpio property found\n");
> + return ERR_PTR(led->strobe_gpio);
> + }
> +
> + return led;
> +}
> +
> +static int ktd2692_probe(struct platform_device *pdev)
> +{
> + struct device *dev = >dev;
> + struct ktd2692_context *led;
> + int ret;
> +
> + if (!dev->of_node)
> + return -ENODEV;
> +
> + led = ktd2692_parse_dt(dev);
> + if (IS_ERR(led))
> + return PTR_ERR(led);
> +
> + led->cdev.name = KTD2692_DEFAULT_NAME;
> + led->cdev.brightness = LED_OFF;
> + led->cdev.max_brightness = LED_FULL;
> + led->cdev.flags |= LED_CORE_SUSPENDRESUME;
> + led->cdev.brightness_set = ktd2692_brightness_set;
> + led->cdev.brightness_get = ktd2692_brightness_get;
> + led->mode = KTD2692_REG_MODE_BASE | KTD2692_MODE_DISABLE;
> +
> + platform_set_drvdata(pdev, led);
> +
> + ret = led_classdev_register(>dev, >cdev);
> + if (ret) {
> + dev_err(dev, "couldn't register LED %s\n", led->cdev.name);
> + return ret;
> + }
> +
> + ret = ktd2692_brightness_set_gpio(led);
> + if (ret) {
> + led_classdev_unregister(>cdev);
> + return ret;
> + }
> +
> + ktd2692_expresswire_reset(led);
> +
> + return ret;

return 0 instead of ret...?



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


[RFC] mm: change mm_advise_free to clear page dirty

2015-02-26 Thread Wang, Yalin
This patch add ClearPageDirty() to clear AnonPage dirty flag,
the Anonpage mapcount must be 1, so that this page is only used by
the current process, not shared by other process like fork().
if not clear page dirty for this anon page, the page will never be
treated as freeable.

Signed-off-by: Yalin Wang 
---
 mm/madvise.c | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/mm/madvise.c b/mm/madvise.c
index 6d0fcb8..257925a 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -297,22 +297,17 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned 
long addr,
continue;
 
page = vm_normal_page(vma, addr, ptent);
-   if (!page)
+   if (!page || !PageAnon(page) || !trylock_page(page))
continue;
 
if (PageSwapCache(page)) {
-   if (!trylock_page(page))
+   if (!try_to_free_swap(page))
continue;
-
-   if (!try_to_free_swap(page)) {
-   unlock_page(page);
-   continue;
-   }
-
-   ClearPageDirty(page);
-   unlock_page(page);
}
 
+   if (page_mapcount(page) == 1)
+   ClearPageDirty(page);
+   unlock_page(page);
/*
 * Some of architecture(ex, PPC) don't update TLB
 * with set_pte_at and tlb_remove_tlb_entry so for
-- 
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/


Re: Re: [perf/core PATCH v5 2/4] perf buildid-cache: Add --purge FILE to remove all caches of FILE

2015-02-26 Thread Masami Hiramatsu
(2015/02/27 0:05), Arnaldo Carvalho de Melo wrote:
> Em Thu, Feb 26, 2015 at 03:54:47PM +0900, Masami Hiramatsu escreveu:
>> @@ -285,6 +308,7 @@ int cmd_buildid_cache(int argc, const char **argv,
>>  bool force = false;
>>  char const *add_name_list_str = NULL,
>> *remove_name_list_str = NULL,
>> +   *purge_name_list_str = NULL,
>> *missing_filename = NULL,
>> *update_name_list_str = NULL,
>> *kcore_filename = NULL;
>> @@ -302,6 +326,8 @@ int cmd_buildid_cache(int argc, const char **argv,
>> "file", "kcore file to add"),
>>  OPT_STRING('r', "remove", _name_list_str, "file list",
>>  "file(s) to remove"),
>> +OPT_STRING('p', "purge", _name_list_str, "path list",
>> +"path(s) to remove (remove old caches too)"),
>>  OPT_STRING('M', "missing", _filename, "file",
>> "to find missing build ids in the cache"),
>>  OPT_BOOLEAN('f', "force", , "don't complain, do it"),
>> @@ -368,6 +394,24 @@ int cmd_buildid_cache(int argc, const char **argv,
>>  }
>>  }
>>  
>> +if (purge_name_list_str) {
>> +list = strlist__new(true, purge_name_list_str);
>> +if (list) {
>> +strlist__for_each(pos, list)
>> +if (build_id_cache__purge_path(pos->s)) {
>> +if (errno == ENOENT) {
>> +pr_debug("%s wasn't in the 
>> cache\n",
>> + pos->s);
>> +continue;
>> +}
>> +pr_warning("Couldn't remove %s: %s\n",
>> +   pos->s, strerror_r(errno, 
>> sbuf, sizeof(sbuf)));
>> +}
>> +
>> +strlist__delete(list);
>> +}
> 
> Here we need to at least warn the user that what he/she asked couldn't
> be done, i.e. strlist__new() failed.

Ah, OK I'll update it.

> 
> Seeing --remove, --purge and --update makes me think eventually we need
> a OPT_STRLIST() :-) 

Agreed :)

> 
> I'm going thru the other patches, the first got in already.

Thanks!

> 
> Thanks for implementing --purge!
> 
> - Arnaldo
> 
>> +}
>> +
>>  if (missing_filename)
>>  ret = build_id_cache__fprintf_missing(session, stdout);
>>  
>> diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
>> index 0bc33be..dcaa964 100644
>> --- a/tools/perf/util/build-id.c
>> +++ b/tools/perf/util/build-id.c
>> @@ -281,35 +281,85 @@ void disable_buildid_cache(void)
>>  no_buildid_cache = true;
>>  }
>>  
>> +static char *build_id_cache__dirname_from_path(const char *name,
>> +   bool is_kallsyms, bool is_vdso)
>> +{
>> +char *realname = (char *)name, *filename;
>> +bool slash = is_kallsyms || is_vdso;
>> +
>> +if (!slash) {
>> +realname = realpath(name, NULL);
>> +if (!realname)
>> +return NULL;
>> +}
>> +
>> +if (asprintf(, "%s%s%s", buildid_dir, slash ? "/" : "",
>> + is_vdso ? DSO__NAME_VDSO : realname) < 0)
>> +filename = NULL;
>> +
>> +if (!slash)
>> +free(realname);
>> +
>> +return filename;
>> +}
>> +
>> +struct strlist *build_id_cache__list_build_ids(const char *pathname)
>> +{
>> +struct strlist *list;
>> +char *dirname;
>> +DIR *dir;
>> +struct dirent *d;
>> +
>> +list = strlist__new(true, NULL);
>> +dirname = build_id_cache__dirname_from_path(pathname, false, false);
>> +if (!list || !dirname)
>> +goto error_free;
>> +
>> +/* List up all dirents */
>> +dir = opendir(dirname);
>> +if (!dir)
>> +goto error_free;
>> +while ((d = readdir(dir)) != NULL) {
>> +if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, ".."))
>> +continue;
>> +strlist__add(list, d->d_name);
>> +}
>> +closedir(dir);
>> +
>> +free(dirname);
>> +return list;
>> +
>> +error_free:
>> +free(dirname);
>> +strlist__delete(list);
>> +return NULL;
>> +}
>> +
>>  int build_id_cache__add_s(const char *sbuild_id, const char *name,
>>bool is_kallsyms, bool is_vdso)
>>  {
>>  const size_t size = PATH_MAX;
>> -char *realname, *filename = zalloc(size),
>> +char *realname = NULL, *filename = NULL, *dirname = NULL,
>>   *linkname = zalloc(size), *targetname, *tmp;
>> -int len, err = -1;
>> -bool slash = is_kallsyms || is_vdso;
>> +int err = -1;
>>  
>> -if (is_kallsyms) {
>> -if (symbol_conf.kptr_restrict) {
>> -pr_debug("Not caching a kptr_restrict'ed 
>> /proc/kallsyms\n");
>> -err = 0;
>> -

[PATCH] x86, traps: early_trap_init() cleanup.

2015-02-26 Thread Wang Nan
As early_trap_init() doesn't use IST, replace set_intr_gate_ist(..., 0)
and set_system_intr_gate_ist(..., 0) with their standard counterparts.

set_intr_gate() requires a trace_debug symbol which we don't have and
won't use. Use a small macro trick as a workaround.

Signed-off-by: Wang Nan 
---

Hi Andy Lutomirski,

   This patch is a bit tricky, but I think we don't need to define another
   helper for such a small problem. What's your opinion?

Thank you!

---
 arch/x86/kernel/traps.c | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
index 4281988..c24434a 100644
--- a/arch/x86/kernel/traps.c
+++ b/arch/x86/kernel/traps.c
@@ -925,17 +925,22 @@ dotraplinkage void do_iret_error(struct pt_regs *regs, 
long error_code)
 /* Set of traps needed for early debugging. */
 void __init early_trap_init(void)
 {
+
/*
-* Don't set ist to DEBUG_STACK as it doesn't work until TSS is
-* ready in cpu_init() <-- trap_init(). Before trap_init(), CPU
-* runs at ring 0 so it is impossible to hit an invalid stack.
-* Using the original stack works well enough at this early
-* stage. DEBUG_STACK will be equipped after cpu_init() in
-* trap_init().
+* Don't use IST to set DEBUG_STACK as it doesn't work until TSS is
+* ready in cpu_init() <-- trap_init(). Before trap_init(), CPU runs at
+* ring 0 so it is impossible to hit an invalid stack.  Using the
+* original stack works well enough at this early stage. DEBUG_STACK
+* will be equipped after cpu_init() in trap_init().
+*
+* Since set_intr_gate() needs a trace_debug but we don't have it,
+* use the following #define as a workaround.
 */
-   set_intr_gate_ist(X86_TRAP_DB, , 0);
+#define trace_debug debug
+   set_intr_gate(X86_TRAP_DB, debug);
+#undef trace_debug
/* int3 can be called from all */
-   set_system_intr_gate_ist(X86_TRAP_BP, , 0);
+   set_system_intr_gate(X86_TRAP_BP, );
 #ifdef CONFIG_X86_32
set_intr_gate(X86_TRAP_PF, page_fault);
 #endif
@@ -1015,7 +1020,7 @@ void __init trap_init(void)
 
/*
 * X86_TRAP_DB and X86_TRAP_BP have been set
-* in early_trap_init(). However, DEBUG_STACK works only after
+* in early_trap_init(). However, ITS works only after
 * cpu_init() loads TSS. See comments in early_trap_init().
 */
set_intr_gate_ist(X86_TRAP_DB, , DEBUG_STACK);
-- 
1.8.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: [LKP] [futex] 76835b0ebf8: -8.1% will-it-scale.per_thread_ops

2015-02-26 Thread Huang Ying
Hi, Catalin,

On Thu, 2015-02-26 at 09:58 +, Catalin Marinas wrote:
> On Thu, Feb 26, 2015 at 05:16:53AM +, Huang Ying wrote:
> > FYI, we noticed the below changes on
> > 
> > git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > commit 76835b0ebf8a7fe85beb03c75121419a7dec52f0 ("futex: Ensure 
> > get_futex_key_refs() always implies a barrier")
> > 
> > 
> > testbox/testcase/testparams: lkp-wsx01/will-it-scale/performance-futex4
> > 
> > 0429fbc0bdc297d6  76835b0ebf8a7fe85beb03c751
> >   --
> >  %stddev %change %stddev
> >  \  |\
> >6314259 ±  0%  -8.1%5800079 ±  0%  will-it-scale.per_thread_ops
> >6274871 ±  0%  -8.1%5768747 ±  0%  will-it-scale.per_process_ops
> 
> This was raised before but I'm not sure we can do much about it:
> 
> https://lkml.org/lkml/2014/10/26/189

Sorry for duplicated report.

> It would be interesting to know the difference in performance with the
> code prior to commits b0c29f79ecea and 11d4616bd07f which optimised the
> futex code but missed a barrier.

I will do some test for that.

Best Regards,
Huang, Ying


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 v9 00/21] Introduce ACPI for ARM64 based on ACPI 5.1

2015-02-26 Thread Timur Tabi

On 02/25/2015 02:39 AM, Hanjun Guo wrote:

Changes since v8:


I'm still debugging it, but v9 on the 4.0-rc1 kernel crashes after 
calling the UEFI boot time services exit function.  That is, this line:


status = sys_table->boottime->exit_boot_services(handle, mmap_key);

in allocate_new_fdt_and_exit_boot() gets called, and then soon after it 
returns, the kernel crashes.  It's really early because the UEFI 
exception handler is called.


I did not have this problem with v8 patchset on 3.19.


Also, you still have a couple whitespace problems in these patches:

Applying: ARM64 / ACPI: additions of ACPI documentation for arm64
/local/mnt/workspace/linux.0/.git/rebase-apply/patch:607: new blank line 
at EOF.

+
/local/mnt/workspace/linux.0/.git/rebase-apply/patch:844: new blank line 
at EOF.

+
warning: 2 lines add whitespace errors.
Applying: Documentation: ACPI for ARM64
/local/mnt/workspace/linux.0/.git/rebase-apply/patch:517: new blank line 
at EOF.

+
warning: 1 line adds whitespace errors.


--
Sent by an employee of the Qualcomm Innovation Center, Inc.
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/


Re: [PATCH v2 06/10] mtd: pxa3xx_nand: add support for the Marvell Berlin nand controller

2015-02-26 Thread Brian Norris
On Thu, Feb 12, 2015 at 03:53:32PM +0100, Antoine Tenart wrote:
> The nand controller on Marvell Berlin SoC reuse the pxa3xx nand driver
> as it quite close. The process of sending commands can be compared to
> the one of the Marvell armada 370: read and write commands are done in
> chunks.
> 
> But the Berlin nand controller has some other specificities which
> require some modifications of the pxa3xx nand driver:
> - there are no IRQ available so we need to poll the status register: we
>   have to use our own cmdfunc Berlin function, and early on the probing
>   function.
> - PAGEPROG are very different from the one used in the pxa3xx driver,
>   so we're using a specific process for this one
> - the SEQIN command is equivalent to a READ0 command
> 
> Signed-off-by: Antoine Tenart 
> ---
>  drivers/mtd/nand/pxa3xx_nand.c | 228 
> -
>  1 file changed, 202 insertions(+), 26 deletions(-)
> 
> diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
> index 8ed045195d31..a74ce08ea95e 100644
> --- a/drivers/mtd/nand/pxa3xx_nand.c
> +++ b/drivers/mtd/nand/pxa3xx_nand.c

> @@ -244,10 +249,11 @@ module_param(use_dma, bool, 0444);
>  MODULE_PARM_DESC(use_dma, "enable DMA for data transferring to/from NAND 
> HW");
>  
>  static struct pxa3xx_nand_timing timing[] = {
> - { 40, 80, 60, 100, 80, 100, 9, 400, 40, },
> - { 10,  0, 20,  40, 30,  40, 11123, 110, 10, },
> - { 10, 25, 15,  25, 15,  30, 25000,  60, 10, },
> - { 10, 35, 15,  25, 15,  25, 25000,  60, 10, },
> + { 40, 80, 60, 100, 80, 100,  9, 400, 40, },
> + { 10,  0, 20,  40, 30,  40,  11123, 110, 10, },
> + { 10, 25, 15,  25, 15,  30,  25000,  60, 10, },
> + { 10, 35, 15,  25, 15,  25,  25000,  60, 10, },
> + {  5, 20, 10,  12, 10,  12, 20, 120, 10, },

I thought I already made it clear that I'm not adding more to these
tables. Please rewrite this to use
onfi_async_timing_mode_to_sdr_timings() helpers

http://lists.infradead.org/pipermail/linux-mtd/2015-February/057726.html

>  };
>  
>  static struct pxa3xx_nand_flash builtin_flash_types[] = {
> @@ -260,6 +266,12 @@ static struct pxa3xx_nand_flash builtin_flash_types[] = {
>  { "512MiB 8-bit",  0xdc2c,  64, 2048,  8,  8, 4096, [2] },
>  { "512MiB 16-bit", 0xcc2c,  64, 2048, 16, 16, 4096, [2] },
>  { "256MiB 16-bit", 0xba20,  64, 2048, 16, 16, 2048, [3] },
> +{ },
> +};
> +
> +static struct pxa3xx_nand_flash berlin_builtin_flash_types[] = {
> +{ "4GiB 8-bit",0xd7ec, 128, 8192,  8,  8, 4096, [4] },
> +{ },
>  };
>  
>  static u8 bbt_pattern[] = {'M', 'V', 'B', 'b', 't', '0' };
> @@ -320,6 +332,18 @@ static struct nand_ecclayout ecc_layout_4KB_bch8bit = {
>   .oobfree = { }
>  };
>  
> +static struct nand_ecclayout ecc_layout_oob_128 = {
> +.eccbytes = 48,
> +.eccpos = {
> +   80, 81, 82, 83, 84, 85, 86, 87,
> +   88, 89, 90, 91, 92, 93, 94, 95,
> +   96, 97, 98, 99, 100, 101, 102, 103,
> +   104, 105, 106, 107, 108, 109, 110, 111,
> +   112, 113, 114, 115, 116, 117, 118, 119,
> +   120, 121, 122, 123, 124, 125, 126, 127},
> +.oobfree = { {.offset = 2, .length = 78} }
> +};

^^^ The indentation is all wrong in the above. Please use tabs.

> +
>  /* Define a default flash type setting serve as flash detecting only */
>  #define DEFAULT_FLASH_TYPE (_flash_types[0])
>  
> @@ -1452,19 +1621,24 @@ static int pxa3xx_nand_scan(struct mtd_info *mtd)
>   return -EINVAL;
>   }
>  
> - num = ARRAY_SIZE(builtin_flash_types) + pdata->num_flash - 1;
> - for (i = 0; i < num; i++) {
> - if (i < pdata->num_flash)
> - f = pdata->flash + i;
> - else
> - f = _flash_types[i - pdata->num_flash + 1];
> + if (info->variant == PXA3XX_NAND_VARIANT_BERLIN2)
> + flash_types = berlin_builtin_flash_types;
> + else
> + flash_types = builtin_flash_types;
>  
> - /* find the chip in default list */
> + for (i = 0; i < pdata->num_flash; i++) {
> + f = pdata->flash + i;
>   if (f->chip_id == id)
>   break;
>   }
>  
> - if (i >= (ARRAY_SIZE(builtin_flash_types) + pdata->num_flash - 1)) {
> + if (f == NULL) {

The style is typically just to do:

if (!f) {

> + for (i = 0; (f = _types[i]); i++)
> + if (f->chip_id == id)
> + break;
> + }
> +
> + if (f == NULL) {

Same.

>   dev_err(>pdev->dev, "ERROR!! flash not defined!!!\n");
>  
>   return -EINVAL;
> @@ -1516,9 +1690,11 @@ KEEP_CONFIG:
>* (aka splitted) command handling,
>*/
>   if (mtd->writesize > PAGE_CHUNK_SIZE) {
> - if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370) {
> + if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370)

[PATCH 0/5] split ET_DYN ASLR from mmap ASLR

2015-02-26 Thread Kees Cook
This separates ET_DYN ASLR from mmap ASLR, as already done on s390. The
various architectures that are already randomizing mmap (arm, arm64, mips,
powerpc, s390, and x86), have their various forms of arch_mmap_rnd()
made available via the new CONFIG_ARCH_HAS_ELF_RANDOMIZE. For these
architectures, arch_randomize_brk() is collapsed as well.

This is an alternative to the solutions in:
https://lkml.org/lkml/2015/2/23/442

Thanks!

-Kees

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 5/5] mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE

2015-02-26 Thread Kees Cook
On architectures that define CONFIG_ARCH_HAS_ELF_RANDOMIZE, collapse the
function declarations while continuing to handle CONFIG_COMPAT_BRK.

Signed-off-by: Kees Cook 
---
 arch/Kconfig   |  1 +
 arch/arm/include/asm/elf.h |  4 
 arch/arm64/include/asm/elf.h   |  4 
 arch/mips/include/asm/elf.h|  4 
 arch/powerpc/include/asm/elf.h |  4 
 arch/s390/include/asm/elf.h|  3 ---
 arch/x86/include/asm/elf.h |  3 ---
 fs/binfmt_elf.c|  4 +---
 include/linux/elf-randomize.h  | 12 
 9 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/arch/Kconfig b/arch/Kconfig
index e315cc79ebe7..1c7e98f137db 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -490,6 +490,7 @@ config ARCH_HAS_ELF_RANDOMIZE
  An architecture supports choosing randomized locations for
  stack, mmap, brk, and ET_DYN. Defined functions:
  - arch_mmap_rnd(), must respect (current->flags & PF_RANDOMIZE)
+ - arch_randomize_brk()
 
 #
 # ABI hall of shame
diff --git a/arch/arm/include/asm/elf.h b/arch/arm/include/asm/elf.h
index afb9cafd3786..c1ff8ab12914 100644
--- a/arch/arm/include/asm/elf.h
+++ b/arch/arm/include/asm/elf.h
@@ -125,10 +125,6 @@ int dump_task_regs(struct task_struct *t, elf_gregset_t 
*elfregs);
 extern void elf_set_personality(const struct elf32_hdr *);
 #define SET_PERSONALITY(ex)elf_set_personality(&(ex))
 
-struct mm_struct;
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
 #ifdef CONFIG_MMU
 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
 struct linux_binprm;
diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index f724db00b235..faad6df49e5b 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -156,10 +156,6 @@ extern int arch_setup_additional_pages(struct linux_binprm 
*bprm,
 #define STACK_RND_MASK (0x3 >> (PAGE_SHIFT - 12))
 #endif
 
-struct mm_struct;
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
 #ifdef CONFIG_COMPAT
 
 #ifdef __AARCH64EB__
diff --git a/arch/mips/include/asm/elf.h b/arch/mips/include/asm/elf.h
index 535f196ffe02..31d747d46a23 100644
--- a/arch/mips/include/asm/elf.h
+++ b/arch/mips/include/asm/elf.h
@@ -410,10 +410,6 @@ struct linux_binprm;
 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
   int uses_interp);
 
-struct mm_struct;
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
 struct arch_elf_state {
int fp_abi;
int interp_fp_abi;
diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index 57d289acb803..ee46ffef608e 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -128,10 +128,6 @@ extern int arch_setup_additional_pages(struct linux_binprm 
*bprm,
(0x7ff >> (PAGE_SHIFT - 12)) : \
(0x3 >> (PAGE_SHIFT - 12)))
 
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
-
 #ifdef CONFIG_SPU_BASE
 /* Notes used in ET_CORE. Note name is "SPU//". */
 #define NT_SPU 1
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 617f7fabdb0a..7cc271003ff6 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -226,9 +226,6 @@ struct linux_binprm;
 #define ARCH_HAS_SETUP_ADDITIONAL_PAGES 1
 int arch_setup_additional_pages(struct linux_binprm *, int);
 
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
 void *fill_cpu_elf_notes(void *ptr, struct save_area *sa, __vector128 *vxrs);
 
 #endif
diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h
index ca3347a9dab5..bbdace22daf8 100644
--- a/arch/x86/include/asm/elf.h
+++ b/arch/x86/include/asm/elf.h
@@ -338,9 +338,6 @@ extern int compat_arch_setup_additional_pages(struct 
linux_binprm *bprm,
  int uses_interp);
 #define compat_arch_setup_additional_pages compat_arch_setup_additional_pages
 
-extern unsigned long arch_randomize_brk(struct mm_struct *mm);
-#define arch_randomize_brk arch_randomize_brk
-
 /*
  * True on X86_32 or when emulating IA32 on X86_64
  */
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index 203c2e6f9a25..96459c18d1eb 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -1041,15 +1041,13 @@ static int load_elf_binary(struct linux_binprm *bprm)
current->mm->end_data = end_data;
current->mm->start_stack = bprm->p;
 
-#ifdef arch_randomize_brk
if ((current->flags & PF_RANDOMIZE) && (randomize_va_space > 1)) {
current->mm->brk = current->mm->start_brk =
arch_randomize_brk(current->mm);
-#ifdef CONFIG_COMPAT_BRK
+#ifdef compat_brk_randomized
 

[PATCH 1/5] arm: factor out mmap ASLR into mmap_rnd

2015-02-26 Thread Kees Cook
Move logic for mmap ASLR into separate function.

Signed-off-by: Kees Cook 
---
 arch/arm/mm/mmap.c | 13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index 5e85ed371364..0f8bc158f2c6 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -169,14 +169,21 @@ arch_get_unmapped_area_topdown(struct file *filp, const 
unsigned long addr0,
return addr;
 }
 
-void arch_pick_mmap_layout(struct mm_struct *mm)
+static unsigned long mmap_rnd(void)
 {
-   unsigned long random_factor = 0UL;
+   unsigned long rnd = 0UL;
 
/* 8 bits of randomness in 20 address space bits */
if ((current->flags & PF_RANDOMIZE) &&
!(current->personality & ADDR_NO_RANDOMIZE))
-   random_factor = (get_random_int() % (1 << 8)) << PAGE_SHIFT;
+   rnd = (get_random_int() % (1 << 8)) << PAGE_SHIFT;
+
+   return rnd;
+}
+
+void arch_pick_mmap_layout(struct mm_struct *mm)
+{
+   unsigned long random_factor = mmap_rnd();
 
if (mmap_is_legacy()) {
mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
-- 
1.9.1

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


[PATCH 3/5] mm: move randomize_et_dyn into ELF_ET_DYN_BASE

2015-02-26 Thread Kees Cook
This moves s390's randomize_et_dyn base into ELF_ET_DYN_BASE, and removes
an unused arm64 extern.

Signed-off-by: Kees Cook 
---
 arch/arm64/include/asm/elf.h |  1 -
 arch/s390/include/asm/elf.h  |  9 +
 arch/s390/mm/mmap.c  | 11 ---
 3 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/arch/arm64/include/asm/elf.h b/arch/arm64/include/asm/elf.h
index 1f65be393139..f724db00b235 100644
--- a/arch/arm64/include/asm/elf.h
+++ b/arch/arm64/include/asm/elf.h
@@ -125,7 +125,6 @@ typedef struct user_fpsimd_state elf_fpregset_t;
  * the loader.  We need to make sure that it is out of the way of the program
  * that it will "exec", and that there is sufficient room for the brk.
  */
-extern unsigned long randomize_et_dyn(unsigned long base);
 #define ELF_ET_DYN_BASE(2 * TASK_SIZE_64 / 3)
 
 /*
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index c9df40b5c0ac..9ed68e7ee856 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -161,10 +161,11 @@ extern unsigned int vdso_enabled;
 /* This is the location that an ET_DYN program is loaded if exec'ed.  Typical
use of this is to invoke "./ld.so someprog" to test out a new version of
the loader.  We need to make sure that it is out of the way of the program
-   that it will "exec", and that there is sufficient room for the brk.  */
-
-extern unsigned long randomize_et_dyn(void);
-#define ELF_ET_DYN_BASErandomize_et_dyn()
+   that it will "exec", and that there is sufficient room for the brk. 64-bit
+   tasks are aligned to 4GB. */
+#define ELF_ET_DYN_BASE (arch_mmap_rnd() + (is_32bit_task() ? \
+   (STACK_TOP / 3 * 2) : \
+   (STACK_TOP / 3 * 2) & ~((1UL << 32) - 1)))
 
 /* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. */
diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
index 77759e35671b..ec4c20448aef 100644
--- a/arch/s390/mm/mmap.c
+++ b/arch/s390/mm/mmap.c
@@ -179,17 +179,6 @@ arch_get_unmapped_area_topdown(struct file *filp, const 
unsigned long addr0,
return addr;
 }
 
-unsigned long randomize_et_dyn(void)
-{
-   unsigned long base;
-
-   base = STACK_TOP / 3 * 2;
-   if (!is_32bit_task())
-   /* Align to 4GB */
-   base &= ~((1UL << 32) - 1);
-   return base + arch_mmap_rnd();
-}
-
 #ifndef CONFIG_64BIT
 
 /*
-- 
1.9.1

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


[PATCH 2/5] mm: expose arch_mmap_rnd when available

2015-02-26 Thread Kees Cook
When an architecture fully supports randomizing the ELF load location, the
arch_mmap_rnd() function becomes available. Rename and expose these functions
where they exist. Introduces CONFIG_ARCH_HAS_ELF_RANDOMIZE.

Signed-off-by: Kees Cook 
---
 arch/Kconfig  |  7 +++
 arch/arm/Kconfig  |  1 +
 arch/arm/mm/mmap.c|  4 ++--
 arch/arm64/Kconfig|  1 +
 arch/arm64/mm/mmap.c  |  4 ++--
 arch/mips/Kconfig |  1 +
 arch/mips/mm/mmap.c   |  9 ++---
 arch/powerpc/Kconfig  |  1 +
 arch/powerpc/mm/mmap.c|  4 ++--
 arch/s390/Kconfig |  1 +
 arch/s390/mm/mmap.c   |  8 
 arch/x86/Kconfig  |  1 +
 arch/x86/mm/mmap.c|  6 +++---
 fs/binfmt_elf.c   |  1 +
 include/linux/elf-randomize.h | 10 ++
 15 files changed, 43 insertions(+), 16 deletions(-)
 create mode 100644 include/linux/elf-randomize.h

diff --git a/arch/Kconfig b/arch/Kconfig
index 05d7a8a458d5..e315cc79ebe7 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -484,6 +484,13 @@ config HAVE_IRQ_EXIT_ON_IRQ_STACK
  This spares a stack switch and improves cache usage on softirq
  processing.
 
+config ARCH_HAS_ELF_RANDOMIZE
+   bool
+   help
+ An architecture supports choosing randomized locations for
+ stack, mmap, brk, and ET_DYN. Defined functions:
+ - arch_mmap_rnd(), must respect (current->flags & PF_RANDOMIZE)
+
 #
 # ABI hall of shame
 #
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 9f1f09a2bc9b..248d99cabaa8 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -3,6 +3,7 @@ config ARM
default y
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+   select ARCH_HAS_ELF_RANDOMIZE
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
select ARCH_HAVE_CUSTOM_GPIO_H
select ARCH_HAS_GCOV_PROFILE_ALL
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index 0f8bc158f2c6..3c1fedb034bb 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -169,7 +169,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const 
unsigned long addr0,
return addr;
 }
 
-static unsigned long mmap_rnd(void)
+unsigned long arch_mmap_rnd(void)
 {
unsigned long rnd = 0UL;
 
@@ -183,7 +183,7 @@ static unsigned long mmap_rnd(void)
 
 void arch_pick_mmap_layout(struct mm_struct *mm)
 {
-   unsigned long random_factor = mmap_rnd();
+   unsigned long random_factor = arch_mmap_rnd();
 
if (mmap_is_legacy()) {
mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 1b8e97331ffb..5f469095e0e2 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -2,6 +2,7 @@ config ARM64
def_bool y
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
+   select ARCH_HAS_ELF_RANDOMIZE
select ARCH_HAS_GCOV_PROFILE_ALL
select ARCH_HAS_SG_CHAIN
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/arm64/mm/mmap.c b/arch/arm64/mm/mmap.c
index 54922d1275b8..b7117cb4bc07 100644
--- a/arch/arm64/mm/mmap.c
+++ b/arch/arm64/mm/mmap.c
@@ -47,7 +47,7 @@ static int mmap_is_legacy(void)
return sysctl_legacy_va_layout;
 }
 
-static unsigned long mmap_rnd(void)
+unsigned long arch_mmap_rnd(void)
 {
unsigned long rnd = 0;
 
@@ -66,7 +66,7 @@ static unsigned long mmap_base(void)
else if (gap > MAX_GAP)
gap = MAX_GAP;
 
-   return PAGE_ALIGN(STACK_TOP - gap - mmap_rnd());
+   return PAGE_ALIGN(STACK_TOP - gap - arch_mmap_rnd());
 }
 
 /*
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index c7a16904cd03..72ce5cece768 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -24,6 +24,7 @@ config MIPS
select HAVE_DEBUG_KMEMLEAK
select HAVE_SYSCALL_TRACEPOINTS
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
+   select ARCH_HAS_ELF_RANDOMIZE
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
select RTC_LIB if !MACH_LOONGSON
select GENERIC_ATOMIC64 if !64BIT
diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c
index f1baadd56e82..d32490d99671 100644
--- a/arch/mips/mm/mmap.c
+++ b/arch/mips/mm/mmap.c
@@ -164,9 +164,12 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
}
 }
 
-static inline unsigned long brk_rnd(void)
+unsigned long arch_mmap_rnd(void)
 {
-   unsigned long rnd = get_random_int();
+   unsigned long rnd = 0;
+
+   if (current->flags & PF_RANDOMIZE)
+   rnd = get_random_int();
 
rnd = rnd << PAGE_SHIFT;
/* 8MB for 32bit, 256MB for 64bit */
@@ -183,7 +186,7 @@ unsigned long arch_randomize_brk(struct mm_struct *mm)
unsigned long base = mm->brk;
unsigned long ret;
 
-   ret = PAGE_ALIGN(base + brk_rnd());
+   ret = 

[PATCH 4/5] mm: split ET_DYN ASLR from mmap ASLR

2015-02-26 Thread Kees Cook
This moves arch_mmap_rnd() into the ELF loader for handling ET_DYN ASLR
in a separate region from mmap ASLR, as already done on s390. Removes
CONFIG_BINFMT_ELF_RANDOMIZE_PIE.

Reported-by: Hector Marco-Gisbert 
Signed-off-by: Kees Cook 
---
 arch/arm/Kconfig|  1 -
 arch/arm64/Kconfig  |  1 -
 arch/mips/Kconfig   |  1 -
 arch/powerpc/Kconfig|  1 -
 arch/s390/include/asm/elf.h |  4 ++--
 arch/x86/Kconfig|  1 -
 fs/Kconfig.binfmt   |  3 ---
 fs/binfmt_elf.c | 17 ++---
 8 files changed, 4 insertions(+), 25 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 248d99cabaa8..e2f0ef9c6ee3 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1,7 +1,6 @@
 config ARM
bool
default y
-   select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select ARCH_HAS_ELF_RANDOMIZE
select ARCH_HAS_TICK_BROADCAST if GENERIC_CLOCKEVENTS_BROADCAST
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 5f469095e0e2..07e0fc7adc88 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -1,6 +1,5 @@
 config ARM64
def_bool y
-   select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
select ARCH_HAS_ELF_RANDOMIZE
select ARCH_HAS_GCOV_PROFILE_ALL
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 72ce5cece768..557c5f1772c1 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -23,7 +23,6 @@ config MIPS
select HAVE_KRETPROBES
select HAVE_DEBUG_KMEMLEAK
select HAVE_SYSCALL_TRACEPOINTS
-   select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ELF_RANDOMIZE
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
select RTC_LIB if !MACH_LOONGSON
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 14fe1c411489..910fa4f9ad1e 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -88,7 +88,6 @@ config PPC
select ARCH_MIGHT_HAVE_PC_PARPORT
select ARCH_MIGHT_HAVE_PC_SERIO
select BINFMT_ELF
-   select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ELF_RANDOMIZE
select OF
select OF_EARLY_FLATTREE
diff --git a/arch/s390/include/asm/elf.h b/arch/s390/include/asm/elf.h
index 9ed68e7ee856..617f7fabdb0a 100644
--- a/arch/s390/include/asm/elf.h
+++ b/arch/s390/include/asm/elf.h
@@ -163,9 +163,9 @@ extern unsigned int vdso_enabled;
the loader.  We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. 64-bit
tasks are aligned to 4GB. */
-#define ELF_ET_DYN_BASE (arch_mmap_rnd() + (is_32bit_task() ? \
+#define ELF_ET_DYN_BASE(is_32bit_task() ? \
(STACK_TOP / 3 * 2) : \
-   (STACK_TOP / 3 * 2) & ~((1UL << 32) - 1)))
+   (STACK_TOP / 3 * 2) & ~((1UL << 32) - 1))
 
 /* This yields a mask that user programs can use to figure out what
instruction set this CPU supports. */
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 9aa91727fbf8..328be0fab910 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -87,7 +87,6 @@ config X86
select HAVE_ARCH_KMEMCHECK
select HAVE_ARCH_KASAN if X86_64 && SPARSEMEM_VMEMMAP
select HAVE_USER_RETURN_NOTIFIER
-   select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select ARCH_HAS_ELF_RANDOMIZE
select HAVE_ARCH_JUMP_LABEL
select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
diff --git a/fs/Kconfig.binfmt b/fs/Kconfig.binfmt
index 270c48148f79..2d0cbbd14cfc 100644
--- a/fs/Kconfig.binfmt
+++ b/fs/Kconfig.binfmt
@@ -27,9 +27,6 @@ config COMPAT_BINFMT_ELF
bool
depends on COMPAT && BINFMT_ELF
 
-config ARCH_BINFMT_ELF_RANDOMIZE_PIE
-   bool
-
 config ARCH_BINFMT_ELF_STATE
bool
 
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index b1c5ef5d9322..203c2e6f9a25 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -910,21 +910,8 @@ static int load_elf_binary(struct linux_binprm *bprm)
 * default mmap base, as well as whatever program they
 * might try to exec.  This is because the brk will
 * follow the loader, and is not movable.  */
-#ifdef CONFIG_ARCH_BINFMT_ELF_RANDOMIZE_PIE
-   /* Memory randomization might have been switched off
-* in runtime via sysctl or explicit setting of
-* personality flags.
-* If that is the case, retain the original non-zero
-* load_bias value in order to establish proper
-* non-randomized mappings.
-*/
-   if (current->flags & PF_RANDOMIZE)
-   load_bias = 0;
-   else
-   

Re: [patch 1/2] mm: remove GFP_THISNODE

2015-02-26 Thread David Rientjes
On Thu, 26 Feb 2015, Vlastimil Babka wrote:

> > NOTE: this is not about __GFP_THISNODE, this is only about GFP_THISNODE.
> > 
> > GFP_THISNODE is a secret combination of gfp bits that have different
> > behavior than expected.  It is a combination of __GFP_THISNODE,
> > __GFP_NORETRY, and __GFP_NOWARN and is special-cased in the page allocator
> > slowpath to fail without trying reclaim even though it may be used in
> > combination with __GFP_WAIT.
> > 
> > An example of the problem this creates: commit e97ca8e5b864 ("mm: fix 
> > GFP_THISNODE callers and clarify") fixed up many users of GFP_THISNODE
> > that really just wanted __GFP_THISNODE.  The problem doesn't end there,
> > however, because even it was a no-op for alloc_misplaced_dst_page(),
> > which also sets __GFP_NORETRY and __GFP_NOWARN, and
> > migrate_misplaced_transhuge_page(), where __GFP_NORETRY and __GFP_NOWAIT
> > is set in GFP_TRANSHUGE.  Converting GFP_THISNODE to __GFP_THISNODE is
> > a no-op in these cases since the page allocator special-cases
> > __GFP_THISNODE && __GFP_NORETRY && __GFP_NOWARN.
> > 
> > It's time to just remove GFP_TRANSHUGE entirely.  We leave __GFP_THISNODE
> 
>   ^THISNODE :) Although yes, it would be nice if 
> we
> could replace the GFP_TRANSHUGE magic checks as well.
> 

Haha, I referenced GFP_TRANSHUGE twice here when I meant GFP_THISNODE, I 
must want to fix that up as well.

> > to restrict an allocation to a local node, but remove GFP_TRANSHUGE and
> > it's obscurity.  Instead, we require that a caller clear __GFP_WAIT if it
> > wants to avoid reclaim.
> > 
> > This allows the aforementioned functions to actually reclaim as they
> > should.  It also enables any future callers that want to do
> > __GFP_THISNODE but also __GFP_NORETRY && __GFP_NOWARN to reclaim.  The
> > rule is simple: if you don't want to reclaim, then don't set __GFP_WAIT.
> 
> So, I agree with the intention, but this has some subtle implications that
> should be mentioned/decided. The check for GFP_THISNODE in
> __alloc_pages_slowpath() comes earlier than the check for __GFP_WAIT. So the
> differences will be:
> 
> 1) We will now call wake_all_kswapds(), unless __GFP_NO_KSWAPD is passed, 
> which
> is only done for hugepages and some type of i915 allocation. Do we want the
> opportunistic attempts from slab to wake up kswapds or do we pass the flag?
> 
> 2) There will be another attempt on get_page_from_freelist() with different
> alloc_flags than in the fast path attempt. Without __GFP_WAIT (and also, 
> again,
> __GFP_KSWAPD, since your commit b104a35d32, which is another subtle check for
> hugepage allocations btw), it will consider the allocation atomic and add
> ALLOC_HARDER flag, unless __GFP_NOMEMALLOC is in __gfp_flags - it seems it's
> generally not. It will also clear ALLOC_CPUSET, which was the concern of
> b104a35d32. However, if I look at __cpuset_node_allowed(), I see that it's
> always true for __GFP_THISNODE, which makes me question commit b104a35d32 in
> light of your patch 2/2 and generally the sanity of all these flags and my
> career choice.
> 

Do we do either of these?  gfp_exact_node() sets __GFP_THISNODE and clears 
__GFP_WAIT which will make the new conditional trigger immediately for 
NUMA configs.

Existing callers of GFP_KERNEL | __GFP_THISNODE aren't impacted and 
net/openvswitch/flow.c is mentioned in the changelog as actually wanting 
GFP_NOWAIT | __GFP_THISNODE so that this early check still fails.

> Ugh :)
> 

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


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

2015-02-26 Thread Stephen Rothwell
Hi Mike,

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

In file included from include/trace/define_trace.h:90:0,
 from include/trace/events/clk.h:198,
 from drivers/clk/clk.c:26:
include/trace/events/clk.h: In function 'ftrace_get_offsets_clk':
include/trace/events/clk.h:30:40: error: dereferencing pointer to incomplete 
type
   __string(name,   core->name   )
^
include/trace/ftrace.h:465:2: note: in definition of macro 'DECLARE_EVENT_CLASS'
  tstruct;   \
  ^
include/trace/events/clk.h:29:2: note: in expansion of macro 'TP_STRUCT__entry'
  TP_STRUCT__entry(
  ^
include/trace/ftrace.h:430:29: note: in expansion of macro '__dynamic_array'
 #define __string(item, src) __dynamic_array(char, item,   \
 ^
include/trace/events/clk.h:30:3: note: in expansion of macro '__string'
   __string(name,   core->name   )
   ^

and many more ...

Caused by commit 0742a46667e3 ("clk: Add tracepoints for hardware
operations").

I have used the version of the clk tree from next-20150225 for today
(since yesterday's tree had a different build problem).
-- 
Cheers,
Stephen Rothwells...@canb.auug.org.au


pgp0OX8E4WBRD.pgp
Description: OpenPGP digital signature


Re: Regression in v4.0.0-rc1 with Android Binder

2015-02-26 Thread David Rientjes
On Thu, 26 Feb 2015, Arve Hjønnevåg wrote:

> > --8<--
> > --- a/drivers/android/binder.c
> > +++ b/drivers/android/binder.c
> > @@ -601,6 +601,7 @@ static int binder_update_page_range(struct
> > binder_proc *proc, int allocate,
> > goto err_alloc_page_failed;
> > }
> > tmp_area.addr = page_addr;
> > +   tmp_area.flags &= ~VM_NO_GUARD;
> 
> This variable is not initialized, so I would expect this to add a
> warning. Setting it to VM_NO_GUARD and removing, " + PAGE_SIZE /*
> guard page? */" fromt he next line would be better. However, the "new"
> map_kernel_range_noflush api seems like a better api to use for this,
> since it removes the need to create a dummy vm_struct at all.
> 

Yeah, this is what you want to do and it's a bug in commit 71394fe50146 
("mm: vmalloc: add flag preventing guard hole allocation") that started to 
look at tmp_area.size without fixing up any of the callers when 
tmp_area.addr and tmp_area.size were only important in the past.  It 
shouldn't take much work to make this use map_kernel_range_noflush().

> > tmp_area.size = PAGE_SIZE + PAGE_SIZE /* guard page? */;
> > ret = map_vm_area(_area, PAGE_KERNEL, page);
> > if (ret) {
> > -->8--

[PATCH] staging: lustre: fld_request.c: Remove else after return.

2015-02-26 Thread Alberto Pires de Oliveira Neto
very sorry for the html patch. It was my first one.

Signed-off-by: Alberto Pires de Oliveira Neto 
---
 drivers/staging/lustre/lustre/fld/fld_request.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c 
b/drivers/staging/lustre/lustre/fld/fld_request.c
index b8d17e1..0b00301 100644
--- a/drivers/staging/lustre/lustre/fld/fld_request.c
+++ b/drivers/staging/lustre/lustre/fld/fld_request.c
@@ -217,10 +217,9 @@ int fld_client_add_target(struct lu_client_fld *fld,
CERROR("%s: Attempt to add target %s (idx %llu) on fly - skip 
it\n",
fld->lcf_name, name, tar->ft_idx);
return 0;
-   } else {
-   CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
-  fld->lcf_name, name, tar->ft_idx);
-   }
+   } 
+   CDEBUG(D_INFO, "%s: Adding target %s (idx %llu)\n",
+   fld->lcf_name, name, tar->ft_idx);
 
OBD_ALLOC_PTR(target);
if (target == NULL)
-- 
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: [tip:x86/asm] x86/traps: Enable DEBUG_STACK after cpu_init() for TRAP_DB/BP

2015-02-26 Thread Andy Lutomirski
On Thu, Feb 26, 2015 at 6:21 PM, Wang Nan  wrote:
> On 2015/2/26 23:12, Andy Lutomirski wrote:
>> On Thu, Feb 26, 2015 at 5:12 AM, tip-bot for Wang Nan  
>> wrote:
>>> Commit-ID:  b4d8327024637cb2a1f7910dcb5d0ad7a096f473
>>> Gitweb: 
>>> http://git.kernel.org/tip/b4d8327024637cb2a1f7910dcb5d0ad7a096f473
>>> Author: Wang Nan 
>>> AuthorDate: Thu, 26 Feb 2015 13:49:39 +0800
>>> Committer:  Ingo Molnar 
>>> CommitDate: Thu, 26 Feb 2015 12:29:20 +0100
>>>
>>> x86/traps: Enable DEBUG_STACK after cpu_init() for TRAP_DB/BP
>>>
>>> Before this patch early_trap_init() installs DEBUG_STACK for
>>> X86_TRAP_BP and X86_TRAP_DB. However, DEBUG_STACK doesn't work
>>> correctly until cpu_init() <-- trap_init().
>>>
>>> This patch passes 0 to set_intr_gate_ist() and
>>> set_system_intr_gate_ist() instead of DEBUG_STACK to let it use
>>> same stack as kernel, and installs DEBUG_STACK for them in
>>> trap_init().
>>>
>>
>> Sorry, I'm late to the party.  This patch, while technically correct
>> AFAICT, is really ugly, because the whole point is that it *doesn't*
>> use ist.  In other words:
>>
>>> +   set_intr_gate_ist(X86_TRAP_DB, , 0);
>>
>> That should be set_intr_gate(X86_TRAP_DB, );
>>
>
> I considered this, but found that set_intr_gate() and set_intr_gate_ist(..., 
> 0)
> behaviors differently: set_intr_gate() -> _trace_set_gate() requires 
> 'trace_##addr'
> to be installed to trace_idt_table, while set_intr_gate_ist(..., 0) puts 
> 'addr'.
> into trace_idt_table() through _set_gate().
> Therefore, if we want to use set_intr_gate() we need to provide a trace_debug 
> entry
> for it, which will be overwritten in trap_init() so it is in fact a useless 
> symbol.

Yuck.  Then IMO we should have a separate helper for this.  Better
yet, we should rename set_intr_gate, because this distinction could
easily be overlooked.

>
> Anyway, I'd like to post a v3 patch follow your advise. Please keep an eye on 
> it.
>
> Thank you!
>
>>> /* int3 can be called from all */
>>> -   set_system_intr_gate_ist(X86_TRAP_BP, , DEBUG_STACK);
>>> +   set_system_intr_gate_ist(X86_TRAP_BP, , 0);
>>
>> Similarly, this should be set_system_gate.
>>
>>>  #ifdef CONFIG_X86_32
>>> set_intr_gate(X86_TRAP_PF, page_fault);
>>>  #endif
>>> @@ -1005,6 +1013,15 @@ void __init trap_init(void)
>>>  */
>>> cpu_init();
>>>
>>> +   /*
>>> +* X86_TRAP_DB and X86_TRAP_BP have been set
>>> +* in early_trap_init(). However, DEBUG_STACK works only after
>>> +* cpu_init() loads TSS. See comments in early_trap_init().
>>
>> It's not that DEBUG_STACK only works after the TSS is loaded; it's
>> that the IST mechanism only works after TSS is loaded.
>>
>> --Andy
>>
>
>



-- 
Andy Lutomirski
AMA Capital Management, LLC
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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 4/4] powerpc/mpic: remove unused functions

2015-02-26 Thread Arseny Solokha
> @@ -1676,31 +1666,6 @@ void __init mpic_init(struct mpic *mpic)
>   mpic_err_int_init(mpic, MPIC_FSL_ERR_INT);
>  }
>  
> -void __init mpic_set_clk_ratio(struct mpic *mpic, u32 clock_ratio)
> -{
> - u32 v;
> -
> - v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
> - v &= ~MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO_MASK;
> - v |= MPIC_GREG_GLOBAL_CONF_1_CLK_RATIO(clock_ratio);
> - mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
> -}
> -
> -void __init mpic_set_serial_int(struct mpic *mpic, int enable)
> -{
> - unsigned long flags;
> - u32 v;
> -
> - raw_spin_lock_irqsave(_lock, flags);
> - v = mpic_read(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1);
> - if (enable)
> - v |= MPIC_GREG_GLOBAL_CONF_1_SIE;
> - else
> - v &= ~MPIC_GREG_GLOBAL_CONF_1_SIE;
> - mpic_write(mpic->gregs, MPIC_GREG_GLOBAL_CONF_1, v);
> - raw_spin_unlock_irqrestore(_lock, flags);
> -}
> -
>  void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
>  {
>   struct mpic *mpic = mpic_find(irq);

Thinking about it some more, I wonder whether it makes sense to propagate these
values through device tree (and refuse to apply them if they are 0), just like
what timer_group_get_freq() and timer_group_get_irq() in
arch/powerpc/sysdev/mpic_timer.c do.

Does it have any real use?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
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] MIPS: IP32: Add platform data hooks to use DS1685 driver

2015-02-26 Thread Joshua Kinard
From: Joshua Kinard 

This modifies the IP32 (SGI O2) platform and reset code to utilize the new
rtc-ds1685 driver.  The old mc146818rtc.h header is removed and ip32_defconfig
is updated as well.

Signed-off-by: Joshua Kinard 
---
 arch/mips/configs/ip32_defconfig  |3
 arch/mips/include/asm/mach-ip32/mc146818rtc.h |   36 
 arch/mips/sgi-ip32/ip32-platform.c|   52 +-
 arch/mips/sgi-ip32/ip32-reset.c   |  132 
 4 files changed, 85 insertions(+), 138 deletions(-)

Ralf,
  This is a re-spin due to the recent commit efc46d13 in ip32-reset.c ("Use
__noreturn instead of open coded attributes in declarations.").  Those
declarations are removed by this patch, since the poweroff mechanism of the
rtc-ds1685 driver is used instead on SGI O2.  rtc-ds1685 is in linux-next now,
so this one can be added at your convenience.

linux-mips-ip32-use-rtc-ds1685.patch
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig
index 70ffe9b..fe48220 100644
--- a/arch/mips/configs/ip32_defconfig
+++ b/arch/mips/configs/ip32_defconfig
@@ -105,7 +105,8 @@ CONFIG_RTC_CLASS=y
 # CONFIG_RTC_HCTOSYS is not set
 # CONFIG_RTC_INTF_SYSFS is not set
 # CONFIG_RTC_INTF_PROC is not set
-CONFIG_RTC_DRV_CMOS=y
+CONFIG_RTC_DRV_DS1685_FAMILY=y
+CONFIG_RTC_DRV_DS1685=y
 CONFIG_EXT2_FS=y
 CONFIG_EXT2_FS_XATTR=y
 CONFIG_EXT2_FS_POSIX_ACL=y
diff --git a/arch/mips/include/asm/mach-ip32/mc146818rtc.h 
b/arch/mips/include/asm/mach-ip32/mc146818rtc.h
deleted file mode 100644
index 6b6bab4..000
--- a/arch/mips/include/asm/mach-ip32/mc146818rtc.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- * Copyright (C) 1998, 2001, 03 by Ralf Baechle
- * Copyright (C) 2000 Harald Koerfgen
- *
- * RTC routines for IP32 style attached Dallas chip.
- */
-#ifndef __ASM_MACH_IP32_MC146818RTC_H
-#define __ASM_MACH_IP32_MC146818RTC_H
-
-#include 
-
-#define RTC_PORT(x)(0x70 + (x))
-
-static unsigned char CMOS_READ(unsigned long addr)
-{
-   return mace->isa.rtc[addr << 8];
-}
-
-static inline void CMOS_WRITE(unsigned char data, unsigned long addr)
-{
-   mace->isa.rtc[addr << 8] = data;
-}
-
-/*
- * FIXME: Do it right. For now just assume that no one lives in 20th century
- * and no O2 user in 22th century ;-)
- */
-#define mc146818_decode_year(year) ((year) + 2000)
-
-#define RTC_ALWAYS_BCD 0
-
-#endif /* __ASM_MACH_IP32_MC146818RTC_H */
diff --git a/arch/mips/sgi-ip32/ip32-platform.c 
b/arch/mips/sgi-ip32/ip32-platform.c
index 511e9ff..ec9eb7f 100644
--- a/arch/mips/sgi-ip32/ip32-platform.c
+++ b/arch/mips/sgi-ip32/ip32-platform.c
@@ -9,10 +9,13 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 
+extern void ip32_prepare_poweroff(void);
+
 #define MACEISA_SERIAL1_OFFS   offsetof(struct sgi_mace, isa.serial1)
 #define MACEISA_SERIAL2_OFFS   offsetof(struct sgi_mace, isa.serial2)
 
@@ -90,22 +93,53 @@ static __init int sgio2btns_devinit(void)
 
 device_initcall(sgio2btns_devinit);
 
-static struct resource sgio2_cmos_rsrc[] = {
+#define MACE_RTC_RES_START (MACE_BASE + offsetof(struct sgi_mace, isa.rtc))
+#define MACE_RTC_RES_END (MACE_RTC_RES_START + 32767)
+
+static struct resource ip32_rtc_resources[] = {
{
-   .start = 0x70,
-   .end   = 0x71,
-   .flags = IORESOURCE_IO
+   .start  = MACEISA_RTC_IRQ,
+   .end= MACEISA_RTC_IRQ,
+   .flags  = IORESOURCE_IRQ
+   }, {
+   .start  = MACE_RTC_RES_START,
+   .end= MACE_RTC_RES_END,
+   .flags  = IORESOURCE_MEM,
}
 };
 
-static __init int sgio2_cmos_devinit(void)
+
+/* RTC registers on IP32 are each padded by 256 bytes (0x100). */
+static struct ds1685_rtc_platform_data
+ip32_rtc_platform_data[] = {
+   {
+   .regstep = 0x100,
+   .bcd_mode = true,
+   .no_irq = false,
+   .uie_unsupported = false,
+   .alloc_io_resources = true,
+   .plat_prepare_poweroff = ip32_prepare_poweroff,
+   },
+};
+
+struct platform_device ip32_rtc_device = {
+   .name   = "rtc-ds1685",
+   .id = -1,
+   .dev= {
+   .platform_data  = ip32_rtc_platform_data,
+   },
+   .num_resources  = ARRAY_SIZE(ip32_rtc_resources),
+   .resource   = ip32_rtc_resources,
+};
+
+static int __init sgio2_rtc_devinit(void)
 {
-   return IS_ERR(platform_device_register_simple("rtc_cmos", -1,
- sgio2_cmos_rsrc, 1));
+   return platform_device_register(_rtc_device);
+
 }
 
-device_initcall(sgio2_cmos_devinit);
+device_initcall(sgio2_rtc_devinit);
 
 MODULE_AUTHOR("Ralf Baechle ");
 MODULE_LICENSE("GPL");

Re: [tip:x86/asm] x86/traps: Enable DEBUG_STACK after cpu_init() for TRAP_DB/BP

2015-02-26 Thread Wang Nan
On 2015/2/26 23:12, Andy Lutomirski wrote:
> On Thu, Feb 26, 2015 at 5:12 AM, tip-bot for Wang Nan  
> wrote:
>> Commit-ID:  b4d8327024637cb2a1f7910dcb5d0ad7a096f473
>> Gitweb: 
>> http://git.kernel.org/tip/b4d8327024637cb2a1f7910dcb5d0ad7a096f473
>> Author: Wang Nan 
>> AuthorDate: Thu, 26 Feb 2015 13:49:39 +0800
>> Committer:  Ingo Molnar 
>> CommitDate: Thu, 26 Feb 2015 12:29:20 +0100
>>
>> x86/traps: Enable DEBUG_STACK after cpu_init() for TRAP_DB/BP
>>
>> Before this patch early_trap_init() installs DEBUG_STACK for
>> X86_TRAP_BP and X86_TRAP_DB. However, DEBUG_STACK doesn't work
>> correctly until cpu_init() <-- trap_init().
>>
>> This patch passes 0 to set_intr_gate_ist() and
>> set_system_intr_gate_ist() instead of DEBUG_STACK to let it use
>> same stack as kernel, and installs DEBUG_STACK for them in
>> trap_init().
>>
> 
> Sorry, I'm late to the party.  This patch, while technically correct
> AFAICT, is really ugly, because the whole point is that it *doesn't*
> use ist.  In other words:
> 
>> +   set_intr_gate_ist(X86_TRAP_DB, , 0);
> 
> That should be set_intr_gate(X86_TRAP_DB, );
> 

I considered this, but found that set_intr_gate() and set_intr_gate_ist(..., 0)
behaviors differently: set_intr_gate() -> _trace_set_gate() requires 
'trace_##addr'
to be installed to trace_idt_table, while set_intr_gate_ist(..., 0) puts 'addr'.
into trace_idt_table() through _set_gate().
Therefore, if we want to use set_intr_gate() we need to provide a trace_debug 
entry
for it, which will be overwritten in trap_init() so it is in fact a useless 
symbol.

Anyway, I'd like to post a v3 patch follow your advise. Please keep an eye on 
it.

Thank you!

>> /* int3 can be called from all */
>> -   set_system_intr_gate_ist(X86_TRAP_BP, , DEBUG_STACK);
>> +   set_system_intr_gate_ist(X86_TRAP_BP, , 0);
> 
> Similarly, this should be set_system_gate.
> 
>>  #ifdef CONFIG_X86_32
>> set_intr_gate(X86_TRAP_PF, page_fault);
>>  #endif
>> @@ -1005,6 +1013,15 @@ void __init trap_init(void)
>>  */
>> cpu_init();
>>
>> +   /*
>> +* X86_TRAP_DB and X86_TRAP_BP have been set
>> +* in early_trap_init(). However, DEBUG_STACK works only after
>> +* cpu_init() loads TSS. See comments in early_trap_init().
> 
> It's not that DEBUG_STACK only works after the TSS is loaded; it's
> that the IST mechanism only works after TSS is loaded.
> 
> --Andy
> 


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


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

2015-02-26 Thread Stephen Rothwell
Hi Paul,

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

arch/x86/xen/smp.c: In function 'xen_cpu_up':
arch/x86/xen/smp.c:460:6: error: 'err' undeclared (first use in this function)
  if (err)
  ^

Caused by commit b92c23b083d6 ("x86: Use common
outgoing-CPU-notification code").

I have used the rcu tree from next-20150226 for today.

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


pgpTFkoFaUh5n.pgp
Description: OpenPGP digital signature


Re: [PATCH v2] scripts: checkpatch.pl: add 2 new checks on memset calls

2015-02-26 Thread Joe Perches
On Fri, 2015-02-27 at 03:42 +0200, Aya Mahfouz wrote:
> On Tue, Feb 24, 2015 at 10:20:24PM -0800, Joe Perches wrote:
> > On Wed, 2015-02-25 at 08:08 +0200, Aya Mahfouz wrote:
> > > What is the next step?
> > Ideally, you understanding why the suggested patch
> > is an improvement over the patch you proposed.
> > Beyond that, submit a patch.  Then submit more...
[]
> This is just a note that I did not forget about the patch.

Hello Aya

> I understand how it works now.

Great.

> I'm just finalizing some final steps with Julia which 
> might take some time.

No rush.  Understanding is more important than the patch.

> Thanks for all your help,

You're quite welcome.  No charge...

Joe

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


  1   2   3   4   5   6   7   8   9   10   >