Patch "arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c" has been added to the 4.14-stable tree
This is a note to let you know that I've just added the patch titled arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-printk-warning-in-arc-plat-eznps-mtm.c.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:13:00 CEST 2018 From: Randy Dunlap Date: Thu, 26 Jul 2018 20:16:35 -0700 Subject: arc: [plat-eznps] fix printk warning in arc/plat-eznps/mtm.c From: Randy Dunlap [ Upstream commit 9e2ea405543d9ddfe05b351f1679e53bd9c11f80 ] Fix printk format warning in arch/arc/plat-eznps/mtm.c: In file included from ../include/linux/printk.h:7, from ../include/linux/kernel.h:14, from ../include/linux/list.h:9, from ../include/linux/smp.h:12, from ../arch/arc/plat-eznps/mtm.c:17: ../arch/arc/plat-eznps/mtm.c: In function 'set_mtm_hs_ctr': ../include/linux/kern_levels.h:5:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long int' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^~ ../include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~ ../include/linux/printk.h:308:9: note: in expansion of macro 'KERN_ERR' printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~ ../arch/arc/plat-eznps/mtm.c:166:3: note: in expansion of macro 'pr_err' pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n", ^~ ../arch/arc/plat-eznps/mtm.c:166:40: note: format string is defined here pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n", ~^ %ld The hs_ctr variable can just be int instead of long, so also change kstrtol() to kstrtoint() and leave the format string as %d. Also add 2 header files since they are used in mtm.c and we prefer not to depend on accidental/indirect #includes. Cc: linux-snps-arc@lists.infradead.org Cc: Ofer Levi Reviewed-by: Leon Romanovsky Signed-off-by: Randy Dunlap Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/plat-eznps/mtm.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/arch/arc/plat-eznps/mtm.c +++ b/arch/arc/plat-eznps/mtm.c @@ -15,6 +15,8 @@ */ #include +#include +#include #include #include #include @@ -157,10 +159,10 @@ void mtm_enable_core(unsigned int cpu) /* Verify and set the value of the mtm hs counter */ static int __init set_mtm_hs_ctr(char *ctr_str) { - long hs_ctr; + int hs_ctr; int ret; - ret = kstrtol(ctr_str, 0, &hs_ctr); + ret = kstrtoint(ctr_str, 0, &hs_ctr); if (ret || hs_ctr > MT_HS_CNT_MAX || hs_ctr < MT_HS_CNT_MIN) { pr_err("** Invalid @nps_mtm_hs_ctr [%d] needs to be [%d:%d] (incl)\n", Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.14/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.14/arc-fix-printk-warning-in-arc-plat-eznps-mtm.c.patch queue-4.14/arc-add-missing-struct-nps_host_reg_aux_dpc.patch queue-4.14/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.14/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.14/arc-fix-data-type-errors-in-platform-headers.patch queue-4.14/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.14/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Patch "arc: fix type warnings in arc/mm/cache.c" has been added to the 4.14-stable tree
This is a note to let you know that I've just added the patch titled arc: fix type warnings in arc/mm/cache.c to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-type-warnings-in-arc-mm-cache.c.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:13:00 CEST 2018 From: Randy Dunlap Date: Thu, 26 Jul 2018 20:16:35 -0700 Subject: arc: fix type warnings in arc/mm/cache.c From: Randy Dunlap [ Upstream commit ec837d620c750c0d4996a907c8c4f7febe1bbeee ] Fix type warnings in arch/arc/mm/cache.c. ../arch/arc/mm/cache.c: In function 'flush_anon_page': ../arch/arc/mm/cache.c:1062:55: warning: passing argument 2 of '__flush_dcache_page' makes integer from pointer without a cast [-Wint-conversion] __flush_dcache_page((phys_addr_t)page_address(page), page_address(page)); ^~ ../arch/arc/mm/cache.c:1013:59: note: expected 'long unsigned int' but argument is of type 'void *' void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr) ~~^ Signed-off-by: Randy Dunlap Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Cc: Elad Kanfi Cc: Leon Romanovsky Cc: Ofer Levi Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/mm/cache.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c @@ -1035,7 +1035,7 @@ void flush_cache_mm(struct mm_struct *mm void flush_cache_page(struct vm_area_struct *vma, unsigned long u_vaddr, unsigned long pfn) { - unsigned int paddr = pfn << PAGE_SHIFT; + phys_addr_t paddr = pfn << PAGE_SHIFT; u_vaddr &= PAGE_MASK; @@ -1055,8 +1055,9 @@ void flush_anon_page(struct vm_area_stru unsigned long u_vaddr) { /* TBD: do we really need to clear the kernel mapping */ - __flush_dcache_page(page_address(page), u_vaddr); - __flush_dcache_page(page_address(page), page_address(page)); + __flush_dcache_page((phys_addr_t)page_address(page), u_vaddr); + __flush_dcache_page((phys_addr_t)page_address(page), + (phys_addr_t)page_address(page)); } Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.14/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.14/arc-fix-printk-warning-in-arc-plat-eznps-mtm.c.patch queue-4.14/arc-add-missing-struct-nps_host_reg_aux_dpc.patch queue-4.14/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.14/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.14/arc-fix-data-type-errors-in-platform-headers.patch queue-4.14/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.14/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Patch "arc: fix build errors in arc/include/asm/delay.h" has been added to the 4.14-stable tree
This is a note to let you know that I've just added the patch titled arc: fix build errors in arc/include/asm/delay.h to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-build-errors-in-arc-include-asm-delay.h.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:13:00 CEST 2018 From: Randy Dunlap Date: Thu, 26 Jul 2018 20:16:35 -0700 Subject: arc: fix build errors in arc/include/asm/delay.h From: Randy Dunlap [ Upstream commit 2423665ec53f2a29191b35382075e9834288a975 ] Fix build errors in arch/arc/'s delay.h: - add "extern unsigned long loops_per_jiffy;" - add for "u64" In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32: ../arch/arc/include/asm/delay.h: In function '__udelay': ../arch/arc/include/asm/delay.h:61:12: error: 'u64' undeclared (first use in this function) loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32; ^~~ In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32: ../arch/arc/include/asm/delay.h: In function '__udelay': ../arch/arc/include/asm/delay.h:63:37: error: 'loops_per_jiffy' undeclared (first use in this function) loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32; ^~~ Signed-off-by: Randy Dunlap Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Cc: Elad Kanfi Cc: Leon Romanovsky Cc: Ofer Levi Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/delay.h |3 +++ 1 file changed, 3 insertions(+) --- a/arch/arc/include/asm/delay.h +++ b/arch/arc/include/asm/delay.h @@ -17,8 +17,11 @@ #ifndef __ASM_ARC_UDELAY_H #define __ASM_ARC_UDELAY_H +#include #include /* HZ */ +extern unsigned long loops_per_jiffy; + static inline void __delay(unsigned long loops) { __asm__ __volatile__( Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.14/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.14/arc-fix-printk-warning-in-arc-plat-eznps-mtm.c.patch queue-4.14/arc-add-missing-struct-nps_host_reg_aux_dpc.patch queue-4.14/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.14/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.14/arc-fix-data-type-errors-in-platform-headers.patch queue-4.14/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.14/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Patch "arc: [plat-eznps] fix data type errors in platform headers" has been added to the 4.14-stable tree
This is a note to let you know that I've just added the patch titled arc: [plat-eznps] fix data type errors in platform headers to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-data-type-errors-in-platform-headers.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:13:00 CEST 2018 From: Randy Dunlap Date: Sun, 29 Jul 2018 11:10:51 -0700 Subject: arc: [plat-eznps] fix data type errors in platform headers From: Randy Dunlap [ Upstream commit b1f32ce1c3d2c11959b7e6a2c58dc5197c581966 ] Add to fix build errors. Both ctop.h and use u32 types and cause many errors. Examples: ../include/soc/nps/common.h:71:4: error: unknown type name 'u32' u32 __reserved:20, cluster:4, core:4, thread:4; ../include/soc/nps/common.h:76:3: error: unknown type name 'u32' u32 value; ../include/soc/nps/common.h:124:4: error: unknown type name 'u32' u32 base:8, cl_x:4, cl_y:4, ../include/soc/nps/common.h:127:3: error: unknown type name 'u32' u32 value; ../arch/arc/plat-eznps/include/plat/ctop.h:83:4: error: unknown type name 'u32' u32 gen:1, gdis:1, clk_gate_dis:1, asb:1, ../arch/arc/plat-eznps/include/plat/ctop.h:86:3: error: unknown type name 'u32' u32 value; ../arch/arc/plat-eznps/include/plat/ctop.h:93:4: error: unknown type name 'u32' u32 csa:22, dmsid:6, __reserved:3, cs:1; ../arch/arc/plat-eznps/include/plat/ctop.h:95:3: error: unknown type name 'u32' u32 value; Cc: linux-snps-arc@lists.infradead.org Cc: Ofer Levi Reviewed-by: Leon Romanovsky Signed-off-by: Randy Dunlap Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/plat-eznps/include/plat/ctop.h |1 + 1 file changed, 1 insertion(+) --- a/arch/arc/plat-eznps/include/plat/ctop.h +++ b/arch/arc/plat-eznps/include/plat/ctop.h @@ -21,6 +21,7 @@ #error "Incorrect ctop.h include" #endif +#include #include /* core auxiliary registers */ Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.14/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.14/arc-fix-printk-warning-in-arc-plat-eznps-mtm.c.patch queue-4.14/arc-add-missing-struct-nps_host_reg_aux_dpc.patch queue-4.14/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.14/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.14/arc-fix-data-type-errors-in-platform-headers.patch queue-4.14/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.14/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Patch "arc: fix build errors in arc/include/asm/delay.h" has been added to the 4.9-stable tree
This is a note to let you know that I've just added the patch titled arc: fix build errors in arc/include/asm/delay.h to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-build-errors-in-arc-include-asm-delay.h.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:16:12 CEST 2018 From: Randy Dunlap Date: Thu, 26 Jul 2018 20:16:35 -0700 Subject: arc: fix build errors in arc/include/asm/delay.h From: Randy Dunlap [ Upstream commit 2423665ec53f2a29191b35382075e9834288a975 ] Fix build errors in arch/arc/'s delay.h: - add "extern unsigned long loops_per_jiffy;" - add for "u64" In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32: ../arch/arc/include/asm/delay.h: In function '__udelay': ../arch/arc/include/asm/delay.h:61:12: error: 'u64' undeclared (first use in this function) loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32; ^~~ In file included from ../drivers/infiniband/hw/cxgb3/cxio_hal.c:32: ../arch/arc/include/asm/delay.h: In function '__udelay': ../arch/arc/include/asm/delay.h:63:37: error: 'loops_per_jiffy' undeclared (first use in this function) loops = ((u64) usecs * 4295 * HZ * loops_per_jiffy) >> 32; ^~~ Signed-off-by: Randy Dunlap Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Cc: Elad Kanfi Cc: Leon Romanovsky Cc: Ofer Levi Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/include/asm/delay.h |3 +++ 1 file changed, 3 insertions(+) --- a/arch/arc/include/asm/delay.h +++ b/arch/arc/include/asm/delay.h @@ -17,8 +17,11 @@ #ifndef __ASM_ARC_UDELAY_H #define __ASM_ARC_UDELAY_H +#include #include /* HZ */ +extern unsigned long loops_per_jiffy; + static inline void __delay(unsigned long loops) { __asm__ __volatile__( Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.9/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.9/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.9/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.9/arc-fix-data-type-errors-in-platform-headers.patch queue-4.9/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.9/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Patch "arc: fix type warnings in arc/mm/cache.c" has been added to the 4.9-stable tree
This is a note to let you know that I've just added the patch titled arc: fix type warnings in arc/mm/cache.c to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-type-warnings-in-arc-mm-cache.c.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:16:12 CEST 2018 From: Randy Dunlap Date: Thu, 26 Jul 2018 20:16:35 -0700 Subject: arc: fix type warnings in arc/mm/cache.c From: Randy Dunlap [ Upstream commit ec837d620c750c0d4996a907c8c4f7febe1bbeee ] Fix type warnings in arch/arc/mm/cache.c. ../arch/arc/mm/cache.c: In function 'flush_anon_page': ../arch/arc/mm/cache.c:1062:55: warning: passing argument 2 of '__flush_dcache_page' makes integer from pointer without a cast [-Wint-conversion] __flush_dcache_page((phys_addr_t)page_address(page), page_address(page)); ^~ ../arch/arc/mm/cache.c:1013:59: note: expected 'long unsigned int' but argument is of type 'void *' void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr) ~~^ Signed-off-by: Randy Dunlap Cc: Vineet Gupta Cc: linux-snps-arc@lists.infradead.org Cc: Elad Kanfi Cc: Leon Romanovsky Cc: Ofer Levi Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/mm/cache.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/arch/arc/mm/cache.c +++ b/arch/arc/mm/cache.c @@ -840,7 +840,7 @@ void flush_cache_mm(struct mm_struct *mm void flush_cache_page(struct vm_area_struct *vma, unsigned long u_vaddr, unsigned long pfn) { - unsigned int paddr = pfn << PAGE_SHIFT; + phys_addr_t paddr = pfn << PAGE_SHIFT; u_vaddr &= PAGE_MASK; @@ -860,8 +860,9 @@ void flush_anon_page(struct vm_area_stru unsigned long u_vaddr) { /* TBD: do we really need to clear the kernel mapping */ - __flush_dcache_page(page_address(page), u_vaddr); - __flush_dcache_page(page_address(page), page_address(page)); + __flush_dcache_page((phys_addr_t)page_address(page), u_vaddr); + __flush_dcache_page((phys_addr_t)page_address(page), + (phys_addr_t)page_address(page)); } Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.9/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.9/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.9/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.9/arc-fix-data-type-errors-in-platform-headers.patch queue-4.9/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.9/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Patch "arc: [plat-eznps] fix data type errors in platform headers" has been added to the 4.9-stable tree
This is a note to let you know that I've just added the patch titled arc: [plat-eznps] fix data type errors in platform headers to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: arc-fix-data-type-errors-in-platform-headers.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From foo@baz Sun Aug 26 09:16:12 CEST 2018 From: Randy Dunlap Date: Sun, 29 Jul 2018 11:10:51 -0700 Subject: arc: [plat-eznps] fix data type errors in platform headers From: Randy Dunlap [ Upstream commit b1f32ce1c3d2c11959b7e6a2c58dc5197c581966 ] Add to fix build errors. Both ctop.h and use u32 types and cause many errors. Examples: ../include/soc/nps/common.h:71:4: error: unknown type name 'u32' u32 __reserved:20, cluster:4, core:4, thread:4; ../include/soc/nps/common.h:76:3: error: unknown type name 'u32' u32 value; ../include/soc/nps/common.h:124:4: error: unknown type name 'u32' u32 base:8, cl_x:4, cl_y:4, ../include/soc/nps/common.h:127:3: error: unknown type name 'u32' u32 value; ../arch/arc/plat-eznps/include/plat/ctop.h:83:4: error: unknown type name 'u32' u32 gen:1, gdis:1, clk_gate_dis:1, asb:1, ../arch/arc/plat-eznps/include/plat/ctop.h:86:3: error: unknown type name 'u32' u32 value; ../arch/arc/plat-eznps/include/plat/ctop.h:93:4: error: unknown type name 'u32' u32 csa:22, dmsid:6, __reserved:3, cs:1; ../arch/arc/plat-eznps/include/plat/ctop.h:95:3: error: unknown type name 'u32' u32 value; Cc: linux-snps-arc@lists.infradead.org Cc: Ofer Levi Reviewed-by: Leon Romanovsky Signed-off-by: Randy Dunlap Signed-off-by: Vineet Gupta Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/arc/plat-eznps/include/plat/ctop.h |1 + 1 file changed, 1 insertion(+) --- a/arch/arc/plat-eznps/include/plat/ctop.h +++ b/arch/arc/plat-eznps/include/plat/ctop.h @@ -21,6 +21,7 @@ #error "Incorrect ctop.h include" #endif +#include #include /* core auxiliary registers */ Patches currently in stable-queue which might be from rdun...@infradead.org are queue-4.9/usb-phy-fix-ppc64-build-errors-in-phy-fsl-usb.c.patch queue-4.9/net-prevent-isa-drivers-from-building-on-ppc32.patch queue-4.9/arc-fix-build-errors-in-arc-include-asm-delay.h.patch queue-4.9/arc-fix-data-type-errors-in-platform-headers.patch queue-4.9/media-staging-omap4iss-include-asm-cacheflush.h-after-generic-includes.patch queue-4.9/arc-fix-type-warnings-in-arc-mm-cache.c.patch ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] treewide: remove current_text_addr
Here is a full-blown (user space) test program demonstrating the whole technique and how to use it. -hpa #include #include #define _RET_IP_ ((unsigned long)__builtin_return_address(0)) #define noinline __attribute__((noinline)) #define used __attribute__((used)) /* __always_inline is defined in glibc already */ #define ifconst(x,y) __builtin_choose_expr(__builtin_constant_p(x),(x),(y)) static inline void notailcall(void) { asm volatile(""); } /* Change this to a null string to make all functions global */ #define STATIC static struct myputs_string { unsigned short len; char str[0]; }; STATIC int _myputs_struct(const struct myputs_string * const strs); STATIC int _myputs_string(const char *str); STATIC int __myputs(unsigned long ip, const char *str, size_t len); #if 1 #include STATIC void dump_caller(unsigned long where) { const char *opname = NULL; const char *wheretoname = NULL; char ichar; unsigned long whereto = 0; #if defined(__i386__) || defined(__x86_64__) char opname_buf[4]; unsigned char opcode; where -= 5; opcode = *(unsigned char *)where; switch (opcode) { case 0xe8: opname = "call"; whereto = where + 5 + *(signed int *)(where + 1); break; case 0xe9: opname = "jmp"; whereto = where + 5 + *(signed int *)(where + 1); break; default: snprintf(opname_buf, sizeof opname_buf, "?%02x", opcode); opname = opname_buf; break; } #elif defined(__sparc__) const char regtype[4] = "gilo"; unsigned int opcode, op1, op3, ibit; signed int simm13, simm30; char opname_buf[32]; char *p; where -= 8; opcode = *(signed int *)where; op1 = opcode >> 30; op3 = (opcode >> 19) & 0x3f; ibit = (opcode >> 13) & 1; simm13 = (opcode & 0x1fff) << 2; simm30 = (opcode & 0x3fff) << 2; opname = opname_buf; if (op1 == 1) { opname = "call"; whereto = where + simm30; } else if (op1 == 2 && op3 == 0x38) { if (ibit) { snprintf(opname_buf, sizeof opname_buf, "jmpl %%%c%u %c 0x%x", regtype[(opcode >> 17) & 3], (opcode >> 14) & 7, simm13 < 0 ? '-' : '+', abs(simm13)); } else { snprintf(opname_buf, sizeof opname_buf, "jmpl %%%c%u + %%%c%u", regtype[(opcode >> 17) & 3], (opcode >> 14) & 7, regtype[(opcode >> 3) & 3], opcode & 7); } } else { snprintf(opname_buf, sizeof opname_buf, "?0x08x", opcode); } #else /* Unknown architecture */ #endif if (whereto == (unsigned long)_myputs_struct) { wheretoname = "_myputs_struct"; } else if (whereto == (unsigned long)_myputs_string) { wheretoname = "_myputs_string"; } else { wheretoname = "?"; } ichar = '['; if (opname) { printf("%c%p: %s", ichar, (void *)where, opname); ichar = ' '; } if (whereto) { printf("%c%p <%s>", ichar, (void *)whereto, wheretoname); ichar = ' '; } if (ichar != '[') putchar(']'); } STATIC int __myputs(unsigned long where, const char *str, size_t len) { size_t slen = strlen(str); size_t rv; len--; rv = printf("%p: \"%.*s\"%*s", (void *)where, (int)len, str, 16-(int)slen, ""); dump_caller(where); if (slen != len) printf(" \n", slen, len); else printf(" \n", len); return rv; } STATIC int noinline _myputs_struct(const struct myputs_string * const strs) { return __myputs(_RET_IP_, strs->str, strs->len); } STATIC int noinline _myputs_string(const char *str) { return __myputs(_RET_IP_, str, strlen(str)+1); } #endif #define myputs(s) \ ({ \ int _rv; \ if (__builtin_constant_p(s) && \ __builtin_constant_p(strlen(s)) &&\ strlen(s)+1 == sizeof(s) && \ sizeof(s) <= (size_t)65535) {\ static const struct { \ struct myputs_string _mps_hdr;\ char _mps_str[sizeof(s)];\ } _mps = { \ ._mps_hdr.len = sizeof(s),\ ._mps_str = ifconst(s,""),\ };\ _rv = _myputs_struct(&_mps._mps_hdr); \ } else { \ _rv = _myputs_string(s);\ }\ notailcall(); \ _rv;\ }) STATIC int test1(void); STATIC int test2(const char *strx); STATIC int test1(void) { return myputs("Foobar"); } STATIC int test2(const char *strx) { return myputs(strx); } int main(int argc, char *argv[]) { (void)argc; test1(); test2(argv[0]); return 0; } ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] treewide: remove current_text_addr
On Sun, Aug 26, 2018 at 12:32 PM H. Peter Anvin wrote: > > Here is a full-blown (user space) test program demonstrating the whole > technique and how to use it. So while I agree that some _THIS_IP_ users might be better off being converted to __builtin_return_address(0) at the caller, I also think that the whole "notailcall" thing shows why that can easily be more problematic than just our currnet _THIS_IP_ solution. Honestly, I'd suggest: - just do the current_text_addr() to _THIS_IP_ conversion - keep _THIS_IP_ and make it be the generic one, and screw the whole "some architectures might implement is better" issue. Nobody cares. - try to convince people to move away from the "we want the kernel instruction pointer for the call" model entirely, and consider this a "legacy" issue. The whole instruction pointer is a nasty thing. We should discourage it and not make complex infrastructure for it. Instead, maybe we could encourage something like struct kernel_loc { const char *file; const char *fn; int line; }; #define __GEN_LOC__(n) \ ({ static const struct kernel_loc n = { \ __FILE__, __FUNCTION__, __LINE__ \ }; &n; }) #define _THIS_LOC_ __GEN_LOC__(__UNIQUE_ID(loc)) which is a hell of a lot nicer to use, and actually allows gcc to optimize things (try it: if you pass a _THIS_LOC_ off to an inline function, and that inline function uses the name and line number, gcc will pick them up directly, without the extra structure dereference. Wouldn't it be much nicer to pass these kinds of "location pointer" around, rather than the nasty _THIS_IP_ thing? Certainly lockdep looks like it could easily take that "const struct kernel_loc *" instead of "unsigned long ip". Makes it easy to print out the lockdep info. Ok, I didn't try to convert anybody, so maybe people who currently use _THIS_IP_ or current_text_addr() have some fundamental reason why they want just that, but let's not male _THIS_IP_ more complex than it needs to be. Hmm? Linus ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] treewide: remove current_text_addr
On 08/26/18 12:30, H. Peter Anvin wrote: > Here is a full-blown (user space) test program demonstrating the whole > technique and how to use it. > > -hpa Incidentally, it looks like _RET_IP_ really should be defined as: /* * Is there any reason whatsoever to have _RET_IP_ an unsigned int * rather than a pointer throughout? */ #define _RET_IP_PTR_ \ __builtin_extract_return_addr(__builtin_return_addr(0)) #define _RET_IP_ ((unsigned long)_RET_IP_PTR_) On some architectures __builtin_extract_return_addr() is apparently necessary; its a nop on x86. Why that isn't part of __builtin_return_addr() one can really wonder. So, checking into all of this, the generic _THIS_IP_ DOES NOT WORK on x86. I have tried a tons of variants, including adding various asm volatile(...) instructions, and no matter what I do, it will always return the address of the surrounding function rather than any kind of local IP. The only way to get a localized address seems to be in assembly, but even so, there is absolutely no guarantee that the value of _THIS_IP_ has anything to do with where the code is otherwise localized in the function. >From examining the output of gcc, the fundamental problem seems to be that *no matter what* one do with the label, unless gcc actually produces a computed goto somewhere in the code, that it can't remove with dead-code elimination or constant propagation, it will arbitrarily hoist the labels all the way to the beginning of the function. Given that, I suspect that other versions of gcc might have similar problems. This is the closest thing to arch-neutral I have been able to find that also works on x86, while not at the same time horribly polluting the namespace: #define __here(n) ___here_ ## n #define __hereasm(n) ".L___here_" #n #define _THIS_IP_CTR_(n)\ ({ \ extern const char __here(n) asm(__hereasm(n)); \ asm volatile(__hereasm(n) ": /* _THIS_IP_ */"); \ (unsigned long)&__here(n); \ }) #define _THIS_IP_ _THIS_IP_CTR_(__COUNTER__) The use of asm volatile() to define a label means that the position in the instruction stream is at least reasonably well-defined. -hpa ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH 6/8] kbuild: consolidate Devicetree dtb build rules
On Sat, Aug 25, 2018 at 9:06 PM Masahiro Yamada wrote: > > Hi Rob, > > > 2018-08-22 6:55 GMT+09:00 Rob Herring : > > There is nothing arch specific about building dtb files other than their > > location under /arch/*/boot/dts/. Keeping each arch aligned is a pain. > > The dependencies and supported targets are all slightly different. > > Also, a cross-compiler for each arch is needed, but really the host > > compiler preprocessor is perfectly fine for building dtbs. Move the > > build rules to a common location and remove the arch specific ones. This > > is done in a single step to avoid warnings about overriding rules. > > > > The build dependencies had been a mixture of 'scripts' and/or 'prepare'. > > These pull in several dependencies some of which need a target compiler > > (specifically devicetable-offsets.h) and aren't needed to build dtbs. > > All that is really needed is dtc, so adjust the dependencies to only be > > dtc. > > > > This change enables support 'dtbs_install' on some arches which were > > missing the target. > > > > Cc: Masahiro Yamada > > Cc: Michal Marek > > Cc: Vineet Gupta > > Cc: Russell King > > Cc: Catalin Marinas > > Cc: Will Deacon > > Cc: Yoshinori Sato > > Cc: Michal Simek > > Cc: Ralf Baechle > > Cc: Paul Burton > > Cc: James Hogan > > Cc: Ley Foon Tan > > Cc: Benjamin Herrenschmidt > > Cc: Paul Mackerras > > Cc: Michael Ellerman > > Cc: Chris Zankel > > Cc: Max Filippov > > Cc: linux-kbu...@vger.kernel.org > > Cc: linux-snps-arc@lists.infradead.org > > Cc: linux-arm-ker...@lists.infradead.org > > Cc: uclinux-h8-de...@lists.sourceforge.jp > > Cc: linux-m...@linux-mips.org > > Cc: nios2-...@lists.rocketboards.org > > Cc: linuxppc-...@lists.ozlabs.org > > Cc: linux-xte...@linux-xtensa.org > > Signed-off-by: Rob Herring > > --- > > Makefile | 30 ++ > > arch/arc/Makefile| 6 -- > > arch/arm/Makefile| 20 +--- > > arch/arm64/Makefile | 17 + > > arch/c6x/Makefile| 2 -- > > arch/h8300/Makefile | 11 +-- > > arch/microblaze/Makefile | 4 +--- > > arch/mips/Makefile | 15 +-- > > arch/nds32/Makefile | 2 +- > > arch/nios2/Makefile | 7 --- > > arch/nios2/boot/Makefile | 4 > > arch/powerpc/Makefile| 3 --- > > arch/xtensa/Makefile | 12 +--- > > scripts/Makefile | 1 - > > scripts/Makefile.lib | 2 +- > > 15 files changed, 38 insertions(+), 98 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index c13f8b85ba60..6d89e673f192 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -1212,6 +1212,30 @@ kselftest-merge: > > $(srctree)/tools/testing/selftests/*/config > > +$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig > > > > +# > > --- > > +# Devicetree files > > + > > +dtstree := $(wildcard arch/$(SRCARCH)/boot/dts) BTW, there's an error here too. It doesn't work right with KBUILD_OUTPUT set and should be: ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),) dtstree := arch/$(SRCARCH)/boot/dts endif > > + > > +ifdef CONFIG_OF_EARLY_FLATTREE > > + > > +%.dtb %.dtb.S %.dtb.o: | dtc > > I think the pipe operator is unnecessary > because Kbuild will descend to $(dtstree) anyway. The pipe means 'order-only', right? So it is just a weaker dependency for things which are not input files as dtc is not. The 'dtc' here is just the dtc rule below, not the actual executable. Or am I missing something? > > + $(Q)$(MAKE) $(build)=$(dtstree) $(dtstree)/$@ > > + > > +PHONY += dtbs > > +dtbs: | dtc > > Ditto. > > > > + $(Q)$(MAKE) $(build)=$(dtstree) > > + > > +dtbs_install: dtbs > > + $(Q)$(MAKE) $(dtbinst)=$(dtstree) > > + > > +all: dtbs > > + > > +dtc: > > + $(Q)$(MAKE) $(build)=scripts/dtc > > + > > +endif > > + > > > arch/*/boot/dts/ are not only directories that > require dtc. Ah yes, of course... > > diff --git a/scripts/Makefile b/scripts/Makefile > > index 61affa300d25..a716a6b10954 100644 > > --- a/scripts/Makefile > > +++ b/scripts/Makefile > > @@ -39,7 +39,6 @@ build_unifdef: $(obj)/unifdef > > subdir-$(CONFIG_MODVERSIONS) += genksyms > > subdir-y += mod > > subdir-$(CONFIG_SECURITY_SELINUX) += selinux > > -subdir-$(CONFIG_DTC) += dtc > > subdir-$(CONFIG_GDB_SCRIPTS) += gdb > > > > # Let clean descend into subdirs Looks like I need to leave this line to fix the above and cleaning. Thanks for the review. Rob ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Re: [PATCH] treewide: remove current_text_addr
On Sun, Aug 26, 2018 at 1:25 PM Linus Torvalds wrote: > Honestly, I'd suggest: > > - just do the current_text_addr() to _THIS_IP_ conversion > > - keep _THIS_IP_ and make it be the generic one, and screw the whole > "some architectures might implement is better" issue. Nobody cares. And mention it to the compiler vendors as this seems like a case where code gen can be improved. > > - try to convince people to move away from the "we want the kernel > instruction pointer for the call" model entirely, and consider this a > "legacy" issue. > > The whole instruction pointer is a nasty thing. We should discourage > it and not make complex infrastructure for it. Yes, please. I think we should strive for simplicity here. > > Instead, maybe we could encourage something like > > struct kernel_loc { const char *file; const char *fn; int line; }; > > #define __GEN_LOC__(n) \ > ({ static const struct kernel_loc n = { \ > __FILE__, __FUNCTION__, __LINE__ \ >}; &n; }) > > #define _THIS_LOC_ __GEN_LOC__(__UNIQUE_ID(loc)) > > which is a hell of a lot nicer to use, and actually allows gcc to > optimize things (try it: if you pass a _THIS_LOC_ off to an inline > function, and that inline function uses the name and line number, gcc > will pick them up directly, without the extra structure dereference. > > Wouldn't it be much nicer to pass these kinds of "location pointer" > around, rather than the nasty _THIS_IP_ thing? > > Certainly lockdep looks like it could easily take that "const struct > kernel_loc *" instead of "unsigned long ip". Makes it easy to print > out the lockdep info. > > Ok, I didn't try to convert anybody, so maybe people who currently use > _THIS_IP_ or current_text_addr() have some fundamental reason why they > want just that, but let's not male _THIS_IP_ more complex than it > needs to be. > > Hmm? > > Linus This is extremely reasonable. I can follow up with the lockdep folks to see if they really need _THIS_IP_ to solve their problem, or if there's a simpler solution that can solve their needs. Sometimes taking a step back and asking for clarity around the big picture allows simpler solutions to shake out. -- Thanks, ~Nick Desaulniers ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc
[PATCH] arc: remove redundant GCC version checks
Commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6") bumped the minimum GCC version to 4.6 for all architectures. With GCC >= 4.6 assumed, 'upto_gcc44' is empty, 'atleast_gcc44' is y. Signed-off-by: Masahiro Yamada --- arch/arc/Makefile | 10 +- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/arch/arc/Makefile b/arch/arc/Makefile index fb02619..99cce77 100644 --- a/arch/arc/Makefile +++ b/arch/arc/Makefile @@ -43,10 +43,7 @@ ifdef CONFIG_ARC_CURR_IN_REG LINUXINCLUDE += -include ${src}/arch/arc/include/asm/current.h endif -upto_gcc44:= $(call cc-ifversion, -le, 0404, y) -atleast_gcc44 := $(call cc-ifversion, -ge, 0404, y) - -cflags-$(atleast_gcc44)+= -fsection-anchors +cflags-y += -fsection-anchors cflags-$(CONFIG_ARC_HAS_LLSC) += -mlock cflags-$(CONFIG_ARC_HAS_SWAPE) += -mswape @@ -82,11 +79,6 @@ cflags-$(disable_small_data) += -mno-sdata -fcall-used-gp cflags-$(CONFIG_CPU_BIG_ENDIAN)+= -mbig-endian ldflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB -# STAR 9000518362: (fixed with binutils shipping with gcc 4.8) -# arc-linux-uclibc-ld (buildroot) or arceb-elf32-ld (EZChip) don't accept -# --build-id w/o "-marclinux". Default arc-elf32-ld is OK -ldflags-$(upto_gcc44) += -marclinux - LIBGCC := $(shell $(CC) $(cflags-y) --print-libgcc-file-name) # Modules with short calls might break for calls into builtin-kernel -- 2.7.4 ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc