svn commit: r283330 - head/sys/fs/nfsclient
Author: rmacklem Date: Sat May 23 21:58:41 2015 New Revision: 283330 URL: https://svnweb.freebsd.org/changeset/base/283330 Log: The NFS client generated directory block(s) with d_fileno == 0 so that it would not return less data than requested. Since returning less directory data than requested is not a problem for FreeBSD and even UFS no longer returns directory structures with d_fileno == 0, this patch stops the client from doing this. Although entries with d_fileno == 0 should not be a problem, the man pages no longer document that these entries should be ignored, so there was a concern that these entries might be an issue in the future. Suggested by: trasz Tested by:trasz MFC after:2 weeks Modified: head/sys/fs/nfsclient/nfs_clrpcops.c Modified: head/sys/fs/nfsclient/nfs_clrpcops.c == --- head/sys/fs/nfsclient/nfs_clrpcops.cSat May 23 21:12:51 2015 (r283329) +++ head/sys/fs/nfsclient/nfs_clrpcops.cSat May 23 21:58:41 2015 (r283330) @@ -3072,25 +3072,6 @@ nfsrpc_readdir(vnode_t vp, struct uio *u *eofp = eof; } - /* -* Add extra empty records to any remaining DIRBLKSIZ chunks. -*/ - while (uio_uio_resid(uiop) 0 ((size_t)(uio_uio_resid(uiop))) != tresid) { - dp = (struct dirent *) CAST_DOWN(caddr_t, uio_iov_base(uiop)); - dp-d_type = DT_UNKNOWN; - dp-d_fileno = 0; - dp-d_namlen = 0; - dp-d_name[0] = '\0'; - tl = (u_int32_t *)dp-d_name[4]; - *tl++ = cookie.lval[0]; - *tl = cookie.lval[1]; - dp-d_reclen = DIRBLKSIZ; - uio_iov_base_add(uiop, DIRBLKSIZ); - uio_iov_len_add(uiop, -(DIRBLKSIZ)); - uio_uio_resid_add(uiop, -(DIRBLKSIZ)); - uiop-uio_offset += DIRBLKSIZ; - } - nfsmout: if (nd-nd_mrep != NULL) mbuf_freem(nd-nd_mrep); @@ -3565,25 +3546,6 @@ nfsrpc_readdirplus(vnode_t vp, struct ui *eofp = eof; } - /* -* Add extra empty records to any remaining DIRBLKSIZ chunks. -*/ - while (uio_uio_resid(uiop) 0 uio_uio_resid(uiop) != tresid) { - dp = (struct dirent *)uio_iov_base(uiop); - dp-d_type = DT_UNKNOWN; - dp-d_fileno = 0; - dp-d_namlen = 0; - dp-d_name[0] = '\0'; - tl = (u_int32_t *)dp-d_name[4]; - *tl++ = cookie.lval[0]; - *tl = cookie.lval[1]; - dp-d_reclen = DIRBLKSIZ; - uio_iov_base_add(uiop, DIRBLKSIZ); - uio_iov_len_add(uiop, -(DIRBLKSIZ)); - uio_uio_resid_add(uiop, -(DIRBLKSIZ)); - uiop-uio_offset += DIRBLKSIZ; - } - nfsmout: if (nd-nd_mrep != NULL) mbuf_freem(nd-nd_mrep); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r282240 - in head: cddl/lib/libdtrace sys/netinet
On 04/29/15 at 05:19P, George V. Neville-Neil wrote: Author: gnn Date: Wed Apr 29 17:19:55 2015 New Revision: 282240 URL: https://svnweb.freebsd.org/changeset/base/282240 Log: Brief demo script showing the various values that can be read via the new SIFTR statically defined tracepoint (SDT). Differential Revision: https://reviews.freebsd.org/D2387 Reviewed by:bz, markj Modified: head/cddl/lib/libdtrace/tcp.d head/sys/netinet/in_kdtrace.c head/sys/netinet/in_kdtrace.h head/sys/netinet/siftr.c George, This seems useful. Can this be MFC'd to 10? Cheers, Hiren pgpXLCvMkAdCr.pgp Description: PGP signature
svn commit: r283331 - head/sys/arm/arm
Author: andrew Date: Sat May 23 22:28:59 2015 New Revision: 283331 URL: https://svnweb.freebsd.org/changeset/base/283331 Log: Use the wait-for-event instruction to put the core we have just enabled to sleep while it waits to start scheduling. The boot core can then use the send-event instruction to wake the cores when they should enter the scheduler. MFC after:1 week Modified: head/sys/arm/arm/mp_machdep.c Modified: head/sys/arm/arm/mp_machdep.c == --- head/sys/arm/arm/mp_machdep.c Sat May 23 21:58:41 2015 (r283330) +++ head/sys/arm/arm/mp_machdep.c Sat May 23 22:28:59 2015 (r283331) @@ -185,8 +185,11 @@ init_secondary(int cpu) atomic_add_rel_32(mp_naps, 1); /* Spin until the BSP releases the APs */ - while (!aps_ready) - ; + while (!atomic_load_acq_int(aps_ready)) { +#if __ARM_ARCH = 7 + __asm __volatile(wfe); +#endif + } /* Initialize curthread */ KASSERT(PCPU_GET(idlethread) != NULL, (no idle thread)); @@ -353,6 +356,10 @@ release_aps(void *dummy __unused) arm_unmask_irq(i); } atomic_store_rel_int(aps_ready, 1); + /* Wake the other threads up */ +#if __ARM_ARCH = 7 + armv7_sev(); +#endif printf(Release APs\n); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283332 - in stable/10/sys: arm/arm arm/mv dev/ofw
Author: ian Date: Sat May 23 22:33:06 2015 New Revision: 283332 URL: https://svnweb.freebsd.org/changeset/base/283332 Log: MFC r274249, r274484, r275583: Avoid panic in ofwbus caused by not released resource list entry Fix typo in ARM GIC device_printf() Fix buffer overflow in Marvell PCI/PCIe driver Modified: stable/10/sys/arm/arm/gic.c stable/10/sys/arm/mv/mv_pci.c stable/10/sys/dev/ofw/ofwbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/gic.c == --- stable/10/sys/arm/arm/gic.c Sat May 23 22:28:59 2015(r283331) +++ stable/10/sys/arm/arm/gic.c Sat May 23 22:33:06 2015(r283332) @@ -273,7 +273,7 @@ arm_gic_attach(device_t dev) arm_config_irq = gic_config_irq; icciidr = gic_c_read_4(GICC_IIDR); - device_printf(dev,pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x sc-nirqs %u\n, + device_printf(dev,pn 0x%x, arch 0x%x, rev 0x%x, implementer 0x%x irqs %u\n, icciidr20, (icciidr16) 0xF, (icciidr12) 0xf, (icciidr 0xfff), sc-nirqs); Modified: stable/10/sys/arm/mv/mv_pci.c == --- stable/10/sys/arm/mv/mv_pci.c Sat May 23 22:28:59 2015 (r283331) +++ stable/10/sys/arm/mv/mv_pci.c Sat May 23 22:33:06 2015 (r283332) @@ -1171,7 +1171,7 @@ mv_pcib_alloc_msi(device_t dev, device_t for (i = start; i start + count; i++) { setbit(sc-sc_msi_bitmap, i); - irqs[i] = MSI_IRQ + i; + *irqs++ = MSI_IRQ + i; } debugf(%s: start: %x count: %x\n, __func__, start, count); Modified: stable/10/sys/dev/ofw/ofwbus.c == --- stable/10/sys/dev/ofw/ofwbus.c Sat May 23 22:28:59 2015 (r283331) +++ stable/10/sys/dev/ofw/ofwbus.c Sat May 23 22:33:06 2015 (r283332) @@ -399,11 +399,17 @@ ofwbus_adjust_resource(device_t bus, dev } static int -ofwbus_release_resource(device_t bus __unused, device_t child, int type, +ofwbus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { + struct resource_list_entry *rle; int error; + /* Clean resource list entry */ + rle = resource_list_find(BUS_GET_RESOURCE_LIST(bus, child), type, rid); + if (rle != NULL) + rle-res = NULL; + if ((rman_get_flags(r) RF_ACTIVE) != 0) { error = bus_deactivate_resource(child, type, rid, r); if (error) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283333 - stable/10/sys/kern
Author: ian Date: Sat May 23 22:34:25 2015 New Revision: 28 URL: https://svnweb.freebsd.org/changeset/base/28 Log: MFC r274711: Stop using early_putc immediately after configuring console with cninit() Modified: stable/10/sys/kern/kern_cons.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_cons.c == --- stable/10/sys/kern/kern_cons.c Sat May 23 22:33:06 2015 (r283332) +++ stable/10/sys/kern/kern_cons.c Sat May 23 22:34:25 2015 (r28) @@ -156,6 +156,13 @@ cninit(void) * Make the best console the preferred console. */ cnselect(best_cn); + +#ifdef EARLY_PRINTF + /* +* Release early console. +*/ + early_putc = NULL; +#endif } void ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283334 - in stable/10/sys: arm/arm dev/fdt dev/ofw
Author: ian Date: Sat May 23 22:36:41 2015 New Revision: 283334 URL: https://svnweb.freebsd.org/changeset/base/283334 Log: MFC r277098, r279235: Introduce ofw_bus_reg_to_rl() to replace part of common bus code Fix endianness on FDT read in ARM GIC Modified: stable/10/sys/arm/arm/gic.c stable/10/sys/dev/fdt/simplebus.c stable/10/sys/dev/ofw/ofw_bus_subr.c stable/10/sys/dev/ofw/ofw_bus_subr.h stable/10/sys/dev/ofw/ofwbus.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/gic.c == --- stable/10/sys/arm/arm/gic.c Sat May 23 22:34:25 2015(r28) +++ stable/10/sys/arm/arm/gic.c Sat May 23 22:36:41 2015(r283334) @@ -204,7 +204,7 @@ gic_decode_fdt(uint32_t iparent, uint32_ *trig = INTR_TRIGGER_CONFORM; *pol = INTR_POLARITY_CONFORM; } else { - if (intr[0] == 0) + if (fdt32_to_cpu(intr[0]) == 0) *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_SPI; else *interrupt = fdt32_to_cpu(intr[1]) + GIC_FIRST_PPI; @@ -216,13 +216,13 @@ gic_decode_fdt(uint32_t iparent, uint32_ * 8 = active low level-sensitive * The hardware only supports active-high-level or rising-edge. */ - if (intr[2] 0x0a) { + if (fdt32_to_cpu(intr[2]) 0x0a) { printf(unsupported trigger/polarity configuration - 0x%2x\n, intr[2] 0x0f); + 0x%2x\n, fdt32_to_cpu(intr[2]) 0x0f); return (ENOTSUP); } *pol = INTR_POLARITY_CONFORM; - if (intr[2] 0x01) + if (fdt32_to_cpu(intr[2]) 0x01) *trig = INTR_TRIGGER_EDGE; else *trig = INTR_TRIGGER_LEVEL; Modified: stable/10/sys/dev/fdt/simplebus.c == --- stable/10/sys/dev/fdt/simplebus.c Sat May 23 22:34:25 2015 (r28) +++ stable/10/sys/dev/fdt/simplebus.c Sat May 23 22:36:41 2015 (r283334) @@ -253,10 +253,6 @@ simplebus_setup_dinfo(device_t dev, phan { struct simplebus_softc *sc; struct simplebus_devinfo *ndi; - uint32_t *reg; - uint64_t phys, size; - int i, j, k; - int nreg; sc = device_get_softc(dev); @@ -267,32 +263,7 @@ simplebus_setup_dinfo(device_t dev, phan } resource_list_init(ndi-rl); - nreg = OF_getencprop_alloc(node, reg, sizeof(*reg), (void **)reg); - if (nreg == -1) - nreg = 0; - if (nreg % (sc-acells + sc-scells) != 0) { - if (bootverbose) - device_printf(dev, Malformed reg property on %s\n, - ndi-obdinfo.obd_name); - nreg = 0; - } - - for (i = 0, k = 0; i nreg; i += sc-acells + sc-scells, k++) { - phys = size = 0; - for (j = 0; j sc-acells; j++) { - phys = 32; - phys |= reg[i + j]; - } - for (j = 0; j sc-scells; j++) { - size = 32; - size |= reg[i + sc-acells + j]; - } - - resource_list_add(ndi-rl, SYS_RES_MEMORY, k, - phys, phys + size - 1, size); - } - free(reg, M_OFWPROP); - + ofw_bus_reg_to_rl(dev, node, sc-acells, sc-scells, ndi-rl); ofw_bus_intr_to_rl(dev, node, ndi-rl); return (ndi); Modified: stable/10/sys/dev/ofw/ofw_bus_subr.c == --- stable/10/sys/dev/ofw/ofw_bus_subr.cSat May 23 22:34:25 2015 (r28) +++ stable/10/sys/dev/ofw/ofw_bus_subr.cSat May 23 22:36:41 2015 (r283334) @@ -370,6 +370,54 @@ ofw_bus_search_intrmap(void *intr, int i } int +ofw_bus_reg_to_rl(device_t dev, phandle_t node, pcell_t acells, pcell_t scells, +struct resource_list *rl) +{ + uint64_t phys, size; + ssize_t i, j, rid, nreg, ret; + uint32_t *reg; + char *name; + + /* +* This may be just redundant when having ofw_bus_devinfo +* but makes this routine independent of it. +*/ + ret = OF_getencprop_alloc(node, name, sizeof(*name), (void **)name); + if (ret == -1) + name = NULL; + + ret = OF_getencprop_alloc(node, reg, sizeof(*reg), (void **)reg); + nreg = (ret == -1) ? 0 : ret; + + if (nreg % (acells + scells) != 0) { + if (bootverbose) + device_printf(dev, Malformed reg property on %s\n, + (name == NULL) ? unknown : name); +
svn commit: r283335 - in stable/10/sys/arm: arm include
Author: ian Date: Sat May 23 22:48:54 2015 New Revision: 283335 URL: https://svnweb.freebsd.org/changeset/base/283335 Log: MFC r278518: Resolve cache line size from CP15 instead of hard-coded 32. Modified: stable/10/sys/arm/arm/cpufunc.c stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/elf_trampoline.c stable/10/sys/arm/include/armreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc.c == --- stable/10/sys/arm/arm/cpufunc.c Sat May 23 22:36:41 2015 (r283334) +++ stable/10/sys/arm/arm/cpufunc.c Sat May 23 22:48:54 2015 (r283335) @@ -837,6 +837,11 @@ u_int cpu_reset_needs_v4_MMU_disable; /* defined(CPU_XSCALE_80219) || defined(CPU_XSCALE_81342) || \ defined(CPU_CORTEXA) || defined(CPU_KRAIT) +/* Global cache line sizes, use 32 as default */ +intarm_dcache_min_line_size = 32; +intarm_icache_min_line_size = 32; +intarm_idcache_min_line_size = 32; + static void get_cachetype_cp15(void); /* Additional cache information local to this file. Log2 of some of the @@ -868,6 +873,12 @@ get_cachetype_cp15() goto out; if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) { + /* Resolve minimal cache line sizes */ + arm_dcache_min_line_size = 1 (CPU_CT_DMINLINE(ctype) + 2); + arm_icache_min_line_size = 1 (CPU_CT_IMINLINE(ctype) + 2); + arm_idcache_min_line_size = + min(arm_icache_min_line_size, arm_dcache_min_line_size); + __asm __volatile(mrc p15, 1, %0, c0, c0, 1 : =r (clevel)); arm_cache_level = clevel; Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S == --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 23 22:36:41 2015 (r283334) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 23 22:48:54 2015 (r283335) @@ -41,6 +41,12 @@ __FBSDID($FreeBSD$); .word _C_LABEL(arm_cache_loc) .Lcache_type: .word _C_LABEL(arm_cache_type) +.Larmv7_dcache_line_size: + .word _C_LABEL(arm_dcache_min_line_size) +.Larmv7_icache_line_size: + .word _C_LABEL(arm_icache_min_line_size) +.Larmv7_idcache_line_size: + .word _C_LABEL(arm_idcache_min_line_size) .Lway_mask: .word 0x3ff .Lmax_index: @@ -176,14 +182,9 @@ ENTRY(armv7_idcache_wbinv_all) RET END(armv7_idcache_wbinv_all) -/* XXX Temporary set it to 32 for MV cores, however this value should be - * get from Cache Type register - */ -.Larmv7_line_size: - .word 32 - ENTRY(armv7_dcache_wb_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_dcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -198,7 +199,8 @@ ENTRY(armv7_dcache_wb_range) END(armv7_dcache_wb_range) ENTRY(armv7_dcache_wbinv_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_dcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -217,7 +219,8 @@ END(armv7_dcache_wbinv_range) * must use wb-inv of the entire cache. */ ENTRY(armv7_dcache_inv_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_dcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -232,7 +235,8 @@ ENTRY(armv7_dcache_inv_range) END(armv7_dcache_inv_range) ENTRY(armv7_idcache_wbinv_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_idcache_line_size + ldr ip, [ip] sub r3, ip, #1 and r2, r0, r3 add r1, r1, r2 @@ -260,7 +264,8 @@ ENTRY_NP(armv7_icache_sync_all) END(armv7_icache_sync_all) ENTRY_NP(armv7_icache_sync_range) - ldr ip, .Larmv7_line_size + ldr ip, .Larmv7_icache_line_size + ldr ip, [ip] .Larmv7_sync_next: mcr CP15_ICIMVAU(r0) mcr CP15_DCCMVAC(r0) Modified: stable/10/sys/arm/arm/elf_trampoline.c == --- stable/10/sys/arm/arm/elf_trampoline.c Sat May 23 22:36:41 2015 (r283334) +++ stable/10/sys/arm/arm/elf_trampoline.c Sat May 23 22:48:54 2015 (r283335) @@ -115,6 +115,10 @@ int arm_pcache_unified; int arm_dcache_align; int arm_dcache_align_mask; +int arm_dcache_min_line_size = 32; +int arm_icache_min_line_size = 32; +int arm_idcache_min_line_size = 32; + u_int arm_cache_level; u_int arm_cache_type[14]; u_int arm_cache_loc; @@ -277,6 +281,13 @@ get_cachetype_cp15() goto out; if (CPU_CT_FORMAT(ctype) == CPU_CT_ARMV7) { + /* Resolve minimal cache line sizes */ +
svn commit: r283336 - in stable/10/sys/arm: arm include
Author: ian Date: Sat May 23 23:05:31 2015 New Revision: 283336 URL: https://svnweb.freebsd.org/changeset/base/283336 Log: MFC r279810, r279811: Clean data cache before instruction cache in armv7_icache_sync_range(). Add minimum cache line sizes to struct cpuinfo, use them in the new cache maintenance routines. Also add a routine to invalidate the branch cache. Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/cpuinfo.c stable/10/sys/arm/arm/genassym.c stable/10/sys/arm/include/cpu-v6.h stable/10/sys/arm/include/cpuinfo.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S == --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 23 22:48:54 2015 (r283335) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 23 23:05:31 2015 (r283336) @@ -247,8 +247,8 @@ ENTRY(armv7_idcache_wbinv_range) add r0, r0, ip subsr1, r1, ip bhi .Larmv7_id_wbinv_next - isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ + isb /* instruction synchronization barrier */ RET END(armv7_idcache_wbinv_range) @@ -258,8 +258,8 @@ ENTRY_NP(armv7_icache_sync_all) #else mcr CP15_ICIALLU #endif - isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ + isb /* instruction synchronization barrier */ RET END(armv7_icache_sync_all) @@ -267,13 +267,13 @@ ENTRY_NP(armv7_icache_sync_range) ldr ip, .Larmv7_icache_line_size ldr ip, [ip] .Larmv7_sync_next: - mcr CP15_ICIMVAU(r0) mcr CP15_DCCMVAC(r0) + mcr CP15_ICIMVAU(r0) add r0, r0, ip subsr1, r1, ip bhi .Larmv7_sync_next - isb /* instruction synchronization barrier */ dsb /* data synchronization barrier */ + isb /* instruction synchronization barrier */ RET END(armv7_icache_sync_range) Modified: stable/10/sys/arm/arm/cpuinfo.c == --- stable/10/sys/arm/arm/cpuinfo.c Sat May 23 22:48:54 2015 (r283335) +++ stable/10/sys/arm/arm/cpuinfo.c Sat May 23 23:05:31 2015 (r283336) @@ -34,7 +34,14 @@ __FBSDID($FreeBSD$); #include machine/cpuinfo.h #include machine/cpu-v6.h -struct cpuinfo cpuinfo; +struct cpuinfo cpuinfo = +{ + /* Use safe defaults for start */ + .dcache_line_size = 32, + .dcache_line_mask = 31, + .icache_line_size = 32, + .icache_line_mask = 31, +}; /* Read and parse CPU id scheme */ void @@ -122,4 +129,10 @@ cpuinfo_init(void) cpuinfo.generic_timer_ext = (cpuinfo.id_pfr1 16) 0xF; cpuinfo.virtualization_ext = (cpuinfo.id_pfr1 12) 0xF; cpuinfo.security_ext = (cpuinfo.id_pfr1 4) 0xF; + + /* L1 Cache sizes */ + cpuinfo.dcache_line_size = 1 (CPU_CT_DMINLINE(cpuinfo.ctr ) + 2); + cpuinfo.dcache_line_mask = cpuinfo.dcache_line_size - 1; + cpuinfo.icache_line_size= 1 (CPU_CT_IMINLINE(cpuinfo.ctr ) + 2); + cpuinfo.icache_line_mask = cpuinfo.icache_line_size - 1; } Modified: stable/10/sys/arm/arm/genassym.c == --- stable/10/sys/arm/arm/genassym.cSat May 23 22:48:54 2015 (r283335) +++ stable/10/sys/arm/arm/genassym.cSat May 23 23:05:31 2015 (r283336) @@ -45,6 +45,7 @@ __FBSDID($FreeBSD$); #include machine/cpu.h #include machine/proc.h #include machine/cpufunc.h +#include machine/cpuinfo.h #include machine/pte.h #include machine/intr.h #include machine/sysarch.h @@ -146,3 +147,8 @@ ASSYM(MAXCOMLEN, MAXCOMLEN); ASSYM(MAXCPU, MAXCPU); ASSYM(NIRQ, NIRQ); ASSYM(PCPU_SIZE, sizeof(struct pcpu)); + +ASSYM(DCACHE_LINE_SIZE, offsetof(struct cpuinfo, dcache_line_size)); +ASSYM(DCACHE_LINE_MASK, offsetof(struct cpuinfo, dcache_line_mask)); +ASSYM(ICACHE_LINE_SIZE, offsetof(struct cpuinfo, icache_line_size)); +ASSYM(ICACHE_LINE_MASK, offsetof(struct cpuinfo, icache_line_mask)); Modified: stable/10/sys/arm/include/cpu-v6.h == --- stable/10/sys/arm/include/cpu-v6.h Sat May 23 22:48:54 2015 (r283335) +++ stable/10/sys/arm/include/cpu-v6.h Sat May 23 23:05:31 2015 (r283336) @@ -37,6 +37,9 @@ #define CPU_ASID_KERNEL 0 +vm_offset_t dcache_wb_pou_checked(vm_offset_t, vm_size_t); +vm_offset_t icache_inv_pou_checked(vm_offset_t, vm_size_t); + /* * Macros to generate CP15
svn commit: r283324 - stable/10/sys/dev/uart
Author: ian Date: Sat May 23 20:01:20 2015 New Revision: 283324 URL: https://svnweb.freebsd.org/changeset/base/283324 Log: MFC r279239: Enable 'receive timeout' interrupt allowing us to not loose 'rx buffer full' event. Modified: stable/10/sys/dev/uart/uart_dev_pl011.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_dev_pl011.c == --- stable/10/sys/dev/uart/uart_dev_pl011.c Sat May 23 19:57:44 2015 (r283323) +++ stable/10/sys/dev/uart/uart_dev_pl011.c Sat May 23 20:01:20 2015 (r283324) @@ -78,6 +78,7 @@ __FBSDID($FreeBSD$); #defineUART_RIS0x0f/* Raw interrupt status register */ #defineUART_RXREADY(1 4)/* RX buffer full */ #defineUART_TXEMPTY(1 5)/* TX buffer empty */ +#defineRIS_RTIM(1 6)/* Receive timeout */ #defineRIS_FE (1 7)/* Framing error interrupt status */ #defineRIS_PE (1 8)/* Parity error interrupt status */ #defineRIS_BE (1 9)/* Break error interrupt status */ @@ -278,11 +279,15 @@ static int uart_pl011_bus_attach(struct uart_softc *sc) { struct uart_bas *bas; + int reg; bas = sc-sc_bas; - /* Enable RX TX interrupts */ - __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); - /* Clear RX TX interrupts */ + + /* Enable interrupts */ + reg = (UART_RXREADY | RIS_RTIM | UART_TXEMPTY); + __uart_setreg(bas, UART_IMSC, reg); + + /* Clear interrupts */ __uart_setreg(bas, UART_ICR, IMSC_MASK_ALL); return (0); @@ -337,15 +342,16 @@ static int uart_pl011_bus_ipend(struct uart_softc *sc) { struct uart_bas *bas; - int ipend; uint32_t ints; + int ipend; + int reg; bas = sc-sc_bas; uart_lock(sc-sc_hwmtx); ints = __uart_getreg(bas, UART_MIS); ipend = 0; - if (ints UART_RXREADY) + if (ints (UART_RXREADY | RIS_RTIM)) ipend |= SER_INT_RXREADY; if (ints RIS_BE) ipend |= SER_INT_BREAK; @@ -355,7 +361,10 @@ uart_pl011_bus_ipend(struct uart_softc * if (sc-sc_txbusy) ipend |= SER_INT_TXIDLE; - __uart_setreg(bas, UART_IMSC, UART_RXREADY); + /* Disable TX interrupt */ + reg = __uart_getreg(bas, UART_IMSC); + reg = ~(UART_TXEMPTY); + __uart_setreg(bas, UART_IMSC, reg); } uart_unlock(sc-sc_hwmtx); @@ -391,14 +400,14 @@ static int uart_pl011_bus_receive(struct uart_softc *sc) { struct uart_bas *bas; - int rx; uint32_t ints, xc; + int rx; bas = sc-sc_bas; uart_lock(sc-sc_hwmtx); ints = __uart_getreg(bas, UART_MIS); - while (ints UART_RXREADY) { + while (ints (UART_RXREADY | RIS_RTIM)) { if (uart_rx_full(sc)) { sc-sc_rxbuf[sc-sc_rxput] = UART_STAT_OVERRUN; break; @@ -411,7 +420,7 @@ uart_pl011_bus_receive(struct uart_softc if (xc DR_PE) rx |= UART_STAT_PARERR; - __uart_setreg(bas, UART_ICR, UART_RXREADY); + __uart_setreg(bas, UART_ICR, (UART_RXREADY | RIS_RTIM)); uart_rx_put(sc, rx); ints = __uart_getreg(bas, UART_MIS); @@ -433,6 +442,7 @@ static int uart_pl011_bus_transmit(struct uart_softc *sc) { struct uart_bas *bas; + int reg; int i; bas = sc-sc_bas; @@ -443,7 +453,12 @@ uart_pl011_bus_transmit(struct uart_soft uart_barrier(bas); } sc-sc_txbusy = 1; - __uart_setreg(bas, UART_IMSC, (UART_RXREADY | UART_TXEMPTY)); + + /* Enable TX interrupt */ + reg = __uart_getreg(bas, UART_IMSC); + reg |= (UART_TXEMPTY); + __uart_setreg(bas, UART_IMSC, reg); + uart_unlock(sc-sc_hwmtx); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283326 - stable/10/sys/sys
Author: ian Date: Sat May 23 20:53:19 2015 New Revision: 283326 URL: https://svnweb.freebsd.org/changeset/base/283326 Log: MFC r268137, r268138: Define a __weak macro for declaring symbols weak. Add support for empty data sets. Data set begin and end pointers should resolve to NULL when not present. This is done by declaring the data set begin and end symbols as weak. Modified: stable/10/sys/sys/cdefs.h stable/10/sys/sys/linker_set.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/sys/cdefs.h == --- stable/10/sys/sys/cdefs.h Sat May 23 20:29:06 2015(r283325) +++ stable/10/sys/sys/cdefs.h Sat May 23 20:53:19 2015(r283326) @@ -213,7 +213,9 @@ #define__packed #define__aligned(x) #define__section(x) +#define__weak #else +#define__weak __attribute__((__weak__)) #if !__GNUC_PREREQ__(2, 5) !defined(__INTEL_COMPILER) #define__dead2 #define__pure2 Modified: stable/10/sys/sys/linker_set.h == --- stable/10/sys/sys/linker_set.h Sat May 23 20:29:06 2015 (r283325) +++ stable/10/sys/sys/linker_set.h Sat May 23 20:53:19 2015 (r283326) @@ -68,9 +68,9 @@ /* * Initialize before referring to a given linker set. */ -#define SET_DECLARE(set, ptype) \ - extern ptype *__CONCAT(__start_set_,set); \ - extern ptype *__CONCAT(__stop_set_,set) +#define SET_DECLARE(set, ptype)\ + extern ptype __weak *__CONCAT(__start_set_,set);\ + extern ptype __weak *__CONCAT(__stop_set_,set) #define SET_BEGIN(set) \ (__CONCAT(__start_set_,set)) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283329 - stable/10/sys/arm/ti
Author: ian Date: Sat May 23 21:12:51 2015 New Revision: 283329 URL: https://svnweb.freebsd.org/changeset/base/283329 Log: MFC r276021, r279766: Reduce the diff in the Ti aintc between head and arm_intrng Fix spurious interrupts on arm am335x (beaglebone), by doing the EOI in both the post-filter and post-thread callbacks. Modified: stable/10/sys/arm/ti/aintc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/aintc.c == --- stable/10/sys/arm/ti/aintc.cSat May 23 21:04:15 2015 (r283328) +++ stable/10/sys/arm/ti/aintc.cSat May 23 21:12:51 2015 (r283329) @@ -72,12 +72,20 @@ static struct resource_spec ti_aintc_spe static struct ti_aintc_softc *ti_aintc_sc = NULL; -#defineaintc_read_4(reg) \ -bus_space_read_4(ti_aintc_sc-aintc_bst, ti_aintc_sc-aintc_bsh, reg) -#defineaintc_write_4(reg, val) \ -bus_space_write_4(ti_aintc_sc-aintc_bst, ti_aintc_sc-aintc_bsh, reg, val) +#defineaintc_read_4(_sc, reg) \ +bus_space_read_4((_sc)-aintc_bst, (_sc)-aintc_bsh, (reg)) +#defineaintc_write_4(_sc, reg, val)\ +bus_space_write_4((_sc)-aintc_bst, (_sc)-aintc_bsh, (reg), (val)) +static void +aintc_post_filter(void *arg) +{ + + arm_irq_memory_barrier(0); + aintc_write_4(ti_aintc_sc, INTC_CONTROL, 1); /* EOI */ +} + static int ti_aintc_probe(device_t dev) { @@ -112,17 +120,19 @@ ti_aintc_attach(device_t dev) ti_aintc_sc = sc; - x = aintc_read_4(INTC_REVISION); + x = aintc_read_4(sc, INTC_REVISION); device_printf(dev, Revision %u.%u\n,(x 4) 0xF, x 0xF); /* SoftReset */ - aintc_write_4(INTC_SYSCONFIG, 2); + aintc_write_4(sc, INTC_SYSCONFIG, 2); /* Wait for reset to complete */ - while(!(aintc_read_4(INTC_SYSSTATUS) 1)); + while(!(aintc_read_4(sc, INTC_SYSSTATUS) 1)); /*Set Priority Threshold */ - aintc_write_4(INTC_THRESHOLD, 0xFF); + aintc_write_4(sc, INTC_THRESHOLD, 0xFF); + + arm_post_filter = aintc_post_filter; return (0); } @@ -146,22 +156,17 @@ DRIVER_MODULE(aintc, simplebus, ti_aintc int arm_get_next_irq(int last_irq) { + struct ti_aintc_softc *sc = ti_aintc_sc; uint32_t active_irq; - if (last_irq != -1) { - aintc_write_4(INTC_ISR_CLEAR(last_irq 5), - 1UL (last_irq 0x1F)); - aintc_write_4(INTC_CONTROL,1); - } - /* Get the next active interrupt */ - active_irq = aintc_read_4(INTC_SIR_IRQ); + active_irq = aintc_read_4(sc, INTC_SIR_IRQ); /* Check for spurious interrupt */ if ((active_irq 0xff80)) { - device_printf(ti_aintc_sc-sc_dev, - Spurious interrupt detected (0x%08x)\n, active_irq); - aintc_write_4(INTC_SIR_IRQ, 0); + device_printf(sc-sc_dev, + Spurious interrupt detected (0x%08x)\n, active_irq); + aintc_write_4(sc, INTC_SIR_IRQ, 0); return -1; } @@ -174,13 +179,17 @@ arm_get_next_irq(int last_irq) void arm_mask_irq(uintptr_t nb) { - aintc_write_4(INTC_MIR_SET(nb 5), (1UL (nb 0x1F))); + struct ti_aintc_softc *sc = ti_aintc_sc; + + aintc_write_4(sc, INTC_MIR_SET(nb 5), (1UL (nb 0x1F))); + aintc_write_4(sc, INTC_CONTROL, 1); /* EOI */ } void arm_unmask_irq(uintptr_t nb) { + struct ti_aintc_softc *sc = ti_aintc_sc; arm_irq_memory_barrier(nb); - aintc_write_4(INTC_MIR_CLEAR(nb 5), (1UL (nb 0x1F))); + aintc_write_4(sc, INTC_MIR_CLEAR(nb 5), (1UL (nb 0x1F))); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283322 - stable/10/sys/arm/samsung/exynos
Author: ian Date: Sat May 23 19:50:14 2015 New Revision: 283322 URL: https://svnweb.freebsd.org/changeset/base/283322 Log: MFC r266942, r266944: Do only receive chars if there are some data in the buffer. This fixes operation on newer Exynos boards. Rename exynos uart driver filenames. Added: stable/10/sys/arm/samsung/exynos/exynos_uart.c - copied unchanged from r266944, head/sys/arm/samsung/exynos/exynos_uart.c stable/10/sys/arm/samsung/exynos/exynos_uart.h - copied unchanged from r266944, head/sys/arm/samsung/exynos/exynos_uart.h Deleted: stable/10/sys/arm/samsung/exynos/uart.c stable/10/sys/arm/samsung/exynos/uart.h Modified: stable/10/sys/arm/samsung/exynos/files.exynos5 Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/arm/samsung/exynos/exynos_uart.c (from r266944, head/sys/arm/samsung/exynos/exynos_uart.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/arm/samsung/exynos/exynos_uart.c Sat May 23 19:50:14 2015(r283322, copy of r266944, head/sys/arm/samsung/exynos/exynos_uart.c) @@ -0,0 +1,382 @@ +/* + * Copyright (c) 2003 Marcel Moolenaar + * Copyright (c) 2007-2009 Andrew Turner + * Copyright (c) 2013 Ruslan Bukin b...@bsdpad.com + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include sys/param.h +#include sys/systm.h +#include sys/bus.h +#include sys/conf.h +#include sys/cons.h +#include sys/tty.h +#include sys/rman.h +#include machine/bus.h +#include machine/intr.h + +#include dev/uart/uart.h +#include dev/uart/uart_cpu.h +#include dev/uart/uart_bus.h + +#include arm/samsung/exynos/exynos_uart.h + +#include uart_if.h + +#defineDEF_CLK 1 + +static int sscomspeed(long, long); +static int s3c24x0_uart_param(struct uart_bas *, int, int, int, int); + +/* + * Low-level UART interface. + */ +static int s3c2410_probe(struct uart_bas *bas); +static void s3c2410_init(struct uart_bas *bas, int, int, int, int); +static void s3c2410_term(struct uart_bas *bas); +static void s3c2410_putc(struct uart_bas *bas, int); +static int s3c2410_rxready(struct uart_bas *bas); +static int s3c2410_getc(struct uart_bas *bas, struct mtx *mtx); + +extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; + +static int +sscomspeed(long speed, long frequency) +{ + int x; + + if (speed = 0 || frequency = 0) + return (-1); + x = (frequency / 16) / speed; + return (x-1); +} + +static int +s3c24x0_uart_param(struct uart_bas *bas, int baudrate, int databits, +int stopbits, int parity) +{ + int brd, ulcon; + + ulcon = 0; + + switch(databits) { + case 5: + ulcon |= ULCON_LENGTH_5; + break; + case 6: + ulcon |= ULCON_LENGTH_6; + break; + case 7: + ulcon |= ULCON_LENGTH_7; + break; + case 8: + ulcon |= ULCON_LENGTH_8; + break; + default: + return (EINVAL); + } + + switch (parity) { + case UART_PARITY_NONE: + ulcon |= ULCON_PARITY_NONE; + break; + case UART_PARITY_ODD: + ulcon |= ULCON_PARITY_ODD; + break; + case UART_PARITY_EVEN: + ulcon |= ULCON_PARITY_EVEN; + break; + case UART_PARITY_MARK: + case UART_PARITY_SPACE: + default: + return (EINVAL); + } + + if (stopbits == 2) + ulcon |= ULCON_STOP; + + uart_setreg(bas, SSCOM_ULCON, ulcon); + +
svn commit: r283323 - in stable/10/sys: arm/samsung/exynos dev/uart
Author: ian Date: Sat May 23 19:57:44 2015 New Revision: 283323 URL: https://svnweb.freebsd.org/changeset/base/283323 Log: MFC r277132: Rename Exynos UART driver functions. No functional change. Modified: stable/10/sys/arm/samsung/exynos/exynos_uart.c stable/10/sys/dev/uart/uart.h stable/10/sys/dev/uart/uart_bus_fdt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/samsung/exynos/exynos_uart.c == --- stable/10/sys/arm/samsung/exynos/exynos_uart.c Sat May 23 19:50:14 2015(r283322) +++ stable/10/sys/arm/samsung/exynos/exynos_uart.c Sat May 23 19:57:44 2015(r283323) @@ -50,17 +50,17 @@ __FBSDID($FreeBSD$); #defineDEF_CLK 1 static int sscomspeed(long, long); -static int s3c24x0_uart_param(struct uart_bas *, int, int, int, int); +static int exynos4210_uart_param(struct uart_bas *, int, int, int, int); /* * Low-level UART interface. */ -static int s3c2410_probe(struct uart_bas *bas); -static void s3c2410_init(struct uart_bas *bas, int, int, int, int); -static void s3c2410_term(struct uart_bas *bas); -static void s3c2410_putc(struct uart_bas *bas, int); -static int s3c2410_rxready(struct uart_bas *bas); -static int s3c2410_getc(struct uart_bas *bas, struct mtx *mtx); +static int exynos4210_probe(struct uart_bas *bas); +static void exynos4210_init(struct uart_bas *bas, int, int, int, int); +static void exynos4210_term(struct uart_bas *bas); +static void exynos4210_putc(struct uart_bas *bas, int); +static int exynos4210_rxready(struct uart_bas *bas); +static int exynos4210_getc(struct uart_bas *bas, struct mtx *mtx); extern SLIST_HEAD(uart_devinfo_list, uart_devinfo) uart_sysdevs; @@ -76,7 +76,7 @@ sscomspeed(long speed, long frequency) } static int -s3c24x0_uart_param(struct uart_bas *bas, int baudrate, int databits, +exynos4210_uart_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { int brd, ulcon; @@ -127,38 +127,38 @@ s3c24x0_uart_param(struct uart_bas *bas, return (0); } -struct uart_ops uart_s3c2410_ops = { - .probe = s3c2410_probe, - .init = s3c2410_init, - .term = s3c2410_term, - .putc = s3c2410_putc, - .rxready = s3c2410_rxready, - .getc = s3c2410_getc, +struct uart_ops uart_exynos4210_ops = { + .probe = exynos4210_probe, + .init = exynos4210_init, + .term = exynos4210_term, + .putc = exynos4210_putc, + .rxready = exynos4210_rxready, + .getc = exynos4210_getc, }; static int -s3c2410_probe(struct uart_bas *bas) +exynos4210_probe(struct uart_bas *bas) { return (0); } static void -s3c2410_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, +exynos4210_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { if (bas-rclk == 0) bas-rclk = DEF_CLK; - KASSERT(bas-rclk != 0, (s3c2410_init: Invalid rclk)); + KASSERT(bas-rclk != 0, (exynos4210_init: Invalid rclk)); uart_setreg(bas, SSCOM_UCON, 0); uart_setreg(bas, SSCOM_UFCON, UFCON_TXTRIGGER_8 | UFCON_RXTRIGGER_8 | UFCON_TXFIFO_RESET | UFCON_RXFIFO_RESET | UFCON_FIFO_ENABLE); - s3c24x0_uart_param(bas, baudrate, databits, stopbits, parity); + exynos4210_uart_param(bas, baudrate, databits, stopbits, parity); /* Enable UART. */ uart_setreg(bas, SSCOM_UCON, UCON_TXMODE_INT | UCON_RXMODE_INT | @@ -167,13 +167,13 @@ s3c2410_init(struct uart_bas *bas, int b } static void -s3c2410_term(struct uart_bas *bas) +exynos4210_term(struct uart_bas *bas) { /* XXX */ } static void -s3c2410_putc(struct uart_bas *bas, int c) +exynos4210_putc(struct uart_bas *bas, int c) { while ((bus_space_read_4(bas-bst, bas-bsh, SSCOM_UFSTAT) @@ -184,7 +184,7 @@ s3c2410_putc(struct uart_bas *bas, int c } static int -s3c2410_rxready(struct uart_bas *bas) +exynos4210_rxready(struct uart_bas *bas) { return ((uart_getreg(bas, SSCOM_UTRSTAT) UTRSTAT_RXREADY) == @@ -192,7 +192,7 @@ s3c2410_rxready(struct uart_bas *bas) } static int -s3c2410_getc(struct uart_bas *bas, struct mtx *mtx) +exynos4210_getc(struct uart_bas *bas, struct mtx *mtx) { int utrstat; @@ -205,34 +205,34 @@ s3c2410_getc(struct uart_bas *bas, struc return (bus_space_read_1(bas-bst, bas-bsh, SSCOM_URXH)); } -static int s3c2410_bus_probe(struct uart_softc *sc); -static int s3c2410_bus_attach(struct uart_softc *sc); -static int s3c2410_bus_flush(struct uart_softc *, int); -static int s3c2410_bus_getsig(struct uart_softc *); -static int s3c2410_bus_ioctl(struct uart_softc *, int, intptr_t); -static int s3c2410_bus_ipend(struct uart_softc *); -static int s3c2410_bus_param(struct uart_softc *, int, int, int, int); -static int s3c2410_bus_receive(struct uart_softc *);
svn commit: r283327 - in stable/10/sys: arm/at91 arm/freescale/vybrid arm/samsung/exynos arm/samsung/s3c2xx0 arm/xilinx dev/uart
Author: ian Date: Sat May 23 20:54:25 2015 New Revision: 283327 URL: https://svnweb.freebsd.org/changeset/base/283327 Log: MFC r279723, r279724: Define new linker set, UART_FDT_CLASS_AND_DEVICE, for registering full (class and device) FDT UART. Define second one, UART_FDT_CLASS, for UART class only. Move the uart_class definitions and fdt compat data into the individual uart implementations, and export them using the new linker-set mechanism. Added: stable/10/sys/dev/uart/uart_cpu_fdt.h - copied unchanged from r279723, head/sys/dev/uart/uart_cpu_fdt.h Modified: stable/10/sys/arm/at91/uart_bus_at91usart.c stable/10/sys/arm/at91/uart_cpu_at91usart.c stable/10/sys/arm/at91/uart_dev_at91usart.c stable/10/sys/arm/freescale/vybrid/vf_uart.c stable/10/sys/arm/samsung/exynos/exynos_uart.c stable/10/sys/arm/samsung/s3c2xx0/uart_bus_s3c2410.c stable/10/sys/arm/samsung/s3c2xx0/uart_cpu_s3c2410.c stable/10/sys/arm/xilinx/uart_dev_cdnc.c stable/10/sys/dev/uart/uart.h stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/uart/uart_cpu_fdt.c stable/10/sys/dev/uart/uart_dev_imx.c stable/10/sys/dev/uart/uart_dev_lpc.c stable/10/sys/dev/uart/uart_dev_msm.c stable/10/sys/dev/uart/uart_dev_ns8250.c stable/10/sys/dev/uart/uart_dev_pl011.c stable/10/sys/dev/uart/uart_dev_ti8250.c stable/10/sys/dev/uart/uart_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/at91/uart_bus_at91usart.c == --- stable/10/sys/arm/at91/uart_bus_at91usart.c Sat May 23 20:53:19 2015 (r283326) +++ stable/10/sys/arm/at91/uart_bus_at91usart.c Sat May 23 20:54:25 2015 (r283327) @@ -46,6 +46,7 @@ __FBSDID($FreeBSD$); #include uart_if.h +extern struct uart_class at91_usart_class; static int usart_at91_probe(device_t dev); static device_method_t usart_at91_methods[] = { Modified: stable/10/sys/arm/at91/uart_cpu_at91usart.c == --- stable/10/sys/arm/at91/uart_cpu_at91usart.c Sat May 23 20:53:19 2015 (r283326) +++ stable/10/sys/arm/at91/uart_cpu_at91usart.c Sat May 23 20:54:25 2015 (r283327) @@ -51,6 +51,7 @@ bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; extern struct bus_space at91_bs_tag; +extern struct uart_class at91_usart_class; int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) Modified: stable/10/sys/arm/at91/uart_dev_at91usart.c == --- stable/10/sys/arm/at91/uart_dev_at91usart.c Sat May 23 20:53:19 2015 (r283326) +++ stable/10/sys/arm/at91/uart_dev_at91usart.c Sat May 23 20:54:25 2015 (r283327) @@ -40,6 +40,9 @@ __FBSDID($FreeBSD$); #include dev/uart/uart.h #include dev/uart/uart_cpu.h +#ifdef FDT +#include dev/uart/uart_cpu_fdt.h +#endif #include dev/uart/uart_bus.h #include arm/at91/at91_usartreg.h #include arm/at91/at91_pdcreg.h @@ -866,3 +869,12 @@ struct uart_class at91_usart_class = { .uc_ops = at91_usart_ops, .uc_range = 8 }; + +#ifdef FDT +static struct ofw_compat_data compat_data[] = { + {atmel,at91rm9200-usart,(uintptr_t)at91_usart_class}, + {atmel,at91sam9260-usart,(uintptr_t)at91_usart_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); +#endif Modified: stable/10/sys/arm/freescale/vybrid/vf_uart.c == --- stable/10/sys/arm/freescale/vybrid/vf_uart.cSat May 23 20:53:19 2015(r283326) +++ stable/10/sys/arm/freescale/vybrid/vf_uart.cSat May 23 20:54:25 2015(r283327) @@ -44,6 +44,7 @@ __FBSDID($FreeBSD$); #include dev/uart/uart.h #include dev/uart/uart_cpu.h +#include dev/uart/uart_cpu_fdt.h #include dev/uart/uart_bus.h #include uart_if.h @@ -270,7 +271,7 @@ static kobj_method_t vf_uart_methods[] = { 0, 0 } }; -struct uart_class uart_vybrid_class = { +static struct uart_class uart_vybrid_class = { vybrid, vf_uart_methods, sizeof(struct vf_uart_softc), @@ -279,6 +280,12 @@ struct uart_class uart_vybrid_class = { .uc_rclk = 2400 /* TODO: get value from CCM */ }; +static struct ofw_compat_data compat_data[] = { + {fsl,mvf600-uart, (uintptr_t)uart_vybrid_class}, + {NULL, (uintptr_t)NULL}, +}; +UART_FDT_CLASS_AND_DEVICE(compat_data); + static int vf_uart_bus_attach(struct uart_softc *sc) { Modified: stable/10/sys/arm/samsung/exynos/exynos_uart.c == --- stable/10/sys/arm/samsung/exynos/exynos_uart.c Sat May 23 20:53:19 2015(r283326) +++ stable/10/sys/arm/samsung/exynos/exynos_uart.c Sat May 23 20:54:25 2015(r283327) @@ -41,6
svn commit: r283328 - head/sys/sys
Author: pluknet Date: Sat May 23 21:04:15 2015 New Revision: 283328 URL: https://svnweb.freebsd.org/changeset/base/283328 Log: Update P_TOTAL_STOP commentary. Modified: head/sys/sys/proc.h Modified: head/sys/sys/proc.h == --- head/sys/sys/proc.h Sat May 23 20:54:25 2015(r283327) +++ head/sys/sys/proc.h Sat May 23 21:04:15 2015(r283328) @@ -660,7 +660,7 @@ struct proc { #defineP_SINGLE_BOUNDARY 0x40 /* Threads should suspend at user boundary. */ #defineP_HWPMC 0x80 /* Process is using HWPMCs */ #defineP_JAILED0x100 /* Process is in jail. */ -#defineP_TOTAL_STOP0x200 /* Stopped in proc_stop_total. */ +#defineP_TOTAL_STOP0x200 /* Stopped in stop_all_proc. */ #defineP_INEXEC0x400 /* Process is in execve(). */ #defineP_STATCHILD 0x800 /* Child process stopped or exited. */ #defineP_INMEM 0x1000 /* Loaded into memory. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283338 - in stable/10/sys/arm/ti: am335x omap4
Author: ian Date: Sat May 23 23:08:54 2015 New Revision: 283338 URL: https://svnweb.freebsd.org/changeset/base/283338 Log: MFC r279816, r279826: Attach the prcm clock driver early, so it can set the mpcore timer frequency. Change the name of the dmtimer pps device from /dev/ppsN to /dev/dmtppsN. Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/ti/am335x/am335x_dmtimer.c == --- stable/10/sys/arm/ti/am335x/am335x_dmtimer.cSat May 23 23:08:16 2015(r283337) +++ stable/10/sys/arm/ti/am335x/am335x_dmtimer.cSat May 23 23:08:54 2015(r283338) @@ -200,7 +200,7 @@ am335x_dmtimer_et_write_4(struct am335x_ */ #ifdef PPS_SYNC -#definePPS_CDEV_NAME pps +#definePPS_CDEV_NAME dmtpps static void am335x_dmtimer_set_capture_mode(struct am335x_dmtimer_softc *sc, bool force_off) Modified: stable/10/sys/arm/ti/omap4/omap4_prcm_clks.c == --- stable/10/sys/arm/ti/omap4/omap4_prcm_clks.cSat May 23 23:08:16 2015(r283337) +++ stable/10/sys/arm/ti/omap4/omap4_prcm_clks.cSat May 23 23:08:54 2015(r283338) @@ -1423,5 +1423,6 @@ static driver_t omap4_prcm_driver = { static devclass_t omap4_prcm_devclass; -DRIVER_MODULE(omap4_prcm, simplebus, omap4_prcm_driver, omap4_prcm_devclass, 0, 0); +EARLY_DRIVER_MODULE(omap4_prcm, simplebus, omap4_prcm_driver, +omap4_prcm_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_EARLY); MODULE_VERSION(omap4_prcm, 1); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283337 - head/sys/arm/arm
Author: andrew Date: Sat May 23 23:08:16 2015 New Revision: 283337 URL: https://svnweb.freebsd.org/changeset/base/283337 Log: Fix a lock up where we enter swapper() with interrupts disabled. In smp_rendezvous_cpus we expect to wait for all cpus to enter smp_rendezvous_action. If we call this holding a proc lock swapper may attempt to also lock it, however as interrupts are disabled the cpu never handles the ipi. Because smp_rendezvous_action waits for all signaled cpus before contining it may get caught waiting for the cpu running swapper as the proc mutex will be unlocked after smp_rendezvous_cpus finishes. The fix is to enable interrupts in the configure stage as we should be doing. MFC after:1 week Modified: head/sys/arm/arm/autoconf.c Modified: head/sys/arm/arm/autoconf.c == --- head/sys/arm/arm/autoconf.c Sat May 23 23:05:31 2015(r283336) +++ head/sys/arm/arm/autoconf.c Sat May 23 23:08:16 2015(r283337) @@ -94,6 +94,7 @@ static void configure_final(void *dummy) { + enable_interrupts(PSR_I | PSR_F); cninit_finish(); cold = 0; } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283339 - in stable/10/sys: arm/arm arm/include conf
Author: ian Date: Sat May 23 23:27:00 2015 New Revision: 283339 URL: https://svnweb.freebsd.org/changeset/base/283339 Log: MFC r280278, r280402: Allow to override default kernel virtual address assignment on ARM. Do not save/restore the TLS pointer on context switch for armv6. Modified: stable/10/sys/arm/arm/swtch.S stable/10/sys/arm/arm/sys_machdep.c stable/10/sys/arm/arm/vm_machdep.c stable/10/sys/arm/include/vmparam.h stable/10/sys/conf/options.arm Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/swtch.S == --- stable/10/sys/arm/arm/swtch.S Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/arm/swtch.S Sat May 23 23:27:00 2015 (r283339) @@ -255,7 +255,7 @@ ENTRY(cpu_switch) mov r4, r0 /* Save the old thread. */ #ifdef ARM_TP_ADDRESS - /* Store the old tp */ + /* Store the old tp; userland can change it on armv4. */ ldr r3, =ARM_TP_ADDRESS ldr r9, [r3] str r9, [r0, #(TD_MD + MD_TP)] @@ -272,11 +272,10 @@ ENTRY(cpu_switch) ldr r9, [r1, #(TD_MD + MD_RAS_END)] str r9, [r3, #8] #else - /* Store the old tp */ - mrc p15, 0, r9, c13, c0, 3 - str r9, [r0, #(TD_MD + MD_TP)] - - /* Set the new tp */ + /* +* Set new tp. No need to store the old one first, userland can't +* change it directly on armv6. +*/ ldr r9, [r1, #(TD_MD + MD_TP)] mcr p15, 0, r9, c13, c0, 3 #endif Modified: stable/10/sys/arm/arm/sys_machdep.c == --- stable/10/sys/arm/arm/sys_machdep.c Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/arm/sys_machdep.c Sat May 23 23:27:00 2015 (r283339) @@ -84,13 +84,11 @@ static int arm32_set_tp(struct thread *td, void *args) { - if (td != curthread) - td-td_md.md_tp = (register_t)args; - else + td-td_md.md_tp = (register_t)args; #ifndef ARM_TP_ADDRESS - set_tls(args); + set_tls(args); #else - *(register_t *)ARM_TP_ADDRESS = (register_t)args; + *(register_t *)ARM_TP_ADDRESS = (register_t)args; #endif return (0); } @@ -99,13 +97,10 @@ static int arm32_get_tp(struct thread *td, void *args) { - if (td != curthread) - td-td_retval[0] = td-td_md.md_tp; - else #ifndef ARM_TP_ADDRESS - td-td_retval[0] = (register_t)get_tls(); + td-td_retval[0] = td-td_md.md_tp; #else - td-td_retval[0] = *(register_t *)ARM_TP_ADDRESS; + td-td_retval[0] = *(register_t *)ARM_TP_ADDRESS; #endif return (0); } Modified: stable/10/sys/arm/arm/vm_machdep.c == --- stable/10/sys/arm/arm/vm_machdep.c Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/arm/vm_machdep.c Sat May 23 23:27:00 2015 (r283339) @@ -182,7 +182,7 @@ cpu_fork(register struct thread *td1, re #ifdef ARM_TP_ADDRESS td2-td_md.md_tp = *(register_t *)ARM_TP_ADDRESS; #else - td2-td_md.md_tp = (register_t) get_tls(); + td2-td_md.md_tp = td1-td_md.md_tp; #endif } @@ -411,7 +411,7 @@ cpu_set_user_tls(struct thread *td, void #ifdef ARM_TP_ADDRESS *(register_t *)ARM_TP_ADDRESS = (register_t)tls_base; #else - set_tls((void *)tls_base); + set_tls(tls_base); #endif critical_exit(); } Modified: stable/10/sys/arm/include/vmparam.h == --- stable/10/sys/arm/include/vmparam.h Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/arm/include/vmparam.h Sat May 23 23:27:00 2015 (r283339) @@ -68,7 +68,9 @@ * The line between user space and kernel space * Mappings = KERNEL_BASE are constant across all processes */ +#ifndef KERNBASE #defineKERNBASE0xc000 +#endif /* * max number of non-contig chunks of physical RAM you can have Modified: stable/10/sys/conf/options.arm == --- stable/10/sys/conf/options.arm Sat May 23 23:08:54 2015 (r283338) +++ stable/10/sys/conf/options.arm Sat May 23 23:27:00 2015 (r283339) @@ -28,6 +28,7 @@ IPI_IRQ_START opt_smp.h IPI_IRQ_ENDopt_smp.h FREEBSD_BOOT_LOADERopt_global.h IXP4XX_FLASH_SIZE opt_global.h +KERNBASE opt_global.h KERNPHYSADDR opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h ___ svn-src-all@freebsd.org mailing list
svn commit: r283340 - stable/10/sys/arm/mv/armadaxp
Author: ian Date: Sat May 23 23:35:19 2015 New Revision: 283340 URL: https://svnweb.freebsd.org/changeset/base/283340 Log: MFC r262409, r267129, r267130, r280709: Move the declaration for mpentry() into a header file Fix broken SMP startup on Armada XP after r265694 Avoid using hard-coded SoC's register address in mptramp code for Armada XP Use pmap_mapdev()/unmapdev() to temporarily map on-chip sram while copying the startup trampoline code. Modified: stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c stable/10/sys/arm/mv/armadaxp/mptramp.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c == --- stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c Sat May 23 23:27:00 2015 (r283339) +++ stable/10/sys/arm/mv/armadaxp/armadaxp_mp.c Sat May 23 23:35:19 2015 (r283340) @@ -37,6 +37,8 @@ #include vm/vm_kern.h #include vm/vm_extern.h +#include dev/fdt/fdt_common.h + #include machine/smp.h #include machine/fdt.h #include machine/armreg.h @@ -97,14 +99,14 @@ platform_mp_init_secondary(void) } void mptramp(void); - - +void mptramp_end(void); +extern vm_offset_t mptramp_pmu_boot; void platform_mp_start_ap(void) { uint32_t reg, *src, *dst, cpu_num, div_val, cputype; - vm_offset_t smp_boot; + vm_offset_t pmu_boot_off; /* * Initialization procedure depends on core revision, * in this step CHIP ID is checked to choose proper procedure @@ -112,16 +114,18 @@ platform_mp_start_ap(void) cputype = cpufunc_id(); cputype = CPU_ID_CPU_MASK; - smp_boot = kva_alloc(PAGE_SIZE); - pmap_kenter_nocache(smp_boot, 0x); - dst = (uint32_t *) smp_boot; - - for (src = (uint32_t *)mptramp; src (uint32_t *)mpentry; + /* +* Set the PA of CPU0 Boot Address Redirect register used in +* mptramp according to the actual SoC registers' base address. +*/ + pmu_boot_off = (CPU_PMU(0) - MV_BASE) + CPU_PMU_BOOT; + mptramp_pmu_boot = fdt_immr_pa + pmu_boot_off; + dst = pmap_mapdev(0x, PAGE_SIZE); + for (src = (uint32_t *)mptramp; src (uint32_t *)mptramp_end; src++, dst++) { *dst = *src; } - kva_free(smp_boot, PAGE_SIZE); - + pmap_unmapdev((vm_offset_t)dst, PAGE_SIZE); if (cputype == CPU_ID_MV88SV584X_V7) { /* Core rev A0 */ div_val = read_cpu_clkdiv(CPU_DIVCLK_CTRL2_RATIO_FULL1); Modified: stable/10/sys/arm/mv/armadaxp/mptramp.S == --- stable/10/sys/arm/mv/armadaxp/mptramp.S Sat May 23 23:27:00 2015 (r283339) +++ stable/10/sys/arm/mv/armadaxp/mptramp.S Sat May 23 23:35:19 2015 (r283340) @@ -29,6 +29,8 @@ __FBSDID($FreeBSD$); +.global _C_LABEL(mptramp_pmu_boot) + ASENTRY_NP(mptramp) mov r0, #0 mcr p15, 0, r0, c7, c7, 0 @@ -44,13 +46,16 @@ ASENTRY_NP(mptramp) /* Read boot address for CPU */ mov r1, #0x100 mul r2, r0, r1 - ldr r1, Lpmureg + ldr r1, mptramp_pmu_boot add r0, r2, r1 ldr r1, [r0], #0x00 mov pc, r1 -Lpmureg: -.word 0xd0022124 +_C_LABEL(mptramp_pmu_boot): + .word 0x0 + END(mptramp) + .global _C_LABEL(mptramp_end) +_C_LABEL(mptramp_end): ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283341 - in stable/10/sys: dev/usb/serial kern sys
Author: ian Date: Sun May 24 00:53:43 2015 New Revision: 283341 URL: https://svnweb.freebsd.org/changeset/base/283341 Log: MFC r279728, r279729, r279756, r279773, r282424, r281367: Add mutex support to the pps_ioctl() API in the kernel. Add PPS support to USB serial drivers. Use correct mode variable for PPS support. Switch polarity of USB serial PPS events. The ftdi get latency and get bitmode device commands are read operations, not writes. Implement a mechanism for making changes in the kernel-driver PPS interface without breaking ABI or API compatibility with existing drivers. Bump version number to indicate the new PPS ABI version changes in the pps_state structure. Modified: stable/10/sys/dev/usb/serial/uftdi.c stable/10/sys/dev/usb/serial/usb_serial.c stable/10/sys/dev/usb/serial/usb_serial.h stable/10/sys/kern/kern_tc.c stable/10/sys/sys/param.h stable/10/sys/sys/timepps.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/serial/uftdi.c == --- stable/10/sys/dev/usb/serial/uftdi.cSat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/dev/usb/serial/uftdi.cSun May 24 00:53:43 2015 (r283341) @@ -1703,7 +1703,7 @@ uftdi_get_bitmode(struct ucom_softc *uco struct uftdi_softc *sc = ucom-sc_parent; usb_device_request_t req; - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = FTDI_SIO_GET_BITMODE; USETW(req.wIndex, sc-sc_ucom.sc_portno); @@ -1740,7 +1740,7 @@ uftdi_get_latency(struct ucom_softc *uco usb_error_t err; uint8_t buf; - req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bmRequestType = UT_READ_VENDOR_DEVICE; req.bRequest = FTDI_SIO_GET_LATENCY; USETW(req.wIndex, sc-sc_ucom.sc_portno); Modified: stable/10/sys/dev/usb/serial/usb_serial.c == --- stable/10/sys/dev/usb/serial/usb_serial.c Sat May 23 23:35:19 2015 (r283340) +++ stable/10/sys/dev/usb/serial/usb_serial.c Sun May 24 00:53:43 2015 (r283341) @@ -96,6 +96,11 @@ __FBSDID($FreeBSD$); static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, USB ucom); +static int ucom_pps_mode; + +SYSCTL_INT(_hw_usb_ucom, OID_AUTO, pps_mode, CTLFLAG_RWTUN, +ucom_pps_mode, 0, pulse capturing mode - 0/1/2 - disabled/CTS/DCD); + #ifdef USB_DEBUG static int ucom_debug = 0; @@ -412,6 +417,11 @@ ucom_attach_tty(struct ucom_super_softc sc-sc_tty = tp; + sc-sc_pps.ppscap = PPS_CAPTUREBOTH; + sc-sc_pps.driver_abi = PPS_ABI_VERSION; + sc-sc_pps.driver_mtx = sc-sc_mtx; + pps_init_abi(sc-sc_pps); + DPRINTF(ttycreate: %s\n, buf); /* Check if this device should be a console */ @@ -861,6 +871,8 @@ ucom_ioctl(struct tty *tp, u_long cmd, c } else { error = ENOIOCTL; } + if (error == ENOIOCTL) + error = pps_ioctl(cmd, data, sc-sc_pps); break; } return (error); @@ -1064,7 +1076,7 @@ ucom_cfg_status_change(struct usb_proc_m struct tty *tp; uint8_t new_msr; uint8_t new_lsr; - uint8_t onoff; + uint8_t msr_delta; uint8_t lsr_delta; tp = sc-sc_tty; @@ -1088,15 +1100,42 @@ ucom_cfg_status_change(struct usb_proc_m /* TTY device closed */ return; } - onoff = ((sc-sc_msr ^ new_msr) SER_DCD); + msr_delta = (sc-sc_msr ^ new_msr); lsr_delta = (sc-sc_lsr ^ new_lsr); sc-sc_msr = new_msr; sc-sc_lsr = new_lsr; - if (onoff) { + /* +* Time pulse counting support. Note that both CTS and DCD are +* active-low signals. The status bit is high to indicate that +* the signal on the line is low, which corresponds to a PPS +* clear event. +*/ + switch(ucom_pps_mode) { + case 1: + if ((sc-sc_pps.ppsparam.mode PPS_CAPTUREBOTH) + (msr_delta SER_CTS)) { + pps_capture(sc-sc_pps); + pps_event(sc-sc_pps, (sc-sc_msr SER_CTS) ? + PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); + } + break; + case 2: + if ((sc-sc_pps.ppsparam.mode PPS_CAPTUREBOTH) + (msr_delta SER_DCD)) { + pps_capture(sc-sc_pps); + pps_event(sc-sc_pps, (sc-sc_msr SER_DCD) ? + PPS_CAPTURECLEAR : PPS_CAPTUREASSERT); + } + break; + default: + break; + } + + if (msr_delta SER_DCD) { - onoff =
svn commit: r283342 - stable/10/share/man/man4
Author: ian Date: Sun May 24 01:09:51 2015 New Revision: 283342 URL: https://svnweb.freebsd.org/changeset/base/283342 Log: MFC r280221: Update ucom(4) with information about the new PPS capture abilities. Modified: stable/10/share/man/man4/ucom.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ucom.4 == --- stable/10/share/man/man4/ucom.4 Sun May 24 00:53:43 2015 (r283341) +++ stable/10/share/man/man4/ucom.4 Sun May 24 01:09:51 2015 (r283342) @@ -29,7 +29,7 @@ .\ .\ $FreeBSD$ .\ -.Dd March 1, 2008 +.Dd March 11, 2015 .Dt UCOM 4 .Os .Sh NAME @@ -63,11 +63,34 @@ This means that normal programs such as or .Xr ppp 8 can be used to access the device. +.Sh Pulse Per Second (PPS) Timing Interface +The +.Nm +driver can capture PPS timing information as defined in RFC 2783. +The API, accessed via +.Xr ioctl 8 , +is available on the tty device. +To use the PPS capture feature with +.Xr ntpd 8 , +symlink the tty device to +.Va /dev/pps0. .Pp The -.Va portno -locater can be used to decide which port to use for devices that have -multiple external ports. +.Va hw.usb.ucom.pps_mode +sysctl configures the PPS capture mode. +It can be set in +.Xr loader.conf 5 +or +.Xr sysctl.conf 5 . +The following capture modes are available: +.Bl -tag -compact -offset -width +.It 0 +Capture disabled (default). +.It 1 +Capture pulses on the CTS line. +.It 2 +Capture pulses on the DCD line. +.El .Sh FILES .Bl -tag -width .Pa /dev/cuaU? .It Pa /dev/cuaU? ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283343 - stable/10/sys/dev/netmap
Author: pkelsey Date: Sun May 24 01:48:33 2015 New Revision: 283343 URL: https://svnweb.freebsd.org/changeset/base/283343 Log: MFC r282978: When a netmap process terminates without the full set of buffers it was granted via rings and ni_bufs_list_head represented in those rings and lists (e.g., via SIGKILL), those buffers are no longer available for subsequent users for the lifetime of the system. To mitigate this resource leak, reset the allocator state when the last ref to that allocator is released. Note that this only recovers leaked resources for an allocator when there are no longer any users of that allocator, so there remain circumstances in which leaked allocator resources may not ever be recovered - consider a set of multiple netmap processes that are all using the same allocator (say, the global allocator) where members of that set may be killed and restarted over time but at any given point there is one member of that set running. Modified: stable/10/sys/dev/netmap/netmap_mem2.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/netmap/netmap_mem2.c == --- stable/10/sys/dev/netmap/netmap_mem2.c Sun May 24 01:09:51 2015 (r283342) +++ stable/10/sys/dev/netmap/netmap_mem2.c Sun May 24 01:48:33 2015 (r283343) @@ -130,9 +130,9 @@ struct netmap_mem_d { /* the three allocators */ struct netmap_obj_pool pools[NETMAP_POOLS_NR]; - netmap_mem_config_t config; - netmap_mem_finalize_t finalize; - netmap_mem_deref_tderef; + netmap_mem_config_t config; /* called with NMA_LOCK held */ + netmap_mem_finalize_t finalize; /* called with NMA_LOCK held */ + netmap_mem_deref_tderef;/* called with NMA_LOCK held */ nm_memid_t nm_id; /* allocator identifier */ int nm_grp; /* iommu groupd id */ @@ -751,6 +751,12 @@ netmap_reset_obj_allocator(struct netmap u_int i; size_t sz = p-_clustsize; + /* +* Free each cluster allocated in +* netmap_finalize_obj_allocator(). The cluster start +* addresses are stored at multiples of p-_clusterentries +* in the lut. +*/ for (i = 0; i p-objtotal; i += p-_clustentries) { if (p-lut[i].vaddr) contigfree(p-lut[i].vaddr, sz, M_NETMAP); @@ -929,6 +935,7 @@ netmap_finalize_obj_allocator(struct net if (i % p-_clustentries == 0 p-lut[i].vaddr) contigfree(p-lut[i].vaddr, n, M_NETMAP); + p-lut[i].vaddr = NULL; } out: p-objtotal = i; @@ -936,6 +943,17 @@ netmap_finalize_obj_allocator(struct net p-numclusters = (i + p-_clustentries - 1) / p-_clustentries; break; } + /* +* Set bitmap and lut state for all buffers in the current +* cluster. +* +* [i, lim) is the set of buffer indexes that cover the +* current cluster. +* +* 'clust' is really the address of the current buffer in +* the current cluster as we index through it with a stride +* of p-_objsize. +*/ for (; i lim; i++, clust += p-_objsize) { p-bitmap[ (i5) ] |= ( 1 (i 31) ); p-lut[i].vaddr = clust; @@ -1092,10 +1110,8 @@ static int netmap_mem_private_finalize(struct netmap_mem_d *nmd) { int err; - NMA_LOCK(nmd); nmd-refcount++; err = netmap_mem_finalize_all(nmd); - NMA_UNLOCK(nmd); return err; } @@ -1103,10 +1119,8 @@ netmap_mem_private_finalize(struct netma static void netmap_mem_private_deref(struct netmap_mem_d *nmd) { - NMA_LOCK(nmd); if (--nmd-refcount = 0) netmap_mem_reset_all(nmd); - NMA_UNLOCK(nmd); } @@ -1242,10 +1256,7 @@ static int netmap_mem_global_finalize(struct netmap_mem_d *nmd) { int err; - - NMA_LOCK(nmd); - - + /* update configuration if changed */ if (netmap_mem_global_config(nmd)) goto out; @@ -1268,8 +1279,6 @@ out: nmd-refcount--; err = nmd-lasterr; - NMA_UNLOCK(nmd); - return err; } @@ -1518,7 +1527,6 @@ netmap_mem_if_delete(struct netmap_adapt static void netmap_mem_global_deref(struct netmap_mem_d *nmd) { - NMA_LOCK(nmd); nmd-refcount--; if (!nmd-refcount) @@ -1526,7 +1534,6 @@ netmap_mem_global_deref(struct netmap_me
svn commit: r283344 - stable/10/share/man/man3
Author: pkelsey Date: Sun May 24 01:52:22 2015 New Revision: 283344 URL: https://svnweb.freebsd.org/changeset/base/283344 Log: MFC r283093: Added description of POSIX-specified behavior when invoked on a key from within that key's destructor. Modified: stable/10/share/man/man3/pthread_getspecific.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man3/pthread_getspecific.3 == --- stable/10/share/man/man3/pthread_getspecific.3 Sun May 24 01:48:33 2015(r283343) +++ stable/10/share/man/man3/pthread_getspecific.3 Sun May 24 01:52:22 2015(r283344) @@ -64,6 +64,11 @@ is undefined. The .Fn pthread_getspecific function may be called from a thread-specific data destructor function. +A call to +.Fn pthread_getspecific +for the thread-specific data key being destroyed returns the value NULL, +unless the value is changed (after the destructor starts) by a call to +.Fn pthread_setspecific . .Sh RETURN VALUES The .Fn pthread_getspecific ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283345 - stable/10/release
Author: gjb Date: Sun May 24 02:15:18 2015 New Revision: 283345 URL: https://svnweb.freebsd.org/changeset/base/283345 Log: MFC r283252: Include the TARGET in the EC2 AMI name. Without this, AWS rejects subsequent image uploads of a different architecture because the name conflicts. Sponsored by: The FreeBSD Foundation Modified: stable/10/release/Makefile.ec2 Directory Properties: stable/10/ (props changed) Modified: stable/10/release/Makefile.ec2 == --- stable/10/release/Makefile.ec2 Sun May 24 01:52:22 2015 (r283344) +++ stable/10/release/Makefile.ec2 Sun May 24 02:15:18 2015 (r283345) @@ -53,7 +53,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} .endif /usr/local/bin/bsdec2-image-upload ${PUBLISH} \ ${.OBJDIR}/ec2.raw \ - ${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX} \ - ${TYPE} ${REVISION}-${BRANCH} \ + ${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} \ + ${TYPE} ${REVISION}-${BRANCH}-${TARGET} \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} @touch ${.TARGET} ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283311 - stable/10/contrib/netbsd-tests/bin/expr
Author: rodrigc Date: Sat May 23 09:16:35 2015 New Revision: 283311 URL: https://svnweb.freebsd.org/changeset/base/283311 Log: Merge: r277829 Revert r277357 as expr has been enhanced to better detect overflow conditions, and now the tests pass PR: 196867 X-MFC with: r277798 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: stable/10/contrib/netbsd-tests/bin/expr/t_expr.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/netbsd-tests/bin/expr/t_expr.sh == --- stable/10/contrib/netbsd-tests/bin/expr/t_expr.sh Sat May 23 09:14:29 2015(r283310) +++ stable/10/contrib/netbsd-tests/bin/expr/t_expr.sh Sat May 23 09:16:35 2015(r283311) @@ -54,9 +54,6 @@ overflow_head() { atf_set descr Test overflow cases } overflow_body() { - # Begin FreeBSD - atf_expect_fail FreeBSD's expr does not check overflow to the same degree NetBSD's expr does; see bug 196867 for more details - # End FreeBSD test_expr '4611686018427387904 + 4611686018427387903' \ '9223372036854775807' test_expr '4611686018427387904 + 4611686018427387904' \ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283312 - stable/10/bin/pkill/tests
Author: rodrigc Date: Sat May 23 09:48:59 2015 New Revision: 283312 URL: https://svnweb.freebsd.org/changeset/base/283312 Log: Merge: 278618 278633 278636 278653 278742 278776 279121 Multiple fixes for pgrep and pkill tests. PR: 19109 Modified: stable/10/bin/pkill/tests/pgrep-j_test.sh stable/10/bin/pkill/tests/pkill-j_test.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/pkill/tests/pgrep-j_test.sh == --- stable/10/bin/pkill/tests/pgrep-j_test.sh Sat May 23 09:16:35 2015 (r283311) +++ stable/10/bin/pkill/tests/pgrep-j_test.sh Sat May 23 09:48:59 2015 (r283312) @@ -4,94 +4,88 @@ jail_name_to_jid() { local check_name=$1 - ( - line=$(jls -n 2 /dev/null | grep name=$check_name ) - for nv in $line; do - local name=${nv%=*} - if [ ${name} = jid ]; then - eval $nv - echo $jid - break - fi - done - ) + jls -j $check_name -s | tr ' ' '\n' | grep jid= | sed -e 's/.*=//g' } base=pgrep_j_test +if [ `id -u` -ne 0 ]; then + echo 1..0 # skip Test needs uid 0. + exit 0 +fi + echo 1..3 +sleep=$(pwd)/sleep.txt +ln -sf /bin/sleep $sleep + name=pgrep -j jid -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_1.pid $sleep 5 +sleep_amount=5 +jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ +command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount - jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_1_2.pid $sleep 5 +jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ +command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount +for i in `seq 1 10`; do jid1=$(jail_name_to_jid ${base}_1_1) jid2=$(jail_name_to_jid ${base}_1_2) jid=${jid1},${jid2} - pid1=$(pgrep -f -x -j $jid $sleep 5 | sort) - pid2=$(printf %s\n%s $(cat ${PWD}/${base}_1_1.pid) \ - $(cat ${PWD}/${base}_1_2.pid) | sort) - if [ $pid1 = $pid2 ]; then - echo ok 1 - $name - else - echo not ok 1 - $name - fi - [ -f ${PWD}/${base}_1_1.pid ] kill $(cat ${PWD}/${base}_1_1.pid) - [ -f ${PWD}/${base}_1_2.pid ] kill $(cat ${PWD}/${base}_1_2.pid) - rm -f $sleep + case $jid in + [0-9]+,[0-9]+) + break + ;; + esac + sleep 0.1 +done +sleep 0.5 + +pid1=$(pgrep -f -x -j $jid $sleep $sleep_amount | sort) +pid2=$(printf %s\n%s $(cat ${PWD}/${base}_1_1.pid) \ +$(cat ${PWD}/${base}_1_2.pid) | sort) +if [ $pid1 = $pid2 ]; then + echo ok 1 - $name else - echo ok 1 - $name # skip Test needs uid 0. + echo not ok 1 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)' fi +[ -f ${PWD}/${base}_1_1.pid ] kill $(cat ${PWD}/${base}_1_1.pid) +[ -f ${PWD}/${base}_1_2.pid ] kill $(cat ${PWD}/${base}_1_2.pid) +wait name=pgrep -j any -if [ `id -u` -eq 0 ]; then - sleep=$(pwd)/sleep.txt - ln -sf /bin/sleep $sleep - jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_1.pid $sleep 5 - - jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ - command=daemon -p ${PWD}/${base}_2_2.pid $sleep 5 - - sleep 2 - pid1=$(pgrep -f -x -j any $sleep 5 | sort) - pid2=$(printf %s\n%s $(cat ${PWD}/${base}_2_1.pid) \ - $(cat ${PWD}/${base}_2_2.pid) | sort) - if [ $pid1 = $pid2 ]; then - echo ok 2 - $name - else - echo not ok 2 - $name - fi - [ -f ${PWD}/${base}_2_1.pid ] kill $(cat ${PWD}/${base}_2_1.pid) - [ -f ${PWD}/${base}_2_2.pid ] kill $(cat ${PWD}/${base}_2_2.pid) - rm -f $sleep +sleep_amount=6 +jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ +command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount + +jail -c path=/ name=${base}_2_2 ip4.addr=127.0.0.1 \ +command=daemon -p ${PWD}/${base}_2_2.pid $sleep $sleep_amount + +sleep 2 +pid1=$(pgrep -f -x -j any $sleep $sleep_amount | sort) +pid2=$(printf %s\n%s $(cat ${PWD}/${base}_2_1.pid) \ +$(cat ${PWD}/${base}_2_2.pid) | sort) +if [ $pid1 = $pid2 ]; then + echo ok 2 - $name else - echo ok 2 - $name # skip Test needs uid 0. + echo not ok 2 - $name # pgrep output: '$(echo $pid1)', pidfile output: '$(echo $pid2)' fi +[ -f ${PWD}/${base}_2_1.pid ] kill $(cat ${PWD}/${base}_2_1.pid) +[ -f ${PWD}/${base}_2_2.pid ] kill $(cat ${PWD}/${base}_2_2.pid) +wait name=pgrep -j none -if [ `id -u` -eq 0 ]; then -
svn commit: r283313 - head/sys/net80211
Author: ae Date: Sat May 23 09:49:40 2015 New Revision: 283313 URL: https://svnweb.freebsd.org/changeset/base/283313 Log: Properly update TX statistics for wlan(4). ieee80211_pwrsave() can fail due to queue overflow, check its return code and increment oerrors counter when it fails. Also handle more error cases and update oerrors counter when we don't send mbuf due to some errors. Return ENETDOWN when parent interface isn't ready. Update obytes and omcasts counters in corresponding places. PR: 184626 Differential Revision:https://reviews.freebsd.org/D2621 Reviewed by: adrian MFC after:1 week Modified: head/sys/net80211/ieee80211_output.c head/sys/net80211/ieee80211_wds.c Modified: head/sys/net80211/ieee80211_output.c == --- head/sys/net80211/ieee80211_output.cSat May 23 09:48:59 2015 (r283312) +++ head/sys/net80211/ieee80211_output.cSat May 23 09:49:40 2015 (r283313) @@ -132,7 +132,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 { struct ieee80211com *ic = vap-iv_ic; struct ifnet *ifp = vap-iv_ifp; - int error; + int error, len, mcast; if ((ni-ni_flags IEEE80211_NODE_PWR_MGT) (m-m_flags M_PWR_SAV) == 0) { @@ -142,7 +142,8 @@ ieee80211_vap_pkt_send_dest(struct ieee8 * the frame back when the time is right. * XXX lose WDS vap linkage? */ - (void) ieee80211_pwrsave(ni, m); + if (ieee80211_pwrsave(ni, m) != 0) + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_free_node(ni); /* @@ -171,6 +172,8 @@ ieee80211_vap_pkt_send_dest(struct ieee8 * interface it (might have been) received on. */ m-m_pkthdr.rcvif = (void *)ni; + mcast = (m-m_flags (M_MCAST | M_BCAST)) ? 1: 0; + len = m-m_pkthdr.len; BPF_MTAP(ifp, m); /* 802.3 tx */ @@ -236,7 +239,7 @@ ieee80211_vap_pkt_send_dest(struct ieee8 /* NB: stat+msg handled in ieee80211_encap */ IEEE80211_TX_UNLOCK(ic); ieee80211_free_node(ni); - /* XXX better status? */ + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return (ENOBUFS); } } @@ -250,8 +253,11 @@ ieee80211_vap_pkt_send_dest(struct ieee8 if (error != 0) { /* NB: IFQ_HANDOFF reclaims mbuf */ ieee80211_free_node(ni); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } else { if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OMCASTS, mcast); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); } ic-ic_lastdata = ticks; @@ -315,6 +321,7 @@ ieee80211_start_pkt(struct ieee80211vap eh-ether_dhost, mcast, %s, on DWDS); vap-iv_stats.is_dwds_mcast++; m_freem(m); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); /* XXX better status? */ return (ENOBUFS); } @@ -397,7 +404,8 @@ ieee80211_start_pkt(struct ieee80211vap * for transmit. */ ic-ic_lastdata = ticks; - (void) ieee80211_pwrsave(ni, m); + if (ieee80211_pwrsave(ni, m) != 0) + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); ieee80211_free_node(ni); ieee80211_new_state(vap, IEEE80211_S_RUN, 0); return (0); @@ -429,9 +437,9 @@ ieee80211_vap_transmit(struct ifnet *ifp IEEE80211_DPRINTF(vap, IEEE80211_MSG_OUTPUT, %s: ignore queue, parent %s not up+running\n, __func__, parent-if_xname); - /* XXX stat */ m_freem(m); - return (EINVAL); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ENETDOWN); } /* @@ -453,7 +461,8 @@ ieee80211_vap_transmit(struct ifnet *ifp IEEE80211_UNLOCK(ic); ifp-if_drv_flags |= IFF_DRV_OACTIVE; m_freem(m); - return (EINVAL); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); + return (ENETDOWN); } IEEE80211_UNLOCK(ic); } Modified: head/sys/net80211/ieee80211_wds.c == --- head/sys/net80211/ieee80211_wds.c Sat May 23 09:48:59 2015 (r283312) +++ head/sys/net80211/ieee80211_wds.c Sat May 23 09:49:40 2015 (r283313) @@ -301,8 +301,12 @@
svn commit: r283309 - head/sys/contrib/dev/ath/ath_hal/ar9300
Author: adrian Date: Sat May 23 08:02:54 2015 New Revision: 283309 URL: https://svnweb.freebsd.org/changeset/base/283309 Log: Add support for the tuning cap for Hornet/AR9331 boards. This dramatically improves RX sensitivity and behaviour on the AR9331 hardware I have, including the Carambola 2. Tested: * AR9331, Carambola 2 board Submitted by: Zilvinas Valinskas zilvinas.valins...@gmail.com Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c == --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Sat May 23 01:17:50 2015(r283308) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Sat May 23 08:02:54 2015(r283309) @@ -4476,8 +4476,16 @@ HAL_BOOL ar9300_tuning_caps_apply(struct if ((eep-base_eep_header.feature_enable 0x40) 6) { tuning_caps_params = 0x7f; -if (AR_SREV_HORNET(ah) || AR_SREV_POSEIDON(ah) || AR_SREV_WASP(ah)) { +/* XXX TODO: ath9k skips it for Wasp and Honeybee/AR9531, not Poseidon */ +if (AR_SREV_POSEIDON(ah) || AR_SREV_WASP(ah)) { return AH_TRUE; +} else if (AR_SREV_HORNET(ah)) { +OS_REG_RMW_FIELD(ah, +AR_HORNET_CH0_XTAL, AR_OSPREY_CHO_XTAL_CAPINDAC, +tuning_caps_params); +OS_REG_RMW_FIELD(ah, +AR_HORNET_CH0_XTAL, AR_OSPREY_CHO_XTAL_CAPOUTDAC, +tuning_caps_params); } else if (AR_SREV_SCORPION(ah)) { OS_REG_RMW_FIELD(ah, AR_SCORPION_CH0_XTAL, AR_OSPREY_CHO_XTAL_CAPINDAC, ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283310 - in stable/10/sys: kern vm
Author: kib Date: Sat May 23 09:14:29 2015 New Revision: 283310 URL: https://svnweb.freebsd.org/changeset/base/283310 Log: MFC r282690: Call uma_reclaim() from the additional pagedaemon thread to reclaim kmem arena address space. Modified: stable/10/sys/kern/kern_malloc.c stable/10/sys/vm/uma.h stable/10/sys/vm/uma_core.c stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_malloc.c == --- stable/10/sys/kern/kern_malloc.cSat May 23 08:02:54 2015 (r283309) +++ stable/10/sys/kern/kern_malloc.cSat May 23 09:14:29 2015 (r283310) @@ -667,13 +667,15 @@ reallocf(void *addr, unsigned long size, } /* - * Wake the page daemon when we exhaust KVA. It will call the lowmem handler - * and uma_reclaim() callbacks in a context that is safe. + * Wake the uma reclamation pagedaemon thread when we exhaust KVA. It + * will call the lowmem handler and uma_reclaim() callbacks in a + * context that is safe. */ static void kmem_reclaim(vmem_t *vm, int flags) { + uma_reclaim_wakeup(); pagedaemon_wakeup(); } Modified: stable/10/sys/vm/uma.h == --- stable/10/sys/vm/uma.h Sat May 23 08:02:54 2015(r283309) +++ stable/10/sys/vm/uma.h Sat May 23 09:14:29 2015(r283310) @@ -689,4 +689,7 @@ struct uma_percpu_stat { uint64_t_ups_reserved[5]; /* Reserved. */ }; +void uma_reclaim_wakeup(void); +void uma_reclaim_worker(void *); + #endif /* _VM_UMA_H_ */ Modified: stable/10/sys/vm/uma_core.c == --- stable/10/sys/vm/uma_core.c Sat May 23 08:02:54 2015(r283309) +++ stable/10/sys/vm/uma_core.c Sat May 23 09:14:29 2015(r283310) @@ -3192,16 +3192,17 @@ uma_find_refcnt(uma_zone_t zone, void *i } /* See uma.h */ -void -uma_reclaim(void) +static void +uma_reclaim_locked(bool kmem_danger) { + #ifdef UMA_DEBUG printf(UMA: vm asked us to release pages!\n); #endif - sx_xlock(uma_drain_lock); + sx_assert(uma_drain_lock, SA_XLOCKED); bucket_enable(); zone_foreach(zone_drain); - if (vm_page_count_min()) { + if (vm_page_count_min() || kmem_danger) { cache_drain_safe(NULL); zone_foreach(zone_drain); } @@ -3213,9 +3214,42 @@ uma_reclaim(void) zone_drain(slabzone); zone_drain(slabrefzone); bucket_zone_drain(); +} + +void +uma_reclaim(void) +{ + + sx_xlock(uma_drain_lock); + uma_reclaim_locked(false); sx_xunlock(uma_drain_lock); } +static int uma_reclaim_needed; + +void +uma_reclaim_wakeup(void) +{ + + uma_reclaim_needed = 1; + wakeup(uma_reclaim_needed); +} + +void +uma_reclaim_worker(void *arg __unused) +{ + + sx_xlock(uma_drain_lock); + for (;;) { + sx_sleep(uma_reclaim_needed, uma_drain_lock, PVM, + umarcl, 0); + if (uma_reclaim_needed) { + uma_reclaim_needed = 0; + uma_reclaim_locked(true); + } + } +} + /* See uma.h */ int uma_zone_exhausted(uma_zone_t zone) Modified: stable/10/sys/vm/vm_pageout.c == --- stable/10/sys/vm/vm_pageout.c Sat May 23 08:02:54 2015 (r283309) +++ stable/10/sys/vm/vm_pageout.c Sat May 23 09:14:29 2015 (r283310) @@ -1726,8 +1726,9 @@ vm_pageout_init(void) static void vm_pageout(void) { + int error; #if MAXMEMDOM 1 - int error, i; + int i; #endif swap_pager_swap_init(); @@ -1741,6 +1742,10 @@ vm_pageout(void) } } #endif + error = kthread_add(uma_reclaim_worker, NULL, curproc, NULL, + 0, 0, uma); + if (error != 0) + panic(starting uma_reclaim helper, error %d\n, error); vm_pageout_worker((void *)(uintptr_t)0); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283316 - head/sys/mips/mips
Author: alc Date: Sat May 23 16:54:46 2015 New Revision: 283316 URL: https://svnweb.freebsd.org/changeset/base/283316 Log: Simplify the allocation of page table pages for mips64. Specifically, when allocation fails, it suffices to perform VM_WAIT. The direct map covers the entirely of physical memory, so unlike 32-bit mips any physical page can be used as a page table page. Modified: head/sys/mips/mips/pmap.c Modified: head/sys/mips/mips/pmap.c == --- head/sys/mips/mips/pmap.c Sat May 23 14:59:27 2015(r283315) +++ head/sys/mips/mips/pmap.c Sat May 23 16:54:46 2015(r283316) @@ -1036,7 +1036,7 @@ pmap_grow_direct_page_cache() { #ifdef __mips_n64 - vm_pageout_grow_cache(3, 0, MIPS_XKPHYS_LARGEST_PHYS); + VM_WAIT; #else vm_pageout_grow_cache(3, 0, MIPS_KSEG0_LARGEST_PHYS); #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283314 - in head/sys/arm/ti/omap4: . pandaboard
Author: andrew Date: Sat May 23 14:48:03 2015 New Revision: 283314 URL: https://svnweb.freebsd.org/changeset/base/283314 Log: Remove an unused header. Deleted: head/sys/arm/ti/omap4/omap4var.h Modified: head/sys/arm/ti/omap4/pandaboard/pandaboard.c Modified: head/sys/arm/ti/omap4/pandaboard/pandaboard.c == --- head/sys/arm/ti/omap4/pandaboard/pandaboard.c Sat May 23 09:49:40 2015(r283313) +++ head/sys/arm/ti/omap4/pandaboard/pandaboard.c Sat May 23 14:48:03 2015(r283314) @@ -42,7 +42,6 @@ __FBSDID($FreeBSD$); #include machine/vmparam.h #include machine/fdt.h -#include arm/ti/omap4/omap4var.h #include arm/ti/omap4/omap4_reg.h /* Registers in the SCRM that control the AUX clocks */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283315 - head/sys/ddb
Author: pfg Date: Sat May 23 14:59:27 2015 New Revision: 283315 URL: https://svnweb.freebsd.org/changeset/base/283315 Log: ddb: de-register Modified: head/sys/ddb/db_command.c head/sys/ddb/db_input.c head/sys/ddb/db_run.c head/sys/ddb/db_watch.c head/sys/ddb/db_write_cmd.c Modified: head/sys/ddb/db_command.c == --- head/sys/ddb/db_command.c Sat May 23 14:48:03 2015(r283314) +++ head/sys/ddb/db_command.c Sat May 23 14:59:27 2015(r283315) @@ -311,7 +311,7 @@ db_cmd_search(char *name, struct command static void db_cmd_list(struct command_table *table) { - register struct command *cmd; + struct command *cmd; LIST_FOREACH(cmd, table, next) { db_printf(%-16s, cmd-name); Modified: head/sys/ddb/db_input.c == --- head/sys/ddb/db_input.c Sat May 23 14:48:03 2015(r283314) +++ head/sys/ddb/db_input.c Sat May 23 14:59:27 2015(r283315) @@ -97,7 +97,7 @@ db_delete(n, bwd) int n; int bwd; { - register char *p; + char *p; if (bwd) { db_lc -= n; @@ -276,7 +276,7 @@ db_inputchar(c) cnputc('\007'); } else if (c = ' ' c = '~') { - register char *p; + char *p; for (p = db_le; p db_lc; p--) *p = *(p-1); @@ -348,7 +348,7 @@ db_readline(lstart, lsize) void db_check_interrupt(void) { - register intc; + int c; c = cnmaygetc(); switch (c) { Modified: head/sys/ddb/db_run.c == --- head/sys/ddb/db_run.c Sat May 23 14:48:03 2015(r283314) +++ head/sys/ddb/db_run.c Sat May 23 14:59:27 2015(r283315) @@ -80,8 +80,8 @@ db_breakpoint_t db_taken_bkpt = 0; bool db_stop_at_pc(bool *is_breakpoint) { - register db_addr_t pc; - register db_breakpoint_t bkpt; + db_addr_t pc; + db_breakpoint_t bkpt; pc = PC_REGS(); #ifdef SOFTWARE_SSTEP @@ -149,7 +149,7 @@ db_stop_at_pc(bool *is_breakpoint) (!inst_return(ins) || --db_call_depth != 0)) { if (db_sstep_print) { if (inst_call(ins) || inst_return(ins)) { - register int i; + int i; db_printf([after %6d] , db_inst_count); for (i = db_call_depth; --i 0; ) @@ -181,7 +181,7 @@ db_stop_at_pc(bool *is_breakpoint) void db_restart_at_pc(bool watchpt) { - register db_addr_t pc = PC_REGS(); + db_addr_t pc = PC_REGS(); if ((db_run_mode == STEP_COUNT) || (db_run_mode == STEP_RETURN) || Modified: head/sys/ddb/db_watch.c == --- head/sys/ddb/db_watch.c Sat May 23 14:48:03 2015(r283314) +++ head/sys/ddb/db_watch.c Sat May 23 14:59:27 2015(r283315) @@ -69,7 +69,7 @@ static void db_set_watchpoint(vm_map_t static db_watchpoint_t db_watchpoint_alloc(void) { - register db_watchpoint_twatch; + db_watchpoint_t watch; if ((watch = db_free_watchpoints) != 0) { db_free_watchpoints = watch-link; @@ -95,7 +95,7 @@ db_watchpoint_free(db_watchpoint_t watch static void db_set_watchpoint(vm_map_t map, db_addr_t addr, vm_size_t size) { - register db_watchpoint_twatch; + db_watchpoint_t watch; if (map == NULL) { db_printf(No map.\n); @@ -135,8 +135,8 @@ db_set_watchpoint(vm_map_t map, db_addr_ static void db_delete_watchpoint(vm_map_t map, db_addr_t addr) { - register db_watchpoint_twatch; - register db_watchpoint_t*prev; + db_watchpoint_t watch; + db_watchpoint_t *prev; for (prev = db_watchpoint_list; (watch = *prev) != 0; @@ -155,7 +155,7 @@ db_delete_watchpoint(vm_map_t map, db_ad static void db_list_watchpoints(void) { - register db_watchpoint_twatch; + db_watchpoint_t watch; if (db_watchpoint_list == 0) { db_printf(No watchpoints set\n); @@ -220,7 +220,7 @@ DB_SHOW_COMMAND(watches, db_listwatch_cm void db_set_watchpoints(void) { - register db_watchpoint_twatch; + db_watchpoint_t watch; if (!db_watchpoints_inserted) { for (watch = db_watchpoint_list; @@ -245,7 +245,7 @@ db_clear_watchpoints(void) static bool db_find_watchpoint(vm_map_t map, db_addr_t addr, db_regs_t regs) { - register db_watchpoint_t watch; + db_watchpoint_t watch; db_watchpoint_t found = 0; for (watch = db_watchpoint_list; Modified:
svn commit: r283317 - in stable/10/sys/arm: arm include
Author: ian Date: Sat May 23 17:30:30 2015 New Revision: 283317 URL: https://svnweb.freebsd.org/changeset/base/283317 Log: MFC r278770, r279114, r279215, r279338, r279543: Add logic for handling new-style ARM cpu ID info. Correct a comment which was exactly backwards from reality. There is no reason to do i+dcache writeback and invalidate when changing the translation table (this may be left over from armv5 days). It's especially bad to do so using a cache operation that isn't coherent on SMP systems. Add casting to make atomic ops work for pointers. (Apparently nobody has ever done atomic ops on pointers before now on arm). Revert incorrect casting. Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S stable/10/sys/arm/arm/cpuinfo.c stable/10/sys/arm/include/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/cpufunc_asm_armv7.S == --- stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 23 16:54:46 2015 (r283316) +++ stable/10/sys/arm/arm/cpufunc_asm_armv7.S Sat May 23 17:30:30 2015 (r283317) @@ -66,11 +66,7 @@ __FBSDID($FreeBSD$); #endif ENTRY(armv7_setttb) - stmdb sp!, {r0, lr} - bl _C_LABEL(armv7_idcache_wbinv_all) /* clean the D cache */ - ldmia sp!, {r0, lr} dsb - orr r0, r0, #PT_ATTR mcr CP15_TTBR0(r0) isb Modified: stable/10/sys/arm/arm/cpuinfo.c == --- stable/10/sys/arm/arm/cpuinfo.c Sat May 23 16:54:46 2015 (r283316) +++ stable/10/sys/arm/arm/cpuinfo.c Sat May 23 17:30:30 2015 (r283317) @@ -58,9 +58,13 @@ cpuinfo_init(void) /* ARMv4T CPU */ cpuinfo.architecture = 1; cpuinfo.revision = (cpuinfo.midr 16) 0x7F; - } + } else { + /* ARM new id scheme */ + cpuinfo.architecture = (cpuinfo.midr 16) 0x0F; + cpuinfo.revision = (cpuinfo.midr 20) 0x0F; + } } else { - /* must be new id scheme */ + /* non ARM - must be new id scheme */ cpuinfo.architecture = (cpuinfo.midr 16) 0x0F; cpuinfo.revision = (cpuinfo.midr 20) 0x0F; } Modified: stable/10/sys/arm/include/atomic.h == --- stable/10/sys/arm/include/atomic.h Sat May 23 16:54:46 2015 (r283316) +++ stable/10/sys/arm/include/atomic.h Sat May 23 17:30:30 2015 (r283317) @@ -582,8 +582,8 @@ atomic_load_64(volatile uint64_t *p) /* * The only way to atomically load 64 bits is with LDREXD which puts the -* exclusive monitor into the open state, so reset it with CLREX because -* we don't actually need to store anything. +* exclusive monitor into the exclusive state, so reset it to open state +* with CLREX because we don't actually need to store anything. */ __asm __volatile( 1: \n ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283318 - in stable/10/sys/dev: mmc sdhci
Author: ian Date: Sat May 23 17:43:02 2015 New Revision: 283318 URL: https://svnweb.freebsd.org/changeset/base/283318 Log: MFC r279359, r279360: For new eMMC chips, we must signal controller HC capability in OP_COND command. Detect, report and use 8-bit bus if is available. Modified: stable/10/sys/dev/mmc/mmc.c stable/10/sys/dev/sdhci/sdhci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mmc/mmc.c == --- stable/10/sys/dev/mmc/mmc.c Sat May 23 17:30:30 2015(r283317) +++ stable/10/sys/dev/mmc/mmc.c Sat May 23 17:43:02 2015(r283318) @@ -1622,7 +1622,7 @@ mmc_go_discovery(struct mmc_softc *sc) mmc_send_app_op_cond(sc, (err ? 0 : MMC_OCR_CCS) | mmcbr_get_ocr(dev), NULL); } else - mmc_send_op_cond(sc, mmcbr_get_ocr(dev), NULL); + mmc_send_op_cond(sc, MMC_OCR_CCS | mmcbr_get_ocr(dev), NULL); mmc_discover_cards(sc); mmc_rescan_cards(sc); Modified: stable/10/sys/dev/sdhci/sdhci.c == --- stable/10/sys/dev/sdhci/sdhci.c Sat May 23 17:30:30 2015 (r283317) +++ stable/10/sys/dev/sdhci/sdhci.c Sat May 23 17:43:02 2015 (r283318) @@ -584,6 +584,8 @@ sdhci_init_slot(device_t dev, struct sdh support voltages.\n); } slot-host.caps = MMC_CAP_4_BIT_DATA; + if (caps SDHCI_CAN_DO_8BITBUS) + slot-host.caps |= MMC_CAP_8_BIT_DATA; if (caps SDHCI_CAN_DO_HISPD) slot-host.caps |= MMC_CAP_HSPEED; /* Decide if we have usable DMA. */ @@ -603,9 +605,11 @@ sdhci_init_slot(device_t dev, struct sdh slot-opt = ~SDHCI_HAVE_DMA; if (bootverbose || sdhci_debug) { - slot_printf(slot, %uMHz%s 4bits%s%s%s %s\n, + slot_printf(slot, %uMHz%s %s%s%s%s %s\n, slot-max_clk / 100, (caps SDHCI_CAN_DO_HISPD) ? HS : , + (caps MMC_CAP_8_BIT_DATA) ? 8bits : + ((caps MMC_CAP_4_BIT_DATA) ? 4bits : 1bit), (caps SDHCI_CAN_VDD_330) ? 3.3V : , (caps SDHCI_CAN_VDD_300) ? 3.0V : , (caps SDHCI_CAN_VDD_180) ? 1.8V : , @@ -692,11 +696,19 @@ sdhci_generic_update_ios(device_t brdev, } /* Configure the bus. */ sdhci_set_clock(slot, ios-clock); - sdhci_set_power(slot, (ios-power_mode == power_off)?0:ios-vdd); - if (ios-bus_width == bus_width_4) + sdhci_set_power(slot, (ios-power_mode == power_off) ? 0 : ios-vdd); + if (ios-bus_width == bus_width_8) { + slot-hostctrl |= SDHCI_CTRL_8BITBUS; + slot-hostctrl = ~SDHCI_CTRL_4BITBUS; + } else if (ios-bus_width == bus_width_4) { + slot-hostctrl = ~SDHCI_CTRL_8BITBUS; slot-hostctrl |= SDHCI_CTRL_4BITBUS; - else + } else if (ios-bus_width == bus_width_1) { + slot-hostctrl = ~SDHCI_CTRL_8BITBUS; slot-hostctrl = ~SDHCI_CTRL_4BITBUS; + } else { + panic(Invalid bus width: %d, ios-bus_width); + } if (ios-timing == bus_timing_hs !(slot-quirks SDHCI_QUIRK_DONT_SET_HISPD_BIT)) slot-hostctrl |= SDHCI_CTRL_HISPD; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283319 - stable/10/sys/arm/arm
Author: ian Date: Sat May 23 17:48:09 2015 New Revision: 283319 URL: https://svnweb.freebsd.org/changeset/base/283319 Log: MFC r279702: Update a comment that had drifted out of date. Modified: stable/10/sys/arm/arm/physmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/physmem.c == --- stable/10/sys/arm/arm/physmem.c Sat May 23 17:43:02 2015 (r283318) +++ stable/10/sys/arm/arm/physmem.c Sat May 23 17:48:09 2015 (r283319) @@ -153,7 +153,7 @@ arm_physmem_print_tables() * Walk the list of hardware regions, processing it against the list of * exclusions that contain the given exflags, and generating an avail list. * - * Updates the kernel global 'realmem' with the sum of all pages in hw regions. + * Updates the value at *pavail with the sum of all pages in all hw regions. * * Returns the number of pages of non-excluded memory added to the avail list. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283320 - head/sys/kern
Author: kib Date: Sat May 23 19:09:04 2015 New Revision: 283320 URL: https://svnweb.freebsd.org/changeset/base/283320 Log: If thread requested to not stop on non-boundary, then not only stopping signals should obey, but also all forms of single-threading. Otherwise, thread might sleep interruptible while owning some resources, and single-threading thread could try to access them. An example is owning vnode lock while dumping core. Submitted by: Conrad Meyer Review: https://reviews.freebsd.org/D2612 Tested by:pho MFC after:1 week Modified: head/sys/kern/kern_thread.c Modified: head/sys/kern/kern_thread.c == --- head/sys/kern/kern_thread.c Sat May 23 17:48:09 2015(r283319) +++ head/sys/kern/kern_thread.c Sat May 23 19:09:04 2015(r283320) @@ -868,12 +868,9 @@ thread_suspend_check(int return_instead) return (ERESTART); /* -* Ignore suspend requests for stop signals if they -* are deferred. +* Ignore suspend requests if they are deferred. */ - if ((P_SHOULDSTOP(p) == P_STOPPED_SIG || - (p-p_flag P_TOTAL_STOP) != 0) - (td-td_flags TDF_SBDRY) != 0) { + if ((td-td_flags TDF_SBDRY) != 0) { KASSERT(return_instead, (TDF_SBDRY set for unsafe thread_suspend_check)); return (0); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283321 - stable/10/sys/dev/uart
Author: ian Date: Sat May 23 19:27:04 2015 New Revision: 283321 URL: https://svnweb.freebsd.org/changeset/base/283321 Log: MFC r272399, r272602, r274451, r274452: Add uart driver for Qualcomm MSM 7000/8000 series chips. It is working on IFC6410 board which has Qualcomm Snapdragon SoC. Use documented compat string for msm uart. Make PL011 UART to wait on putc only when TX FIFO is full Make uart_bus_fdt a decendant of ofwbus Added: stable/10/sys/dev/uart/uart_dev_msm.c - copied unchanged from r272399, head/sys/dev/uart/uart_dev_msm.c stable/10/sys/dev/uart/uart_dev_msm.h - copied unchanged from r272399, head/sys/dev/uart/uart_dev_msm.h Modified: stable/10/sys/dev/uart/uart.h stable/10/sys/dev/uart/uart_bus_fdt.c stable/10/sys/dev/uart/uart_dev_pl011.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart.h == --- stable/10/sys/dev/uart/uart.h Sat May 23 19:09:04 2015 (r283320) +++ stable/10/sys/dev/uart/uart.h Sat May 23 19:27:04 2015 (r283321) @@ -65,6 +65,7 @@ struct uart_bas { struct uart_class; extern struct uart_class uart_imx_class __attribute__((weak)); +extern struct uart_class uart_msm_class __attribute__((weak)); extern struct uart_class uart_ns8250_class __attribute__((weak)); extern struct uart_class uart_quicc_class __attribute__((weak)); extern struct uart_class uart_s3c2410_class __attribute__((weak)); Modified: stable/10/sys/dev/uart/uart_bus_fdt.c == --- stable/10/sys/dev/uart/uart_bus_fdt.c Sat May 23 19:09:04 2015 (r283320) +++ stable/10/sys/dev/uart/uart_bus_fdt.c Sat May 23 19:27:04 2015 (r283321) @@ -84,6 +84,7 @@ static struct ofw_compat_data compat_dat {fsl,imx21-uart, (uintptr_t)uart_imx_class}, {fsl,mvf600-uart, (uintptr_t)uart_vybrid_class}, {lpc,uart,(uintptr_t)uart_lpc_class}, + {qcom,msm-uartdm, (uintptr_t)uart_msm_class}, {ti,ns16550, (uintptr_t)uart_ti8250_class}, {ns16550, (uintptr_t)uart_ns8250_class}, {NULL, (uintptr_t)NULL}, @@ -156,3 +157,4 @@ uart_fdt_probe(device_t dev) } DRIVER_MODULE(uart, simplebus, uart_fdt_driver, uart_devclass, 0, 0); +DRIVER_MODULE(uart, ofwbus, uart_fdt_driver, uart_devclass, 0, 0); Copied: stable/10/sys/dev/uart/uart_dev_msm.c (from r272399, head/sys/dev/uart/uart_dev_msm.c) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/uart/uart_dev_msm.c Sat May 23 19:27:04 2015 (r283321, copy of r272399, head/sys/dev/uart/uart_dev_msm.c) @@ -0,0 +1,568 @@ +/*- + * Copyright (c) 2014 Ganbold Tsagaankhuu ganb...@freebsd.org + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Qualcomm MSM7K/8K uart driver */ + +#include sys/cdefs.h +__FBSDID($FreeBSD$); + +#include opt_ddb.h + +#include sys/param.h +#include sys/systm.h +#include sys/bus.h +#include sys/conf.h +#include sys/kdb.h +#include machine/bus.h +#include machine/fdt.h + +#include dev/uart/uart.h +#include dev/uart/uart_cpu.h +#include dev/uart/uart_bus.h +#include dev/uart/uart_dev_msm.h + +#include uart_if.h + +#defineDEF_CLK 7372800 + +#defineGETREG(bas, reg)\ +bus_space_read_4((bas)-bst, (bas)-bsh, (reg)) +#defineSETREG(bas, reg, value) \ +bus_space_write_4((bas)-bst, (bas)-bsh, (reg), (value)) + +static int msm_uart_param(struct uart_bas *, int, int, int,
svn commit: r283349 - stable/10/sys/cam
Author: trasz Date: Sun May 24 04:14:09 2015 New Revision: 283349 URL: https://svnweb.freebsd.org/changeset/base/283349 Log: MFC r279554: Make periphdriver_register() take XPT lock when modifying the periph_drivers array. This fixes a panic that sometimes occured when kldloading ctl.ko. PR: 200384 Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/cam_periph.c stable/10/sys/cam/cam_xpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_periph.c == --- stable/10/sys/cam/cam_periph.c Sun May 24 02:46:08 2015 (r283348) +++ stable/10/sys/cam/cam_periph.c Sun May 24 04:14:09 2015 (r283349) @@ -108,9 +108,19 @@ periphdriver_register(void *data) struct periph_driver **newdrivers, **old; int ndrivers; +again: ndrivers = nperiph_drivers + 2; newdrivers = malloc(sizeof(*newdrivers) * ndrivers, M_CAMPERIPH, M_WAITOK); + xpt_lock_buses(); + if (ndrivers != nperiph_drivers + 2) { + /* +* Lost race against itself; go around. +*/ + xpt_unlock_buses(); + free(newdrivers, M_CAMPERIPH); + goto again; + } if (periph_drivers) bcopy(periph_drivers, newdrivers, sizeof(*newdrivers) * nperiph_drivers); @@ -118,9 +128,10 @@ periphdriver_register(void *data) newdrivers[nperiph_drivers + 1] = NULL; old = periph_drivers; periph_drivers = newdrivers; + nperiph_drivers++; + xpt_unlock_buses(); if (old) free(old, M_CAMPERIPH); - nperiph_drivers++; /* If driver marked as early or it is late now, initialize it. */ if (((drv-flags CAM_PERIPH_DRV_EARLY) != 0 initialized 0) || initialized 1) Modified: stable/10/sys/cam/cam_xpt.c == --- stable/10/sys/cam/cam_xpt.c Sun May 24 02:46:08 2015(r283348) +++ stable/10/sys/cam/cam_xpt.c Sun May 24 04:14:09 2015(r283349) @@ -149,6 +149,8 @@ typedef int xpt_pdrvfunc_t (struct perip /* Transport layer configuration information */ static struct xpt_softc xsoftc; +MTX_SYSINIT(xpt_topo_init, xsoftc.xpt_topo_lock, XPT topology lock, MTX_DEF); + TUNABLE_INT(kern.cam.boot_delay, xsoftc.boot_delay); SYSCTL_INT(_kern_cam, OID_AUTO, boot_delay, CTLFLAG_RDTUN, xsoftc.boot_delay, 0, Bus registration wait time); @@ -850,7 +852,6 @@ xpt_init(void *dummy) mtx_init(xsoftc.xpt_lock, XPT lock, NULL, MTX_DEF); mtx_init(xsoftc.xpt_highpower_lock, XPT highpower lock, NULL, MTX_DEF); - mtx_init(xsoftc.xpt_topo_lock, XPT topology lock, NULL, MTX_DEF); xsoftc.xpt_taskq = taskqueue_create(CAM XPT task, M_WAITOK, taskqueue_thread_enqueue, /*context*/xsoftc.xpt_taskq); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org