[PATCH v4 4/6] staging: ks7010: fix coding style issue of using pr_notice instead of printk

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of using pr_notice instead of printk,
warning as issued by checkpatch.pl

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog
 - updated subject to include driver name

 drivers/staging/ks7010/ks_wlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 94b648b..78beca7 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,7 +38,7 @@
 #define DPRINTK(n, fmt, args...) \
do { \
if (KS_WLAN_DEBUG > (n)) \
-   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
+   pr_notice("%s: "fmt, __FUNCTION__, ## args); \
} while (0)
 #else
 #define DPRINTK(n, fmt, args...)
-- 
2.7.4



[PATCH v4 4/6] staging: ks7010: fix coding style issue of using pr_notice instead of printk

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of using pr_notice instead of printk,
warning as issued by checkpatch.pl

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog
 - updated subject to include driver name

 drivers/staging/ks7010/ks_wlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 94b648b..78beca7 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,7 +38,7 @@
 #define DPRINTK(n, fmt, args...) \
do { \
if (KS_WLAN_DEBUG > (n)) \
-   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
+   pr_notice("%s: "fmt, __FUNCTION__, ## args); \
} while (0)
 #else
 #define DPRINTK(n, fmt, args...)
-- 
2.7.4



[PATCH v4 1/6] staging: ks7010: fixed warning of avoiding line over 80 characters

2017-02-25 Thread Chetan Sethi
This patch fixes warning of line over 80 characters, as issued by
checkpatch.pl

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog

 drivers/staging/ks7010/ks_wlan.h | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 9ab80e1..668202d 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -18,10 +18,10 @@
 #include 
 #include 
 
-#include /* spinlock_t   
*/
-#include/* wait_queue_head_t
*/
-#include/* pid_t
*/
-#include/* struct net_device_stats,  struct sk_buff 
*/
+#include /* spinlock_t */
+#include/* wait_queue_head_t */
+#include/* pid_t */
+#include/* struct net_device_stats,  struct sk_buff */
 #include 
 #include 
 #include   /* struct atomic_t */
@@ -36,7 +36,8 @@
 
 #ifdef KS_WLAN_DEBUG
 #define DPRINTK(n, fmt, args...) \
- if (KS_WLAN_DEBUG > (n)) printk(KERN_NOTICE "%s: "fmt, 
__FUNCTION__, ## args)
+ if (KS_WLAN_DEBUG > (n)) \
+   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args)
 #else
 #define DPRINTK(n, fmt, args...)
 #endif
-- 
2.7.4



[PATCH v4 1/6] staging: ks7010: fixed warning of avoiding line over 80 characters

2017-02-25 Thread Chetan Sethi
This patch fixes warning of line over 80 characters, as issued by
checkpatch.pl

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog

 drivers/staging/ks7010/ks_wlan.h | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 9ab80e1..668202d 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -18,10 +18,10 @@
 #include 
 #include 
 
-#include /* spinlock_t   
*/
-#include/* wait_queue_head_t
*/
-#include/* pid_t
*/
-#include/* struct net_device_stats,  struct sk_buff 
*/
+#include /* spinlock_t */
+#include/* wait_queue_head_t */
+#include/* pid_t */
+#include/* struct net_device_stats,  struct sk_buff */
 #include 
 #include 
 #include   /* struct atomic_t */
@@ -36,7 +36,8 @@
 
 #ifdef KS_WLAN_DEBUG
 #define DPRINTK(n, fmt, args...) \
- if (KS_WLAN_DEBUG > (n)) printk(KERN_NOTICE "%s: "fmt, 
__FUNCTION__, ## args)
+ if (KS_WLAN_DEBUG > (n)) \
+   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args)
 #else
 #define DPRINTK(n, fmt, args...)
 #endif
-- 
2.7.4



[PATCH] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'

2017-02-25 Thread Christophe JAILLET
If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the
clk already handled.

With the current implemenatation, we try to do that on the clk that has
triggered the error, which is a no-op, and leave 'msm_host->bus_clks[0]'
untouched.

Shift by one the index array to free resources correctly.

Signed-off-by: Christophe JAILLET 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 1fc07ce24686..eac4987f3946 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -438,7 +438,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
return 0;
 err:
for (; i > 0; i--)
-   clk_disable_unprepare(msm_host->bus_clks[i]);
+   clk_disable_unprepare(msm_host->bus_clks[i-1]);
 
return ret;
 }
-- 
2.9.3



[PATCH] drm/msm/dsi: Fix the releasing of resources in error path in 'dsi_bus_clk_enable()'

2017-02-25 Thread Christophe JAILLET
If a 'clk_prepare_enable()' fails, then we need to disable_unprepare the
clk already handled.

With the current implemenatation, we try to do that on the clk that has
triggered the error, which is a no-op, and leave 'msm_host->bus_clks[0]'
untouched.

Shift by one the index array to free resources correctly.

Signed-off-by: Christophe JAILLET 
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c 
b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 1fc07ce24686..eac4987f3946 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -438,7 +438,7 @@ static int dsi_bus_clk_enable(struct msm_dsi_host *msm_host)
return 0;
 err:
for (; i > 0; i--)
-   clk_disable_unprepare(msm_host->bus_clks[i]);
+   clk_disable_unprepare(msm_host->bus_clks[i-1]);
 
return ret;
 }
-- 
2.9.3



[PATCH v5 2/4] switchtec: Add user interface documentation

2017-02-25 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and
a RST formatted text file which documents the char device interface.
Jonathan Corbet has indicated he will move this to a new user-space
developer documentation book once it's created.

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
---
 Documentation/switchtec.txt | 53 +
 MAINTAINERS |  1 +
 2 files changed, 54 insertions(+)
 create mode 100644 Documentation/switchtec.txt

diff --git a/Documentation/switchtec.txt b/Documentation/switchtec.txt
new file mode 100644
index 000..4bced4c
--- /dev/null
+++ b/Documentation/switchtec.txt
@@ -0,0 +1,53 @@
+
+Linux Switchtec Support
+
+
+Microsemi's "Switchtec" line of PCI switch devices is already
+supported by the kernel with standard PCI switch drivers. However, the
+Switchtec device advertises a special management endpoint which
+enables some additional functionality. This includes:
+
+* Packet and Byte Counters
+* Firmware Upgrades
+* Event and Error logs
+* Querying port link status
+* Custom user firmware commands
+
+The switchtec kernel module implements this functionality.
+
+
+Interface
+=
+
+The primary means of communicating with the Switchtec management firmware is
+through the Memory-mapped Remote Procedure Call (MRPC) interface.
+Commands are submitted to the interface with a 4-byte command
+identifier and up to 1KB of command specific data. The firmware will
+respond with a 4 bytes return code and up to 1KB of command specific
+data. The interface only processes a single command at a time.
+
+
+Userspace Interface
+===
+
+The MRPC interface will be exposed to userspace through a simple char
+device: /dev/switchtec#, one for each management endpoint in the system.
+
+The char device has the following semantics:
+
+* A write must consist of at least 4 bytes and no more than 1028 bytes.
+  The first four bytes will be interpreted as the command to run and
+  the remainder will be used as the input data. A write will send the
+  command to the firmware to begin processing.
+
+* Each write must be followed by exactly one read. Any double write will
+  produce an error and any read that doesn't follow a write will
+  produce an error.
+
+* A read will block until the firmware completes the command and return
+  the four bytes of status plus up to 1024 bytes of output data. (The
+  length will be specified by the size parameter of the read call --
+  reading less than 4 bytes will produce an error.
+
+* The poll call will also be supported for userspace applications that
+  need to do other things while waiting for the command to complete.
diff --git a/MAINTAINERS b/MAINTAINERS
index a57686f..aa702b0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9512,6 +9512,7 @@ M:Stephen Bates 
 M: Logan Gunthorpe 
 L: linux-...@vger.kernel.org
 S: Maintained
+F: Documentation/switchtec.txt
 F: drivers/pci/switch/switchtec*
 
 PCI DRIVER FOR NVIDIA TEGRA
-- 
2.1.4



[PATCH v5 2/4] switchtec: Add user interface documentation

2017-02-25 Thread Logan Gunthorpe
This adds standard documentation for the sysfs switchtec attributes and
a RST formatted text file which documents the char device interface.
Jonathan Corbet has indicated he will move this to a new user-space
developer documentation book once it's created.

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
---
 Documentation/switchtec.txt | 53 +
 MAINTAINERS |  1 +
 2 files changed, 54 insertions(+)
 create mode 100644 Documentation/switchtec.txt

diff --git a/Documentation/switchtec.txt b/Documentation/switchtec.txt
new file mode 100644
index 000..4bced4c
--- /dev/null
+++ b/Documentation/switchtec.txt
@@ -0,0 +1,53 @@
+
+Linux Switchtec Support
+
+
+Microsemi's "Switchtec" line of PCI switch devices is already
+supported by the kernel with standard PCI switch drivers. However, the
+Switchtec device advertises a special management endpoint which
+enables some additional functionality. This includes:
+
+* Packet and Byte Counters
+* Firmware Upgrades
+* Event and Error logs
+* Querying port link status
+* Custom user firmware commands
+
+The switchtec kernel module implements this functionality.
+
+
+Interface
+=
+
+The primary means of communicating with the Switchtec management firmware is
+through the Memory-mapped Remote Procedure Call (MRPC) interface.
+Commands are submitted to the interface with a 4-byte command
+identifier and up to 1KB of command specific data. The firmware will
+respond with a 4 bytes return code and up to 1KB of command specific
+data. The interface only processes a single command at a time.
+
+
+Userspace Interface
+===
+
+The MRPC interface will be exposed to userspace through a simple char
+device: /dev/switchtec#, one for each management endpoint in the system.
+
+The char device has the following semantics:
+
+* A write must consist of at least 4 bytes and no more than 1028 bytes.
+  The first four bytes will be interpreted as the command to run and
+  the remainder will be used as the input data. A write will send the
+  command to the firmware to begin processing.
+
+* Each write must be followed by exactly one read. Any double write will
+  produce an error and any read that doesn't follow a write will
+  produce an error.
+
+* A read will block until the firmware completes the command and return
+  the four bytes of status plus up to 1024 bytes of output data. (The
+  length will be specified by the size parameter of the read call --
+  reading less than 4 bytes will produce an error.
+
+* The poll call will also be supported for userspace applications that
+  need to do other things while waiting for the command to complete.
diff --git a/MAINTAINERS b/MAINTAINERS
index a57686f..aa702b0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9512,6 +9512,7 @@ M:Stephen Bates 
 M: Logan Gunthorpe 
 L: linux-...@vger.kernel.org
 S: Maintained
+F: Documentation/switchtec.txt
 F: drivers/pci/switch/switchtec*
 
 PCI DRIVER FOR NVIDIA TEGRA
-- 
2.1.4



[PATCH v4 3/6] staging: ks7010: fix coding style issue of using tabs instead of spaces

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of using tabs instead of spaces at
start of line, error as issued by checkpatch.pl

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog

 drivers/staging/ks7010/ks_wlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 33d6b28..94b648b 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -36,7 +36,7 @@
 
 #ifdef KS_WLAN_DEBUG
 #define DPRINTK(n, fmt, args...) \
-do { \
+   do { \
if (KS_WLAN_DEBUG > (n)) \
printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
} while (0)
-- 
2.7.4



[PATCH v4 3/6] staging: ks7010: fix coding style issue of using tabs instead of spaces

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of using tabs instead of spaces at
start of line, error as issued by checkpatch.pl

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog

 drivers/staging/ks7010/ks_wlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 33d6b28..94b648b 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -36,7 +36,7 @@
 
 #ifdef KS_WLAN_DEBUG
 #define DPRINTK(n, fmt, args...) \
-do { \
+   do { \
if (KS_WLAN_DEBUG > (n)) \
printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
} while (0)
-- 
2.7.4



[PATCH v4 2/6] staging: ks7010: fix coding style issue of enclosing complex macro value in parentheses

2017-02-25 Thread Chetan Sethi
This patch fixes error of enclosing complex macro value in parentheses,
error as issued by checkpatch

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
 - incorporated review comment of correct indentation for do statement
v4:
 - modified description to exclude mention of patch number from changelog

 drivers/staging/ks7010/ks_wlan.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 668202d..33d6b28 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -36,8 +36,10 @@
 
 #ifdef KS_WLAN_DEBUG
 #define DPRINTK(n, fmt, args...) \
- if (KS_WLAN_DEBUG > (n)) \
-   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args)
+do { \
+   if (KS_WLAN_DEBUG > (n)) \
+   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
+   } while (0)
 #else
 #define DPRINTK(n, fmt, args...)
 #endif
-- 
2.7.4



[PATCH v4 2/6] staging: ks7010: fix coding style issue of enclosing complex macro value in parentheses

2017-02-25 Thread Chetan Sethi
This patch fixes error of enclosing complex macro value in parentheses,
error as issued by checkpatch

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
 - incorporated review comment of correct indentation for do statement
v4:
 - modified description to exclude mention of patch number from changelog

 drivers/staging/ks7010/ks_wlan.h | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 668202d..33d6b28 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -36,8 +36,10 @@
 
 #ifdef KS_WLAN_DEBUG
 #define DPRINTK(n, fmt, args...) \
- if (KS_WLAN_DEBUG > (n)) \
-   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args)
+do { \
+   if (KS_WLAN_DEBUG > (n)) \
+   printk(KERN_NOTICE "%s: "fmt, __FUNCTION__, ## args); \
+   } while (0)
 #else
 #define DPRINTK(n, fmt, args...)
 #endif
-- 
2.7.4



[PATCH v4 5/6] staging: ks7010: fix coding style issue of using __func__ instead of __FUNCTION__

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of using __func__ instead of gcc
specific __FUNCTION__, warning as issued by checkpatch

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog
 - updated subject to include driver name

 drivers/staging/ks7010/ks_wlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 78beca7..79737bf 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,7 +38,7 @@
 #define DPRINTK(n, fmt, args...) \
do { \
if (KS_WLAN_DEBUG > (n)) \
-   pr_notice("%s: "fmt, __FUNCTION__, ## args); \
+   pr_notice("%s: "fmt, __func__, ## args); \
} while (0)
 #else
 #define DPRINTK(n, fmt, args...)
-- 
2.7.4



[PATCH v4 5/6] staging: ks7010: fix coding style issue of using __func__ instead of __FUNCTION__

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of using __func__ instead of gcc
specific __FUNCTION__, warning as issued by checkpatch

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog
 - updated subject to include driver name

 drivers/staging/ks7010/ks_wlan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 78beca7..79737bf 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -38,7 +38,7 @@
 #define DPRINTK(n, fmt, args...) \
do { \
if (KS_WLAN_DEBUG > (n)) \
-   pr_notice("%s: "fmt, __FUNCTION__, ## args); \
+   pr_notice("%s: "fmt, __func__, ## args); \
} while (0)
 #else
 #define DPRINTK(n, fmt, args...)
-- 
2.7.4



[PATCH] [linux-next] xenbus: Remove duplicate inclusion of linux/init.h

2017-02-25 Thread Masanari Iida
This patch remove duplicate inclusion of linux/init.h in
xenbus_dev_frontend.c.
Confirm successfully compile after remove the line.

Signed-off-by: Masanari Iida 
---
 drivers/xen/xenbus/xenbus_dev_frontend.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c 
b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 4d343eed08f5..1f4733b80c87 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -55,7 +55,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
-- 
2.12.0



[PATCH] [linux-next] xenbus: Remove duplicate inclusion of linux/init.h

2017-02-25 Thread Masanari Iida
This patch remove duplicate inclusion of linux/init.h in
xenbus_dev_frontend.c.
Confirm successfully compile after remove the line.

Signed-off-by: Masanari Iida 
---
 drivers/xen/xenbus/xenbus_dev_frontend.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/xen/xenbus/xenbus_dev_frontend.c 
b/drivers/xen/xenbus/xenbus_dev_frontend.c
index 4d343eed08f5..1f4733b80c87 100644
--- a/drivers/xen/xenbus/xenbus_dev_frontend.c
+++ b/drivers/xen/xenbus/xenbus_dev_frontend.c
@@ -55,7 +55,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
-- 
2.12.0



[PATCH v5 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-02-25 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to:

* Inform userspace of firmware partition locations
* Pass event counts and allow userspace to wait on events
* Translate between PFF numbers used by the switch to
  port numbers.

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
---
 Documentation/ioctl/ioctl-number.txt |   1 +
 Documentation/switchtec.txt  |  27 ++
 MAINTAINERS  |   1 +
 drivers/pci/switch/switchtec.c   | 467 +++
 include/uapi/linux/switchtec_ioctl.h | 132 ++
 5 files changed, 628 insertions(+)
 create mode 100644 include/uapi/linux/switchtec_ioctl.h

diff --git a/Documentation/ioctl/ioctl-number.txt 
b/Documentation/ioctl/ioctl-number.txt
index 81c7f2b..032b33c 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -191,6 +191,7 @@ Code  Seq#(hex) Include FileComments
 'W'00-1F   linux/watchdog.hconflict!
 'W'00-1F   linux/wanrouter.h   conflict!   (pre 3.9)
 'W'00-3F   sound/asound.h  conflict!
+'W'40-5F   drivers/pci/switch/switchtec.c
 'X'all fs/xfs/xfs_fs.h conflict!
and fs/xfs/linux-2.6/xfs_ioctl32.h
and include/linux/falloc.h
diff --git a/Documentation/switchtec.txt b/Documentation/switchtec.txt
index 4bced4c..a0a9c7b 100644
--- a/Documentation/switchtec.txt
+++ b/Documentation/switchtec.txt
@@ -51,3 +51,30 @@ The char device has the following semantics:
 
 * The poll call will also be supported for userspace applications that
   need to do other things while waiting for the command to complete.
+
+The following IOCTLs are also supported by the device:
+
+* SWITCHTEC_IOCTL_FLASH_INFO - Retrieve firmware length and number
+  of partitions in the device.
+
+* SWITCHTEC_IOCTL_FLASH_PART_INFO - Retrieve address and lengeth for
+  any specified partition in flash.
+
+* SWITCHTEC_IOCTL_EVENT_SUMMARY - Read a structure of bitmaps
+  indicating all uncleared events.
+
+* SWITCHTEC_IOCTL_EVENT_CTL - Get the current count, clear and set flags
+  for any event. This ioctl takes in a switchtec_ioctl_event_ctl struct
+  with the event_id, index and flags set (index being the partition or PFF
+  number for non-global events). It returns whether the event has
+  occurred, the number of times and any event specific data. The flags
+  can be used to clear the count or enable and disable actions to
+  happen when the event occurs.
+  By using the SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL flag,
+  you can set an event to trigger a poll command to return with
+  POLLPRI. In this way, userspace can wait for events to occur.
+
+* SWITCHTEC_IOCTL_PFF_TO_PORT and SWITCHTEC_IOCTL_PORT_TO_PFF convert
+  between PCI Function Framework number (used by the event system)
+  and Switchtec Logic Port ID and Partition number (which is more
+  user friendly).
diff --git a/MAINTAINERS b/MAINTAINERS
index 6fed938..c1a9a30 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9515,6 +9515,7 @@ S:Maintained
 F: Documentation/switchtec.txt
 F: Documentation/ABI/testing/sysfs-class-switchtec
 F: drivers/pci/switch/switchtec*
+F: include/uapi/linux/switchtec_ioctl.h
 
 PCI DRIVER FOR NVIDIA TEGRA
 M: Thierry Reding 
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 2e47d79..94384e7 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -13,6 +13,8 @@
  *
  */
 
+#include 
+
 #include 
 #include 
 #include 
@@ -740,6 +742,417 @@ static unsigned int switchtec_dev_poll(struct file *filp, 
poll_table *wait)
return ret;
 }
 
+static int ioctl_flash_info(struct switchtec_dev *stdev,
+   struct switchtec_ioctl_flash_info __user *uinfo)
+{
+   struct switchtec_ioctl_flash_info info = {0};
+   struct flash_info_regs __iomem *fi = stdev->mmio_flash_info;
+
+   info.flash_length = ioread32(>flash_length);
+   info.num_partitions = SWITCHTEC_IOCTL_NUM_PARTITIONS;
+
+   if (copy_to_user(uinfo, , sizeof(info)))
+   return -EFAULT;
+
+   return 0;
+}
+
+static void set_fw_info_part(struct switchtec_ioctl_flash_part_info *info,
+struct partition_info __iomem *pi)
+{
+   info->address = ioread32(>address);
+   info->length = ioread32(>length);
+}
+
+static int ioctl_flash_part_info(struct switchtec_dev *stdev,
+   struct switchtec_ioctl_flash_part_info __user *uinfo)
+{
+   struct switchtec_ioctl_flash_part_info info = {0};
+   struct flash_info_regs __iomem *fi = stdev->mmio_flash_info;
+   u32 active_addr = -1;
+
+   if (copy_from_user(, uinfo, sizeof(info)))
+   return 

[PATCH v5 4/4] switchtec: Add IOCTLs to the Switchtec driver

2017-02-25 Thread Logan Gunthorpe
This patch introduces a couple of special IOCTLs which are provided to:

* Inform userspace of firmware partition locations
* Pass event counts and allow userspace to wait on events
* Translate between PFF numbers used by the switch to
  port numbers.

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
---
 Documentation/ioctl/ioctl-number.txt |   1 +
 Documentation/switchtec.txt  |  27 ++
 MAINTAINERS  |   1 +
 drivers/pci/switch/switchtec.c   | 467 +++
 include/uapi/linux/switchtec_ioctl.h | 132 ++
 5 files changed, 628 insertions(+)
 create mode 100644 include/uapi/linux/switchtec_ioctl.h

diff --git a/Documentation/ioctl/ioctl-number.txt 
b/Documentation/ioctl/ioctl-number.txt
index 81c7f2b..032b33c 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.txt
@@ -191,6 +191,7 @@ Code  Seq#(hex) Include FileComments
 'W'00-1F   linux/watchdog.hconflict!
 'W'00-1F   linux/wanrouter.h   conflict!   (pre 3.9)
 'W'00-3F   sound/asound.h  conflict!
+'W'40-5F   drivers/pci/switch/switchtec.c
 'X'all fs/xfs/xfs_fs.h conflict!
and fs/xfs/linux-2.6/xfs_ioctl32.h
and include/linux/falloc.h
diff --git a/Documentation/switchtec.txt b/Documentation/switchtec.txt
index 4bced4c..a0a9c7b 100644
--- a/Documentation/switchtec.txt
+++ b/Documentation/switchtec.txt
@@ -51,3 +51,30 @@ The char device has the following semantics:
 
 * The poll call will also be supported for userspace applications that
   need to do other things while waiting for the command to complete.
+
+The following IOCTLs are also supported by the device:
+
+* SWITCHTEC_IOCTL_FLASH_INFO - Retrieve firmware length and number
+  of partitions in the device.
+
+* SWITCHTEC_IOCTL_FLASH_PART_INFO - Retrieve address and lengeth for
+  any specified partition in flash.
+
+* SWITCHTEC_IOCTL_EVENT_SUMMARY - Read a structure of bitmaps
+  indicating all uncleared events.
+
+* SWITCHTEC_IOCTL_EVENT_CTL - Get the current count, clear and set flags
+  for any event. This ioctl takes in a switchtec_ioctl_event_ctl struct
+  with the event_id, index and flags set (index being the partition or PFF
+  number for non-global events). It returns whether the event has
+  occurred, the number of times and any event specific data. The flags
+  can be used to clear the count or enable and disable actions to
+  happen when the event occurs.
+  By using the SWITCHTEC_IOCTL_EVENT_FLAG_EN_POLL flag,
+  you can set an event to trigger a poll command to return with
+  POLLPRI. In this way, userspace can wait for events to occur.
+
+* SWITCHTEC_IOCTL_PFF_TO_PORT and SWITCHTEC_IOCTL_PORT_TO_PFF convert
+  between PCI Function Framework number (used by the event system)
+  and Switchtec Logic Port ID and Partition number (which is more
+  user friendly).
diff --git a/MAINTAINERS b/MAINTAINERS
index 6fed938..c1a9a30 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9515,6 +9515,7 @@ S:Maintained
 F: Documentation/switchtec.txt
 F: Documentation/ABI/testing/sysfs-class-switchtec
 F: drivers/pci/switch/switchtec*
+F: include/uapi/linux/switchtec_ioctl.h
 
 PCI DRIVER FOR NVIDIA TEGRA
 M: Thierry Reding 
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 2e47d79..94384e7 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -13,6 +13,8 @@
  *
  */
 
+#include 
+
 #include 
 #include 
 #include 
@@ -740,6 +742,417 @@ static unsigned int switchtec_dev_poll(struct file *filp, 
poll_table *wait)
return ret;
 }
 
+static int ioctl_flash_info(struct switchtec_dev *stdev,
+   struct switchtec_ioctl_flash_info __user *uinfo)
+{
+   struct switchtec_ioctl_flash_info info = {0};
+   struct flash_info_regs __iomem *fi = stdev->mmio_flash_info;
+
+   info.flash_length = ioread32(>flash_length);
+   info.num_partitions = SWITCHTEC_IOCTL_NUM_PARTITIONS;
+
+   if (copy_to_user(uinfo, , sizeof(info)))
+   return -EFAULT;
+
+   return 0;
+}
+
+static void set_fw_info_part(struct switchtec_ioctl_flash_part_info *info,
+struct partition_info __iomem *pi)
+{
+   info->address = ioread32(>address);
+   info->length = ioread32(>length);
+}
+
+static int ioctl_flash_part_info(struct switchtec_dev *stdev,
+   struct switchtec_ioctl_flash_part_info __user *uinfo)
+{
+   struct switchtec_ioctl_flash_part_info info = {0};
+   struct flash_info_regs __iomem *fi = stdev->mmio_flash_info;
+   u32 active_addr = -1;
+
+   if (copy_from_user(, uinfo, sizeof(info)))
+   return -EFAULT;
+
+   switch (info.flash_partition) {
+   case SWITCHTEC_IOCTL_PART_CFG0:
+   active_addr = 

[PATCH v5 1/4] MicroSemi Switchtec management interface driver

2017-02-25 Thread Logan Gunthorpe
Microsemi's "Switchtec" line of PCI switch devices is already well
supported by the kernel with standard PCI switch drivers. However, the
Switchtec device advertises a special management endpoint with a separate
PCI function address and class code. This endpoint enables some additional
functionality which includes:

 * Packet and Byte Counters
 * Switch Firmware Upgrades
 * Event and Error logs
 * Querying port link status
 * Custom user firmware commands

This patch introduces the switchtec kernel module which provides
PCI driver that exposes a char device. The char device provides
userspace access to this interface through read, write and (optionally)
poll calls.

A userspace tool and library which utilizes this interface is available
at [1]. This tool takes inspiration (and borrows some code) from
nvme-cli [2]. The tool is largely complete at this time but additional
features may be added in the future.

[1] https://github.com/sbates130272/switchtec-user
[2] https://github.com/linux-nvme/nvme-cli

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
Reviewed-by: Greg Kroah-Hartman 
---
 MAINTAINERS|   8 +
 drivers/pci/Kconfig|   1 +
 drivers/pci/Makefile   |   1 +
 drivers/pci/switch/Kconfig |  13 +
 drivers/pci/switch/Makefile|   1 +
 drivers/pci/switch/switchtec.c | 955 +
 6 files changed, 979 insertions(+)
 create mode 100644 drivers/pci/switch/Kconfig
 create mode 100644 drivers/pci/switch/Makefile
 create mode 100644 drivers/pci/switch/switchtec.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 527d137..a57686f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9506,6 +9506,14 @@ S:   Maintained
 F: Documentation/devicetree/bindings/pci/aardvark-pci.txt
 F: drivers/pci/host/pci-aardvark.c
 
+PCI DRIVER FOR MICROSEMI SWITCHTEC
+M: Kurt Schwemmer 
+M: Stephen Bates 
+M: Logan Gunthorpe 
+L: linux-...@vger.kernel.org
+S: Maintained
+F: drivers/pci/switch/switchtec*
+
 PCI DRIVER FOR NVIDIA TEGRA
 M: Thierry Reding 
 L: linux-te...@vger.kernel.org
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 6555eb7..f72e8c5 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -133,3 +133,4 @@ config PCI_HYPERV
 
 source "drivers/pci/hotplug/Kconfig"
 source "drivers/pci/host/Kconfig"
+source "drivers/pci/switch/Kconfig"
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 8db5079..15b46dd 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -68,3 +68,4 @@ ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
 
 # PCI host controller drivers
 obj-y += host/
+obj-y += switch/
diff --git a/drivers/pci/switch/Kconfig b/drivers/pci/switch/Kconfig
new file mode 100644
index 000..4c49648
--- /dev/null
+++ b/drivers/pci/switch/Kconfig
@@ -0,0 +1,13 @@
+menu "PCI switch controller drivers"
+   depends on PCI
+
+config PCI_SW_SWITCHTEC
+   tristate "MicroSemi Switchtec PCIe Switch Management Driver"
+   help
+Enables support for the management interface for the MicroSemi
+Switchtec series of PCIe switches. Supports userspace access
+to submit MRPC commands to the switch via /dev/switchtecX
+devices. See  for more
+information.
+
+endmenu
diff --git a/drivers/pci/switch/Makefile b/drivers/pci/switch/Makefile
new file mode 100644
index 000..37d8cfb
--- /dev/null
+++ b/drivers/pci/switch/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_PCI_SW_SWITCHTEC) += switchtec.o
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
new file mode 100644
index 000..4aaf89b
--- /dev/null
+++ b/drivers/pci/switch/switchtec.c
@@ -0,0 +1,955 @@
+/*
+ * Microsemi Switchtec(tm) PCIe Management Driver
+ * Copyright (c) 2017, Microsemi Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
+MODULE_VERSION("0.1");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Microsemi Corporation");
+
+static int max_devices = 16;
+module_param(max_devices, int, 0644);
+MODULE_PARM_DESC(max_devices, "max number of switchtec device instances");
+
+static 

[PATCH v5 1/4] MicroSemi Switchtec management interface driver

2017-02-25 Thread Logan Gunthorpe
Microsemi's "Switchtec" line of PCI switch devices is already well
supported by the kernel with standard PCI switch drivers. However, the
Switchtec device advertises a special management endpoint with a separate
PCI function address and class code. This endpoint enables some additional
functionality which includes:

 * Packet and Byte Counters
 * Switch Firmware Upgrades
 * Event and Error logs
 * Querying port link status
 * Custom user firmware commands

This patch introduces the switchtec kernel module which provides
PCI driver that exposes a char device. The char device provides
userspace access to this interface through read, write and (optionally)
poll calls.

A userspace tool and library which utilizes this interface is available
at [1]. This tool takes inspiration (and borrows some code) from
nvme-cli [2]. The tool is largely complete at this time but additional
features may be added in the future.

[1] https://github.com/sbates130272/switchtec-user
[2] https://github.com/linux-nvme/nvme-cli

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
Reviewed-by: Greg Kroah-Hartman 
---
 MAINTAINERS|   8 +
 drivers/pci/Kconfig|   1 +
 drivers/pci/Makefile   |   1 +
 drivers/pci/switch/Kconfig |  13 +
 drivers/pci/switch/Makefile|   1 +
 drivers/pci/switch/switchtec.c | 955 +
 6 files changed, 979 insertions(+)
 create mode 100644 drivers/pci/switch/Kconfig
 create mode 100644 drivers/pci/switch/Makefile
 create mode 100644 drivers/pci/switch/switchtec.c

diff --git a/MAINTAINERS b/MAINTAINERS
index 527d137..a57686f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9506,6 +9506,14 @@ S:   Maintained
 F: Documentation/devicetree/bindings/pci/aardvark-pci.txt
 F: drivers/pci/host/pci-aardvark.c
 
+PCI DRIVER FOR MICROSEMI SWITCHTEC
+M: Kurt Schwemmer 
+M: Stephen Bates 
+M: Logan Gunthorpe 
+L: linux-...@vger.kernel.org
+S: Maintained
+F: drivers/pci/switch/switchtec*
+
 PCI DRIVER FOR NVIDIA TEGRA
 M: Thierry Reding 
 L: linux-te...@vger.kernel.org
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 6555eb7..f72e8c5 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -133,3 +133,4 @@ config PCI_HYPERV
 
 source "drivers/pci/hotplug/Kconfig"
 source "drivers/pci/host/Kconfig"
+source "drivers/pci/switch/Kconfig"
diff --git a/drivers/pci/Makefile b/drivers/pci/Makefile
index 8db5079..15b46dd 100644
--- a/drivers/pci/Makefile
+++ b/drivers/pci/Makefile
@@ -68,3 +68,4 @@ ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
 
 # PCI host controller drivers
 obj-y += host/
+obj-y += switch/
diff --git a/drivers/pci/switch/Kconfig b/drivers/pci/switch/Kconfig
new file mode 100644
index 000..4c49648
--- /dev/null
+++ b/drivers/pci/switch/Kconfig
@@ -0,0 +1,13 @@
+menu "PCI switch controller drivers"
+   depends on PCI
+
+config PCI_SW_SWITCHTEC
+   tristate "MicroSemi Switchtec PCIe Switch Management Driver"
+   help
+Enables support for the management interface for the MicroSemi
+Switchtec series of PCIe switches. Supports userspace access
+to submit MRPC commands to the switch via /dev/switchtecX
+devices. See  for more
+information.
+
+endmenu
diff --git a/drivers/pci/switch/Makefile b/drivers/pci/switch/Makefile
new file mode 100644
index 000..37d8cfb
--- /dev/null
+++ b/drivers/pci/switch/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_PCI_SW_SWITCHTEC) += switchtec.o
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
new file mode 100644
index 000..4aaf89b
--- /dev/null
+++ b/drivers/pci/switch/switchtec.c
@@ -0,0 +1,955 @@
+/*
+ * Microsemi Switchtec(tm) PCIe Management Driver
+ * Copyright (c) 2017, Microsemi Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
+MODULE_VERSION("0.1");
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Microsemi Corporation");
+
+static int max_devices = 16;
+module_param(max_devices, int, 0644);
+MODULE_PARM_DESC(max_devices, "max number of switchtec device instances");
+
+static dev_t switchtec_devt;
+static struct class *switchtec_class;
+static DEFINE_IDA(switchtec_minor_ida);
+
+#define MICROSEMI_VENDOR_ID 0x11f8
+#define MICROSEMI_NTB_CLASSCODE 0x068000
+#define MICROSEMI_MGMT_CLASSCODE

[PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-02-25 Thread Logan Gunthorpe
Changes since v4:

* Turns out pushing the pci release code into the device release
  function didn't work as I would have liked. If you try to unbind the
  device with an instance open, then you hit a kernel bug at
  drivers/pci/msi.c:371. (This didn't occur in v3.)

  To solve this, we've moved the pci release code back into the
  unregister function and reintroduced an alive flag. This time,
  however, the alive flag is protected by mrpc_mutex and we're very
  careful about what happens to devices still in use (they should
  all be released through the timeout path and an ENODEV error
  returned to userspace; while new commands are blocked with the
  same error).

Changes since v3:

* Removed stdev_is_alive and moved pci deinit functions
  into the device release function which only occurs after all
  cdev instances are closed. (per Bjorn)
* Reduced locking in read/write functions (per Bjorn)
* Use pci_alloc_irq_vectors to vastly improve ISR initialization (Bjorn)
* A few other minor nits and cleanup as noticed by Bjorn

Changes since v2:

* Collected reviewed and tested tags
* Very minor fix to the error path in the create function

Changes since v1:

* Rebased onto 4.10-rc6 (cleanly)
* Split the patch into a few more easily digestible patches (as
  suggested by Greg Kroah-Hartman)
* Folded switchtec.c into switchtec.h (per Greg)
* Fixed a bunch of 32bit build warnings caught by the kbuild test robot
* Fixed some issues in the documentation so it has a proper
  reStructredText format (as noted by Jonathan Corbet)
* Fixed padding and sizes in the IOCTL structures as noticed by Emil
  Velikov and used pahole to verify their consistency across 32 and 64
  bit builds
* Reworked one of the IOCTL interfaces to be more future proof (per
  Emil).

Changes since RFC:

* Fixed incorrect use of the drive model as pointed out by Greg
  Kroah-Hartman
* Used devm functions as suggested by Keith Busch
* Added a handful of sysfs attributes to the switchtec class
* Added a handful of IOCTLs to the switchtec device
* A number of miscellaneous bug fixes

--

Hi,

This is a continuation of the RFC we posted lasted month [1] which
proposes a management driver for Microsemi's Switchtec line of PCI
switches. This hardware is still looking to be used in the Open
Compute Platform

To make this entirely clear: the Switchtec products are compliant
with the PCI specifications and are supported today with the standard
in-kernel driver. However, these devices also expose a management endpoint
on a separate PCI function address which can be used to perform some
advanced operations. This is a driver for that function. See the patch
for more information.

Since the RFC, we've made the changes requested by Greg Kroah-Hartman
and Keith Busch, and we've also fleshed out a number of features. We've
added a couple of IOCTLs and sysfs attributes which are documented in
the patch. Significant work has also been done on the userspace tool
which is available under a GPL license at [2]. We've also had testing
done by some of the interested parties.

We hope to see this work included in either 4.11 or 4.12 assuming a
smooth review process.

The patch is based off of the v4.10-rc6 release.

Thanks for your review,

Logan

[1] https://www.spinics.net/lists/linux-pci/msg56897.html
[2] https://github.com/sbates130272/switchtec-user

Logan Gunthorpe (4):
  MicroSemi Switchtec management interface driver
  switchtec: Add user interface documentation
  switchtec: Add sysfs attributes to the Switchtec driver
  switchtec: Add IOCTLs to the Switchtec driver

 Documentation/ABI/testing/sysfs-class-switchtec |   96 ++
 Documentation/ioctl/ioctl-number.txt|1 +
 Documentation/switchtec.txt |   80 ++
 MAINTAINERS |   11 +
 drivers/pci/Kconfig |1 +
 drivers/pci/Makefile|1 +
 drivers/pci/switch/Kconfig  |   13 +
 drivers/pci/switch/Makefile |1 +
 drivers/pci/switch/switchtec.c  | 1535 +++
 include/uapi/linux/switchtec_ioctl.h|  132 ++
 10 files changed, 1871 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-switchtec
 create mode 100644 Documentation/switchtec.txt
 create mode 100644 drivers/pci/switch/Kconfig
 create mode 100644 drivers/pci/switch/Makefile
 create mode 100644 drivers/pci/switch/switchtec.c
 create mode 100644 include/uapi/linux/switchtec_ioctl.h

--
2.1.4


[PATCH v4 6/6] staging: ks7010: fix coding style issue of aligning comments properly

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of having block comments using a
trailing */ on a separate line, warning as issued by checkpatch

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog
 - updated subject to include driver name

 drivers/staging/ks7010/ks_wlan.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 79737bf..1a63704 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -359,7 +359,8 @@ struct wpa_key_t {
u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE];  /* LSB first */
struct sockaddr addr;   /* ff:ff:ff:ff:ff:ff for broadcast/multicast
 * (group) keys or unicast address for
-* individual keys */
+* individual keys
+*/
u16 alg;
u16 key_len;/* WEP: 5 or 13, TKIP: 32, CCMP: 16 */
u8 key_val[IW_ENCODING_TOKEN_MAX];
-- 
2.7.4



[PATCH v5 0/4] New Microsemi PCI Switch Management Driver

2017-02-25 Thread Logan Gunthorpe
Changes since v4:

* Turns out pushing the pci release code into the device release
  function didn't work as I would have liked. If you try to unbind the
  device with an instance open, then you hit a kernel bug at
  drivers/pci/msi.c:371. (This didn't occur in v3.)

  To solve this, we've moved the pci release code back into the
  unregister function and reintroduced an alive flag. This time,
  however, the alive flag is protected by mrpc_mutex and we're very
  careful about what happens to devices still in use (they should
  all be released through the timeout path and an ENODEV error
  returned to userspace; while new commands are blocked with the
  same error).

Changes since v3:

* Removed stdev_is_alive and moved pci deinit functions
  into the device release function which only occurs after all
  cdev instances are closed. (per Bjorn)
* Reduced locking in read/write functions (per Bjorn)
* Use pci_alloc_irq_vectors to vastly improve ISR initialization (Bjorn)
* A few other minor nits and cleanup as noticed by Bjorn

Changes since v2:

* Collected reviewed and tested tags
* Very minor fix to the error path in the create function

Changes since v1:

* Rebased onto 4.10-rc6 (cleanly)
* Split the patch into a few more easily digestible patches (as
  suggested by Greg Kroah-Hartman)
* Folded switchtec.c into switchtec.h (per Greg)
* Fixed a bunch of 32bit build warnings caught by the kbuild test robot
* Fixed some issues in the documentation so it has a proper
  reStructredText format (as noted by Jonathan Corbet)
* Fixed padding and sizes in the IOCTL structures as noticed by Emil
  Velikov and used pahole to verify their consistency across 32 and 64
  bit builds
* Reworked one of the IOCTL interfaces to be more future proof (per
  Emil).

Changes since RFC:

* Fixed incorrect use of the drive model as pointed out by Greg
  Kroah-Hartman
* Used devm functions as suggested by Keith Busch
* Added a handful of sysfs attributes to the switchtec class
* Added a handful of IOCTLs to the switchtec device
* A number of miscellaneous bug fixes

--

Hi,

This is a continuation of the RFC we posted lasted month [1] which
proposes a management driver for Microsemi's Switchtec line of PCI
switches. This hardware is still looking to be used in the Open
Compute Platform

To make this entirely clear: the Switchtec products are compliant
with the PCI specifications and are supported today with the standard
in-kernel driver. However, these devices also expose a management endpoint
on a separate PCI function address which can be used to perform some
advanced operations. This is a driver for that function. See the patch
for more information.

Since the RFC, we've made the changes requested by Greg Kroah-Hartman
and Keith Busch, and we've also fleshed out a number of features. We've
added a couple of IOCTLs and sysfs attributes which are documented in
the patch. Significant work has also been done on the userspace tool
which is available under a GPL license at [2]. We've also had testing
done by some of the interested parties.

We hope to see this work included in either 4.11 or 4.12 assuming a
smooth review process.

The patch is based off of the v4.10-rc6 release.

Thanks for your review,

Logan

[1] https://www.spinics.net/lists/linux-pci/msg56897.html
[2] https://github.com/sbates130272/switchtec-user

Logan Gunthorpe (4):
  MicroSemi Switchtec management interface driver
  switchtec: Add user interface documentation
  switchtec: Add sysfs attributes to the Switchtec driver
  switchtec: Add IOCTLs to the Switchtec driver

 Documentation/ABI/testing/sysfs-class-switchtec |   96 ++
 Documentation/ioctl/ioctl-number.txt|1 +
 Documentation/switchtec.txt |   80 ++
 MAINTAINERS |   11 +
 drivers/pci/Kconfig |1 +
 drivers/pci/Makefile|1 +
 drivers/pci/switch/Kconfig  |   13 +
 drivers/pci/switch/Makefile |1 +
 drivers/pci/switch/switchtec.c  | 1535 +++
 include/uapi/linux/switchtec_ioctl.h|  132 ++
 10 files changed, 1871 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-switchtec
 create mode 100644 Documentation/switchtec.txt
 create mode 100644 drivers/pci/switch/Kconfig
 create mode 100644 drivers/pci/switch/Makefile
 create mode 100644 drivers/pci/switch/switchtec.c
 create mode 100644 include/uapi/linux/switchtec_ioctl.h

--
2.1.4


[PATCH v4 6/6] staging: ks7010: fix coding style issue of aligning comments properly

2017-02-25 Thread Chetan Sethi
This patch fixes coding style issue of having block comments using a
trailing */ on a separate line, warning as issued by checkpatch

Signed-off-by: Chetan Sethi 
---
v2:
 - split multiple changes across different patches
v3:
 - mentioned patch revision in subject
v4:
 - modified description to exclude mention of patch number from changelog
 - updated subject to include driver name

 drivers/staging/ks7010/ks_wlan.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index 79737bf..1a63704 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -359,7 +359,8 @@ struct wpa_key_t {
u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE];  /* LSB first */
struct sockaddr addr;   /* ff:ff:ff:ff:ff:ff for broadcast/multicast
 * (group) keys or unicast address for
-* individual keys */
+* individual keys
+*/
u16 alg;
u16 key_len;/* WEP: 5 or 13, TKIP: 32, CCMP: 16 */
u8 key_val[IW_ENCODING_TOKEN_MAX];
-- 
2.7.4



[PATCH v5 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-25 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide
some device information that is exposed from the devices. Primarily
component and device names and versions. These are documented in
Documentation/ABI/testing/sysfs-class-switchtec.

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
Reviewed-by: Greg Kroah-Hartman 
---
 Documentation/ABI/testing/sysfs-class-switchtec |  96 
 MAINTAINERS |   1 +
 drivers/pci/switch/switchtec.c  | 113 
 3 files changed, 210 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-switchtec

diff --git a/Documentation/ABI/testing/sysfs-class-switchtec 
b/Documentation/ABI/testing/sysfs-class-switchtec
new file mode 100644
index 000..48cb4c1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-switchtec
@@ -0,0 +1,96 @@
+switchtec - Microsemi Switchtec PCI Switch Management Endpoint
+
+For details on this subsystem look at Documentation/switchtec.txt.
+
+What:  /sys/class/switchtec
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   The switchtec class subsystem folder.
+   Each registered switchtec driver is represented by a switchtecX
+   subfolder (X being an integer >= 0).
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/component_id
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Component identifier as stored in the hardware (eg. PM8543)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/component_revision
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Component revision stored in the hardware (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/component_vendor
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Component vendor as stored in the hardware (eg. MICROSEM)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/device_version
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Device version as stored in the hardware (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/fw_version
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Currently running firmware version (read only)
+Values:integer (in hexadecimal).
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/partition
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Partition number for this device in the switch (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/partition_count
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Total number of partitions in the switch (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/product_id
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Product identifier as stored in the hardware (eg. PSX 48XG3)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/product_revision
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Product revision stored in the hardware (eg. RevB)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/product_vendor
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Product vendor as stored in the hardware (eg. MICROSEM)
+   (read only)
+Values:arbitrary string.
diff --git a/MAINTAINERS b/MAINTAINERS
index aa702b0..6fed938 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9513,6 +9513,7 @@ M:Logan Gunthorpe 
 L: linux-...@vger.kernel.org
 S: Maintained
 F: Documentation/switchtec.txt
+F: Documentation/ABI/testing/sysfs-class-switchtec
 F: drivers/pci/switch/switchtec*
 
 PCI DRIVER FOR NVIDIA TEGRA
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 4aaf89b..2e47d79 100644
--- 

[PATCH v5 3/4] switchtec: Add sysfs attributes to the Switchtec driver

2017-02-25 Thread Logan Gunthorpe
This patch adds a few read-only sysfs attributes which provide
some device information that is exposed from the devices. Primarily
component and device names and versions. These are documented in
Documentation/ABI/testing/sysfs-class-switchtec.

Signed-off-by: Logan Gunthorpe 
Signed-off-by: Stephen Bates 
Tested-by: Krishna Dhulipala 
Reviewed-by: Wei Zhang 
Reviewed-by: Jens Axboe 
Reviewed-by: Greg Kroah-Hartman 
---
 Documentation/ABI/testing/sysfs-class-switchtec |  96 
 MAINTAINERS |   1 +
 drivers/pci/switch/switchtec.c  | 113 
 3 files changed, 210 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-class-switchtec

diff --git a/Documentation/ABI/testing/sysfs-class-switchtec 
b/Documentation/ABI/testing/sysfs-class-switchtec
new file mode 100644
index 000..48cb4c1
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-class-switchtec
@@ -0,0 +1,96 @@
+switchtec - Microsemi Switchtec PCI Switch Management Endpoint
+
+For details on this subsystem look at Documentation/switchtec.txt.
+
+What:  /sys/class/switchtec
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   The switchtec class subsystem folder.
+   Each registered switchtec driver is represented by a switchtecX
+   subfolder (X being an integer >= 0).
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/component_id
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Component identifier as stored in the hardware (eg. PM8543)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/component_revision
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Component revision stored in the hardware (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/component_vendor
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Component vendor as stored in the hardware (eg. MICROSEM)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/device_version
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Device version as stored in the hardware (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/fw_version
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Currently running firmware version (read only)
+Values:integer (in hexadecimal).
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/partition
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Partition number for this device in the switch (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/partition_count
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Total number of partitions in the switch (read only)
+Values:integer.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/product_id
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Product identifier as stored in the hardware (eg. PSX 48XG3)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/product_revision
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Product revision stored in the hardware (eg. RevB)
+   (read only)
+Values:arbitrary string.
+
+
+What:  /sys/class/switchtec/switchtec[0-9]+/product_vendor
+Date:  05-Jan-2017
+KernelVersion: v4.11
+Contact:   Logan Gunthorpe 
+Description:   Product vendor as stored in the hardware (eg. MICROSEM)
+   (read only)
+Values:arbitrary string.
diff --git a/MAINTAINERS b/MAINTAINERS
index aa702b0..6fed938 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -9513,6 +9513,7 @@ M:Logan Gunthorpe 
 L: linux-...@vger.kernel.org
 S: Maintained
 F: Documentation/switchtec.txt
+F: Documentation/ABI/testing/sysfs-class-switchtec
 F: drivers/pci/switch/switchtec*
 
 PCI DRIVER FOR NVIDIA TEGRA
diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
index 4aaf89b..2e47d79 100644
--- a/drivers/pci/switch/switchtec.c
+++ b/drivers/pci/switch/switchtec.c
@@ -495,6 +495,118 @@ static void mrpc_timeout_work(struct work_struct *work)
mutex_unlock(>mrpc_mutex);
 }
 
+static ssize_t device_version_show(struct device *dev,
+   struct device_attribute *attr, char *buf)
+{
+   struct switchtec_dev *stdev = to_stdev(dev);
+   u32 ver;
+
+   ver = 

Re: [RFC PATCH 1/2] mm, vmscan: account the number of isolated pages per zone

2017-02-25 Thread Tetsuo Handa
Michal Hocko wrote:
> On Wed 22-02-17 11:02:21, Tetsuo Handa wrote:
> > Michal Hocko wrote:
> > > On Tue 21-02-17 23:35:07, Tetsuo Handa wrote:
> > > > Michal Hocko wrote:
> > > > > OK, so it seems that all the distractions are handled now and 
> > > > > linux-next
> > > > > should provide a reasonable base for testing. You said you weren't 
> > > > > able
> > > > > to reproduce the original long stalls on too_many_isolated(). I would 
> > > > > be
> > > > > still interested to see those oom reports and potential anomalies in 
> > > > > the
> > > > > isolated counts before I send the patch for inclusion so your further
> > > > > testing would be more than appreciated. Also stalls > 10s without any
> > > > > previous occurrences would be interesting.
> > > > 
> > > > I confirmed that linux-next-20170221 with kmallocwd applied can 
> > > > reproduce
> > > > infinite too_many_isolated() loop problem. Please send your patches to 
> > > > linux-next.
> > > 
> > > So I assume that you didn't see the lockup with the patch applied and
> > > the OOM killer has resolved the situation by killing other tasks, right?
> > > Can I assume your Tested-by?
> > 
> > No. I tested linux-next-20170221 which does not include your patch.
> > I didn't test linux-next-20170221 with your patch applied. Your patch will
> > avoid infinite too_many_isolated() loop problem in shrink_inactive_list().
> > But we need to test different workloads by other people. Thus, I suggest
> > you to send your patches to linux-next without my testing.
> 
> I will send the patch to Andrew later after merge window closes. It
> would be really helpful, though, to see how it handles your workload
> which is known to reproduce the oom starvation.

I tested http://lkml.kernel.org/r/20170119112336.gn30...@dhcp22.suse.cz
on top of linux-next-20170221 with kmallocwd applied.

I did not hit too_many_isolated() loop problem. But I hit an "unable to invoke
the OOM killer due to !__GFP_FS allocation" lockup problem shown below.

Complete log is at http://I-love.SAKURA.ne.jp/tmp/serial-20170226.txt.xz .
--
[  444.281177] Killed process 9477 (a.out) total-vm:4168kB, anon-rss:84kB, 
file-rss:0kB, shmem-rss:0kB
[  444.287046] oom_reaper: reaped process 9477 (a.out), now anon-rss:0kB, 
file-rss:0kB, shmem-rss:0kB
[  484.810225] BUG: workqueue lockup - pool cpus=1 node=0 flags=0x0 nice=0 
stuck for 38s!
[  484.812907] BUG: workqueue lockup - pool cpus=2 node=0 flags=0x0 nice=0 
stuck for 41s!
[  484.815546] Showing busy workqueues and worker pools:
[  484.817595] workqueue events: flags=0x0
[  484.819456]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=3/256
[  484.821666] pending: vmpressure_work_fn, vmstat_shepherd, 
vmw_fb_dirty_flush [vmwgfx]
[  484.824356]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=2/256
[  484.826582] pending: drain_local_pages_wq BAR(9595), e1000_watchdog 
[e1000]
[  484.829091]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=2/256
[  484.831325] in-flight: 7418:rht_deferred_worker
[  484.86] pending: rht_deferred_worker
[  484.835346] workqueue events_long: flags=0x0
[  484.837343]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=1/256
[  484.839566] pending: gc_worker [nf_conntrack]
[  484.841691] workqueue events_power_efficient: flags=0x80
[  484.843873]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=1/256
[  484.846103] pending: fb_flashcursor
[  484.847928]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=2/256
[  484.850149] pending: neigh_periodic_work, neigh_periodic_work
[  484.852403] workqueue events_freezable_power_: flags=0x84
[  484.854534]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256
[  484.85] in-flight: 27:disk_events_workfn
[  484.858621] workqueue writeback: flags=0x4e
[  484.860347]   pwq 256: cpus=0-127 flags=0x4 nice=0 active=2/256
[  484.862415] in-flight: 8444:wb_workfn wb_workfn
[  484.864602] workqueue vmstat: flags=0xc
[  484.866291]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256
[  484.868307] pending: vmstat_update
[  484.869876]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/256
[  484.871864] pending: vmstat_update
[  484.874058] workqueue mpt_poll_0: flags=0x8
[  484.875698]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256
[  484.877602] pending: mpt_fault_reset_work [mptbase]
[  484.879502] workqueue xfs-buf/sda1: flags=0xc
[  484.881148]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/1
[  484.883011] pending: xfs_buf_ioend_work [xfs]
[  484.884706] workqueue xfs-data/sda1: flags=0xc
[  484.886367]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=27/256 MAYDAY
[  484.888410] in-flight: 5356:xfs_end_io [xfs], 451(RESCUER):xfs_end_io 
[xfs] xfs_end_io [xfs] xfs_end_io [xfs] xfs_end_io [xfs] xfs_end_io [xfs], 
10498:xfs_end_io [xfs], 6386:xfs_end_io [xfs]
[  484.893483] pending: xfs_end_io [xfs], xfs_end_io [xfs], xfs_end_io 
[xfs], xfs_end_io [xfs], xfs_end_io [xfs], xfs_end_io [xfs], xfs_end_io [xfs], 
xfs_end_io [xfs], 

[locking/ww_mutex] f2a5fec173: BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 59s!

2017-02-25 Thread kernel test robot
Greetings,

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

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

commit f2a5fec17395f259d54daa8833d81b00cceb15c3
Author: Chris Wilson <ch...@chris-wilson.co.uk>
AuthorDate: Thu Dec 1 11:47:06 2016 +
Commit: Ingo Molnar <mi...@kernel.org>
CommitDate: Sat Jan 14 11:37:14 2017 +0100

locking/ww_mutex: Begin kselftests for ww_mutex

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
Signed-off-by: Peter Zijlstra (Intel) <pet...@infradead.org>
Cc: Andrew Morton <a...@linux-foundation.org>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Maarten Lankhorst <d...@mblankhorst.nl>
Cc: Nicolai Hähnle <nhaeh...@gmail.com>
Cc: Paul E. McKenney <paul...@linux.vnet.ibm.com>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Link: 
http://lkml.kernel.org/r/20161201114711.28697-4-ch...@chris-wilson.co.uk
Signed-off-by: Ingo Molnar <mi...@kernel.org>

0186a6cbdc  locking/ww_mutex: Add ww_mutex to locktorture test
f2a5fec173  locking/ww_mutex: Begin kselftests for ww_mutex
+---+++
|   | 0186a6cbdc | f2a5fec173 |
+---+++
| boot_successes| 120| 0  |
| boot_failures | 0  | 112|
| BUG:workqueue_lockup-pool | 0  | 97 |
| BUG:kernel_hang_in_boot_stage | 0  | 15 |
+---+++

[3.036274] PCI: CLS 0 bytes, default 64
[3.038041] Unpacking initramfs...
[3.058066] workqueue: round-robin CPU selection forced, expect performance 
impact
[3.149167] debug: unmapping init [mem 0xcfc9d000-0xcffc]
[3.152572] cryptomgr_test (23) used greatest stack depth: 7652 bytes left
[   63.606059] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 
stuck for 59s!
[   63.610183] Showing busy workqueues and worker pools:
[   63.611720] workqueue events: flags=0x0
[   63.613064]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256
[   63.614743] in-flight: 22:test_mutex_work
[   63.616153] pending: tsc_refine_calibration_work

git bisect start e7a9cdaf617bb866348b56c41806f9405df24e38 
c470abd4fde40ea6a0846a2beab642a578c0b8cd --
git bisect  bad c6ab4540dc999ad60e5f4e20d29b8039fb093b30  # 00:57  0-  
7  Merge 'dax/fd-alloc' into devel-spot-201702251707
git bisect good bd66678f66ab6a7aab38d8d8e7bd82086300ad2f  # 01:12 20+  
0  Merge 'chanwoo-extcon/extcon-next' into devel-spot-201702251707
git bisect  bad 57efc9635834ab4a24fa94ed200b32585d67b175  # 01:26  0-  
7  Merge 'jlayton/ceph-4.11' into devel-spot-201702251707
git bisect good d0ca01d183ec3766f03c1ffe66921ce0f43b8d50  # 01:45 20+  
2  Merge 
'linux-review/Bjorn-Andersson/arm64-dts-msm8996-Add-modem-and-slpi-smp2p-nodes/20170225-083258'
 into devel-spot-201702251707
git bisect  bad 229797d6c89ad2304c27c1d355d7684f20097fa3  # 02:09  0- 
10  Merge 
'linux-review/Eric-Biggers/crypto-constify-test-vectors/20170225-075240' into 
devel-spot-201702251707
git bisect  bad eb4085c137f82fa834cceb1d8e5f4b1264fbd297  # 02:22  0- 
13  Merge 
'linux-review/Niklas-Cassel/locking-rwsem-fix-down_write_killable-for-CONFIG_RWSEM_GENERIC_SPINLOCK/20170225-082246'
 into devel-spot-201702251707
git bisect  bad f2a5fec17395f259d54daa8833d81b00cceb15c3  # 02:31  0-  
6  locking/ww_mutex: Begin kselftests for ww_mutex
git bisect good 3822da3ed0676e01f83fe0518c333c8e9ba249bf  # 02:53 20+  
0  locking/ww_mutex: Extract stamp comparison to __ww_mutex_stamp_after()
git bisect good 427b18207a87f6306bd53a74e03dbe17392b0045  # 03:23 20+  
0  locking/mutex: Improve inlining
git bisect good 977625a693283dbb35b2a3f674bc0237f7347348  # 11:46 22+  
1  locking/mutex: Initialize mutex_waiter::ww_ctx with poison when debugging
git bisect good 0186a6cbdc6287fde65858e5d9c714dc167b8ace  # 12:45 20+  
0  locking/ww_mutex: Add ww_mutex to locktorture test
# first bad commit: [f2a5fec17395f259d54daa8833d81b00cceb15c3] 
locking/ww_mutex: Begin kselftests for ww_mutex
git bisect good 0186a6cbdc6287fde65858e5d9c714dc167b8ace  # 14:12 60+  
0  locking/ww_mutex: Add ww_mutex to locktorture test
# extra tests on HEAD of linux-devel/devel-spot-201702251707
git bisect  bad e7a9cdaf617bb866348b56c41806f9405df24e38  # 14:13  0- 
45  0day head guard for 'devel-spot-201702251707'
# extra tests on tree/branch linus/master
git bisect  bad c4f3f22eddc982d247ffe2a6690c3e4a5c46dd09  # 14:31  0-  
1  Merge tag 'linux-kselftest-4.11-rc1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
# extra tests on tree/branch linux-next/master
git bisect  bad 3e73

Re: [RFC PATCH 1/2] mm, vmscan: account the number of isolated pages per zone

2017-02-25 Thread Tetsuo Handa
Michal Hocko wrote:
> On Wed 22-02-17 11:02:21, Tetsuo Handa wrote:
> > Michal Hocko wrote:
> > > On Tue 21-02-17 23:35:07, Tetsuo Handa wrote:
> > > > Michal Hocko wrote:
> > > > > OK, so it seems that all the distractions are handled now and 
> > > > > linux-next
> > > > > should provide a reasonable base for testing. You said you weren't 
> > > > > able
> > > > > to reproduce the original long stalls on too_many_isolated(). I would 
> > > > > be
> > > > > still interested to see those oom reports and potential anomalies in 
> > > > > the
> > > > > isolated counts before I send the patch for inclusion so your further
> > > > > testing would be more than appreciated. Also stalls > 10s without any
> > > > > previous occurrences would be interesting.
> > > > 
> > > > I confirmed that linux-next-20170221 with kmallocwd applied can 
> > > > reproduce
> > > > infinite too_many_isolated() loop problem. Please send your patches to 
> > > > linux-next.
> > > 
> > > So I assume that you didn't see the lockup with the patch applied and
> > > the OOM killer has resolved the situation by killing other tasks, right?
> > > Can I assume your Tested-by?
> > 
> > No. I tested linux-next-20170221 which does not include your patch.
> > I didn't test linux-next-20170221 with your patch applied. Your patch will
> > avoid infinite too_many_isolated() loop problem in shrink_inactive_list().
> > But we need to test different workloads by other people. Thus, I suggest
> > you to send your patches to linux-next without my testing.
> 
> I will send the patch to Andrew later after merge window closes. It
> would be really helpful, though, to see how it handles your workload
> which is known to reproduce the oom starvation.

I tested http://lkml.kernel.org/r/20170119112336.gn30...@dhcp22.suse.cz
on top of linux-next-20170221 with kmallocwd applied.

I did not hit too_many_isolated() loop problem. But I hit an "unable to invoke
the OOM killer due to !__GFP_FS allocation" lockup problem shown below.

Complete log is at http://I-love.SAKURA.ne.jp/tmp/serial-20170226.txt.xz .
--
[  444.281177] Killed process 9477 (a.out) total-vm:4168kB, anon-rss:84kB, 
file-rss:0kB, shmem-rss:0kB
[  444.287046] oom_reaper: reaped process 9477 (a.out), now anon-rss:0kB, 
file-rss:0kB, shmem-rss:0kB
[  484.810225] BUG: workqueue lockup - pool cpus=1 node=0 flags=0x0 nice=0 
stuck for 38s!
[  484.812907] BUG: workqueue lockup - pool cpus=2 node=0 flags=0x0 nice=0 
stuck for 41s!
[  484.815546] Showing busy workqueues and worker pools:
[  484.817595] workqueue events: flags=0x0
[  484.819456]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=3/256
[  484.821666] pending: vmpressure_work_fn, vmstat_shepherd, 
vmw_fb_dirty_flush [vmwgfx]
[  484.824356]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=2/256
[  484.826582] pending: drain_local_pages_wq BAR(9595), e1000_watchdog 
[e1000]
[  484.829091]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=2/256
[  484.831325] in-flight: 7418:rht_deferred_worker
[  484.86] pending: rht_deferred_worker
[  484.835346] workqueue events_long: flags=0x0
[  484.837343]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=1/256
[  484.839566] pending: gc_worker [nf_conntrack]
[  484.841691] workqueue events_power_efficient: flags=0x80
[  484.843873]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=1/256
[  484.846103] pending: fb_flashcursor
[  484.847928]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=2/256
[  484.850149] pending: neigh_periodic_work, neigh_periodic_work
[  484.852403] workqueue events_freezable_power_: flags=0x84
[  484.854534]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256
[  484.85] in-flight: 27:disk_events_workfn
[  484.858621] workqueue writeback: flags=0x4e
[  484.860347]   pwq 256: cpus=0-127 flags=0x4 nice=0 active=2/256
[  484.862415] in-flight: 8444:wb_workfn wb_workfn
[  484.864602] workqueue vmstat: flags=0xc
[  484.866291]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256
[  484.868307] pending: vmstat_update
[  484.869876]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/256
[  484.871864] pending: vmstat_update
[  484.874058] workqueue mpt_poll_0: flags=0x8
[  484.875698]   pwq 4: cpus=2 node=0 flags=0x0 nice=0 active=1/256
[  484.877602] pending: mpt_fault_reset_work [mptbase]
[  484.879502] workqueue xfs-buf/sda1: flags=0xc
[  484.881148]   pwq 2: cpus=1 node=0 flags=0x0 nice=0 active=1/1
[  484.883011] pending: xfs_buf_ioend_work [xfs]
[  484.884706] workqueue xfs-data/sda1: flags=0xc
[  484.886367]   pwq 6: cpus=3 node=0 flags=0x0 nice=0 active=27/256 MAYDAY
[  484.888410] in-flight: 5356:xfs_end_io [xfs], 451(RESCUER):xfs_end_io 
[xfs] xfs_end_io [xfs] xfs_end_io [xfs] xfs_end_io [xfs] xfs_end_io [xfs], 
10498:xfs_end_io [xfs], 6386:xfs_end_io [xfs]
[  484.893483] pending: xfs_end_io [xfs], xfs_end_io [xfs], xfs_end_io 
[xfs], xfs_end_io [xfs], xfs_end_io [xfs], xfs_end_io [xfs], xfs_end_io [xfs], 
xfs_end_io [xfs], 

[locking/ww_mutex] f2a5fec173: BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 stuck for 59s!

2017-02-25 Thread kernel test robot
Greetings,

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

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

commit f2a5fec17395f259d54daa8833d81b00cceb15c3
Author: Chris Wilson 
AuthorDate: Thu Dec 1 11:47:06 2016 +
Commit: Ingo Molnar 
CommitDate: Sat Jan 14 11:37:14 2017 +0100

locking/ww_mutex: Begin kselftests for ww_mutex

Signed-off-by: Chris Wilson 
Signed-off-by: Peter Zijlstra (Intel) 
Cc: Andrew Morton 
Cc: Linus Torvalds 
Cc: Maarten Lankhorst 
Cc: Nicolai Hähnle 
Cc: Paul E. McKenney 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Link: 
http://lkml.kernel.org/r/20161201114711.28697-4-ch...@chris-wilson.co.uk
Signed-off-by: Ingo Molnar 

0186a6cbdc  locking/ww_mutex: Add ww_mutex to locktorture test
f2a5fec173  locking/ww_mutex: Begin kselftests for ww_mutex
+---+++
|   | 0186a6cbdc | f2a5fec173 |
+---+++
| boot_successes| 120| 0  |
| boot_failures | 0  | 112|
| BUG:workqueue_lockup-pool | 0  | 97 |
| BUG:kernel_hang_in_boot_stage | 0  | 15 |
+---+++

[3.036274] PCI: CLS 0 bytes, default 64
[3.038041] Unpacking initramfs...
[3.058066] workqueue: round-robin CPU selection forced, expect performance 
impact
[3.149167] debug: unmapping init [mem 0xcfc9d000-0xcffc]
[3.152572] cryptomgr_test (23) used greatest stack depth: 7652 bytes left
[   63.606059] BUG: workqueue lockup - pool cpus=0 node=0 flags=0x0 nice=0 
stuck for 59s!
[   63.610183] Showing busy workqueues and worker pools:
[   63.611720] workqueue events: flags=0x0
[   63.613064]   pwq 0: cpus=0 node=0 flags=0x0 nice=0 active=2/256
[   63.614743] in-flight: 22:test_mutex_work
[   63.616153] pending: tsc_refine_calibration_work

git bisect start e7a9cdaf617bb866348b56c41806f9405df24e38 
c470abd4fde40ea6a0846a2beab642a578c0b8cd --
git bisect  bad c6ab4540dc999ad60e5f4e20d29b8039fb093b30  # 00:57  0-  
7  Merge 'dax/fd-alloc' into devel-spot-201702251707
git bisect good bd66678f66ab6a7aab38d8d8e7bd82086300ad2f  # 01:12 20+  
0  Merge 'chanwoo-extcon/extcon-next' into devel-spot-201702251707
git bisect  bad 57efc9635834ab4a24fa94ed200b32585d67b175  # 01:26  0-  
7  Merge 'jlayton/ceph-4.11' into devel-spot-201702251707
git bisect good d0ca01d183ec3766f03c1ffe66921ce0f43b8d50  # 01:45 20+  
2  Merge 
'linux-review/Bjorn-Andersson/arm64-dts-msm8996-Add-modem-and-slpi-smp2p-nodes/20170225-083258'
 into devel-spot-201702251707
git bisect  bad 229797d6c89ad2304c27c1d355d7684f20097fa3  # 02:09  0- 
10  Merge 
'linux-review/Eric-Biggers/crypto-constify-test-vectors/20170225-075240' into 
devel-spot-201702251707
git bisect  bad eb4085c137f82fa834cceb1d8e5f4b1264fbd297  # 02:22  0- 
13  Merge 
'linux-review/Niklas-Cassel/locking-rwsem-fix-down_write_killable-for-CONFIG_RWSEM_GENERIC_SPINLOCK/20170225-082246'
 into devel-spot-201702251707
git bisect  bad f2a5fec17395f259d54daa8833d81b00cceb15c3  # 02:31  0-  
6  locking/ww_mutex: Begin kselftests for ww_mutex
git bisect good 3822da3ed0676e01f83fe0518c333c8e9ba249bf  # 02:53 20+  
0  locking/ww_mutex: Extract stamp comparison to __ww_mutex_stamp_after()
git bisect good 427b18207a87f6306bd53a74e03dbe17392b0045  # 03:23 20+  
0  locking/mutex: Improve inlining
git bisect good 977625a693283dbb35b2a3f674bc0237f7347348  # 11:46 22+  
1  locking/mutex: Initialize mutex_waiter::ww_ctx with poison when debugging
git bisect good 0186a6cbdc6287fde65858e5d9c714dc167b8ace  # 12:45 20+  
0  locking/ww_mutex: Add ww_mutex to locktorture test
# first bad commit: [f2a5fec17395f259d54daa8833d81b00cceb15c3] 
locking/ww_mutex: Begin kselftests for ww_mutex
git bisect good 0186a6cbdc6287fde65858e5d9c714dc167b8ace  # 14:12 60+  
0  locking/ww_mutex: Add ww_mutex to locktorture test
# extra tests on HEAD of linux-devel/devel-spot-201702251707
git bisect  bad e7a9cdaf617bb866348b56c41806f9405df24e38  # 14:13  0- 
45  0day head guard for 'devel-spot-201702251707'
# extra tests on tree/branch linus/master
git bisect  bad c4f3f22eddc982d247ffe2a6690c3e4a5c46dd09  # 14:31  0-  
1  Merge tag 'linux-kselftest-4.11-rc1' of 
git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
# extra tests on tree/branch linux-next/master
git bisect  bad 3e7350242c6f3d41d28e03418bd781cc1b7bad5f  # 14:31  0- 
44  Add linux-next specific files for 20170224

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


dmesg-yocto-ivb41-11:20170226050157:i386-randconfig-n0-201708:4.10.0-rc3-00151

Re: [PATCH] scripts: objdiff: Ignore debug info when comparing

2017-02-25 Thread Masahiro Yamada
Hi.

2017-02-17 6:18 GMT+09:00 Stephen Boyd :
> If the kernel is configured to be built with debug symbols, or
> has bug tables, comparing files may not work if line numbers
> change. This makes comparing object files with these options
> harder to do. Let's strip out the debug info and drop the
> __bug_table here so that we don't see false positives. There may
> be other things to drop later, and it may be architecture
> specific, but this works for me with my ARM64 build.
>
> Cc: Masahiro Yamada 
> Cc: Jason Cooper 
> Signed-off-by: Stephen Boyd 


Great!

Reviewed-by: Masahiro Yamada 


BTW, I left Panasonic two years ago,
so the old address yamad...@jp.panasonic.com
is not working any more.

Please drop the "Cc: Masahiro Yamada "
when this patch is applied.


Thanks!



-- 
Best Regards
Masahiro Yamada


Re: [PATCH] scripts: objdiff: Ignore debug info when comparing

2017-02-25 Thread Masahiro Yamada
Hi.

2017-02-17 6:18 GMT+09:00 Stephen Boyd :
> If the kernel is configured to be built with debug symbols, or
> has bug tables, comparing files may not work if line numbers
> change. This makes comparing object files with these options
> harder to do. Let's strip out the debug info and drop the
> __bug_table here so that we don't see false positives. There may
> be other things to drop later, and it may be architecture
> specific, but this works for me with my ARM64 build.
>
> Cc: Masahiro Yamada 
> Cc: Jason Cooper 
> Signed-off-by: Stephen Boyd 


Great!

Reviewed-by: Masahiro Yamada 


BTW, I left Panasonic two years ago,
so the old address yamad...@jp.panasonic.com
is not working any more.

Please drop the "Cc: Masahiro Yamada "
when this patch is applied.


Thanks!



-- 
Best Regards
Masahiro Yamada


Re: [PATCH 3/9] ASoC: sun8i-codec-analog: add support for V3s SoC

2017-02-25 Thread Chen-Yu Tsai
On Sat, Feb 25, 2017 at 8:30 PM, Icenowy Zheng  wrote:
> The V3s SoC features an analog codec with headphone support but without
> mic2 and linein.

It doesn't have MBIAS either. Please split it out as well.

ChenYu

>
> Add support for it.
>
> Signed-off-by: Icenowy Zheng 
> ---
>  Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt | 1 +
>  sound/soc/sunxi/sun8i-codec-analog.c   | 9 +
>  2 files changed, 10 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt 
> b/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
> index 779b735781ba..1b6e7c4e50ab 100644
> --- a/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
> +++ b/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
> @@ -4,6 +4,7 @@ Required properties:
>  - compatible: must be one of the following compatibles:
> - "allwinner,sun8i-a23-codec-analog"
> - "allwinner,sun8i-h3-codec-analog"
> +   - "allwinner,sun8i-v3s-codec-analog"
>
>  Required properties if not a sub-node of the PRCM node:
>  - reg: must contain the registers location and length
> diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
> b/sound/soc/sunxi/sun8i-codec-analog.c
> index 6c17c99c2c8d..6375932177a3 100644
> --- a/sound/soc/sunxi/sun8i-codec-analog.c
> +++ b/sound/soc/sunxi/sun8i-codec-analog.c
> @@ -695,6 +695,11 @@ static const struct sun8i_codec_analog_quirks 
> sun8i_h3_quirks = {
> .has_mic2   = true,
>  };
>
> +static const struct sun8i_codec_analog_quirks sun8i_v3s_quirks = {
> +   .has_headphone  = true,
> +   .has_hmic   = true,
> +};
> +
>  static int sun8i_codec_analog_cmpnt_probe(struct snd_soc_component *cmpnt)
>  {
> struct device *dev = cmpnt->dev;
> @@ -762,6 +767,10 @@ static const struct of_device_id 
> sun8i_codec_analog_of_match[] = {
> .compatible = "allwinner,sun8i-h3-codec-analog",
> .data = _h3_quirks,
> },
> +   {
> +   .compatible = "allwinner,sun8i-v3s-codec-analog",
> +   .data = _v3s_quirks,
> +   },
> {}
>  };
>  MODULE_DEVICE_TABLE(of, sun8i_codec_analog_of_match);
> --
> 2.11.1
>


Re: [PATCH 3/9] ASoC: sun8i-codec-analog: add support for V3s SoC

2017-02-25 Thread Chen-Yu Tsai
On Sat, Feb 25, 2017 at 8:30 PM, Icenowy Zheng  wrote:
> The V3s SoC features an analog codec with headphone support but without
> mic2 and linein.

It doesn't have MBIAS either. Please split it out as well.

ChenYu

>
> Add support for it.
>
> Signed-off-by: Icenowy Zheng 
> ---
>  Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt | 1 +
>  sound/soc/sunxi/sun8i-codec-analog.c   | 9 +
>  2 files changed, 10 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt 
> b/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
> index 779b735781ba..1b6e7c4e50ab 100644
> --- a/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
> +++ b/Documentation/devicetree/bindings/sound/sun8i-codec-analog.txt
> @@ -4,6 +4,7 @@ Required properties:
>  - compatible: must be one of the following compatibles:
> - "allwinner,sun8i-a23-codec-analog"
> - "allwinner,sun8i-h3-codec-analog"
> +   - "allwinner,sun8i-v3s-codec-analog"
>
>  Required properties if not a sub-node of the PRCM node:
>  - reg: must contain the registers location and length
> diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
> b/sound/soc/sunxi/sun8i-codec-analog.c
> index 6c17c99c2c8d..6375932177a3 100644
> --- a/sound/soc/sunxi/sun8i-codec-analog.c
> +++ b/sound/soc/sunxi/sun8i-codec-analog.c
> @@ -695,6 +695,11 @@ static const struct sun8i_codec_analog_quirks 
> sun8i_h3_quirks = {
> .has_mic2   = true,
>  };
>
> +static const struct sun8i_codec_analog_quirks sun8i_v3s_quirks = {
> +   .has_headphone  = true,
> +   .has_hmic   = true,
> +};
> +
>  static int sun8i_codec_analog_cmpnt_probe(struct snd_soc_component *cmpnt)
>  {
> struct device *dev = cmpnt->dev;
> @@ -762,6 +767,10 @@ static const struct of_device_id 
> sun8i_codec_analog_of_match[] = {
> .compatible = "allwinner,sun8i-h3-codec-analog",
> .data = _h3_quirks,
> },
> +   {
> +   .compatible = "allwinner,sun8i-v3s-codec-analog",
> +   .data = _v3s_quirks,
> +   },
> {}
>  };
>  MODULE_DEVICE_TABLE(of, sun8i_codec_analog_of_match);
> --
> 2.11.1
>


Re: [PATCH 2/9] ASoC: sun8i-codec-analog: split out linein and mic2

2017-02-25 Thread Chen-Yu Tsai
On Sat, Feb 25, 2017 at 8:30 PM, Icenowy Zheng  wrote:
> Allwinner V3s SoC features an analog codec without linein and mic2.
>
> Split out them, in order to prepare for the analog codec on V3s.
>
> Signed-off-by: Icenowy Zheng 

Acked-by: Chen-Yu Tsai 

Though it would be better if you did 1 split as 1 patch, with 2 patches
in total.


Re: [PATCH 2/9] ASoC: sun8i-codec-analog: split out linein and mic2

2017-02-25 Thread Chen-Yu Tsai
On Sat, Feb 25, 2017 at 8:30 PM, Icenowy Zheng  wrote:
> Allwinner V3s SoC features an analog codec without linein and mic2.
>
> Split out them, in order to prepare for the analog codec on V3s.
>
> Signed-off-by: Icenowy Zheng 

Acked-by: Chen-Yu Tsai 

Though it would be better if you did 1 split as 1 patch, with 2 patches
in total.


[PATCH] [linux-next] bcache: Remove duplicate inclusion of blkdev.h

2017-02-25 Thread Masanari Iida
This patch remove duplicate inclusion of blkdev.h in util.h.
Confirm compile successfully after remove the line.

Signed-off-by: Masanari Iida 
---
 drivers/md/bcache/util.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index cf2cbc211d83..03af094d0202 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -4,7 +4,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.12.0



[PATCH] [linux-next] bcache: Remove duplicate inclusion of blkdev.h

2017-02-25 Thread Masanari Iida
This patch remove duplicate inclusion of blkdev.h in util.h.
Confirm compile successfully after remove the line.

Signed-off-by: Masanari Iida 
---
 drivers/md/bcache/util.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index cf2cbc211d83..03af094d0202 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -4,7 +4,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
-- 
2.12.0



Recommended notation for OPP to avoid DTC warnings

2017-02-25 Thread Masahiro Yamada
Hi.


Decumentation/devicetree/bindings/opp/opp.txt
takes examples like this:

opp@10 {
opp-hz = /bits/ 64 <10>;
opp-microvolt = <97 975000 985000>;
opp-microamp = <7>;
clock-latency-ns = <30>;
opp-suspend;
};
opp@11 {
opp-hz = /bits/ 64 <11>;
opp-microvolt = <98 100 101>;
opp-microamp = <8>;
clock-latency-ns = <31>;
};
opp@12 {
opp-hz = /bits/ 64 <12>;
opp-microvolt = <1025000>;
clock-latency-ns = <29>;
turbo-mode;
};


If we follow this notation and the device-tree is built with W=1,
DTC warns like follows:


Warning (unit_address_vs_reg): Node /opp_table0/opp@10 has a
unit name, but no reg property


Is there a recommended notation to avoid it?

Maybe, simply omit the "@" ?



-- 
Best Regards
Masahiro Yamada


Recommended notation for OPP to avoid DTC warnings

2017-02-25 Thread Masahiro Yamada
Hi.


Decumentation/devicetree/bindings/opp/opp.txt
takes examples like this:

opp@10 {
opp-hz = /bits/ 64 <10>;
opp-microvolt = <97 975000 985000>;
opp-microamp = <7>;
clock-latency-ns = <30>;
opp-suspend;
};
opp@11 {
opp-hz = /bits/ 64 <11>;
opp-microvolt = <98 100 101>;
opp-microamp = <8>;
clock-latency-ns = <31>;
};
opp@12 {
opp-hz = /bits/ 64 <12>;
opp-microvolt = <1025000>;
clock-latency-ns = <29>;
turbo-mode;
};


If we follow this notation and the device-tree is built with W=1,
DTC warns like follows:


Warning (unit_address_vs_reg): Node /opp_table0/opp@10 has a
unit name, but no reg property


Is there a recommended notation to avoid it?

Maybe, simply omit the "@" ?



-- 
Best Regards
Masahiro Yamada


[PATCH] speakup: synth: Fix checkpatch warning

2017-02-25 Thread Man Choy
Fix following checkpatch warning:

WARNING: line over 80 characters
+>attributes) < 
0)

total: 0 errors, 1 warnings, 485 lines checked
Signed-off-by: Man Choy 
---
 drivers/staging/speakup/synth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index a61c02b..d984312 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -406,8 +406,8 @@ static int do_synth_init(struct spk_synth *in_synth)
speakup_register_var(var);
if (!spk_quiet_boot)
synth_printf("%s found\n", synth->long_name);
-   if (synth->attributes.name && sysfs_create_group(speakup_kobj,
->attributes) < 
0)
+   if (synth->attributes.name &&
+   sysfs_create_group(speakup_kobj, >attributes) < 0)
return -ENOMEM;
synth_flags = synth->flags;
wake_up_interruptible_all(_event);
-- 
2.7.4



[PATCH] speakup: synth: Fix checkpatch warning

2017-02-25 Thread Man Choy
Fix following checkpatch warning:

WARNING: line over 80 characters
+>attributes) < 
0)

total: 0 errors, 1 warnings, 485 lines checked
Signed-off-by: Man Choy 
---
 drivers/staging/speakup/synth.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/speakup/synth.c b/drivers/staging/speakup/synth.c
index a61c02b..d984312 100644
--- a/drivers/staging/speakup/synth.c
+++ b/drivers/staging/speakup/synth.c
@@ -406,8 +406,8 @@ static int do_synth_init(struct spk_synth *in_synth)
speakup_register_var(var);
if (!spk_quiet_boot)
synth_printf("%s found\n", synth->long_name);
-   if (synth->attributes.name && sysfs_create_group(speakup_kobj,
->attributes) < 
0)
+   if (synth->attributes.name &&
+   sysfs_create_group(speakup_kobj, >attributes) < 0)
return -ENOMEM;
synth_flags = synth->flags;
wake_up_interruptible_all(_event);
-- 
2.7.4



[PATCH 0/3] arm,arm64: dts: uniphier: remove skeleton.dtsi inclusion and fix warnings

2017-02-25 Thread Masahiro Yamada
  - The inclusion of skeleton.dtsi is deprecated.
Specify #address-cells and #size-cells explicitly

  - If built with W=1, many warnings are displayed.  Fix them.


Masahiro Yamada (3):
  ARM: dts: uniphier: remove skeleton.dtsi inclusion
  ARM: dts: uniphier: fix no unit name warnings
  arm64: dts: uniphier: fix no unit name warnings

 arch/arm/boot/dts/uniphier-ld4-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-ld4.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-ld6b-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ace.dts | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-pro4-sanji.dts   | 2 +-
 arch/arm/boot/dts/uniphier-pro4.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-pro5.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-pxs2-gentil.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pxs2-vodka.dts   | 2 +-
 arch/arm/boot/dts/uniphier-pxs2.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-sld3-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-sld3.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-sld8-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-sld8.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-support-card.dtsi| 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi| 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi| 2 +-
 20 files changed, 26 insertions(+), 26 deletions(-)

-- 
2.7.4



[PATCH 0/3] arm,arm64: dts: uniphier: remove skeleton.dtsi inclusion and fix warnings

2017-02-25 Thread Masahiro Yamada
  - The inclusion of skeleton.dtsi is deprecated.
Specify #address-cells and #size-cells explicitly

  - If built with W=1, many warnings are displayed.  Fix them.


Masahiro Yamada (3):
  ARM: dts: uniphier: remove skeleton.dtsi inclusion
  ARM: dts: uniphier: fix no unit name warnings
  arm64: dts: uniphier: fix no unit name warnings

 arch/arm/boot/dts/uniphier-ld4-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-ld4.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-ld6b-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ace.dts | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-pro4-sanji.dts   | 2 +-
 arch/arm/boot/dts/uniphier-pro4.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-pro5.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-pxs2-gentil.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pxs2-vodka.dts   | 2 +-
 arch/arm/boot/dts/uniphier-pxs2.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-sld3-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-sld3.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-sld8-ref.dts | 2 +-
 arch/arm/boot/dts/uniphier-sld8.dtsi| 4 ++--
 arch/arm/boot/dts/uniphier-support-card.dtsi| 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi| 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi| 2 +-
 20 files changed, 26 insertions(+), 26 deletions(-)

-- 
2.7.4



[PATCH 1/3] ARM: dts: uniphier: remove skeleton.dtsi inclusion

2017-02-25 Thread Masahiro Yamada
Commit 9c0da3cc61f1 ("ARM: dts: explicitly mark skeleton.dtsi as
deprecated") declared that skeleton.dtsi was deprecated.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/boot/dts/uniphier-ld4.dtsi  | 4 ++--
 arch/arm/boot/dts/uniphier-pro4.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-pro5.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-pxs2.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-sld3.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-sld8.dtsi | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/uniphier-ld4.dtsi 
b/arch/arm/boot/dts/uniphier-ld4.dtsi
index a7c494d..4f5fe15 100644
--- a/arch/arm/boot/dts/uniphier-ld4.dtsi
+++ b/arch/arm/boot/dts/uniphier-ld4.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-ld4";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-pro4.dtsi 
b/arch/arm/boot/dts/uniphier-pro4.dtsi
index e960b09..794a85a 100644
--- a/arch/arm/boot/dts/uniphier-pro4.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro4.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-pro4";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-pro5.dtsi 
b/arch/arm/boot/dts/uniphier-pro5.dtsi
index dbc5e53..df07b55 100644
--- a/arch/arm/boot/dts/uniphier-pro5.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro5.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-pro5";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-pxs2.dtsi 
b/arch/arm/boot/dts/uniphier-pxs2.dtsi
index e9e031d..58c3e2f 100644
--- a/arch/arm/boot/dts/uniphier-pxs2.dtsi
+++ b/arch/arm/boot/dts/uniphier-pxs2.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-pxs2";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-sld3.dtsi 
b/arch/arm/boot/dts/uniphier-sld3.dtsi
index 9fad6bd..01d77ed 100644
--- a/arch/arm/boot/dts/uniphier-sld3.dtsi
+++ b/arch/arm/boot/dts/uniphier-sld3.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-sld3";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-sld8.dtsi 
b/arch/arm/boot/dts/uniphier-sld8.dtsi
index b2c980e..eb06fdc 100644
--- a/arch/arm/boot/dts/uniphier-sld8.dtsi
+++ b/arch/arm/boot/dts/uniphier-sld8.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-sld8";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
-- 
2.7.4



[PATCH 1/3] ARM: dts: uniphier: remove skeleton.dtsi inclusion

2017-02-25 Thread Masahiro Yamada
Commit 9c0da3cc61f1 ("ARM: dts: explicitly mark skeleton.dtsi as
deprecated") declared that skeleton.dtsi was deprecated.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/boot/dts/uniphier-ld4.dtsi  | 4 ++--
 arch/arm/boot/dts/uniphier-pro4.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-pro5.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-pxs2.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-sld3.dtsi | 4 ++--
 arch/arm/boot/dts/uniphier-sld8.dtsi | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/uniphier-ld4.dtsi 
b/arch/arm/boot/dts/uniphier-ld4.dtsi
index a7c494d..4f5fe15 100644
--- a/arch/arm/boot/dts/uniphier-ld4.dtsi
+++ b/arch/arm/boot/dts/uniphier-ld4.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-ld4";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-pro4.dtsi 
b/arch/arm/boot/dts/uniphier-pro4.dtsi
index e960b09..794a85a 100644
--- a/arch/arm/boot/dts/uniphier-pro4.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro4.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-pro4";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-pro5.dtsi 
b/arch/arm/boot/dts/uniphier-pro5.dtsi
index dbc5e53..df07b55 100644
--- a/arch/arm/boot/dts/uniphier-pro5.dtsi
+++ b/arch/arm/boot/dts/uniphier-pro5.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-pro5";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-pxs2.dtsi 
b/arch/arm/boot/dts/uniphier-pxs2.dtsi
index e9e031d..58c3e2f 100644
--- a/arch/arm/boot/dts/uniphier-pxs2.dtsi
+++ b/arch/arm/boot/dts/uniphier-pxs2.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-pxs2";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-sld3.dtsi 
b/arch/arm/boot/dts/uniphier-sld3.dtsi
index 9fad6bd..01d77ed 100644
--- a/arch/arm/boot/dts/uniphier-sld3.dtsi
+++ b/arch/arm/boot/dts/uniphier-sld3.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-sld3";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
diff --git a/arch/arm/boot/dts/uniphier-sld8.dtsi 
b/arch/arm/boot/dts/uniphier-sld8.dtsi
index b2c980e..eb06fdc 100644
--- a/arch/arm/boot/dts/uniphier-sld8.dtsi
+++ b/arch/arm/boot/dts/uniphier-sld8.dtsi
@@ -43,10 +43,10 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-/include/ "skeleton.dtsi"
-
 / {
compatible = "socionext,uniphier-sld8";
+   #address-cells = <1>;
+   #size-cells = <1>;
 
cpus {
#address-cells = <1>;
-- 
2.7.4



[PATCH 3/3] arm64: dts: uniphier: fix no unit name warnings

2017-02-25 Thread Masahiro Yamada
Fix warnings reported when built with W=1:
  Node /memory has a reg or ranges property, but no unit name

Signed-off-by: Masahiro Yamada 
---

 arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi| 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts 
b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
index 7168cf8..1b96e24 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD11 Reference Board";
compatible = "socionext,uniphier-ld11-ref", "socionext,uniphier-ld11";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0 0x8000 0 0x4000>;
};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi 
b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
index da881f5..2ed35e3 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
@@ -140,7 +140,7 @@
 <1 10 4>;
};
 
-   soc {
+   soc@0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts 
b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
index 609162a..8cb0f11 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD20 Reference Board";
compatible = "socionext,uniphier-ld20-ref", "socionext,uniphier-ld20";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0 0x8000 0 0xc000>;
};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi 
b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
index a6b3a70..96c053f 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
@@ -209,7 +209,7 @@
 <1 10 4>;
};
 
-   soc {
+   soc@0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
-- 
2.7.4



[PATCH 3/3] arm64: dts: uniphier: fix no unit name warnings

2017-02-25 Thread Masahiro Yamada
Fix warnings reported when built with W=1:
  Node /memory has a reg or ranges property, but no unit name

Signed-off-by: Masahiro Yamada 
---

 arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi| 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts | 2 +-
 arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts 
b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
index 7168cf8..1b96e24 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD11 Reference Board";
compatible = "socionext,uniphier-ld11-ref", "socionext,uniphier-ld11";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0 0x8000 0 0x4000>;
};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi 
b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
index da881f5..2ed35e3 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld11.dtsi
@@ -140,7 +140,7 @@
 <1 10 4>;
};
 
-   soc {
+   soc@0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts 
b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
index 609162a..8cb0f11 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD20 Reference Board";
compatible = "socionext,uniphier-ld20-ref", "socionext,uniphier-ld20";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0 0x8000 0 0xc000>;
};
diff --git a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi 
b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
index a6b3a70..96c053f 100644
--- a/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
+++ b/arch/arm64/boot/dts/socionext/uniphier-ld20.dtsi
@@ -209,7 +209,7 @@
 <1 10 4>;
};
 
-   soc {
+   soc@0 {
compatible = "simple-bus";
#address-cells = <1>;
#size-cells = <1>;
-- 
2.7.4



[PATCH 2/3] ARM: dts: uniphier: fix no unit name warnings

2017-02-25 Thread Masahiro Yamada
Fix warnings reported when built with W=1:
  Node /memory has a reg or ranges property, but no unit name

Signed-off-by: Masahiro Yamada 
---

 arch/arm/boot/dts/uniphier-ld4-ref.dts   | 2 +-
 arch/arm/boot/dts/uniphier-ld6b-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ace.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pro4-sanji.dts| 2 +-
 arch/arm/boot/dts/uniphier-pxs2-gentil.dts   | 2 +-
 arch/arm/boot/dts/uniphier-pxs2-vodka.dts| 2 +-
 arch/arm/boot/dts/uniphier-sld3-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-sld8-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/uniphier-ld4-ref.dts 
b/arch/arm/boot/dts/uniphier-ld4-ref.dts
index 110031b..77163b3 100644
--- a/arch/arm/boot/dts/uniphier-ld4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld4-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD4 Reference Board";
compatible = "socionext,uniphier-ld4-ref", "socionext,uniphier-ld4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x2000>;
};
diff --git a/arch/arm/boot/dts/uniphier-ld6b-ref.dts 
b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
index c05d631..467ad6a 100644
--- a/arch/arm/boot/dts/uniphier-ld6b-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD6b Reference Board";
compatible = "socionext,uniphier-ld6b-ref", "socionext,uniphier-ld6b";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pro4-ace.dts 
b/arch/arm/boot/dts/uniphier-pro4-ace.dts
index 0ab0a40..a10a5fa 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ace.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ace.dts
@@ -50,7 +50,7 @@
model = "UniPhier Pro4 Ace Board";
compatible = "socionext,uniphier-pro4-ace", "socionext,uniphier-pro4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x4000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pro4-ref.dts 
b/arch/arm/boot/dts/uniphier-pro4-ref.dts
index 9e92e60..58a2cba 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier Pro4 Reference Board";
compatible = "socionext,uniphier-pro4-ref", "socionext,uniphier-pro4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x4000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pro4-sanji.dts 
b/arch/arm/boot/dts/uniphier-pro4-sanji.dts
index dc4ea88..1508eeb 100644
--- a/arch/arm/boot/dts/uniphier-pro4-sanji.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-sanji.dts
@@ -50,7 +50,7 @@
model = "UniPhier Pro4 Sanji Board";
compatible = "socionext,uniphier-pro4-sanji", "socionext,uniphier-pro4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts 
b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
index 373818a..e26ed59 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
@@ -51,7 +51,7 @@
compatible = "socionext,uniphier-pxs2-gentil",
 "socionext,uniphier-pxs2";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts 
b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
index 51a3eac..a28e9e4 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
@@ -50,7 +50,7 @@
model = "UniPhier PXs2 Vodka Board";
compatible = "socionext,uniphier-pxs2-vodka", "socionext,uniphier-pxs2";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-sld3-ref.dts 
b/arch/arm/boot/dts/uniphier-sld3-ref.dts
index ac792ae0..827c821 100644
--- a/arch/arm/boot/dts/uniphier-sld3-ref.dts
+++ b/arch/arm/boot/dts/uniphier-sld3-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier sLD3 Reference Board";
compatible = "socionext,uniphier-sld3-ref", "socionext,uniphier-sld3";
 
-   memory {
+   memory@800 {
device_type = "memory";
reg = <0x8000 0x2000
   0xc000 0x2000>;
diff --git a/arch/arm/boot/dts/uniphier-sld8-ref.dts 
b/arch/arm/boot/dts/uniphier-sld8-ref.dts
index a8291f9..93c3dd9 100644
--- 

[PATCH 2/3] ARM: dts: uniphier: fix no unit name warnings

2017-02-25 Thread Masahiro Yamada
Fix warnings reported when built with W=1:
  Node /memory has a reg or ranges property, but no unit name

Signed-off-by: Masahiro Yamada 
---

 arch/arm/boot/dts/uniphier-ld4-ref.dts   | 2 +-
 arch/arm/boot/dts/uniphier-ld6b-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ace.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pro4-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-pro4-sanji.dts| 2 +-
 arch/arm/boot/dts/uniphier-pxs2-gentil.dts   | 2 +-
 arch/arm/boot/dts/uniphier-pxs2-vodka.dts| 2 +-
 arch/arm/boot/dts/uniphier-sld3-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-sld8-ref.dts  | 2 +-
 arch/arm/boot/dts/uniphier-support-card.dtsi | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/boot/dts/uniphier-ld4-ref.dts 
b/arch/arm/boot/dts/uniphier-ld4-ref.dts
index 110031b..77163b3 100644
--- a/arch/arm/boot/dts/uniphier-ld4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld4-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD4 Reference Board";
compatible = "socionext,uniphier-ld4-ref", "socionext,uniphier-ld4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x2000>;
};
diff --git a/arch/arm/boot/dts/uniphier-ld6b-ref.dts 
b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
index c05d631..467ad6a 100644
--- a/arch/arm/boot/dts/uniphier-ld6b-ref.dts
+++ b/arch/arm/boot/dts/uniphier-ld6b-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier LD6b Reference Board";
compatible = "socionext,uniphier-ld6b-ref", "socionext,uniphier-ld6b";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pro4-ace.dts 
b/arch/arm/boot/dts/uniphier-pro4-ace.dts
index 0ab0a40..a10a5fa 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ace.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ace.dts
@@ -50,7 +50,7 @@
model = "UniPhier Pro4 Ace Board";
compatible = "socionext,uniphier-pro4-ace", "socionext,uniphier-pro4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x4000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pro4-ref.dts 
b/arch/arm/boot/dts/uniphier-pro4-ref.dts
index 9e92e60..58a2cba 100644
--- a/arch/arm/boot/dts/uniphier-pro4-ref.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier Pro4 Reference Board";
compatible = "socionext,uniphier-pro4-ref", "socionext,uniphier-pro4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x4000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pro4-sanji.dts 
b/arch/arm/boot/dts/uniphier-pro4-sanji.dts
index dc4ea88..1508eeb 100644
--- a/arch/arm/boot/dts/uniphier-pro4-sanji.dts
+++ b/arch/arm/boot/dts/uniphier-pro4-sanji.dts
@@ -50,7 +50,7 @@
model = "UniPhier Pro4 Sanji Board";
compatible = "socionext,uniphier-pro4-sanji", "socionext,uniphier-pro4";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts 
b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
index 373818a..e26ed59 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-gentil.dts
@@ -51,7 +51,7 @@
compatible = "socionext,uniphier-pxs2-gentil",
 "socionext,uniphier-pxs2";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts 
b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
index 51a3eac..a28e9e4 100644
--- a/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
+++ b/arch/arm/boot/dts/uniphier-pxs2-vodka.dts
@@ -50,7 +50,7 @@
model = "UniPhier PXs2 Vodka Board";
compatible = "socionext,uniphier-pxs2-vodka", "socionext,uniphier-pxs2";
 
-   memory {
+   memory@8000 {
device_type = "memory";
reg = <0x8000 0x8000>;
};
diff --git a/arch/arm/boot/dts/uniphier-sld3-ref.dts 
b/arch/arm/boot/dts/uniphier-sld3-ref.dts
index ac792ae0..827c821 100644
--- a/arch/arm/boot/dts/uniphier-sld3-ref.dts
+++ b/arch/arm/boot/dts/uniphier-sld3-ref.dts
@@ -52,7 +52,7 @@
model = "UniPhier sLD3 Reference Board";
compatible = "socionext,uniphier-sld3-ref", "socionext,uniphier-sld3";
 
-   memory {
+   memory@800 {
device_type = "memory";
reg = <0x8000 0x2000
   0xc000 0x2000>;
diff --git a/arch/arm/boot/dts/uniphier-sld8-ref.dts 
b/arch/arm/boot/dts/uniphier-sld8-ref.dts
index a8291f9..93c3dd9 100644
--- a/arch/arm/boot/dts/uniphier-sld8-ref.dts
+++ 

[PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers

2017-02-25 Thread Tahsin Erdogan
When pcpu_alloc() is called with gfp != GFP_KERNEL, the likelihood of
a failure is higher than GFP_KERNEL case. This is mainly because
pcpu_alloc() relies on previously allocated reserves and does not make
an effort to add memory to its pools for non-GFP_KERNEL case.

This issue is somewhat mitigated by kicking off a background work when
a memory allocation failure occurs. But this doesn't really help the
original victim of allocation failure.

This problem affects blkg_lookup_create() callers on machines with a
lot of cpus.

This patch reduces failure cases by trying to expand the memory pools.
It passes along gfp flag so it is safe to allocate memory this way.

To make this work, a gfp flag aware vmalloc_gfp() function is added.
Also, locking around vmap_area_lock has been updated to save/restore
irq flags. This was needed to avoid a lockdep problem between
request_queue->queue_lock and vmap_area_lock.

Signed-off-by: Tahsin Erdogan 
---
v2:
 added vmalloc_gfp() to mm/nommu.c as well

 include/linux/vmalloc.h |   5 +-
 mm/nommu.c  |   5 ++
 mm/percpu-km.c  |   8 +--
 mm/percpu-vm.c  | 119 +++-
 mm/percpu.c | 156 
 mm/vmalloc.c|  74 ++-
 6 files changed, 184 insertions(+), 183 deletions(-)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index d68edffbf142..8110a0040b9d 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -72,6 +72,7 @@ extern void *vzalloc(unsigned long size);
 extern void *vmalloc_user(unsigned long size);
 extern void *vmalloc_node(unsigned long size, int node);
 extern void *vzalloc_node(unsigned long size, int node);
+extern void *vmalloc_gfp(unsigned long size, gfp_t gfp_mask);
 extern void *vmalloc_exec(unsigned long size);
 extern void *vmalloc_32(unsigned long size);
 extern void *vmalloc_32_user(unsigned long size);
@@ -165,14 +166,14 @@ extern __init void vm_area_register_early(struct 
vm_struct *vm, size_t align);
 # ifdef CONFIG_MMU
 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
 const size_t *sizes, int nr_vms,
-size_t align);
+size_t align, gfp_t gfp_mask);
 
 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
 # else
 static inline struct vm_struct **
 pcpu_get_vm_areas(const unsigned long *offsets,
const size_t *sizes, int nr_vms,
-   size_t align)
+   size_t align, gfp_t gfp_mask)
 {
return NULL;
 }
diff --git a/mm/nommu.c b/mm/nommu.c
index bc964c26be8c..e81d4724ac07 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -359,6 +359,11 @@ void *vzalloc_node(unsigned long size, int node)
 }
 EXPORT_SYMBOL(vzalloc_node);
 
+void *vmalloc_gfp(unsigned long size, gfp_t gfp_mask)
+{
+   return __vmalloc(size, gfp_mask, PAGE_KERNEL);
+}
+
 #ifndef PAGE_KERNEL_EXEC
 # define PAGE_KERNEL_EXEC PAGE_KERNEL
 #endif
diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index d66911ff42d9..599a9ce84544 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -34,7 +34,7 @@
 #include 
 
 static int pcpu_populate_chunk(struct pcpu_chunk *chunk,
-  int page_start, int page_end)
+  int page_start, int page_end, gfp_t gfp)
 {
return 0;
 }
@@ -45,18 +45,18 @@ static void pcpu_depopulate_chunk(struct pcpu_chunk *chunk,
/* nada */
 }
 
-static struct pcpu_chunk *pcpu_create_chunk(void)
+static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp)
 {
const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT;
struct pcpu_chunk *chunk;
struct page *pages;
int i;
 
-   chunk = pcpu_alloc_chunk();
+   chunk = pcpu_alloc_chunk(gfp);
if (!chunk)
return NULL;
 
-   pages = alloc_pages(GFP_KERNEL, order_base_2(nr_pages));
+   pages = alloc_pages(gfp, order_base_2(nr_pages));
if (!pages) {
pcpu_free_chunk(chunk);
return NULL;
diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c
index 9ac639499bd1..42348a421ccf 100644
--- a/mm/percpu-vm.c
+++ b/mm/percpu-vm.c
@@ -20,28 +20,6 @@ static struct page *pcpu_chunk_page(struct pcpu_chunk *chunk,
 }
 
 /**
- * pcpu_get_pages - get temp pages array
- *
- * Returns pointer to array of pointers to struct page which can be indexed
- * with pcpu_page_idx().  Note that there is only one array and accesses
- * should be serialized by pcpu_alloc_mutex.
- *
- * RETURNS:
- * Pointer to temp pages array on success.
- */
-static struct page **pcpu_get_pages(void)
-{
-   static struct page **pages;
-   size_t pages_size = pcpu_nr_units * pcpu_unit_pages * sizeof(pages[0]);
-
-   lockdep_assert_held(_alloc_mutex);
-
-   if (!pages)
-   pages = pcpu_mem_zalloc(pages_size);
-   return pages;
-}
-
-/**
  * 

[PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers

2017-02-25 Thread Tahsin Erdogan
When pcpu_alloc() is called with gfp != GFP_KERNEL, the likelihood of
a failure is higher than GFP_KERNEL case. This is mainly because
pcpu_alloc() relies on previously allocated reserves and does not make
an effort to add memory to its pools for non-GFP_KERNEL case.

This issue is somewhat mitigated by kicking off a background work when
a memory allocation failure occurs. But this doesn't really help the
original victim of allocation failure.

This problem affects blkg_lookup_create() callers on machines with a
lot of cpus.

This patch reduces failure cases by trying to expand the memory pools.
It passes along gfp flag so it is safe to allocate memory this way.

To make this work, a gfp flag aware vmalloc_gfp() function is added.
Also, locking around vmap_area_lock has been updated to save/restore
irq flags. This was needed to avoid a lockdep problem between
request_queue->queue_lock and vmap_area_lock.

Signed-off-by: Tahsin Erdogan 
---
v2:
 added vmalloc_gfp() to mm/nommu.c as well

 include/linux/vmalloc.h |   5 +-
 mm/nommu.c  |   5 ++
 mm/percpu-km.c  |   8 +--
 mm/percpu-vm.c  | 119 +++-
 mm/percpu.c | 156 
 mm/vmalloc.c|  74 ++-
 6 files changed, 184 insertions(+), 183 deletions(-)

diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index d68edffbf142..8110a0040b9d 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -72,6 +72,7 @@ extern void *vzalloc(unsigned long size);
 extern void *vmalloc_user(unsigned long size);
 extern void *vmalloc_node(unsigned long size, int node);
 extern void *vzalloc_node(unsigned long size, int node);
+extern void *vmalloc_gfp(unsigned long size, gfp_t gfp_mask);
 extern void *vmalloc_exec(unsigned long size);
 extern void *vmalloc_32(unsigned long size);
 extern void *vmalloc_32_user(unsigned long size);
@@ -165,14 +166,14 @@ extern __init void vm_area_register_early(struct 
vm_struct *vm, size_t align);
 # ifdef CONFIG_MMU
 struct vm_struct **pcpu_get_vm_areas(const unsigned long *offsets,
 const size_t *sizes, int nr_vms,
-size_t align);
+size_t align, gfp_t gfp_mask);
 
 void pcpu_free_vm_areas(struct vm_struct **vms, int nr_vms);
 # else
 static inline struct vm_struct **
 pcpu_get_vm_areas(const unsigned long *offsets,
const size_t *sizes, int nr_vms,
-   size_t align)
+   size_t align, gfp_t gfp_mask)
 {
return NULL;
 }
diff --git a/mm/nommu.c b/mm/nommu.c
index bc964c26be8c..e81d4724ac07 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -359,6 +359,11 @@ void *vzalloc_node(unsigned long size, int node)
 }
 EXPORT_SYMBOL(vzalloc_node);
 
+void *vmalloc_gfp(unsigned long size, gfp_t gfp_mask)
+{
+   return __vmalloc(size, gfp_mask, PAGE_KERNEL);
+}
+
 #ifndef PAGE_KERNEL_EXEC
 # define PAGE_KERNEL_EXEC PAGE_KERNEL
 #endif
diff --git a/mm/percpu-km.c b/mm/percpu-km.c
index d66911ff42d9..599a9ce84544 100644
--- a/mm/percpu-km.c
+++ b/mm/percpu-km.c
@@ -34,7 +34,7 @@
 #include 
 
 static int pcpu_populate_chunk(struct pcpu_chunk *chunk,
-  int page_start, int page_end)
+  int page_start, int page_end, gfp_t gfp)
 {
return 0;
 }
@@ -45,18 +45,18 @@ static void pcpu_depopulate_chunk(struct pcpu_chunk *chunk,
/* nada */
 }
 
-static struct pcpu_chunk *pcpu_create_chunk(void)
+static struct pcpu_chunk *pcpu_create_chunk(gfp_t gfp)
 {
const int nr_pages = pcpu_group_sizes[0] >> PAGE_SHIFT;
struct pcpu_chunk *chunk;
struct page *pages;
int i;
 
-   chunk = pcpu_alloc_chunk();
+   chunk = pcpu_alloc_chunk(gfp);
if (!chunk)
return NULL;
 
-   pages = alloc_pages(GFP_KERNEL, order_base_2(nr_pages));
+   pages = alloc_pages(gfp, order_base_2(nr_pages));
if (!pages) {
pcpu_free_chunk(chunk);
return NULL;
diff --git a/mm/percpu-vm.c b/mm/percpu-vm.c
index 9ac639499bd1..42348a421ccf 100644
--- a/mm/percpu-vm.c
+++ b/mm/percpu-vm.c
@@ -20,28 +20,6 @@ static struct page *pcpu_chunk_page(struct pcpu_chunk *chunk,
 }
 
 /**
- * pcpu_get_pages - get temp pages array
- *
- * Returns pointer to array of pointers to struct page which can be indexed
- * with pcpu_page_idx().  Note that there is only one array and accesses
- * should be serialized by pcpu_alloc_mutex.
- *
- * RETURNS:
- * Pointer to temp pages array on success.
- */
-static struct page **pcpu_get_pages(void)
-{
-   static struct page **pages;
-   size_t pages_size = pcpu_nr_units * pcpu_unit_pages * sizeof(pages[0]);
-
-   lockdep_assert_held(_alloc_mutex);
-
-   if (!pages)
-   pages = pcpu_mem_zalloc(pages_size);
-   return pages;
-}
-
-/**
  * pcpu_free_pages - free pages 

Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE

2017-02-25 Thread Baoquan He
Hi Boris,

Thanks a lot for your comments, sorry so late to reply!

On 02/14/17 at 06:32pm, Borislav Petkov wrote:
> > diff --git a/arch/x86/include/asm/page_64_types.h 
> > b/arch/x86/include/asm/page_64_types.h
> > index 9215e05..24c9098 100644
> > --- a/arch/x86/include/asm/page_64_types.h
> > +++ b/arch/x86/include/asm/page_64_types.h
> > @@ -50,16 +50,22 @@
> >  #define __VIRTUAL_MASK_SHIFT   47
> >  
> >  /*
> > - * Kernel image size is limited to 1GiB due to the fixmap living in the
> > + * Kernel image size is limited to 512 MB. The kernel code+data+bss
> 
> This is not what it said there before. With your change you have:
> 
> - 0
> .
> .
> .
> - 512 - KERNEL_IMAGE_SIZE
> .
> .
> .
> - 1024 - KERNEL_MAPPING_SIZE
> 
> and KERNEL_IMAGE_SIZE is not limited to 512Mb but it is "Use 512Mib by
> default". And we do enforce that in various places like in the linker
> script assertions but there's some headroom open in the upper 512Mib if
> needed.

Before below commit merged, it said:

 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
 * arch/x86/kernel/head_64.S), and it is mapped here:
 */
#define KERNEL_IMAGE_SIZE  (512 * 1024 * 1024)

commit 6145cfe3 ("x86, kaslr: Raise the maximum virtual address to -1
GiB on x86_64")

So you can see KERNEL_IMAGE_SIZE is a constant value and not optional.
Then Kees posted above commit, The default mentioned in "Use 512Mib by
default" should be KERNEL_IMAGE_SIZE in the case that kaslr code not
compiled in, 512M, which is relative to the case that kaslr code
compiled in, 1G. In fact, it's meaning the kernel mapping size defaults
to 512M, and will change to 1G if CONFIG_RANDOMIZE_BASE is chosen.

Seems in kernel only linker script checks kernel image size as below:

. = ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), 
 
   "kernel image bigger than KERNEL_IMAGE_SIZE");

In arch/x86/kernel/head64.c, it's more likely checking the kernel
mapping size, just because they share the same constant,
KERNEL_IMAGE_SIZE.

About headroom, in boot/compressed/kaslr.c kernel iamge size is
considered, including head room. Here I am not quite sure. Do you mean:
KERNEL_IMAGE_SIZE use 512Mib by default, only kerel image size is
limited to 512M which is (_end - _text) since linker script will check
it. While with headroom, it could be bigger than 512M if needed.

Am I right on understanding it?

> 
> KERNEL_MAPPING_SIZE OTOH is the one limited to 1G due to the fixmap L2
> PGT...
> 
> > + * must not be bigger than that.
> > + */
> > +#define KERNEL_IMAGE_SIZE  (512 * 1024 * 1024)
> > +
> > +/*
> > + * Kernel mapping size is limited to 1GiB due to the fixmap living in the
> >   * next 1GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S). Use
> >   * 512MiB by default, leaving 1.5GiB for modules once the page tables
> >   * are fully set up. If kernel ASLR is configured, it can extend the
> >   * kernel page table mapping, reducing the size of the modules area.
> >   */
> >  #if defined(CONFIG_RANDOMIZE_BASE)
> > -#define KERNEL_IMAGE_SIZE  (1024 * 1024 * 1024)
> > +#define KERNEL_MAPPING_SIZE(1024 * 1024 * 1024)
> >  #else
> > -#define KERNEL_IMAGE_SIZE  (512 * 1024 * 1024)
> > +#define KERNEL_MAPPING_SIZE(512 * 1024 * 1024)
> >  #endif
> 
> ... and since you're adding that define now, fixup the comments in this
> patch too, to explain what they mean.

Yes, agree, this makes it clearer. Will do.

> 
> Also, I'd like for the text to say that both defines are dependent in
> the sense that IMAGE_SIZE <= MAPPING_SIZE so that people know what's
> going on and which is which.

It makes sense, will do. 

Thanks for great suggestion!


Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE

2017-02-25 Thread Baoquan He
Hi Boris,

Thanks a lot for your comments, sorry so late to reply!

On 02/14/17 at 06:32pm, Borislav Petkov wrote:
> > diff --git a/arch/x86/include/asm/page_64_types.h 
> > b/arch/x86/include/asm/page_64_types.h
> > index 9215e05..24c9098 100644
> > --- a/arch/x86/include/asm/page_64_types.h
> > +++ b/arch/x86/include/asm/page_64_types.h
> > @@ -50,16 +50,22 @@
> >  #define __VIRTUAL_MASK_SHIFT   47
> >  
> >  /*
> > - * Kernel image size is limited to 1GiB due to the fixmap living in the
> > + * Kernel image size is limited to 512 MB. The kernel code+data+bss
> 
> This is not what it said there before. With your change you have:
> 
> - 0
> .
> .
> .
> - 512 - KERNEL_IMAGE_SIZE
> .
> .
> .
> - 1024 - KERNEL_MAPPING_SIZE
> 
> and KERNEL_IMAGE_SIZE is not limited to 512Mb but it is "Use 512Mib by
> default". And we do enforce that in various places like in the linker
> script assertions but there's some headroom open in the upper 512Mib if
> needed.

Before below commit merged, it said:

 * Kernel image size is limited to 512 MB (see level2_kernel_pgt in
 * arch/x86/kernel/head_64.S), and it is mapped here:
 */
#define KERNEL_IMAGE_SIZE  (512 * 1024 * 1024)

commit 6145cfe3 ("x86, kaslr: Raise the maximum virtual address to -1
GiB on x86_64")

So you can see KERNEL_IMAGE_SIZE is a constant value and not optional.
Then Kees posted above commit, The default mentioned in "Use 512Mib by
default" should be KERNEL_IMAGE_SIZE in the case that kaslr code not
compiled in, 512M, which is relative to the case that kaslr code
compiled in, 1G. In fact, it's meaning the kernel mapping size defaults
to 512M, and will change to 1G if CONFIG_RANDOMIZE_BASE is chosen.

Seems in kernel only linker script checks kernel image size as below:

. = ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), 
 
   "kernel image bigger than KERNEL_IMAGE_SIZE");

In arch/x86/kernel/head64.c, it's more likely checking the kernel
mapping size, just because they share the same constant,
KERNEL_IMAGE_SIZE.

About headroom, in boot/compressed/kaslr.c kernel iamge size is
considered, including head room. Here I am not quite sure. Do you mean:
KERNEL_IMAGE_SIZE use 512Mib by default, only kerel image size is
limited to 512M which is (_end - _text) since linker script will check
it. While with headroom, it could be bigger than 512M if needed.

Am I right on understanding it?

> 
> KERNEL_MAPPING_SIZE OTOH is the one limited to 1G due to the fixmap L2
> PGT...
> 
> > + * must not be bigger than that.
> > + */
> > +#define KERNEL_IMAGE_SIZE  (512 * 1024 * 1024)
> > +
> > +/*
> > + * Kernel mapping size is limited to 1GiB due to the fixmap living in the
> >   * next 1GiB (see level2_kernel_pgt in arch/x86/kernel/head_64.S). Use
> >   * 512MiB by default, leaving 1.5GiB for modules once the page tables
> >   * are fully set up. If kernel ASLR is configured, it can extend the
> >   * kernel page table mapping, reducing the size of the modules area.
> >   */
> >  #if defined(CONFIG_RANDOMIZE_BASE)
> > -#define KERNEL_IMAGE_SIZE  (1024 * 1024 * 1024)
> > +#define KERNEL_MAPPING_SIZE(1024 * 1024 * 1024)
> >  #else
> > -#define KERNEL_IMAGE_SIZE  (512 * 1024 * 1024)
> > +#define KERNEL_MAPPING_SIZE(512 * 1024 * 1024)
> >  #endif
> 
> ... and since you're adding that define now, fixup the comments in this
> patch too, to explain what they mean.

Yes, agree, this makes it clearer. Will do.

> 
> Also, I'd like for the text to say that both defines are dependent in
> the sense that IMAGE_SIZE <= MAPPING_SIZE so that people know what's
> going on and which is which.

It makes sense, will do. 

Thanks for great suggestion!


Re: [PATCH v5 5/7] arm: dts: sun8i: split Allwinner H3 .dtsi

2017-02-25 Thread Chen-Yu Tsai
Hi,

On Sun, Feb 26, 2017 at 9:19 AM, Icenowy Zheng  wrote:
> From: Andre Przywara 
>
> The new Allwinner H5 SoC is pin-compatible to the H3 SoC, but with the
> Cortex-A7 cores replaced by Cortex-A53 cores and the MMC controller
> updated. So we should really share almost the whole .dtsi.
> In preparation for that move the peripheral parts of the existing
> sun8i-h3.dtsi into a new sun8i-h3-h5.dtsi.
> The actual sun8i-h3.dtsi then includes that and defines the H3 specific
> parts on top of it.
> On the way get rid of skeleton.dtsi, as recommended in that very file.
>
> Signed-off-by: Andre Przywara 
> [Icenowy: also split out mmc, as well as pio and ccu's compatible]
> Signed-off-by: Icenowy Zheng 
> ---
> Changes in v3:
> - Use label-based syntax to reference nodes in H3 DTSI file.
> Changes in v2:
> - Rebase on current linux-next (because of the add of audio codec)
>
>  arch/arm/boot/dts/sun8i-h3.dtsi| 789 
> -
>  .../boot/dts/{sun8i-h3.dtsi => sunxi-h3-h5.dtsi}   |  87 +--
>  2 files changed, 148 insertions(+), 728 deletions(-)
>  rewrite arch/arm/boot/dts/sun8i-h3.dtsi (81%)
>  copy arch/arm/boot/dts/{sun8i-h3.dtsi => sunxi-h3-h5.dtsi} (88%)
>
> diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
> dissimilarity index 81%
> index 8a4d7894a11f..4209d974c3f4 100644
> --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> @@ -1,648 +1,141 @@
> -/*
> - * Copyright (C) 2015 Jens Kuske 
> - *
> - * This file is dual-licensed: you can use it either under the terms
> - * of the GPL or the X11 license, at your option. Note that this dual
> - * licensing only applies to this file, and not this project as a
> - * whole.
> - *
> - *  a) This file 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 file 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.
> - *
> - * Or, alternatively,
> - *
> - *  b) Permission is hereby granted, free of charge, to any person
> - * obtaining a copy of this software and associated documentation
> - * files (the "Software"), to deal in the Software without
> - * restriction, including without limitation the rights to use,
> - * copy, modify, merge, publish, distribute, sublicense, and/or
> - * sell copies of the Software, and to permit persons to whom the
> - * Software is furnished to do so, subject to the following
> - * conditions:
> - *
> - * The above copyright notice and this permission notice shall be
> - * included in all copies or substantial portions of the Software.
> - *
> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> - * OTHER DEALINGS IN THE SOFTWARE.
> - */
> -
> -#include "skeleton.dtsi"
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -/ {
> -   interrupt-parent = <>;
> -
> -   cpus {
> -   #address-cells = <1>;
> -   #size-cells = <0>;
> -
> -   cpu@0 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <0>;
> -   };
> -
> -   cpu@1 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <1>;
> -   };
> -
> -   cpu@2 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <2>;
> -   };
> -
> -   cpu@3 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <3>;
> -   };
> -   };
> -
> -   timer {
> -   compatible = "arm,armv7-timer";
> -   interrupts =  IRQ_TYPE_LEVEL_LOW)>,
> - IRQ_TYPE_LEVEL_LOW)>,
> - IRQ_TYPE_LEVEL_LOW)>,
> - IRQ_TYPE_LEVEL_LOW)>;
> -   };
> -
> -   clocks {
> -  

Re: [PATCH v5 5/7] arm: dts: sun8i: split Allwinner H3 .dtsi

2017-02-25 Thread Chen-Yu Tsai
Hi,

On Sun, Feb 26, 2017 at 9:19 AM, Icenowy Zheng  wrote:
> From: Andre Przywara 
>
> The new Allwinner H5 SoC is pin-compatible to the H3 SoC, but with the
> Cortex-A7 cores replaced by Cortex-A53 cores and the MMC controller
> updated. So we should really share almost the whole .dtsi.
> In preparation for that move the peripheral parts of the existing
> sun8i-h3.dtsi into a new sun8i-h3-h5.dtsi.
> The actual sun8i-h3.dtsi then includes that and defines the H3 specific
> parts on top of it.
> On the way get rid of skeleton.dtsi, as recommended in that very file.
>
> Signed-off-by: Andre Przywara 
> [Icenowy: also split out mmc, as well as pio and ccu's compatible]
> Signed-off-by: Icenowy Zheng 
> ---
> Changes in v3:
> - Use label-based syntax to reference nodes in H3 DTSI file.
> Changes in v2:
> - Rebase on current linux-next (because of the add of audio codec)
>
>  arch/arm/boot/dts/sun8i-h3.dtsi| 789 
> -
>  .../boot/dts/{sun8i-h3.dtsi => sunxi-h3-h5.dtsi}   |  87 +--
>  2 files changed, 148 insertions(+), 728 deletions(-)
>  rewrite arch/arm/boot/dts/sun8i-h3.dtsi (81%)
>  copy arch/arm/boot/dts/{sun8i-h3.dtsi => sunxi-h3-h5.dtsi} (88%)
>
> diff --git a/arch/arm/boot/dts/sun8i-h3.dtsi b/arch/arm/boot/dts/sun8i-h3.dtsi
> dissimilarity index 81%
> index 8a4d7894a11f..4209d974c3f4 100644
> --- a/arch/arm/boot/dts/sun8i-h3.dtsi
> +++ b/arch/arm/boot/dts/sun8i-h3.dtsi
> @@ -1,648 +1,141 @@
> -/*
> - * Copyright (C) 2015 Jens Kuske 
> - *
> - * This file is dual-licensed: you can use it either under the terms
> - * of the GPL or the X11 license, at your option. Note that this dual
> - * licensing only applies to this file, and not this project as a
> - * whole.
> - *
> - *  a) This file 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 file 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.
> - *
> - * Or, alternatively,
> - *
> - *  b) Permission is hereby granted, free of charge, to any person
> - * obtaining a copy of this software and associated documentation
> - * files (the "Software"), to deal in the Software without
> - * restriction, including without limitation the rights to use,
> - * copy, modify, merge, publish, distribute, sublicense, and/or
> - * sell copies of the Software, and to permit persons to whom the
> - * Software is furnished to do so, subject to the following
> - * conditions:
> - *
> - * The above copyright notice and this permission notice shall be
> - * included in all copies or substantial portions of the Software.
> - *
> - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> - * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> - * OTHER DEALINGS IN THE SOFTWARE.
> - */
> -
> -#include "skeleton.dtsi"
> -
> -#include 
> -#include 
> -#include 
> -#include 
> -
> -/ {
> -   interrupt-parent = <>;
> -
> -   cpus {
> -   #address-cells = <1>;
> -   #size-cells = <0>;
> -
> -   cpu@0 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <0>;
> -   };
> -
> -   cpu@1 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <1>;
> -   };
> -
> -   cpu@2 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <2>;
> -   };
> -
> -   cpu@3 {
> -   compatible = "arm,cortex-a7";
> -   device_type = "cpu";
> -   reg = <3>;
> -   };
> -   };
> -
> -   timer {
> -   compatible = "arm,armv7-timer";
> -   interrupts =  IRQ_TYPE_LEVEL_LOW)>,
> - IRQ_TYPE_LEVEL_LOW)>,
> - IRQ_TYPE_LEVEL_LOW)>,
> - IRQ_TYPE_LEVEL_LOW)>;
> -   };
> -
> -   clocks {
> -   #address-cells = <1>;
> -   #size-cells = <1>;
> -   ranges;
> -
> -

[PATCH] ARM: oxnas: remove redundant select CPU_V6K

2017-02-25 Thread Masahiro Yamada
MACH_OX820 depends on ARCH_MULTI_V6, which already selects CPU_V6K.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-oxnas/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-oxnas/Kconfig b/arch/arm/mach-oxnas/Kconfig
index 8fa4557..e3610c5 100644
--- a/arch/arm/mach-oxnas/Kconfig
+++ b/arch/arm/mach-oxnas/Kconfig
@@ -28,7 +28,6 @@ config MACH_OX820
depends on ARCH_MULTI_V6
select ARM_GIC
select DMA_CACHE_RWFO if SMP
-   select CPU_V6K
select HAVE_SMP
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP
-- 
2.7.4



[PATCH] ARM: prima2: remove redundant select CPU_V7

2017-02-25 Thread Masahiro Yamada
ARCH_ATLAS7 resides in "if ARCH_SIRF ... end", and ARCH_SIRF depends
on ARCH_MULTI_V7, which selects CPU_V7.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-prima2/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 85e874a..7426211 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -27,7 +27,6 @@ config ARCH_ATLAS7
bool "CSR SiRFSoC ATLAS7 ARM Cortex A7 Platform"
default y
select ARM_GIC
-   select CPU_V7
select ATLAS7_TIMER
select HAVE_ARM_SCU if SMP
select HAVE_SMP
-- 
2.7.4



[PATCH] ARM: oxnas: remove redundant select CPU_V6K

2017-02-25 Thread Masahiro Yamada
MACH_OX820 depends on ARCH_MULTI_V6, which already selects CPU_V6K.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-oxnas/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-oxnas/Kconfig b/arch/arm/mach-oxnas/Kconfig
index 8fa4557..e3610c5 100644
--- a/arch/arm/mach-oxnas/Kconfig
+++ b/arch/arm/mach-oxnas/Kconfig
@@ -28,7 +28,6 @@ config MACH_OX820
depends on ARCH_MULTI_V6
select ARM_GIC
select DMA_CACHE_RWFO if SMP
-   select CPU_V6K
select HAVE_SMP
select HAVE_ARM_SCU if SMP
select HAVE_ARM_TWD if SMP
-- 
2.7.4



[PATCH] ARM: prima2: remove redundant select CPU_V7

2017-02-25 Thread Masahiro Yamada
ARCH_ATLAS7 resides in "if ARCH_SIRF ... end", and ARCH_SIRF depends
on ARCH_MULTI_V7, which selects CPU_V7.

Signed-off-by: Masahiro Yamada 
---

 arch/arm/mach-prima2/Kconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/arm/mach-prima2/Kconfig b/arch/arm/mach-prima2/Kconfig
index 85e874a..7426211 100644
--- a/arch/arm/mach-prima2/Kconfig
+++ b/arch/arm/mach-prima2/Kconfig
@@ -27,7 +27,6 @@ config ARCH_ATLAS7
bool "CSR SiRFSoC ATLAS7 ARM Cortex A7 Platform"
default y
select ARM_GIC
-   select CPU_V7
select ATLAS7_TIMER
select HAVE_ARM_SCU if SMP
select HAVE_SMP
-- 
2.7.4



[PATCH 8/9] Staging: rtl8712: wifi.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/wifi.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 74dfc9b0e494..556367bfbe8a 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -370,7 +370,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 
 
 /*-
-   Below is for the security related definition
+ * Below is for the security related definition
  *-
  */
 #define _RESERVED_FRAME_TYPE_  0
@@ -415,7 +415,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 
 
 /* ---
-   Below is the fixed elements...
+ * Below is the fixed elements...
  * ---
  */
 #define _AUTH_ALGM_NUM_2
@@ -444,14 +444,14 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 #define cap_ShortPremble BIT(5)
 
 /*-
-   Below is the definition for 802.11i / 802.1x
+ * Below is the definition for 802.11i / 802.1x
  
*--
  */
 #define _IEEE8021X_MGT_1   /*WPA */
 #define _IEEE8021X_PSK_2   /* WPA with pre-shared 
key */
 
 /*-
-   Below is the definition for WMM
+ * Below is the definition for WMM
  
*--
  */
 #define _WMM_IE_Length_7  /* for WMM STA */
@@ -459,7 +459,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 
 
 /*-
-   Below is the definition for 802.11n
+ * Below is the definition for 802.11n
  
*--
  */
 
@@ -498,7 +498,7 @@ struct ieee80211_bar {
 #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA  0x0004
 
 
- /**
+/*
  * struct ieee80211_ht_cap - HT capabilities
  *
  * This structure refers to "HT capabilities element" as
-- 
2.11.1



[PATCH 8/9] Staging: rtl8712: wifi.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/wifi.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 74dfc9b0e494..556367bfbe8a 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -370,7 +370,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 
 
 /*-
-   Below is for the security related definition
+ * Below is for the security related definition
  *-
  */
 #define _RESERVED_FRAME_TYPE_  0
@@ -415,7 +415,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 
 
 /* ---
-   Below is the fixed elements...
+ * Below is the fixed elements...
  * ---
  */
 #define _AUTH_ALGM_NUM_2
@@ -444,14 +444,14 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 #define cap_ShortPremble BIT(5)
 
 /*-
-   Below is the definition for 802.11i / 802.1x
+ * Below is the definition for 802.11i / 802.1x
  
*--
  */
 #define _IEEE8021X_MGT_1   /*WPA */
 #define _IEEE8021X_PSK_2   /* WPA with pre-shared 
key */
 
 /*-
-   Below is the definition for WMM
+ * Below is the definition for WMM
  
*--
  */
 #define _WMM_IE_Length_7  /* for WMM STA */
@@ -459,7 +459,7 @@ static inline unsigned char *get_hdr_bssid(unsigned char 
*pframe)
 
 
 /*-
-   Below is the definition for 802.11n
+ * Below is the definition for 802.11n
  
*--
  */
 
@@ -498,7 +498,7 @@ struct ieee80211_bar {
 #define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA  0x0004
 
 
- /**
+/*
  * struct ieee80211_ht_cap - HT capabilities
  *
  * This structure refers to "HT capabilities element" as
-- 
2.11.1



[PATCH 9/9] Staging: rtl8712: wlan_bssdef.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/wlan_bssdef.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/wlan_bssdef.h 
b/drivers/staging/rtl8712/wlan_bssdef.h
index c0654ae4d70d..9dc9ce5a2ccc 100644
--- a/drivers/staging/rtl8712/wlan_bssdef.h
+++ b/drivers/staging/rtl8712/wlan_bssdef.h
@@ -53,9 +53,9 @@ struct NDIS_802_11_CONFIGURATION_FH {
 };
 
 /*
-   FW will only save the channel number in DSConfig.
-   ODI Handler will convert the channel number to freq. number.
-*/
+ * FW will only save the channel number in DSConfig.
+ * ODI Handler will convert the channel number to freq. number.
+ */
 struct NDIS_802_11_CONFIGURATION {
u32 Length; /* Length of structure */
u32 BeaconPeriod;   /* units are Kusec */
-- 
2.11.1



[PATCH 9/9] Staging: rtl8712: wlan_bssdef.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/wlan_bssdef.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8712/wlan_bssdef.h 
b/drivers/staging/rtl8712/wlan_bssdef.h
index c0654ae4d70d..9dc9ce5a2ccc 100644
--- a/drivers/staging/rtl8712/wlan_bssdef.h
+++ b/drivers/staging/rtl8712/wlan_bssdef.h
@@ -53,9 +53,9 @@ struct NDIS_802_11_CONFIGURATION_FH {
 };
 
 /*
-   FW will only save the channel number in DSConfig.
-   ODI Handler will convert the channel number to freq. number.
-*/
+ * FW will only save the channel number in DSConfig.
+ * ODI Handler will convert the channel number to freq. number.
+ */
 struct NDIS_802_11_CONFIGURATION {
u32 Length; /* Length of structure */
u32 BeaconPeriod;   /* units are Kusec */
-- 
2.11.1



[PATCH 7/9] Staging: rtl8712: rtl871x_recv.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_recv.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_recv.h 
b/drivers/staging/rtl8712/rtl871x_recv.h
index f419943ad75d..6c535647daed 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.h
+++ b/drivers/staging/rtl8712/rtl871x_recv.h
@@ -74,12 +74,12 @@ struct rx_pkt_attrib {
 };
 
 /*
-accesser of recv_priv: recv_entry(dispatch / passive level);
-recv_thread(passive) ; returnpkt(dispatch)
-; halt(passive) ;
-
-using enter_critical section to protect
-*/
+ * accesser of recv_priv: recv_entry(dispatch / passive level);
+ * recv_thread(passive) ; returnpkt(dispatch)
+ * ; halt(passive) ;
+ *
+ * using enter_critical section to protect
+ */
 struct recv_priv {
spinlock_t lock;
struct  __queue free_recv_queue;
-- 
2.11.1



[PATCH 7/9] Staging: rtl8712: rtl871x_recv.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_recv.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_recv.h 
b/drivers/staging/rtl8712/rtl871x_recv.h
index f419943ad75d..6c535647daed 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.h
+++ b/drivers/staging/rtl8712/rtl871x_recv.h
@@ -74,12 +74,12 @@ struct rx_pkt_attrib {
 };
 
 /*
-accesser of recv_priv: recv_entry(dispatch / passive level);
-recv_thread(passive) ; returnpkt(dispatch)
-; halt(passive) ;
-
-using enter_critical section to protect
-*/
+ * accesser of recv_priv: recv_entry(dispatch / passive level);
+ * recv_thread(passive) ; returnpkt(dispatch)
+ * ; halt(passive) ;
+ *
+ * using enter_critical section to protect
+ */
 struct recv_priv {
spinlock_t lock;
struct  __queue free_recv_queue;
-- 
2.11.1



[PATCH 6/9] Staging: rtl8712: rtl871x_pwrctrl.h - style fix

2017-02-25 Thread Derek Robson
Fixed style fo block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_pwrctrl.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h 
b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index c82fdf85d474..4a873d053eea 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -48,11 +48,11 @@ enum Power_Mgnt {
 };
 
 /*
-   BIT[2:0] = HW state
-   BIT[3] = Protocol PS state, 0: register active state,
-   1: register sleep state
-   BIT[4] = sub-state
-*/
+ * BIT[2:0] = HW state
+ * BIT[3] = Protocol PS state, 0: register active state,
+ * 1: register sleep state
+ * BIT[4] = sub-state
+ */
 
 #definePS_DPS  BIT(0)
 #definePS_LCLK (PS_DPS)
-- 
2.11.1



[PATCH 6/9] Staging: rtl8712: rtl871x_pwrctrl.h - style fix

2017-02-25 Thread Derek Robson
Fixed style fo block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_pwrctrl.h | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h 
b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index c82fdf85d474..4a873d053eea 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -48,11 +48,11 @@ enum Power_Mgnt {
 };
 
 /*
-   BIT[2:0] = HW state
-   BIT[3] = Protocol PS state, 0: register active state,
-   1: register sleep state
-   BIT[4] = sub-state
-*/
+ * BIT[2:0] = HW state
+ * BIT[3] = Protocol PS state, 0: register active state,
+ * 1: register sleep state
+ * BIT[4] = sub-state
+ */
 
 #definePS_DPS  BIT(0)
 #definePS_LCLK (PS_DPS)
-- 
2.11.1



[PATCH 5/9] Staging: rtl8712: rtl871x_mp_ioctl.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_mp_ioctl.h | 32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h 
b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
index 1102451a733d..c99a6dbae476 100644
--- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
+++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
@@ -162,26 +162,26 @@ static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = 
{
 */
{1, oid_rt_pro_set_channel_direct_call_hdl},/*0x08*/
{1, oid_null_function}, /*0x09
-   * OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
-   */
+* OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
+*/
{1, oid_null_function}, /*0x0A
-   * OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
-   */
+* OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
+*/
{1, oid_rt_pro_set_continuous_tx_hdl},  /*0x0B
-   * OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
-   */
+* 
OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
+*/
{1, oid_rt_pro_set_single_carrier_tx_hdl}, /*0x0C
-   * OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
-   */
+   * 
OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
+   */
{1, oid_null_function}, /*0x0D
-   * OID_RT_PRO_SET_TX_ANTENNA_BB
-   */
+* OID_RT_PRO_SET_TX_ANTENNA_BB
+*/
{1, oid_rt_pro_set_antenna_bb_hdl}, /*0x0E*/
{1, oid_null_function}, /*0x0F  OID_RT_PRO_SET_CR_SCRAMBLER*/
{1, oid_null_function}, /*0x10  OID_RT_PRO_SET_CR_NEW_FILTER*/
{1, oid_rt_pro_set_tx_power_control_hdl}, /*0x11
-   * OID_RT_PRO_SET_TX_POWER_CONTROL
-   */
+  * 
OID_RT_PRO_SET_TX_POWER_CONTROL
+  */
{1, oid_null_function}, /*0x12  OID_RT_PRO_SET_CR_TX_CONFIG*/
{1, oid_null_function}, /*0x13
 * OID_RT_PRO_GET_TX_POWER_CONTROL
@@ -218,11 +218,11 @@ static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = 
{
 *OID_RT_PRO_QUERY_PERMANENT_ADDRESS
 */
{1, oid_null_function}, /*0x2A
-*OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS
-*/
+*OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS
+*/
{1, oid_rt_pro_set_carrier_suppression_tx_hdl},/*0x2B
-*OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX
-*/
+   
*OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX
+   */
{1, oid_null_function}, /*0x2C  OID_RT_PRO_RECEIVE_PACKET*/
{1, oid_null_function}, /*0x2D  OID_RT_PRO_WRITE_EEPROM_BYTE*/
{1, oid_null_function}, /*0x2E  OID_RT_PRO_READ_EEPROM_BYTE*/
-- 
2.11.1



[PATCH 5/9] Staging: rtl8712: rtl871x_mp_ioctl.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_mp_ioctl.h | 32 +++---
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h 
b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
index 1102451a733d..c99a6dbae476 100644
--- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
+++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.h
@@ -162,26 +162,26 @@ static const struct oid_obj_priv oid_rtl_seg_81_80_00[] = 
{
 */
{1, oid_rt_pro_set_channel_direct_call_hdl},/*0x08*/
{1, oid_null_function}, /*0x09
-   * OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
-   */
+* OID_RT_PRO_SET_SLEEP_MODE_DIRECT_CALL
+*/
{1, oid_null_function}, /*0x0A
-   * OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
-   */
+* OID_RT_PRO_SET_WAKE_MODE_DIRECT_CALL
+*/
{1, oid_rt_pro_set_continuous_tx_hdl},  /*0x0B
-   * OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
-   */
+* 
OID_RT_PRO_SET_TX_CONTINUOUS_DIRECT_CALL
+*/
{1, oid_rt_pro_set_single_carrier_tx_hdl}, /*0x0C
-   * OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
-   */
+   * 
OID_RT_PRO_SET_SINGLE_CARRIER_TX_CONTINUOUS
+   */
{1, oid_null_function}, /*0x0D
-   * OID_RT_PRO_SET_TX_ANTENNA_BB
-   */
+* OID_RT_PRO_SET_TX_ANTENNA_BB
+*/
{1, oid_rt_pro_set_antenna_bb_hdl}, /*0x0E*/
{1, oid_null_function}, /*0x0F  OID_RT_PRO_SET_CR_SCRAMBLER*/
{1, oid_null_function}, /*0x10  OID_RT_PRO_SET_CR_NEW_FILTER*/
{1, oid_rt_pro_set_tx_power_control_hdl}, /*0x11
-   * OID_RT_PRO_SET_TX_POWER_CONTROL
-   */
+  * 
OID_RT_PRO_SET_TX_POWER_CONTROL
+  */
{1, oid_null_function}, /*0x12  OID_RT_PRO_SET_CR_TX_CONFIG*/
{1, oid_null_function}, /*0x13
 * OID_RT_PRO_GET_TX_POWER_CONTROL
@@ -218,11 +218,11 @@ static const struct oid_obj_priv oid_rtl_seg_81_80_20[] = 
{
 *OID_RT_PRO_QUERY_PERMANENT_ADDRESS
 */
{1, oid_null_function}, /*0x2A
-*OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS
-*/
+*OID_RT_PRO_SET_PHILIPS_RF_PARAMETERS
+*/
{1, oid_rt_pro_set_carrier_suppression_tx_hdl},/*0x2B
-*OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX
-*/
+   
*OID_RT_PRO_SET_CARRIER_SUPPRESSION_TX
+   */
{1, oid_null_function}, /*0x2C  OID_RT_PRO_RECEIVE_PACKET*/
{1, oid_null_function}, /*0x2D  OID_RT_PRO_WRITE_EEPROM_BYTE*/
{1, oid_null_function}, /*0x2E  OID_RT_PRO_READ_EEPROM_BYTE*/
-- 
2.11.1



[PATCH 3/9] Staging: rtl8712: rtl871x_io.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments.
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_io.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_io.h 
b/drivers/staging/rtl8712/rtl871x_io.h
index 26dd24cddd38..dd054d7367b3 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
+++ b/drivers/staging/rtl8712/rtl871x_io.h
@@ -49,9 +49,9 @@
 #define _IO_CMDMASK_   (0x1F80)
 
 /*
-   For prompt mode accessing, caller shall free io_req
-   Otherwise, io_handler will free io_req
-*/
+ * For prompt mode accessing, caller shall free io_req
+ * Otherwise, io_handler will free io_req
+ */
 /* IO STATUS TYPE */
 #define _IO_ERR_   BIT(2)
 #define _IO_SUCCESS_   BIT(1)
@@ -69,8 +69,8 @@
 #define IO_WR16_ASYNC  (_IO_WRITE_ | _IO_HW_)
 #define IO_WR8_ASYNC   (_IO_WRITE_ | _IO_BYTE_)
 /*
-   Only Sync. burst accessing is provided.
-*/
+ * Only Sync. burst accessing is provided.
+ */
 #define IO_WR_BURST(x) (IO_WRITE_ | _IO_SYNC_ | _IO_BURST_ | \
((x) & _IOSZ_MASK_))
 #define IO_RD_BURST(x) (_IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
@@ -218,8 +218,8 @@ struct reg_protocol_wt {
 };
 
 /*
-Below is the data structure used by _io_handler
-*/
+ * Below is the data structure used by _io_handler
+ */
 
 struct io_queue {
spinlock_t lock;
-- 
2.11.1



[PATCH 3/9] Staging: rtl8712: rtl871x_io.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments.
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_io.h | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_io.h 
b/drivers/staging/rtl8712/rtl871x_io.h
index 26dd24cddd38..dd054d7367b3 100644
--- a/drivers/staging/rtl8712/rtl871x_io.h
+++ b/drivers/staging/rtl8712/rtl871x_io.h
@@ -49,9 +49,9 @@
 #define _IO_CMDMASK_   (0x1F80)
 
 /*
-   For prompt mode accessing, caller shall free io_req
-   Otherwise, io_handler will free io_req
-*/
+ * For prompt mode accessing, caller shall free io_req
+ * Otherwise, io_handler will free io_req
+ */
 /* IO STATUS TYPE */
 #define _IO_ERR_   BIT(2)
 #define _IO_SUCCESS_   BIT(1)
@@ -69,8 +69,8 @@
 #define IO_WR16_ASYNC  (_IO_WRITE_ | _IO_HW_)
 #define IO_WR8_ASYNC   (_IO_WRITE_ | _IO_BYTE_)
 /*
-   Only Sync. burst accessing is provided.
-*/
+ * Only Sync. burst accessing is provided.
+ */
 #define IO_WR_BURST(x) (IO_WRITE_ | _IO_SYNC_ | _IO_BURST_ | \
((x) & _IOSZ_MASK_))
 #define IO_RD_BURST(x) (_IO_SYNC_ | _IO_BURST_ | ((x) & _IOSZ_MASK_))
@@ -218,8 +218,8 @@ struct reg_protocol_wt {
 };
 
 /*
-Below is the data structure used by _io_handler
-*/
+ * Below is the data structure used by _io_handler
+ */
 
 struct io_queue {
spinlock_t lock;
-- 
2.11.1



[PATCH 0/9] drivers: staging: rtl8712 - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments across whole of the rtl8712 driver
Found using check patch


Derek Robson (9):
  Staging: rtl8712: rtl871x_cmd.h - block comments
  Staging: rtl8712: rtl871x_event.h - style fix
  Staging: rtl8712: rtl871x_io.h - style fix
  Staging: rtl8712: rtl871x_mlme.h - style fix
  Staging: rtl8712: rtl871x_mp_ioctl.h - style fix
  Staging: rtl8712: rtl871x_pwrctrl.h - style fix
  Staging: rtl8712: rtl871x_recv.h - style fix
  Staging: rtl8712: wifi.h - style fix
  Staging: rtl8712: wlan_bssdef.h - style fix

 drivers/staging/rtl8712/rtl871x_cmd.h  |  2 +-
 drivers/staging/rtl8712/rtl871x_event.h|  8 
 drivers/staging/rtl8712/rtl871x_io.h   | 14 ++---
 drivers/staging/rtl8712/rtl871x_mlme.h | 16 +++
 drivers/staging/rtl8712/rtl871x_mp_ioctl.h | 32 +++---
 drivers/staging/rtl8712/rtl871x_pwrctrl.h  | 10 +-
 drivers/staging/rtl8712/rtl871x_recv.h | 12 +--
 drivers/staging/rtl8712/wifi.h | 12 +--
 drivers/staging/rtl8712/wlan_bssdef.h  |  6 +++---
 9 files changed, 56 insertions(+), 56 deletions(-)

-- 
2.11.1



[PATCH 0/9] drivers: staging: rtl8712 - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments across whole of the rtl8712 driver
Found using check patch


Derek Robson (9):
  Staging: rtl8712: rtl871x_cmd.h - block comments
  Staging: rtl8712: rtl871x_event.h - style fix
  Staging: rtl8712: rtl871x_io.h - style fix
  Staging: rtl8712: rtl871x_mlme.h - style fix
  Staging: rtl8712: rtl871x_mp_ioctl.h - style fix
  Staging: rtl8712: rtl871x_pwrctrl.h - style fix
  Staging: rtl8712: rtl871x_recv.h - style fix
  Staging: rtl8712: wifi.h - style fix
  Staging: rtl8712: wlan_bssdef.h - style fix

 drivers/staging/rtl8712/rtl871x_cmd.h  |  2 +-
 drivers/staging/rtl8712/rtl871x_event.h|  8 
 drivers/staging/rtl8712/rtl871x_io.h   | 14 ++---
 drivers/staging/rtl8712/rtl871x_mlme.h | 16 +++
 drivers/staging/rtl8712/rtl871x_mp_ioctl.h | 32 +++---
 drivers/staging/rtl8712/rtl871x_pwrctrl.h  | 10 +-
 drivers/staging/rtl8712/rtl871x_recv.h | 12 +--
 drivers/staging/rtl8712/wifi.h | 12 +--
 drivers/staging/rtl8712/wlan_bssdef.h  |  6 +++---
 9 files changed, 56 insertions(+), 56 deletions(-)

-- 
2.11.1



[PATCH 4/9] Staging: rtl8712: rtl871x_mlme.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_mlme.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mlme.h 
b/drivers/staging/rtl8712/rtl871x_mlme.h
index 53a23234c598..b21f28140f53 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.h
+++ b/drivers/staging/rtl8712/rtl871x_mlme.h
@@ -68,14 +68,14 @@
 #define _FW_UNDER_SURVEY   WIFI_SITE_MONITOR
 
 /*
-there are several "locks" in mlme_priv,
-since mlme_priv is a shared resource between many threads,
-like ISR/Call-Back functions, the OID handlers, and even timer functions.
-Each _queue has its own locks, already.
-Other items are protected by mlme_priv.lock.
-To avoid possible dead lock, any thread trying to modify mlme_priv
-SHALL not lock up more than one lock at a time!
-*/
+ * there are several "locks" in mlme_priv,
+ * since mlme_priv is a shared resource between many threads,
+ * like ISR/Call-Back functions, the OID handlers, and even timer functions.
+ * Each _queue has its own locks, already.
+ * Other items are protected by mlme_priv.lock.
+ * To avoid possible dead lock, any thread trying to modify mlme_priv
+ * SHALL not lock up more than one lock at a time!
+ */
 
 #define traffic_threshold  10
 #definetraffic_scan_period 500
-- 
2.11.1



[PATCH 2/9] Staging: rtl8712: rtl871x_event.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_event.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
b/drivers/staging/rtl8712/rtl871x_event.h
index 5db8620980e5..517137906e6c 100644
--- a/drivers/staging/rtl8712/rtl871x_event.h
+++ b/drivers/staging/rtl8712/rtl871x_event.h
@@ -34,7 +34,7 @@
 
 /*
  * Used to report a bss has been scanned
-*/
+ */
 struct survey_event{
struct wlan_bssid_ex bss;
 };
@@ -42,7 +42,7 @@ struct survey_event   {
 /*
  * Used to report that the requested site survey has been done.
  * bss_cnt indicates the number of bss that has been reported.
-*/
+ */
 struct surveydone_event {
unsigned intbss_cnt;
 
@@ -54,7 +54,7 @@ struct surveydone_event {
  *  -1: authentication fail
  *  -2: association fail
  *  > 0: TID
-*/
+ */
 struct joinbss_event {
struct  wlan_networknetwork;
 };
@@ -62,7 +62,7 @@ struct joinbss_event {
 /*
  * Used to report a given STA has joinned the created BSS.
  * It is used in AP/Ad-HoC(M) mode.
-*/
+ */
 struct stassoc_event {
unsigned char macaddr[6];
unsigned char rsvd[2];
-- 
2.11.1



[PATCH 4/9] Staging: rtl8712: rtl871x_mlme.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_mlme.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_mlme.h 
b/drivers/staging/rtl8712/rtl871x_mlme.h
index 53a23234c598..b21f28140f53 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.h
+++ b/drivers/staging/rtl8712/rtl871x_mlme.h
@@ -68,14 +68,14 @@
 #define _FW_UNDER_SURVEY   WIFI_SITE_MONITOR
 
 /*
-there are several "locks" in mlme_priv,
-since mlme_priv is a shared resource between many threads,
-like ISR/Call-Back functions, the OID handlers, and even timer functions.
-Each _queue has its own locks, already.
-Other items are protected by mlme_priv.lock.
-To avoid possible dead lock, any thread trying to modify mlme_priv
-SHALL not lock up more than one lock at a time!
-*/
+ * there are several "locks" in mlme_priv,
+ * since mlme_priv is a shared resource between many threads,
+ * like ISR/Call-Back functions, the OID handlers, and even timer functions.
+ * Each _queue has its own locks, already.
+ * Other items are protected by mlme_priv.lock.
+ * To avoid possible dead lock, any thread trying to modify mlme_priv
+ * SHALL not lock up more than one lock at a time!
+ */
 
 #define traffic_threshold  10
 #definetraffic_scan_period 500
-- 
2.11.1



[PATCH 2/9] Staging: rtl8712: rtl871x_event.h - style fix

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_event.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_event.h 
b/drivers/staging/rtl8712/rtl871x_event.h
index 5db8620980e5..517137906e6c 100644
--- a/drivers/staging/rtl8712/rtl871x_event.h
+++ b/drivers/staging/rtl8712/rtl871x_event.h
@@ -34,7 +34,7 @@
 
 /*
  * Used to report a bss has been scanned
-*/
+ */
 struct survey_event{
struct wlan_bssid_ex bss;
 };
@@ -42,7 +42,7 @@ struct survey_event   {
 /*
  * Used to report that the requested site survey has been done.
  * bss_cnt indicates the number of bss that has been reported.
-*/
+ */
 struct surveydone_event {
unsigned intbss_cnt;
 
@@ -54,7 +54,7 @@ struct surveydone_event {
  *  -1: authentication fail
  *  -2: association fail
  *  > 0: TID
-*/
+ */
 struct joinbss_event {
struct  wlan_networknetwork;
 };
@@ -62,7 +62,7 @@ struct joinbss_event {
 /*
  * Used to report a given STA has joinned the created BSS.
  * It is used in AP/Ad-HoC(M) mode.
-*/
+ */
 struct stassoc_event {
unsigned char macaddr[6];
unsigned char rsvd[2];
-- 
2.11.1



[PATCH 1/9] Staging: rtl8712: rtl871x_cmd.h - block comments

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h 
b/drivers/staging/rtl8712/rtl871x_cmd.h
index 4734ca856aa2..24da2ccea04f 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.h
+++ b/drivers/staging/rtl8712/rtl871x_cmd.h
@@ -144,7 +144,7 @@ struct disconnect_parm {
  * #define IW_MODE_REPEAT  4   // Wireless Repeater (forwarder)
  * #define IW_MODE_SECOND  5   // Secondary master/repeater (backup)
  * #define IW_MODE_MONITOR 6   // Passive monitor (listen only)
-*/
+ */
 struct setopmode_parm {
u8  mode;
u8  rsvd[3];
-- 
2.11.1



[PATCH 1/9] Staging: rtl8712: rtl871x_cmd.h - block comments

2017-02-25 Thread Derek Robson
Fixed style of block comments
Found using checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/rtl8712/rtl871x_cmd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl871x_cmd.h 
b/drivers/staging/rtl8712/rtl871x_cmd.h
index 4734ca856aa2..24da2ccea04f 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.h
+++ b/drivers/staging/rtl8712/rtl871x_cmd.h
@@ -144,7 +144,7 @@ struct disconnect_parm {
  * #define IW_MODE_REPEAT  4   // Wireless Repeater (forwarder)
  * #define IW_MODE_SECOND  5   // Secondary master/repeater (backup)
  * #define IW_MODE_MONITOR 6   // Passive monitor (listen only)
-*/
+ */
 struct setopmode_parm {
u8  mode;
u8  rsvd[3];
-- 
2.11.1



Re: [PATCH v2 2/2] arm64: dts: hisilicon: add dts files for hi3798cv200-poplar board

2017-02-25 Thread Andreas Färber
Am 22.02.2017 um 09:38 schrieb Jiancheng Xue:
> Add basic dts files for hi3798cv200-poplar board. Poplar is the
> first development board compliant with the 96Boards Enterprise
> edition TV Platform specification. The board features the

"Enterprise Edition"

> Hi3798CV200 with an integrated quad-core 64-bit ARM Cortex A53
> processor and high performance Mali T720 GPU.
> 
> Signed-off-by: Jiancheng Xue 
> Reviewed-by: Alex Elder 
> ---
> Changed Log:
> v2:
> - Fixed issues pointed by Rob Herring.
>   1. Moved the led node out of the soc node.
>   2. Restrained the ranges property of soc node smaller.
> - Refined the patch according to Andreas's suggestions.
> - Enabled gmac1 device node instead of gmac0.
> - Added a compatible string "syscon" for crg nodes.
> 
>  arch/arm64/boot/dts/hisilicon/Makefile |   1 +
>  .../boot/dts/hisilicon/hi3798cv200-poplar.dts  | 171 +
>  arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 415 
> +
>  3 files changed, 587 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
> 
> diff --git a/arch/arm64/boot/dts/hisilicon/Makefile 
> b/arch/arm64/boot/dts/hisilicon/Makefile
> index c3a6c19..8960eca 100644
> --- a/arch/arm64/boot/dts/hisilicon/Makefile
> +++ b/arch/arm64/boot/dts/hisilicon/Makefile
> @@ -1,4 +1,5 @@
>  dtb-$(CONFIG_ARCH_HISI) += hi3660-hikey960.dtb
> +dtb-$(CONFIG_ARCH_HISI) += hi3798cv200-poplar.dtb
>  dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb
>  dtb-$(CONFIG_ARCH_HISI) += hip05-d02.dtb
>  dtb-$(CONFIG_ARCH_HISI) += hip06-d03.dtb
> diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts 
> b/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
> new file mode 100644
> index 000..967853a
> --- /dev/null
> +++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
> @@ -0,0 +1,171 @@
> +/*
> + * DTS File for HiSilicon Poplar Development Board
> + *
> + * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program. If not, see .

Rob has requested that new DT files use SPDX-License-Identifier, i.e.:

SPDX-License-Identifier: GPL-2.0+

although I believe dual-licensing is generally preferred for DT files:

SPDX-License-Identifier: (GPL-2.0+ OR MIT)

> + */
> +
> +/dts-v1/;
> +
> +#include 
> +#include "hi3798cv200.dtsi"
> +
> +/ {
> + model = "HiSilicon Poplar Development Board";
> + compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200";
> +
> + aliases {
> + serial0 = 

No alias for uart2?

> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + memory@0 {
> + device_type = "memory";
> + reg = <0x0 0x0 0x0 0x8000>;
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + user-led0 {
> + label = "USER-LED0";
> + gpios = < 3 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "heartbeat";
> + default-state = "off";
> + };
> +
> + user-led1 {
> + label = "USER-LED1";
> + gpios = < 1 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "mmc0";
> + default-state = "off";
> + };
> +
> + user-led2 {
> + label = "USER-LED2";
> + gpios = < 2 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "none";
> + default-state = "off";
> + };
> +
> + user-led3 {
> + label = "USER-LED3";
> + gpios = < 6 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "cpu0";
> + default-state = "off";
> + };
> + };
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> + label = "LS-UART0";
> +};
> +/* No optional LS-UART1 on Low Speed Expansion Connector. */
> +
> + {
> + status = "okay";
> + label = "LS-I2C0";
> +};
> +
> + {
> + status = "okay";
> + label = "LS-I2C1";
> +};
> +
> + {
> + status = "okay";
> + label = "LS-SPI0";
> +};
> +
> + {
> + 

Re: [PATCH v2 2/2] arm64: dts: hisilicon: add dts files for hi3798cv200-poplar board

2017-02-25 Thread Andreas Färber
Am 22.02.2017 um 09:38 schrieb Jiancheng Xue:
> Add basic dts files for hi3798cv200-poplar board. Poplar is the
> first development board compliant with the 96Boards Enterprise
> edition TV Platform specification. The board features the

"Enterprise Edition"

> Hi3798CV200 with an integrated quad-core 64-bit ARM Cortex A53
> processor and high performance Mali T720 GPU.
> 
> Signed-off-by: Jiancheng Xue 
> Reviewed-by: Alex Elder 
> ---
> Changed Log:
> v2:
> - Fixed issues pointed by Rob Herring.
>   1. Moved the led node out of the soc node.
>   2. Restrained the ranges property of soc node smaller.
> - Refined the patch according to Andreas's suggestions.
> - Enabled gmac1 device node instead of gmac0.
> - Added a compatible string "syscon" for crg nodes.
> 
>  arch/arm64/boot/dts/hisilicon/Makefile |   1 +
>  .../boot/dts/hisilicon/hi3798cv200-poplar.dts  | 171 +
>  arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi | 415 
> +
>  3 files changed, 587 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi3798cv200.dtsi
> 
> diff --git a/arch/arm64/boot/dts/hisilicon/Makefile 
> b/arch/arm64/boot/dts/hisilicon/Makefile
> index c3a6c19..8960eca 100644
> --- a/arch/arm64/boot/dts/hisilicon/Makefile
> +++ b/arch/arm64/boot/dts/hisilicon/Makefile
> @@ -1,4 +1,5 @@
>  dtb-$(CONFIG_ARCH_HISI) += hi3660-hikey960.dtb
> +dtb-$(CONFIG_ARCH_HISI) += hi3798cv200-poplar.dtb
>  dtb-$(CONFIG_ARCH_HISI) += hi6220-hikey.dtb
>  dtb-$(CONFIG_ARCH_HISI) += hip05-d02.dtb
>  dtb-$(CONFIG_ARCH_HISI) += hip06-d03.dtb
> diff --git a/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts 
> b/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
> new file mode 100644
> index 000..967853a
> --- /dev/null
> +++ b/arch/arm64/boot/dts/hisilicon/hi3798cv200-poplar.dts
> @@ -0,0 +1,171 @@
> +/*
> + * DTS File for HiSilicon Poplar Development Board
> + *
> + * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program. If not, see .

Rob has requested that new DT files use SPDX-License-Identifier, i.e.:

SPDX-License-Identifier: GPL-2.0+

although I believe dual-licensing is generally preferred for DT files:

SPDX-License-Identifier: (GPL-2.0+ OR MIT)

> + */
> +
> +/dts-v1/;
> +
> +#include 
> +#include "hi3798cv200.dtsi"
> +
> +/ {
> + model = "HiSilicon Poplar Development Board";
> + compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200";
> +
> + aliases {
> + serial0 = 

No alias for uart2?

> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +
> + memory@0 {
> + device_type = "memory";
> + reg = <0x0 0x0 0x0 0x8000>;
> + };
> +
> + leds {
> + compatible = "gpio-leds";
> +
> + user-led0 {
> + label = "USER-LED0";
> + gpios = < 3 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "heartbeat";
> + default-state = "off";
> + };
> +
> + user-led1 {
> + label = "USER-LED1";
> + gpios = < 1 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "mmc0";
> + default-state = "off";
> + };
> +
> + user-led2 {
> + label = "USER-LED2";
> + gpios = < 2 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "none";
> + default-state = "off";
> + };
> +
> + user-led3 {
> + label = "USER-LED3";
> + gpios = < 6 GPIO_ACTIVE_LOW>;
> + linux,default-trigger = "cpu0";
> + default-state = "off";
> + };
> + };
> +};
> +
> + {
> + status = "okay";
> +};
> +
> + {
> + status = "okay";
> + label = "LS-UART0";
> +};
> +/* No optional LS-UART1 on Low Speed Expansion Connector. */
> +
> + {
> + status = "okay";
> + label = "LS-I2C0";
> +};
> +
> + {
> + status = "okay";
> + label = "LS-I2C1";
> +};
> +
> + {
> + status = "okay";
> + label = "LS-SPI0";
> +};
> +
> + {
> + status = "okay";
> + gpio-line-names 

Re: [PATCH 1/1] fs: Allows for the pivot_root syscall to be optional

2017-02-25 Thread Nicolas Pitre
On Sat, 25 Feb 2017, Brian Ashworth wrote:

> The pivot_root syscall is not needed on systems that do not use
> any intermediate filesystem. Allowing for pivot_root to be
> ommitted from the kernel will aid in the tinification efforts.
> 
> Without CONFIG_PIVOT_ROOT_SYSCALL set
> add/remove: 0/2 grow/shrink: 1/0 up/down: 45/-707 (-662)
> function old new   delta
> attach_recursive_mnt 349 394 +45
> attach_mnt71   - -71
> sys_pivot_root   636   --636
> Total: Before=1899893, After=1899231, chg -0.03%

A -0.03% size difference doesn't seem much.  To bring up a more 
realistic scenario for tinification statistics, you could start from 
"make tinyconfig" instead.

> Signed-off-by: Brian Ashworth 
> ---
>  fs/namespace.c  |  2 ++
>  init/Kconfig| 10 ++
>  kernel/sys_ni.c |  1 +
>  3 files changed, 13 insertions(+)

I agree that this is a much more interesting diffstat than the previous 
one.

Acked-by: Nicolas Pitre 


> diff --git a/fs/namespace.c b/fs/namespace.c
> index 487ba30bb5c6..5e24a08bfb36 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -3058,6 +3058,7 @@ bool path_is_under(const struct path *path1, const 
> struct path *path2)
>  }
>  EXPORT_SYMBOL(path_is_under);
>  
> +#ifdef CONFIG_PIVOT_ROOT_SYSCALL
>  /*
>   * pivot_root Semantics:
>   * Moves the root file system of the current process to the directory 
> put_old,
> @@ -3180,6 +3181,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, 
> new_root,
>  out0:
>   return error;
>  }
> +#endif  /* CONFIG_PIVOT_ROOT_SYSCALL */
>  
>  static void __init init_mount_tree(void)
>  {
> diff --git a/init/Kconfig b/init/Kconfig
> index 8c39615165b7..4ea9ab25ec30 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1450,6 +1450,16 @@ config SYSCTL_SYSCALL
>  
> If unsure say N here.
>  
> +config PIVOT_ROOT_SYSCALL
> + bool "Pivot_root syscall support" if EXPERT
> + default y
> + help
> +   pivot_root is a system call that allows the root to be moved and
> +   replaced by another root. This is needed for intermediate file
> +   systems such as initrd.
> +
> +   If unsure say Y here.
> +
>  config POSIX_TIMERS
>   bool "Posix Clocks & timers" if EXPERT
>   default y
> diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
> index 8acef8576ce9..7bd207571f87 100644
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -178,6 +178,7 @@ cond_syscall(sys_setfsgid);
>  cond_syscall(sys_capget);
>  cond_syscall(sys_capset);
>  cond_syscall(sys_copy_file_range);
> +cond_syscall(sys_pivot_root);
>  
>  /* arch-specific weak syscall entries */
>  cond_syscall(sys_pciconfig_read);
> -- 
> 2.11.1
> 
> 


Re: [PATCH 1/1] fs: Allows for the pivot_root syscall to be optional

2017-02-25 Thread Nicolas Pitre
On Sat, 25 Feb 2017, Brian Ashworth wrote:

> The pivot_root syscall is not needed on systems that do not use
> any intermediate filesystem. Allowing for pivot_root to be
> ommitted from the kernel will aid in the tinification efforts.
> 
> Without CONFIG_PIVOT_ROOT_SYSCALL set
> add/remove: 0/2 grow/shrink: 1/0 up/down: 45/-707 (-662)
> function old new   delta
> attach_recursive_mnt 349 394 +45
> attach_mnt71   - -71
> sys_pivot_root   636   --636
> Total: Before=1899893, After=1899231, chg -0.03%

A -0.03% size difference doesn't seem much.  To bring up a more 
realistic scenario for tinification statistics, you could start from 
"make tinyconfig" instead.

> Signed-off-by: Brian Ashworth 
> ---
>  fs/namespace.c  |  2 ++
>  init/Kconfig| 10 ++
>  kernel/sys_ni.c |  1 +
>  3 files changed, 13 insertions(+)

I agree that this is a much more interesting diffstat than the previous 
one.

Acked-by: Nicolas Pitre 


> diff --git a/fs/namespace.c b/fs/namespace.c
> index 487ba30bb5c6..5e24a08bfb36 100644
> --- a/fs/namespace.c
> +++ b/fs/namespace.c
> @@ -3058,6 +3058,7 @@ bool path_is_under(const struct path *path1, const 
> struct path *path2)
>  }
>  EXPORT_SYMBOL(path_is_under);
>  
> +#ifdef CONFIG_PIVOT_ROOT_SYSCALL
>  /*
>   * pivot_root Semantics:
>   * Moves the root file system of the current process to the directory 
> put_old,
> @@ -3180,6 +3181,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, 
> new_root,
>  out0:
>   return error;
>  }
> +#endif  /* CONFIG_PIVOT_ROOT_SYSCALL */
>  
>  static void __init init_mount_tree(void)
>  {
> diff --git a/init/Kconfig b/init/Kconfig
> index 8c39615165b7..4ea9ab25ec30 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1450,6 +1450,16 @@ config SYSCTL_SYSCALL
>  
> If unsure say N here.
>  
> +config PIVOT_ROOT_SYSCALL
> + bool "Pivot_root syscall support" if EXPERT
> + default y
> + help
> +   pivot_root is a system call that allows the root to be moved and
> +   replaced by another root. This is needed for intermediate file
> +   systems such as initrd.
> +
> +   If unsure say Y here.
> +
>  config POSIX_TIMERS
>   bool "Posix Clocks & timers" if EXPERT
>   default y
> diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
> index 8acef8576ce9..7bd207571f87 100644
> --- a/kernel/sys_ni.c
> +++ b/kernel/sys_ni.c
> @@ -178,6 +178,7 @@ cond_syscall(sys_setfsgid);
>  cond_syscall(sys_capget);
>  cond_syscall(sys_capset);
>  cond_syscall(sys_copy_file_range);
> +cond_syscall(sys_pivot_root);
>  
>  /* arch-specific weak syscall entries */
>  cond_syscall(sys_pciconfig_read);
> -- 
> 2.11.1
> 
> 


Re: [PATCH v2 1/2] dt-bindings: arm: hisilicon: add bindings for hi3798cv200 SoC and Poplar board

2017-02-25 Thread Andreas Färber
Am 22.02.2017 um 09:38 schrieb Jiancheng Xue:
> Add bindings for HiSilicon hi3798cv200 SoC and Poplar Board.
> 
> Signed-off-by: Jiancheng Xue 
> ---
>  Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt 
> b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> index f1c1e21..1fd3dd7 100644
> --- a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> +++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> @@ -4,6 +4,10 @@ Hi3660 SoC
>  Required root node properties:
>   - compatible = "hisilicon,hi3660";
>  
> +Hi3798cv200 Poplar Board
> +Required root node properties:
> + - compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200";

Please remember to CC previous reviewers.

This still looks wrong: Why is this not "hisilicon,poplar" if you choose
against "tocoding,poplar"? Is there a second Poplar board with a
different SoC? Even then it would be redundant with the second
compatible string.

Regards,
Andreas

> +
>  Hi4511 Board
>  Required root node properties:
>   - compatible = "hisilicon,hi3620-hi4511";

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


Re: [PATCH v2 1/2] dt-bindings: arm: hisilicon: add bindings for hi3798cv200 SoC and Poplar board

2017-02-25 Thread Andreas Färber
Am 22.02.2017 um 09:38 schrieb Jiancheng Xue:
> Add bindings for HiSilicon hi3798cv200 SoC and Poplar Board.
> 
> Signed-off-by: Jiancheng Xue 
> ---
>  Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt 
> b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> index f1c1e21..1fd3dd7 100644
> --- a/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> +++ b/Documentation/devicetree/bindings/arm/hisilicon/hisilicon.txt
> @@ -4,6 +4,10 @@ Hi3660 SoC
>  Required root node properties:
>   - compatible = "hisilicon,hi3660";
>  
> +Hi3798cv200 Poplar Board
> +Required root node properties:
> + - compatible = "hisilicon,hi3798cv200-poplar", "hisilicon,hi3798cv200";

Please remember to CC previous reviewers.

This still looks wrong: Why is this not "hisilicon,poplar" if you choose
against "tocoding,poplar"? Is there a second Poplar board with a
different SoC? Even then it would be redundant with the second
compatible string.

Regards,
Andreas

> +
>  Hi4511 Board
>  Required root node properties:
>   - compatible = "hisilicon,hi3620-hi4511";

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)


[PATCH 1/1] fs: Allows for the pivot_root syscall to be optional

2017-02-25 Thread Brian Ashworth
The pivot_root syscall is not needed on systems that do not use
any intermediate filesystem. Allowing for pivot_root to be
ommitted from the kernel will aid in the tinification efforts.

Without CONFIG_PIVOT_ROOT_SYSCALL set
add/remove: 0/2 grow/shrink: 1/0 up/down: 45/-707 (-662)
function old new   delta
attach_recursive_mnt 349 394 +45
attach_mnt71   - -71
sys_pivot_root   636   --636
Total: Before=1899893, After=1899231, chg -0.03%

Signed-off-by: Brian Ashworth 
---
 fs/namespace.c  |  2 ++
 init/Kconfig| 10 ++
 kernel/sys_ni.c |  1 +
 3 files changed, 13 insertions(+)

diff --git a/fs/namespace.c b/fs/namespace.c
index 487ba30bb5c6..5e24a08bfb36 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3058,6 +3058,7 @@ bool path_is_under(const struct path *path1, const struct 
path *path2)
 }
 EXPORT_SYMBOL(path_is_under);
 
+#ifdef CONFIG_PIVOT_ROOT_SYSCALL
 /*
  * pivot_root Semantics:
  * Moves the root file system of the current process to the directory put_old,
@@ -3180,6 +3181,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
 out0:
return error;
 }
+#endif  /* CONFIG_PIVOT_ROOT_SYSCALL */
 
 static void __init init_mount_tree(void)
 {
diff --git a/init/Kconfig b/init/Kconfig
index 8c39615165b7..4ea9ab25ec30 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1450,6 +1450,16 @@ config SYSCTL_SYSCALL
 
  If unsure say N here.
 
+config PIVOT_ROOT_SYSCALL
+   bool "Pivot_root syscall support" if EXPERT
+   default y
+   help
+ pivot_root is a system call that allows the root to be moved and
+ replaced by another root. This is needed for intermediate file
+ systems such as initrd.
+
+ If unsure say Y here.
+
 config POSIX_TIMERS
bool "Posix Clocks & timers" if EXPERT
default y
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 8acef8576ce9..7bd207571f87 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -178,6 +178,7 @@ cond_syscall(sys_setfsgid);
 cond_syscall(sys_capget);
 cond_syscall(sys_capset);
 cond_syscall(sys_copy_file_range);
+cond_syscall(sys_pivot_root);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
-- 
2.11.1



[PATCH 1/1] fs: Allows for the pivot_root syscall to be optional

2017-02-25 Thread Brian Ashworth
The pivot_root syscall is not needed on systems that do not use
any intermediate filesystem. Allowing for pivot_root to be
ommitted from the kernel will aid in the tinification efforts.

Without CONFIG_PIVOT_ROOT_SYSCALL set
add/remove: 0/2 grow/shrink: 1/0 up/down: 45/-707 (-662)
function old new   delta
attach_recursive_mnt 349 394 +45
attach_mnt71   - -71
sys_pivot_root   636   --636
Total: Before=1899893, After=1899231, chg -0.03%

Signed-off-by: Brian Ashworth 
---
 fs/namespace.c  |  2 ++
 init/Kconfig| 10 ++
 kernel/sys_ni.c |  1 +
 3 files changed, 13 insertions(+)

diff --git a/fs/namespace.c b/fs/namespace.c
index 487ba30bb5c6..5e24a08bfb36 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3058,6 +3058,7 @@ bool path_is_under(const struct path *path1, const struct 
path *path2)
 }
 EXPORT_SYMBOL(path_is_under);
 
+#ifdef CONFIG_PIVOT_ROOT_SYSCALL
 /*
  * pivot_root Semantics:
  * Moves the root file system of the current process to the directory put_old,
@@ -3180,6 +3181,7 @@ SYSCALL_DEFINE2(pivot_root, const char __user *, new_root,
 out0:
return error;
 }
+#endif  /* CONFIG_PIVOT_ROOT_SYSCALL */
 
 static void __init init_mount_tree(void)
 {
diff --git a/init/Kconfig b/init/Kconfig
index 8c39615165b7..4ea9ab25ec30 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1450,6 +1450,16 @@ config SYSCTL_SYSCALL
 
  If unsure say N here.
 
+config PIVOT_ROOT_SYSCALL
+   bool "Pivot_root syscall support" if EXPERT
+   default y
+   help
+ pivot_root is a system call that allows the root to be moved and
+ replaced by another root. This is needed for intermediate file
+ systems such as initrd.
+
+ If unsure say Y here.
+
 config POSIX_TIMERS
bool "Posix Clocks & timers" if EXPERT
default y
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index 8acef8576ce9..7bd207571f87 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -178,6 +178,7 @@ cond_syscall(sys_setfsgid);
 cond_syscall(sys_capget);
 cond_syscall(sys_capset);
 cond_syscall(sys_copy_file_range);
+cond_syscall(sys_pivot_root);
 
 /* arch-specific weak syscall entries */
 cond_syscall(sys_pciconfig_read);
-- 
2.11.1



[PATCH] Staging: bcm2835-audio - style fix, block comments

2017-02-25 Thread Derek Robson
Fixed block comments as found by checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/bcm2835-audio/bcm2835-ctl.c | 3 ++-
 drivers/staging/bcm2835-audio/bcm2835-pcm.c | 3 ++-
 drivers/staging/bcm2835-audio/bcm2835.h | 5 -
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/bcm2835-audio/bcm2835-ctl.c
index a4ffa1bf53e5..1dd68c116f57 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-ctl.c
@@ -248,7 +248,8 @@ static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol 
*kcontrol,
 {
/* bcm2835 supports only consumer mode and sets all other format flags
 * automatically. So the only thing left is signalling non-audio
-* content */
+* content
+*/
ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO;
return 0;
 }
diff --git a/drivers/staging/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
index 16127e062661..d965e61b8a6a 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
@@ -308,7 +308,8 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream 
*substream)
 
/* notify the vchiq that it should enter spdif passthrough mode by
 * setting channels=0 (see
-* https://github.com/raspberrypi/linux/issues/528) */
+* https://github.com/raspberrypi/linux/issues/528)
+*/
if (chip->spdif_status & IEC958_AES0_NONAUDIO)
channels = 0;
else
diff --git a/drivers/staging/bcm2835-audio/bcm2835.h 
b/drivers/staging/bcm2835-audio/bcm2835.h
index 36e3ef80e60c..292cf1dc4d7a 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.h
+++ b/drivers/staging/bcm2835-audio/bcm2835.h
@@ -26,11 +26,6 @@
 #include 
 #include 
 
-/*
-#define AUDIO_DEBUG_ENABLE
-#define AUDIO_VERBOSE_DEBUG_ENABLE
- */
-
 /* Debug macros */
 
 #ifdef AUDIO_DEBUG_ENABLE
-- 
2.11.1



[PATCH] Staging: bcm2835-audio - style fix, block comments

2017-02-25 Thread Derek Robson
Fixed block comments as found by checkpatch

Signed-off-by: Derek Robson 
---
 drivers/staging/bcm2835-audio/bcm2835-ctl.c | 3 ++-
 drivers/staging/bcm2835-audio/bcm2835-pcm.c | 3 ++-
 drivers/staging/bcm2835-audio/bcm2835.h | 5 -
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-ctl.c 
b/drivers/staging/bcm2835-audio/bcm2835-ctl.c
index a4ffa1bf53e5..1dd68c116f57 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-ctl.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-ctl.c
@@ -248,7 +248,8 @@ static int snd_bcm2835_spdif_mask_get(struct snd_kcontrol 
*kcontrol,
 {
/* bcm2835 supports only consumer mode and sets all other format flags
 * automatically. So the only thing left is signalling non-audio
-* content */
+* content
+*/
ucontrol->value.iec958.status[0] = IEC958_AES0_NONAUDIO;
return 0;
 }
diff --git a/drivers/staging/bcm2835-audio/bcm2835-pcm.c 
b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
index 16127e062661..d965e61b8a6a 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-pcm.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-pcm.c
@@ -308,7 +308,8 @@ static int snd_bcm2835_pcm_prepare(struct snd_pcm_substream 
*substream)
 
/* notify the vchiq that it should enter spdif passthrough mode by
 * setting channels=0 (see
-* https://github.com/raspberrypi/linux/issues/528) */
+* https://github.com/raspberrypi/linux/issues/528)
+*/
if (chip->spdif_status & IEC958_AES0_NONAUDIO)
channels = 0;
else
diff --git a/drivers/staging/bcm2835-audio/bcm2835.h 
b/drivers/staging/bcm2835-audio/bcm2835.h
index 36e3ef80e60c..292cf1dc4d7a 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.h
+++ b/drivers/staging/bcm2835-audio/bcm2835.h
@@ -26,11 +26,6 @@
 #include 
 #include 
 
-/*
-#define AUDIO_DEBUG_ENABLE
-#define AUDIO_VERBOSE_DEBUG_ENABLE
- */
-
 /* Debug macros */
 
 #ifdef AUDIO_DEBUG_ENABLE
-- 
2.11.1



[PATCH 0/1] fs: Support compiling out the pivot_root syscall

2017-02-25 Thread Brian Ashworth
This patch will allow for the pivot_root syscall to be made
optional. Based on feedback, this patch uses an ifdef in the
source rather than conditional compilation in the Makefile.

The pivot_root syscall is not needed on systems that do not use
any intermediate filesystem. Allowing for pivot_root to be
ommitted from the kernel will aid in the tinification efforts.

Brian Ashworth (1):
  Allows for the pivot_root syscall to be optional

 fs/namespace.c  |  2 ++
 init/Kconfig| 10 ++
 kernel/sys_ni.c |  1 +
 3 files changed, 13 insertions(+)

-- 
2.11.1



[PATCH] uapi: fix asm/signal.h userspace compilation errors

2017-02-25 Thread Dmitry V. Levin
Include  (guarded by #ifndef __KERNEL__) to fix asm/signal.h
userspace compilation errors like this:

/usr/include/asm/signal.h:126:2: error: unknown type name 'size_t'
  size_t ss_size;

As no uapi header provides a definition of size_t, inclusion
of  seems to be the most conservative fix available.

On the kernel side size_t is typedef'ed to __kernel_size_t, so
an alternative fix would be to change the type of sigaltstack.ss_size
from size_t to __kernel_size_t for all architectures except those where
sizeof(size_t) < sizeof(__kernel_size_t), namely, x32 and mips n32.

On x32 and mips n32, however, #include  seems to be the most
straightforward way to obtain the definition for sigaltstack.ss_size's
type.

Signed-off-by: Dmitry V. Levin 
---
 include/uapi/asm-generic/signal.h  | 3 +++
 arch/alpha/include/uapi/asm/signal.h   | 3 +++
 arch/arm/include/uapi/asm/signal.h | 3 +++
 arch/avr32/include/uapi/asm/signal.h   | 3 +++
 arch/cris/include/uapi/asm/signal.h| 3 +++
 arch/h8300/include/uapi/asm/signal.h   | 3 +++
 arch/ia64/include/uapi/asm/signal.h| 4 
 arch/m32r/include/uapi/asm/signal.h| 3 +++
 arch/m68k/include/uapi/asm/signal.h| 3 +++
 arch/mips/include/uapi/asm/signal.h| 3 +++
 arch/mn10300/include/uapi/asm/signal.h | 3 +++
 arch/parisc/include/uapi/asm/signal.h  | 4 
 arch/powerpc/include/uapi/asm/signal.h | 3 +++
 arch/s390/include/uapi/asm/signal.h| 3 +++
 arch/sparc/include/uapi/asm/signal.h   | 3 +++
 arch/x86/include/uapi/asm/signal.h | 3 +++
 arch/xtensa/include/uapi/asm/signal.h  | 2 ++
 17 files changed, 52 insertions(+)

diff --git a/include/uapi/asm-generic/signal.h 
b/include/uapi/asm-generic/signal.h
index 3094618..e618eab 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -100,6 +100,9 @@ typedef unsigned long old_sigset_t;
 #endif
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
diff --git a/arch/alpha/include/uapi/asm/signal.h 
b/arch/alpha/include/uapi/asm/signal.h
index dd4ca4bc..74e09f6 100644
--- a/arch/alpha/include/uapi/asm/signal.h
+++ b/arch/alpha/include/uapi/asm/signal.h
@@ -94,6 +94,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/arm/include/uapi/asm/signal.h 
b/arch/arm/include/uapi/asm/signal.h
index 33073bd..a7b0012 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -93,6 +93,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/avr32/include/uapi/asm/signal.h 
b/arch/avr32/include/uapi/asm/signal.h
index ffe8c77..62f3b88 100644
--- a/arch/avr32/include/uapi/asm/signal.h
+++ b/arch/avr32/include/uapi/asm/signal.h
@@ -95,6 +95,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/cris/include/uapi/asm/signal.h 
b/arch/cris/include/uapi/asm/signal.h
index ce42fa7..bedff78 100644
--- a/arch/cris/include/uapi/asm/signal.h
+++ b/arch/cris/include/uapi/asm/signal.h
@@ -89,6 +89,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/h8300/include/uapi/asm/signal.h 
b/arch/h8300/include/uapi/asm/signal.h
index af3a6c3..361e2e5 100644
--- a/arch/h8300/include/uapi/asm/signal.h
+++ b/arch/h8300/include/uapi/asm/signal.h
@@ -88,6 +88,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/ia64/include/uapi/asm/signal.h 
b/arch/ia64/include/uapi/asm/signal.h
index c0ea285..b089bfc 100644
--- a/arch/ia64/include/uapi/asm/signal.h
+++ b/arch/ia64/include/uapi/asm/signal.h
@@ -107,6 +107,10 @@
 
 #  include 
 
+#  ifndef __KERNEL__
+#   include  /* For size_t. */
+#  endif
+
 /* Avoid too many header ordering problems.  */
 struct siginfo;
 
diff --git a/arch/m32r/include/uapi/asm/signal.h 
b/arch/m32r/include/uapi/asm/signal.h
index 54acacb..269ec39 100644
--- a/arch/m32r/include/uapi/asm/signal.h
+++ b/arch/m32r/include/uapi/asm/signal.h
@@ -90,6 +90,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/m68k/include/uapi/asm/signal.h 
b/arch/m68k/include/uapi/asm/signal.h
index 

[PATCH] uapi: fix asm/signal.h userspace compilation errors

2017-02-25 Thread Dmitry V. Levin
Include  (guarded by #ifndef __KERNEL__) to fix asm/signal.h
userspace compilation errors like this:

/usr/include/asm/signal.h:126:2: error: unknown type name 'size_t'
  size_t ss_size;

As no uapi header provides a definition of size_t, inclusion
of  seems to be the most conservative fix available.

On the kernel side size_t is typedef'ed to __kernel_size_t, so
an alternative fix would be to change the type of sigaltstack.ss_size
from size_t to __kernel_size_t for all architectures except those where
sizeof(size_t) < sizeof(__kernel_size_t), namely, x32 and mips n32.

On x32 and mips n32, however, #include  seems to be the most
straightforward way to obtain the definition for sigaltstack.ss_size's
type.

Signed-off-by: Dmitry V. Levin 
---
 include/uapi/asm-generic/signal.h  | 3 +++
 arch/alpha/include/uapi/asm/signal.h   | 3 +++
 arch/arm/include/uapi/asm/signal.h | 3 +++
 arch/avr32/include/uapi/asm/signal.h   | 3 +++
 arch/cris/include/uapi/asm/signal.h| 3 +++
 arch/h8300/include/uapi/asm/signal.h   | 3 +++
 arch/ia64/include/uapi/asm/signal.h| 4 
 arch/m32r/include/uapi/asm/signal.h| 3 +++
 arch/m68k/include/uapi/asm/signal.h| 3 +++
 arch/mips/include/uapi/asm/signal.h| 3 +++
 arch/mn10300/include/uapi/asm/signal.h | 3 +++
 arch/parisc/include/uapi/asm/signal.h  | 4 
 arch/powerpc/include/uapi/asm/signal.h | 3 +++
 arch/s390/include/uapi/asm/signal.h| 3 +++
 arch/sparc/include/uapi/asm/signal.h   | 3 +++
 arch/x86/include/uapi/asm/signal.h | 3 +++
 arch/xtensa/include/uapi/asm/signal.h  | 2 ++
 17 files changed, 52 insertions(+)

diff --git a/include/uapi/asm-generic/signal.h 
b/include/uapi/asm-generic/signal.h
index 3094618..e618eab 100644
--- a/include/uapi/asm-generic/signal.h
+++ b/include/uapi/asm-generic/signal.h
@@ -100,6 +100,9 @@ typedef unsigned long old_sigset_t;
 #endif
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 struct sigaction {
__sighandler_t sa_handler;
unsigned long sa_flags;
diff --git a/arch/alpha/include/uapi/asm/signal.h 
b/arch/alpha/include/uapi/asm/signal.h
index dd4ca4bc..74e09f6 100644
--- a/arch/alpha/include/uapi/asm/signal.h
+++ b/arch/alpha/include/uapi/asm/signal.h
@@ -94,6 +94,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/arm/include/uapi/asm/signal.h 
b/arch/arm/include/uapi/asm/signal.h
index 33073bd..a7b0012 100644
--- a/arch/arm/include/uapi/asm/signal.h
+++ b/arch/arm/include/uapi/asm/signal.h
@@ -93,6 +93,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/avr32/include/uapi/asm/signal.h 
b/arch/avr32/include/uapi/asm/signal.h
index ffe8c77..62f3b88 100644
--- a/arch/avr32/include/uapi/asm/signal.h
+++ b/arch/avr32/include/uapi/asm/signal.h
@@ -95,6 +95,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/cris/include/uapi/asm/signal.h 
b/arch/cris/include/uapi/asm/signal.h
index ce42fa7..bedff78 100644
--- a/arch/cris/include/uapi/asm/signal.h
+++ b/arch/cris/include/uapi/asm/signal.h
@@ -89,6 +89,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/h8300/include/uapi/asm/signal.h 
b/arch/h8300/include/uapi/asm/signal.h
index af3a6c3..361e2e5 100644
--- a/arch/h8300/include/uapi/asm/signal.h
+++ b/arch/h8300/include/uapi/asm/signal.h
@@ -88,6 +88,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/ia64/include/uapi/asm/signal.h 
b/arch/ia64/include/uapi/asm/signal.h
index c0ea285..b089bfc 100644
--- a/arch/ia64/include/uapi/asm/signal.h
+++ b/arch/ia64/include/uapi/asm/signal.h
@@ -107,6 +107,10 @@
 
 #  include 
 
+#  ifndef __KERNEL__
+#   include  /* For size_t. */
+#  endif
+
 /* Avoid too many header ordering problems.  */
 struct siginfo;
 
diff --git a/arch/m32r/include/uapi/asm/signal.h 
b/arch/m32r/include/uapi/asm/signal.h
index 54acacb..269ec39 100644
--- a/arch/m32r/include/uapi/asm/signal.h
+++ b/arch/m32r/include/uapi/asm/signal.h
@@ -90,6 +90,9 @@ typedef unsigned long sigset_t;
 #include 
 
 #ifndef __KERNEL__
+
+#include /* For size_t. */
+
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
diff --git a/arch/m68k/include/uapi/asm/signal.h 
b/arch/m68k/include/uapi/asm/signal.h
index cba6f85..f6a409e 100644
--- 

[PATCH 0/1] fs: Support compiling out the pivot_root syscall

2017-02-25 Thread Brian Ashworth
This patch will allow for the pivot_root syscall to be made
optional. Based on feedback, this patch uses an ifdef in the
source rather than conditional compilation in the Makefile.

The pivot_root syscall is not needed on systems that do not use
any intermediate filesystem. Allowing for pivot_root to be
ommitted from the kernel will aid in the tinification efforts.

Brian Ashworth (1):
  Allows for the pivot_root syscall to be optional

 fs/namespace.c  |  2 ++
 init/Kconfig| 10 ++
 kernel/sys_ni.c |  1 +
 3 files changed, 13 insertions(+)

-- 
2.11.1



[PATCH] writeback: use setup_deferrable_timer

2017-02-25 Thread Geliang Tang
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang 
---
 mm/page-writeback.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 26a6081..9e7d576 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -649,9 +649,8 @@ int wb_domain_init(struct wb_domain *dom, gfp_t gfp)
 
spin_lock_init(>lock);
 
-   init_timer_deferrable(>period_timer);
-   dom->period_timer.function = writeout_period;
-   dom->period_timer.data = (unsigned long)dom;
+   setup_deferrable_timer(>period_timer, writeout_period,
+  (unsigned long)dom);
 
dom->dirty_limit_tstamp = jiffies;
 
-- 
2.9.3



[PATCH] writeback: use setup_deferrable_timer

2017-02-25 Thread Geliang Tang
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang 
---
 mm/page-writeback.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 26a6081..9e7d576 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -649,9 +649,8 @@ int wb_domain_init(struct wb_domain *dom, gfp_t gfp)
 
spin_lock_init(>lock);
 
-   init_timer_deferrable(>period_timer);
-   dom->period_timer.function = writeout_period;
-   dom->period_timer.data = (unsigned long)dom;
+   setup_deferrable_timer(>period_timer, writeout_period,
+  (unsigned long)dom);
 
dom->dirty_limit_tstamp = jiffies;
 
-- 
2.9.3



[PATCH] workqueue: use setup_deferrable_timer

2017-02-25 Thread Geliang Tang
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang 
---
 kernel/workqueue.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 072cbc9..54a8fff 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3208,9 +3208,8 @@ static int init_worker_pool(struct worker_pool *pool)
INIT_LIST_HEAD(>idle_list);
hash_init(pool->busy_hash);
 
-   init_timer_deferrable(>idle_timer);
-   pool->idle_timer.function = idle_worker_timeout;
-   pool->idle_timer.data = (unsigned long)pool;
+   setup_deferrable_timer(>idle_timer, idle_worker_timeout,
+  (unsigned long)pool);
 
setup_timer(>mayday_timer, pool_mayday_timeout,
(unsigned long)pool);
-- 
2.9.3



[PATCH] workqueue: use setup_deferrable_timer

2017-02-25 Thread Geliang Tang
Use setup_deferrable_timer() instead of init_timer_deferrable() to
simplify the code.

Signed-off-by: Geliang Tang 
---
 kernel/workqueue.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 072cbc9..54a8fff 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -3208,9 +3208,8 @@ static int init_worker_pool(struct worker_pool *pool)
INIT_LIST_HEAD(>idle_list);
hash_init(pool->busy_hash);
 
-   init_timer_deferrable(>idle_timer);
-   pool->idle_timer.function = idle_worker_timeout;
-   pool->idle_timer.data = (unsigned long)pool;
+   setup_deferrable_timer(>idle_timer, idle_worker_timeout,
+  (unsigned long)pool);
 
setup_timer(>mayday_timer, pool_mayday_timeout,
(unsigned long)pool);
-- 
2.9.3



Re: [PATCH 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers

2017-02-25 Thread kbuild test robot
Hi Tahsin,

[auto build test ERROR on mmotm/master]
[also build test ERROR on v4.10 next-20170224]
[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/Tahsin-Erdogan/percpu-remove-unused-chunk_alloc-parameter-from-pcpu_get_pages/20170226-052515
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: blackfin-BF561-EZKIT-SMP_defconfig (attached as .config)
compiler: bfin-uclinux-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=blackfin 

All errors (new ones prefixed by >>):

   mm/built-in.o: In function `pcpu_mem_zalloc':
>> mm/percpu.c:314: undefined reference to `vmalloc_gfp'

vim +314 mm/percpu.c

   308  if (WARN_ON_ONCE(!slab_is_available()))
   309  return NULL;
   310  
   311  if (size <= PAGE_SIZE)
   312  return kzalloc(size, gfp);
   313  else
 > 314  return vmalloc_gfp(size, gfp | __GFP_HIGHMEM | 
 > __GFP_ZERO);
   315  }
   316  
   317  /**

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


.config.gz
Description: application/gzip


Re: [PATCH 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers

2017-02-25 Thread kbuild test robot
Hi Tahsin,

[auto build test ERROR on mmotm/master]
[also build test ERROR on v4.10 next-20170224]
[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/Tahsin-Erdogan/percpu-remove-unused-chunk_alloc-parameter-from-pcpu_get_pages/20170226-052515
base:   git://git.cmpxchg.org/linux-mmotm.git master
config: blackfin-BF561-EZKIT-SMP_defconfig (attached as .config)
compiler: bfin-uclinux-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=blackfin 

All errors (new ones prefixed by >>):

   mm/built-in.o: In function `pcpu_mem_zalloc':
>> mm/percpu.c:314: undefined reference to `vmalloc_gfp'

vim +314 mm/percpu.c

   308  if (WARN_ON_ONCE(!slab_is_available()))
   309  return NULL;
   310  
   311  if (size <= PAGE_SIZE)
   312  return kzalloc(size, gfp);
   313  else
 > 314  return vmalloc_gfp(size, gfp | __GFP_HIGHMEM | 
 > __GFP_ZERO);
   315  }
   316  
   317  /**

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


.config.gz
Description: application/gzip


  1   2   3   4   5   >