Re: [PATCH v2 0/2] ARC: rework U-boot arguments handling

2019-02-15 Thread LABBE Corentin
On Thu, Feb 14, 2019 at 06:07:43PM +0300, Eugeniy Paltsev wrote:
> Reworking U-boot args handling and enable uboot support
> unconditionally.
> 
> Changes v1->v2:
>  * Drop magic number check [in this patch series]
>  * Keep comment about cndline appending
> 
> Changes RFC->v1:
>  * Don't add new ABI contract between kernel and uboot
>  * Eliminate CONFIG_ARC_UBOOT_SUPPORT Kconfig option and
>enable uboot support unconditionally
>  * Skip invalid U-boot args instead of panic
>  * Check existing U-boot magic value
>  * Improve uboot_arg validating
>  * Minor code changes
> 
> Eugeniy Paltsev (2):
>   ARC: U-boot: check arguments paranoidly
>   ARC: enable uboot support unconditionally
> 
>  arch/arc/Kconfig| 12 -
>  arch/arc/configs/nps_defconfig  |  1 -
>  arch/arc/configs/vdk_hs38_defconfig |  1 -
>  arch/arc/configs/vdk_hs38_smp_defconfig |  2 -
>  arch/arc/kernel/head.S  |  7 ++-
>  arch/arc/kernel/setup.c | 96 
> +++--
>  6 files changed, 70 insertions(+), 49 deletions(-)
> 
> -- 
> 2.14.5
> 

Hello

Tested-by: Corentin LABBE 

It worked on our LAVA lab  along with my "arc: hsdk_defconfig: Enable 
CONFIG_BLK_DEV_RAM" patch.

Regards

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] ARC: [plat-hsdk]: Add reset controller handle to manage USB reset

2019-02-15 Thread Eugeniy Paltsev
DW USB controller on HSDK hangs sometimes after SW reset, so
add reset handle to make possible to reset DW USB controller HW.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/boot/dts/hsdk.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
index 43f17b51ee89..f80fb9dc8653 100644
--- a/arch/arc/boot/dts/hsdk.dts
+++ b/arch/arc/boot/dts/hsdk.dts
@@ -200,6 +200,7 @@
compatible = "snps,hsdk-v1.0-ohci", "generic-ohci";
reg = <0x6 0x100>;
interrupts = <15>;
+   resets = <&cgu_rst HSDK_USB_RESET>;
dma-coherent;
};
 
@@ -207,6 +208,7 @@
compatible = "snps,hsdk-v1.0-ehci", "generic-ehci";
reg = <0x4 0x100>;
interrupts = <15>;
+   resets = <&cgu_rst HSDK_USB_RESET>;
dma-coherent;
};
 
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


kisskb: OK linus/axs101_defconfig/arcompact Sat Feb 16, 08:53

2019-02-15 Thread noreply
OK linus/axs101_defconfig/arcompact Sat Feb 16, 08:53

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

Commit:   Merge tag 'for-5.0/dm-fixes-3' of 
git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
  ae3fa8bd73c9b64416816ec0e9951cd8695c9854
Compiler: arc-buildroot-linux-uclibc-gcc (Buildroot 2015.08.1) 4.8.4 / GNU ld 
(GNU Binutils) 2.23.2

Possible errors
---

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"

Possible warnings (7)
--

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"
arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla]
arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used 
[-Wunused-value]
arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used 
[-Wunused-value]
net/ipv4/tcp_input.c:4324:49: warning: array subscript is above array bounds 
[-Warray-bounds]
arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used 
[-Wunused-value]


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


kisskb: OK linus/axs103_smp_defconfig/arcv2 Sat Feb 16, 08:53

2019-02-15 Thread noreply
OK linus/axs103_smp_defconfig/arcv2 Sat Feb 16, 08:53

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

Commit:   Merge tag 'for-5.0/dm-fixes-3' of 
git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
  ae3fa8bd73c9b64416816ec0e9951cd8695c9854
Compiler: arc-linux-gcc.br_real (Buildroot 2016.11-git-00613-ge98b4dd) 6.2.1 
20160824 / GNU ld (GNU Binutils) 2.27.51.20160928

Possible errors
---

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"
 #define KERN_ERR KERN_SOH "3" /* error conditions */
 #define KERN_ERR KERN_SOH "3" /* error conditions */
 #define KERN_ERR KERN_SOH "3" /* error conditions */

Possible warnings (82)
--

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"
arch/arc/mm/tlb.c:914:2: warning: ISO C90 forbids variable length array 'pd0' 
[-Wvla]
kernel/dma/direct.c:40:4: warning: format '%zu' expects argument of type 
'size_t', but argument 4 has type 'unsigned int' [-Wformat=]
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kern_levels.h:5:18: warning: format '%zd' expects argument of 
type 'signed size_t', but argument 3 has type 'size_t {aka unsigned int}' 
[-Wformat=]
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
fs/ext4/inode.c:3654:12: warning: format '%zd' expects argument of type 'signed 
size_t', but argument 6 has type 'ssize_t {aka int}' [-Wformat=]
drivers/base/regmap/regmap.c:1531:22: warning: format '%zu' expects argument of 
type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=]
drivers/base/regmap/regcache.c:719:20: warning: format '%zu' expects argument 
of type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=]
drivers/base/component.c:164:24: warning: format '%zu' expects argument of type 
'size_t', but argument 4 has type 'unsigned int' [-Wformat=]
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', 
but argument 4 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', 
but argument 5 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=]
 #define KERN_WARNING KERN_SOH "4" /* warning conditions */
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=]
 #define KERN_WARNING KERN_SOH "4" /* warning conditions */
mm/percpu.c:1948:27: warning: format '%zu' expects argument of type 'size_t', 
but argument 3 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:32: warning: format '%zu' expects argument of type 'size_t', 
but argument 4 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:37: warning: format '%zu' expects argument of type 'size_t', 
but argument 5 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:42: warning: format '%zu' expects argument of type 'size_t', 
but argument 6 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:52: warning: format '%zu' expects argument of type 'size_t', 
but argument 7 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:56: warning: format '%zu' expects argument of type 'size_t', 
but argument 8 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 4 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 6 has type 'unsigned int' [-Wformat=]
inclu

kisskb: OK linus/axs103_smp_defconfig/arcv2 Sat Feb 16, 10:36

2019-02-15 Thread noreply
OK linus/axs103_smp_defconfig/arcv2 Sat Feb 16, 10:36

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

Commit:   Merge tag 'for-linus-20190215' of git://git.kernel.dk/linux-block
  24f0a48743a256bdec1bcb80708bc309da4aa261
Compiler: arc-linux-gcc.br_real (Buildroot 2016.11-git-00613-ge98b4dd) 6.2.1 
20160824 / GNU ld (GNU Binutils) 2.27.51.20160928

Possible errors
---

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"
 #define KERN_ERR KERN_SOH "3" /* error conditions */
 #define KERN_ERR KERN_SOH "3" /* error conditions */
 #define KERN_ERR KERN_SOH "3" /* error conditions */

Possible warnings (82)
--

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"
kernel/dma/direct.c:40:4: warning: format '%zu' expects argument of type 
'size_t', but argument 4 has type 'unsigned int' [-Wformat=]
arch/arc/mm/tlb.c:914:2: warning: ISO C90 forbids variable length array 'pd0' 
[-Wvla]
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
fs/ext4/inode.c:3654:12: warning: format '%zd' expects argument of type 'signed 
size_t', but argument 6 has type 'ssize_t {aka int}' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zd' expects argument of 
type 'signed size_t', but argument 3 has type 'size_t {aka unsigned int}' 
[-Wformat=]
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
include/linux/kernel.h:846:29: warning: comparison of distinct pointer types 
lacks a cast
fs/ext4/page-io.c:163:5: warning: format '%zd' expects argument of type 'signed 
size_t', but argument 6 has type 'ssize_t {aka int}' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=]
drivers/base/regmap/regmap.c:1531:22: warning: format '%zu' expects argument of 
type 'size_t', but argument 5 has type 'unsigned int' [-Wformat=]
drivers/base/component.c:164:24: warning: format '%zu' expects argument of type 
'size_t', but argument 4 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', 
but argument 4 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1382:17: warning: format '%zu' expects argument of type 'size_t', 
but argument 5 has type 'unsigned int' [-Wformat=]
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 2 has type 'unsigned int' [-Wformat=]
 #define KERN_WARNING KERN_SOH "4" /* warning conditions */
include/linux/kern_levels.h:5:18: warning: format '%zu' expects argument of 
type 'size_t', but argument 3 has type 'unsigned int' [-Wformat=]
 #define KERN_WARNING KERN_SOH "4" /* warning conditions */
mm/percpu.c:1948:27: warning: format '%zu' expects argument of type 'size_t', 
but argument 3 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:32: warning: format '%zu' expects argument of type 'size_t', 
but argument 4 has type 'unsigned int' [-Wformat=]
mm/percpu.c:1948:37: warning: format '%zu' expects argument of type 'size_t', 
but argument 5 has type 'u

kisskb: OK linus/axs101_defconfig/arcompact Sat Feb 16, 10:36

2019-02-15 Thread noreply
OK linus/axs101_defconfig/arcompact Sat Feb 16, 10:36

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

Commit:   Merge tag 'for-linus-20190215' of git://git.kernel.dk/linux-block
  24f0a48743a256bdec1bcb80708bc309da4aa261
Compiler: arc-buildroot-linux-uclibc-gcc (Buildroot 2015.08.1) 4.8.4 / GNU ld 
(GNU Binutils) 2.23.2

Possible errors
---

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"

Possible warnings (7)
--

arch/arc/boot/dts/axs10x_mb.dtsi:221.15-225.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x54: I2C bus unit address format error, expected 
"54"
arch/arc/boot/dts/axs10x_mb.dtsi:227.15-231.6: Warning (i2c_bus_reg): 
/axs10x_mb/i2c@0x1f000/eeprom@0x57: I2C bus unit address format error, expected 
"57"
arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla]
net/ipv4/tcp_input.c:4324:49: warning: array subscript is above array bounds 
[-Warray-bounds]
arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used 
[-Wunused-value]
arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used 
[-Wunused-value]
arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used 
[-Wunused-value]


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 1/2] ARC: U-boot: check arguments paranoidly

2019-02-15 Thread Vineet Gupta


[...]

> -char __initdata *uboot_arg;
> +unsigned int __initdata uboot_arg;

Why ?

In both places it is actually used, it is intended as a pointer. The cast for
range check is needed but lets cast there. See below for real reason.


> -static inline int is_kernel(unsigned long addr)
> +static inline bool uboot_arg_invalid(unsigned int addr)
>  {
> - if (addr >= (unsigned long)_stext && addr <= (unsigned long)_end)
> - return 1;
> +
> + /* Check that address doesn't clobber resident kernel image */
> + return addr >= (unsigned int)_stext && addr <= (unsigned int)_end;

...

> +
> + /* see if U-boot passed an external Device Tree blob */
> + if (uboot_tag == UBOOT_TAG_DTB) {
> + machine_desc = setup_machine_fdt((void *)uboot_arg);

On a 64-bit paradigm, with LP64 ABI, this will break since int will be 4b, while
pointer 8b.

I'll fix it up locally and push !

-Vineet

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc