Re: Build regressions/improvements in v3.13-rc2
On Sun, Dec 1, 2013 at 10:44 AM, Geert Uytterhoeven ge...@linux-m68k.org wrote: JFYI, when comparing v3.13-rc2[1] to v3.13-rc1[3], the summaries are: - build errors: +8/-8 - build warnings: +147/-97 + /scratch/kisskb/src/drivers/crypto/caam/jr.c: error: implicit declaration of function 'of_iomap' [-Werror=implicit-function-declaration]: = 468:2 powerpc/mpc85xx_defconfig + /scratch/kisskb/src/arch/powerpc/kernel/swsusp_booke.S: Error: invalid sprg number: = 161, 85, 165, 91, 167, 163, 87, 89 powerpc-randconfig + /scratch/kisskb/src/drivers/tty/ehv_bytechan.c: error: type defaults to 'int' in declaration of 'console_initcall' [-Werror=implicit-int]: = 363:1 powerpc-allmodconfig + /scratch/kisskb/src/arch/sparc/kernel/kgdb_64.c: error: implicit declaration of function 'exception_enter' [-Werror=implicit-function-declaration]: = 162:7 + /scratch/kisskb/src/arch/sparc/kernel/kgdb_64.c: error: implicit declaration of function 'exception_exit' [-Werror=implicit-function-declaration]: = 176:2 sparc64-allmodconfig + error: drivers/built-in.o: undefined reference to `i2c_register_driver': = .init.literal+0xd88) + error: sram.c: undefined reference to `devm_regmap_init_i2c': = .text+0x590dc) sparc-allmodconfig xtensa-allmodconfig + /scratch/kisskb/src/drivers/gpu/drm/drm_gem_cma_helper.c: error: implicit declaration of function 'dma_alloc_writecombine' [-Werror=implicit-function-declaration]: = 91:2 + /scratch/kisskb/src/drivers/gpu/drm/drm_gem_cma_helper.c: error: implicit declaration of function 'dma_free_writecombine' [-Werror=implicit-function-declaration]: = 176:3 sh-randconfig [1] http://kisskb.ellerman.id.au/kisskb/head/6939/ (119 out of 120 configs) [3] http://kisskb.ellerman.id.au/kisskb/head/6919/ (119 out of 120 configs) Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/9] powerpc: Add TIF_ELF2ABI flag.
Michael Ellerman m...@ellerman.id.au writes: On Wed, Nov 20, 2013 at 10:15:00PM +1100, Anton Blanchard wrote: From: Rusty Russell ru...@rustcorp.com.au Little endian ppc64 is getting an exciting new ABI. This is reflected by the bottom two bits of e_flags in the ELF header: 0 == legacy binaries (v1 ABI) 1 == binaries using the old ABI (compiled with a new toolchain) 2 == binaries using the new ABI. Just to be ridiculously clear for stupid people like me, you refer here to the v1 ABI and the old ABI - they are the same thing - right? Sorry for delay, was off for a week. Yes, same thing. diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index ba7b197..05a3030 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h @@ -107,6 +107,9 @@ static inline struct thread_info *current_thread_info(void) #define TIF_EMULATE_STACK_STORE 16 /* Is an instruction emulation for stack store? */ #define TIF_MEMDIE 17 /* is terminating due to OOM killer */ +#if defined(CONFIG_PPC64) +#define TIF_ELF2ABI 18 /* function descriptors must die! */ +#endif This is the first TIF flag we #ifdef for 32 vs 64, is that just because we don't want to waste a flag on 32 bit? No, it's because I wanted to make damn sure that there wasn't anyone testing this in 32-bit code, since ELF2 is currently a 64-bit only option. Cheers, Rusty. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] watchdog: mpc8xxx_wdt: MPC8xx is HW enabled
On 11/30/2013 07:45 AM, Christophe Leroy wrote: MPC8xx watchdog is enabled at startup by HW. If the bootloader disables it, it cannot be reenabled. Is that true for all variants of 8xx, especially for 823 ? I am a bit concerned about breaking compatibility with some chips ... assuming there was a reason for not setting this flag originally. Thanks, Guenter Signed-off-by: Christophe Leroy christophe.le...@c-s.fr diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c --- a/drivers/watchdog/mpc8xxx_wdt.c2013-05-11 22:57:46.0 +0200 +++ b/drivers/watchdog/mpc8xxx_wdt.c2013-08-08 02:12:15.0 +0200 @@ -273,6 +310,7 @@ .compatible = fsl,mpc823-wdt, .data = (struct mpc8xxx_wdt_type) { .prescaler = 0x800, + .hw_enabled = true, }, }, {}, --- Ce courrier électronique ne contient aucun virus ou logiciel malveillant parce que la protection avast! Antivirus est active. http://www.avast.com -- To unsubscribe from this list: send the line unsubscribe linux-watchdog in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] watchdog: mpc8xxx_wdt convert to watchdog core
On 11/30/2013 07:33 AM, Christophe Leroy wrote: Convert mpc8xxx_wdt.c to the new watchdog API. Signed-off-by: Christophe Leroy christophe.le...@c-s.fr diff -ur a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c --- a/drivers/watchdog/mpc8xxx_wdt.c2013-05-11 22:57:46.0 +0200 +++ b/drivers/watchdog/mpc8xxx_wdt.c2013-11-30 16:14:53.803495472 +0100 @@ -72,28 +72,31 @@ * to 0 */ static int prescale = 1; -static unsigned int timeout_sec; -static unsigned long wdt_is_open; static DEFINE_SPINLOCK(wdt_spinlock); -static void mpc8xxx_wdt_keepalive(void) +static int mpc8xxx_wdt_ping(struct watchdog_device *w) { /* Ping the WDT */ spin_lock(wdt_spinlock); out_be16(wd_base-swsrr, 0x556c); out_be16(wd_base-swsrr, 0xaa39); spin_unlock(wdt_spinlock); + return 0; The return code is never checked, so you can make this function void. } +static struct watchdog_device mpc8xxx_wdt_dev; static void mpc8xxx_wdt_timer_ping(unsigned long arg); -static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, 0); +static DEFINE_TIMER(wdt_timer, mpc8xxx_wdt_timer_ping, 0, + (unsigned long)mpc8xxx_wdt_dev); static void mpc8xxx_wdt_timer_ping(unsigned long arg) { - mpc8xxx_wdt_keepalive(); + struct watchdog_device *w = (struct watchdog_device *)arg; + + mpc8xxx_wdt_ping(w); /* We're pinging it twice faster than needed, just to be sure. */ - mod_timer(wdt_timer, jiffies + HZ * timeout_sec / 2); + mod_timer(wdt_timer, jiffies + HZ * w-timeout / 2); } static void mpc8xxx_wdt_pr_warn(const char *msg) @@ -102,19 +105,9 @@ reset ? reset : machine check exception); } -static ssize_t mpc8xxx_wdt_write(struct file *file, const char __user *buf, -size_t count, loff_t *ppos) -{ - if (count) - mpc8xxx_wdt_keepalive(); - return count; -} - -static int mpc8xxx_wdt_open(struct inode *inode, struct file *file) +static int mpc8xxx_wdt_start(struct watchdog_device *w) { u32 tmp = SWCRR_SWEN; - if (test_and_set_bit(0, wdt_is_open)) - return -EBUSY; /* Once we start the watchdog we can't stop it */ if (nowayout) This code and the subsequent module_get can be removed; it is handled by the infrastructure. @@ -132,59 +125,30 @@ del_timer_sync(wdt_timer); - return nonseekable_open(inode, file); + return 0; } -static int mpc8xxx_wdt_release(struct inode *inode, struct file *file) +static int mpc8xxx_wdt_stop(struct watchdog_device *w) { - if (!nowayout) - mpc8xxx_wdt_timer_ping(0); - else - mpc8xxx_wdt_pr_warn(watchdog closed); - clear_bit(0, wdt_is_open); + mpc8xxx_wdt_timer_ping((unsigned long)w); I really dislike this typecasting back and forth. I think it would be better to move the mod_timer() call from mpc8xxx_wdt_timer_ping into mpc8xxx_wdt_ping and call mpc8xxx_wdt_ping directly whenever possible. From mpc8xxx_wdt_timer_ping you can then just call mpc8xxx_wdt_ping with the typecasted parameter. return 0; } -static long mpc8xxx_wdt_ioctl(struct file *file, unsigned int cmd, - unsigned long arg) -{ - void __user *argp = (void __user *)arg; - int __user *p = argp; - static const struct watchdog_info ident = { - .options = WDIOF_KEEPALIVEPING, - .firmware_version = 1, - .identity = MPC8xxx, - }; - - switch (cmd) { - case WDIOC_GETSUPPORT: - return copy_to_user(argp, ident, sizeof(ident)) ? -EFAULT : 0; - case WDIOC_GETSTATUS: - case WDIOC_GETBOOTSTATUS: - return put_user(0, p); - case WDIOC_KEEPALIVE: - mpc8xxx_wdt_keepalive(); - return 0; - case WDIOC_GETTIMEOUT: - return put_user(timeout_sec, p); - default: - return -ENOTTY; - } -} +static struct watchdog_info mpc8xxx_wdt_info = { + .options = WDIOF_KEEPALIVEPING, + .firmware_version = 1, + .identity = MPC8xxx, +}; -static const struct file_operations mpc8xxx_wdt_fops = { - .owner = THIS_MODULE, - .llseek = no_llseek, - .write = mpc8xxx_wdt_write, - .unlocked_ioctl = mpc8xxx_wdt_ioctl, - .open = mpc8xxx_wdt_open, - .release= mpc8xxx_wdt_release, +static struct watchdog_ops mpc8xxx_wdt_ops = { + .owner = THIS_MODULE, + .start = mpc8xxx_wdt_start, + .stop = mpc8xxx_wdt_stop, }; -static struct miscdevice mpc8xxx_wdt_miscdev = { - .minor = WATCHDOG_MINOR, - .name = watchdog, - .fops = mpc8xxx_wdt_fops, +static struct watchdog_device mpc8xxx_wdt_dev = { + .info = mpc8xxx_wdt_info, + .ops = mpc8xxx_wdt_ops, }; static const
ping: re: [PATCH 1/1] kernel code that do not handle NULL return of kmem_cache_zalloc
ping I do a grep for kmem_cache_zalloc and kmem_cache_alloc in kernel tree, and find some code do not handle NULL return of kmem_cache_zalloc correctly Signed-off-by: Zhouyi Zhou yizhouz...@ict.ac.cn --- arch/powerpc/kvm/book3s_32_mmu_host.c |5 + drivers/iommu/omap-iommu.c|3 ++- fs/jffs2/malloc.c |4 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_32_mmu_host.c b/arch/powerpc/kvm/book3s_32_mmu_host.c index 3a0abd2..5fac89d 100644 --- a/arch/powerpc/kvm/book3s_32_mmu_host.c +++ b/arch/powerpc/kvm/book3s_32_mmu_host.c @@ -243,6 +243,11 @@ next_pteg: /* Now tell our Shadow PTE code about the new page */ pte = kvmppc_mmu_hpte_cache_next(vcpu); + if (!pte) { + kvm_release_pfn_clean(hpaddr PAGE_SHIFT); + r = -EAGAIN; + goto out; + } dprintk_mmu(KVM: %c%c Map 0x%llx: [%lx] 0x%llx (0x%llx) - %lx\n, orig_pte-may_write ? 'w' : '-', diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index bcd78a7..5155714 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -551,7 +551,8 @@ static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd, u32 da) dev_vdbg(obj-dev, %s: a new pte:%p\n, __func__, iopte); } else { /* We raced, free the reduniovant table */ - iopte_free(iopte); + if (iopte) + iopte_free(iopte); } pte_ready: diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c index 4f47aa2..58e2336 100644 --- a/fs/jffs2/malloc.c +++ b/fs/jffs2/malloc.c @@ -287,6 +287,8 @@ struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void) { struct jffs2_xattr_datum *xd; xd = kmem_cache_zalloc(xattr_datum_cache, GFP_KERNEL); + if (!xd) + return NULL; dbg_memalloc(%p\n, xd); xd-class = RAWNODE_CLASS_XATTR_DATUM; @@ -305,6 +307,8 @@ struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void) { struct jffs2_xattr_ref *ref; ref = kmem_cache_zalloc(xattr_ref_cache, GFP_KERNEL); + if (!ref) + return NULL; dbg_memalloc(%p\n, ref); ref-class = RAWNODE_CLASS_XATTR_REF; -- 1.7.10.4 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: 3.13 Oops on ppc64_cpu --smt=off
Hi, On 11/30/2013 11:15 PM, Alexander Graf wrote: Hi Ben, With current linus master (3.13-rc2+) I'm facing an interesting issue with SMT disabling on p7. When I trigger the cpu offlining it works as expected, but after a few seconds the machine goes into an oops as you can see below. It looks like a null pointer dereference. tip/sched/urgent has the below fix. Can you please apply the following it and check if the issue gets resolved? A similar issue was reported earlier as well and it pointed to the commit id 37dc65. I believe the problem that you report is also pointing to the regression caused by the same commit id. Thanks Regards Preeti U Murthy --- commit 42eb088ed246a5a817bb45a8b32fe234cf1c0f8b Author: Peter Zijlstra pet...@infradead.org Date: Tue Nov 19 16:41:49 2013 +0100 sched: Avoid NULL dereference on sd_busy Commit 37dc6b50cee9 (sched: Remove unnecessary iteration over sched domains to update nr_busy_cpus) forgot to clear 'sd_busy' under some conditions leading to a possible NULL deref in set_cpu_sd_state_idle(). Reported-by: Anton Blanchard an...@samba.org Cc: Preeti U Murthy pre...@linux.vnet.ibm.com Signed-off-by: Peter Zijlstra pet...@infradead.org Link: http://lkml.kernel.org/r/20131118113701.gf3...@twins.programming.kicks-ass.net Signed-off-by: Ingo Molnar mi...@kernel.org diff --git a/kernel/sched/core.c b/kernel/sched/core.c index c1808606ee5f..a1591ca7eb5a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -4910,8 +4910,9 @@ static void update_top_cache_domain(int cpu) if (sd) { id = cpumask_first(sched_domain_span(sd)); size = cpumask_weight(sched_domain_span(sd)); - rcu_assign_pointer(per_cpu(sd_busy, cpu), sd-parent); + sd = sd-parent; /* sd_busy */ } + rcu_assign_pointer(per_cpu(sd_busy, cpu), sd); rcu_assign_pointer(per_cpu(sd_llc, cpu), sd); per_cpu(sd_llc_size, cpu) = size; Alex ($ ppc64_cpu --smt=off) kvm: disabling virtualization on CPU1 kvm: disabling virtualization on CPU2 kvm: disabling virtualization on CPU3 kvm: disabling virtualization on CPU5 kvm: disabling virtualization on CPU6 kvm: disabling virtualization on CPU7 kvm: disabling virtualization on CPU9 kvm: disabling virtualization on CPU10 kvm: disabling virtualization on CPU11 kvm: disabling virtualization on CPU13 kvm: disabling virtualization on CPU14 kvm: disabling virtualization on CPU15 kvm: disabling virtualization on CPU17 kvm: disabling virtualization on CPU18 kvm: disabling virtualization on CPU19 kvm: disabling virtualization on CPU21 kvm: disabling virtualization on CPU22 kvm: disabling virtualization on CPU23 kvm: disabling virtualization on CPU25 kvm: disabling virtualization on CPU26 kvm: disabling virtualization on CPU27 kvm: disabling virtualization on CPU29 kvm: disabling virtualization on CPU30 kvm: disabling virtualization on CPU31 kvm: disabling virtualization on CPU33 kvm: disabling virtualization on CPU34 kvm: disabling virtualization on CPU35 kvm: disabling virtualization on CPU37 kvm: disabling virtualization on CPU38 kvm: disabling virtualization on CPU39 kvm: disabling virtualization on CPU41 kvm: disabling virtualization on CPU42 kvm: disabling virtualization on CPU43 kvm: disabling virtualization on CPU45 kvm: disabling virtualization on CPU46 kvm: disabling virtualization on CPU47 kvm: disabling virtualization on CPU49 kvm: disabling virtualization on CPU50 kvm: disabling virtualization on CPU51 kvm: disabling virtualization on CPU53 kvm: disabling virtualization on CPU54 kvm: disabling virtualization on CPU55 kvm: disabling virtualization on CPU57 kvm: disabling virtualization on CPU58 kvm: disabling virtualization on CPU59 kvm: disabling virtualization on CPU61 kvm: disabling virtualization on CPU62 kvm: disabling virtualization on CPU63 Unable to handle kernel paging request for data at address 0x0010 Faulting instruction address: 0xc0124188 Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=1024 NUMA PowerNV Modules linked in: iptable_filter ip_tables x_tables nfsv3 nfs_acl nfs fscache lockd sunrpc autofs4 binfmt_misc af_packet fuse loop dm_mod ohci_pci ohci_hcd ehci_pci ehci_hcd e1000e usbcore sr_mod cdrom ses enclosure rtc_generic usb_common ptp sg pps_core sd_mod crc_t10dif crct10dif_common scsi_dh_hp_sw scsi_dh_alua scsi_dh_emc scsi_dh_rdac scsi_dh virtio_pci virtio_console virtio_blk virtio virtio_ring ipr libata scsi_mod CPU: 56 PID: 0 Comm: swapper/56 Not tainted 3.13.0-rc2-0.g01695c8-default+ #1 task: c007f28b5180 ti: c007f28c8000 task.ti: c007f28c8000 NIP: c0124188 LR: c0124144 CTR: c011e650 REGS: c007f28cb1e0 TRAP: 0300 Not tainted (3.13.0-rc2-0.g01695c8-default+) MSR: 90009032 SF,HV,EE,ME,IR,DR,RI CR: 2428 XER: CFAR: c000908c
Re: [PATCH] watchdog: mpc8xxx_wdt: MPC8xx is HW enabled
Dear Guenter, In message 529b9152.9090...@roeck-us.net you wrote: On 11/30/2013 07:45 AM, Christophe Leroy wrote: MPC8xx watchdog is enabled at startup by HW. If the bootloader disables it, it cannot be reenabled. Is that true for all variants of 8xx, especially for 823 ? I am a bit concerned about breaking compatibility with some chips ... assuming there was a reason for not setting this flag originally. This is correct, and applies for all variants of the MPC8xx, including the MPC823 / MPC823E. From the UM: The software watchdog timer can be disabled or its timeout period can be changed in the SYPCR. Once the SYPCR is written, it cannot be written again until a system reset. Actually this is the only correct behaviour. Any watchdog that can be disabled by software is not worth it's name, and unsuitable for any kind of aplications where security / reliability are required. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Ninety-Ninety Rule of Project Schedules: The first ninety percent of the task takes ninety percent of the time, and the last ten percent takes the other ninety percent. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
re: ping: re:[PATCH 1/1] kernel code that do not handle NULL return of kmem_cache_zalloc
From: Zhouyi Zhou zhouzho...@gmail.com the text of previous ping message maybe garbled sorry for the trouble I do a grep for kmem_cache_zalloc and kmem_cache_alloc in kernel tree, and find some code do not handle NULL return of kmem_cache_zalloc correctly Signed-off-by: Zhouyi Zhou yizhouz...@ict.ac.cn --- arch/powerpc/kvm/book3s_32_mmu_host.c |5 + drivers/iommu/omap-iommu.c|3 ++- fs/jffs2/malloc.c |4 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kvm/book3s_32_mmu_host.c b/arch/powerpc/kvm/book3s_32_mmu_host.c index 3a0abd2..5fac89d 100644 --- a/arch/powerpc/kvm/book3s_32_mmu_host.c +++ b/arch/powerpc/kvm/book3s_32_mmu_host.c @@ -243,6 +243,11 @@ next_pteg: /* Now tell our Shadow PTE code about the new page */ pte = kvmppc_mmu_hpte_cache_next(vcpu); + if (!pte) { + kvm_release_pfn_clean(hpaddr PAGE_SHIFT); + r = -EAGAIN; + goto out; + } dprintk_mmu(KVM: %c%c Map 0x%llx: [%lx] 0x%llx (0x%llx) - %lx\n, orig_pte-may_write ? 'w' : '-', diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c index bcd78a7..5155714 100644 --- a/drivers/iommu/omap-iommu.c +++ b/drivers/iommu/omap-iommu.c @@ -551,7 +551,8 @@ static u32 *iopte_alloc(struct omap_iommu *obj, u32 *iopgd, u32 da) dev_vdbg(obj-dev, %s: a new pte:%p\n, __func__, iopte); } else { /* We raced, free the reduniovant table */ - iopte_free(iopte); + if (iopte) + iopte_free(iopte); } pte_ready: diff --git a/fs/jffs2/malloc.c b/fs/jffs2/malloc.c index 4f47aa2..58e2336 100644 --- a/fs/jffs2/malloc.c +++ b/fs/jffs2/malloc.c @@ -287,6 +287,8 @@ struct jffs2_xattr_datum *jffs2_alloc_xattr_datum(void) { struct jffs2_xattr_datum *xd; xd = kmem_cache_zalloc(xattr_datum_cache, GFP_KERNEL); + if (!xd) + return NULL; dbg_memalloc(%p\n, xd); xd-class = RAWNODE_CLASS_XATTR_DATUM; @@ -305,6 +307,8 @@ struct jffs2_xattr_ref *jffs2_alloc_xattr_ref(void) { struct jffs2_xattr_ref *ref; ref = kmem_cache_zalloc(xattr_ref_cache, GFP_KERNEL); + if (!ref) + return NULL; dbg_memalloc(%p\n, ref); ref-class = RAWNODE_CLASS_XATTR_REF; -- 1.7.10.4 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev