include/linux/kprobes.h:361:2: error: invalid use of undefined type 'struct kprobe_ctlblk'

2017-02-11 Thread kbuild test robot
Hi Russell,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: b2c0b2cbb282f0cf42518ffacbe197e6f2884168 nmi: create generic NMI 
backtrace implementation
date:   1 year, 7 months ago
config: mn10300-allyesconfig (attached as .config)
compiler: am33_2.0-linux-gcc (GCC) 6.2.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b2c0b2cbb282f0cf42518ffacbe197e6f2884168
# save the attached .config to linux build tree
make.cross ARCH=mn10300 

All errors (new ones prefixed by >>):

   In file included from lib/nmi_backtrace.c:17:0:
   include/linux/kprobes.h: In function 'get_kprobe_ctlblk':
>> include/linux/kprobes.h:361:2: error: invalid use of undefined type 'struct 
>> kprobe_ctlblk'
 return this_cpu_ptr(&kprobe_ctlblk);
 ^~

vim +361 include/linux/kprobes.h

e65845235 Ananth N Mavinakayanahalli 2005-11-07  355  {
b76834bc1 Christoph Lameter  2010-12-06  356
__this_cpu_write(current_kprobe, NULL);
e65845235 Ananth N Mavinakayanahalli 2005-11-07  357  }
e65845235 Ananth N Mavinakayanahalli 2005-11-07  358  
e65845235 Ananth N Mavinakayanahalli 2005-11-07  359  static inline struct 
kprobe_ctlblk *get_kprobe_ctlblk(void)
e65845235 Ananth N Mavinakayanahalli 2005-11-07  360  {
bdffd893a Christoph Lameter  2014-04-29 @361return 
this_cpu_ptr(&kprobe_ctlblk);
e65845235 Ananth N Mavinakayanahalli 2005-11-07  362  }
e65845235 Ananth N Mavinakayanahalli 2005-11-07  363  
^1da177e4 Linus Torvalds 2005-04-16  364  int 
register_kprobe(struct kprobe *p);

:: The code at line 361 was first introduced by commit
:: bdffd893a0e9c431304142d12d9a0a21d365c502 tracing: Replace __get_cpu_var 
uses with this_cpu_ptr

:: TO: Christoph Lameter 
:: CC: Steven Rostedt 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[PATCH 14/15] staging: rtl8192u: Fixing no new typedef warning

2017-02-11 Thread simran singhal
This patch fixes following checkpatch.pl
warnings: WARNING:do not add new typedefs.
All the related files have been modified.

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h |  4 ++--
 .../staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c  |  4 ++--
 .../staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c  |  4 ++--
 .../staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c   |  4 ++--
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c  |  4 ++--
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c |  6 +++---
 drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c  | 18 +-
 drivers/staging/rtl8192u/r8192U_core.c | 14 +++---
 drivers/staging/rtl8192u/r819xU_cmdpkt.c   |  4 ++--
 drivers/staging/rtl8192u/r819xU_firmware.c |  4 ++--
 10 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index fc8c6a4..0a37a05 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -83,7 +83,7 @@
 #define SUPPORT_CKIP_PK0x10// bit4
 /* defined for skb cb field */
 /* At most 28 byte */
-typedef struct cb_desc {
+struct cb_desc {
/* Tx Desc Related flags (8-9) */
u8 bLastIniPkt:1;
u8 bCmdOrInit:1;
@@ -139,7 +139,7 @@ typedef struct cb_desc {
u8 DrvAggrNum;
u16 pkt_size;
u8 reserved12;
-}cb_desc, *pcb_desc;
+};
 
 /*--Define 
---*/
 #define MGN_1M  0x02
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index cb226ed..e6648f7 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -192,7 +192,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
int data_len, i;
u8 *pos;
struct rtl_80211_hdr_4addr *hdr;
-   cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+   struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
 
if (skb_headroom(skb) < CCMP_HDR_LEN ||
skb_tailroom(skb) < CCMP_MIC_LEN ||
@@ -263,7 +263,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
struct ieee80211_ccmp_data *key = priv;
u8 keyidx, *pos;
struct rtl_80211_hdr_4addr *hdr;
-   cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+   struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
u8 pn[6];
 
if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) {
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index e688508..2453413 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -304,7 +304,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
int len;
u8 *pos;
struct rtl_80211_hdr_4addr *hdr;
-   cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+   struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
int ret = 0;
u8 rc4key[16],  *icv;
u32 crc;
@@ -387,7 +387,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
u32 iv32;
u16 iv16;
struct rtl_80211_hdr_4addr *hdr;
-   cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+   struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
u8 rc4key[16];
u8 icv[4];
u32 crc;
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
index 1999bc5..44a90cb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_wep.c
@@ -88,7 +88,7 @@ static int prism2_wep_encrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
u32 klen, len;
u8 key[WEP_KEY_LEN + 3];
u8 *pos;
-   cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+   struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
u32 crc;
u8 *icv;
struct scatterlist sg;
@@ -166,7 +166,7 @@ static int prism2_wep_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
u32  klen, plen;
u8 key[WEP_KEY_LEN + 3];
u8 keyidx, *pos;
-   cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
+   struct cb_desc *tcb_desc = (struct cb_desc *)(skb->cb + 
MAX_DEV_ADDR_SIZE);
u32 crc;
u8 icv[4];

[PATCH] Staging: iio: impedance-analyzer: ad5933.c - style fix

2017-02-11 Thread Derek Robson
Change permissions to octal style.
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/iio/impedance-analyzer/ad5933.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c 
b/drivers/staging/iio/impedance-analyzer/ad5933.c
index 5e96352fa4ac..297665d3fe11 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -345,12 +345,12 @@ static ssize_t ad5933_store_frequency(struct device *dev,
return ret ? ret : len;
 }
 
-static IIO_DEVICE_ATTR(out_voltage0_freq_start, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_freq_start, 0644,
ad5933_show_frequency,
ad5933_store_frequency,
AD5933_REG_FREQ_START);
 
-static IIO_DEVICE_ATTR(out_voltage0_freq_increment, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_freq_increment, 0644,
ad5933_show_frequency,
ad5933_store_frequency,
AD5933_REG_FREQ_INC);
@@ -469,32 +469,32 @@ static ssize_t ad5933_store(struct device *dev,
return ret ? ret : len;
 }
 
-static IIO_DEVICE_ATTR(out_voltage0_scale, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_scale, 0644,
ad5933_show,
ad5933_store,
AD5933_OUT_RANGE);
 
-static IIO_DEVICE_ATTR(out_voltage0_scale_available, S_IRUGO,
+static IIO_DEVICE_ATTR(out_voltage0_scale_available, 0444,
ad5933_show,
NULL,
AD5933_OUT_RANGE_AVAIL);
 
-static IIO_DEVICE_ATTR(in_voltage0_scale, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(in_voltage0_scale, 0644,
ad5933_show,
ad5933_store,
AD5933_IN_PGA_GAIN);
 
-static IIO_DEVICE_ATTR(in_voltage0_scale_available, S_IRUGO,
+static IIO_DEVICE_ATTR(in_voltage0_scale_available, 0444,
ad5933_show,
NULL,
AD5933_IN_PGA_GAIN_AVAIL);
 
-static IIO_DEVICE_ATTR(out_voltage0_freq_points, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_freq_points, 0644,
ad5933_show,
ad5933_store,
AD5933_FREQ_POINTS);
 
-static IIO_DEVICE_ATTR(out_voltage0_settling_cycles, S_IRUGO | S_IWUSR,
+static IIO_DEVICE_ATTR(out_voltage0_settling_cycles, 0644,
ad5933_show,
ad5933_store,
AD5933_OUT_SETTLING_CYCLES);
-- 
2.11.1



[PATCH] Staging: sm750fb: sm750.c - style fix

2017-02-11 Thread Derek Robson
Change permissions to octal style.
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/sm750fb/sm750.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index ee741c012b92..e49f8845f923 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -1229,7 +1229,7 @@ static void __exit lynxfb_exit(void)
 }
 module_exit(lynxfb_exit);
 
-module_param(g_option, charp, S_IRUGO);
+module_param(g_option, charp, 0444);
 
 MODULE_PARM_DESC(g_option,
 "\n\t\tCommon options:\n"
-- 
2.11.1



Re: [PATCHSET for-4.11] cgroup: implement cgroup v2 thread mode

2017-02-11 Thread Mike Galbraith
On Sun, 2017-02-12 at 14:05 +0900, Tejun Heo wrote:

> > I think cgroup tree depth is a more significant issue; because of
> > hierarchy we often do tree walks (uo-to-root or down-to-task).
> > 
> > So creating elaborate trees is something I try not to do.
> 
> So, as long as the depth stays reasonable (single digit or lower),
> what we try to do is keeping tree traversal operations aggregated or
> located on slow paths.  There still are places that this overhead
> shows up (e.g. the block controllers aren't too optimized) but it
> isn't particularly difficult to make a handful of layers not matter at
> all.

A handful of cpu bean counting layers stings considerably.

homer:/abuild # pipe-test 1  
2.010057 usecs/loop -- avg 2.010057 995.0 KHz
2.006630 usecs/loop -- avg 2.009714 995.2 KHz
2.127118 usecs/loop -- avg 2.021455 989.4 KHz
2.256244 usecs/loop -- avg 2.044934 978.0 KHz
1.993693 usecs/loop -- avg 2.039810 980.5 KHz
^C
homer:/abuild # cgexec -g cpu:hurt pipe-test 1
2.771641 usecs/loop -- avg 2.771641 721.6 KHz
2.432333 usecs/loop -- avg 2.737710 730.5 KHz
2.750493 usecs/loop -- avg 2.738988 730.2 KHz
2.663203 usecs/loop -- avg 2.731410 732.2 KHz
2.762564 usecs/loop -- avg 2.734525 731.4 KHz
^C
homer:/abuild # cgexec -g cpu:hurt/pain pipe-test 1
2.967201 usecs/loop -- avg 2.967201 674.0 KHz
3.049012 usecs/loop -- avg 2.975382 672.2 KHz
3.031226 usecs/loop -- avg 2.980966 670.9 KHz
2.954259 usecs/loop -- avg 2.978296 671.5 KHz
2.933432 usecs/loop -- avg 2.973809 672.5 KHz
^C
...
homer:/abuild # cgexec -g cpu:hurt/pain/ouch/moan/groan pipe-test 1
4.417044 usecs/loop -- avg 4.417044 452.8 KHz
4.494913 usecs/loop -- avg 4.424831 452.0 KHz
4.253861 usecs/loop -- avg 4.407734 453.7 KHz
4.378059 usecs/loop -- avg 4.404766 454.1 KHz
4.179895 usecs/loop -- avg 4.382279 456.4 KHz


[PATCH 1/2] arch/x86: Fix sparse warning symbol not declared

2017-02-11 Thread Tobin C. Harding
This patch adds static declaration to a number of variables. Fixes
sparse symbol was not declared warnings.

Signed-off-by: Tobin C. Harding 
---
 arch/x86/purgatory/purgatory.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/x86/purgatory/purgatory.c b/arch/x86/purgatory/purgatory.c
index 25e068b..2a2cbe5 100644
--- a/arch/x86/purgatory/purgatory.c
+++ b/arch/x86/purgatory/purgatory.c
@@ -18,11 +18,11 @@ struct sha_region {
unsigned long len;
 };
 
-unsigned long backup_dest = 0;
-unsigned long backup_src = 0;
-unsigned long backup_sz = 0;
+static unsigned long backup_dest = 0;
+static unsigned long backup_src = 0;
+static unsigned long backup_sz = 0;
 
-u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 };
+static u8 sha256_digest[SHA256_DIGEST_SIZE] = { 0 };
 
 struct sha_region sha_regions[16] = {};
 
@@ -39,7 +39,7 @@ static int copy_backup_region(void)
return 0;
 }
 
-int verify_sha256_digest(void)
+static int verify_sha256_digest(void)
 {
struct sha_region *ptr, *end;
u8 digest[SHA256_DIGEST_SIZE];
-- 
2.7.4



[PATCH 0/2] arch/x86: Fix sparse warning

2017-02-11 Thread Tobin C. Harding
This series fixes multiple occurences of sparse warning, 'symbol
is not declared. Should it be static?'. Initial patch adds 'static'
keyword to variable declarations. Second patch declares function in
order to clear same warning. 

Tobin C. Harding (2):
  arch/x86: Fix sparse warning symbol not declared
  arch/x86: Fix sparse warning symbol not declared

 arch/x86/purgatory/purgatory.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

-- 
2.7.4



[PATCH 2/2] arch/x86: Fix sparse warning symbol not declared

2017-02-11 Thread Tobin C. Harding
This patch adds function declaration in order to quiet sparse symbol
not declared warning.

Signed-off-by: Tobin C. Harding 
---

Unsure why adding declaration quiets sparse. This may not be the
correct solution. Only testing done is building and booting kernel.
Since 'purgatory' is called from assembler and does not need forward
declaration the only advantage to this patch seems to be to save the
next newbie from investigating the sparse warning.

arch/x86/purgatory/purgatory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/purgatory/purgatory.c b/arch/x86/purgatory/purgatory.c
index 2a2cbe5..129433c 100644
--- a/arch/x86/purgatory/purgatory.c
+++ b/arch/x86/purgatory/purgatory.c
@@ -18,6 +18,8 @@ struct sha_region {
unsigned long len;
 };
 
+void purgatory(void);
+
 static unsigned long backup_dest = 0;
 static unsigned long backup_src = 0;
 static unsigned long backup_sz = 0;
-- 
2.7.4



Re: [PATCH 3/4] ASoC: sun8i-codec: Convert to SOC_MIXER_ARRAY

2017-02-11 Thread Chen-Yu Tsai
On Fri, Feb 10, 2017 at 5:41 PM, Mylène Josserand
 wrote:
> SOC_MIXER_ARRAY is a simplified function of SND_SOC_DAPM_MIXER
> which handles automatically the ARRAY_SIZE of controls.
>
> Update the driver to use SOC_MIXER_ARRAY.
>
> Signed-off-by: Mylène Josserand 

Acked-by: Chen-Yu Tsai 


Re: [PATCH 2/4] ASoC: sun8i-codec: Update mixer to use SOC_DAPM_DOUBLE

2017-02-11 Thread Chen-Yu Tsai
On Fri, Feb 10, 2017 at 5:41 PM, Mylène Josserand
 wrote:
> Update the driver to use the new SOC_DAPM_DOUBLE definition
> on the digital DAC mixer.
> Update the names accordingly as, when they are shared, the
> controls are not prefixed with the widget's name anymore.
>
> Signed-off-by: Mylène Josserand 

Acked-by: Chen-Yu Tsai 


Re: [PATCH 1/4] ASoC: sun8i-codec: Remove analog "HP" widget

2017-02-11 Thread Chen-Yu Tsai
On Fri, Feb 10, 2017 at 5:41 PM, Mylène Josserand
 wrote:
> The "HP" widget is already present and take part to
> the analog part (sun8i-codec-analog).
>
> Remove it from the digital part as it is unnecessary.
>
> Signed-off-by: Mylène Josserand 

Acked-by: Chen-Yu Tsai 


[PATCH] usercopy: add testcases to check zeroing on failure of usercopy

2017-02-11 Thread Hoeun Ryu
In the hardend usercopy, the destination buffer will be zeroed if
copy_from_user/get_user fails. This patch adds testcases for it.
The destination buffer is set with non-zero value before illegal
copy_from_user/get_user is executed and the buffer is compared to
zero after usercopy is done.

Signed-off-by: Hoeun Ryu 
---
 lib/test_user_copy.c | 17 +
 1 file changed, 17 insertions(+)

diff --git a/lib/test_user_copy.c b/lib/test_user_copy.c
index 0ecef3e..54bd898 100644
--- a/lib/test_user_copy.c
+++ b/lib/test_user_copy.c
@@ -41,11 +41,18 @@ static int __init test_user_copy_init(void)
char *bad_usermem;
unsigned long user_addr;
unsigned long value = 0x5A;
+   char *zerokmem;
 
kmem = kmalloc(PAGE_SIZE * 2, GFP_KERNEL);
if (!kmem)
return -ENOMEM;
 
+   zerokmem = kzalloc(PAGE_SIZE * 2, GFP_KERNEL);
+   if (!zerokmem) {
+   kfree(kmem);
+   return -ENOMEM;
+   }
+
user_addr = vm_mmap(NULL, 0, PAGE_SIZE * 2,
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_ANONYMOUS | MAP_PRIVATE, 0);
@@ -69,25 +76,35 @@ static int __init test_user_copy_init(void)
"legitimate put_user failed");
 
/* Invalid usage: none of these should succeed. */
+   memset(kmem, 0x5A, PAGE_SIZE);
ret |= test(!copy_from_user(kmem, (char __user *)(kmem + PAGE_SIZE),
PAGE_SIZE),
"illegal all-kernel copy_from_user passed");
+   ret |= test(memcmp(zerokmem, kmem, PAGE_SIZE),
+   "zeroing failure for illegal all-kernel copy_from_user");
+   memset(bad_usermem, 0x5A, PAGE_SIZE);
ret |= test(!copy_from_user(bad_usermem, (char __user *)kmem,
PAGE_SIZE),
"illegal reversed copy_from_user passed");
+   ret |= test(memcmp(zerokmem, bad_usermem, PAGE_SIZE),
+   "zeroing failure for illegal reversed copy_from_user");
ret |= test(!copy_to_user((char __user *)kmem, kmem + PAGE_SIZE,
  PAGE_SIZE),
"illegal all-kernel copy_to_user passed");
ret |= test(!copy_to_user((char __user *)kmem, bad_usermem,
  PAGE_SIZE),
"illegal reversed copy_to_user passed");
+   memset(kmem, 0x5A, PAGE_SIZE);
ret |= test(!get_user(value, (unsigned long __user *)kmem),
"illegal get_user passed");
+   ret |= test(memcmp(zerokmem, kmem, sizeof(value)),
+   "zeroing failure for illegal get_user");
ret |= test(!put_user(value, (unsigned long __user *)kmem),
"illegal put_user passed");
 
vm_munmap(user_addr, PAGE_SIZE * 2);
kfree(kmem);
+   kfree(zerokmem);
 
if (ret == 0) {
pr_info("tests passed.\n");
-- 
2.7.4



RE: [PATCH 05/13] vmbus: remove per channel state

2017-02-11 Thread KY Srinivasan


> -Original Message-
> From: Stephen Hemminger
> Sent: Friday, February 10, 2017 8:39 AM
> To: Greg KH ; KY Srinivasan
> 
> Cc: linux-kernel@vger.kernel.org; de...@linuxdriverproject.org;
> o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com;
> jasow...@redhat.com; leann.ogasaw...@canonical.com; Stephen
> Hemminger 
> Subject: RE: [PATCH 05/13] vmbus: remove per channel state
> 
> -Original Message-
> From: Greg KH [mailto:gre...@linuxfoundation.org]
> Sent: Friday, February 10, 2017 6:47 AM
> To: KY Srinivasan 
> Cc: linux-kernel@vger.kernel.org; de...@linuxdriverproject.org;
> o...@aepfle.de; a...@canonical.com; vkuzn...@redhat.com;
> jasow...@redhat.com; leann.ogasaw...@canonical.com; Stephen
> Hemminger ; Stephen Hemminger
> 
> Subject: Re: [PATCH 05/13] vmbus: remove per channel state
> 
> On Sun, Feb 05, 2017 at 05:20:35PM -0700, k...@exchange.microsoft.com
> wrote:
> > From: Stephen Hemminger 
> >
> > The netvsc no longer needs per channel state hook to track receive buffer.
> >
> > Signed-off-by: Stephen Hemminger 
> > Signed-off-by: K. Y. Srinivasan 
> > ---
> >  include/linux/hyperv.h |   14 --
> >  1 files changed, 0 insertions(+), 14 deletions(-)
> 
> This patch breaks the build badly, I don't know how it passed anyone's
> build tests :(
> 
> The functions are still used in two different files.
> 
> I've applied the first 4 patches here, but really, I shouldn't have had
> to bisect down to the offending patch.
> 
> ugh.
> 
> greg k-h
> 
> In the set I submitted was the patch to remove usage of per channel state in
> netvsc.
> KY dropped it, because it already is in net-next. So this patch can wait until
> net-next is merged.
> The current split tree process is a pain and causes slow development cycles

Greg,

Sorry for the confusion; I will be resending the rest of the patches.

Thanks,

K. Y


[PATCH 13/15] staging: rtl8192u: Prefer using the BIT macro

2017-02-11 Thread simran singhal
This patch replaces bit shifting on 1 with the BIT(x) macro as it's
extensively used by other function in this driver.

This was done with coccinelle:
@@ int g; @@

-(1 << g)
+BIT(g)

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h | 188 -
 1 file changed, 94 insertions(+), 94 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index e71af2f..fc8c6a4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -502,28 +502,28 @@ do { if (ieee80211_debug_level & (level)) \
  *
  */
 
-#define IEEE80211_DL_INFO  (1<<0)
-#define IEEE80211_DL_WX(1<<1)
-#define IEEE80211_DL_SCAN  (1<<2)
-#define IEEE80211_DL_STATE (1<<3)
-#define IEEE80211_DL_MGMT  (1<<4)
-#define IEEE80211_DL_FRAG  (1<<5)
-#define IEEE80211_DL_EAP   (1<<6)
-#define IEEE80211_DL_DROP  (1<<7)
-
-#define IEEE80211_DL_TX(1<<8)
-#define IEEE80211_DL_RX(1<<9)
-
-#define IEEE80211_DL_HT   (1<<10)  //HT
-#define IEEE80211_DL_BA   (1<<11)  //ba
-#define IEEE80211_DL_TS   (1<<12)  //TS
-#define IEEE80211_DL_QOS   (1<<13)
-#define IEEE80211_DL_REORDER  (1<<14)
-#define IEEE80211_DL_IOT  (1<<15)
-#define IEEE80211_DL_IPS  (1<<16)
-#define IEEE80211_DL_TRACE(1<<29)  //trace function, need to user 
net_ratelimit() together in order not to print too much to the screen
-#define IEEE80211_DL_DATA (1<<30)   //use this flag to control whether 
print data buf out.
-#define IEEE80211_DL_ERR  (1<<31)   //always open
+#define IEEE80211_DL_INFO  BIT(0)
+#define IEEE80211_DL_WXBIT(1)
+#define IEEE80211_DL_SCAN  BIT(2)
+#define IEEE80211_DL_STATE BIT(3)
+#define IEEE80211_DL_MGMT  BIT(4)
+#define IEEE80211_DL_FRAG  BIT(5)
+#define IEEE80211_DL_EAP   BIT(6)
+#define IEEE80211_DL_DROP  BIT(7)
+
+#define IEEE80211_DL_TXBIT(8)
+#define IEEE80211_DL_RXBIT(9)
+
+#define IEEE80211_DL_HT   BIT(10)  //HT
+#define IEEE80211_DL_BA   BIT(11)  //ba
+#define IEEE80211_DL_TS   BIT(12)  //TS
+#define IEEE80211_DL_QOS   BIT(13)
+#define IEEE80211_DL_REORDER  BIT(14)
+#define IEEE80211_DL_IOT  BIT(15)
+#define IEEE80211_DL_IPS  BIT(16)
+#define IEEE80211_DL_TRACEBIT(29)  //trace function, need to user 
net_ratelimit() together in order not to print too much to the screen
+#define IEEE80211_DL_DATA BIT(30)   //use this flag to control whether 
print data buf out.
+#define IEEE80211_DL_ERR  BIT(31)   //always open
 #define IEEE80211_ERROR(f, a...) printk(KERN_ERR "ieee80211: " f, ## a)
 #define IEEE80211_WARNING(f, a...) printk(KERN_WARNING "ieee80211: " f, ## a)
 #define IEEE80211_DEBUG_INFO(f, a...)   IEEE80211_DEBUG(IEEE80211_DL_INFO, f, 
## a)
@@ -579,35 +579,35 @@ struct ieee80211_snap_hdr {
 #define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
 #define WLAN_GET_SEQ_SEQ(seq)  (((seq) & IEEE80211_SCTL_SEQ) >> 4)
 
-#define WLAN_CAPABILITY_BSS (1<<0)
-#define WLAN_CAPABILITY_IBSS (1<<1)
-#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
-#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
-#define WLAN_CAPABILITY_PRIVACY (1<<4)
-#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
-#define WLAN_CAPABILITY_PBCC (1<<6)
-#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
-#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
-#define WLAN_CAPABILITY_QOS (1<<9)
-#define WLAN_CAPABILITY_SHORT_SLOT (1<<10)
-#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
+#define WLAN_CAPABILITY_BSS BIT(0)
+#define WLAN_CAPABILITY_IBSS BIT(1)
+#define WLAN_CAPABILITY_CF_POLLABLE BIT(2)
+#define WLAN_CAPABILITY_CF_POLL_REQUEST BIT(3)
+#define WLAN_CAPABILITY_PRIVACY BIT(4)
+#define WLAN_CAPABILITY_SHORT_PREAMBLE BIT(5)
+#define WLAN_CAPABILITY_PBCC BIT(6)
+#define WLAN_CAPABILITY_CHANNEL_AGILITY BIT(7)
+#define WLAN_CAPABILITY_SPECTRUM_MGMT BIT(8)
+#define WLAN_CAPABILITY_QOS BIT(9)
+#define WLAN_CAPABILITY_SHORT_SLOT BIT(10)
+#define WLAN_CAPABILITY_DSSS_OFDM BIT(13)
 
 /* 802.11g ERP information element */
-#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
-#define WLAN_ERP_USE_PROTECTION (1<<1)
-#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
-
-#define IEEE80211_STATMASK_SIGNAL (1<<0)
-#define IEEE80211_STATMASK_RSSI (1<<1)
-#define IEEE80211_STATMASK_NOISE (1<<2)
-#define IEEE80211_STATMASK_RATE (1<<3)
+#define WLAN_ERP_NON_ERP_PRESENT BIT(0)
+#define WLAN_ERP_USE_PROTECTION BIT(1)
+#define WLAN_ERP_BARKER_PREAMBLE BIT(2)
+
+#define IEEE80211_STATMASK_SIGNAL BIT(0)
+#define IEEE80211_STATMASK_RSSI BIT(1)
+#define IEEE80211_STATMASK_NOISE BIT(2)
+#define IEEE80211_STATMASK_RATE BIT(3)
 #define IEEE80211_STATMASK_WEMASK 0x7
 
-#define IEEE80211_CCK_MODULATION(1<<0)
-#define IEEE80211_OFDM_M

Re: [PATCH] device-dax: don't set kobj parent during cdev init

2017-02-11 Thread Logan Gunthorpe
On 11/02/17 11:58 AM, Dan Williams wrote:
> Also when using an embedded cdev how would you recommend avoiding this 
> problem?

I don't know. Hopefully, Greg has a good idea. But it sounds like a
general problem that a lot of cdev's actually suffer from without
realizing. Perhaps we need a more general solution. Some way for the
cdev to reference its containing structure in a way that it's designed
for such that anyone writing a driver will do the right thing without
needing to dive into the kobjects.

Logan


Re: [PATCHSET for-4.11] cgroup: implement cgroup v2 thread mode

2017-02-11 Thread Tejun Heo
Hello,

On Fri, Feb 10, 2017 at 06:51:45PM +0100, Peter Zijlstra wrote:
> Sure, we're past that. This isn't about what memcg can or cannot do.
> Previous discussions established that controllers come in two shapes:
> 
>  - task based controllers; these are build on per task properties and
>groups are aggregates over sets of tasks. Since per definition inter
>task competition is already defined on individual tasks, its fairly
>trivial to extend the same rules to sets of tasks etc..
> 
>Examples: cpu, cpuset, cpuacct, perf, pid, (freezer)
>
>  - system controllers; instead of building from tasks upwards, they
>split what previously would be machine wide / global state. For these
>there is no natural competition rule vs tasks, and hence your
>no-internal-task rule.
> 
>Examples: memcg, io, hugetlb

This is a bit of delta but as I wrote before, at least cpu (and
accordingly cpuacct) won't stay purely task-based as we should account
for resource consumptions which aren't tied to specific tasks to the
matching domain (e.g. CPU consumption during writeback, disk
encryption or CPU cycles spent to receive packets).

> > And here's another point, currently, all controllers are enabled
> > consecutively from root.  If we have leaf thread subtrees, this still
> > works fine.  Resource domain controllers won't be enabled into thread
> > subtrees.  If we allow switching back and forth, what do we do in the
> > middle while we're in the thread part?
> 
> From what I understand you cannot re-enable a controller once its been
> disabled, right? If you disable it, its dead for the entire subtree.

cgroups on creation don't enable controllers by default and users can
enable and disable controllers dynamically as long as the conditions
are met.  So, they can be disable and re-enabled.

> > No matter what we do, it's
> > gonna be more confusing and we lose basic invariants like "parent
> > always has superset of control knobs that its child has".
> 
> No, exactly that. I don't think I ever proposed something different.
>
> The "resource domain" flag I proposed violates the no-internal-processes
> thing, but it doesn't violate that rule afaict.

If we go to thread mode and back to domain mode, the control knobs for
domain controllers don't make sense on the thread part of the tree and
they won't have cgroup_subsys_state to correspond to either.  For
example,

 A - T - B

B's memcg knobs would control memory distribution from A and cgroups
in T can't have memcg knobs.  It'd be weird to indicate that memcg is
enabled in those cgroups too.

We can make it work somehow.  It's just weird-ass interface.

> > As for the runtime overhead, if you get affected by adding a top-level
> > cgroup in any measureable way, we need to fix that.  That's not a
> > valid argument for messing up the interface.
> 
> I think cgroup tree depth is a more significant issue; because of
> hierarchy we often do tree walks (uo-to-root or down-to-task).
> 
> So creating elaborate trees is something I try not to do.

So, as long as the depth stays reasonable (single digit or lower),
what we try to do is keeping tree traversal operations aggregated or
located on slow paths.  There still are places that this overhead
shows up (e.g. the block controllers aren't too optimized) but it
isn't particularly difficult to make a handful of layers not matter at
all.  memcg batches the charging operations and it's impossible to
measure the overhead of several levels of hierarchy.

In general, I think it's important to ensure that this in general is
the case so that users can use the logical layouts matching the actual
resource hierarchy rather than having to twist the layout for
optimization.

> > Even if we allow switching back and forth, we can't make the same
> > cgroup both resource domain && thread root.  Not in a sane way at
> > least.
> 
> The back and forth thing yes, but even with a single level, the one
> resource domain you tag will be both resource domain and thread root.

Ah, you're right.

Thanks.

-- 
tejun


RE: [PATCH 0/9] Drivers: hv: Miscellaneous vmbus cleanup and improvements

2017-02-11 Thread KY Srinivasan


> -Original Message-
> From: k...@exchange.microsoft.com [mailto:k...@exchange.microsoft.com]
> Sent: Saturday, February 11, 2017 7:43 PM
> To: gre...@linuxfoundation.org; linux-kernel@vger.kernel.org;
> de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com;
> vkuzn...@redhat.com; jasow...@redhat.com;
> leann.ogasaw...@canonical.com
> Cc: KY Srinivasan 
> Subject: [PATCH 0/9] Drivers: hv: Miscellaneous vmbus cleanup and
> improvements
> 
> [This sender failed our fraud detection checks and may not be who they
> appear to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing]
> 
> From: K. Y. Srinivasan 
> 
> Miscellaneous vmbus cleanup and improvements.
> 
> Stephen Hemminger (9):
>   vmbus: remove per channel state
>   vmbus: callback is in softirq not workqueue
>   vmbus: put related per-cpu variable together
>   vmbus: change to per channel tasklet
>   vmbus: add direct isr callback mode
>   vmbus: remove conditional locking of vmbus_write
>   vmbus: expose hv_begin/end_read
>   vmbus: constify parameters where possible
>   vmbus: replace modulus operation with subtraction
> 
>  drivers/hv/channel.c |   15 ++
>  drivers/hv/channel_mgmt.c|   41 +++---
>  drivers/hv/connection.c  |  109 ++---
>  drivers/hv/hv.c  |  124 
> ++
>  drivers/hv/hv_util.c |3 +-
>  drivers/hv/hyperv_vmbus.h|   63 +++--
>  drivers/hv/ring_buffer.c |   60 +++--
>  drivers/hv/vmbus_drv.c   |  111 +++--
> 
>  drivers/uio/uio_hv_generic.c |2 +-
>  include/linux/hyperv.h   |  110 +++--
>  10 files changed, 297 insertions(+), 341 deletions(-)
Greg,

Please drop this patch-set. I am going to resend.

K. Y


collect2: error: ld returned 1 exit status

2017-02-11 Thread kbuild test robot
Hi Linus,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: 2527ecc9195e9c66252af24c4689e8a67cd4ccb9 gpio: Fix OF build problem on 
UM
date:   6 months ago
config: um-allyesconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
git checkout 2527ecc9195e9c66252af24c4689e8a67cd4ccb9
# save the attached .config to linux build tree
make ARCH=um 

All errors (new ones prefixed by >>):

   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc781): warning: Using 'getgrnam' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc5cc): warning: Using 'getpwuid' in statically linked applications 
requires at runtime the shared libraries from the glibc version used for linking
   arch/um/drivers/built-in.o: In function `vde_open_real':
   (.text+0xc8e5): warning: Using 'getaddrinfo' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoaddr':
   (.text+0x1d375): warning: Using 'gethostbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametonetaddr':
   (.text+0x1d415): warning: Using 'getnetbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoproto':
   (.text+0x1d635): warning: Using 'getprotobyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   arch/um/drivers/built-in.o: In function `pcap_nametoport':
   (.text+0x1d467): warning: Using 'getservbyname' in statically linked 
applications requires at runtime the shared libraries from the glibc version 
used for linking
   drivers/built-in.o: In function `fwnode_get_named_gpiod':
   drivers/gpio/gpiolib.c:3215: undefined reference to 
`of_get_named_gpiod_flags'
   drivers/built-in.o: In function `gpiod_get_index':
   drivers/gpio/gpiolib.c:3140: undefined reference to 
`of_get_named_gpiod_flags'
   drivers/built-in.o: In function `lp872x_probe':
   drivers/regulator/lp872x.c:773: undefined reference to 
`devm_gpio_request_one'
   drivers/regulator/lp872x.c:746: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `max8952_pmic_probe':
   drivers/regulator/max8952.c:249: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `max8973_probe':
   drivers/regulator/max8973-regulator.c:715: undefined reference to 
`devm_gpio_request_one'
   drivers/regulator/max8973-regulator.c:770: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `pwm_regulator_probe':
   drivers/regulator/pwm-regulator.c:387: undefined reference to 
`devm_gpiod_get_optional'
   drivers/built-in.o: In function `tps62360_probe':
   drivers/regulator/tps62360-regulator.c:433: undefined reference to 
`devm_gpio_request_one'
   drivers/regulator/tps62360-regulator.c:444: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `fdp_nci_i2c_probe':
   drivers/nfc/fdp/i2c.c:326: undefined reference to `devm_gpiod_get'
   drivers/built-in.o: In function `nfcmrvl_nci_unregister_dev':
   drivers/nfc/nfcmrvl/main.c:198: undefined reference to `devm_gpio_free'
   drivers/built-in.o: In function `nfcmrvl_nci_register_dev':
   drivers/nfc/nfcmrvl/main.c:127: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `st21nfca_hci_i2c_probe':
   drivers/nfc/st21nfca/i2c.c:597: undefined reference to 
`devm_gpio_request_one'
   drivers/built-in.o: In function `st_nci_i2c_probe':
   drivers/nfc/st-nci/i2c.c:300: undefined reference to `devm_gpio_request_one'
   drivers/built-in.o: In function `nxp_nci_i2c_probe':
   drivers/nfc/nxp-nci/i2c.c:361: undefined reference to `devm_gpio_request_one'
   drivers/built-in.o: In function `mdio_gpio_probe':
   drivers/net/phy/mdio-gpio.c:177: undefined reference to `devm_gpio_request'
   drivers/built-in.o: In function `at803x_probe':
   drivers/net/phy/at803x.c:283: undefined reference to 
`devm_gpiod_get_optional'
   drivers/built-in.o: In function `mv88e6xxx_probe':
   drivers/net/dsa/mv88e6xxx/chip.c:4022: undefined reference to 
`devm_gpiod_get_optional'
   drivers/built-in.o: In function `pps_gpio_probe':
   drivers/pps/clients/pps-gpio.c:125: undefined reference to 
`devm_gpio_request'
   drivers/built-in.o: In function `max8903_probe':
   drivers/power/max8903_charger.c:248: undefined reference to 
`devm_gpio_request'
   drivers/power/max8903_charger.c:280: undefined re

RE: [PATCH v2 3/5] pci: set msi_domain_ops as __ro_after_init

2017-02-11 Thread KY Srinivasan


> -Original Message-
> From: Jess Frazelle [mailto:m...@jessfraz.com]
> Sent: Friday, February 10, 2017 5:38 PM
> To: KY Srinivasan ; Haiyang Zhang
> ; Stephen Hemminger
> ; Bjorn Helgaas ; Keith
> Busch ; open list:Hyper-V CORE AND DRIVERS
> ; open list:PCI SUBSYSTEM  p...@vger.kernel.org>; open list 
> Cc: kernel-harden...@lists.openwall.com; Jess Frazelle 
> Subject: [PATCH v2 3/5] pci: set msi_domain_ops as __ro_after_init
> 
> Marked msi_domain_ops structs as __ro_after_init when called only during
> init.
> This protects the data structure from accidental corruption.
> 
> Suggested-by: Kees Cook 
> Signed-off-by: Jess Frazelle 

Acked-by: K. Y. Srinivasan 

K. Y

> ---
>  drivers/pci/host/pci-hyperv.c | 2 +-
>  drivers/pci/host/vmd.c| 2 +-
>  drivers/pci/msi.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
> index 3efcc7bdc5fb..f05b93689d8f 100644
> --- a/drivers/pci/host/pci-hyperv.c
> +++ b/drivers/pci/host/pci-hyperv.c
> @@ -958,7 +958,7 @@ static irq_hw_number_t
> hv_msi_domain_ops_get_hwirq(struct msi_domain_info *info,
>   return arg->msi_hwirq;
>  }
> 
> -static struct msi_domain_ops hv_msi_ops = {
> +static struct msi_domain_ops hv_msi_ops __ro_after_init = {
>   .get_hwirq  = hv_msi_domain_ops_get_hwirq,
>   .msi_prepare= pci_msi_prepare,
>   .set_desc   = pci_msi_set_desc,
> diff --git a/drivers/pci/host/vmd.c b/drivers/pci/host/vmd.c
> index 18ef1a93c10a..152c461538e4 100644
> --- a/drivers/pci/host/vmd.c
> +++ b/drivers/pci/host/vmd.c
> @@ -253,7 +253,7 @@ static void vmd_set_desc(msi_alloc_info_t *arg,
> struct msi_desc *desc)
>   arg->desc = desc;
>  }
> 
> -static struct msi_domain_ops vmd_msi_domain_ops = {
> +static struct msi_domain_ops vmd_msi_domain_ops __ro_after_init = {
>   .get_hwirq  = vmd_get_hwirq,
>   .msi_init   = vmd_msi_init,
>   .msi_free   = vmd_msi_free,
> diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
> index 50c5003295ca..93141d5e2d1c 100644
> --- a/drivers/pci/msi.c
> +++ b/drivers/pci/msi.c
> @@ -1413,7 +1413,7 @@ static void
> pci_msi_domain_set_desc(msi_alloc_info_t *arg,
>  #define pci_msi_domain_set_desc  NULL
>  #endif
> 
> -static struct msi_domain_ops pci_msi_domain_ops_default = {
> +static struct msi_domain_ops pci_msi_domain_ops_default __ro_after_init
> = {
>   .set_desc   = pci_msi_domain_set_desc,
>   .msi_check  = pci_msi_domain_check_cap,
>   .handle_error   = pci_msi_domain_handle_error,
> --
> 2.11.0



Re: [PATCH] acpi: acpica: fix acpi operand cache leak

2017-02-11 Thread kbuild test robot
Hi Seunghun,

[auto build test WARNING on pm/linux-next]
[also build test WARNING on v4.10-rc7 next-20170210]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Seunghun-Han/acpi-acpica-fix-acpi-operand-cache-leak/20170212-105735
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git 
linux-next
config: i386-randconfig-x003-201707 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/acpi/acpica/nsutils.c: In function 'acpi_ns_terminate':
>> drivers/acpi/acpica/nsutils.c:600:2: warning: ISO C90 forbids mixed 
>> declarations and code [-Wdeclaration-after-statement]
 union acpi_operand_object *prev;
 ^

vim +600 drivers/acpi/acpica/nsutils.c

^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  584   * 
FUNCTION:acpi_ns_terminate
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  585   *
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  586   * 
PARAMETERS:  none
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  587   *
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  588   * 
RETURN:  none
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  589   *
44f6c012 drivers/acpi/namespace/nsutils.c Robert Moore   2005-04-18  590   * 
DESCRIPTION: free memory allocated for namespace and ACPI table storage.
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  591   *
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  592   
**/
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  593  
4be44fcd drivers/acpi/namespace/nsutils.c Len Brown  2005-08-05  594  void 
acpi_ns_terminate(void)
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  595  {
3f69fe15 drivers/acpi/acpica/nsutils.cBob Moore  2013-11-21  596
acpi_status status;
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  597  
b229cf92 drivers/acpi/namespace/nsutils.c Bob Moore  2006-04-21  598
ACPI_FUNCTION_TRACE(ns_terminate);
^1da177e drivers/acpi/namespace/nsutils.c Linus Torvalds 2005-04-16  599  
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25 @600
union acpi_operand_object *prev;
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  601
union acpi_operand_object *next;
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  602  
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  603
/* Delete any module-level code blocks */
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  604  
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  605
next = acpi_gbl_module_code_list;
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  606
while (next) {
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  607
prev = next;
25823e78 drivers/acpi/acpica/nsutils.cBob Moore  2015-08-25  608
next = next->method.mutex;

:: The code at line 600 was first introduced by commit
:: 25823e784aac78964ada0e49efe2766d2aeb9fa4 ACPICA: Add additional debug 
info/statements

:: TO: Bob Moore 
:: CC: Rafael J. Wysocki 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


alg: comp: Compression test 1 failed for lz4

2017-02-11 Thread Christian Kujau
Hi,

while the LZ4 and LZ4HC module appears to be available on PowerPC 32-bit 
(it's a PowerBook G4), I get these warnings below during module load. The 
lzo module is working just fine and I'm using it extensively for ZRAM on 
that machine.

Is this a configuration[0] error or is LZ4 just not supported for this 
architecture?

Thanks,
Christian.

[0] http://nerdbynature.de/bits/4.10-rc7/config_4.10-rc7.txt - but
I get the same messages with a stock Debian/4.9 configuration too.


$ modprobe lz4
alg: comp: Compression test 1 failed for lz4-generic
: f0 10 4a 6f 69 6e 20 75 73 20 6e 6f 77 20 61 6e
0010: 64 20 73 68 61 72 65 20 74 68 65 20 73 6f 66 74
0020: 77 00 0d 0f 00 23 0b 50 77 61 72 65 20
alg: acomp: Compression test 1 failed for lz4-scomp
: f0 10 4a 6f 69 6e 20 75 73 20 6e 6f 77 20 61 6e
0010: 64 20 73 68 61 72 65 20 74 68 65 20 73 6f 66 74
0020: 77 00 0d 0f 00 23 0b 50 77 61 72 65 20


$ modprobe lz4hc
alg: comp: Compression test 1 failed for lz4hc-generic
: f0 10 4a 6f 69 6e 20 75 73 20 6e 6f 77 20 61 6e
0010: 64 20 73 68 61 72 65 20 74 68 65 20 73 6f 66 74
0020: 77 00 0d 0f 00 23 0b 50 77 61 72 65 20
alg: acomp: Compression test 1 failed for lz4hc-scomp
: f0 10 4a 6f 69 6e 20 75 73 20 6e 6f 77 20 61 6e
0010: 64 20 73 68 61 72 65 20 74 68 65 20 73 6f 66 74
0020: 77 00 0d 0f 00 23 0b 50 77 61 72 65 20

-- 
BOFH excuse #174:

Backbone adjustment


[PATCH 0/2] net: Replace custom page based bitmap with IDA

2017-02-11 Thread Tobin C. Harding
Current implementation of __dev_alloc_name uses a custom bitmap of
a single page to iterate network device id's and allocate an
unused id. This is seemingly the same task that the IDA does. Also the
current implementation leads to a upper limit of 8 * PAGE_SIZE on the
number of network id's (for each name format i.e eth0).

This patch uses the kernel's IDA as a replacement to the page based
bitmap. This has the effect of simplifying the code and removing
the upper limit.

Testing was carried out using a simple network device module, the
core of which is;

#define NDEVICES 32768 /* current implementation hard limit */

/* test driver */
static int tm_init_module(void)
{
int result;
int i;
unsigned long before, after, diff, msec;

pr_debug("tm: init module");

before = jiffies;

for (i = 0; i < NDEVICES; i++) {

devs[i] = alloc_netdev(0, "sn%d",
NET_NAME_UNKNOWN, tm_init);

if (!devs[i])
return -ENOMEM;

result = register_netdev(devs[i]);
if (result) {
pr_err("tm: error %i registering device \"%s\"\n",
result, devs[i]->name);
tm_cleanup();
return -ENODEV;
}
}

after = jiffies;
diff = (long)after - (long)before;
msec = diff * 1000 / HZ;
pr_debug("tm: Total milliseconds: %ld\n", msec);

return 0;
}
module_init(tm_init_module);

The main objective of this patch is to simplify the code of __dev_alloc_name.
As a side effect the hard limit is also removed. Results from running the,
admittedly convoluted, test module show that the patched version is slightly 
slower.


Benchmarks
==

System: core i5 Linux 4.10.0-rc7+ #18 SMP

$ qemu-system-x86_64 -kernel arch/x86_64/boot/bzImage -drive 
file=/home/tobin/build/imgs/qemu-image.img,index=0,media=disk,format=raw 
-append "root=/dev/sda console=ttyS0" --enable-kvm --nographic -m 12G


Current implementation

#define NDEVICES 3

[  134.376741] tm: Total milliseconds: 127152

Patched version

#define NDEVICES 3

[  226.960212] tm: Total milliseconds: 220756

#define NDEVICES 35000

[  276.590994] tm: Total milliseconds: 270620


Tobin C. Harding (2):
  include: Fix checkpatch whitespace error and warning
  net: Replace custom page based bitmap with IDA

 include/linux/idr.h |  4 ++--
 net/core/dev.c  | 20 ++--
 2 files changed, 8 insertions(+), 16 deletions(-)

-- 
2.7.4



[PATCH 2/2] net: Replace custom page based bitmap with IDA

2017-02-11 Thread Tobin C. Harding
Current implementation of __dev_alloc_name uses a custom bitmap of
a single page to iterate network device id's and allocate an unused id.
This leads to a upper limit of 8 * PAGE_SIZE network device id's (for
each name format i.e eth0).

This patch uses the kernel's IDA as a replacement to the page based
bitmap. This has the effect of simplifying the code and removing
the upper limit.

Signed-off-by: Tobin C. Harding 
---
 net/core/dev.c | 20 ++--
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 29101c9..b16ea84 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1025,39 +1025,31 @@ static int __dev_alloc_name(struct net *net, const char 
*name, char *buf)
 {
int i = 0;
const char *p;
-   const int max_netdevices = 8*PAGE_SIZE;
-   unsigned long *inuse;
struct net_device *d;
+   DEFINE_IDA(ida);
+   const int end = 0;
 
p = strnchr(name, IFNAMSIZ-1, '%');
if (p) {
-   /*
-* Verify the string as this thing may have come from
+   /* Verify the string as this thing may have come from
 * the user.  There must be either one "%d" and no other "%"
 * characters.
 */
if (p[1] != 'd' || strchr(p + 2, '%'))
return -EINVAL;
 
-   /* Use one page as a bit array of possible slots */
-   inuse = (unsigned long *) get_zeroed_page(GFP_ATOMIC);
-   if (!inuse)
-   return -ENOMEM;
-
for_each_netdev(net, d) {
if (!sscanf(d->name, name, &i))
continue;
-   if (i < 0 || i >= max_netdevices)
+   if (i < 0)
continue;
 
/*  avoid cases where sscanf is not exact inverse of 
printf */
snprintf(buf, IFNAMSIZ, name, i);
if (!strncmp(buf, d->name, IFNAMSIZ))
-   set_bit(i, inuse);
+   ida_simple_get(&ida, i, end, GFP_KERNEL);
}
-
-   i = find_first_zero_bit(inuse, max_netdevices);
-   free_page((unsigned long) inuse);
+   i = ida_simple_get(&ida, 0, end, GFP_KERNEL);
}
 
if (buf != name)
-- 
2.7.4



[PATCH 1/2] include: Fix checkpatch whitespace error and warning

2017-02-11 Thread Tobin C. Harding
This patch fixes two trivial whitespace messages (ERROR/WARNING).
Fixes trailing whitespace ERROR and fixes space before tabs WARNING.

Signed-off-by: Tobin C. Harding 
---
 include/linux/idr.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/idr.h b/include/linux/idr.h
index 3c01b89..4a8de2f 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -1,6 +1,6 @@
 /*
  * include/linux/idr.h
- * 
+ *
  * 2002-10-18  written by Jim Houston jim.hous...@ccur.com
  * Copyright (C) 2002 by Concurrent Computer Corporation
  * Distributed under the GNU GPL license version 2.
@@ -183,7 +183,7 @@ static inline void *idr_find(struct idr *idr, int id)
  */
 #define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */
 #define IDA_BITMAP_LONGS   (IDA_CHUNK_SIZE / sizeof(long) - 1)
-#define IDA_BITMAP_BITS(IDA_BITMAP_LONGS * sizeof(long) * 8)
+#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8)
 
 struct ida_bitmap {
longnr_busy;
-- 
2.7.4



[PATCH] acpi: acpica: fix acpi operand cache leak

2017-02-11 Thread Seunghun Han
I'm Seunghun Han, and I work for National Security Research Institute of
South Korea.

I have been doing a research on ACPI and making a handcrafted ACPI table
for my research.
Errors of handcrafted ACPI tables are handled well in Linux kernel while boot
process, and Linux kernel goes well without critical problems.
But I found some ACPI operand cache leaks in ACPI early abort cases.

Boot log of ACPI operand cache leak is as follows:
>[0.174332] ACPI: Added _OSI(Module Device)
>[0.175504] ACPI: Added _OSI(Processor Device)
>[0.176010] ACPI: Added _OSI(3.0 _SCP Extensions)
>[0.177032] ACPI: Added _OSI(Processor Aggregator Device)
>[0.178284] ACPI: SCI (IRQ16705) allocation failed
>[0.179352] ACPI Exception: AE_NOT_ACQUIRED, Unable to install System 
>Control Interrupt handler (20160930/evevent-131)
>[0.180008] ACPI: Unable to start the ACPI Interpreter
>[0.181125] ACPI Error: Could not remove SCI handler (20160930/evmisc-281)
>[0.184068] kmem_cache_destroy Acpi-Operand: Slab cache still has objects
>[0.185358] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.10.0-rc3 #2
>[0.186820] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS 
>VirtualBox 12/01/2006
>[0.188000] Call Trace:
>[0.188000]  ? dump_stack+0x5c/0x7d
>[0.188000]  ? kmem_cache_destroy+0x224/0x230
>[0.188000]  ? acpi_sleep_proc_init+0x22/0x22
>[0.188000]  ? acpi_os_delete_cache+0xa/0xd
>[0.188000]  ? acpi_ut_delete_caches+0x3f/0x7b
>[0.188000]  ? acpi_terminate+0x5/0xf
>[0.188000]  ? acpi_init+0x288/0x32e
>[0.188000]  ? __class_create+0x4c/0x80
>[0.188000]  ? video_setup+0x7a/0x7a
>[0.188000]  ? do_one_initcall+0x4e/0x1b0
>[0.188000]  ? kernel_init_freeable+0x194/0x21a
>[0.188000]  ? rest_init+0x80/0x80
>[0.188000]  ? kernel_init+0xa/0x100
>[0.188000]  ? ret_from_fork+0x25/0x30

When early abort is occurred due to invalid ACPI information, Linux kernel
terminates ACPI by calling acpi_terminate() function.
The function calls acpi_ns_terminate() function to delete namespace data
and ACPI operand cache (acpi_gbl_module_code_list).

But the deletion code in acpi_ns_terminate() function is wrapped in
ACPI_EXEC_APP definition, therefore the code is only executed when the
definition exists.
If the define doesn't exist, ACPI operand cache (acpi_gbl_module_code_list) is
leaked, and stack dump is shown in kernel log.

This causes a security threat because the old kernel (<= 4.9) shows memory
locations of kernel functions in stack dump, therefore kernel ASLR can be
neutralized.

To fix ACPI operand leak for enhancing security, I made a patch which removes
the ACPI_EXEC_APP define in acpi_ns_terminate() function for executing the
deletion code unconditionally.

I hope that this patch improves the security of Linux kernel.

Thank you.

Signed-off-by: Seunghun Han 
---
 drivers/acpi/acpica/nsutils.c | 26 +++---
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 691814d..acb6099 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -597,22 +597,18 @@ void acpi_ns_terminate(void)
 
ACPI_FUNCTION_TRACE(ns_terminate);
 
-#ifdef ACPI_EXEC_APP
-   {
-   union acpi_operand_object *prev;
-   union acpi_operand_object *next;
-
-   /* Delete any module-level code blocks */
-
-   next = acpi_gbl_module_code_list;
-   while (next) {
-   prev = next;
-   next = next->method.mutex;
-   prev->method.mutex = NULL;  /* Clear the Mutex 
(cheated) field */
-   acpi_ut_remove_reference(prev);
-   }
+   union acpi_operand_object *prev;
+   union acpi_operand_object *next;
+
+   /* Delete any module-level code blocks */
+
+   next = acpi_gbl_module_code_list;
+   while (next) {
+   prev = next;
+   next = next->method.mutex;
+   prev->method.mutex = NULL;  /* Clear the Mutex (cheated) 
field */
+   acpi_ut_remove_reference(prev);
}
-#endif
 
/*
 * Free the entire namespace -- all nodes and all objects
-- 
2.1.4



[PATCH] tools:perf:scripting-engines: Fix compile error with some perl5 versions

2017-02-11 Thread Wang YanQing
Fix below compile error:
CC   util/scripting-engines/trace-event-perl.o
In file included from /usr/lib/perl5/5.22.2/i686-linux/CORE/perl.h:5673:0,
 from util/scripting-engines/trace-event-perl.c:31:
/usr/lib/perl5/5.22.2/i686-linux/CORE/inline.h: In function 
'S__is_utf8_char_slow':
/usr/lib/perl5/5.22.2/i686-linux/CORE/inline.h:270:5: error: nested extern 
declaration of 'Perl___notused' [-Werror=nested-externs]
dTHX;   /* The function called below requires thread context */
 ^
cc1: all warnings being treated as errors

After digging perl5 repository, I find out that we will meet this compile error
with perl from v5.21.1 to v5.25.4

Signed-off-by: Wang YanQing 
---
 tools/perf/util/scripting-engines/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/util/scripting-engines/Build 
b/tools/perf/util/scripting-engines/Build
index 6516e22..82d28c6 100644
--- a/tools/perf/util/scripting-engines/Build
+++ b/tools/perf/util/scripting-engines/Build
@@ -1,6 +1,6 @@
 libperf-$(CONFIG_LIBPERL)   += trace-event-perl.o
 libperf-$(CONFIG_LIBPYTHON) += trace-event-python.o
 
-CFLAGS_trace-event-perl.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls 
-Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-undef 
-Wno-switch-default
+CFLAGS_trace-event-perl.o += $(PERL_EMBED_CCOPTS) -Wno-redundant-decls 
-Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow -Wno-nested-externs 
-Wno-undef -Wno-switch-default
 
 CFLAGS_trace-event-python.o += $(PYTHON_EMBED_CCOPTS) -Wno-redundant-decls 
-Wno-strict-prototypes -Wno-unused-parameter -Wno-shadow
-- 
1.8.5.6.2.g3d8a54e.dirty



Re: [PATCH] net: ethernet: ti: cpsw: return NET_XMIT_DROP if skb_padto failed

2017-02-11 Thread David Miller
From: Ivan Khoronzhuk 
Date: Sat, 11 Feb 2017 03:49:57 +0200

> If skb_padto failed the skb has been dropped already, so it was
> consumed, but it doesn't mean it was sent, thus no need to update
> queue tx time, etc. So, return NET_XMIT_DROP as more appropriate.
> 
> Signed-off-by: Ivan Khoronzhuk 

Applied.


Re: [PATCH v3 net-next 4/9] sunvnet: add driver stats for ethtool support

2017-02-11 Thread David Miller
From: Stephen Hemminger 
Date: Fri, 10 Feb 2017 16:22:08 -0800

> On Fri, 10 Feb 2017 09:38:20 -0800
> Shannon Nelson  wrote:
> 
>> +static void vsw_get_ethtool_stats(struct net_device *dev,
>> +  struct ethtool_stats *estats, u64 *data)
>> +{
>> +int i = 0;
>> +
>> +data[i++] = dev->stats.rx_packets;
>> +data[i++] = dev->stats.tx_packets;
>> +data[i++] = dev->stats.rx_bytes;
>> +data[i++] = dev->stats.tx_bytes;
>> +data[i++] = dev->stats.rx_errors;
>> +data[i++] = dev->stats.tx_errors;
>> +data[i++] = dev->stats.rx_dropped;
>> +data[i++] = dev->stats.tx_dropped;
>> +data[i++] = dev->stats.multicast;
> 
> Please do not duplicate regular network statistics into ethtool.
> This doesn't really add any value.

Agreed.


Re: [PATCHv6 0/7] Refactor macvtap to re-use tap functionality by other virtual intefaces

2017-02-11 Thread David Miller
From: Sainath Grandhi 
Date: Fri, 10 Feb 2017 16:03:45 -0800

> Tap character devices can be implemented on other virtual interfaces like
> ipvlan, similar to macvtap. Source code for tap functionality in macvtap
> can be re-used for this purpose.
> 
> This patch series splits macvtap source into two modules, macvtap and tap.
> This patch series also includes a patch for implementing tap character
> device driver based on the IP-VLAN network interface, called ipvtap.
> 
> These patches are tested on x86 platform.

Series applied, thanks.


[tip:WIP.sched/core 131/154] arch/sh/include/asm/fpu.h:11:6: error: dereferencing pointer to incomplete type 'struct pt_regs'

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
WIP.sched/core
head:   12372f63e2728a509817b56878cd6633d92053b3
commit: 63a4ca7de1d32b82b973dc6eb1da7398fb2630d2 [131/154] sched/headers: 
Remove  from 
config: sh-sh2007_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 63a4ca7de1d32b82b973dc6eb1da7398fb2630d2
# save the attached .config to linux build tree
make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   In file included from arch/sh/kernel/cpu/sh4/fpu.c:18:0:
   arch/sh/include/asm/fpu.h: In function 'release_fpu':
>> arch/sh/include/asm/fpu.h:11:6: error: dereferencing pointer to incomplete 
>> type 'struct pt_regs'
 regs->sr |= SR_FD;
 ^~
   In file included from arch/sh/include/asm/traps.h:7:0,
from arch/sh/kernel/cpu/sh4/fpu.c:19:
   arch/sh/kernel/cpu/sh4/fpu.c: At top level:
>> arch/sh/include/asm/traps_32.h:53:24: error: parameter 5 ('__regs') has 
>> incomplete type
struct pt_regs __regs)
   ^
   arch/sh/kernel/cpu/sh4/fpu.c:405:1: note: in expansion of macro 
'BUILD_TRAP_HANDLER'
BUILD_TRAP_HANDLER(fpu_error)
^~
   arch/sh/kernel/cpu/sh4/fpu.c: In function 'fpu_error_trap_handler':
   arch/sh/kernel/cpu/sh4/fpu.c:428:2: error: implicit declaration of function 
'force_sig' [-Werror=implicit-function-declaration]
 force_sig(SIGFPE, tsk);
 ^
   cc1: some warnings being treated as errors

vim +11 arch/sh/include/asm/fpu.h

332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   1  #ifndef 
__ASM_SH_FPU_H
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   2  #define 
__ASM_SH_FPU_H
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   3  
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   4  #ifndef 
__ASSEMBLY__
0ea820cf arch/sh/include/asm/fpu.h Paul Mundt2010-01-13   5  
0ea820cf arch/sh/include/asm/fpu.h Paul Mundt2010-01-13   6  struct 
task_struct;
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   7  
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   8  #ifdef 
CONFIG_SH_FPU
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22   9  static inline 
void release_fpu(struct pt_regs *regs)
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  10  {
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22 @11 
regs->sr |= SR_FD;
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  12  }
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  13  
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  14  static inline 
void grab_fpu(struct pt_regs *regs)
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  15  {
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  16 
regs->sr &= ~SR_FD;
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  17  }
332fd57b include/asm-sh/fpu.h  Paul Mundt2007-11-22  18  
d3ea9fa0 arch/sh/include/asm/fpu.h Stuart Menefy 2009-09-25  19  extern void 
save_fpu(struct task_struct *__tsk);

:: The code at line 11 was first introduced by commit
:: 332fd57b92d26e2ac6112340b98e92bb76117a41 sh: Bring the SH-5 FPU in line 
with the SH-4 FPU API.

:: TO: Paul Mundt 
:: CC: Paul Mundt 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[tip:WIP.sched/core 74/154] arch/arm/nwfpe/fpmodule.c:54:21: error: implicit declaration of function 'send_sig'

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
WIP.sched/core
head:   12372f63e2728a509817b56878cd6633d92053b3
commit: 3cff44a935eba893a68a1bcb3ee7e90cbbbabbb7 [74/154] sched/headers: Move 
task_struct::signal and task_struct::sighand types and accessors into 

config: arm-h3600_defconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 3cff44a935eba893a68a1bcb3ee7e90cbbbabbb7
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   arch/arm/nwfpe/fpmodule.c: In function 'float_raise':
>> arch/arm/nwfpe/fpmodule.c:54:21: error: implicit declaration of function 
>> 'send_sig' [-Werror=implicit-function-declaration]
#define fp_send_sig send_sig
^
   arch/arm/nwfpe/fpmodule.c:178:3: note: in expansion of macro 'fp_send_sig'
  fp_send_sig(SIGFPE, current, 1);
  ^~~
   cc1: some warnings being treated as errors

vim +/send_sig +54 arch/arm/nwfpe/fpmodule.c

^1da177e Linus Torvalds 2005-04-16  48  #define NWFPE_BITS "double"
^1da177e Linus Torvalds 2005-04-16  49  #endif
^1da177e Linus Torvalds 2005-04-16  50  
^1da177e Linus Torvalds 2005-04-16  51  #ifdef MODULE
^1da177e Linus Torvalds 2005-04-16  52  void fp_send_sig(unsigned long sig, 
struct task_struct *p, int priv);
^1da177e Linus Torvalds 2005-04-16  53  #else
^1da177e Linus Torvalds 2005-04-16 @54  #define fp_send_sig send_sig
^1da177e Linus Torvalds 2005-04-16  55  #define kern_fp_enter   fp_enter
^1da177e Linus Torvalds 2005-04-16  56  
^1da177e Linus Torvalds 2005-04-16  57  extern char fpe_type[];

:: The code at line 54 was first introduced by commit
:: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:: TO: Linus Torvalds 
:: CC: Linus Torvalds 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH v5] fork: free vmapped stacks in cache when cpus are offline

2017-02-11 Thread Hoeun Ryu

> On Feb 12, 2017, at 5:19 AM, Thomas Gleixner  wrote:
> 
>> On Sat, 11 Feb 2017, kbuild test robot wrote:
>> 
>> Hi Hoeun,
>> 
>> [auto build test ERROR on linus/master]
>> [also build test ERROR on v4.10-rc7 next-20170210]
>> [if your patch is applied to the wrong git tree, please drop us a note to 
>> help improve the system]
>> 
>> url:
>> https://github.com/0day-ci/linux/commits/Hoeun-Ryu/fork-free-vmapped-stacks-in-cache-when-cpus-are-offline/20170211-183401
>> config: ia64-allmodconfig (attached as .config)
>> compiler: ia64-linux-gcc (GCC) 6.2.0
>> reproduce:
>>wget 
>> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>>  -O ~/bin/make.cross
>>chmod +x ~/bin/make.cross
>># save the attached .config to linux build tree
>>make.cross ARCH=ia64 
>> 
>> All errors (new ones prefixed by >>):
>> 
>>   kernel/fork.c: In function 'fork_init':
>>>> kernel/fork.c:483:2: error: implicit declaration of function 
>>>> 'vm_stack_cache_init' [-Werror=implicit-function-declaration]
>> vm_stack_cache_init();
>> ^~~
> 
> Right. This needs to move to a different place as that part is nested inside
> 
> #ifndef CONFIG_ARCH_THREAD_STACK_ALLOCATOR
> 
> That's an horrible ifdef maze in that file.
> 

I think we should rollback to v4. Do you agree?

> Thanks,
> 
>tglx


cc1: error: '-march=r3900' requires '-mfp32'

2017-02-11 Thread kbuild test robot
Hi James,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: 034827c727f7f3946a18355b63995b402c226c82 MIPS: Fix -mabi=64 build of 
vdso.lds
date:   4 months ago
config: mips-jmr3927_defconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 034827c727f7f3946a18355b63995b402c226c82
# save the attached .config to linux build tree
make.cross ARCH=mips 

All errors (new ones prefixed by >>):

>> cc1: error: '-march=r3900' requires '-mfp32'

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[tip:WIP.sched/core 88/154] arch/s390/appldata/appldata_base.c:572:19: error: 'nr_threads' undeclared here (not in a function)

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
WIP.sched/core
head:   12372f63e2728a509817b56878cd6633d92053b3
commit: 1a0c1b565f6d461190282268c46480b53785651e [88/154] sched/headers: Move 
task statistics APIs from  to 
config: s390-default_defconfig (attached as .config)
compiler: s390x-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 1a0c1b565f6d461190282268c46480b53785651e
# save the attached .config to linux build tree
make.cross ARCH=s390 

All errors (new ones prefixed by >>):

   In file included from include/linux/linkage.h:6:0,
from include/linux/kernel.h:6,
from include/linux/list.h:8,
from include/linux/module.h:9,
from arch/s390/appldata/appldata_base.c:14:
>> arch/s390/appldata/appldata_base.c:572:19: error: 'nr_threads' undeclared 
>> here (not in a function)
EXPORT_SYMBOL_GPL(nr_threads);
  ^
   include/linux/export.h:58:16: note: in definition of macro '___EXPORT_SYMBOL'
 extern typeof(sym) sym;  \
   ^~~
   arch/s390/appldata/appldata_base.c:572:1: note: in expansion of macro 
'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(nr_threads);
^
>> arch/s390/appldata/appldata_base.c:573:19: error: 'nr_running' undeclared 
>> here (not in a function)
EXPORT_SYMBOL_GPL(nr_running);
  ^
   include/linux/export.h:58:16: note: in definition of macro '___EXPORT_SYMBOL'
 extern typeof(sym) sym;  \
   ^~~
   arch/s390/appldata/appldata_base.c:573:1: note: in expansion of macro 
'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(nr_running);
^
>> arch/s390/appldata/appldata_base.c:574:19: error: 'nr_iowait' undeclared 
>> here (not in a function)
EXPORT_SYMBOL_GPL(nr_iowait);
  ^
   include/linux/export.h:58:16: note: in definition of macro '___EXPORT_SYMBOL'
 extern typeof(sym) sym;  \
   ^~~
   arch/s390/appldata/appldata_base.c:574:1: note: in expansion of macro 
'EXPORT_SYMBOL_GPL'
EXPORT_SYMBOL_GPL(nr_iowait);
^

vim +/nr_threads +572 arch/s390/appldata/appldata_base.c

^1da177e4 Linus Torvalds  2005-04-16  566  
EXPORT_SYMBOL_GPL(appldata_unregister_ops);
5b5dd21a8 Gerald Schaefer 2006-06-29  567  EXPORT_SYMBOL_GPL(appldata_diag);
^1da177e4 Linus Torvalds  2005-04-16  568  
0c3252d58 Gerald Schaefer 2008-07-14  569  #ifdef CONFIG_SWAP
^1da177e4 Linus Torvalds  2005-04-16  570  EXPORT_SYMBOL_GPL(si_swapinfo);
0c3252d58 Gerald Schaefer 2008-07-14  571  #endif
^1da177e4 Linus Torvalds  2005-04-16 @572  EXPORT_SYMBOL_GPL(nr_threads);
^1da177e4 Linus Torvalds  2005-04-16 @573  EXPORT_SYMBOL_GPL(nr_running);
^1da177e4 Linus Torvalds  2005-04-16 @574  EXPORT_SYMBOL_GPL(nr_iowait);

:: The code at line 572 was first introduced by commit
:: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:: TO: Linus Torvalds 
:: CC: Linus Torvalds 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[tip:WIP.sched/core 74/154] arch/sh/kernel/cpu/sh4/fpu.c:428:2: error: implicit declaration of function 'force_sig'

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
WIP.sched/core
head:   12372f63e2728a509817b56878cd6633d92053b3
commit: 3cff44a935eba893a68a1bcb3ee7e90cbbbabbb7 [74/154] sched/headers: Move 
task_struct::signal and task_struct::sighand types and accessors into 

config: sh-sh2007_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 3cff44a935eba893a68a1bcb3ee7e90cbbbabbb7
# save the attached .config to linux build tree
make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   arch/sh/kernel/cpu/sh4/fpu.c: In function 'fpu_error_trap_handler':
>> arch/sh/kernel/cpu/sh4/fpu.c:428:2: error: implicit declaration of function 
>> 'force_sig' [-Werror=implicit-function-declaration]
 force_sig(SIGFPE, tsk);
 ^
   cc1: some warnings being treated as errors

vim +/force_sig +428 arch/sh/kernel/cpu/sh4/fpu.c

0ea820cf Paul Mundt 2010-01-13  422 if 
tsk->thread.xstate->hardfpu.fpscr & FPSCR_ENABLE_MASK) >> 7) &
c8c0a1ab Stuart Menefy  2007-11-30  423  
(fpu_exception_flags >> 2)) == 0) {
^1da177e Linus Torvalds 2005-04-16  424 return;
c8c0a1ab Stuart Menefy  2007-11-30  425 }
c8c0a1ab Stuart Menefy  2007-11-30  426 }
^1da177e Linus Torvalds 2005-04-16  427  
^1da177e Linus Torvalds 2005-04-16 @428 force_sig(SIGFPE, tsk);
^1da177e Linus Torvalds 2005-04-16  429  }

:: The code at line 428 was first introduced by commit
:: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:: TO: Linus Torvalds 
:: CC: Linus Torvalds 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH v11 7/9] mmc: cavium: Add scatter-gather DMA support

2017-02-11 Thread kbuild test robot
Hi Jan,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc7 next-20170210]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Jan-Glauber/Cavium-MMC-driver/20170206-214740
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

   arch/arm64/include/asm/io.h:137:32: note: in expansion of macro 
'readq_relaxed'
#define readq(c)  ({ u64 __v = readq_relaxed(c); __iormb(); __v; })
   ^
   drivers/mmc/host/cavium-mmc.c:255:29: note: in expansion of macro 'readq'
  old_slot->cached_switch = readq(host->base + MIO_EMM_SWITCH);
^
   drivers/mmc/host/cavium-mmc.c:256:45: error: 'MIO_EMM_RCA' undeclared (first 
use in this function)
  old_slot->cached_rca = readq(host->base + MIO_EMM_RCA);
^
   include/uapi/linux/swab.h:129:32: note: in definition of macro '__swab64'
 (__builtin_constant_p((__u64)(x)) ? \
   ^
   include/linux/byteorder/generic.h:86:21: note: in expansion of macro 
'__le64_to_cpu'
#define le64_to_cpu __le64_to_cpu
^
   arch/arm64/include/asm/io.h:137:32: note: in expansion of macro 
'readq_relaxed'
#define readq(c)  ({ u64 __v = readq_relaxed(c); __iormb(); __v; })
   ^
   drivers/mmc/host/cavium-mmc.c:256:26: note: in expansion of macro 'readq'
  old_slot->cached_rca = readq(host->base + MIO_EMM_RCA);
 ^
   In file included from include/linux/scatterlist.h:8:0,
from include/linux/dma-mapping.h:10,
from drivers/mmc/host/cavium-mmc.c:18:
   drivers/mmc/host/cavium-mmc.c:267:38: error: 'MIO_EMM_SAMPLE' undeclared 
(first use in this function)
 writeq(emm_sample.val, host->base + MIO_EMM_SAMPLE);
 ^
   arch/arm64/include/asm/io.h:127:78: note: in definition of macro 
'writeq_relaxed'
#define writeq_relaxed(v,c) ((void)__raw_writeq((__force 
u64)cpu_to_le64(v),(c)))

 ^
   drivers/mmc/host/cavium-mmc.c:267:2: note: in expansion of macro 'writeq'
 writeq(emm_sample.val, host->base + MIO_EMM_SAMPLE);
 ^~
   drivers/mmc/host/cavium-mmc.c: In function 'do_read':
   drivers/mmc/host/cavium-mmc.c:281:47: error: 'MIO_EMM_BUF_IDX' undeclared 
(first use in this function)
 writeq((0x1 | (dbuf << 6)), host->base + MIO_EMM_BUF_IDX);
  ^
   arch/arm64/include/asm/io.h:127:78: note: in definition of macro 
'writeq_relaxed'
#define writeq_relaxed(v,c) ((void)__raw_writeq((__force 
u64)cpu_to_le64(v),(c)))

 ^
   drivers/mmc/host/cavium-mmc.c:281:2: note: in expansion of macro 'writeq'
 writeq((0x1 | (dbuf << 6)), host->base + MIO_EMM_BUF_IDX);
 ^~
   In file included from include/linux/swab.h:4:0,
from include/uapi/linux/byteorder/big_endian.h:12,
from include/linux/byteorder/big_endian.h:4,
from arch/arm64/include/uapi/asm/byteorder.h:20,
from include/asm-generic/bitops/le.h:5,
from arch/arm64/include/asm/bitops.h:50,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from include/linux/delay.h:10,
from drivers/mmc/host/cavium-mmc.c:16:
   drivers/mmc/host/cavium-mmc.c:291:29: error: 'MIO_EMM_BUF_DAT' undeclared 
(first use in this function)
   dat = readq(host->base + MIO_EMM_BUF_DAT);
^
   include/uapi/linux/swab.h:129:32: note: in definition of macro '__swab64'
 (__builtin_constant_p((__u64)(x)) ? \
   ^
   include/linux/byteorder/generic.h:86:21: note: in expansion of macro 
'__le64_to_cpu'
#define le64_to_cpu __le64_to_cpu
^
   arch/arm64/include/asm/io.h:137:32: note: in expansion of macro 
'readq_relaxed'
#define readq(c)  ({ u64 __v = readq_relaxed(c); __iormb(); __v; })
   ^
   drivers/mmc/host/cavium-mmc.c:291:10: note: in expansion of macro 'readq'
   dat = readq(host->base + MIO_EMM_BUF_DAT);
 ^
   drivers/mmc/host/cavium-mmc.c: In function 'set_cmd_

{standard input}:107: Error: unknown opcode

2017-02-11 Thread kbuild test robot
Hi Rich,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: b4214e41b7152b1964a3421a40251d202ae2d2c0 sh: add SMP support for J2
date:   6 months ago
config: sh-j2_defconfig (attached as .config)
compiler: sh4-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout b4214e41b7152b1964a3421a40251d202ae2d2c0
# save the attached .config to linux build tree
make.cross ARCH=sh 

All errors (new ones prefixed by >>):

   {standard input}: Assembler messages:
>> {standard input}:107: Error: unknown opcode
   {standard input}:141: Error: unknown opcode
   {standard input}:159: Error: unknown opcode

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: [PATCH v11 6/9] mmc: cavium: Add MMC PCI driver for ThunderX SOCs

2017-02-11 Thread kbuild test robot
Hi Jan,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.10-rc7 next-20170210]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Jan-Glauber/Cavium-MMC-driver/20170206-214740
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

All errors (new ones prefixed by >>):

   In file included from drivers/mmc/host/cavium-mmc.c:28:0:
   drivers/mmc/host/cavium-mmc.h:41:7: warning: "CONFIG_MMC_CAVIUM_THUNDERX" is 
not defined [-Wundef]
#elif CONFIG_MMC_CAVIUM_THUNDERX
  ^~
   In file included from include/linux/swab.h:4:0,
from include/uapi/linux/byteorder/big_endian.h:12,
from include/linux/byteorder/big_endian.h:4,
from arch/arm64/include/uapi/asm/byteorder.h:20,
from include/asm-generic/bitops/le.h:5,
from arch/arm64/include/asm/bitops.h:50,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from include/linux/delay.h:10,
from drivers/mmc/host/cavium-mmc.c:16:
   drivers/mmc/host/cavium-mmc.c: In function 'check_switch_errors':
>> drivers/mmc/host/cavium-mmc.c:156:38: error: 'MIO_EMM_SWITCH' undeclared 
>> (first use in this function)
 emm_switch.val = readq(host->base + MIO_EMM_SWITCH);
 ^
   include/uapi/linux/swab.h:129:32: note: in definition of macro '__swab64'
 (__builtin_constant_p((__u64)(x)) ? \
   ^
   include/linux/byteorder/generic.h:86:21: note: in expansion of macro 
'__le64_to_cpu'
#define le64_to_cpu __le64_to_cpu
^
   arch/arm64/include/asm/io.h:137:32: note: in expansion of macro 
'readq_relaxed'
#define readq(c)  ({ u64 __v = readq_relaxed(c); __iormb(); __v; })
   ^
   drivers/mmc/host/cavium-mmc.c:156:19: note: in expansion of macro 'readq'
 emm_switch.val = readq(host->base + MIO_EMM_SWITCH);
  ^
   drivers/mmc/host/cavium-mmc.c:156:38: note: each undeclared identifier is 
reported only once for each function it appears in
 emm_switch.val = readq(host->base + MIO_EMM_SWITCH);
 ^
   include/uapi/linux/swab.h:129:32: note: in definition of macro '__swab64'
 (__builtin_constant_p((__u64)(x)) ? \
   ^
   include/linux/byteorder/generic.h:86:21: note: in expansion of macro 
'__le64_to_cpu'
#define le64_to_cpu __le64_to_cpu
^
   arch/arm64/include/asm/io.h:137:32: note: in expansion of macro 
'readq_relaxed'
#define readq(c)  ({ u64 __v = readq_relaxed(c); __iormb(); __v; })
   ^
   drivers/mmc/host/cavium-mmc.c:156:19: note: in expansion of macro 'readq'
 emm_switch.val = readq(host->base + MIO_EMM_SWITCH);
  ^
   In file included from include/linux/scatterlist.h:8:0,
from include/linux/dma-mapping.h:10,
from drivers/mmc/host/cavium-mmc.c:18:
   drivers/mmc/host/cavium-mmc.c: In function 'do_switch':
   drivers/mmc/host/cavium-mmc.c:184:38: error: 'MIO_EMM_SWITCH' undeclared 
(first use in this function)
 writeq(emm_switch.val, host->base + MIO_EMM_SWITCH);
 ^
   arch/arm64/include/asm/io.h:127:78: note: in definition of macro 
'writeq_relaxed'
#define writeq_relaxed(v,c) ((void)__raw_writeq((__force 
u64)cpu_to_le64(v),(c)))

 ^
   drivers/mmc/host/cavium-mmc.c:184:2: note: in expansion of macro 'writeq'
 writeq(emm_switch.val, host->base + MIO_EMM_SWITCH);
 ^~
   In file included from include/linux/swab.h:4:0,
from include/uapi/linux/byteorder/big_endian.h:12,
from include/linux/byteorder/big_endian.h:4,
from arch/arm64/include/uapi/asm/byteorder.h:20,
from include/asm-generic/bitops/le.h:5,
from arch/arm64/include/asm/bitops.h:50,
from include/linux/bitops.h:36,
from include/linux/kernel.h:10,
from include/linux/delay.h:10,
from drivers/mmc/host/cavium-mmc.c:16:
>> drivers/mmc/host/cavium-mmc.c:191:36: error: 'MIO_EMM_RSP_STS' undeclared 
>> (first use in this function)
  rsp_sts.val = readq(host->ba

[PATCH v2] tty: pty: Fix flush ldisc after userspace see the data already

2017-02-11 Thread Wang YanQing
When tty_buffer_flush calling had been enabled in pty_flush_buffer
(in commit 1d1d14da12e79a6c05fbe1a975401f0f56c93316
 "pty: Fix buffer flush deadlock"), this causes a issue had been
hidden before it.

Don't flush line discipline of another side, because user could see the data
in line discipline through poll, TIOCINQ or FIONREAD already. Current behavior
break the expection of userspace application in below situations.

Example1:
Thread A Thread B
 
n_tty_poll return POLLIN
 CTRL-C trigger pty_flush_buffer
   tty_buffer_flush
 n_tty_flush_buffer
TIOCINQ or FIONREAD
  return zero number of bytes

Example2:
Thread A Thread B
 
TIOCINQ or FIONREAD
  return valid number of bytes

 CTRL-C trigger pty_flush_buffer
   tty_buffer_flush
 n_tty_flush_buffer
n_tty_read still block due to no data

I meet this problem(Example1) in konsole, current behavior cause konsole to 
hangup
forever.

It has high possibility to trigger the trouble I meet to execute below commands 
a
few times in konsole, because konsole treat current kernel behavior as EOF:
1:cat BigFile
2:CTRL-C

Fixes: 1d1d14da12e7 ("pty: Fix buffer flush deadlock")
CC: sta...@vger.kernel.org # v4.0+
Signed-off-by: Wang YanQing 
---
 Changes:
 v1-v2:
 1: Rewrite the oneline description, subject.
 2: Reword changelog.

 drivers/tty/pty.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index a23fa5e..2b90738 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -216,16 +216,11 @@ static int pty_signal(struct tty_struct *tty, int sig)
 static void pty_flush_buffer(struct tty_struct *tty)
 {
struct tty_struct *to = tty->link;
-   struct tty_ldisc *ld;
 
if (!to)
return;
 
-   ld = tty_ldisc_ref(to);
-   tty_buffer_flush(to, ld);
-   if (ld)
-   tty_ldisc_deref(ld);
-
+   tty_buffer_flush(to, NULL);
if (to->packet) {
spin_lock_irq(&tty->ctrl_lock);
tty->ctrl_status |= TIOCPKT_FLUSHWRITE;
-- 
1.8.5.6.2.g3d8a54e.dirty



arch/ia64/kernel/entry.S:621: Error: Operand 2 of `adds' should be a 14-bit integer (-8192-8191)

2017-02-11 Thread kbuild test robot
Hi Will,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: da48d094ce5d7c7dcdad9011648a81c42fd1c2ef Kconfig: remove 
HAVE_LATENCYTOP_SUPPORT
date:   1 year, 1 month ago
config: ia64-allyesconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout da48d094ce5d7c7dcdad9011648a81c42fd1c2ef
# save the attached .config to linux build tree
make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   arch/ia64/kernel/entry.S: Assembler messages:
>> arch/ia64/kernel/entry.S:621: Error: Operand 2 of `adds' should be a 14-bit 
>> integer (-8192-8191)
   arch/ia64/kernel/entry.S:728: Error: Operand 2 of `adds' should be a 14-bit 
integer (-8192-8191)
   arch/ia64/kernel/entry.S:859: Error: Operand 2 of `adds' should be a 14-bit 
integer (-8192-8191)
--
   arch/ia64/kernel/ivt.S: Assembler messages:
>> arch/ia64/kernel/ivt.S:759: Error: Operand 3 of `add' should be a general 
>> register r0-r3

vim +621 arch/ia64/kernel/entry.S

^1da177e Linus Torvalds 2005-04-16  605 PT_REGS_UNWIND_INFO(0)
^1da177e Linus Torvalds 2005-04-16  606  {  /*
^1da177e Linus Torvalds 2005-04-16  607  * Some versions of gas 
generate bad unwind info if the first instruction of a
^1da177e Linus Torvalds 2005-04-16  608  * procedure doesn't go into 
the first slot of a bundle.  This is a workaround.
^1da177e Linus Torvalds 2005-04-16  609  */
^1da177e Linus Torvalds 2005-04-16  610 nop.m 0
^1da177e Linus Torvalds 2005-04-16  611 nop.i 0
^1da177e Linus Torvalds 2005-04-16  612 /*
^1da177e Linus Torvalds 2005-04-16  613  * We need to call 
schedule_tail() to complete the scheduling process.
^1da177e Linus Torvalds 2005-04-16  614  * Called by ia64_switch_to() 
after do_fork()->copy_thread().  r8 contains the
^1da177e Linus Torvalds 2005-04-16  615  * address of the previously 
executing task.
^1da177e Linus Torvalds 2005-04-16  616  */
^1da177e Linus Torvalds 2005-04-16  617 br.call.sptk.many 
rp=ia64_invoke_schedule_tail
^1da177e Linus Torvalds 2005-04-16  618  }
^1da177e Linus Torvalds 2005-04-16  619  .ret8:
54d496c3 Al Viro2012-10-14  620  (pKStk)br.call.sptk.many 
rp=call_payload
^1da177e Linus Torvalds 2005-04-16 @621 adds 
r2=TI_FLAGS+IA64_TASK_SIZE,r13
^1da177e Linus Torvalds 2005-04-16  622 ;;
^1da177e Linus Torvalds 2005-04-16  623 ld4 r2=[r2]
^1da177e Linus Torvalds 2005-04-16  624 ;;
^1da177e Linus Torvalds 2005-04-16  625 mov r8=0
^1da177e Linus Torvalds 2005-04-16  626 and 
r2=_TIF_SYSCALL_TRACEAUDIT,r2
^1da177e Linus Torvalds 2005-04-16  627 ;;
^1da177e Linus Torvalds 2005-04-16  628 cmp.ne p6,p0=r2,r0
^1da177e Linus Torvalds 2005-04-16  629  (p6)   br.cond.spnt 
.strace_check_retval

:: The code at line 621 was first introduced by commit
:: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:: TO: Linus Torvalds 
:: CC: Linus Torvalds 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[tip:sched/core 83/86] kernel/sched/core.c:199:25: error: 'paravirt_steal_rq_enabled' undeclared

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core
head:   bb3bac2ca9a3a5b7fa601781adf70167a0449d75
commit: 004172bdad644327dc7a6543186b9d7b529ee944 [83/86] sched/core: Remove 
unnecessary #include headers
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 004172bdad644327dc7a6543186b9d7b529ee944
# save the attached .config to linux build tree
make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   kernel/sched/core.c: In function 'update_rq_clock_task':
>> kernel/sched/core.c:199:25: error: 'paravirt_steal_rq_enabled' undeclared 
>> (first use in this function)
 if (static_key_false((¶virt_steal_rq_enabled))) {
^
   kernel/sched/core.c:199:25: note: each undeclared identifier is reported 
only once for each function it appears in
>> kernel/sched/core.c:200:11: error: implicit declaration of function 
>> 'paravirt_steal_clock' [-Werror=implicit-function-declaration]
  steal = paravirt_steal_clock(cpu_of(rq));
  ^~~~
   cc1: some warnings being treated as errors

vim +/paravirt_steal_rq_enabled +199 kernel/sched/core.c

535b9552 Ingo Molnar 2017-02-01  193irq_delta = delta;
535b9552 Ingo Molnar 2017-02-01  194  
535b9552 Ingo Molnar 2017-02-01  195rq->prev_irq_time += irq_delta;
535b9552 Ingo Molnar 2017-02-01  196delta -= irq_delta;
535b9552 Ingo Molnar 2017-02-01  197  #endif
535b9552 Ingo Molnar 2017-02-01  198  #ifdef CONFIG_PARAVIRT_TIME_ACCOUNTING
535b9552 Ingo Molnar 2017-02-01 @199if 
(static_key_false((¶virt_steal_rq_enabled))) {
535b9552 Ingo Molnar 2017-02-01 @200steal = 
paravirt_steal_clock(cpu_of(rq));
535b9552 Ingo Molnar 2017-02-01  201steal -= rq->prev_steal_time_rq;
535b9552 Ingo Molnar 2017-02-01  202  
535b9552 Ingo Molnar 2017-02-01  203if (unlikely(steal > delta))

:: The code at line 199 was first introduced by commit
:: 535b9552bb81eebe112ee7bd34ee498857b0c26b sched/rq_clock: Consolidate the 
ordering of the rq_clock methods

:: TO: Ingo Molnar 
:: CC: Ingo Molnar 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[tip:WIP.sched/core 98/154] arch/mips/include/asm/processor.h:384:41: error: implicit declaration of function 'task_stack_page'

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 
WIP.sched/core
head:   12372f63e2728a509817b56878cd6633d92053b3
commit: 030a6259fec4df48769d8efc0e0d4431e05935aa [98/154] sched/headers: Move 
task-stack related APIs from  to 
config: mips-generic_defconfig (attached as .config)
compiler: mipsel-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 030a6259fec4df48769d8efc0e0d4431e05935aa
# save the attached .config to linux build tree
make.cross ARCH=mips 

All errors (new ones prefixed by >>):

   In file included from arch/mips/include/asm/io.h:28:0,
from include/linux/io.h:25,
from arch/mips/kernel/smp-cps.c:12:
   arch/mips/kernel/smp-cps.c: In function 'cps_boot_secondary':
>> arch/mips/include/asm/processor.h:384:41: error: implicit declaration of 
>> function 'task_stack_page' [-Werror=implicit-function-declaration]
#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + \
^
   arch/mips/kernel/smp-cps.c:302:16: note: in expansion of macro '__KSTK_TOS'
 vpe_cfg->sp = __KSTK_TOS(idle);
   ^~
   cc1: some warnings being treated as errors

vim +/task_stack_page +384 arch/mips/include/asm/processor.h

04cc89d1 arch/mips/include/asm/processor.h Ralf Baechle   2016-03-27  378  
static inline void flush_thread(void)
04cc89d1 arch/mips/include/asm/processor.h Ralf Baechle   2016-03-27  379  {
04cc89d1 arch/mips/include/asm/processor.h Ralf Baechle   2016-03-27  380  }
04cc89d1 arch/mips/include/asm/processor.h Ralf Baechle   2016-03-27  381  
^1da177e include/asm-mips/processor.h  Linus Torvalds 2005-04-16  382  
unsigned long get_wchan(struct task_struct *p);
^1da177e include/asm-mips/processor.h  Linus Torvalds 2005-04-16  383  
484889fc arch/mips/include/asm/processor.h David Daney2009-07-08 @384  
#define __KSTK_TOS(tsk) ((unsigned long)task_stack_page(tsk) + \
484889fc arch/mips/include/asm/processor.h David Daney2009-07-08  385   
 THREAD_SIZE - 32 - sizeof(struct pt_regs))
484889fc arch/mips/include/asm/processor.h David Daney2009-07-08  386  
#define task_pt_regs(tsk) ((struct pt_regs *)__KSTK_TOS(tsk))
40bc9c67 include/asm-mips/processor.h  Al Viro2006-01-12  387  
#define KSTK_EIP(tsk) (task_pt_regs(tsk)->cp0_epc)

:: The code at line 384 was first introduced by commit
:: 484889fc85a223ef56edc31828b86751b2296b7c MIPS: Avoid clobbering struct 
pt_regs in kthreads

:: TO: David Daney 
:: CC: Ralf Baechle 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


arch/mips/vdso/gettimeofday.c:1:0: error: '-march=r3900' requires '-mfp32'

2017-02-11 Thread kbuild test robot
Hi Guenter,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: 398c7500a1f5f74e207bd2edca1b1721b3cc1f1e MIPS: VDSO: Fix build error 
with binutils 2.24 and earlier
date:   1 year, 1 month ago
config: mips-jmr3927_defconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout 398c7500a1f5f74e207bd2edca1b1721b3cc1f1e
# save the attached .config to linux build tree
make.cross ARCH=mips 

All errors (new ones prefixed by >>):

>> arch/mips/vdso/gettimeofday.c:1:0: error: '-march=r3900' requires '-mfp32'
/*


vim +1 arch/mips/vdso/gettimeofday.c

a7f4df4e Alex Smith 2015-10-21 @1  /*
a7f4df4e Alex Smith 2015-10-21  2   * Copyright (C) 2015 Imagination 
Technologies
a7f4df4e Alex Smith 2015-10-21  3   * Author: Alex Smith 
a7f4df4e Alex Smith 2015-10-21  4   *
a7f4df4e Alex Smith 2015-10-21  5   * This program is free software; you can 
redistribute it and/or modify it
a7f4df4e Alex Smith 2015-10-21  6   * under the terms of the GNU General Public 
License as published by the
a7f4df4e Alex Smith 2015-10-21  7   * Free Software Foundation;  either version 
2 of the  License, or (at your
a7f4df4e Alex Smith 2015-10-21  8   * option) any later version.
a7f4df4e Alex Smith 2015-10-21  9   */

:: The code at line 1 was first introduced by commit
:: a7f4df4e21dd8a8dab96e88acd2c9c5017b83fc6 MIPS: VDSO: Add implementations 
of gettimeofday() and clock_gettime()

:: TO: Alex Smith 
:: CC: Ralf Baechle 

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


[no subject]

2017-02-11 Thread Chagri
hiya Linux



http://healthysumner.com/estadisticas.php?ride=2wvv41w9gskt1zkb



Chagri


arch/mips/vdso/elf.S:1:0: error: '-march=r3900' requires '-mfp32'

2017-02-11 Thread kbuild test robot
Hi Alex,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: ebb5e78cc63417a35254a791de66e1cc84f963cc MIPS: Initial implementation 
of a VDSO
date:   1 year, 3 months ago
config: mips-jmr3927_defconfig (attached as .config)
compiler: mips-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout ebb5e78cc63417a35254a791de66e1cc84f963cc
# save the attached .config to linux build tree
make.cross ARCH=mips 

All errors (new ones prefixed by >>):

>> arch/mips/vdso/elf.S:1:0: error: '-march=r3900' requires '-mfp32'
/*

--
>> arch/mips/vdso/sigreturn.S:1:0: error: '-march=r3900' requires '-mfp32'
/*


vim +1 arch/mips/vdso/elf.S

   > 1  /*
 2   * Copyright (C) 2015 Imagination Technologies
 3   * Author: Alex Smith 
 4   *

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


make[2]: *** No rule to make target 'olddefconfig'.

2017-02-11 Thread kbuild test robot
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   1ce42845f987e92eabfc6e026d44d826c25c74a5
commit: eed0eabd12ef061821cbfa20d903476e07645320 MIPS: generic: Introduce 
generic DT-based board support
date:   4 months ago
config: mips-64r6el_defconfig (attached as .config)
compiler: mips64el-linux-gnuabi64-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git checkout eed0eabd12ef061821cbfa20d903476e07645320
# save the attached .config to linux build tree
make.cross ARCH=mips 

All errors (new ones prefixed by >>):

>> make[2]: *** No rule to make target 'olddefconfig'.
   make[1]: *** [64r6el_defconfig] Error 2
   make: *** [sub-make] Error 2

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip


Re: 4.10-rc1: thinkpad x60: who ate my cpu?

2017-02-11 Thread Woody Suwalski

Pavel Machek wrote:

On Sat 2017-01-14 12:30:54, Pavel Machek wrote:

Hi!

On Thu 2017-01-12 20:19:31, Woody Suwalski wrote:

Pavel Machek wrote:

Hi!


I used to have two cpus, and Thinkpad X60 should have two cores, but I
only see one on 4.10-rc1. This machine went through many
suspend/resume cycles. When backups finish, I'll try -rc2.

Whoever did it, he seems to have returned the cpu in -rc3. All seems
to be good now.

Actually since you have mentioned - I have checked my x60 - same problem -
only one CPU. However I was running 4.8.13 with uptime 33 days, multiple
sleep/wake-ups.
Installed a current EOL 4.8.17 and rebooted - I see 2 CPUs. So the issue is
older then 4.10 kernel, and I suspect it is the CPU hotplug / wakeup
related...

Hmm. So I seen two cores in -rc3 after boot. But it is quite well
possible that -rc1 was ok just after boot, too, and problem happened
sometime later (probably during suspend/resume cycles). Let me go back
to -rc1 to check.

Indeed in -rc1 I see both CPUs after boot. So we have hard to
reproduce case where 4.8 to 4.10 kernels lose one of the cpu cores...



Managed to duplicate - but it took again a long time - I have an uptime 
of 29 days.
It must have happened in the last day, as I kept checking as often as I 
remembered.


The kernel is 4.8.17 EOL, installed almost a month ago.
Platform ThinkPad x60,  Intel(R) Core(TM) Duo CPU  T2400  @ 1.83GHz

In dmesg I see that it used to be when 2 CPUs were OK:
[690409.476107] PM: noirq suspend of devices complete after 79.914 msecs
[690409.476547] ACPI: Preparing to enter system sleep state S3
[690409.780081] ACPI : EC: EC stopped
[690409.780083] PM: Saving platform NVS memory
[690409.780284] Disabling non-boot CPUs ...
[690409.805284] smpboot: CPU 1 is now offline
[690409.816464] ACPI: Low-level resume complete
[690409.816464] ACPI : EC: EC started
[690409.816464] PM: Restoring platform NVS memory
[690409.816464] Enabling non-boot CPUs ...
[690409.840574] x86: Booting SMP configuration:
[690409.840576] smpboot: Booting Node 0 Processor 1 APIC 0x1
[690409.805271] Initializing CPU#1
[690409.805271] Disabled fast string operations
[690409.888252]  cache: parent cpu1 should not be sleeping
[690409.920185] CPU1 is up
[690409.922288] ACPI: Waking up from system sleep state S3

Then the CPU1 failed to start:

[691329.776108] PM: noirq suspend of devices complete after 79.941 msecs
[691329.776550] ACPI: Preparing to enter system sleep state S3
[691330.080081] ACPI : EC: EC stopped
[691330.080083] PM: Saving platform NVS memory
[691330.080284] Disabling non-boot CPUs ...
[691330.105303] smpboot: CPU 1 is now offline
[691330.116477] ACPI: Low-level resume complete
[691330.116477] ACPI : EC: EC started
[691330.116477] PM: Restoring platform NVS memory
[691330.116477] Enabling non-boot CPUs ...
[691330.140570] x86: Booting SMP configuration:
[691330.140572] smpboot: Booting Node 0 Processor 1 APIC 0x1
[691340.140015] smpboot: do_boot_cpu failed(-1) to wakeup CPU#1
[691340.164445] Error taking CPU1 up: -5
[691340.166309] ACPI: Waking up from system sleep state S3

And now it is:
[692517.868523] ACPI: Preparing to enter system sleep state S3
[692518.172074] ACPI : EC: EC stopped
[692518.172076] PM: Saving platform NVS memory
[692518.172269] Disabling non-boot CPUs ...
[692518.172269] ACPI: Low-level resume complete
[692518.172269] ACPI : EC: EC started
[692518.172269] PM: Restoring platform NVS memory
[692518.172269] ACPI: Waking up from system sleep state S3

Is there any test I could do on the CPU wakeup while in that state?

Woody



[PATCH] leds/trigger/activity: add a system activity LED trigger

2017-02-11 Thread Willy Tarreau
The "activity" trigger was inspired by the heartbeat one, but aims at
providing instant indication of the immediate CPU usage. Under idle
condition, it flashes 10ms every second. At 100% usage, it flashes
90ms every 100ms. The blinking frequency increases from 1 to 10 Hz
until either the load is high enough to saturate one CPU core or 50%
load is reached on a single-core system. Then past this point only the
duty cycle increases from 10 to 90%.

This results in a very visible activity reporting allowing one to
immediately tell whether a machine is under load or not, making it
quite suitable to be used in clusters.

Signed-off-by: Willy Tarreau 
---
 drivers/leds/trigger/Kconfig|   9 +
 drivers/leds/trigger/Makefile   |   1 +
 drivers/leds/trigger/ledtrig-activity.c | 290 
 3 files changed, 300 insertions(+)
 create mode 100644 drivers/leds/trigger/ledtrig-activity.c

diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig
index 3f9ddb9..8432d9e 100644
--- a/drivers/leds/trigger/Kconfig
+++ b/drivers/leds/trigger/Kconfig
@@ -77,6 +77,15 @@ config LEDS_TRIGGER_CPU
 
  If unsure, say N.
 
+config LEDS_TRIGGER_ACTIVITY
+   tristate "LED activity Trigger"
+   depends on LEDS_TRIGGERS
+   help
+ This allows LEDs to be controlled by a immediate CPU usage.
+ The flash frequency and duty cycle varies from faint flashes to
+ intense brightness depending on the instant CPU load.
+ If unsure, say Y.
+
 config LEDS_TRIGGER_GPIO
tristate "LED GPIO Trigger"
depends on LEDS_TRIGGERS
diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile
index a72c43c..e572ce57 100644
--- a/drivers/leds/trigger/Makefile
+++ b/drivers/leds/trigger/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT)+= ledtrig-heartbeat.o
 obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT)   += ledtrig-backlight.o
 obj-$(CONFIG_LEDS_TRIGGER_GPIO)+= ledtrig-gpio.o
 obj-$(CONFIG_LEDS_TRIGGER_CPU) += ledtrig-cpu.o
+obj-$(CONFIG_LEDS_TRIGGER_ACTIVITY)+= ledtrig-activity.o
 obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON)  += ledtrig-default-on.o
 obj-$(CONFIG_LEDS_TRIGGER_TRANSIENT)   += ledtrig-transient.o
 obj-$(CONFIG_LEDS_TRIGGER_CAMERA)  += ledtrig-camera.o
diff --git a/drivers/leds/trigger/ledtrig-activity.c 
b/drivers/leds/trigger/ledtrig-activity.c
new file mode 100644
index 000..9acdc56
--- /dev/null
+++ b/drivers/leds/trigger/ledtrig-activity.c
@@ -0,0 +1,290 @@
+/*
+ * Activity LED trigger
+ *
+ * Copyright (C) 2017 Willy Tarreau 
+ * Partially based on Atsushi Nemoto's ledtrig-heartbeat.c.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "../leds.h"
+
+static int panic_detected;
+
+struct activity_data {
+   struct timer_list timer;
+   u64 last_idle;
+   u64 last_boot;
+   int time_left;
+   int state;
+   int invert;
+};
+
+static void led_activity_function(unsigned long data)
+{
+   struct led_classdev *led_cdev = (struct led_classdev *)data;
+   struct activity_data *activity_data = led_cdev->trigger_data;
+   struct timespec boot_time;
+   unsigned int target;
+   unsigned int usage;
+   int delay;
+   u64 curr_idle;
+   u64 curr_boot;
+   u32 diff_idle;
+   u32 diff_boot;
+   int cpus;
+   int i;
+
+   if (unlikely(panic_detected)) {
+   /* full brightness in case of panic */
+   led_set_brightness_nosleep(led_cdev, led_cdev->max_brightness);
+   return;
+   }
+
+   get_monotonic_boottime(&boot_time);
+
+   cpus = 0;
+   curr_idle = 0;
+   for_each_possible_cpu(i) {
+   curr_idle += (__force u64)kcpustat_cpu(i).cpustat[CPUTIME_IDLE];
+   curr_idle += (__force 
u64)kcpustat_cpu(i).cpustat[CPUTIME_IOWAIT];
+   cpus++;
+   }
+
+   curr_boot = div_s64(timespec_to_ns(&boot_time), NSEC_PER_SEC / HZ) * 
cpus;
+   curr_idle = cputime64_to_jiffies64(curr_idle);
+   diff_boot = curr_boot - activity_data->last_boot;
+   diff_idle = curr_idle - activity_data->last_idle;
+
+   activity_data->last_boot = curr_boot;
+   activity_data->last_idle = curr_idle;
+
+   if (diff_boot <= 0)
+   usage = 0;
+   else if (diff_idle <= diff_boot)
+   usage = 100 - 100 * diff_idle / diff_boot;
+   else
+   usage = 100;
+
+   /*
+* Now we know the total boot_time multiplied by the number of CPUs, and
+* the total idle+wait time for all CPUs. We'll compare how they evolved
+* since last call. The % of overall CPU usage is :
+*
+*  1 - delta_i

Re: [PATCH -next] rtc: sun6i: Fix return value check in sun6i_rtc_clk_init()

2017-02-11 Thread Alexandre Belloni
On 09/02/2017 at 00:16:13 +, Wei Yongjun wrote:
> From: Wei Yongjun 
> 
> In case of error, the function of_io_request_and_map() returns ERR_PTR()
> and never returns NULL. The NULL test in the return value check should
> be replaced with IS_ERR().
> 
> Fixes: 847b8bf62eb4 ("rtc: sun6i: Expose the 32kHz oscillator")
> Signed-off-by: Wei Yongjun 
> ---
>  drivers/rtc/rtc-sun6i.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
Applied, thanks.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com


Re: [PATCH v2 2/2] arm: dts: mt2701: add nor flash node

2017-02-11 Thread Matthias Brugger



On 02/06/2017 08:45 AM, Boris Brezillon wrote:

Hi Guochun,

On Sun, 5 Feb 2017 12:00:49 +0800
Guochun Mao  wrote:




+   nor_flash: spi@11014000 {
+   compatible = "mediatek,mt2701-nor",
+"mediatek,mt8173-nor";
+   reg = <0 0x11014000 0 0xe0>;
+   clocks = <&pericfg CLK_PERI_FLASH>,
+<&topckgen CLK_TOP_FLASH_SEL>;
+   clock-names = "spi", "sf";
+   #address-cells = <1>;
+   #size-cells = <0>;
+   status = "disabled";
+   };
+
mmsys: syscon@1400 {
compatible = "mediatek,mt2701-mmsys", "syscon";
reg = <0 0x1400 0 0x1000>;


Hi,
mtk-quadspi.txt had been updated as suggested.
Is there suggestion about this patch?


It should probably go through the Mediatek tree. Matthias, any opinion?



Yes, I will take this one through mine tree.

Thanks,
Matthias


Re: [PATCH v2 06/10] clk: mediatek: add clk support for MT6797

2017-02-11 Thread Matthias Brugger



On 02/06/2017 01:15 PM, Mars Cheng wrote:

From: Kevin-CW Chen 

Add MT6797 clock support, include topckgen, apmixedsys, infracfg
and subsystem clocks

Signed-off-by: Kevin-CW Chen 
Signed-off-by: Mars Cheng 
---


Tested-by: Matthias Brugger 


 drivers/clk/mediatek/Kconfig   |   33 ++
 drivers/clk/mediatek/Makefile  |5 +
 drivers/clk/mediatek/clk-mt6797-img.c  |   76 
 drivers/clk/mediatek/clk-mt6797-mm.c   |  136 ++
 drivers/clk/mediatek/clk-mt6797-vdec.c |   93 +
 drivers/clk/mediatek/clk-mt6797-venc.c |   78 
 drivers/clk/mediatek/clk-mt6797.c  |  716 
 include/dt-bindings/clock/mt6797-clk.h |  281 +
 8 files changed, 1418 insertions(+)
 create mode 100644 drivers/clk/mediatek/clk-mt6797-img.c
 create mode 100644 drivers/clk/mediatek/clk-mt6797-mm.c
 create mode 100644 drivers/clk/mediatek/clk-mt6797-vdec.c
 create mode 100644 drivers/clk/mediatek/clk-mt6797-venc.c
 create mode 100644 drivers/clk/mediatek/clk-mt6797.c
 create mode 100644 include/dt-bindings/clock/mt6797-clk.h

diff --git a/drivers/clk/mediatek/Kconfig b/drivers/clk/mediatek/Kconfig
index 0bd631a..4b91eed 100644
--- a/drivers/clk/mediatek/Kconfig
+++ b/drivers/clk/mediatek/Kconfig
@@ -49,6 +49,39 @@ config COMMON_CLK_MT2701_BDPSYS
---help---
  This driver supports Mediatek MT2701 bdpsys clocks.

+config COMMON_CLK_MT6797
+   bool "Clock driver for Mediatek MT6797"
+   depends on (ARCH_MEDIATEK && ARM64) || COMPILE_TEST
+   select COMMON_CLK_MEDIATEK
+   default ARCH_MEDIATEK && ARM64
+   ---help---
+ This driver supports Mediatek MT6797 basic clocks.
+
+config COMMON_CLK_MT6797_MMSYS
+   bool "Clock driver for Mediatek MT6797 mmsys"
+   depends on COMMON_CLK_MT6797
+   ---help---
+ This driver supports Mediatek MT6797 mmsys clocks.
+
+config COMMON_CLK_MT6797_IMGSYS
+   bool "Clock driver for Mediatek MT6797 imgsys"
+   depends on COMMON_CLK_MT6797
+   ---help---
+ This driver supports Mediatek MT6797 imgsys clocks.
+
+config COMMON_CLK_MT6797_VDECSYS
+   bool "Clock driver for Mediatek MT6797 vdecsys"
+   depends on COMMON_CLK_MT6797
+   ---help---
+ This driver supports Mediatek MT6797 vdecsys clocks.
+
+config COMMON_CLK_MT6797_VENCSYS
+   bool "Clock driver for Mediatek MT6797 vencsys"
+   depends on COMMON_CLK_MT6797
+   ---help---
+ This driver supports Mediatek MT6797 vencsys clocks.
+
+
 config COMMON_CLK_MT8135
bool "Clock driver for Mediatek MT8135"
depends on ARCH_MEDIATEK || COMPILE_TEST
diff --git a/drivers/clk/mediatek/Makefile b/drivers/clk/mediatek/Makefile
index 19ae7ef..5c3afb8 100644
--- a/drivers/clk/mediatek/Makefile
+++ b/drivers/clk/mediatek/Makefile
@@ -1,5 +1,10 @@
 obj-$(CONFIG_COMMON_CLK_MEDIATEK) += clk-mtk.o clk-pll.o clk-gate.o 
clk-apmixed.o
 obj-$(CONFIG_RESET_CONTROLLER) += reset.o
+obj-$(CONFIG_COMMON_CLK_MT6797) += clk-mt6797.o
+obj-$(CONFIG_COMMON_CLK_MT6797_IMGSYS) += clk-mt6797-img.o
+obj-$(CONFIG_COMMON_CLK_MT6797_MMSYS) += clk-mt6797-mm.o
+obj-$(CONFIG_COMMON_CLK_MT6797_VDECSYS) += clk-mt6797-vdec.o
+obj-$(CONFIG_COMMON_CLK_MT6797_VENCSYS) += clk-mt6797-venc.o
 obj-$(CONFIG_COMMON_CLK_MT2701) += clk-mt2701.o
 obj-$(CONFIG_COMMON_CLK_MT2701_BDPSYS) += clk-mt2701-bdp.o
 obj-$(CONFIG_COMMON_CLK_MT2701_ETHSYS) += clk-mt2701-eth.o
diff --git a/drivers/clk/mediatek/clk-mt6797-img.c 
b/drivers/clk/mediatek/clk-mt6797-img.c
new file mode 100644
index 000..94cc480
--- /dev/null
+++ b/drivers/clk/mediatek/clk-mt6797-img.c
@@ -0,0 +1,76 @@
+/* Copyright (c) 2017 MediaTek Inc.
+ * Author: Kevin Chen 
+ *
+ * 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 "clk-mtk.h"
+#include "clk-gate.h"
+
+static const struct mtk_gate_regs img_cg_regs = {
+   .set_ofs = 0x0004,
+   .clr_ofs = 0x0008,
+   .sta_ofs = 0x,
+};
+
+#define GATE_IMG(_id, _name, _parent, _shift) {\
+   .id = _id,  \
+   .name = _name,  \
+   .parent_name = _parent, \
+   .regs = &img_cg_regs,   \
+   .shift = _shift,\
+   .ops = &mtk_clk_gate_ops_setclr,\
+   }
+
+static const struct mtk_gate img_clks[] = {
+   GATE_IMG(CLK_IMG_FDVT, "img_fdvt", "mm_sel", 11),
+   GATE_IMG(CLK_IMG_DPE, "img_dpe", "mm_sel", 10),
+   GATE_IMG(CLK_IMG_DIP, "img_dip", "mm_s

Re: [PATCH] smiapp: add CCP2 support

2017-02-11 Thread Pavel Machek
Hi!

> Besides this patch, what else is needed? The CSI-2 / CCP2 support is
> missing in V4L2 OF at least. It'd be better to have this all in the same
> set.

Quite a lot of is needed.

> I pushed the two DT patches here:
> 
> https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ccp2>

Thanks for a branch. If you could the two patches that look ok there,
it would mean less work for me, I could just mark those two as applied
here.

Core changes for CSI2 support are needed.

There are core changes in notifier locking, and subdev support.

I need video-bus-switch, at least for testing.

I need subdev support for omap3isp, so that we can attach flash and
focus devices.

Finally dts support on N900 can be enabled.

Thanks,

Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html


signature.asc
Description: Digital signature


Re: [PATCH v2 07/10] soc: mediatek: refine scysys for mediatek platforms

2017-02-11 Thread Matthias Brugger



On 02/06/2017 01:15 PM, Mars Cheng wrote:

This adds 2 refinements: avoid fixed spm power statue and add vdec item



Please be more explicit in the commit message.


Signed-off-by: Mars Cheng 
Signed-off-by: Kevin-CW Chen 
---
 drivers/soc/mediatek/mtk-scpsys.c |   35 +--
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-scpsys.c 
b/drivers/soc/mediatek/mtk-scpsys.c
index beb7916..a8ba800 100644
--- a/drivers/soc/mediatek/mtk-scpsys.c
+++ b/drivers/soc/mediatek/mtk-scpsys.c
@@ -71,6 +71,7 @@ enum clk_id {
CLK_VENC,
CLK_VENC_LT,
CLK_ETHIF,
+   CLK_VDEC,
CLK_MAX,
 };

@@ -81,6 +82,7 @@ enum clk_id {
"venc",
"venc_lt",
"ethif",
+   "vdec",
NULL,
 };


Put CLK_VDEC addition in the patch where you add support for mt6797.

Thanks,
Matthias



@@ -107,21 +109,28 @@ struct scp_domain {
struct regulator *supply;
 };

+struct scp_ctrl_reg {
+   int pwr_sta_offs;
+   int pwr_sta2nd_offs;
+};
+
 struct scp {
struct scp_domain *domains;
struct genpd_onecell_data pd_data;
struct device *dev;
void __iomem *base;
struct regmap *infracfg;
+   struct scp_ctrl_reg ctrl_reg;
 };

 static int scpsys_domain_is_on(struct scp_domain *scpd)
 {
struct scp *scp = scpd->scp;

-   u32 status = readl(scp->base + SPM_PWR_STATUS) & scpd->data->sta_mask;
-   u32 status2 = readl(scp->base + SPM_PWR_STATUS_2ND) &
-   scpd->data->sta_mask;
+   u32 status = readl(scp->base + scp->ctrl_reg.pwr_sta_offs) &
+   scpd->data->sta_mask;
+   u32 status2 = readl(scp->base + scp->ctrl_reg.pwr_sta2nd_offs) &
+   scpd->data->sta_mask;

/*
 * A domain is on when both status bits are set. If only one is set
@@ -346,7 +355,8 @@ static void init_clks(struct platform_device *pdev, struct 
clk **clk)
 }

 static struct scp *init_scp(struct platform_device *pdev,
-   const struct scp_domain_data *scp_domain_data, int num)
+   const struct scp_domain_data *scp_domain_data, int num,
+   struct scp_ctrl_reg *scp_ctrl_reg)
 {
struct genpd_onecell_data *pd_data;
struct resource *res;
@@ -358,6 +368,9 @@ static struct scp *init_scp(struct platform_device *pdev,
if (!scp)
return ERR_PTR(-ENOMEM);

+   scp->ctrl_reg.pwr_sta_offs = scp_ctrl_reg->pwr_sta_offs;
+   scp->ctrl_reg.pwr_sta2nd_offs = scp_ctrl_reg->pwr_sta2nd_offs;
+
scp->dev = &pdev->dev;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -556,8 +569,13 @@ static void mtk_register_power_domains(struct 
platform_device *pdev,
 static int __init scpsys_probe_mt2701(struct platform_device *pdev)
 {
struct scp *scp;
+   struct scp_ctrl_reg scp_reg;

-   scp = init_scp(pdev, scp_domain_data_mt2701, NUM_DOMAINS_MT2701);
+   scp_reg.pwr_sta_offs = SPM_PWR_STATUS;
+   scp_reg.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND;
+
+   scp = init_scp(pdev, scp_domain_data_mt2701, NUM_DOMAINS_MT2701,
+  &scp_reg);
if (IS_ERR(scp))
return PTR_ERR(scp);

@@ -667,8 +685,13 @@ static int __init scpsys_probe_mt8173(struct 
platform_device *pdev)
struct scp *scp;
struct genpd_onecell_data *pd_data;
int ret;
+   struct scp_ctrl_reg scp_reg;
+
+   scp_reg.pwr_sta_offs = SPM_PWR_STATUS;
+   scp_reg.pwr_sta2nd_offs = SPM_PWR_STATUS_2ND;

-   scp = init_scp(pdev, scp_domain_data_mt8173, NUM_DOMAINS_MT8173);
+   scp = init_scp(pdev, scp_domain_data_mt8173, NUM_DOMAINS_MT8173,
+  &scp_reg);
if (IS_ERR(scp))
return PTR_ERR(scp);




[PATCH] clk: qcom: Do not drop device node twice

2017-02-11 Thread Guenter Roeck
of_find_node_by_name() drops the reference to a passed device node.
It is not necessary to drop it again, and doing so may result in the
device node being released prematurely.

Cc: Rob Herring 
Signed-off-by: Guenter Roeck 
---
 drivers/clk/qcom/common.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/qcom/common.c b/drivers/clk/qcom/common.c
index cfab7b400381..03f9d316f969 100644
--- a/drivers/clk/qcom/common.c
+++ b/drivers/clk/qcom/common.c
@@ -145,7 +145,6 @@ static int _qcom_cc_register_board_clk(struct device *dev, 
const char *path,
clocks_node = of_find_node_by_path("/clocks");
if (clocks_node)
node = of_find_node_by_name(clocks_node, path);
-   of_node_put(clocks_node);
 
if (!node) {
fixed = devm_kzalloc(dev, sizeof(*fixed), GFP_KERNEL);
-- 
2.7.4



[PATCH] ARM: OMAP2+: Grab reference to device nodes where needed

2017-02-11 Thread Guenter Roeck
After commit 'of: fix of_node leak caused in of_find_node_opts_by_path',
the following error may be reported when running omap images.

OF: ERROR: Bad of_node_put() on /ocp@6800
CPU: 0 PID: 0 Comm: swapper Not tainted 4.10.0-rc7-next-20170210 #1
Hardware name: Generic OMAP3-GP (Flattened Device Tree)
[] (unwind_backtrace) from [] (show_stack+0x10/0x14)
[] (show_stack) from [] (dump_stack+0x98/0xac)
[] (dump_stack) from [] (kobject_release+0x48/0x7c)
[] (kobject_release)
from [] (of_find_node_by_name+0x74/0x94)
[] (of_find_node_by_name)
from [] (omap3xxx_hwmod_is_hs_ip_block_usable+0x24/0x2c)
[] (omap3xxx_hwmod_is_hs_ip_block_usable) from
[] (omap3xxx_hwmod_init+0x180/0x274)
[] (omap3xxx_hwmod_init)
from [] (omap3_init_early+0xa0/0x11c)
[] (omap3_init_early)
from [] (omap3430_init_early+0x8/0x30)
[] (omap3430_init_early)
from [] (setup_arch+0xc04/0xc34)
[] (setup_arch) from [] (start_kernel+0x68/0x38c)
[] (start_kernel) from [<8020807c>] (0x8020807c)

of_find_node_by_name() drops the reference to the passed device node,
so it is necessary to grab an extra one if it is still needed after the
call.

Cc: Qi Hou 
Cc: Peter Rosin 
Cc: Rob Herring 
Signed-off-by: Guenter Roeck 
---
 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 56f917ec8621..d4ca1e3964c3 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3117,6 +3117,7 @@ static int __init 
omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,
if (!bus)
return (omap_type() == OMAP2_DEVICE_TYPE_GP) ? 1 : 0;
 
+   of_node_get(bus);
if (of_device_is_available(of_find_node_by_name(bus, dev_name)))
return 1;
 
@@ -3189,15 +3190,20 @@ int __init omap3xxx_hwmod_init(void)
 
if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
r = omap_hwmod_register_links(h_sham);
-   if (r < 0)
+   if (r < 0) {
+   of_node_put(bus);
return r;
+   }
}
 
if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
r = omap_hwmod_register_links(h_aes);
-   if (r < 0)
+   if (r < 0) {
+   of_node_put(bus);
return r;
+   }
}
+   of_node_put(bus);
 
/*
 * Register hwmod links specific to certain ES levels of a
-- 
2.7.4



[PATCH net-next v1] bpf: Rebuild bpf.o for any dependency update

2017-02-11 Thread Mickaël Salaün
This is needed to force a rebuild of bpf.o when one of its dependencies
(e.g. uapi/linux/bpf.h) is updated.

Add a phony target.

Signed-off-by: Mickaël Salaün 
Cc: Alexei Starovoitov 
Cc: Daniel Borkmann 
Cc: David S. Miller 
Cc: Wang Nan 
---
 tools/testing/selftests/bpf/Makefile | 15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/bpf/Makefile 
b/tools/testing/selftests/bpf/Makefile
index a35f564f66a1..c7816fe60feb 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -1,13 +1,24 @@
-CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I../../../lib
+LIBDIR := ../../../lib
+BPFOBJ := $(LIBDIR)/bpf/bpf.o
+
+CFLAGS += -Wall -O2 -lcap -I../../../include/uapi -I$(LIBDIR)
 
 test_objs = test_verifier test_tag test_maps test_lru_map test_lpm_map
 
 TEST_PROGS := $(test_objs) test_kmod.sh
 TEST_FILES := $(test_objs)
 
+.PHONY: all clean force
+
 all: $(test_objs)
 
-$(test_objs): ../../../lib/bpf/bpf.o
+# force a rebuild of BPFOBJ when its dependencies are updated
+force:
+
+$(BPFOBJ): force
+   $(MAKE) -C $(dir $(BPFOBJ))
+
+$(test_objs): $(BPFOBJ)
 
 include ../lib.mk
 
-- 
2.11.0



Re: [PATCH] MIPS: sync-r4k: Fix KERN_CONT fallout

2017-02-11 Thread James Hogan
On Thu, Feb 02, 2017 at 01:22:04PM +, Matt Redfearn wrote:
> Since commit 4bcc595ccd80 ("printk: reinstate KERN_CONT for printing
> continuation lines") the output of counter synchornisation has been
> split across lines:
> [ 0.665181] Synchronize counters for CPU 1:
> [ 0.678578] done.
> 
> Fix this by using pr_cont, and replace printk with pr_info.
> 
> Signed-off-by: Matt Redfearn 

Applied

Thanks
James

> ---
> 
>  arch/mips/kernel/sync-r4k.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/mips/kernel/sync-r4k.c b/arch/mips/kernel/sync-r4k.c
> index 4472a7f98577..1df1160b6a47 100644
> --- a/arch/mips/kernel/sync-r4k.c
> +++ b/arch/mips/kernel/sync-r4k.c
> @@ -29,7 +29,7 @@ void synchronise_count_master(int cpu)
>   int i;
>   unsigned long flags;
>  
> - printk(KERN_INFO "Synchronize counters for CPU %u: ", cpu);
> + pr_info("Synchronize counters for CPU %u: ", cpu);
>  
>   local_irq_save(flags);
>  
> @@ -83,7 +83,7 @@ void synchronise_count_master(int cpu)
>* count registers were almost certainly out of sync
>* so no point in alarming people
>*/
> - printk("done.\n");
> + pr_cont("done.\n");
>  }
>  
>  void synchronise_count_slave(int cpu)
> -- 
> 2.7.4
> 
> 


signature.asc
Description: Digital signature


Re: [PATCHv2] v4l: split lane parsing code

2017-02-11 Thread Sakari Ailus
Hi Pavel,

On Thu, Jan 12, 2017 at 11:24:06AM +0100, Pavel Machek wrote:
> 
> From: Sakari Ailus 
> 
> The function to parse CSI2 bus parameters was called
> v4l2_of_parse_csi_bus(), rename it as v4l2_of_parse_csi2_bus() in
> anticipation of CSI1/CCP2 support.
> 
> Obtain data bus type from bus-type property. Only try parsing bus
> specific properties in this case.
> 
> Separate lane parsing from CSI-2 bus parameter parsing. The CSI-1 will
> need these as well, separate them into a different
> function. have_clk_lane and num_data_lanes arguments may be NULL; the
> CSI-1 bus will have no use for them.
> 
> Signed-off-by: Sakari Ailus 
> Signed-off-by: Ivaylo Dimitrov 
> Signed-off-by: Pavel Machek 

The patch looks good to me. Could you post a patchset containing all the
needed patches, maybe on top of the DT patches in the ccp2 branch, please?
It'd be easier to handle this that way.

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk


Re: [PATCH] smiapp: add CCP2 support

2017-02-11 Thread Sakari
Thanks, Pavel! :-)

Besides this patch, what else is needed? The CSI-2 / CCP2 support is
missing in V4L2 OF at least. It'd be better to have this all in the same
set.

I pushed the two DT patches here:

https://git.linuxtv.org/sailus/media_tree.git/commit/?h=ccp2>

On Wed, Feb 08, 2017 at 02:11:27PM +0100, Pavel Machek wrote:
> 
> Add support for CCP2 connected SMIA sensors as found
> on the Nokia N900.
> 
> Signed-off-by: Sebastian Reichel 
> Signed-off-by: Ivaylo Dimitrov 
> Signed-off-by: Pavel Machek 
> 
> diff --git a/drivers/media/i2c/smiapp/smiapp-core.c 
> b/drivers/media/i2c/smiapp/smiapp-core.c
> index 44f8c7e..c217bc6 100644
> --- a/drivers/media/i2c/smiapp/smiapp-core.c
> +++ b/drivers/media/i2c/smiapp/smiapp-core.c
> @@ -2997,13 +2997,19 @@ static struct smiapp_hwconfig 
> *smiapp_get_hwconfig(struct device *dev)
>   switch (bus_cfg->bus_type) {
>   case V4L2_MBUS_CSI2:
>   hwcfg->csi_signalling_mode = SMIAPP_CSI_SIGNALLING_MODE_CSI2;
> + hwcfg->lanes = bus_cfg->bus.mipi_csi2.num_data_lanes;
> + break;
> + case V4L2_MBUS_CCP2:
> + hwcfg->csi_signalling_mode = (bus_cfg->bus.mipi_csi1.strobe) ?
> + SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_STROBE :
> + SMIAPP_CSI_SIGNALLING_MODE_CCP2_DATA_CLOCK;
> + hwcfg->lanes = 1;
>   break;
> - /* FIXME: add CCP2 support. */
>   default:
> + dev_err(dev, "unknown bus protocol\n");

It's rather unsupported --- V4L2 OF framework picks one from enum
v4l2_mbus_type. You might want to print the value, too. Up to you.

>   goto out_err;
>   }
>  
> - hwcfg->lanes = bus_cfg->bus.mipi_csi2.num_data_lanes;
>   dev_dbg(dev, "lanes %u\n", hwcfg->lanes);
>  
>   /* NVM size is not mandatory */
> @@ -3017,8 +3023,8 @@ static struct smiapp_hwconfig 
> *smiapp_get_hwconfig(struct device *dev)
>   goto out_err;
>   }
>  
> - dev_dbg(dev, "nvm %d, clk %d, csi %d\n", hwcfg->nvm_size,
> - hwcfg->ext_clk, hwcfg->csi_signalling_mode);
> + dev_dbg(dev, "nvm %d, clk %d, mode %d\n",
> + hwcfg->nvm_size, hwcfg->ext_clk, hwcfg->csi_signalling_mode);
>  
>   if (!bus_cfg->nr_of_link_frequencies) {
>   dev_warn(dev, "no link frequencies defined\n");
> 


-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk


Re: [PATCH v4 3/3] MIPS: ath79: Fix the USB PHY reset names

2017-02-11 Thread James Hogan
Hi Alban,

On Sun, Feb 05, 2017 at 08:52:32PM +0100, Alban wrote:
> From: Alban Bedel 
> 
> The binding for the USB PHY went thru before the driver. However the
> new version of the driver now use the PHY core support for reset, and
> this expect the reset to be named "phy". So remove the "usb-" prefix
> from the the reset names.
> 
> Signed-off-by: Alban Bedel 
> ---
>  Documentation/devicetree/bindings/phy/phy-ath79-usb.txt | 4 ++--
>  arch/mips/boot/dts/qca/ar9132.dtsi  | 2 +-



> diff --git a/arch/mips/boot/dts/qca/ar9132.dtsi 
> b/arch/mips/boot/dts/qca/ar9132.dtsi
> index 302f0a8..808c2bb 100644
> --- a/arch/mips/boot/dts/qca/ar9132.dtsi
> +++ b/arch/mips/boot/dts/qca/ar9132.dtsi
> @@ -160,7 +160,7 @@
>   usb_phy: usb-phy {
>   compatible = "qca,ar7100-usb-phy";
>  
> - reset-names = "usb-phy", "usb-suspend-override";
> + reset-names = "phy", "suspend-override";

Does arch/mips/boot/dts/qca/ar9331.dtsi need updating too?

Cheers
James


signature.asc
Description: Digital signature


Re: [PATCH] MIPS: IRQ Stack: Fix erroneous jal to plat_irq_dispatch

2017-02-11 Thread James Hogan
On Wed, Jan 25, 2017 at 05:00:25PM +, Matt Redfearn wrote:
> Commit dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts")
> changed both the normal and vectored interrupt handlers. Unfortunately
> the vectored version, "except_vec_vi_handler", was incorrectly modified
> to unconditionally jal to plat_irq_dispatch, rather than doing a jalr to
> the vectored handler that has been set up. This is ok for many platforms
> which set the vectored handler to plat_irq_dispatch anyway, but will
> cause problems with platforms that use other handlers.
> 
> Fixes: dda45f701c9d ("MIPS: Switch to the irq_stack in interrupts")
> Signed-off-by: Matt Redfearn 

Applied

Thanks
James

> ---
> 
> Ralf, if possible please could you squash this?
> 
> ---
>  arch/mips/kernel/genex.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S
> index 0a7ba4b2f687..7ec9612cb007 100644
> --- a/arch/mips/kernel/genex.S
> +++ b/arch/mips/kernel/genex.S
> @@ -329,7 +329,7 @@ NESTED(except_vec_vi_handler, 0, sp)
>   PTR_ADD sp, t0, t1
>  
>  2:
> - jal plat_irq_dispatch
> + jalrv0
>  
>   /* Restore sp */
>   movesp, s1
> -- 
> 2.7.4
> 


signature.asc
Description: Digital signature


Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )

2017-02-11 Thread Borislav Petkov
On Sat, Feb 11, 2017 at 09:58:26PM +0100, Gabriel C wrote:
> Yes , it will hang before tsc message ..
> Also sometimes I have same trace sometimes it just hangs forever.

It doesn't sound like dis_ucode_ldr changes anything. Or maybe it does,
maybe the microcode applies some fix for some erratum or whatnot.

Right, so please disable that splash screen and do a boot video again
without the dis_ucode_ldr option.

Thanks.

-- 
Regards/Gruss,
Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.


Re: [PATCH] MIPS: Fix distclean with Makefile.postlink

2017-02-11 Thread James Hogan
On Mon, Jan 30, 2017 at 09:58:34AM +, Matt Redfearn wrote:
> The postlink Makefile must include include/config/auto.conf to get the
> kernel configuration variables. But in a clean kernel directory this
> file does not exist, causing make to bail with the error:
> 
> arch/mips/Makefile.postlink:10:
> include/config/auto.conf: No such file or directory
> make[1]: *** No rule to make target
> 'include/config/auto.conf'.  Stop.
> Makefile:1290: recipe for target 'vmlinuxclean' failed
> 
> Fix this by using "-include" to not cause a Make error when the file
> does not exist.
> 
> Fixes: 44079d3509ae ("MIPS: Use Makefile.postlink to insert relocations into 
> vmlinux")
> Signed-off-by: Matt Redfearn 

Applied

Thanks
James

> ---
> 
>  arch/mips/Makefile.postlink | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/mips/Makefile.postlink b/arch/mips/Makefile.postlink
> index b0ddf0701a31..4b7f5a648c79 100644
> --- a/arch/mips/Makefile.postlink
> +++ b/arch/mips/Makefile.postlink
> @@ -7,7 +7,7 @@
>  PHONY := __archpost
>  __archpost:
>  
> -include include/config/auto.conf
> +-include include/config/auto.conf
>  include scripts/Kbuild.include
>  
>  CMD_RELOCS = arch/mips/boot/tools/relocs
> -- 
> 2.7.4
> 
> 


signature.asc
Description: Digital signature


[PATCH 12/15] staging: rtl8192u: Fix warnings relating to printk()

2017-02-11 Thread simran singhal
This fixes the following checkpatch.pl warnings:
WARNING: printk() should include KERN_ facility level

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index f02eb8e..51503ee 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -143,7 +143,7 @@ static struct sk_buff *ieee80211_ADDBA(struct 
ieee80211_device *ieee, u8 *Dst, P
 
if (ACT_ADDBARSP == type) {
// Status Code
-   printk("=>to send ADDBARSP\n");
+   printk(KERN_INFO "=>to send ADDBARSP\n");
 
put_unaligned_le16(StatusCode, tag);
tag += 2;
@@ -345,7 +345,7 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, 
struct sk_buff *skb)
pBaTimeoutVal = (u16 *)(tag + 5);
pBaStartSeqCtrl = (PSEQUENCE_CONTROL)(req + 7);
 
-   printk(">rx ADDBAREQ from :%pM\n", dst);
+   printk(KERN_INFO ">rx ADDBAREQ from :%pM\n", dst);
 //some other capability is not ready now.
if ((ieee->current_network.qos_data.active == 0) ||
(!ieee->pHTInfo->bCurrentHTSupport)) //||
-- 
2.7.4



Re: Linux 4.9.6 ( Restore IO-APIC irq_chip retrigger callback , breaks my box )

2017-02-11 Thread Gabriel C



On 11.02.2017 15:21, Borislav Petkov wrote:

On Sat, Feb 11, 2017 at 02:09:14PM +0100, Gabriel C wrote:

Adding ' dis_ucode_ldr ' to commandline makes the kernel hangs right after :


Wait a minute, are you saying that without dis_ucode_ldr you can't even
boot so far?


Yes , it will hang before tsc message ..
Also sometimes I have same trace sometimes it just hangs forever.





clocksource: tsc: mask: 0x max_cycles: 0x20ac7f6ecc6, 
max_idle_ns: 440795315461 ns
...

and I have the bug triggered really quick..

Also I cannot get netconsole to work , I'm sure is some problem here local and 
I don't have
any serial cable around right now. The only way I saw now to give you at least 
some ifo is to
make an video of that crash. You can find it there :

http://ftp.frugalware.org/pub/other/people/crazy/kernel/t/crash.mp4


Watchdog fires on all cores showing they're all idle. For some reason,
not all cores get to dump the watchdog splat, though. Some seem really
stuck.

And you have TAINT_FIRMWARE_WORKAROUND due to
intel_prepare_irq_remapping() noticing intr remapping is broken on that
box.


Well yes and I'm not so sure is really broken.. I reverted the patch 
blacklisted my box right after it was addeded
the time and I don't have any issues .. however since I don't have a use of 
that feature I don't really care is marked broken or not..



Would be better if you could disable that frugalware splash screen and
switch to grub console mode so that we can see the very beginning of the
boot.


I do that tomorrow ...



Btw, your BIOS is from 2013. Is there new one, per chance, on your
vendor's site? Might wanna consider updating it...




This BIOS was / is newest one :(



[PATCH 11/15] staging: rtl8192u: Fix RETURN_VOID warnings

2017-02-11 Thread simran singhal
Fix 'void function return statements are not generally useful'
checkpatch.pl warnings.

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index c09f3ad..f02eb8e 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -258,7 +258,6 @@ static void ieee80211_send_ADDBAReq(struct ieee80211_device 
*ieee,
else {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function 
%s()\n", __func__);
}
-   return;
 }
 
 
/
@@ -308,7 +307,6 @@ static void ieee80211_send_DELBA(struct ieee80211_device 
*ieee, u8 *dst,
else {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function 
%s()\n", __func__);
}
-   return ;
 }
 
 
/
@@ -708,5 +706,4 @@ void RxBaInactTimeout(unsigned long data)
&pRxTs->RxAdmittedBARecord,
RX_DIR,
DELBA_REASON_TIMEOUT);
-   return ;
 }
-- 
2.7.4



[PATCH 10/15] staging: rtl8192u: Fix brace placement

2017-02-11 Thread simran singhal
Fix brace placement errors caught by checkpatch.pl ERROR: that open
brace { should be on the previous line

Signed-off-by: simran singhal 
---
 .../staging/rtl8192u/ieee80211/rtl819x_BAProc.c| 90 --
 1 file changed, 30 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index 91ea77d..c09f3ad 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -46,15 +46,13 @@ static u8 TxTsDeleteBA(struct ieee80211_device *ieee, 
PTX_TS_RECORD pTxTs)
u8  bSendDELBA = false;
 
// Delete pending BA
-   if (pPendingBa->bValid)
-   {
+   if (pPendingBa->bValid) {
DeActivateBAEntry(ieee, pPendingBa);
bSendDELBA = true;
}
 
// Delete admitted BA
-   if (pAdmittedBa->bValid)
-   {
+   if (pAdmittedBa->bValid) {
DeActivateBAEntry(ieee, pAdmittedBa);
bSendDELBA = true;
}
@@ -74,8 +72,7 @@ static u8 RxTsDeleteBA(struct ieee80211_device *ieee, 
PRX_TS_RECORD pRxTs)
PBA_RECORD  pBa = &pRxTs->RxAdmittedBARecord;
u8  bSendDELBA = false;
 
-   if (pBa->bValid)
-   {
+   if (pBa->bValid) {
DeActivateBAEntry(ieee, pBa);
bSendDELBA = true;
}
@@ -115,14 +112,12 @@ static struct sk_buff *ieee80211_ADDBA(struct 
ieee80211_device *ieee, u8 *Dst, P
u16 len = ieee->tx_headroom + 9;
//category(1) + action field(1) + Dialog Token(1) + BA Parameter Set(2) 
+  BA Timeout Value(2) +  BA Start SeqCtrl(2)(or StatusCode(2))
IEEE80211_DEBUG(IEEE80211_DL_TRACE | IEEE80211_DL_BA, ">%s(), 
frame(%d) sentd to:%pM, ieee->dev:%p\n", __func__, type, Dst, ieee->dev);
-   if (pBA == NULL)
-   {
+   if (pBA == NULL) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "pBA is NULL\n");
return NULL;
}
skb = dev_alloc_skb(len + sizeof( struct rtl_80211_hdr_3addr)); //need 
to add something others? FIXME
-   if (skb == NULL)
-   {
+   if (skb == NULL) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for 
ADDBA_REQ\n");
return NULL;
}
@@ -146,8 +141,7 @@ static struct sk_buff *ieee80211_ADDBA(struct 
ieee80211_device *ieee, u8 *Dst, P
// Dialog Token
*tag ++= pBA->DialogToken;
 
-   if (ACT_ADDBARSP == type)
-   {
+   if (ACT_ADDBARSP == type) {
// Status Code
printk("=>to send ADDBARSP\n");
 
@@ -163,8 +157,7 @@ static struct sk_buff *ieee80211_ADDBA(struct 
ieee80211_device *ieee, u8 *Dst, P
put_unaligned_le16(pBA->BaTimeoutValue, tag);
tag += 2;
 
-   if (ACT_ADDBAREQ == type)
-   {
+   if (ACT_ADDBAREQ == type) {
// BA Start SeqCtrl
memcpy(tag, (u8 *)&(pBA->BaStartSeqCtrl), 2);
tag += 2;
@@ -209,8 +202,7 @@ static struct sk_buff *ieee80211_DELBA(
DelbaParamSet.field.TID = pBA->BaParamSet.field.TID;
 
skb = dev_alloc_skb(len + sizeof( struct rtl_80211_hdr_3addr)); //need 
to add something others? FIXME
-   if (skb == NULL)
-   {
+   if (skb == NULL) {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "can't alloc skb for 
ADDBA_REQ\n");
return NULL;
}
@@ -257,15 +249,13 @@ static void ieee80211_send_ADDBAReq(struct 
ieee80211_device *ieee,
struct sk_buff *skb;
skb = ieee80211_ADDBA(ieee, dst, pBA, 0, ACT_ADDBAREQ); //construct 
ACT_ADDBAREQ frames so set statuscode zero.
 
-   if (skb)
-   {
+   if (skb) {
softmac_mgmt_xmit(skb, ieee);
//add statistic needed here.
//and skb will be freed in softmac_mgmt_xmit(), so omit all 
dev_kfree_skb_any() outside softmac_mgmt_xmit()
//WB
}
-   else
-   {
+   else {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function 
%s()\n", __func__);
}
return;
@@ -284,13 +274,11 @@ static void ieee80211_send_ADDBARsp(struct 
ieee80211_device *ieee, u8 *dst,
 {
struct sk_buff *skb;
skb = ieee80211_ADDBA(ieee, dst, pBA, StatusCode, ACT_ADDBARSP); 
//construct ACT_ADDBARSP frames
-   if (skb)
-   {
+   if (skb) {
softmac_mgmt_xmit(skb, ieee);
//same above
}
-   else
-   {
+   else {
IEEE80211_DEBUG(IEEE80211_DL_ERR, "alloc skb error in function 
%s()\n", __func__);
}
 
@@ -313,13 +301,11 @@ static void ieee80211_send_DELBA(struct ieee80211_device 
*ieee, u8 *dst,
 {
struct sk_buff *skb;
skb = ieee80211_DELBA(ieee, dst, pBA, TxRxSelect, ReasonCode); 
//construct ACT_ADDBARSP frames
-   if (skb)
-   {
+   if (skb) {
 

[PATCH 09/15] staging: rtl8192u: Removing true and false comparison

2017-02-11 Thread simran singhal
Remove comparison to true and false in if statement.
Problem found usingcheckpatch.pl.
CHECK: Using comparison to true is error prone
CHECK: Using comparison to false is error prone

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c 
b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
index 98fbb6e..91ea77d 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c
@@ -496,7 +496,7 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, 
struct sk_buff *skb)
// Check if related BA is waiting for setup.
// If not, reject by sending DELBA frame.
//
-   if((pAdmittedBA->bValid==true))
+   if (pAdmittedBA->bValid)
{
// Since BA is already setup, we ignore all other ADDBA 
Response.
IEEE80211_DEBUG(IEEE80211_DL_BA, "OnADDBARsp(): Recv ADDBA Rsp. 
Drop because already admit it! \n");
@@ -650,7 +650,7 @@ TsInitAddBA(
 {
PBA_RECORD  pBA = &pTS->TxPendingBARecord;
 
-   if(pBA->bValid==true && bOverwritePending==false)
+   if (pBA->bValid && !bOverwritePending)
return;
 
// Set parameters to "Pending" variable set
-- 
2.7.4



[PATCH 08/15] staging: rtl8192u: Remove unnecessary space after a cast

2017-02-11 Thread simran singhal
This patch fixes the checkpatch issue:
CHECK: No space is necessary after a cast

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
index 403f0ec..a38a064 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
@@ -135,7 +135,7 @@ int ieee80211_unregister_crypto_ops(struct 
ieee80211_crypto_ops *ops)
spin_lock_irqsave(&hcrypt->lock, flags);
for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) {
struct ieee80211_crypto_alg *alg =
-   (struct ieee80211_crypto_alg *) ptr;
+   (struct ieee80211_crypto_alg *)ptr;
if (alg->ops == ops) {
list_del(&alg->list);
del_alg = alg;
@@ -166,7 +166,7 @@ struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const 
char *name)
spin_lock_irqsave(&hcrypt->lock, flags);
for (ptr = hcrypt->algs.next; ptr != &hcrypt->algs; ptr = ptr->next) {
struct ieee80211_crypto_alg *alg =
-   (struct ieee80211_crypto_alg *) ptr;
+   (struct ieee80211_crypto_alg *)ptr;
if (strcmp(alg->ops->name, name) == 0) {
found_alg = alg;
break;
@@ -228,7 +228,7 @@ void __exit ieee80211_crypto_deinit(void)
for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
 ptr = n, n = ptr->next) {
struct ieee80211_crypto_alg *alg =
-   (struct ieee80211_crypto_alg *) ptr;
+   (struct ieee80211_crypto_alg *)ptr;
list_del(ptr);
pr_debug("ieee80211_crypt: unregistered algorithm '%s' 
(deinit)\n",
alg->ops->name);
-- 
2.7.4



[PATCH 07/15] staging: rtl8192u: Replace explicit NULL comparisons with !

2017-02-11 Thread simran singhal
This patch replace explicit NULL comparison with ! or unmark operator to
simplify code.
Reported by checkpatch.pl for comparison to NULL could be
written "!XXX" or "XXX".

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
index 9cf90d0..403f0ec 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt.c
@@ -80,7 +80,7 @@ void ieee80211_crypt_delayed_deinit(struct ieee80211_device 
*ieee,
struct ieee80211_crypt_data *tmp;
unsigned long flags;
 
-   if (*crypt == NULL)
+   if (!(*crypt))
return;
 
tmp = *crypt;
@@ -104,11 +104,11 @@ int ieee80211_register_crypto_ops(struct 
ieee80211_crypto_ops *ops)
unsigned long flags;
struct ieee80211_crypto_alg *alg;
 
-   if (hcrypt == NULL)
+   if (!hcrypt)
return -1;
 
alg = kzalloc(sizeof(*alg), GFP_KERNEL);
-   if (alg == NULL)
+   if (!alg)
return -ENOMEM;
 
alg->ops = ops;
@@ -129,7 +129,7 @@ int ieee80211_unregister_crypto_ops(struct 
ieee80211_crypto_ops *ops)
struct list_head *ptr;
struct ieee80211_crypto_alg *del_alg = NULL;
 
-   if (hcrypt == NULL)
+   if (!hcrypt)
return -1;
 
spin_lock_irqsave(&hcrypt->lock, flags);
@@ -160,7 +160,7 @@ struct ieee80211_crypto_ops *ieee80211_get_crypto_ops(const 
char *name)
struct list_head *ptr;
struct ieee80211_crypto_alg *found_alg = NULL;
 
-   if (hcrypt == NULL)
+   if (!hcrypt)
return NULL;
 
spin_lock_irqsave(&hcrypt->lock, flags);
@@ -222,7 +222,7 @@ void __exit ieee80211_crypto_deinit(void)
 {
struct list_head *ptr, *n;
 
-   if (hcrypt == NULL)
+   if (!hcrypt)
return;
 
for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs;
-- 
2.7.4



[PATCH 06/15] staging: rtl8192u: Remove useless function

2017-02-11 Thread simran singhal
This patch remove useless function ieee80211_ccmp_null.

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 1 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 6 --
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 1 -
 3 files changed, 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 077ea13..e71af2f 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -2255,7 +2255,6 @@ void softmac_mgmt_xmit(struct sk_buff *skb, struct 
ieee80211_device *ieee);
 
 /* ieee80211_crypt_ccmp&tkip&wep.c */
 void ieee80211_tkip_null(void);
-void ieee80211_ccmp_null(void);
 
 int ieee80211_crypto_init(void);
 void ieee80211_crypto_deinit(void);
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index b9377f3..cb226ed 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -426,12 +426,6 @@ static char *ieee80211_ccmp_print_stats(char *p, void 
*priv)
return p;
 }
 
-void ieee80211_ccmp_null(void)
-{
-   /* printk(">%s()\n", __func__); */
-   return;
-}
-
 static struct ieee80211_crypto_ops ieee80211_crypt_ccmp = {
.name   = "CCMP",
.init   = ieee80211_ccmp_init,
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index 30fff6c..0b162bf 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -177,7 +177,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
 
 /* These function were added to load crypte module autoly */
ieee80211_tkip_null();
-   ieee80211_ccmp_null();
 
return dev;
 
-- 
2.7.4



[PATCH 05/15] staging: rtl8192u: Fix braces {} style

2017-02-11 Thread simran singhal
This fixes all checkpatch form of this from the Lustre tree: CHECK:
braces {} should be used on all arms of this statement

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index eaeb9dc..b9377f3 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -380,10 +380,11 @@ static int ieee80211_ccmp_set_key(void *key, int len, u8 
*seq, void *priv)
data->rx_pn[5] = seq[0];
}
crypto_cipher_setkey((void *)data->tfm, data->key, CCMP_TK_LEN);
-   } else if (len == 0)
+   } else if (len == 0) {
data->key_set = 0;
-   else
+   } else {
return -1;
+   }
 
return 0;
 }
-- 
2.7.4



Re: [RFC PATCH] perf/stat: Add --disable-hwdt

2017-02-11 Thread Ingo Molnar

* Borislav Petkov  wrote:

> On Sat, Feb 11, 2017 at 06:59:10PM +0100, Ingo Molnar wrote:
> > So I checked the perf-list manpage and it didn't tell me much about how to 
> > disable 
> > the NMI watchdog.
> 
> Oh, it is buried there:
> 
> "
> EVENT GROUPS
> 
> 
> ...
> 
> 
> Globally pinned events can limit the number of counters available for
> other groups. On x86 systems, the NMI watchdog pins a counter by default.
> The nmi watchdog can be disabled as root with
> 
>   echo 0 > /proc/sys/kernel/nmi_watchdog"
> 
> > How about a more proactive hint, something like:
> > 
> > To disable the NMI watchdog permanently, do:
> 
> Why permanently? We want it to run and be disabled around the
> measurement only. Anyway, here's something more to the point:

> + if (print_free_counters_hint)
> + fprintf(output,
> +"Some events weren't counted. Try disabling the NMI watchdog:\n"
> +"echo 0 > /proc/sys/kernel/nmi_watchdog\n"
> +"perf stat ...\n"
> +"echo 1 > /proc/sys/kernel/nmi_watchdog\n");
>  }

Ok, looks good to me!

Acked-by: Ingo Molnar 

Thanks,

Ingo


[PATCH 04/15] staging: rtl8192u: Clean up comparison to NULL

2017-02-11 Thread simran singhal
Checkpatch recommended changes.

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 21abb2d..eaeb9dc 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -67,7 +67,7 @@ static void *ieee80211_ccmp_init(int key_idx)
struct ieee80211_ccmp_data *priv;
 
priv = kzalloc(sizeof(*priv), GFP_ATOMIC);
-   if (priv == NULL)
+   if (!priv)
goto fail;
priv->key_idx = key_idx;
 
-- 
2.7.4



[PATCH 03/15] staging: rtl8192u: Fixing multiple assignments

2017-02-11 Thread simran singhal
This patch modifies the assignments into single assignments.

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index c4abfd1..21abb2d 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -181,7 +181,8 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
xor_block(auth, &aad[AES_BLOCK_LEN], AES_BLOCK_LEN);
ieee80211_ccmp_aes_encrypt(tfm, auth, auth);
b0[0] &= 0x07;
-   b0[14] = b0[15] = 0;
+   b0[14] = 0;
+   b0[15] = 0;
ieee80211_ccmp_aes_encrypt(tfm, b0, s0);
 }
 
-- 
2.7.4



Re: [PATCH] clocksource: add __ro_after_init to cyclecounter

2017-02-11 Thread Thomas Gleixner
On Sat, 11 Feb 2017, Ard Biesheuvel wrote:

> On 11 February 2017 at 19:20, Bhumika Goyal  wrote:
> > The object cyclecounter of type cyclecounter is not getting modified
> > after getting initialized by arch_counter_register. Apart from
> > initialization in arch_counter_register it is also passed as an argument
> > to the function timecounter_init but this argument is of type const.
> > Therefore, add __ro_after_init to its declaration.
> >
> 
> I think adding __ro_after_init is fine if this struct is never
> modified after init. But the reference in the commit log to the
> constness of the timecounter_init() argument  makes no sense: that
> only means timecounter_init() will not modify the object, which allows
> pointers to const objects to be passed to it as well. The opposite is
> not true, though: there is no requirement whatsoever that objects
> passed into const pointer arguments should be const themselves.

Indeed.


Re: [PATCH] clocksource: add __ro_after_init to cyclecounter

2017-02-11 Thread Thomas Gleixner
On Sun, 12 Feb 2017, Bhumika Goyal wrote:

Please be more careful with your subject line. The prefix for this is
definitely not 'clocksource'. git log would have told you the proper one:

clocksource/drivers/arm_arch_timer

'clocksource' is the general subsystem and used for system wide changes or
core changes, but not for a particular driver.

> The object cyclecounter of type cyclecounter is not getting modified
> after getting initialized by arch_counter_register. Apart from
> initialization in arch_counter_register it is also passed as an argument
> to the function timecounter_init but this argument is of type const.
> Therefore, add __ro_after_init to its declaration.

Other than that this is fine. I'll fix it up when applying.

Thanks,

tglx


[PATCH] kernfs: fix locking around kernfs_ops->release() callback

2017-02-11 Thread Tejun Heo
The release callback may be called from two places - file release
operation and kernfs open file draining.  kernfs_open_file->mutex is
used to synchronize the two callsites.  This unfortunately leads to
possible circular locking because of->mutex is used to protect the
usual kernfs operations which may use locking constructs which are
held while removing and thus draining kernfs files.

@of->mutex is for synchronizing concurrent kernfs access operations
and all we need here is synchronization between the releaes and drain
paths.  As the drain path has to grab kernfs_open_file_mutex anyway,
let's use the mutex to synchronize the release operation instead.

Signed-off-by: Tejun Heo 
Reported-by: Tony Lindgren 
Fixes: 0e67db2f9fe9 ("kernfs: add kernfs_ops->open/release() callbacks")
---
Hello,

Tony, can you please verify that this resolves the lockdep warnings
that you've been seeing on linux-next?

Greg, this is a fix for the kernfs patches which are being routed
through the cgroup tree.  Once Tony confirms, I'll apply this patch on
top.

Thanks!

 fs/kernfs/file.c |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

--- a/fs/kernfs/file.c
+++ b/fs/kernfs/file.c
@@ -747,10 +747,15 @@ err_out:
 static void kernfs_release_file(struct kernfs_node *kn,
struct kernfs_open_file *of)
 {
-   if (!(kn->flags & KERNFS_HAS_RELEASE))
-   return;
+   /*
+* @of is guaranteed to have no other file operations in flight and
+* we just want to synchronize release and drain paths.
+* @kernfs_open_file_mutex is enough.  @of->mutex can't be used
+* here because drain path may be called from places which can
+* cause circular dependency.
+*/
+   lockdep_assert_held(&kernfs_open_file_mutex);
 
-   mutex_lock(&of->mutex);
if (!of->released) {
/*
 * A file is never detached without being released and we
@@ -760,7 +765,6 @@ static void kernfs_release_file(struct k
kn->attr.ops->release(of);
of->released = true;
}
-   mutex_unlock(&of->mutex);
 }
 
 static int kernfs_fop_release(struct inode *inode, struct file *filp)
@@ -768,7 +772,12 @@ static int kernfs_fop_release(struct ino
struct kernfs_node *kn = filp->f_path.dentry->d_fsdata;
struct kernfs_open_file *of = kernfs_of(filp);
 
-   kernfs_release_file(kn, of);
+   if (kn->flags & KERNFS_HAS_RELEASE) {
+   mutex_lock(&kernfs_open_file_mutex);
+   kernfs_release_file(kn, of);
+   mutex_unlock(&kernfs_open_file_mutex);
+   }
+
kernfs_put_open_node(kn, of);
seq_release(inode, filp);
kfree(of->prealloc_buf);


[PATCH 02/15] staging: rtl8192u: Removing unnecessary space after a cast

2017-02-11 Thread simran singhal
This patch fixes the checkpatch warning by removing unnecessary space
after a cast.
CHECK: No space is necessary after a cast

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 0ddd5ac..c4abfd1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -131,7 +131,7 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
if (a4_included)
aad_len += 6;
if (qc_included) {
-   pos = (u8 *) &hdr->addr4;
+   pos = (u8 *)&hdr->addr4;
if (a4_included)
pos += 6;
qc = *pos & 0x0f;
@@ -157,13 +157,13 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
 * A4 (if present)
 * QC (if present)
 */
-   pos = (u8 *) hdr;
+   pos = (u8 *)hdr;
aad[0] = 0; /* aad_len >> 8 */
aad[1] = aad_len & 0xff;
aad[2] = pos[0] & 0x8f;
aad[3] = pos[1] & 0xc7;
memcpy(aad + 4, hdr->addr1, 3 * ETH_ALEN);
-   pos = (u8 *) &hdr->seq_ctl;
+   pos = (u8 *)&hdr->seq_ctl;
aad[22] = pos[0] & 0x0f;
aad[23] = 0; /* all bits masked */
memset(aad + 24, 0, 8);
@@ -221,7 +221,7 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
*pos++ = key->tx_pn[1];
*pos++ = key->tx_pn[0];
 
-   hdr = (struct rtl_80211_hdr_4addr *) skb->data;
+   hdr = (struct rtl_80211_hdr_4addr *)skb->data;
if (!tcb_desc->bHwSec) {
int blocks, last, len;
u8 *mic;
@@ -270,7 +270,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
return -1;
}
 
-   hdr = (struct rtl_80211_hdr_4addr *) skb->data;
+   hdr = (struct rtl_80211_hdr_4addr *)skb->data;
pos = skb->data + hdr_len;
keyidx = pos[3];
if (!(keyidx & (1 << 5))) {
-- 
2.7.4



[tip:perf/core] perf/x86/intel: Add Kaby Lake support

2017-02-11 Thread tip-bot for Srinivas Pandruvada
Commit-ID:  f2029b1e47b607619d1dd2cb0bbb77f64ec6b7c2
Gitweb: http://git.kernel.org/tip/f2029b1e47b607619d1dd2cb0bbb77f64ec6b7c2
Author: Srinivas Pandruvada 
AuthorDate: Fri, 10 Feb 2017 11:38:37 -0800
Committer:  Thomas Gleixner 
CommitDate: Sat, 11 Feb 2017 21:28:23 +0100

perf/x86/intel: Add Kaby Lake support

Add Kaby Lake mobile and desktop models for RAPL, CSTATE and UNCORE
matching Skylake.

Signed-off-by: Srinivas Pandruvada 
Cc: pet...@infradead.org
Cc: kan.li...@intel.com
Cc: bige...@linutronix.de
Cc: dave.han...@linux.intel.com
Cc: piotr@intel.com
Cc: davi...@google.com
Cc: b...@suse.de
Link: 
http://lkml.kernel.org/r/1486755517-17812-1-git-send-email-srinivas.pandruv...@linux.intel.com
Signed-off-by: Thomas Gleixner 

---
 arch/x86/events/intel/cstate.c | 3 +++
 arch/x86/events/intel/rapl.c   | 3 +++
 arch/x86/events/intel/uncore.c | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/arch/x86/events/intel/cstate.c b/arch/x86/events/intel/cstate.c
index 1076c9a..aff4b5b 100644
--- a/arch/x86/events/intel/cstate.c
+++ b/arch/x86/events/intel/cstate.c
@@ -541,6 +541,9 @@ static const struct x86_cpu_id intel_cstates_match[] 
__initconst = {
X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_MOBILE,  snb_cstates),
X86_CSTATES_MODEL(INTEL_FAM6_SKYLAKE_DESKTOP, snb_cstates),
 
+   X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_MOBILE,  snb_cstates),
+   X86_CSTATES_MODEL(INTEL_FAM6_KABYLAKE_DESKTOP, snb_cstates),
+
X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNL, knl_cstates),
X86_CSTATES_MODEL(INTEL_FAM6_XEON_PHI_KNM, knl_cstates),
{ },
diff --git a/arch/x86/events/intel/rapl.c b/arch/x86/events/intel/rapl.c
index 22ef4f7..22054ca 100644
--- a/arch/x86/events/intel/rapl.c
+++ b/arch/x86/events/intel/rapl.c
@@ -771,6 +771,9 @@ static const struct x86_cpu_id rapl_cpu_match[] __initconst 
= {
X86_RAPL_MODEL_MATCH(INTEL_FAM6_SKYLAKE_DESKTOP, skl_rapl_init),
X86_RAPL_MODEL_MATCH(INTEL_FAM6_SKYLAKE_X,   hsx_rapl_init),
 
+   X86_RAPL_MODEL_MATCH(INTEL_FAM6_KABYLAKE_MOBILE,  skl_rapl_init),
+   X86_RAPL_MODEL_MATCH(INTEL_FAM6_KABYLAKE_DESKTOP, skl_rapl_init),
+
X86_RAPL_MODEL_MATCH(INTEL_FAM6_ATOM_GOLDMONT, hsw_rapl_init),
{},
 };
diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c
index 1ab4597..758c1aa 100644
--- a/arch/x86/events/intel/uncore.c
+++ b/arch/x86/events/intel/uncore.c
@@ -1328,6 +1328,8 @@ static const struct x86_cpu_id intel_uncore_match[] 
__initconst = {
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_DESKTOP,skl_uncore_init),
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_MOBILE, skl_uncore_init),
X86_UNCORE_MODEL_MATCH(INTEL_FAM6_SKYLAKE_X,  skx_uncore_init),
+   X86_UNCORE_MODEL_MATCH(INTEL_FAM6_KABYLAKE_MOBILE, skl_uncore_init),
+   X86_UNCORE_MODEL_MATCH(INTEL_FAM6_KABYLAKE_DESKTOP, skl_uncore_init),
{},
 };
 


Re: [PATCH] clocksource: add __ro_after_init to cyclecounter

2017-02-11 Thread Ard Biesheuvel
On 11 February 2017 at 19:20, Bhumika Goyal  wrote:
> The object cyclecounter of type cyclecounter is not getting modified
> after getting initialized by arch_counter_register. Apart from
> initialization in arch_counter_register it is also passed as an argument
> to the function timecounter_init but this argument is of type const.
> Therefore, add __ro_after_init to its declaration.
>

I think adding __ro_after_init is fine if this struct is never
modified after init. But the reference in the commit log to the
constness of the timecounter_init() argument  makes no sense: that
only means timecounter_init() will not modify the object, which allows
pointers to const objects to be passed to it as well. The opposite is
not true, though: there is no requirement whatsoever that objects
passed into const pointer arguments should be const themselves.


> Signed-off-by: Bhumika Goyal 
> ---
>  drivers/clocksource/arm_arch_timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/arm_arch_timer.c 
> b/drivers/clocksource/arm_arch_timer.c
> index 4c8c3fb..a10506b 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -580,7 +580,7 @@ static u64 arch_counter_read_cc(const struct cyclecounter 
> *cc)
> .flags  = CLOCK_SOURCE_IS_CONTINUOUS,
>  };
>
> -static struct cyclecounter cyclecounter = {
> +static struct cyclecounter cyclecounter __ro_after_init = {
> .read   = arch_counter_read_cc,
> .mask   = CLOCKSOURCE_MASK(56),
>  };
> --
> 1.9.1
>
>
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


[PATCH 01/15] staging: rtl8192u: Removing multiple blank lines

2017-02-11 Thread simran singhal
This patch fixes the checkpatch warning by removing multiple blank
lines.
CHECK: Please don't use multiple blank lines

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c | 12 
 1 file changed, 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
index 2dc25cc..0ddd5ac 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_ccmp.c
@@ -90,7 +90,6 @@ static void *ieee80211_ccmp_init(int key_idx)
return NULL;
 }
 
-
 static void ieee80211_ccmp_deinit(void *priv)
 {
struct ieee80211_ccmp_data *_priv = priv;
@@ -100,7 +99,6 @@ static void ieee80211_ccmp_deinit(void *priv)
kfree(priv);
 }
 
-
 static inline void xor_block(u8 *b, u8 *a, size_t len)
 {
int i;
@@ -109,8 +107,6 @@ static inline void xor_block(u8 *b, u8 *a, size_t len)
b[i] ^= a[i];
 }
 
-
-
 static void ccmp_init_blocks(struct crypto_tfm *tfm,
 struct rtl_80211_hdr_4addr *hdr,
 u8 *pn, size_t dlen, u8 *b0, u8 *auth,
@@ -189,8 +185,6 @@ static void ccmp_init_blocks(struct crypto_tfm *tfm,
ieee80211_ccmp_aes_encrypt(tfm, b0, s0);
 }
 
-
-
 static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 {
struct ieee80211_ccmp_data *key = priv;
@@ -227,7 +221,6 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
*pos++ = key->tx_pn[1];
*pos++ = key->tx_pn[0];
 
-
hdr = (struct rtl_80211_hdr_4addr *) skb->data;
if (!tcb_desc->bHwSec) {
int blocks, last, len;
@@ -264,7 +257,6 @@ static int ieee80211_ccmp_encrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
return 0;
 }
 
-
 static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 {
struct ieee80211_ccmp_data *key = priv;
@@ -327,7 +319,6 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
u8 *a = key->rx_a;
int i, blocks, last, len;
 
-
ccmp_init_blocks(key->tfm, hdr, pn, data_len, b0, a, b);
xor_block(mic, b, CCMP_MIC_LEN);
 
@@ -366,7 +357,6 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int 
hdr_len, void *priv)
return keyidx;
 }
 
-
 static int ieee80211_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
 {
struct ieee80211_ccmp_data *data = priv;
@@ -397,7 +387,6 @@ static int ieee80211_ccmp_set_key(void *key, int len, u8 
*seq, void *priv)
return 0;
 }
 
-
 static int ieee80211_ccmp_get_key(void *key, int len, u8 *seq, void *priv)
 {
struct ieee80211_ccmp_data *data = priv;
@@ -421,7 +410,6 @@ static int ieee80211_ccmp_get_key(void *key, int len, u8 
*seq, void *priv)
return CCMP_TK_LEN;
 }
 
-
 static char *ieee80211_ccmp_print_stats(char *p, void *priv)
 {
struct ieee80211_ccmp_data *ccmp = priv;
-- 
2.7.4



Re: [PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems

2017-02-11 Thread kbuild test robot
Hi Kishore,

[auto build test ERROR on tip/x86/core]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Kishore-Karanala/Staging-setup-c-boot-loader-kernel-arguments-are-secured-over-cmdline-txt-arguments-for-some-systems/20170212-033448
config: x86_64-randconfig-x008-201707
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
make ARCH=x86_64  randconfig
make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> arch/x86/Kconfig:2199: syntax error
>> arch/x86/Kconfig:2198: unknown option "In"
   arch/x86/Kconfig:2199:warning: ignoring unsupported character ','
>> arch/x86/Kconfig:2199: unknown option "cmdline"
>> arch/x86/Kconfig:2200: unknown option "CMDLINE"
   make[2]: *** [oldconfig] Error 1
   make[1]: *** [oldconfig] Error 2
   make: *** [sub-make] Error 2
--
>> arch/x86/Kconfig:2199: syntax error
>> arch/x86/Kconfig:2198: unknown option "In"
   arch/x86/Kconfig:2199:warning: ignoring unsupported character ','
>> arch/x86/Kconfig:2199: unknown option "cmdline"
>> arch/x86/Kconfig:2200: unknown option "CMDLINE"
   make[2]: *** [olddefconfig] Error 1
   make[2]: Target 'oldnoconfig' not remade because of errors.
   make[1]: *** [oldnoconfig] Error 2
   make: *** [sub-make] Error 2

vim +2199 arch/x86/Kconfig

  2192However, you can use the CONFIG_CMDLINE_OVERRIDE option to
  2193change this behavior.
  2194  
  2195In most cases, the command line (whether built-in or provided
  2196by the boot loader) should specify the device for the root
  2197file system.
> 2198   In some of the systems boot loader arguments needs dominated 
> over
> 2199   cmdline arguments in systems like automotive , this can be 
> done using
> 2200   CMDLINE="!root=/dev/mmcblk0p1 ro"
  2201  
  2202  config CMDLINE_OVERRIDE
  2203  bool "Built-in command line overrides boot loader arguments"

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [PATCH v5] fork: free vmapped stacks in cache when cpus are offline

2017-02-11 Thread Thomas Gleixner
On Sat, 11 Feb 2017, kbuild test robot wrote:

> Hi Hoeun,
> 
> [auto build test ERROR on linus/master]
> [also build test ERROR on v4.10-rc7 next-20170210]
> [if your patch is applied to the wrong git tree, please drop us a note to 
> help improve the system]
> 
> url:
> https://github.com/0day-ci/linux/commits/Hoeun-Ryu/fork-free-vmapped-stacks-in-cache-when-cpus-are-offline/20170211-183401
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 6.2.0
> reproduce:
> wget 
> https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
>  -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> make.cross ARCH=ia64 
> 
> All errors (new ones prefixed by >>):
> 
>kernel/fork.c: In function 'fork_init':
> >> kernel/fork.c:483:2: error: implicit declaration of function 
> >> 'vm_stack_cache_init' [-Werror=implicit-function-declaration]
>  vm_stack_cache_init();
>  ^~~

Right. This needs to move to a different place as that part is nested inside

#ifndef CONFIG_ARCH_THREAD_STACK_ALLOCATOR

That's an horrible ifdef maze in that file.

Thanks,

tglx


Re: [PATCH RT] Align rt_mutex inlining with upstream behavior

2017-02-11 Thread Thomas Gleixner
On Sat, 11 Feb 2017, Ingo Molnar wrote:

> 
> * Sebastian Andrzej Siewior  wrote:
> 
> > On 2017-02-10 10:09:29 [-0800], Andy Ritger wrote:
> > > Is the
> > > 
> > > WARN_ON(rt_mutex_is_locked(lock));
> > > 
> > > in rt_mutex_destroy() valuable in non-CONFIG_DEBUG_MUTEXES kernels,
> > > such that it would be better to always call it, and not noop away 
> > > mutex_destroy()
> > > non-CONFIG_DEBUG_MUTEXES kernels?  I thought that was your objection to
> > > Alex's original patch.
> > 
> > It kind of was…
> > So first I removed the GPL symbol. Then I wasn't too happy about it
> > especially since it was not introduced as part of RT. So I reverted that
> > changed and aligned with mainline behaviour (the mutex_rt.h hunk). But
> > then I noticed that with CONFIG_DEBUG_MUTEXES=n and
> > CONFIG_DEBUG_RT_MUTEXES=y we still have a regression compared to !RT and
> > this was the initial motivation to fix things.
> > Then I got curious why mutex_lock() (which is essential rt_mutex_lock())
> > works and noticed the wrapper around it. And while looking at it I
> > decided to go back to strip the GPL part from export symbol instead of
> > adding a wrapper. And here I am.
> > Then I was looking at the patch and decided to align with mainline (and
> > keep that one hunk) in case Ingo ask for his GPL symbol.
> 
> tglx and Peter Zijlstra are main co-authors of kernel/locking/rtmutex.c, and 
> every 
> author (copyright holder) has to agree to changing a GPL export of a kernel 
> subsystem's API to a non-GPL export.

I'm fine with that change as it really hurts users and makes RT behave the
same way as mainline.

Acked-by: Thomas Gleixner 

Thanks,

tglx

[PATCH] ARM: dts: exynos: Use thermal fuse value for thermal zone 0 on Exynos5420

2017-02-11 Thread Krzysztof Kozlowski
In Odroid XU3 Lite board, the temperature levels reported for thermal
zone 0 were weird. In warm room:
/sys/class/thermal/thermal_zone0/temp:32000
/sys/class/thermal/thermal_zone1/temp:51000
/sys/class/thermal/thermal_zone2/temp:55000
/sys/class/thermal/thermal_zone3/temp:54000
/sys/class/thermal/thermal_zone4/temp:51000

Sometimes after booting the value was even equal to ambient temperature
which is highly unlikely to be a real temperature of sensor in SoC.

The thermal sensor's calibration (trimming) is based on fused values.
In case of the board above, the fused values are: 35, 52, 43, 58 and 43
(corresponding to each TMU device).  However driver defined a minimum value
for fused data as 40 and for smaller values it was using a hard-coded 55
instead.  This lead to mapping data from sensor to wrong temperatures
for thermal zone 0.

Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10)
do not impose any limits on fused values.  Since we do not have any
knowledge about these limits, use 0 as a minimum accepted fused value.
This should essentially allow accepting any reasonable fused value thus
behaving like vendor driver.

The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing
exynso4412 with one change - the samsung,tmu_min_efuse_value.

Signed-off-by: Krzysztof Kozlowski 

---

Testing on other Exynos542x boards is much appreciated. Especially I
wonder what efuse values are there.
---
 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 +++
 arch/arm/boot/dts/exynos5420.dtsi | 10 -
 2 files changed, 30 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi

diff --git a/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi 
b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
new file mode 100644
index ..c8771c660550
--- /dev/null
+++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi
@@ -0,0 +1,25 @@
+/*
+ * Device tree sources for Exynos5420 TMU sensor configuration
+ *
+ * Copyright (c) 2014 Lukasz Majewski 
+ * Copyright (c) 2017 Krzysztof Kozlowski 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#include 
+
+#thermal-sensor-cells = <0>;
+samsung,tmu_gain = <8>;
+samsung,tmu_reference_voltage = <16>;
+samsung,tmu_noise_cancel_mode = <4>;
+samsung,tmu_efuse_value = <55>;
+samsung,tmu_min_efuse_value = <0>;
+samsung,tmu_max_efuse_value = <100>;
+samsung,tmu_first_point_trim = <25>;
+samsung,tmu_second_point_trim = <85>;
+samsung,tmu_default_temp_offset = <50>;
+samsung,tmu_cal_type = ;
diff --git a/arch/arm/boot/dts/exynos5420.dtsi 
b/arch/arm/boot/dts/exynos5420.dtsi
index 7dc9dc82afd8..83b3899d228d 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -699,7 +699,7 @@
interrupts = <0 65 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_TMU>;
clock-names = "tmu_apbif";
-   #include "exynos4412-tmu-sensor-conf.dtsi"
+   #include "exynos5420-tmu-sensor-conf.dtsi"
};
 
tmu_cpu1: tmu@10064000 {
@@ -708,7 +708,7 @@
interrupts = <0 183 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_TMU>;
clock-names = "tmu_apbif";
-   #include "exynos4412-tmu-sensor-conf.dtsi"
+   #include "exynos5420-tmu-sensor-conf.dtsi"
};
 
tmu_cpu2: tmu@10068000 {
@@ -717,7 +717,7 @@
interrupts = <0 184 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_TMU>, <&clock CLK_TMU>;
clock-names = "tmu_apbif", "tmu_triminfo_apbif";
-   #include "exynos4412-tmu-sensor-conf.dtsi"
+   #include "exynos5420-tmu-sensor-conf.dtsi"
};
 
tmu_cpu3: tmu@1006c000 {
@@ -726,7 +726,7 @@
interrupts = <0 185 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_TMU>, <&clock CLK_TMU_GPU>;
clock-names = "tmu_apbif", "tmu_triminfo_apbif";
-   #include "exynos4412-tmu-sensor-conf.dtsi"
+   #include "exynos5420-tmu-sensor-conf.dtsi"
};
 
tmu_gpu: tmu@100a {
@@ -735,7 +735,7 @@
interrupts = <0 215 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clock CLK_TMU_GPU>, <&clock CLK_TMU>;
clock-names = "tmu_apbif", "tmu_triminfo_apbif";
-   #include "exynos4412-tmu-sensor-conf.dtsi"
+   #include "exynos5420-tmu-sensor-conf.dtsi"
};
 
sysmmu_g2

Re: [PATCHv4 4/5] x86/mm: check in_compat_syscall() instead TIF_ADDR32 for mmap(MAP_32BIT)

2017-02-11 Thread Thomas Gleixner
On Mon, 30 Jan 2017, Dmitry Safonov wrote:

> At this momet, logic in arch_get_unmapped_area{,_topdown} for mmaps with
> MAP_32BIT flag checks TIF_ADDR32 which means:
> o if 32-bit ELF changes mode to 64-bit on x86_64 and then tries to
>   mmap() with MAP_32BIT it'll result in addr over 4Gb (as default is
>   top-down allocation)
> o if 64-bit ELF changes mode to 32-bit and tries mmap() with MAP_32BIT,
>   it'll allocate only memory in 1GB space: [0x4000, 0x8000).
> 
> Fix it by handeling MAP_32BIT in 64-bit syscalls only.

I really have a hard time to understand what is fixed and how that is
related to the $subject.

Again. Please explain the problem first properly so one can understand the
issue immediately.

> As a little bonus it'll make thread flag a little less used.

I really do not understand the bonus part here. You replace the thread flag
check with a different one and AFAICT this looks like oart of the 'fix'.

Thanks,

tglx

> @@ -101,7 +101,7 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, 
> len,
>  static void find_start_end(unsigned long flags, unsigned long *begin,
>  unsigned long *end)
>  {
> - if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT)) {
> + if (!in_compat_syscall() && (flags & MAP_32BIT)) {
>   /* This is usually used needed to map code in small
>  model, so it needs to be in the first 31bit. Limit
>  it to that.  This means we need to move the
> @@ -195,7 +195,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const 
> unsigned long addr0,
>   return addr;
>  
>   /* for MAP_32BIT mappings we force the legacy mmap base */
> - if (!test_thread_flag(TIF_ADDR32) && (flags & MAP_32BIT))
> + if (!in_compat_syscall() && (flags & MAP_32BIT))
>   goto bottomup;
>  
>   /* requesting a specific address */
> -- 
> 2.11.0
> 
> 


[PATCH] thermal: exynos: Remove parsing unused samsung,tmu_cal_mode property

2017-02-11 Thread Krzysztof Kozlowski
The property samsung,tmu_cal_mode is not used and not used.  We can
safely remove it.

Signed-off-by: Krzysztof Kozlowski 
---
 drivers/thermal/samsung/exynos_tmu.c | 1 -
 drivers/thermal/samsung/exynos_tmu.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c 
b/drivers/thermal/samsung/exynos_tmu.c
index ad1186dd6132..7b8ef09d2b3c 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -1168,7 +1168,6 @@ static int exynos_of_sensor_conf(struct device_node *np,
pdata->default_temp_offset = (u8)value;
 
of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type);
-   of_property_read_u32(np, "samsung,tmu_cal_mode", &pdata->cal_mode);
 
of_node_put(np);
return 0;
diff --git a/drivers/thermal/samsung/exynos_tmu.h 
b/drivers/thermal/samsung/exynos_tmu.h
index 440c7140b660..5149c2a3030c 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -70,7 +70,6 @@ struct exynos_tmu_platform_data {
 
enum soc_type type;
u32 cal_type;
-   u32 cal_mode;
 };
 
 #endif /* _EXYNOS_TMU_H */
-- 
2.9.3



Re: [PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems

2017-02-11 Thread Thomas Gleixner
On Sun, 12 Feb 2017, Kishore Karanala wrote:
1;2802;0c
The proper subsystem for x86 is x86 and not staging.

Also your subject line is a way too long sentence instead of a short and
precise summary of the change.

> boot loader kernel arguments are secured over cmdline.txt
> arguments for some systems

Repeating it does not make it any better.

What's missing here is an explanation WHY this changes is needed and which
problem it solves.

> Signed-off-by: Kishore Karanala 
> ---
>  arch/x86/Kconfig| 3 +++
>  arch/x86/kernel/setup.c | 7 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
> index e487493..3077fb0 100644
> --- a/arch/x86/Kconfig
> +++ b/arch/x86/Kconfig
> @@ -2224,6 +2224,9 @@ config CMDLINE
> In most cases, the command line (whether built-in or provided
> by the boot loader) should specify the device for the root
> file system.
> +  In some of the systems boot loader arguments needs dominated over
> +  cmdline arguments in systems like automotive , this can be done using
> +  CMDLINE="!root=/dev/mmcblk0p1 ro"

I really have no idea what that sentence means. Also it does not explain
what the exclamation mark stands for.

Aside of that the indentation of that paragraph is wrong.

>  config CMDLINE_OVERRIDE
>   bool "Built-in command line overrides boot loader arguments"
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 4cfba94..5fa3194 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -962,11 +962,16 @@ void __init setup_arch(char **cmdline_p)
>  #ifdef CONFIG_CMDLINE_OVERRIDE
>   strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>  #else
> - if (builtin_cmdline[0]) {
> + if (builtin_cmdline[0] != '!') {
>   /* append boot loader cmdline to builtin */
>   strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
>   strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
>   strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
> + } else {
> + /* This will provide additional secuirty to cmdline */

I assume you mean security. What has this to do with security? The empty
changelog does not explain it neither does this comment.

> + /* arguments not overriding bootloader arguments */

Multiline comments are formatted like this

/*
 * This is the first line of a multiline comment which
 * continues on the second line.
 */

> + strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
> + strlcat(boot_command_line, &builtin_cmdline[1], 
> COMMAND_LINE_SIZE);

So this is just the reverse order of the exsiting mechanism. What's the
point of this exercise?

Thanks,

tglx


Re: [PATCH v3 2/4] iio: chemical: add driver for dsm501/ppd42ns particle sensors

2017-02-11 Thread Tomasz Duszynski
On Sat, Feb 11, 2017 at 10:45:38AM +, Jonathan Cameron wrote:
> On 09/02/17 17:13, Tomasz Duszynski wrote:
> > This patch adds support for dsm501 and ppd42ns particle sensors.
> >
> > Both sensors work on the same principle. Heater (resistor) heats up air
> > in sensor chamber which induces upward flow. Particles convect up through
> > a light beam provided by internal infra-red LED. Light scattered by
> > particles is picked by photodiode and internal electronics outputs PWM
> > signal.
> >
> > Measuring low time occupancy of the signal during 30s measurement period
> > particles number in cubic meter can be computed.
> >
> > Signed-off-by: Tomasz Duszynski 
> Hi Tomasz,
>
> Please always resend the whole series.  Otherwise it gets awfully confusing
> when one tries to find the relevant set of patches making up the latest
> version.  At least I'm guessing that is what has happened as I can't find
> the rest of this v3 series.
Ah. I totally messed up. Will repost the whole series soon.
>
> As such I'm going to comment on this one alone.
>
>
> I'm currious, how consistent is the data you get off this device?
> Are we getting something that looks close to what you'd get measuring the
> pulses with a logic analyser or scope for example?
I've done this sort of tests using logic analyzer and errors were
negligible. So yes, consistency is more than enough for this kind of
sensor.
>
> Rather feels like this should be piped into a pulse width capture unit or
> similar if you have hardware support.  I guess you don't though on your
> particular board! (I'm thinking of something like the TI ECAP, though
> magic with latching counters would probably work on other boards.
>
> Anyhow, coming together nicely.  A few minor points inline.
>
> Thanks,
>
> Jonathan
> > ---
> >  Changes in v3:
> >   o use devm_gpiod_get() instead of indexed version. This is due to bindings
> > change.
> >
> >  Changes in v2:
> >   o whitespace fix
> >   o drop excessive comments about conversion to pcs/0.01cf
> >   o fix 'concentartion' typo in dsm501_number_concentartion handler name
> >
> >  drivers/iio/chemical/Kconfig  |  10 ++
> >  drivers/iio/chemical/Makefile |   1 +
> >  drivers/iio/chemical/dsm501.c | 225 
> > ++
> >  3 files changed, 236 insertions(+)
> >  create mode 100644 drivers/iio/chemical/dsm501.c
> >
> > diff --git a/drivers/iio/chemical/Kconfig b/drivers/iio/chemical/Kconfig
> > index cea7f9857a1f..986d612aa77f 100644
> > --- a/drivers/iio/chemical/Kconfig
> > +++ b/drivers/iio/chemical/Kconfig
> > @@ -21,6 +21,16 @@ config ATLAS_PH_SENSOR
> >  To compile this driver as module, choose M here: the
> >  module will be called atlas-ph-sensor.
> >
> > +config DSM501
> > +   tristate "Samyoung DSM501 particle sensor"
> > +   depends on GPIOLIB
> > +   help
> > +Say yes here to build support for the Samyoung DSM501
> > +particle sensor.
> In this help text, all supported parts should be listed.
Ack
> > +
> > +To compile this driver as a module, choose M here: the module
> > +will be called dsm501.
> > +
> >  config IAQCORE
> > tristate "AMS iAQ-Core VOC sensors"
> > depends on I2C
> > diff --git a/drivers/iio/chemical/Makefile b/drivers/iio/chemical/Makefile
> > index b02202b41289..76f50ff8ba7d 100644
> > --- a/drivers/iio/chemical/Makefile
> > +++ b/drivers/iio/chemical/Makefile
> > @@ -4,5 +4,6 @@
> >
> >  # When adding new entries keep the list in alphabetical order
> >  obj-$(CONFIG_ATLAS_PH_SENSOR)  += atlas-ph-sensor.o
> > +obj-$(CONFIG_DSM501)   += dsm501.o
> >  obj-$(CONFIG_IAQCORE)  += ams-iaq-core.o
> >  obj-$(CONFIG_VZ89X)+= vz89x.o
> > diff --git a/drivers/iio/chemical/dsm501.c b/drivers/iio/chemical/dsm501.c
> > new file mode 100644
> > index ..7c53b8305508
> > --- /dev/null
> > +++ b/drivers/iio/chemical/dsm501.c
> > @@ -0,0 +1,225 @@
> > +/*
> > + * Samyoung DSM501 particle sensor driver
> > + *
> > + * Copyright (C) 2017 Tomasz Duszynski 
> > + *
> > + * Datasheets:
> > + *  http://www.samyoungsnc.com/products/3-1%20Specification%20DSM501.pdf
> > + *  http://wiki.timelab.org/images/f/f9/PPD42NS.pdf
> > + *
> > + * 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.
> My pet hate ;) Drop the empty line.
Ack
> > + *
> > + */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +
> > +#define DSM501_DR

Re: [PATCH] Staging: arch/x86/kernel/setup.c : fixed empty line style issue

2017-02-11 Thread Thomas Gleixner
On Sat, 11 Feb 2017, Kishore Karanala wrote:

> From: Kishore 
> 
> Fixed empty line style issue

What? There is no issue. These empty lines are entirely correct and
removing them is just hurting readability.

Thanks,

tglx

> Signed-off-by: Kishore Karanala 
> ---
>  arch/x86/kernel/setup.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
> index 4cfba94..6d35649 100644
> --- a/arch/x86/kernel/setup.c
> +++ b/arch/x86/kernel/setup.c
> @@ -723,7 +723,6 @@ static void __init trim_snb_memory(void)
>* already been reserved.
>*/
>   memblock_reserve(0, 1<<20);
> - 
>   for (i = 0; i < ARRAY_SIZE(bad_pages); i++) {
>   if (memblock_reserve(bad_pages[i], PAGE_SIZE))
>   printk(KERN_WARNING "failed to reserve 0x%08lx\n",
> @@ -815,7 +814,6 @@ static void __init trim_low_memory_range(void)
>  {
>   memblock_reserve(0, ALIGN(reserve_low, PAGE_SIZE));
>  }
> - 
>  /*
>   * Dump out kernel offset information on panic.
>   */
> -- 
> 2.7.4
> 
> 


Re: [PATCHv4 3/5] x86/mm: fix 32-bit mmap() for 64-bit ELF

2017-02-11 Thread Thomas Gleixner
On Mon, 30 Jan 2017, Dmitry Safonov wrote:

> Fix 32-bit compat_sys_mmap() mapping VMA over 4Gb in 64-bit binaries
> and 64-bit sys_mmap() mapping VMA only under 4Gb in 32-bit binaries.
> Introduced new bases for compat syscalls in mm_struct:
> mmap_compat_base and mmap_compat_legacy_base for top-down and
> bottom-up allocations accordingly.
> Taught arch_get_unmapped_area{,_topdown}() to use the new mmap_bases
> in compat syscalls for high/low limits in vm_unmapped_area().
> 
> I discovered that bug on ZDTM tests for compat 32-bit C/R.
> Working compat sys_mmap() in 64-bit binaries is really needed for that
> purpose, as 32-bit applications are restored from 64-bit CRIU binary.

Again that changelog sucks.

Explain the problem/bug first. Then explain the way to fix it and do not
tell fairy tales about what you did without explaing the bug in the first
place.

DocumentationSubittingPatches explains that very well.


> +config HAVE_ARCH_COMPAT_MMAP_BASES
> + bool
> + help
> +   If this is set, one program can do native and compatible syscall
> +   mmap() on architecture. Thus kernel has different bases to
> +   compute high and low virtual address limits for allocation.

Sigh. How is a user supposed to decode this?

  This allows 64bit applications to invoke syscalls in 64bit and
  32bit mode. Required for 

>  
> @@ -113,10 +114,19 @@ static void find_start_end(unsigned long flags, 
> unsigned long *begin,
>   if (current->flags & PF_RANDOMIZE) {
>   *begin = randomize_page(*begin, 0x0200);
>   }
> - } else {
> - *begin = current->mm->mmap_legacy_base;
> - *end = TASK_SIZE;
> + return;
>   }
> +
> +#ifdef CONFIG_COMPAT

Can you please find a solution which does not create that ifdef horror in
the code? Just a few accessors to those compat fields are required to do
that.

> +
> +#ifdef CONFIG_COMPAT
> + arch_pick_mmap_base(&mm->mmap_compat_base, &mm->mmap_compat_legacy_base,
> + arch_compat_rnd(), IA32_PAGE_OFFSET);
> +#endif

Ditto

Thanks,

tglx


[PATCH net-next v1] bpf: Remove redundant ifdef

2017-02-11 Thread Mickaël Salaün
Remove a useless ifdef __NR_bpf as requested by Wang Nan.

Inline one-line static functions as it was in the bpf_sys.h file.

Signed-off-by: Mickaël Salaün 
Cc: Alexei Starovoitov 
Cc: Daniel Borkmann 
Cc: David S. Miller 
Cc: Wang Nan 
Link: https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895...@huawei.com
---
 tools/lib/bpf/bpf.c | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c
index 50e04cc5..2de9c386989a 100644
--- a/tools/lib/bpf/bpf.c
+++ b/tools/lib/bpf/bpf.c
@@ -42,21 +42,15 @@
 # endif
 #endif
 
-static __u64 ptr_to_u64(const void *ptr)
+static inline __u64 ptr_to_u64(const void *ptr)
 {
return (__u64) (unsigned long) ptr;
 }
 
-static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
-  unsigned int size)
+static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr,
+ unsigned int size)
 {
-#ifdef __NR_bpf
return syscall(__NR_bpf, cmd, attr, size);
-#else
-   fprintf(stderr, "No bpf syscall, kernel headers too old?\n");
-   errno = ENOSYS;
-   return -1;
-#endif
 }
 
 int bpf_create_map(enum bpf_map_type map_type, int key_size,
-- 
2.11.0



[PATCH] Staging: setup.c : boot loader kernel arguments are secured over cmdline.txt arguments for some systems

2017-02-11 Thread Kishore Karanala
boot loader kernel arguments are secured over cmdline.txt
arguments for some systems

Signed-off-by: Kishore Karanala 
---
 arch/x86/Kconfig| 3 +++
 arch/x86/kernel/setup.c | 7 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index e487493..3077fb0 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -2224,6 +2224,9 @@ config CMDLINE
  In most cases, the command line (whether built-in or provided
  by the boot loader) should specify the device for the root
  file system.
+In some of the systems boot loader arguments needs dominated over
+cmdline arguments in systems like automotive , this can be done using
+CMDLINE="!root=/dev/mmcblk0p1 ro"
 
 config CMDLINE_OVERRIDE
bool "Built-in command line overrides boot loader arguments"
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 4cfba94..5fa3194 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -962,11 +962,16 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_CMDLINE_OVERRIDE
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
 #else
-   if (builtin_cmdline[0]) {
+   if (builtin_cmdline[0] != '!') {
/* append boot loader cmdline to builtin */
strlcat(builtin_cmdline, " ", COMMAND_LINE_SIZE);
strlcat(builtin_cmdline, boot_command_line, COMMAND_LINE_SIZE);
strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
+   } else {
+   /* This will provide additional secuirty to cmdline */
+   /* arguments not overriding bootloader arguments */
+   strlcat(boot_command_line, " ", COMMAND_LINE_SIZE);
+   strlcat(boot_command_line, &builtin_cmdline[1], 
COMMAND_LINE_SIZE);
}
 #endif
 #endif
-- 
2.7.4



[PATCH] clocksource: add __ro_after_init to cyclecounter

2017-02-11 Thread Bhumika Goyal
The object cyclecounter of type cyclecounter is not getting modified
after getting initialized by arch_counter_register. Apart from
initialization in arch_counter_register it is also passed as an argument
to the function timecounter_init but this argument is of type const.
Therefore, add __ro_after_init to its declaration.

Signed-off-by: Bhumika Goyal 
---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c 
b/drivers/clocksource/arm_arch_timer.c
index 4c8c3fb..a10506b 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -580,7 +580,7 @@ static u64 arch_counter_read_cc(const struct cyclecounter 
*cc)
.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
-static struct cyclecounter cyclecounter = {
+static struct cyclecounter cyclecounter __ro_after_init = {
.read   = arch_counter_read_cc,
.mask   = CLOCKSOURCE_MASK(56),
 };
-- 
1.9.1



Re: [PATCH 07/10] rcu: Separate the RCU synchronization types and APIs into

2017-02-11 Thread Paul McKenney
On Wed, Feb 8, 2017 at 10:34 AM, Ingo Molnar  wrote:
> So rcupdate.h is a pretty complex header, in particular it includes
>  which includes  - creating a
> dependency that includes  in ,
> which prevents the isolation of  from the derived
>  header.
>
> Solve part of the problem by decoupling rcupdate.h from completions:
> this can be done by separating out the rcu_synchronize types and APIs,
> and updating their usage sites.
>
> Since this is a mostly RCU-internal types this will not just simplify
> 's dependencies, but will make all the hundreds of
> .c files that include rcupdate.h but not completions or wait.h build
> faster.

Indeed, rcupdate.h is overdue for a more sweeping overhaul.

> ( For rcutiny this means that two dependent APIs have to be uninlined,
>   but that shouldn't be much of a problem as they are rare variants. )

Do people still care about Tiny kernel?  If so, I can queue a patch
that leaves rcu_barrier_bh() and rcu_barrier_sched() inline, but
creates an rcu_barrier_generic() or some such, so that there is
space taken up by only one EXPORT_SYMBOL() instead of two.
(0day Test Robot yells at me every time I add one...)

Other than that, I don't see any problems with this.  I will do some
testing.

   Thanx, Paul

> Cc: Linus Torvalds 
> Cc: Mike Galbraith 
> Cc: Paul E. McKenney 
> Cc: Peter Zijlstra 
> Cc: Thomas Gleixner 
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Ingo Molnar 
> ---
>  fs/autofs4/autofs_i.h |  1 +
>  include/linux/dcache.h|  1 +
>  include/linux/rcupdate.h  | 40 
>  include/linux/rcupdate_wait.h | 50 
> ++
>  include/linux/rcutiny.h   | 11 ++-
>  kernel/rcu/srcu.c |  2 +-
>  kernel/rcu/tiny.c | 14 +-
>  kernel/rcu/tree.c |  2 +-
>  kernel/rcu/update.c   |  1 +
>  kernel/sched/core.c   |  1 +
>  10 files changed, 71 insertions(+), 52 deletions(-)
>
> diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h
> index c885daae68c8..beef981aa54f 100644
> --- a/fs/autofs4/autofs_i.h
> +++ b/fs/autofs4/autofs_i.h
> @@ -14,6 +14,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  /* This is the range of ioctl() numbers we claim as ours */
>  #define AUTOFS_IOC_FIRST AUTOFS_IOC_READY
> diff --git a/include/linux/dcache.h b/include/linux/dcache.h
> index c965e4469499..16948defb568 100644
> --- a/include/linux/dcache.h
> +++ b/include/linux/dcache.h
> @@ -11,6 +11,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  struct path;
>  struct vfsmount;
> diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> index 01f71e1d2e94..1f476b63c596 100644
> --- a/include/linux/rcupdate.h
> +++ b/include/linux/rcupdate.h
> @@ -40,7 +40,6 @@
>  #include 
>  #include 
>  #include 
> -#include 
>  #include 
>  #include 
>  #include 
> @@ -226,45 +225,6 @@ void call_rcu_sched(struct rcu_head *head,
>
>  void synchronize_sched(void);
>
> -/*
> - * Structure allowing asynchronous waiting on RCU.
> - */
> -struct rcu_synchronize {
> -   struct rcu_head head;
> -   struct completion completion;
> -};

> -void wakeme_after_rcu(struct rcu_head *head);> -
> -void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
> -  struct rcu_synchronize *rs_array);
> -
> -#define _wait_rcu_gp(checktiny, ...) \
> -do {   \
> -   call_rcu_func_t __crcu_array[] = { __VA_ARGS__ };   \
> -   struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)];\
> -   __wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array),  \
> -   __crcu_array, __rs_array);  \
> -} while (0)
> -
> -#define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
> -
> -/**
> - * synchronize_rcu_mult - Wait concurrently for multiple grace periods
> - * @...: List of call_rcu() functions for the flavors to wait on.
> - *
> - * This macro waits concurrently for multiple flavors of RCU grace periods.
> - * For example, synchronize_rcu_mult(call_rcu, call_rcu_bh) would wait
> - * on concurrent RCU and RCU-bh grace periods.  Waiting on a give SRCU
> - * domain requires you to write a wrapper function for that SRCU domain's
> - * call_srcu() function, supplying the corresponding srcu_struct.
> - *
> - * If Tiny RCU, tell _wait_rcu_gp() not to bother waiting for RCU
> - * or RCU-bh, given that anywhere synchronize_rcu_mult() can be called
> - * is automatically a grace period.
> - */
> -#define synchronize_rcu_mult(...) \
> -   _wait_rcu_gp(IS_ENABLED(CONFIG_TINY_RCU), __VA_ARGS__)
> -
>  /**
>   * call_rcu_tasks() - Queue an RCU for invocation task-based grace period
>   * @head: structure to be used for queueing the RCU updates.
> diff --git a/include/linux/rcupdate_wait.h b/include/linux/rcupdate_w

[PATCH] kernel: ksysfs: add __ro_after_init to bin_attribute structure

2017-02-11 Thread Bhumika Goyal
The object notes_attr of type bin_attribute is not modified after
getting initailized by ksysfs_init. Apart from initialization in
ksysfs_init it is also passed as an argument to the function
sysfs_create_bin_file but this argument is of type const. Therefore, add
__ro_after_init to its declaration.

Signed-off-by: Bhumika Goyal 
---
 kernel/ksysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index ee1bc1b..0999679 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -195,7 +195,7 @@ static ssize_t notes_read(struct file *filp, struct kobject 
*kobj,
return count;
 }
 
-static struct bin_attribute notes_attr = {
+static struct bin_attribute notes_attr __ro_after_init  = {
.attr = {
.name = "notes",
.mode = S_IRUGO,
-- 
1.9.1



Re: [PATCH] staging: r8712u: use __le32 type for little-endian data

2017-02-11 Thread Perry Hooker
Thank you all for taking the time to look at this. I'm sorry for
filling your inboxes with my mistakes - as you probably guessed, I'm
new to kernel development, so I really appreciate the feedback.

Perry

On Fri, Feb 10, 2017 at 1:55 PM, Larry Finger  wrote:
> On 02/10/2017 12:23 PM, Perry Hooker wrote:
>>
>> This patch fixes the following sparse warning:
>> drivers/staging/rtl8712/usb_ops_linux.c:212:33: warning: cast to
>> restricted __le32
>>
>> Signed-off-by: Perry Hooker 
>> ---
>>  drivers/staging/rtl8712/usb_ops_linux.c | 5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>
>
> Are you using the staging branch of Greg's tree? If so, you should be using
> staging-next. The exact patch that you submitted has already been applied as
> commit 6839bc81478f entitled "staging: rtl8712: changed uint to __le32" and
> authored by Jannik Becher . The patch was applied
> on Tue Dec 20.
>
> Sorry that I did not remember about that earlier patch with the first reply;
> however, you did get the fix right this time. Congratulations as these
> endian issues can be difficult.
>
> In a quick look at the code, I see that there are a number of endian
> problems in the headers for the 802.11 packets, and in the macros that read
> and write the TX and RX descriptors. It is surprising that the driver
> actually works on big-endian hardware. I do not know how much experience you
> have, but the macros are tricky. I will try to get them cleaned up.
>
> Larry
>
>
> staging: rtl8712: changed uint to __le32
>
>
>>
>> diff --git a/drivers/staging/rtl8712/usb_ops_linux.c
>> b/drivers/staging/rtl8712/usb_ops_linux.c
>> index fc6bb0b..df7c1aa 100644
>> --- a/drivers/staging/rtl8712/usb_ops_linux.c
>> +++ b/drivers/staging/rtl8712/usb_ops_linux.c
>> @@ -192,7 +192,8 @@ void r8712_usb_write_mem(struct intf_hdl *pintfhdl,
>> u32 addr, u32 cnt, u8 *wmem)
>>
>>  static void r8712_usb_read_port_complete(struct urb *purb)
>>  {
>> -   uint isevt, *pbuf;
>> +   __le32 *pbuf;
>> +   uint isevt;
>> struct recv_buf *precvbuf = (struct recv_buf *)purb->context;
>> struct _adapter *padapter = (struct _adapter *)precvbuf->adapter;
>> struct recv_priv *precvpriv = &padapter->recvpriv;
>> @@ -208,7 +209,7 @@ static void r8712_usb_read_port_complete(struct urb
>> *purb)
>> _pkt *pskb = precvbuf->pskb;
>>
>> precvbuf->transfer_len = purb->actual_length;
>> -   pbuf = (uint *)precvbuf->pbuf;
>> +   pbuf = (__le32 *)precvbuf->pbuf;
>> isevt = le32_to_cpu(*(pbuf + 1)) & 0x1ff;
>> if ((isevt & 0x1ff) == 0x1ff) {
>> r8712_rxcmd_event_hdl(padapter, pbuf);
>>
>


Re: [PATCH] hwrng: cavium: Use per device name to allow for multiple devices.

2017-02-11 Thread Herbert Xu
On Mon, Feb 06, 2017 at 02:28:46PM -0800, David Daney wrote:
> Systems containing the Cavium HW RNG may have one device per NUMA
> node.  A typical configuration is a 2-node NUMA system, which results
> in 2 RNG devices.  The hwrng subsystem refuses (and rightly so) to
> register more than one device with he same name, so we get failure
> messages on these systems.
> 
> Make the hwrng name unique by including the underlying device name.
> Also remove spaces from the name to make it possible to switch devices
> via the sysfs knobs.
> 
> Signed-off-by: David Daney 

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


Re: crypto: NULL deref in sha512_mb_mgr_get_comp_job_avx2

2017-02-11 Thread Herbert Xu
On Wed, Feb 01, 2017 at 10:45:02AM -0800, Tim Chen wrote:
>
> One theory that Mehga and I have is that perhaps the flusher
> and regular computaion updates are stepping on each other. 
> Can you try this patch and see if it helps?

Patch applied.  Thanks.
-- 
Email: Herbert Xu 
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt


  1   2   3   >