From owner-svn-src-stable-7@FreeBSD.ORG Sun Jan 23 02:18:18 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3AD3106564A; Sun, 23 Jan 2011 02:18:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82F48FC12; Sun, 23 Jan 2011 02:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0N2II44036513; Sun, 23 Jan 2011 02:18:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0N2IIV7036510; Sun, 23 Jan 2011 02:18:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101230218.p0N2IIV7036510@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 23 Jan 2011 02:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217741 - stable/7/sys/dev/alc X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 02:18:19 -0000 Author: yongari Date: Sun Jan 23 02:18:18 2011 New Revision: 217741 URL: http://svn.freebsd.org/changeset/base/217741 Log: MFC r217649: Correct wrong definition of PM timer mask and adjust L1/PM timer value. While I'm here enable all clocks before initializing controller. This change should fix lockup issue seen on AR8152 v1.1 PCIe Fast Ethernet controller. PR: kern/154076 Modified: stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/alc/if_alcreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Jan 23 02:15:50 2011 (r217740) +++ stable/7/sys/dev/alc/if_alc.c Sun Jan 23 02:18:18 2011 (r217741) @@ -678,7 +678,7 @@ alc_aspm(struct alc_softc *sc, int media pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; pmcfg &= ~(PM_CFG_L1_ENTRY_TIMER_MASK | PM_CFG_LCKDET_TIMER_MASK); pmcfg |= PM_CFG_MAC_ASPM_CHK; - pmcfg |= PM_CFG_SERDES_ENB | PM_CFG_RBER_ENB; + pmcfg |= (PM_CFG_LCKDET_TIMER_DEFAULT << PM_CFG_LCKDET_TIMER_SHIFT); pmcfg &= ~(PM_CFG_ASPM_L1_ENB | PM_CFG_ASPM_L0S_ENB); if ((sc->alc_flags & ALC_FLAG_APS) != 0) { @@ -3150,6 +3150,9 @@ alc_init_locked(struct alc_softc *sc) alc_init_cmb(sc); alc_init_smb(sc); + /* Enable all clocks. */ + CSR_WRITE_4(sc, ALC_CLK_GATING_CFG, 0); + /* Reprogram the station address. */ bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); CSR_WRITE_4(sc, ALC_PAR0, Modified: stable/7/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/7/sys/dev/alc/if_alcreg.h Sun Jan 23 02:15:50 2011 (r217740) +++ stable/7/sys/dev/alc/if_alcreg.h Sun Jan 23 02:18:18 2011 (r217741) @@ -109,7 +109,7 @@ #define PM_CFG_PCIE_RECV 0x00008000 #define PM_CFG_L1_ENTRY_TIMER_MASK 0x000F0000 #define PM_CFG_PM_REQ_TIMER_MASK 0x00F00000 -#define PM_CFG_LCKDET_TIMER_MASK 0x3F000000 +#define PM_CFG_LCKDET_TIMER_MASK 0x0F000000 #define PM_CFG_EN_BUFS_RX_L0S 0x10000000 #define PM_CFG_SA_DLY_ENB 0x20000000 #define PM_CFG_MAC_ASPM_CHK 0x40000000 @@ -120,8 +120,9 @@ #define PM_CFG_LCKDET_TIMER_SHIFT 24 #define PM_CFG_L0S_ENTRY_TIMER_DEFAULT 6 -#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 12 -#define PM_CFG_PM_REQ_TIMER_DEFAULT 1 +#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 1 +#define PM_CFG_LCKDET_TIMER_DEFAULT 12 +#define PM_CFG_PM_REQ_TIMER_DEFAULT 12 #define ALC_LTSSM_ID_CFG 0x12FC #define LTSSM_ID_WRO_ENB 0x00001000 @@ -724,6 +725,14 @@ #define ALC_TX_MIB_BASE 0x1760 +#define ALC_CLK_GATING_CFG 0x1814 +#define CLK_GATING_DMAW_ENB 0x0001 +#define CLK_GATING_DMAR_ENB 0x0002 +#define CLK_GATING_TXQ_ENB 0x0004 +#define CLK_GATING_RXQ_ENB 0x0008 +#define CLK_GATING_TXMAC_ENB 0x0010 +#define CLK_GATING_RXMAC_ENB 0x0020 + #define ALC_DEBUG_DATA0 0x1900 #define ALC_DEBUG_DATA1 0x1904 From owner-svn-src-stable-7@FreeBSD.ORG Mon Jan 24 15:18:18 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2F55106566B; Mon, 24 Jan 2011 15:18:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D047B8FC16; Mon, 24 Jan 2011 15:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OFIIB3096277; Mon, 24 Jan 2011 15:18:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OFIIJB096275; Mon, 24 Jan 2011 15:18:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201101241518.p0OFIIJB096275@svn.freebsd.org> From: Glen Barber Date: Mon, 24 Jan 2011 15:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217788 - stable/7/share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:18:19 -0000 Author: gjb (doc committer) Date: Mon Jan 24 15:18:18 2011 New Revision: 217788 URL: http://svn.freebsd.org/changeset/base/217788 Log: MFC 217148, 217786: Document rc.conf.d in rc.conf(5). PR: 140495 Approved by: keramida (mentor) Modified: stable/7/share/man/man5/rc.conf.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Mon Jan 24 15:17:10 2011 (r217787) +++ stable/7/share/man/man5/rc.conf.5 Mon Jan 24 15:18:18 2011 (r217788) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2010 +.Dd January 7, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -64,7 +64,19 @@ The file is used to override settings in .Pa /etc/rc.conf for historical reasons. -See the +In addition to +.Pa /etc/rc.conf.local +you can also place smaller configuration files for each +.Xr rc 8 +script in the +.Pa /etc/rc.conf.d +directory, which will be included by the +.Va load_rc_config +function. +For jail configurations you could use the file +.Pa /etc/rc.conf.d/jail +to store jail specific configuration options. +Also see the .Va rc_conf_files variable below. .Pp From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 19:44:56 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D461065697; Tue, 25 Jan 2011 19:44:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35E368FC19; Tue, 25 Jan 2011 19:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PJiu7I048018; Tue, 25 Jan 2011 19:44:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PJiuC5048015; Tue, 25 Jan 2011 19:44:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101251944.p0PJiuC5048015@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 19:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217836 - stable/7/sys/vm X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:44:56 -0000 Author: jhb Date: Tue Jan 25 19:44:55 2011 New Revision: 217836 URL: http://svn.freebsd.org/changeset/base/217836 Log: MFC 214144: - Make 'vm_refcnt' volatile so that compilers won't be tempted to treat its value as a loop invariant. Currently this is a no-op because 'atomic_cmpset_int()' clobbers all memory on current architectures. - Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop a reference in vmspace_free(). Modified: stable/7/sys/vm/vm_map.c stable/7/sys/vm/vm_map.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Tue Jan 25 19:44:42 2011 (r217835) +++ stable/7/sys/vm/vm_map.c Tue Jan 25 19:44:55 2011 (r217836) @@ -336,15 +336,11 @@ vmspace_dofree(struct vmspace *vm) void vmspace_free(struct vmspace *vm) { - int refcnt; if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); - do - refcnt = vm->vm_refcnt; - while (!atomic_cmpset_int(&vm->vm_refcnt, refcnt, refcnt - 1)); - if (refcnt == 1) + if (atomic_fetchadd_int(&vm->vm_refcnt, -1) == 1) vmspace_dofree(vm); } Modified: stable/7/sys/vm/vm_map.h ============================================================================== --- stable/7/sys/vm/vm_map.h Tue Jan 25 19:44:42 2011 (r217835) +++ stable/7/sys/vm/vm_map.h Tue Jan 25 19:44:55 2011 (r217836) @@ -246,7 +246,7 @@ struct vmspace { caddr_t vm_taddr; /* (c) user virtual address of text */ caddr_t vm_daddr; /* (c) user virtual address of data */ caddr_t vm_maxsaddr; /* user VA at max stack growth */ - int vm_refcnt; /* number of references */ + volatile int vm_refcnt; /* number of references */ }; #ifdef _KERNEL From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 20:33:47 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A80E11065693; Tue, 25 Jan 2011 20:33:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 961238FC29; Tue, 25 Jan 2011 20:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKXlR2049390; Tue, 25 Jan 2011 20:33:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKXlj9049383; Tue, 25 Jan 2011 20:33:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252033.p0PKXlj9049383@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217839 - in stable/7/sys: kern sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:33:47 -0000 Author: jhb Date: Tue Jan 25 20:33:47 2011 New Revision: 217839 URL: http://svn.freebsd.org/changeset/base/217839 Log: MFC 211514,214158: - There isn't really a need to hold the ktrace mutex just to read the value of p_traceflag that is stored in the kinfo_proc structure. - When disabling ktracing on a process, free any pending requests that may be left. This fixes a memory leak that can occur when tracing is disabled on a process via disabling tracing of a specific file (or if an I/O error occurs with the tracefile) if the process's next system call is exit(). The trace disabling code clears p_traceflag, so exit1() doesn't do any KTRACE-related cleanup leading to the leak. I chose to make the free'ing of pending records synchronous rather than patching exit1(). - Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into kern_ktrace.c instead. Make ktrace_mtx private to kern_ktrace.c as a result. Modified: stable/7/sys/kern/kern_exec.c stable/7/sys/kern/kern_exit.c stable/7/sys/kern/kern_fork.c stable/7/sys/kern/kern_ktrace.c stable/7/sys/kern/kern_proc.c stable/7/sys/sys/ktrace.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_exec.c ============================================================================== --- stable/7/sys/kern/kern_exec.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_exec.c Tue Jan 25 20:33:47 2011 (r217839) @@ -605,16 +605,8 @@ interpret: setsugid(p); #ifdef KTRACE - if (p->p_tracevp != NULL && - priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) { - mtx_lock(&ktrace_mtx); - p->p_traceflag = 0; - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - mtx_unlock(&ktrace_mtx); - } + if (priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) + ktrprocexec(p, &tracecred, &tracevp); #endif /* * Close any file descriptors 0..2 that reference procfs, Modified: stable/7/sys/kern/kern_exit.c ============================================================================== --- stable/7/sys/kern/kern_exit.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_exit.c Tue Jan 25 20:33:47 2011 (r217839) @@ -123,10 +123,6 @@ exit1(struct thread *td, int rv) struct tty *tp; struct vnode *ttyvp; struct vnode *vtmp; -#ifdef KTRACE - struct vnode *tracevp; - struct ucred *tracecred; -#endif struct plimit *plim; int locked; @@ -367,33 +363,7 @@ retry: (void)acct_process(td); mtx_unlock(&Giant); #ifdef KTRACE - /* - * Disable tracing, then drain any pending records and release - * the trace file. - */ - if (p->p_traceflag != 0) { - PROC_LOCK(p); - mtx_lock(&ktrace_mtx); - p->p_traceflag = 0; - mtx_unlock(&ktrace_mtx); - PROC_UNLOCK(p); - ktrprocexit(td); - PROC_LOCK(p); - mtx_lock(&ktrace_mtx); - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - mtx_unlock(&ktrace_mtx); - PROC_UNLOCK(p); - if (tracevp != NULL) { - locked = VFS_LOCK_GIANT(tracevp->v_mount); - vrele(tracevp); - VFS_UNLOCK_GIANT(locked); - } - if (tracecred != NULL) - crfree(tracecred); - } + ktrprocexit(td); #endif /* * Release reference to text vnode Modified: stable/7/sys/kern/kern_fork.c ============================================================================== --- stable/7/sys/kern/kern_fork.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_fork.c Tue Jan 25 20:33:47 2011 (r217839) @@ -613,21 +613,7 @@ again: callout_init(&p2->p_itcallout, CALLOUT_MPSAFE); #ifdef KTRACE - /* - * Copy traceflag and tracefile if enabled. - */ - mtx_lock(&ktrace_mtx); - KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); - if (p1->p_traceflag & KTRFAC_INHERIT) { - p2->p_traceflag = p1->p_traceflag; - if ((p2->p_tracevp = p1->p_tracevp) != NULL) { - VREF(p2->p_tracevp); - KASSERT(p1->p_tracecred != NULL, - ("ktrace vnode with no cred")); - p2->p_tracecred = crhold(p1->p_tracecred); - } - } - mtx_unlock(&ktrace_mtx); + ktrprocfork(p1, p2); #endif /* Modified: stable/7/sys/kern/kern_ktrace.c ============================================================================== --- stable/7/sys/kern/kern_ktrace.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_ktrace.c Tue Jan 25 20:33:47 2011 (r217839) @@ -127,7 +127,7 @@ SYSCTL_UINT(_kern_ktrace, OID_AUTO, geni 0, "Maximum size of genio event payload"); static int print_message = 1; -struct mtx ktrace_mtx; +static struct mtx ktrace_mtx; static struct sx ktrace_sx; static void ktrace_init(void *dummy); @@ -135,7 +135,10 @@ static int sysctl_kern_ktrace_request_po static u_int ktrace_resize_pool(u_int newsize); static struct ktr_request *ktr_getrequest(int type); static void ktr_submitrequest(struct thread *td, struct ktr_request *req); +static void ktr_freeproc(struct proc *p, struct ucred **uc, + struct vnode **vp); static void ktr_freerequest(struct ktr_request *req); +static void ktr_freerequest_locked(struct ktr_request *req); static void ktr_writerequest(struct thread *td, struct ktr_request *req); static int ktrcanset(struct thread *,struct proc *); static int ktrsetchildren(struct thread *,struct proc *,int,int,struct vnode *); @@ -375,11 +378,43 @@ static void ktr_freerequest(struct ktr_request *req) { + mtx_lock(&ktrace_mtx); + ktr_freerequest_locked(req); + mtx_unlock(&ktrace_mtx); +} + +static void +ktr_freerequest_locked(struct ktr_request *req) +{ + + mtx_assert(&ktrace_mtx, MA_OWNED); if (req->ktr_buffer != NULL) free(req->ktr_buffer, M_KTRACE); - mtx_lock(&ktrace_mtx); STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list); - mtx_unlock(&ktrace_mtx); +} + +/* + * Disable tracing for a process and release all associated resources. + * The caller is responsible for releasing a reference on the returned + * vnode and credentials. + */ +static void +ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp) +{ + struct ktr_request *req; + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_assert(&ktrace_mtx, MA_OWNED); + *uc = p->p_tracecred; + p->p_tracecred = NULL; + if (vp != NULL) + *vp = p->p_tracevp; + p->p_tracevp = NULL; + p->p_traceflag = 0; + while ((req = STAILQ_FIRST(&p->p_ktr)) != NULL) { + STAILQ_REMOVE_HEAD(&p->p_ktr, ktr_list); + ktr_freerequest_locked(req); + } } void @@ -432,20 +467,79 @@ ktrsysret(code, error, retval) } /* - * When a process exits, drain per-process asynchronous trace records. + * When a setuid process execs, disable tracing. + * + * XXX: We toss any pending asynchronous records. + */ +void +ktrprocexec(struct proc *p, struct ucred **uc, struct vnode **vp) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_lock(&ktrace_mtx); + ktr_freeproc(p, uc, vp); + mtx_unlock(&ktrace_mtx); +} + +/* + * When a process exits, drain per-process asynchronous trace records + * and disable tracing. */ void ktrprocexit(struct thread *td) { + struct proc *p; + struct ucred *cred; + struct vnode *vp; + int vfslocked; + + p = td->td_proc; + if (p->p_traceflag == 0) + return; ktrace_enter(td); sx_xlock(&ktrace_sx); ktr_drain(td); sx_xunlock(&ktrace_sx); + PROC_LOCK(p); + mtx_lock(&ktrace_mtx); + ktr_freeproc(p, &cred, &vp); + mtx_unlock(&ktrace_mtx); + PROC_UNLOCK(p); + if (vp != NULL) { + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); + } + if (cred != NULL) + crfree(cred); ktrace_exit(td); } /* + * When a process forks, enable tracing in the new process if needed. + */ +void +ktrprocfork(struct proc *p1, struct proc *p2) +{ + + PROC_LOCK_ASSERT(p1, MA_OWNED); + PROC_LOCK_ASSERT(p2, MA_OWNED); + mtx_lock(&ktrace_mtx); + KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); + if (p1->p_traceflag & KTRFAC_INHERIT) { + p2->p_traceflag = p1->p_traceflag; + if ((p2->p_tracevp = p1->p_tracevp) != NULL) { + VREF(p2->p_tracevp); + KASSERT(p1->p_tracecred != NULL, + ("ktrace vnode with no cred")); + p2->p_tracecred = crhold(p1->p_tracecred); + } + } + mtx_unlock(&ktrace_mtx); +} + +/* * When a thread returns, drain any asynchronous records generated by the * system call. */ @@ -696,10 +790,7 @@ ktrace(td, uap) if (p->p_tracevp == vp) { if (ktrcanset(td, p)) { mtx_lock(&ktrace_mtx); - cred = p->p_tracecred; - p->p_tracecred = NULL; - p->p_tracevp = NULL; - p->p_traceflag = 0; + ktr_freeproc(p, &cred, NULL); mtx_unlock(&ktrace_mtx); vrele_count++; crfree(cred); @@ -867,14 +958,9 @@ ktrops(td, p, ops, facs, vp) p->p_traceflag |= KTRFAC_ROOT; } else { /* KTROP_CLEAR */ - if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) { + if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) /* no more tracing */ - p->p_traceflag = 0; - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - } + ktr_freeproc(p, &tracecred, &tracevp); } mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); @@ -1038,10 +1124,7 @@ ktr_writerequest(struct thread *td, stru PROC_LOCK(p); if (p->p_tracevp == vp) { mtx_lock(&ktrace_mtx); - p->p_tracevp = NULL; - p->p_traceflag = 0; - cred = p->p_tracecred; - p->p_tracecred = NULL; + ktr_freeproc(p, &cred, NULL); mtx_unlock(&ktrace_mtx); vrele_count++; } @@ -1053,11 +1136,6 @@ ktr_writerequest(struct thread *td, stru } sx_sunlock(&allproc_lock); - /* - * We can't clear any pending requests in threads that have cached - * them but not yet committed them, as those are per-thread. The - * thread will have to clear it itself on system call return. - */ vfslocked = VFS_LOCK_GIANT(vp->v_mount); while (vrele_count-- > 0) vrele(vp); Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_proc.c Tue Jan 25 20:33:47 2011 (r217839) @@ -63,10 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KTRACE -#include -#include -#endif #ifdef DDB #include @@ -717,9 +713,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_textvp = p->p_textvp; #ifdef KTRACE kp->ki_tracep = p->p_tracevp; - mtx_lock(&ktrace_mtx); kp->ki_traceflag = p->p_traceflag; - mtx_unlock(&ktrace_mtx); #endif kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; Modified: stable/7/sys/sys/ktrace.h ============================================================================== --- stable/7/sys/sys/ktrace.h Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/sys/ktrace.h Tue Jan 25 20:33:47 2011 (r217839) @@ -191,8 +191,6 @@ struct stat; #define KTRFAC_DROP 0x20000000 /* last event was dropped */ #ifdef _KERNEL -extern struct mtx ktrace_mtx; - void ktrnamei(char *); void ktrcsw(int, int); void ktrpsig(int, sig_t, sigset_t *, int); @@ -200,7 +198,9 @@ void ktrgenio(int, enum uio_rw, struct u void ktrsyscall(int, int narg, register_t args[]); void ktrsysctl(int *name, u_int namelen); void ktrsysret(int, int, register_t); +void ktrprocexec(struct proc *, struct ucred **, struct vnode **); void ktrprocexit(struct thread *); +void ktrprocfork(struct proc *, struct proc *); void ktruserret(struct thread *); void ktrstruct(const char *, size_t, void *, size_t); #define ktrsockaddr(s) \ From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 20:44:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5995510656C0; Tue, 25 Jan 2011 20:44:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 483EC8FC18; Tue, 25 Jan 2011 20:44:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKiPhd049780; Tue, 25 Jan 2011 20:44:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKiP8x049773; Tue, 25 Jan 2011 20:44:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252044.p0PKiP8x049773@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217841 - stable/7/usr.sbin/mfiutil X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:44:25 -0000 Author: jhb Date: Tue Jan 25 20:44:24 2011 New Revision: 217841 URL: http://svn.freebsd.org/changeset/base/217841 Log: MFC 204329,210723,210933,214778,215526: Sync mfiutil(8) with HEAD: - Handle malloc() failures more gracefully by error'ing out rather than segfaulting. - Fixed dependencies (make checkdpadd). - Fix typos and spelling mistakes. Modified: stable/7/usr.sbin/mfiutil/Makefile stable/7/usr.sbin/mfiutil/mfi_cmd.c stable/7/usr.sbin/mfiutil/mfi_config.c stable/7/usr.sbin/mfiutil/mfi_evt.c stable/7/usr.sbin/mfiutil/mfi_flash.c stable/7/usr.sbin/mfiutil/mfiutil.8 Directory Properties: stable/7/usr.sbin/mfiutil/ (props changed) Modified: stable/7/usr.sbin/mfiutil/Makefile ============================================================================== --- stable/7/usr.sbin/mfiutil/Makefile Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/Makefile Tue Jan 25 20:44:24 2011 (r217841) @@ -8,6 +8,7 @@ MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime WARNS?=3 +DPADD= ${LIBUTIL} LDADD= -lutil # Here be dragons Modified: stable/7/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_cmd.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_cmd.c Tue Jan 25 20:44:24 2011 (r217841) @@ -46,7 +46,7 @@ #include static const char *mfi_status_codes[] = { - "Command completed succesfully", + "Command completed successfully", "Invalid command", "Invalid DMCD opcode", "Invalid parameter", Modified: stable/7/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_config.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_config.c Tue Jan 25 20:44:24 2011 (r217841) @@ -328,6 +328,10 @@ parse_array(int fd, int raid_type, char /* Validate each drive. */ info->drives = calloc(count, sizeof(struct mfi_pd_info)); + if (info->drives == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } info->drive_count = count; for (pinfo = info->drives; (cp = strsep(&array_str, ",")) != NULL; pinfo++) { @@ -638,6 +642,10 @@ create_volume(int ac, char **av) break; } arrays = calloc(narrays, sizeof(*arrays)); + if (arrays == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < narrays; i++) { error = parse_array(fd, raid_type, av[i], &arrays[i]); if (error) @@ -673,6 +681,10 @@ create_volume(int ac, char **av) state.array_count = config->array_count; if (config->array_count > 0) { state.arrays = calloc(config->array_count, sizeof(int)); + if (state.arrays == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < config->array_count; i++) { ar = (struct mfi_array *)p; state.arrays[i] = ar->array_ref; @@ -685,6 +697,10 @@ create_volume(int ac, char **av) state.log_drv_count = config->log_drv_count; if (config->log_drv_count) { state.volumes = calloc(config->log_drv_count, sizeof(int)); + if (state.volumes == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < config->log_drv_count; i++) { ld = (struct mfi_ld_config *)p; state.volumes[i] = ld->properties.ld.v.target_id; @@ -721,6 +737,10 @@ create_volume(int ac, char **av) config_size = sizeof(struct mfi_config_data) + sizeof(struct mfi_ld_config) * nvolumes + MFI_ARRAY_SIZE * narrays; config = calloc(1, config_size); + if (config == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } config->size = config_size; config->array_count = narrays; config->array_size = MFI_ARRAY_SIZE; /* XXX: Firmware hardcode */ @@ -902,6 +922,10 @@ add_spare(int ac, char **av) spare = malloc(sizeof(struct mfi_spare) + sizeof(uint16_t) * config->array_count); + if (spare == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } bzero(spare, sizeof(struct mfi_spare)); spare->ref = info.ref; @@ -1170,6 +1194,10 @@ dump(int ac, char **av) } config = malloc(len); + if (config == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } if (sysctlbyname(buf, config, &len, NULL, 0) < 0) { error = errno; warn("Failed to read debug command"); Modified: stable/7/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_evt.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_evt.c Tue Jan 25 20:44:24 2011 (r217841) @@ -624,6 +624,10 @@ show_events(int ac, char **av) } list = malloc(size); + if (list == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (seq = start;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { Modified: stable/7/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_flash.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_flash.c Tue Jan 25 20:44:24 2011 (r217841) @@ -163,6 +163,10 @@ flash_adapter(int ac, char **av) /* Upload the file 64k at a time. */ buf = malloc(FLASH_BUF_SIZE); + if (buf == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } offset = 0; while (sb.st_size > 0) { nread = read(flash, buf, FLASH_BUF_SIZE); Modified: stable/7/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/7/usr.sbin/mfiutil/mfiutil.8 Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfiutil.8 Tue Jan 25 20:44:24 2011 (r217841) @@ -254,7 +254,7 @@ The default locale is The available locales are .Dq volume , .Dq drive , -.Dq enclousure , +.Dq enclosure , .Dq battery , .Dq sas , .Dq controller , @@ -503,7 +503,7 @@ Enable periodic patrol reads initiated b The optional .Ar interval argument specifies the interval in seconds between patrol reads. -If patrol reads should be run continously, +If patrol reads should be run continuously, then .Ar interval should consist of the word From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 20:49:25 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5820B1065673; Tue, 25 Jan 2011 20:49:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473BA8FC18; Tue, 25 Jan 2011 20:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKnPFT050045; Tue, 25 Jan 2011 20:49:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKnPKn050042; Tue, 25 Jan 2011 20:49:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252049.p0PKnPKn050042@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217844 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:49:25 -0000 Author: jhb Date: Tue Jan 25 20:49:24 2011 New Revision: 217844 URL: http://svn.freebsd.org/changeset/base/217844 Log: MFC 215540: Set various POSIX capability sysctls to the version of the API that is supported rather than 1. They are supposed to return a suitable value for sysconf(3). While here, make the fsync sysctl match . Modified: stable/7/sys/kern/p1003_1b.c stable/7/sys/kern/posix4_mib.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/p1003_1b.c ============================================================================== --- stable/7/sys/kern/p1003_1b.c Tue Jan 25 20:48:48 2011 (r217843) +++ stable/7/sys/kern/p1003_1b.c Tue Jan 25 20:49:24 2011 (r217844) @@ -102,7 +102,7 @@ sched_attach(void) int ret = ksched_attach(&ksched); if (ret == 0) - p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 1); + p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 200112L); return ret; } Modified: stable/7/sys/kern/posix4_mib.c ============================================================================== --- stable/7/sys/kern/posix4_mib.c Tue Jan 25 20:48:48 2011 (r217843) +++ stable/7/sys/kern/posix4_mib.c Tue Jan 25 20:49:24 2011 (r217844) @@ -134,9 +134,10 @@ p31b_iscfg(int num) static void p31b_set_standard(void *dummy) { - /* ??? p31b_setcfg(CTL_P1003_1B_FSYNC, 1); */ - p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 1); - p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 1); + + p31b_setcfg(CTL_P1003_1B_FSYNC, 200112L); + p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 200112L); + p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 200112L); p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); if (!p31b_iscfg(CTL_P1003_1B_AIO_LISTIO_MAX)) p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, -1); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 20:54:30 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B48106566B; Tue, 25 Jan 2011 20:54:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F9C8FC1F; Tue, 25 Jan 2011 20:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKsTdh050254; Tue, 25 Jan 2011 20:54:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKsTE8050252; Tue, 25 Jan 2011 20:54:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252054.p0PKsTE8050252@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217846 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:54:30 -0000 Author: jhb Date: Tue Jan 25 20:54:29 2011 New Revision: 217846 URL: http://svn.freebsd.org/changeset/base/217846 Log: MFC 215541: Set the POSIX semaphore capability when the semaphore module is enabled. Modified: stable/7/sys/kern/uipc_sem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/uipc_sem.c ============================================================================== --- stable/7/sys/kern/uipc_sem.c Tue Jan 25 20:54:15 2011 (r217845) +++ stable/7/sys/kern/uipc_sem.c Tue Jan 25 20:54:29 2011 (r217846) @@ -869,6 +869,7 @@ ksem_module_init(void) mtx_init(&ksem_count_lock, "ksem count", NULL, MTX_DEF); sx_init(&ksem_dict_lock, "ksem dictionary"); ksem_dictionary = hashinit(1024, M_KSEM, &ksem_hash); + p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 200112L); p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); @@ -900,6 +901,7 @@ ksem_module_destroy(void) SYSCALL_DEREGISTER(ksem_getvalue); SYSCALL_DEREGISTER(ksem_destroy); + p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 0); hashdestroy(ksem_dictionary, M_KSEM, ksem_hash); sx_destroy(&ksem_dict_lock); mtx_destroy(&ksem_count_lock); From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 21:51:32 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9B110657C8; Tue, 25 Jan 2011 21:51:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9A68FC19; Tue, 25 Jan 2011 21:51:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PLpWmc052009; Tue, 25 Jan 2011 21:51:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PLpWYd052007; Tue, 25 Jan 2011 21:51:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101252151.p0PLpWYd052007@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 25 Jan 2011 21:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217854 - stable/7/lib/libc/sys X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:51:33 -0000 Author: jilles Date: Tue Jan 25 21:51:32 2011 New Revision: 217854 URL: http://svn.freebsd.org/changeset/base/217854 Log: MFC r217484: mknod(2): The required include is , not . This is what SUSv4 requires, and also the only thing that works if strict standards compliance is requested. PR: standards/123688 Submitted by: gcooper Modified: stable/7/lib/libc/sys/mknod.2 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sys/mknod.2 ============================================================================== --- stable/7/lib/libc/sys/mknod.2 Tue Jan 25 21:45:00 2011 (r217853) +++ stable/7/lib/libc/sys/mknod.2 Tue Jan 25 21:51:32 2011 (r217854) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -37,7 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Sh DESCRIPTION From owner-svn-src-stable-7@FreeBSD.ORG Tue Jan 25 22:08:44 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1098E1065696; Tue, 25 Jan 2011 22:08:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F19098FC36; Tue, 25 Jan 2011 22:08:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PM8hMp052747; Tue, 25 Jan 2011 22:08:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PM8hN7052738; Tue, 25 Jan 2011 22:08:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252208.p0PM8hN7052738@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 22:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217856 - in stable/7/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 pc98/pc98 powerpc/powerpc sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:08:44 -0000 Author: jhb Date: Tue Jan 25 22:08:43 2011 New Revision: 217856 URL: http://svn.freebsd.org/changeset/base/217856 Log: MFC 214835: Adjust the order of operations in spinlock_enter() and spinlock_exit() to work properly with single-stepping in a kernel debugger. Modified: stable/7/sys/amd64/amd64/machdep.c stable/7/sys/arm/arm/machdep.c stable/7/sys/i386/i386/machdep.c stable/7/sys/ia64/ia64/machdep.c stable/7/sys/pc98/pc98/machdep.c stable/7/sys/powerpc/powerpc/machdep.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sun4v/sun4v/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/amd64/amd64/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -1405,11 +1405,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -1417,12 +1421,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } /* Modified: stable/7/sys/arm/arm/machdep.c ============================================================================== --- stable/7/sys/arm/arm/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/arm/arm/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -475,11 +475,15 @@ void spinlock_enter(void) { struct thread *td; + register_t cspr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_cspr = disable_interrupts(I32_bit | F32_bit); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + cspr = disable_interrupts(I32_bit | F32_bit); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_cspr = cspr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -487,12 +491,14 @@ void spinlock_exit(void) { struct thread *td; + register_t cspr; td = curthread; critical_exit(); + cspr = td->td_md.md_saved_cspr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - restore_interrupts(td->td_md.md_saved_cspr); + restore_interrupts(cspr); } /* Modified: stable/7/sys/i386/i386/machdep.c ============================================================================== --- stable/7/sys/i386/i386/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/i386/i386/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -2440,11 +2440,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -2452,12 +2456,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: stable/7/sys/ia64/ia64/machdep.c ============================================================================== --- stable/7/sys/ia64/ia64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/ia64/ia64/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -410,11 +410,15 @@ void spinlock_enter(void) { struct thread *td; + int intr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_intr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + intr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_intr = intr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -422,12 +426,14 @@ void spinlock_exit(void) { struct thread *td; + int intr; td = curthread; critical_exit(); + intr = td->td_md.md_saved_intr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_intr); + intr_restore(intr); } void Modified: stable/7/sys/pc98/pc98/machdep.c ============================================================================== --- stable/7/sys/pc98/pc98/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/pc98/pc98/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -2179,11 +2179,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -2191,12 +2195,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: stable/7/sys/powerpc/powerpc/machdep.c ============================================================================== --- stable/7/sys/powerpc/powerpc/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/powerpc/powerpc/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -942,11 +942,15 @@ void spinlock_enter(void) { struct thread *td; + register_t msr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_msr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + msr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_msr = msr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -954,12 +958,14 @@ void spinlock_exit(void) { struct thread *td; + register_t msr; td = curthread; critical_exit(); + msr = td->td_md.md_saved_msr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_msr); + intr_restore(msr); } /* Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/sparc64/sparc64/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -222,9 +222,10 @@ spinlock_enter(void) if (td->td_md.md_spinlock_count == 0) { pil = rdpr(pil); wrpr(pil, 0, PIL_TICK); + td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; - } - td->td_md.md_spinlock_count++; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -232,12 +233,14 @@ void spinlock_exit(void) { struct thread *td; + register_t pil; td = curthread; critical_exit(); + pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - wrpr(pil, td->td_md.md_saved_pil, 0); + wrpr(pil, pil, 0); } static phandle_t Modified: stable/7/sys/sun4v/sun4v/machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/sun4v/sun4v/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -267,9 +267,10 @@ spinlock_enter(void) td = curthread; if (td->td_md.md_spinlock_count == 0) { pil = intr_disable(); + td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; - } - td->td_md.md_spinlock_count++; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -277,14 +278,14 @@ void spinlock_exit(void) { struct thread *td; + register_t pil; td = curthread; critical_exit(); + pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) { - intr_restore(td->td_md.md_saved_pil); - } - + if (td->td_md.md_spinlock_count == 0) + intr_restore(pil); } unsigned From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 26 20:09:08 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96721065679; Wed, 26 Jan 2011 20:09:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DEEB8FC13; Wed, 26 Jan 2011 20:09:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QK98hc088218; Wed, 26 Jan 2011 20:09:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QK986U088215; Wed, 26 Jan 2011 20:09:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262009.p0QK986U088215@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217898 - in stable/7/sys/dev: aac mfi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:09:08 -0000 Author: jhb Date: Wed Jan 26 20:09:08 2011 New Revision: 217898 URL: http://svn.freebsd.org/changeset/base/217898 Log: MFC 216235,216236: When masking direct and processor devices during an inquiry, properly preserve the upper bits of the first data byte. Modified: stable/7/sys/dev/aac/aac_cam.c stable/7/sys/dev/mfi/mfi_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac_cam.c ============================================================================== --- stable/7/sys/dev/aac/aac_cam.c Wed Jan 26 20:08:53 2011 (r217897) +++ stable/7/sys/dev/aac/aac_cam.c Wed Jan 26 20:09:08 2011 (r217898) @@ -539,7 +539,8 @@ aac_cam_complete(struct aac_command *cm) (device == T_PROCESSOR) || (sc->flags & AAC_FLAGS_CAM_PASSONLY)) ccb->csio.data_ptr[0] = - ((device & 0xe0) | T_NODEVICE); + ((ccb->csio.data_ptr[0] & 0xe0) | + T_NODEVICE); } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && ccb->ccb_h.target_lun != 0) { /* fix for INQUIRYs on Lun>0 */ Modified: stable/7/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/7/sys/dev/mfi/mfi_cam.c Wed Jan 26 20:08:53 2011 (r217897) +++ stable/7/sys/dev/mfi/mfi_cam.c Wed Jan 26 20:09:08 2011 (r217898) @@ -340,14 +340,14 @@ mfip_done(struct mfi_command *cm) ccbh->status = CAM_REQ_CMP; csio->scsi_status = pt->header.scsi_status; if (ccbh->flags & CAM_CDB_POINTER) - command = ccb->csio.cdb_io.cdb_ptr[0]; + command = csio->cdb_io.cdb_ptr[0]; else - command = ccb->csio.cdb_io.cdb_bytes[0]; + command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { - device = ccb->csio.data_ptr[0] & 0x1f; + device = csio->data_ptr[0] & 0x1f; if ((device == T_DIRECT) || (device == T_PROCESSOR)) csio->data_ptr[0] = - (device & 0xe0) | T_NODEVICE; + (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } break; } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 26 20:14:12 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DC31065670; Wed, 26 Jan 2011 20:14:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568AD8FC21; Wed, 26 Jan 2011 20:14:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKECik088425; Wed, 26 Jan 2011 20:14:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKECiT088423; Wed, 26 Jan 2011 20:14:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262014.p0QKECiT088423@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217900 - stable/7/lib/libc/stdio X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:14:12 -0000 Author: jhb Date: Wed Jan 26 20:14:12 2011 New Revision: 217900 URL: http://svn.freebsd.org/changeset/base/217900 Log: MFC 216334: When reopening a stream backed by an open file descriptor, do not close the existing file descriptor. Instead, let dup2() atomically close the old file descriptor when assigning the newly opened file to the same descriptor. This closes a race in a multithreaded application where a concurrent open() could allocate the existing file descriptor in between the calls to close() and dup2(). Modified: stable/7/lib/libc/stdio/freopen.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdio/freopen.c ============================================================================== --- stable/7/lib/libc/stdio/freopen.c Wed Jan 26 20:14:03 2011 (r217899) +++ stable/7/lib/libc/stdio/freopen.c Wed Jan 26 20:14:12 2011 (r217900) @@ -150,14 +150,6 @@ freopen(file, mode, fp) /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); - if (f < 0 && isopen) { - /* If out of fd's close the old one and try again. */ - if (errno == ENFILE || errno == EMFILE) { - (void) (*fp->_close)(fp->_cookie); - isopen = 0; - f = _open(file, oflags, DEFFILEMODE); - } - } sverrno = errno; finish: @@ -165,9 +157,11 @@ finish: * Finish closing fp. Even if the open succeeded above, we cannot * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. + * + * Leave the existing file descriptor open until dup2() is called + * below to avoid races where a concurrent open() in another thread + * could claim the existing descriptor. */ - if (isopen) - (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); fp->_w = 0; @@ -186,6 +180,8 @@ finish: memset(&fp->_extra->mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ @@ -197,11 +193,12 @@ finish: * to maintain the descriptor. Various C library routines (perror) * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ - if (wantfd >= 0 && f != wantfd) { + if (wantfd >= 0) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; - } + } else + (void)_close(fp->_file); } /* From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 26 20:26:58 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81FB5106564A; Wed, 26 Jan 2011 20:26:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713F58FC1F; Wed, 26 Jan 2011 20:26:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKQwQh088975; Wed, 26 Jan 2011 20:26:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKQw4g088973; Wed, 26 Jan 2011 20:26:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262026.p0QKQw4g088973@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217904 - stable/7/sys/dev/pci X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:26:58 -0000 Author: jhb Date: Wed Jan 26 20:26:58 2011 New Revision: 217904 URL: http://svn.freebsd.org/changeset/base/217904 Log: MFC 216590: Don't whine about child drivers calling pci_enable_busmaster(). That is perfectly normal. Modified: stable/7/sys/dev/pci/vga_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/pci/vga_pci.c ============================================================================== --- stable/7/sys/dev/pci/vga_pci.c Wed Jan 26 20:26:46 2011 (r217903) +++ stable/7/sys/dev/pci/vga_pci.c Wed Jan 26 20:26:58 2011 (r217904) @@ -222,8 +222,6 @@ static int vga_pci_enable_busmaster(device_t dev, device_t child) { - device_printf(dev, "child %s requested pci_enable_busmaster\n", - device_get_nameunit(child)); return (pci_enable_busmaster(dev)); } @@ -231,8 +229,6 @@ static int vga_pci_disable_busmaster(device_t dev, device_t child) { - device_printf(dev, "child %s requested pci_disable_busmaster\n", - device_get_nameunit(child)); return (pci_disable_busmaster(dev)); } From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 26 20:29:28 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7E221065673; Wed, 26 Jan 2011 20:29:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C71C08FC0C; Wed, 26 Jan 2011 20:29:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKTSCv089121; Wed, 26 Jan 2011 20:29:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKTSQl089119; Wed, 26 Jan 2011 20:29:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262029.p0QKTSQl089119@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217906 - stable/7/sys/netinet X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:29:29 -0000 Author: jhb Date: Wed Jan 26 20:29:28 2011 New Revision: 217906 URL: http://svn.freebsd.org/changeset/base/217906 Log: MFC 216621: Fix a typo in a comment. Modified: stable/7/sys/netinet/tcp_timer.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_timer.c ============================================================================== --- stable/7/sys/netinet/tcp_timer.c Wed Jan 26 20:29:11 2011 (r217905) +++ stable/7/sys/netinet/tcp_timer.c Wed Jan 26 20:29:28 2011 (r217906) @@ -485,7 +485,7 @@ tcp_timer_rexmt(void * xtp) TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* - * Disable rfc1323 if we havn't got any response to + * Disable rfc1323 if we haven't got any response to * our third SYN to work-around some broken terminal servers * (most of which have hopefully been retired) that have bad VJ * header compression code which trashes TCP segments containing From owner-svn-src-stable-7@FreeBSD.ORG Wed Jan 26 20:36:21 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EAF71065672; Wed, 26 Jan 2011 20:36:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CFDC8FC13; Wed, 26 Jan 2011 20:36:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKaKDB089439; Wed, 26 Jan 2011 20:36:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKaKf1089435; Wed, 26 Jan 2011 20:36:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262036.p0QKaKf1089435@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217909 - in stable/7/sys/dev: if_ndis mpt X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:36:21 -0000 Author: jhb Date: Wed Jan 26 20:36:20 2011 New Revision: 217909 URL: http://svn.freebsd.org/changeset/base/217909 Log: MFC 216486,216764: Use bus_alloc_resource_any() instead of bus_alloc_resource(). Modified: stable/7/sys/dev/if_ndis/if_ndis_pccard.c stable/7/sys/dev/if_ndis/if_ndis_pci.c stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- stable/7/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 26 20:36:04 2011 (r217908) +++ stable/7/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 26 20:36:20 2011 (r217909) @@ -195,9 +195,8 @@ ndis_attach_pccard(dev) resource_list_init(&sc->ndis_rl); sc->ndis_io_rid = 0; - sc->ndis_res_io = bus_alloc_resource(dev, - SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->ndis_io_rid, RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -210,8 +209,7 @@ ndis_attach_pccard(dev) rman_get_size(sc->ndis_res_io)); rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, Modified: stable/7/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- stable/7/sys/dev/if_ndis/if_ndis_pci.c Wed Jan 26 20:36:04 2011 (r217908) +++ stable/7/sys/dev/if_ndis/if_ndis_pci.c Wed Jan 26 20:36:20 2011 (r217909) @@ -195,9 +195,9 @@ ndis_attach_pci(dev) switch (rle->type) { case SYS_RES_IOPORT: sc->ndis_io_rid = rle->rid; - sc->ndis_res_io = bus_alloc_resource(dev, + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -217,10 +217,10 @@ ndis_attach_pci(dev) if (sc->ndis_res_mem) { sc->ndis_altmem_rid = rle->rid; sc->ndis_res_altmem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_altmem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_altmem == NULL) { device_printf(dev, "couldn't map alt " @@ -231,10 +231,10 @@ ndis_attach_pci(dev) } else { sc->ndis_mem_rid = rle->rid; sc->ndis_res_mem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_mem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_mem == NULL) { device_printf(dev, "couldn't map memory\n"); @@ -246,9 +246,9 @@ ndis_attach_pci(dev) break; case SYS_RES_IRQ: rid = rle->rid; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); @@ -273,8 +273,8 @@ ndis_attach_pci(dev) */ if (sc->ndis_irq == NULL) { rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't route interrupt\n"); error = ENXIO; Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Wed Jan 26 20:36:04 2011 (r217908) +++ stable/7/sys/dev/mpt/mpt_pci.c Wed Jan 26 20:36:20 2011 (r217909) @@ -510,8 +510,8 @@ mpt_pci_attach(device_t dev) * some cards otherwise). */ mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); - mpt->pci_pio_reg = bus_alloc_resource(dev, SYS_RES_IOPORT, - &mpt->pci_pio_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { device_printf(dev, "unable to map registers in PIO mode\n"); goto bad; @@ -521,8 +521,8 @@ mpt_pci_attach(device_t dev) /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); - mpt->pci_reg = bus_alloc_resource(dev, SYS_RES_MEMORY, - &mpt->pci_mem_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { device_printf(dev, "Unable to memory map registers.\n"); if (mpt->is_sas) { From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 09:01:44 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 850331065696; Thu, 27 Jan 2011 09:01:44 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BD798FC15; Thu, 27 Jan 2011 09:01:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R91iZL007683; Thu, 27 Jan 2011 09:01:44 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R91it4007680; Thu, 27 Jan 2011 09:01:44 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101270901.p0R91it4007680@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 09:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217928 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:01:44 -0000 Author: cperciva Date: Thu Jan 27 09:01:44 2011 New Revision: 217928 URL: http://svn.freebsd.org/changeset/base/217928 Log: MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). Modified: stable/7/share/man/man4/nfe.4 stable/7/share/man/man4/re.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/nfe.4 ============================================================================== --- stable/7/share/man/man4/nfe.4 Thu Jan 27 09:01:00 2011 (r217927) +++ stable/7/share/man/man4/nfe.4 Thu Jan 27 09:01:44 2011 (r217928) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Thu Jan 27 09:01:00 2011 (r217927) +++ stable/7/share/man/man4/re.4 Thu Jan 27 09:01:44 2011 (r217928) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 18:34:06 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C6E1065697; Thu, 27 Jan 2011 18:34:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2966E8FC22; Thu, 27 Jan 2011 18:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIY6nR028395; Thu, 27 Jan 2011 18:34:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIY6Ui028392; Thu, 27 Jan 2011 18:34:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271834.p0RIY6Ui028392@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217949 - in stable/7/sys/dev: alc jme X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:34:06 -0000 Author: yongari Date: Thu Jan 27 18:34:05 2011 New Revision: 217949 URL: http://svn.freebsd.org/changeset/base/217949 Log: MFC r216362: Remove unecessary and clearly wrong usage of atomic(9). Modified: stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/jme/if_jme.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Thu Jan 27 18:31:07 2011 (r217948) +++ stable/7/sys/dev/alc/if_alc.c Thu Jan 27 18:34:05 2011 (r217949) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2668,9 +2667,10 @@ alc_int_task(void *arg, int pending) ifp = sc->alc_ifp; status = CSR_READ_4(sc, ALC_INTR_STATUS); - more = atomic_readandclear_int(&sc->alc_morework); - if (more != 0) + if (sc->alc_morework != 0) { + sc->alc_morework = 0; status |= INTR_RX_PKT; + } if ((status & ALC_INTRS) == 0) goto done; @@ -2682,7 +2682,7 @@ alc_int_task(void *arg, int pending) if ((status & INTR_RX_PKT) != 0) { more = alc_rxintr(sc, sc->alc_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->alc_morework, 1); + sc->alc_morework = 1; else if (more == EIO) { ALC_LOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:31:07 2011 (r217948) +++ stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:34:05 2011 (r217949) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2189,7 +2188,7 @@ jme_link_task(void *arg, int pending) * procuder/consumer index. */ sc->jme_cdata.jme_rx_cons = 0; - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; jme_init_tx_ring(sc); /* Initialize shadow status block. */ jme_init_ssb(sc); @@ -2259,10 +2258,9 @@ jme_int_task(void *arg, int pending) ifp = sc->jme_ifp; status = CSR_READ_4(sc, JME_INTR_STATUS); - more = atomic_readandclear_int(&sc->jme_morework); - if (more != 0) { + if (sc->jme_morework != 0) { + sc->jme_morework = 0; status |= INTR_RXQ_COAL | INTR_RXQ_COAL_TO; - more = 0; } if ((status & JME_INTRS) == 0 || status == 0xFFFFFFFF) goto done; @@ -2278,7 +2276,7 @@ jme_int_task(void *arg, int pending) if ((status & (INTR_RXQ_COAL | INTR_RXQ_COAL_TO)) != 0) { more = jme_rxintr(sc, sc->jme_process_limit); if (more != 0) - atomic_set_int(&sc->jme_morework, 1); + sc->jme_morework = 1; } if ((status & INTR_RXQ_DESC_EMPTY) != 0) { /* @@ -2988,7 +2986,7 @@ jme_init_rx_ring(struct jme_softc *sc) sc->jme_cdata.jme_rx_cons = 0; JME_RXCHAIN_RESET(sc); - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; rd = &sc->jme_rdata; bzero(rd->jme_rx_ring, JME_RX_RING_SIZE); From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 18:38:48 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C7B7106566B; Thu, 27 Jan 2011 18:38:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4B28FC1B; Thu, 27 Jan 2011 18:38:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIcmJH028727; Thu, 27 Jan 2011 18:38:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIcm9l028725; Thu, 27 Jan 2011 18:38:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271838.p0RIcm9l028725@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217951 - stable/7/sys/dev/ale X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:38:48 -0000 Author: yongari Date: Thu Jan 27 18:38:48 2011 New Revision: 217951 URL: http://svn.freebsd.org/changeset/base/217951 Log: MFC r216438: Remove unecessary and clearly wrong usage of atomic(9). Modified: stable/7/sys/dev/ale/if_ale.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Thu Jan 27 18:37:10 2011 (r217950) +++ stable/7/sys/dev/ale/if_ale.c Thu Jan 27 18:38:48 2011 (r217951) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2284,8 +2283,7 @@ ale_int_task(void *arg, int pending) sc = (struct ale_softc *)arg; status = CSR_READ_4(sc, ALE_INTR_STATUS); - more = atomic_readandclear_int(&sc->ale_morework); - if (more != 0) + if (sc->ale_morework != 0) status |= INTR_RX_PKT; if ((status & ALE_INTRS) == 0) goto done; @@ -2298,7 +2296,7 @@ ale_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { more = ale_rxeof(sc, sc->ale_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->ale_morework, 1); + sc->ale_morework = 1; else if (more == EIO) { ALE_LOCK(sc); sc->ale_stats.reset_brk_seq++; @@ -3002,7 +3000,7 @@ ale_init_rx_pages(struct ale_softc *sc) ALE_LOCK_ASSERT(sc); - atomic_set_int(&sc->ale_morework, 0); + sc->ale_morework = 0; sc->ale_cdata.ale_rx_seqno = 0; sc->ale_cdata.ale_rx_curp = 0; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 18:46:26 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76317106566B; Thu, 27 Jan 2011 18:46:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648888FC19; Thu, 27 Jan 2011 18:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIkQd3029278; Thu, 27 Jan 2011 18:46:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIkQf9029275; Thu, 27 Jan 2011 18:46:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271846.p0RIkQf9029275@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217953 - stable/7/sys/dev/jme X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:46:26 -0000 Author: yongari Date: Thu Jan 27 18:46:26 2011 New Revision: 217953 URL: http://svn.freebsd.org/changeset/base/217953 Log: MFC r216546,216548-216550: r216546: Consistently put a tab character between #define and the macro name. r216548: Fix a regression introduced in r213893. FPGA version requires PHY probing so allow PHY probing on all possible addresses. r216549: Make sure whether driver allocated resource before releasing it. r216550: Use system defined PCIR_EXPRESS_DEVICE_CTL instead of using magic number. Modified: stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:44:05 2011 (r217952) +++ stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:46:26 2011 (r217953) @@ -683,7 +683,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_extcap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + 0x08, 2); + burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); @@ -738,8 +738,9 @@ jme_attach(device_t dev) /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, - jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, - MIIF_DOPAUSE); + jme_mediastatus, BMSR_DEFCAPMASK, + sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, + MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -861,10 +862,12 @@ jme_detach(device_t dev) } } - bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); + if (sc->jme_irq[0] != NULL) + bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); if ((sc->jme_flags & (JME_FLAG_MSIX | JME_FLAG_MSI)) != 0) pci_release_msi(dev); - bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); + if (sc->jme_res[0] != NULL) + bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); mtx_destroy(&sc->jme_mtx); return (0); Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 18:44:05 2011 (r217952) +++ stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 18:46:26 2011 (r217953) @@ -66,8 +66,8 @@ * JMC250 can send 9K jumbo frame on Tx path and can receive * 65535 bytes. */ -#define JME_JUMBO_FRAMELEN 9216 -#define JME_JUMBO_MTU \ +#define JME_JUMBO_FRAMELEN 9216 +#define JME_JUMBO_MTU \ (JME_JUMBO_FRAMELEN - sizeof(struct ether_vlan_header) - \ ETHER_HDR_LEN - ETHER_CRC_LEN) #define JME_MAX_MTU \ @@ -143,14 +143,14 @@ struct jme_ring_data { bus_addr_t jme_ssb_block_paddr; }; -#define JME_TX_RING_ADDR(sc, i) \ +#define JME_TX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_tx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_RX_RING_ADDR(sc, i) \ +#define JME_RX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_rx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_TX_RING_SIZE \ +#define JME_TX_RING_SIZE \ (sizeof(struct jme_desc) * JME_TX_RING_CNT) -#define JME_RX_RING_SIZE \ +#define JME_RX_RING_SIZE \ (sizeof(struct jme_desc) * JME_RX_RING_CNT) #define JME_SSB_SIZE sizeof(struct jme_ssb) @@ -223,14 +223,14 @@ struct jme_softc { }; /* Register access macros. */ -#define CSR_WRITE_4(_sc, reg, val) \ +#define CSR_WRITE_4(_sc, reg, val) \ bus_write_4((_sc)->jme_res[0], (reg), (val)) -#define CSR_READ_4(_sc, reg) \ +#define CSR_READ_4(_sc, reg) \ bus_read_4((_sc)->jme_res[0], (reg)) -#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) -#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) -#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) +#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) +#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) +#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) #define JME_MAXERR 5 @@ -242,8 +242,8 @@ do { \ } while (0) #define JME_TX_TIMEOUT 5 -#define JME_TIMEOUT 1000 -#define JME_PHY_TIMEOUT 1000 -#define JME_EEPROM_TIMEOUT 1000 +#define JME_TIMEOUT 1000 +#define JME_PHY_TIMEOUT 1000 +#define JME_EEPROM_TIMEOUT 1000 #endif From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:04:18 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37173106566B; Thu, 27 Jan 2011 19:04:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 247948FC22; Thu, 27 Jan 2011 19:04:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJ4Ioe030199; Thu, 27 Jan 2011 19:04:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJ4IlZ030193; Thu, 27 Jan 2011 19:04:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271904.p0RJ4IlZ030193@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217955 - in stable/7/sys/dev: jme mii X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:04:18 -0000 Author: yongari Date: Thu Jan 27 19:04:17 2011 New Revision: 217955 URL: http://svn.freebsd.org/changeset/base/217955 Log: MFC r216551: Add support for JMicron JMC251/JMC261 Gigabit/Fast ethernet controller with Card Read Host Controller. These controllers are multi-function devices and have the same ethernet core of JMC250/JMC260. Starting from REVFM 5(chip full mask revision) controllers have the following features. o eFuse support o PCD(Packet Completion Deferring) o More advanced PHY power saving Because these controllers started to use eFuse, station address modified by driver is permanent as if it was written to EEPROM. If you have to change station address please save your controller default address to safe place before reprogramming it. There is no way to restore factory default station address. Many thanks to JMicron for continuing to support FreeBSD. HW donated by: JMicron Modified: stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h stable/7/sys/dev/jme/if_jmevar.h stable/7/sys/dev/mii/jmphy.c stable/7/sys/dev/mii/jmphyreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/jme/if_jme.c Thu Jan 27 19:04:17 2011 (r217955) @@ -97,9 +97,9 @@ static struct jme_dev { const char *jme_name; } jme_devs[] = { { VENDORID_JMICRON, DEVICEID_JMC250, - "JMicron Inc, JMC250 Gigabit Ethernet" }, + "JMicron Inc, JMC25x Gigabit Ethernet" }, { VENDORID_JMICRON, DEVICEID_JMC260, - "JMicron Inc, JMC260 Fast Ethernet" }, + "JMicron Inc, JMC26x Fast Ethernet" }, }; static int jme_miibus_readreg(device_t, int, int); @@ -110,7 +110,9 @@ static int jme_mediachange(struct ifnet static int jme_probe(device_t); static int jme_eeprom_read_byte(struct jme_softc *, uint8_t, uint8_t *); static int jme_eeprom_macaddr(struct jme_softc *); +static int jme_efuse_macaddr(struct jme_softc *); static void jme_reg_macaddr(struct jme_softc *); +static void jme_set_macaddr(struct jme_softc *, uint8_t *); static void jme_map_intr_vector(struct jme_softc *); static int jme_attach(device_t); static int jme_detach(device_t); @@ -152,6 +154,8 @@ static void jme_set_filter(struct jme_so static void jme_stats_clear(struct jme_softc *); static void jme_stats_save(struct jme_softc *); static void jme_stats_update(struct jme_softc *); +static void jme_phy_down(struct jme_softc *); +static void jme_phy_up(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -432,6 +436,55 @@ jme_eeprom_macaddr(struct jme_softc *sc) return (ENOENT); } +static int +jme_efuse_macaddr(struct jme_softc *sc) +{ + uint32_t reg; + int i; + + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | EFUSE_CTL1_AUTOLAOD_DONE)) != + EFUSE_CTL1_AUTOLAOD_DONE) + return (ENOENT); + /* Reset eFuse controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg |= EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg &= ~EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + + /* Have eFuse reload station address to MAC controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + reg &= ~EFUSE_CTL1_CMD_MASK; + reg |= EFUSE_CTL1_CMD_AUTOLOAD | EFUSE_CTL1_EXECUTE; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL1, reg, 4); + + /* + * Verify completion of eFuse autload command. It should be + * completed within 108us. + */ + DELAY(110); + for (i = 10; i > 0; i--) { + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | + EFUSE_CTL1_AUTOLAOD_DONE)) != EFUSE_CTL1_AUTOLAOD_DONE) { + DELAY(20); + continue; + } + if ((reg & EFUSE_CTL1_EXECUTE) == 0) + break; + /* Station address loading is still in progress. */ + DELAY(20); + } + if (i == 0) { + device_printf(sc->jme_dev, "eFuse autoload timed out.\n"); + return (ETIMEDOUT); + } + + return (0); +} + static void jme_reg_macaddr(struct jme_softc *sc) { @@ -454,6 +507,13 @@ jme_reg_macaddr(struct jme_softc *sc) sc->jme_eaddr[4] = (par0 >> 8) & 0xff; sc->jme_eaddr[5] = par0 & 0xff; } else { + /* + * For controllers that use eFuse, the station address + * could also be extracted from JME_PCI_PAR0 and + * JME_PCI_PAR1 registers in PCI configuration space. + * Each register holds exactly half of station address(24bits) + * so use JME_PAR0, JME_PAR1 registers instead. + */ sc->jme_eaddr[0] = (par0 >> 0) & 0xFF; sc->jme_eaddr[1] = (par0 >> 8) & 0xFF; sc->jme_eaddr[2] = (par0 >> 16) & 0xFF; @@ -464,6 +524,42 @@ jme_reg_macaddr(struct jme_softc *sc) } static void +jme_set_macaddr(struct jme_softc *sc, uint8_t *eaddr) +{ + uint32_t val; + int i; + + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + /* + * Avoid reprogramming station address if the address + * is the same as previous one. Note, reprogrammed + * station address is permanent as if it was written + * to EEPROM. So if station address was changed by + * admistrator it's possible to lose factory configured + * address when driver fails to restore its address. + * (e.g. reboot or system crash) + */ + if (bcmp(eaddr, sc->jme_eaddr, ETHER_ADDR_LEN) != 0) { + for (i = 0; i < ETHER_ADDR_LEN; i++) { + val = JME_EFUSE_EEPROM_FUNC0 << + JME_EFUSE_EEPROM_FUNC_SHIFT; + val |= JME_EFUSE_EEPROM_PAGE_BAR1 << + JME_EFUSE_EEPROM_PAGE_SHIFT; + val |= (JME_PAR0 + i) << + JME_EFUSE_EEPROM_ADDR_SHIFT; + val |= eaddr[i] << JME_EFUSE_EEPROM_DATA_SHIFT; + pci_write_config(sc->jme_dev, JME_EFUSE_EEPROM, + val | JME_EFUSE_EEPROM_WRITE, 4); + } + } + } else { + CSR_WRITE_4(sc, JME_PAR0, + eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); + CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + } +} + +static void jme_map_intr_vector(struct jme_softc *sc) { uint32_t map[MSINUM_NUM_INTR_SOURCE / JME_MSI_MESSAGES]; @@ -542,7 +638,7 @@ jme_attach(device_t dev) struct mii_data *mii; uint32_t reg; uint16_t burst; - int error, i, msic, msixc, pmc; + int error, i, mii_flags, msic, msixc, pmc; error = 0; sc = device_get_softc(dev); @@ -644,11 +740,14 @@ jme_attach(device_t dev) goto fail; } + /* Identify controller features and bugs. */ if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && CHIPMODE_REVFM(sc->jme_chip_rev) == 2) sc->jme_flags |= JME_FLAG_DMA32BIT; - sc->jme_flags |= JME_FLAG_TXCLK; + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + sc->jme_flags |= JME_FLAG_EFUSE | JME_FLAG_PCCPCD; + sc->jme_flags |= JME_FLAG_TXCLK | JME_FLAG_RXCLK; sc->jme_flags |= JME_FLAG_HWMIB; } @@ -656,14 +755,20 @@ jme_attach(device_t dev) jme_reset(sc); /* Get station address. */ - reg = CSR_READ_4(sc, JME_SMBCSR); - if ((reg & SMBCSR_EEPROM_PRESENT) != 0) - error = jme_eeprom_macaddr(sc); - if (error != 0 || (reg & SMBCSR_EEPROM_PRESENT) == 0) { - if (error != 0 && (bootverbose)) + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + error = jme_efuse_macaddr(sc); + if (error == 0) + jme_reg_macaddr(sc); + } else { + error = ENOENT; + reg = CSR_READ_4(sc, JME_SMBCSR); + if ((reg & SMBCSR_EEPROM_PRESENT) != 0) + error = jme_eeprom_macaddr(sc); + if (error != 0 && bootverbose) device_printf(sc->jme_dev, "ethernet hardware address not found in EEPROM.\n"); - jme_reg_macaddr(sc); + if (error != 0) + jme_reg_macaddr(sc); } /* @@ -736,11 +841,17 @@ jme_attach(device_t dev) } ifp->if_capenable = ifp->if_capabilities; + /* Wakeup PHY. */ + jme_phy_up(sc); + mii_flags = MIIF_DOPAUSE; + /* Ask PHY calibration to PHY driver. */ + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + mii_flags |= MIIF_MACPRIV0; /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, - MII_OFFSET_ANY, MIIF_DOPAUSE); + MII_OFFSET_ANY, mii_flags); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -833,6 +944,9 @@ jme_detach(device_t dev) taskqueue_drain(sc->jme_tq, &sc->jme_int_task); taskqueue_drain(sc->jme_tq, &sc->jme_tx_task); taskqueue_drain(taskqueue_swi, &sc->jme_link_task); + /* Restore possibly modified station address. */ + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) + jme_set_macaddr(sc, sc->jme_eaddr); ether_ifdetach(ifp); } @@ -1493,9 +1607,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) | GPREG1_RX_MAC_CLK_DIS); /* No PME capability, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); return; } @@ -1527,8 +1643,7 @@ jme_setwol(struct jme_softc *sc) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); if ((ifp->if_capenable & IFCAP_WOL) == 0) { /* No WOL, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); } } @@ -1566,6 +1681,8 @@ jme_resume(device_t dev) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } + /* Wakeup PHY. */ + jme_phy_up(sc); ifp = sc->jme_ifp; if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -2218,6 +2335,13 @@ jme_link_task(void *arg, int pending) CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr | RXCSR_RX_ENB | RXCSR_RXQ_START); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr | TXCSR_TX_ENB); + /* Lastly enable TX/RX clock. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, + CSR_READ_4(sc, JME_GHC) & ~GHC_TX_MAC_CLK_DIS); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) & ~GPREG1_RX_MAC_CLK_DIS); } ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2596,13 +2720,45 @@ jme_tick(void *arg) static void jme_reset(struct jme_softc *sc) { + uint32_t ghc, gpreg; /* Stop receiver, transmitter. */ jme_stop_rx(sc); jme_stop_tx(sc); + + /* Reset controller. */ CSR_WRITE_4(sc, JME_GHC, GHC_RESET); + CSR_READ_4(sc, JME_GHC); + DELAY(10); + /* + * Workaround Rx FIFO overruns seen under certain conditions. + * Explicitly synchorize TX/RX clock. TX/RX clock should be + * enabled only after enabling TX/RX MACs. + */ + if ((sc->jme_flags & (JME_FLAG_TXCLK | JME_FLAG_RXCLK)) != 0) { + /* Disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_RESET | GHC_TX_MAC_CLK_DIS); + /* Disable RX clock. */ + gpreg = CSR_READ_4(sc, JME_GPREG1); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + gpreg = CSR_READ_4(sc, JME_GPREG1); + /* De-assert RESET but still disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + ghc = CSR_READ_4(sc, JME_GHC); + + /* Enable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, ghc & ~GHC_TX_MAC_CLK_DIS); + /* Enable RX clock. */ + CSR_WRITE_4(sc, JME_GPREG1, gpreg & ~GPREG1_RX_MAC_CLK_DIS); + CSR_READ_4(sc, JME_GPREG1); + + /* Disable TX/RX clock again. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + } else + CSR_WRITE_4(sc, JME_GHC, 0); + CSR_READ_4(sc, JME_GHC); DELAY(10); - CSR_WRITE_4(sc, JME_GHC, 0); } static void @@ -2621,7 +2777,6 @@ jme_init_locked(struct jme_softc *sc) { struct ifnet *ifp; struct mii_data *mii; - uint8_t eaddr[ETHER_ADDR_LEN]; bus_addr_t paddr; uint32_t reg; int error; @@ -2657,10 +2812,7 @@ jme_init_locked(struct jme_softc *sc) jme_init_ssb(sc); /* Reprogram the station address. */ - bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); - CSR_WRITE_4(sc, JME_PAR0, - eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); - CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + jme_set_macaddr(sc, IF_LLADDR(sc->jme_ifp)); /* * Configure Tx queue. @@ -2798,6 +2950,30 @@ jme_init_locked(struct jme_softc *sc) PCCRX_COAL_PKT_MASK; CSR_WRITE_4(sc, JME_PCCRX0, reg); + /* + * Configure PCD(Packet Completion Deferring). It seems PCD + * generates an interrupt when the time interval between two + * back-to-back incoming/outgoing packet is long enough for + * it to reach its timer value 0. The arrival of new packets + * after timer has started causes the PCD timer to restart. + * Unfortunately, it's not clear how PCD is useful at this + * moment, so just use the same of PCC parameters. + */ + if ((sc->jme_flags & JME_FLAG_PCCPCD) != 0) { + sc->jme_rx_pcd_to = sc->jme_rx_coal_to; + if (sc->jme_rx_coal_to > PCDRX_TO_MAX) + sc->jme_rx_pcd_to = PCDRX_TO_MAX; + sc->jme_tx_pcd_to = sc->jme_tx_coal_to; + if (sc->jme_tx_coal_to > PCDTX_TO_MAX) + sc->jme_tx_pcd_to = PCDTX_TO_MAX; + reg = sc->jme_rx_pcd_to << PCDRX0_TO_THROTTLE_SHIFT; + reg |= sc->jme_rx_pcd_to << PCDRX0_TO_SHIFT; + CSR_WRITE_4(sc, PCDRX_REG(0), reg); + reg = sc->jme_tx_pcd_to << PCDTX_TO_THROTTLE_SHIFT; + reg |= sc->jme_tx_pcd_to << PCDTX_TO_SHIFT; + CSR_WRITE_4(sc, JME_PCDTX, reg); + } + /* Configure shadow status block but don't enable posting. */ paddr = sc->jme_rdata.jme_ssb_block_paddr; CSR_WRITE_4(sc, JME_SHBASE_ADDR_HI, JME_ADDR_HI(paddr)); @@ -3203,6 +3379,43 @@ jme_stats_update(struct jme_softc *sc) stat->tx_bad_frames += ostat->tx_bad_frames; } +static void +jme_phy_down(struct jme_softc *sc) +{ + uint32_t reg; + + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg |= 0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_D3; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + +static void +jme_phy_up(struct jme_softc *sc) +{ + uint32_t reg; + uint16_t bmcr; + + bmcr = jme_miibus_readreg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR); + bmcr &= ~BMCR_PDOWN; + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, bmcr); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg &= ~0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_DIS; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/jme/if_jmereg.h Thu Jan 27 19:04:17 2011 (r217955) @@ -63,6 +63,10 @@ #define JME_PCI_DBG 0x9C +#define JME_PCI_PAR0 0xA4 /* JMC25x/JMC26x REVFM >= 5 */ + +#define JME_PCI_PAR1 0xA8 /* JMC25x/JMC26x REVFM >= 5 */ + #define JME_PCI_SPI 0xB0 #define SPI_ENB 0x00000010 @@ -71,6 +75,21 @@ #define SPI_SCK_CTRL 0x00000002 #define SPI_CS_N_CTRL 0x00000001 +#define JME_EFUSE_CTL1 0xB8 +#define EFUSE_CTL1_DATA_MASK 0xF0000000 +#define EFUSE_CTL1_EXECUTE 0x08000000 +#define EFUSE_CTL1_CMD_AUTOLOAD 0x02000000 +#define EFUSE_CTL1_CMD_READ 0x04000000 +#define EFUSE_CTL1_CMD_BLOW 0x06000000 +#define EFUSE_CTL1_CMD_MASK 0x06000000 +#define EFUSE_CTL1_AUTOLOAD_ERR 0x00010000 +#define EFUSE_CTL1_BYTE_SEL_MASK 0x0000FF00 +#define EFUSE_CTL1_BIT_SEL_MASK 0x00000070 +#define EFUSE_CTL1_AUTOLAOD_DONE 0x00000001 + +#define JME_EFUSE_CTL2 0xBC +#define EFUSE_CTL2_RESET 0x00008000 + #define JME_PCI_PHYCFG0 0xC0 #define JME_PCI_PHYCFG1 0xC4 @@ -86,7 +105,7 @@ /* PCIe link error/status. */ #define JME_PCI_LES 0xD8 -/* propeietary register 0. */ +/* Proprietary register 0. */ #define JME_PCI_PE0 0xE0 #define PE0_SPI_EXIST 0x00200000 #define PE0_PME_D0 0x00100000 @@ -115,7 +134,31 @@ #define PE0_PM_AUXC_MASK 0x00000007 #define PE0_PM_AUXC_DEF 0x00000007 +/* Proprietary register 1. */ #define JME_PCI_PE1 0xE4 +#define PE1_GIGA_PDOWN_MASK 0x0000C000 +#define PE1_GIGA_PDOWN_DIS 0x00000000 +#define PE1_GIGA_PDOWN_D3 0x00004000 +#define PE1_GIGA_PDOWN_PCIE_SHUTDOWN 0x00008000 +#define PE1_GIGA_PDOWN_PCIE_IDDQ 0x0000C000 + +#define JME_EFUSE_EEPROM 0xE8 +#define JME_EFUSE_EEPROM_WRITE 0x80000000 +#define JME_EFUSE_EEPROM_FUNC_MASK 0x70000000 +#define JME_EFUSE_EEPROM_PAGE_MASK 0x0F000000 +#define JME_EFUSE_EEPROM_ADDR_MASK 0x00FF0000 +#define JME_EFUSE_EEPROM_DATA_MASK 0x0000FF00 +#define JME_EFUSE_EEPROM_SMBSTAT_MASK 0x000000FF +#define JME_EFUSE_EEPROM_FUNC_SHIFT 28 +#define JME_EFUSE_EEPROM_PAGE_SHIFT 24 +#define JME_EFUSE_EEPROM_ADDR_SHIFT 16 +#define JME_EFUSE_EEPROM_DATA_SHIFT 8 +#define JME_EFUSE_EEPROM_SMBSTAT_SHIFT 0 + +#define JME_EFUSE_EEPROM_FUNC0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR1 1 +#define JME_EFUSE_EEPROM_PAGE_BAR2 2 #define JME_PCI_PHYTEST 0xF8 @@ -312,7 +355,7 @@ #define RXMAC_PAD_10BYTES 0x00000002 #define RXMAC_CSUM_ENB 0x00000001 -/* Rx unicast MAC address. */ +/* Rx unicast MAC address. Read-only on JMC25x/JMC26x REVFM >= 5 */ #define JME_PAR0 0x0038 #define JME_PAR1 0x003C @@ -455,6 +498,7 @@ #define JME_GIGARCHI 0x041C #define JME_GIGARDLO 0x0420 #define JME_GIGARDHI 0x0424 +#define JME_PHYPOWDN 0x0424 /* JMC250/JMC260 REVFM >= 5 */ /* BIST status and control. */ #define JME_GIGACSR 0x0428 @@ -627,6 +671,7 @@ /* General purpose register 1. */ #define JME_GPREG1 0x080C +#define GPREG1_RX_MAC_CLK_DIS 0x04000000 /* JMC250/JMC260 REVFM >= 2 */ #define GPREG1_RSS_IPV6_10_100 0x00000040 /* JMC250 A2 */ #define GPREG1_HDPX_FIX 0x00000020 /* JMC250 A2 */ #define GPREG1_INTDLY_UNIT_16US 0x00000018 /* JMC250 A1, A2 */ @@ -816,6 +861,53 @@ #define SHBASE_POST_FORCE 0x00000002 #define SHBASE_POST_ENB 0x00000001 +#define JME_PCDRX_BASE 0x0850 +#define JME_PCDRX_END 0x0857 +#define PCDRX_REG(x) (JME_PCDRX_BASE + (((x) / 2) * 4)) +#define PCDRX1_TO_THROTTLE_MASK 0xFF000000 +#define PCDRX1_TO_MASK 0x00FF0000 +#define PCDRX0_TO_THROTTLE_MASK 0x0000FF00 +#define PCDRX0_TO_MASK 0x000000FF +#define PCDRX1_TO_THROTTLE_SHIFT 24 +#define PCDRX1_TO_SHIFT 16 +#define PCDRX0_TO_THROTTLE_SHIFT 8 +#define PCDRX0_TO_SHIFT 0 +#define PCDRX_TO_MIN 1 +#define PCDRX_TO_MAX 255 + +#define JME_PCDTX 0x0858 +#define PCDTX_TO_THROTTLE_MASK 0x0000FF00 +#define PCDTX_TO_MASK 0x000000FF +#define PCDTX_TO_THROTTLE_SHIFT 8 +#define PCDTX_TO_SHIFT 0 +#define PCDTX_TO_MIN 1 +#define PCDTX_TO_MAX 255 + +#define JME_PCCPCD_STAT 0x085C +#define PCCPCD_STAT_RX3_MASK 0xFF000000 +#define PCCPCD_STAT_RX2_MASK 0x00FF0000 +#define PCCPCD_STAT_RX1_MASK 0x0000FF00 +#define PCCPCD_STAT_RX0_MASK 0x000000FF +#define PCCPCD_STAT_RX3_SHIFT 24 +#define PCCPCD_STAT_RX2_SHIFT 16 +#define PCCPCD_STAT_RX1_SHIFT 8 +#define PCCPCD_STAT_RX0_SHIFT 0 + +/* TX data throughput in KB. */ +#define JME_TX_THROUGHPUT 0x0860 +#define TX_THROUGHPUT_MASK 0x000FFFFF + +/* RX data throughput in KB. */ +#define JME_RX_THROUGHPUT 0x0864 +#define RX_THROUGHPUT_MASK 0x000FFFFF + +#define JME_LPI_CTL 0x086C +#define LPI_STAT_ANC_ANF 0x00000010 +#define LPI_STAT_AN_TIMEOUT 0x00000008 +#define LPI_STAT_RX_LPI 0x00000004 +#define LPI_INT_ENB 0x00000002 +#define LPI_REQ 0x00000001 + /* Timer 1 and 2. */ #define JME_TIMER1 0x0870 #define JME_TIMER2 0x0874 @@ -824,6 +916,15 @@ #define TIMER_CNT_SHIFT 0 #define TIMER_UNIT 1024 /* 1024us */ +/* Timer 3. */ +#define JME_TIMER3 0x0878 +#define TIMER3_TIMEOUT 0x00010000 +#define TIMER3_TIMEOUT_COUNT_MASK 0x0000FF00 /* 130ms unit */ +#define TIMER3_TIMEOUT_VAL_MASK 0x000000E0 +#define TIMER3_ENB 0x00000001 +#define TIMER3_TIMEOUT_COUNT_SHIFT 8 +#define TIMER3_TIMEOUT_VALUE_SHIFT 1 + /* Aggresive power mode control. */ #define JME_APMC 0x087C #define APMC_PCIE_SDOWN_STAT 0x80000000 Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 19:04:17 2011 (r217955) @@ -185,19 +185,22 @@ struct jme_softc { uint32_t jme_tx_dma_size; uint32_t jme_rx_dma_size; int jme_flags; -#define JME_FLAG_FPGA 0x0001 -#define JME_FLAG_PCIE 0x0002 -#define JME_FLAG_PCIX 0x0003 -#define JME_FLAG_MSI 0x0004 -#define JME_FLAG_MSIX 0x0010 -#define JME_FLAG_PMCAP 0x0020 -#define JME_FLAG_FASTETH 0x0040 -#define JME_FLAG_NOJUMBO 0x0080 -#define JME_FLAG_TXCLK 0x0100 -#define JME_FLAG_DMA32BIT 0x0200 -#define JME_FLAG_HWMIB 0x0400 -#define JME_FLAG_DETACH 0x4000 -#define JME_FLAG_LINK 0x8000 +#define JME_FLAG_FPGA 0x00000001 +#define JME_FLAG_PCIE 0x00000002 +#define JME_FLAG_PCIX 0x00000004 +#define JME_FLAG_MSI 0x00000008 +#define JME_FLAG_MSIX 0x00000010 +#define JME_FLAG_PMCAP 0x00000020 +#define JME_FLAG_FASTETH 0x00000040 +#define JME_FLAG_NOJUMBO 0x00000080 +#define JME_FLAG_RXCLK 0x00000100 +#define JME_FLAG_TXCLK 0x00000200 +#define JME_FLAG_DMA32BIT 0x00000400 +#define JME_FLAG_HWMIB 0x00000800 +#define JME_FLAG_EFUSE 0x00001000 +#define JME_FLAG_PCCPCD 0x00002000 +#define JME_FLAG_DETACH 0x40000000 +#define JME_FLAG_LINK 0x80000000 struct jme_hw_stats jme_ostats; struct jme_hw_stats jme_stats; @@ -210,8 +213,10 @@ struct jme_softc { uint32_t jme_rxcsr; int jme_process_limit; int jme_tx_coal_to; + int jme_tx_pcd_to; int jme_tx_coal_pkt; int jme_rx_coal_to; + int jme_rx_pcd_to; int jme_rx_coal_pkt; volatile int jme_morework; Modified: stable/7/sys/dev/mii/jmphy.c ============================================================================== --- stable/7/sys/dev/mii/jmphy.c Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/mii/jmphy.c Thu Jan 27 19:04:17 2011 (r217955) @@ -104,6 +104,7 @@ jmphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; jsc = device_get_softc(dev); sc = &jsc->mii_sc; @@ -118,6 +119,10 @@ jmphy_attach(device_t dev) sc->mii_service = jmphy_service; sc->mii_pdata = mii; + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "jme") == 0 && + (sc->mii_flags & MIIF_MACPRIV0) != 0) + sc->mii_flags |= MIIF_PHYPRIV0; jsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); jsc->mii_model = MII_MODEL(ma->mii_id2); jsc->mii_rev = MII_REV(ma->mii_id2); @@ -265,6 +270,7 @@ static void jmphy_reset(struct mii_softc *sc) { struct jmphy_softc *jsc; + uint16_t t2cr, val; int i; jsc = (struct jmphy_softc *)sc; @@ -279,6 +285,39 @@ jmphy_reset(struct mii_softc *sc) if ((PHY_READ(sc, MII_BMCR) & BMCR_RESET) == 0) break; } + /* Perform vendor recommended PHY calibration. */ + if ((sc->mii_flags & MIIF_PHYPRIV0) != 0) { + /* Select PHY test mode 1. */ + t2cr = PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + t2cr |= 0x2000; + PHY_WRITE(sc, MII_100T2CR, t2cr); + /* Apply calibration patch. */ + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~0x0002; + val |= 0x0010 | 0x0001; + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + + /* XXX 20ms to complete recalibration. */ + DELAY(20 * 1000); + + PHY_READ(sc, MII_100T2CR); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~(0x0001 | 0x0002 | 0x0010); + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + /* Disable PHY test mode. */ + PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + PHY_WRITE(sc, MII_100T2CR, t2cr); + } } static uint16_t Modified: stable/7/sys/dev/mii/jmphyreg.h ============================================================================== --- stable/7/sys/dev/mii/jmphyreg.h Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/mii/jmphyreg.h Thu Jan 27 19:04:17 2011 (r217955) @@ -105,4 +105,13 @@ #define JMPHY_TMCTL 0x1A #define JMPHY_TMCTL_SLEEP_ENB 0x1000 +/* PHY specific configuration register. */ +#define JMPHY_SPEC_ADDR 0x1E +#define JMPHY_SPEC_ADDR_READ 0x4000 +#define JMPHY_SPEC_ADDR_WRITE 0x8000 + +#define JMPHY_SPEC_DATA 0x1F + +#define JMPHY_EXT_COMM_2 0x32 + #endif /* _DEV_MII_JMPHYREG_H_ */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:08:02 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03AB3106564A; Thu, 27 Jan 2011 19:08:02 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6ABE8FC13; Thu, 27 Jan 2011 19:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJ81eH030419; Thu, 27 Jan 2011 19:08:01 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJ81X8030417; Thu, 27 Jan 2011 19:08:01 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271908.p0RJ81X8030417@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217957 - stable/7/usr.sbin/pstat X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:08:02 -0000 Author: remko Date: Thu Jan 27 19:08:01 2011 New Revision: 217957 URL: http://svn.freebsd.org/changeset/base/217957 Log: MFC r178987 Fix pstat behaviour when using coredumps. The reference to tp was incorrect and should have been poining to &tty, tp is a virtual address from the coredump, while we should obtain the address through the tty struct. Approved by: imp (mentor, implicit trivial changes) MFC after: 1 week Submitted by: Ed Schouten (ed at 80836 dot nl) PR: 138131 Modified: stable/7/usr.sbin/pstat/pstat.c Directory Properties: stable/7/usr.sbin/pstat/ (props changed) Modified: stable/7/usr.sbin/pstat/pstat.c ============================================================================== --- stable/7/usr.sbin/pstat/pstat.c Thu Jan 27 19:05:43 2011 (r217956) +++ stable/7/usr.sbin/pstat/pstat.c Thu Jan 27 19:08:01 2011 (r217957) @@ -246,7 +246,7 @@ ttymode_kvm(void) XT_COPY(olowat); #undef XT_COPY ttyprt(&xt); - tp = TAILQ_NEXT(tp, t_list); + tp = TAILQ_NEXT(&tty, t_list); } } From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:12:05 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01BFB1065670; Thu, 27 Jan 2011 19:12:05 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B438FC1D; Thu, 27 Jan 2011 19:12:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJC4AR030756; Thu, 27 Jan 2011 19:12:04 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJC40l030754; Thu, 27 Jan 2011 19:12:04 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271912.p0RJC40l030754@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217960 - stable/7/share/man/man5 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:12:05 -0000 Author: remko Date: Thu Jan 27 19:12:04 2011 New Revision: 217960 URL: http://svn.freebsd.org/changeset/base/217960 Log: MFC r198787 Document the WWWSUPFILE variable. PR: 137723 Submitted by: Sofian Brabez Approved by: imp (mentor, implicit) MFC after: 3 days Facilitated by: Snow B.V. PR: 137723 Modified: stable/7/share/man/man5/make.conf.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/make.conf.5 ============================================================================== --- stable/7/share/man/man5/make.conf.5 Thu Jan 27 19:11:11 2011 (r217959) +++ stable/7/share/man/man5/make.conf.5 Thu Jan 27 19:12:04 2011 (r217960) @@ -318,6 +318,14 @@ Set this to use .Xr cvsup 1 to update your ports with .Dq Li "make update" . +.It Va WWWSUPFILE +.Pq Vt str +The www +.Ar supfile +to use when doing a +.Dq Li "make update" +This defaults to +.Pa /usr/share/examples/cvsup/www\-supfile . .El .Ss "BUILDING THE KERNEL" The following list provides a name and short description for variables From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:17:32 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE131065670; Thu, 27 Jan 2011 19:17:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1AF8FC19; Thu, 27 Jan 2011 19:17:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJHVrC031215; Thu, 27 Jan 2011 19:17:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJHVMM031213; Thu, 27 Jan 2011 19:17:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271917.p0RJHVMM031213@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217963 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:17:32 -0000 Author: yongari Date: Thu Jan 27 19:17:31 2011 New Revision: 217963 URL: http://svn.freebsd.org/changeset/base/217963 Log: MFC r183646,216552: r183646: Add a HARDWARE section. It doesn't contain any information not already in the DESCRIPTION section, but this allows for the manual page to be used in the automatic hardware notes generation. r216552: Document JMC251/JMC261 support. Modified: stable/7/share/man/man4/jme.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/jme.4 ============================================================================== --- stable/7/share/man/man4/jme.4 Thu Jan 27 19:15:25 2011 (r217962) +++ stable/7/share/man/man4/jme.4 Thu Jan 27 19:17:31 2011 (r217963) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2008 +.Dd December 18, 2010 .Dt JME 4 .Os .Sh NAME @@ -48,8 +48,8 @@ if_jme_load="YES" .Sh DESCRIPTION The .Nm -device driver provides support for JMicron JMC250 PCI Express -Gigabit Ethernet controllers and JMicron JMC260 PCI Express Fast +device driver provides support for JMicron JMC25x PCI Express +Gigabit Ethernet controllers and JMicron JMC26x PCI Express Fast Ethernet controllers. .Pp All LOMs supported by the @@ -59,7 +59,7 @@ TCP segmentation offload (TSO), hardware features, Wake On Lan (WOL) and an interrupt coalescing/moderation mechanism as well as a 64-bit multicast hash filter. .Pp -The JMC250 also supports Jumbo Frames (up to 9216 bytes), which can be +The JMC25x also supports Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 @@ -94,6 +94,21 @@ Force half duplex operation. .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +JMicron JMC250 PCI Express Gigabit Ethernet controller +.It +JMicron JMC251 PCI Express Gigabit Ethernet with Card Read Host controller +.It +JMicron JMC260 PCI Express Fast Ethernet controller +.It +JMicron JMC261 PCI Express Gigabit Ethernet with Card Read Host controller +.El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:32:54 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F406106566B; Thu, 27 Jan 2011 19:32:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 437B38FC1A; Thu, 27 Jan 2011 19:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJWspY032309; Thu, 27 Jan 2011 19:32:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJWs6n032307; Thu, 27 Jan 2011 19:32:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271932.p0RJWs6n032307@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217968 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:32:54 -0000 Author: yongari Date: Thu Jan 27 19:32:53 2011 New Revision: 217968 URL: http://svn.freebsd.org/changeset/base/217968 Log: MFC r179724,179852: r179724: Add man page for ixgbe driver r179852: Bring this up to date with regard to our other section 4 and Intel manpages, also fixes a few mdoc bugs. Added: stable/7/share/man/man4/ixgbe.4 - copied, changed from r179724, head/share/man/man4/ixgbe.4 Modified: Directory Properties: stable/7/share/man/man4/ (props changed) Copied and modified: stable/7/share/man/man4/ixgbe.4 (from r179724, head/share/man/man4/ixgbe.4) ============================================================================== --- head/share/man/man4/ixgbe.4 Wed Jun 11 18:49:55 2008 (r179724, copy source) +++ stable/7/share/man/man4/ixgbe.4 Thu Jan 27 19:32:53 2011 (r217968) @@ -31,23 +31,32 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd June 11, 2008 .Dt IXGBE 4 .Os .Sh NAME .Nm ixgbe -.Nd "10 Gigabit Ethernet driver for the FreeBSD operating system" +.Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" .Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device ixgbe" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ixgbe_load="YES" +.Ed .Sh DESCRIPTION The .Nm driver provides support for PCI 10Gb Ethernet adapters based on the Intel 82598EB Intel(R) Network Connections. The driver supports Jumbo Frames, MSIX, TSO, and RSS. -For a list of supported adapters, see the -.Pa README -included with the driver. .Pp For questions related to hardware requirements, refer to the documentation supplied with your Intel 10GbE adapter. @@ -61,8 +70,8 @@ utility configures the adapter to receiv The maximum MTU size for Jumbo Frames is 16114. .Pp This driver version supports VLANs. -For information on enabling VLANs, see the -.Pa README . +For information on enabling VLANs, see +.Xr ifconfig 8 . .Sh HARDWARE The .Nm @@ -73,9 +82,9 @@ driver supports the following cards: Intel(R) 10 Gigabit XF SR/AF Dual Port Server Adapter .It Intel(R) 10 Gigabit XF SR/LR Server Adapter -.IT +.It Intel(R) 82598EB 10 Gigabit AF Network Connection -.IT +.It Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection .El .Sh DIAGNOSTICS @@ -89,10 +98,6 @@ The device has stopped responding to the the network connection (cable). .El .Sh SUPPORT -For additional information regarding building and installation, -see the -.Pa README -included with the driver. For general information and support, go to the Intel support website at: .Pa http://support.intel.com . @@ -103,7 +108,6 @@ issue to .Aq freebsdnic@mailbox.intel.com . .Sh SEE ALSO .Xr arp 4 , -.Xr gx 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:37:02 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD5D9106564A; Thu, 27 Jan 2011 19:37:02 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4078FC15; Thu, 27 Jan 2011 19:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJb2S0032533; Thu, 27 Jan 2011 19:37:02 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJb2AC032530; Thu, 27 Jan 2011 19:37:02 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271937.p0RJb2AC032530@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217970 - stable/7/sys/dev/usb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:37:02 -0000 Author: remko Date: Thu Jan 27 19:37:01 2011 New Revision: 217970 URL: http://svn.freebsd.org/changeset/base/217970 Log: MFC r194582 Add support for the Myson Heden 8813. Note that I also added the usbdev to the list, because the 8813 version is not yet known there. I might have twisted the sorting there but because 8813 comes before 8818, I added it before that (with _8813 to differentiate) the item. PR: 135628 Submitted by: Yoshikazu GOTO Approved by: imp (mentor, implicit) PR: 135628 Modified: stable/7/sys/dev/usb/umass.c stable/7/sys/dev/usb/usbdevs Directory Properties: stable/7/sys/dev/usb/ (props changed) Modified: stable/7/sys/dev/usb/umass.c ============================================================================== --- stable/7/sys/dev/usb/umass.c Thu Jan 27 19:33:57 2011 (r217969) +++ stable/7/sys/dev/usb/umass.c Thu Jan 27 19:37:01 2011 (r217970) @@ -571,6 +571,10 @@ static struct umass_devdescr_t umass_dev UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY | IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE }, + { USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN_8813, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_SYNCHRONIZE_CACHE + }, { USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_SYNCHRONIZE_CACHE Modified: stable/7/sys/dev/usb/usbdevs ============================================================================== --- stable/7/sys/dev/usb/usbdevs Thu Jan 27 19:33:57 2011 (r217969) +++ stable/7/sys/dev/usb/usbdevs Thu Jan 27 19:37:01 2011 (r217970) @@ -1837,6 +1837,7 @@ product MSYSTEMS DISKONKEY 0x0010 DiskOn product MSYSTEMS DISKONKEY2 0x0011 DiskOnKey /* Myson products */ +product MYSON HEDEN_8813 0x8813 USB-IDE product MYSON HEDEN 0x8818 USB-IDE product MYSON STARREADER 0x9920 USB flash card adapter From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 19:38:03 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C82821065673; Thu, 27 Jan 2011 19:38:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B72B08FC1E; Thu, 27 Jan 2011 19:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJc39N032591; Thu, 27 Jan 2011 19:38:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJc3NX032589; Thu, 27 Jan 2011 19:38:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271938.p0RJc3NX032589@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217971 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:38:03 -0000 Author: yongari Date: Thu Jan 27 19:38:03 2011 New Revision: 217971 URL: http://svn.freebsd.org/changeset/base/217971 Log: MFC r182771: Hook up ixgbe(4) to the build. D'oh! Modified: stable/7/share/man/man4/Makefile Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Thu Jan 27 19:37:01 2011 (r217970) +++ stable/7/share/man/man4/Makefile Thu Jan 27 19:38:03 2011 (r217971) @@ -146,6 +146,7 @@ MAN= aac.4 \ ispfw.4 \ iwi.4 \ ixgb.4 \ + ixgbe.4 \ jme.4 \ joy.4 \ kbdmux.4 \ @@ -493,6 +494,7 @@ MLINKS+=ipfirewall.4 ipaccounting.4 \ MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 MLINKS+=ixgb.4 if_ixgb.4 +MLINKS+=ixgbe.4 if_ixgbe.4 MLINKS+=kue.4 if_kue.4 MLINKS+=lagg.4 trunk.4 MLINKS+=le.4 if_le.4 From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 20:12:36 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263DB10656A5; Thu, 27 Jan 2011 20:12:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1566D8FC26; Thu, 27 Jan 2011 20:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKCZ5h033987; Thu, 27 Jan 2011 20:12:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKCZNQ033985; Thu, 27 Jan 2011 20:12:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272012.p0RKCZNQ033985@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 20:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217977 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:12:36 -0000 Author: jhb Date: Thu Jan 27 20:12:35 2011 New Revision: 217977 URL: http://svn.freebsd.org/changeset/base/217977 Log: MFC 217077: Only change the priority of timeshare threads to PRI_MAX_TIMESHARE when yield() is called. Specifically, leave the priority of real time and idle threads unchanged. Modified: stable/7/sys/kern/kern_synch.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/usb/ (props changed) Modified: stable/7/sys/kern/kern_synch.c ============================================================================== --- stable/7/sys/kern/kern_synch.c Thu Jan 27 20:12:18 2011 (r217976) +++ stable/7/sys/kern/kern_synch.c Thu Jan 27 20:12:35 2011 (r217977) @@ -552,7 +552,8 @@ yield(struct thread *td, struct yield_ar { thread_lock(td); - sched_prio(td, PRI_MAX_TIMESHARE); + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) + sched_prio(td, PRI_MAX_TIMESHARE); mi_switch(SW_VOL, NULL); thread_unlock(td); td->td_retval[0] = 0; From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 20:39:20 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22AA1065673; Thu, 27 Jan 2011 20:39:20 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8388E8FC26; Thu, 27 Jan 2011 20:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKdKo7034871; Thu, 27 Jan 2011 20:39:20 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKdKZ8034869; Thu, 27 Jan 2011 20:39:20 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101272039.p0RKdKZ8034869@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 20:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217978 - stable/7/tools/tools/tinybsd X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:39:20 -0000 Author: remko Date: Thu Jan 27 20:39:19 2011 New Revision: 217978 URL: http://svn.freebsd.org/changeset/base/217978 Log: MFC r194558 Add architecture support for TinyBSD PR: 135301 Submitted by: Olivier Cochard-Labbe Reviewed by: Jean Milanez Melo (maintainer) Approved by: imp (mentor, implicit) MFC after: 1 week PR: 135301 Modified: stable/7/tools/tools/tinybsd/tinybsd Directory Properties: stable/7/tools/tools/tinybsd/ (props changed) Modified: stable/7/tools/tools/tinybsd/tinybsd ============================================================================== --- stable/7/tools/tools/tinybsd/tinybsd Thu Jan 27 20:12:35 2011 (r217977) +++ stable/7/tools/tools/tinybsd/tinybsd Thu Jan 27 20:39:19 2011 (r217978) @@ -19,6 +19,8 @@ BASEFILE="tinybsd.basefiles" PORTSFILE="tinybsd.ports" PORTSDIR=/usr/ports DEFINSTARGS="-o 0 -g 0 -m 555" +TINYARCH=$(uname -p) + TS="=====>" splitarg1 () { @@ -331,7 +333,7 @@ install_ports() { make_kernel() { echo "${TS} Building customized tiny beastie kernel... " - cp -p ${CURRENTDIR}/conf/${CONF}/${KERNCONF} /usr/src/sys/i386/conf + cp -p ${CURRENTDIR}/conf/${CONF}/${KERNCONF} /usr/src/sys/${TINYARCH}/conf cd /usr/src make buildkernel KERNCONF=${KERNCONF} || exit 1 gzip -9 /usr/obj/usr/src/sys/${KERNCONF}/kernel @@ -339,7 +341,7 @@ make_kernel() { install ${DEFINSTARGS} \ /usr/obj/usr/src/sys/${KERNCONF}/modules/usr/src/sys/modules/acpi/acpi/acpi.ko \ ${WORKDIR}/boot/kernel - install -o 0 -g 0 -m 444 /sys/i386/conf/GENERIC.hints ${WORKDIR}/boot/device.hints + install -o 0 -g 0 -m 444 /sys/${TINYARCH}/conf/GENERIC.hints ${WORKDIR}/boot/device.hints } copy_libraries() { From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 20:50:04 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B82106566C; Thu, 27 Jan 2011 20:50:04 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2F88FC1A; Thu, 27 Jan 2011 20:50:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKo447035321; Thu, 27 Jan 2011 20:50:04 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKo4bw035319; Thu, 27 Jan 2011 20:50:04 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101272050.p0RKo4bw035319@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 20:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217979 - stable/7/sys/cam/scsi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:50:04 -0000 Author: remko Date: Thu Jan 27 20:50:03 2011 New Revision: 217979 URL: http://svn.freebsd.org/changeset/base/217979 Log: MFC r186424 Add quirk for the Storcase InfoStation 12bay SATA to FC SAN. PR: 129858 Submitted by: Nick Triantos MFC after: 1 week PR: 129858 Modified: stable/7/sys/cam/scsi/scsi_da.c Directory Properties: stable/7/sys/cam/scsi/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_da.c Thu Jan 27 20:39:19 2011 (r217978) +++ stable/7/sys/cam/scsi/scsi_da.c Thu Jan 27 20:50:03 2011 (r217979) @@ -537,6 +537,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Storcase (Kingston) InfoStation IFS FC2/SATA-R 201A + * PR: 129858 + */ + {T_DIRECT, SIP_MEDIA_FIXED, "IFS", "FC2/SATA-R*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* * Samsung YP-U3 mp3-player * PR: 125398 */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 20:53:03 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD0E106566B; Thu, 27 Jan 2011 20:53:03 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEECF8FC18; Thu, 27 Jan 2011 20:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKr3f3035440; Thu, 27 Jan 2011 20:53:03 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKr3LW035438; Thu, 27 Jan 2011 20:53:03 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101272053.p0RKr3LW035438@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 20:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217980 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:53:03 -0000 Author: remko Date: Thu Jan 27 20:53:03 2011 New Revision: 217980 URL: http://svn.freebsd.org/changeset/base/217980 Log: MFC r183110 Document the -F 's return statement. If the application returns succesfully the return code is 7 (which means the filesystem is clean). PR: 127432 Submitted by: edwin MFC after: 3 days PR: 127432 Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 Directory Properties: stable/7/sbin/fsck_ffs/ (props changed) Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 27 20:50:03 2011 (r217979) +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 27 20:53:03 2011 (r217980) @@ -329,6 +329,12 @@ contains default list of file systems to .El .Sh EXIT STATUS .Ex -std +.Pp +If the option +.Fl F +is used, +.Nm +exits 7 if the file system is clean. .Sh DIAGNOSTICS The diagnostics produced by .Nm From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 21:21:09 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FC4B106566C; Thu, 27 Jan 2011 21:21:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E73F8FC14; Thu, 27 Jan 2011 21:21:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLL99G036330; Thu, 27 Jan 2011 21:21:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLL9rf036324; Thu, 27 Jan 2011 21:21:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272121.p0RLL9rf036324@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217982 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:21:09 -0000 Author: jhb Date: Thu Jan 27 21:21:09 2011 New Revision: 217982 URL: http://svn.freebsd.org/changeset/base/217982 Log: MFC 217078,217079: Various priority fixes for creating new threads: - Move sched_fork() later in fork() after the various sections of the new thread and proc have been copied and zeroed from the old thread and proc. Otherwise attempts to modify thread or process data in sched_fork() could be undone. - Don't copy td_{base,}_user_pri from the old thread to the new thread in sched_fork_thread() in ULE. This is already done courtesy the bcopy() of the thread copy region. - Always initialize the real priority (td_priority) of new threads to the new thread's base priority (td_base_pri) to avoid bogusly inheriting a borrowed priority from the parent thread. - Properly initialize the base priority (td_base_pri) of thread0 to PVM to match the desired priority in td_priority. Otherwise the first time thread0 used a borrowed priority it would drop down to PUSER instead of PVM. - Explicitly initialize the starting priority of new kprocs to PVM to avoid inheriting some random priority from thread0. Modified: stable/7/sys/kern/init_main.c stable/7/sys/kern/kern_fork.c stable/7/sys/kern/kern_kthread.c stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/usb/ (props changed) Modified: stable/7/sys/kern/init_main.c ============================================================================== --- stable/7/sys/kern/init_main.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/init_main.c Thu Jan 27 21:21:09 2011 (r217982) @@ -438,7 +438,7 @@ proc0_init(void *dummy __unused) td->td_user_pri = PUSER; td->td_base_user_pri = PUSER; td->td_priority = PVM; - td->td_base_pri = PUSER; + td->td_base_pri = PVM; td->td_oncpu = 0; td->td_flags = TDF_INMEM; td->td_cpuset = cpuset_thread0(); Modified: stable/7/sys/kern/kern_fork.c ============================================================================== --- stable/7/sys/kern/kern_fork.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/kern_fork.c Thu Jan 27 21:21:09 2011 (r217982) @@ -419,12 +419,6 @@ again: p2 = newproc; p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = trypid; - /* - * Allow the scheduler to initialize the child. - */ - thread_lock(td); - sched_fork(td, td2); - thread_unlock(td); AUDIT_ARG(pid, p2->p_pid); LIST_INSERT_HEAD(&allproc, p2, p_list); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); @@ -514,6 +508,13 @@ again: td2->td_flags = TDF_INMEM; /* + * Allow the scheduler to initialize the child. + */ + thread_lock(td); + sched_fork(td, td2); + thread_unlock(td); + + /* * Duplicate sub-structures as needed. * Increase reference counts on shared objects. */ Modified: stable/7/sys/kern/kern_kthread.c ============================================================================== --- stable/7/sys/kern/kern_kthread.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/kern_kthread.c Thu Jan 27 21:21:09 2011 (r217982) @@ -109,14 +109,15 @@ kthread_create(void (*func)(void *), voi /* call the processes' main()... */ td = FIRST_THREAD_IN_PROC(p2); cpu_set_fork_handler(td, func, arg); + thread_lock(td); TD_SET_CAN_RUN(td); + sched_prio(td, PVM); + sched_user_prio(td, PUSER); /* Delay putting it on the run queue until now. */ - if (!(flags & RFSTOPPED)) { - thread_lock(td); + if (!(flags & RFSTOPPED)) sched_add(td, SRQ_BORING); - thread_unlock(td); - } + thread_unlock(td); return 0; } Modified: stable/7/sys/kern/sched_4bsd.c ============================================================================== --- stable/7/sys/kern/sched_4bsd.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/sched_4bsd.c Thu Jan 27 21:21:09 2011 (r217982) @@ -660,6 +660,7 @@ sched_fork_thread(struct thread *td, str childtd->td_estcpu = td->td_estcpu; childtd->td_lock = &sched_lock; childtd->td_cpuset = cpuset_ref(td->td_cpuset); + childtd->td_priority = childtd->td_base_pri; sched_newthread(childtd); childtd->td_sched->ts_flags |= (td->td_sched->ts_flags & TSF_AFFINITY); } Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/sched_ule.c Thu Jan 27 21:21:09 2011 (r217982) @@ -2065,14 +2065,16 @@ sched_fork_thread(struct thread *td, str ts2->ts_cpu = ts->ts_cpu; ts2->ts_runq = NULL; /* - * Grab our parents cpu estimation information and priority. + * Grab our parents cpu estimation information. */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; - child->td_user_pri = td->td_user_pri; - child->td_base_user_pri = td->td_base_user_pri; + /* + * Do not inherit any borrowed priority from the parent. + */ + child->td_priority = child->td_base_pri; /* * And update interactivity score. */ From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 21:27:49 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA768106564A; Thu, 27 Jan 2011 21:27:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4008FC0C; Thu, 27 Jan 2011 21:27:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLRnKu036566; Thu, 27 Jan 2011 21:27:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLRnb5036565; Thu, 27 Jan 2011 21:27:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272127.p0RLRnb5036565@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217983 - in stable/7/sys: . cam/scsi cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:27:49 -0000 Author: jhb Date: Thu Jan 27 21:27:49 2011 New Revision: 217983 URL: http://svn.freebsd.org/changeset/base/217983 Log: Cleanup mergeinfo from some earlier changes. Modified: Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cam/scsi/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/usb/ (props changed) From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 21:28:01 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC88D106564A; Thu, 27 Jan 2011 21:28:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF5D8FC13; Thu, 27 Jan 2011 21:28:01 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 32D3C46B37; Thu, 27 Jan 2011 16:28:01 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 498B68A009; Thu, 27 Jan 2011 16:28:00 -0500 (EST) From: John Baldwin To: Remko Lodder Date: Thu, 27 Jan 2011 16:20:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101272050.p0RKo4bw035319@svn.freebsd.org> In-Reply-To: <201101272050.p0RKo4bw035319@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101271620.39540.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 27 Jan 2011 16:28:00 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r217979 - stable/7/sys/cam/scsi X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:28:01 -0000 On Thursday, January 27, 2011 3:50:04 pm Remko Lodder wrote: > Author: remko > Date: Thu Jan 27 20:50:03 2011 > New Revision: 217979 > URL: http://svn.freebsd.org/changeset/base/217979 > > Log: > MFC r186424 > > Add quirk for the Storcase InfoStation 12bay > SATA to FC SAN. > > PR: 129858 > Submitted by: Nick Triantos > MFC after: 1 week > > PR: 129858 > > Modified: > stable/7/sys/cam/scsi/scsi_da.c > Directory Properties: > stable/7/sys/cam/scsi/ (props changed) All kernel changes should be merged to sys/, not a subdirectory. -- John Baldwin From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 21:33:06 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADB1D1065672; Thu, 27 Jan 2011 21:33:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A478FC15; Thu, 27 Jan 2011 21:33:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLX6lE036875; Thu, 27 Jan 2011 21:33:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLX6Yh036873; Thu, 27 Jan 2011 21:33:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272133.p0RLX6Yh036873@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217985 - stable/7/sys/kern X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:33:06 -0000 Author: jhb Date: Thu Jan 27 21:33:06 2011 New Revision: 217985 URL: http://svn.freebsd.org/changeset/base/217985 Log: MFC 217237,217291: - Fix two harmless off-by-one errors. - Always use PRI_BASE() when checking the base type of a thread's priority class. Modified: stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Jan 27 21:32:50 2011 (r217984) +++ stable/7/sys/kern/sched_ule.c Thu Jan 27 21:33:06 2011 (r217985) @@ -151,7 +151,7 @@ static struct td_sched td_sched0; #define SCHED_PRI_NHALF (SCHED_PRI_NRESV / 2) #define SCHED_PRI_MIN (PRI_MIN_TIMESHARE + SCHED_PRI_NHALF) #define SCHED_PRI_MAX (PRI_MAX_TIMESHARE - SCHED_PRI_NHALF) -#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN) +#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN + 1) #define SCHED_PRI_TICKS(ts) \ (SCHED_TICK_HZ((ts)) / \ (roundup(SCHED_TICK_TOTAL((ts)), SCHED_PRI_RANGE) / SCHED_PRI_RANGE)) @@ -1460,7 +1460,7 @@ sched_priority(struct thread *td) int score; int pri; - if (td->td_pri_class != PRI_TIMESHARE) + if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) return; /* * If the score is interactive we place the thread in the realtime @@ -1478,8 +1478,8 @@ sched_priority(struct thread *td) score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); if (score < sched_interact) { pri = PRI_MIN_REALTIME; - pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact) - * score; + pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME + 1) / + sched_interact) * score; KASSERT(pri >= PRI_MIN_REALTIME && pri <= PRI_MAX_REALTIME, ("sched_priority: invalid interactive priority %d score %d", pri, score)); @@ -2229,7 +2229,7 @@ sched_clock(struct thread *td) ts = td->td_sched; if (td->td_pri_class & PRI_FIFO_BIT) return; - if (td->td_pri_class == PRI_TIMESHARE) { + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) { /* * We used a tick; charge it to the thread so * that we can compute our interactivity. From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 21:39:03 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8603106564A; Thu, 27 Jan 2011 21:39:03 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D74828FC13; Thu, 27 Jan 2011 21:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLd3vT037305; Thu, 27 Jan 2011 21:39:03 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLd3rT037303; Thu, 27 Jan 2011 21:39:03 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101272139.p0RLd3rT037303@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 21:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217986 - stable/7/share/man/man4 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:39:04 -0000 Author: cperciva Date: Thu Jan 27 21:39:03 2011 New Revision: 217986 URL: http://svn.freebsd.org/changeset/base/217986 Log: MFC r217872: Unbreak .Dd line. Approved by: re (kib) Modified: stable/7/share/man/man4/rgephy.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/rgephy.4 ============================================================================== --- stable/7/share/man/man4/rgephy.4 Thu Jan 27 21:33:06 2011 (r217985) +++ stable/7/share/man/man4/rgephy.4 Thu Jan 27 21:39:03 2011 (r217986) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15 2011 $ +.Dd January 16, 2011 .Dt RGEPHY 4 .Os .Sh NAME From owner-svn-src-stable-7@FreeBSD.ORG Thu Jan 27 23:07:23 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5BC1065673; Thu, 27 Jan 2011 23:07:23 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A4B58FC12; Thu, 27 Jan 2011 23:07:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RN7NZT042477; Thu, 27 Jan 2011 23:07:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RN7NkF042475; Thu, 27 Jan 2011 23:07:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101272307.p0RN7NkF042475@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 27 Jan 2011 23:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217995 - stable/7/share/man/man3 X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:07:23 -0000 Author: gavin Date: Thu Jan 27 23:07:23 2011 New Revision: 217995 URL: http://svn.freebsd.org/changeset/base/217995 Log: Merge r217264 from head: Remove a bullet point that appears to have been accidentally inserted twice. It has also been included within the feature lists to which it is relevant. PR: tobez Modified: stable/7/share/man/man3/queue.3 Directory Properties: stable/7/share/man/man3/ (props changed) Modified: stable/7/share/man/man3/queue.3 ============================================================================== --- stable/7/share/man/man3/queue.3 Thu Jan 27 23:07:03 2011 (r217994) +++ stable/7/share/man/man3/queue.3 Thu Jan 27 23:07:23 2011 (r217995) @@ -186,7 +186,6 @@ O(1) removal of an entry from the head o Forward traversal through the list. .El .Pp -O(n) removal of any entry in the list. Singly-linked lists are the simplest of the four data structures and support only the above functionality. Singly-linked lists are ideal for applications with large datasets From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 28 07:04:02 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE4F8106566C; Fri, 28 Jan 2011 07:04:02 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD1D78FC1C; Fri, 28 Jan 2011 07:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S742DR061825; Fri, 28 Jan 2011 07:04:02 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S742WM061823; Fri, 28 Jan 2011 07:04:02 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101280704.p0S742WM061823@svn.freebsd.org> From: Remko Lodder Date: Fri, 28 Jan 2011 07:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218009 - stable/7/sbin/newfs_msdos X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 07:04:02 -0000 Author: remko Date: Fri Jan 28 07:04:01 2011 New Revision: 218009 URL: http://svn.freebsd.org/changeset/base/218009 Log: MFC r174460,174478 Add information about the maximum file size for msdosfs. PR: docs/112935 Submitted by: Julian Stacey Actually this was inspired by the ticket submitted by Julian. MFC After: 3 days PR: docs/112935 Modified: stable/7/sbin/newfs_msdos/newfs_msdos.8 Directory Properties: stable/7/sbin/newfs_msdos/ (props changed) Modified: stable/7/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- stable/7/sbin/newfs_msdos/newfs_msdos.8 Fri Jan 28 06:58:14 2011 (r218008) +++ stable/7/sbin/newfs_msdos/newfs_msdos.8 Fri Jan 28 07:04:01 2011 (r218009) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 6, 1998 +.Dd December 8, 2007 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -162,6 +162,9 @@ struct bsxbpb { u_int16_t bkbs; /* [-k] backup boot sector */ }; .Ed +.Sh LIMITATION +The maximum file size is 4GB, even if the file system itself is bigger. +.Ed .Sh EXIT STATUS Exit status is 0 on success and 1 on error. .Sh EXAMPLES From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 28 20:06:51 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA6F1065675; Fri, 28 Jan 2011 20:06:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6F18FC0C; Fri, 28 Jan 2011 20:06:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SK6pZX098272; Fri, 28 Jan 2011 20:06:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SK6pEq098269; Fri, 28 Jan 2011 20:06:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101282006.p0SK6pEq098269@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Jan 2011 20:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218034 - stable/7/usr.bin/cpuset X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:06:51 -0000 Author: jhb Date: Fri Jan 28 20:06:51 2011 New Revision: 218034 URL: http://svn.freebsd.org/changeset/base/218034 Log: MFC 217416: Add two more features to cpuset(1): - Add a new -C flag to create a new cpuset and move an existing pid into that set. - Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all) which maps to the list of all CPUs in the system. Modified: stable/7/usr.bin/cpuset/cpuset.1 stable/7/usr.bin/cpuset/cpuset.c Directory Properties: stable/7/usr.bin/cpuset/ (props changed) Modified: stable/7/usr.bin/cpuset/cpuset.1 ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.1 Fri Jan 28 20:06:39 2011 (r218033) +++ stable/7/usr.bin/cpuset/cpuset.1 Fri Jan 28 20:06:51 2011 (r218034) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd January 14, 2011 .Dt CPUSET 1 .Os .Sh NAME @@ -41,6 +41,11 @@ .Op Fl s Ar setid .Fl p Ar pid .Nm +.Op Fl c +.Op Fl l Ar cpu-list +.Fl C +.Fl p Ar pid +.Nm .Op Fl cr .Op Fl l Ar cpu-list .Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq @@ -98,6 +103,8 @@ for the thread. .Pp The options are as follows: .Bl -tag -width ".Fl l Ar cpu-list" +.It Fl C +Create a new cpuset and assign the target process to that set. .It Fl c The requested operation should reference the cpuset available via the target specifier. @@ -117,6 +124,9 @@ Specifies a jail id as the target of the Specifies a list of CPUs to apply to a target. Specification may include numbers separated by '-' for ranges and commas separating individual numbers. +A special list of +.Dq all +may be specified in which case the list includes all CPUs from the root set. .It Fl p Ar pid Specifies a pid as the target of the operation. .It Fl s Ar setid @@ -168,6 +178,11 @@ into the specified cpuset .Ar setid so it may be managed with other pids in that set: .Dl cpuset -s -p +.Pp +Create a new cpuset that is restricted to CPUs 0 and 2 and move +.Ar pid +into the new set: +.Dl cpuset -C -c -l 0,2 -p .Sh SEE ALSO .Xr cpuset 2 .Sh HISTORY Modified: stable/7/usr.bin/cpuset/cpuset.c ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.c Fri Jan 28 20:06:39 2011 (r218033) +++ stable/7/usr.bin/cpuset/cpuset.c Fri Jan 28 20:06:51 2011 (r218034) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +int Cflag; int cflag; int gflag; int iflag; @@ -72,6 +73,12 @@ parselist(char *list, cpuset_t *mask) int curnum; char *l; + if (strcasecmp(list, "all") == 0) { + if (cpuset_getaffinity(CPU_LEVEL_ROOT, CPU_WHICH_PID, -1, + sizeof(*mask), mask) != 0) + err(EXIT_FAILURE, "getaffinity"); + return; + } state = NONE; curnum = lastnum = 0; for (l = list; *l != '\0';) { @@ -199,8 +206,11 @@ main(int argc, char *argv[]) level = CPU_LEVEL_WHICH; which = CPU_WHICH_PID; id = pid = tid = setid = -1; - while ((ch = getopt(argc, argv, "cgij:l:p:rs:t:x:")) != -1) { + while ((ch = getopt(argc, argv, "Ccgij:l:p:rs:t:x:")) != -1) { switch (ch) { + case 'C': + Cflag = 1; + break; case 'c': if (rflag) usage(); @@ -255,7 +265,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; if (gflag) { - if (argc || lflag) + if (argc || Cflag || lflag) usage(); /* Only one identity specifier. */ if (jflag + xflag + sflag + pflag + tflag > 1) @@ -272,7 +282,7 @@ main(int argc, char *argv[]) * The user wants to run a command with a set and possibly cpumask. */ if (argc) { - if (pflag | rflag | tflag | xflag | jflag) + if (Cflag | pflag | rflag | tflag | xflag | jflag) usage(); if (sflag) { if (cpuset_setid(CPU_WHICH_PID, -1, setid)) @@ -293,9 +303,11 @@ main(int argc, char *argv[]) /* * We're modifying something that presently exists. */ + if (Cflag && (sflag || rflag || !pflag || tflag || xflag || jflag)) + usage(); if (!lflag && (cflag || rflag)) usage(); - if (!lflag && !sflag) + if (!lflag && !(Cflag || sflag)) usage(); /* You can only set a mask on a thread. */ if (tflag && (sflag | pflag | xflag | jflag)) @@ -303,6 +315,15 @@ main(int argc, char *argv[]) /* You can only set a mask on an irq. */ if (xflag && (jflag | pflag | sflag | tflag)) usage(); + if (Cflag) { + /* + * Create a new cpuset and move the specified process + * into the set. + */ + if (cpuset(&setid) < 0) + err(EXIT_FAILURE, "newid"); + sflag = 1; + } if (pflag && sflag) { if (cpuset_setid(CPU_WHICH_PID, pid, setid)) err(EXIT_FAILURE, "setid"); @@ -331,6 +352,8 @@ usage(void) fprintf(stderr, " cpuset [-l cpu-list] [-s setid] -p pid\n"); fprintf(stderr, + " cpuset [-c] [-l cpu-list] -C -p pid\n"); + fprintf(stderr, " cpuset [-cr] [-l cpu-list] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); fprintf(stderr, " cpuset [-cgir] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); From owner-svn-src-stable-7@FreeBSD.ORG Fri Jan 28 20:22:03 2011 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E5B9106564A; Fri, 28 Jan 2011 20:22:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6228FC14; Fri, 28 Jan 2011 20:22:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SKM3Vo098836; Fri, 28 Jan 2011 20:22:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SKM3Y1098834; Fri, 28 Jan 2011 20:22:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101282022.p0SKM3Y1098834@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Jan 2011 20:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218036 - stable/7/sys/gnu/fs/ext2fs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:22:03 -0000 Author: jhb Date: Fri Jan 28 20:22:03 2011 New Revision: 218036 URL: http://svn.freebsd.org/changeset/base/218036 Log: MFC 217702: Restore support for the 'async' and 'sync' mount options lost when switching to nmount(2). While here, sort the options. Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Jan 28 20:21:41 2011 (r218035) +++ stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Jan 28 20:22:03 2011 (r218036) @@ -114,9 +114,9 @@ static int ext2_check_sb_compat(struct e static int compute_sb_data(struct vnode * devvp, struct ext2_super_block * es, struct ext2_sb_info * fs); -static const char *ext2_opts[] = { "from", "export", "acls", "noexec", - "noatime", "union", "suiddir", "multilabel", "nosymfollow", - "noclusterr", "noclusterw", "force", NULL }; +static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", + "noclusterw", "noexec", "export", "force", "from", "multilabel", + "suiddir", "nosymfollow", "sync", "union", NULL }; /* * VFS Operations.