From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 00:43:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA8091065672; Sun, 14 Feb 2010 00:43:42 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5DA58FC08; Sun, 14 Feb 2010 00:43:42 +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 o1E0hgD2009843; Sun, 14 Feb 2010 00:43:42 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E0hgGk009838; Sun, 14 Feb 2010 00:43:42 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002140043.o1E0hgGk009838@svn.freebsd.org> From: Rick Macklem Date: Sun, 14 Feb 2010 00:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203851 - stable/8/sys/fs/nfsclient X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 00:43:43 -0000 Author: rmacklem Date: Sun Feb 14 00:43:42 2010 New Revision: 203851 URL: http://svn.freebsd.org/changeset/base/203851 Log: MFC: r203303 Patch the experimental NFS client so that there is a timeout for negative name cache entries in a manner analogous to r202767 for the regular NFS client. Also, make the code in nfs_lookup() compatible with that of the regular client and replace the sysctl variable that enabled negative name caching with the mount point option. Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/fs/nfsclient/nfs_clvnops.c stable/8/sys/fs/nfsclient/nfsmount.h stable/8/sys/fs/nfsclient/nfsnode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun Feb 14 00:30:24 2010 (r203850) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Sun Feb 14 00:43:42 2010 (r203851) @@ -99,7 +99,7 @@ static void nfs_decode_args(struct mount struct nfs_args *argp, struct ucred *, struct thread *); static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, u_char *, u_char *, u_char *, - struct vnode **, struct ucred *, struct thread *); + struct vnode **, struct ucred *, struct thread *, int); static vfs_mount_t nfs_mount; static vfs_cmount_t nfs_cmount; static vfs_unmount_t nfs_unmount; @@ -498,7 +498,7 @@ nfs_mountdiskless(char *path, nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); if ((error = mountnfs(args, mp, nam, path, NULL, NULL, NULL, vpp, - td->td_ucred, td)) != 0) { + td->td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -669,6 +669,7 @@ static const char *nfs_opts[] = { "from" "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", + "negnametimeo", NULL }; /* @@ -717,6 +718,7 @@ nfs_mount(struct mount *mp) char hst[MNAMELEN]; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *opt, *name, *secname; + int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; if (vfs_filteropt(mp->mnt_optnew, nfs_opts)) { error = EINVAL; @@ -891,6 +893,16 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_TIMEO; } + if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) + == 0) { + ret = sscanf(opt, "%d", &negnametimeo); + if (ret != 1 || negnametimeo < 0) { + vfs_mount_error(mp, "illegal negnametimeo: %s", + opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "sec", (void **) &secname, NULL) == 0) nfs_sec_name(secname, &args.flags); @@ -990,7 +1002,7 @@ nfs_mount(struct mount *mp) args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, dirpath, srvkrbname, - &vp, td->td_ucred, td); + &vp, td->td_ucred, td, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1033,7 +1045,8 @@ nfs_cmount(struct mntarg *ma, void *data static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, char *hst, u_char *krbname, u_char *dirpath, u_char *srvkrbname, - struct vnode **vpp, struct ucred *cred, struct thread *td) + struct vnode **vpp, struct ucred *cred, struct thread *td, + int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1101,6 +1114,7 @@ mountnfs(struct nfs_args *argp, struct m vfs_getnewfsid(mp); nmp->nm_mountp = mp; mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); + nmp->nm_negnametimeo = negnametimeo; nfs_decode_args(mp, nmp, argp, cred, td); Modified: stable/8/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun Feb 14 00:30:24 2010 (r203850) +++ stable/8/sys/fs/nfsclient/nfs_clvnops.c Sun Feb 14 00:43:42 2010 (r203851) @@ -224,10 +224,6 @@ int newnfs_directio_enable = 0; SYSCTL_INT(_vfs_newnfs, OID_AUTO, directio_enable, CTLFLAG_RW, &newnfs_directio_enable, 0, "Enable NFS directio"); -static int newnfs_neglookup_enable = 1; -SYSCTL_INT(_vfs_newnfs, OID_AUTO, neglookup_enable, CTLFLAG_RW, - &newnfs_neglookup_enable, 0, "Enable NFS negative lookup caching"); - /* * This sysctl allows other processes to mmap a file that has been opened * O_DIRECT by a process. In general, having processes mmap the file while @@ -713,11 +709,11 @@ nfs_close(struct vop_close_args *ap) * enabled. (What does this have to do with negative lookup * caching? Well nothing, except it was reported by the * same user that needed negative lookup caching and I wanted - * there to be a way to disable it via sysctl to see if it + * there to be a way to disable it to see if it * is the cause of some caching/coherency issue that might * crop up.) */ - if (newnfs_neglookup_enable == 0) + if (VFSTONFS(vp->v_mount)->nm_negnametimeo == 0) np->n_attrstamp = 0; if (np->n_flag & NWRITEERR) { np->n_flag &= ~NWRITEERR; @@ -1007,6 +1003,8 @@ nfs_lookup(struct vop_lookup_args *ap) struct thread *td = cnp->cn_thread; struct nfsfh *nfhp; struct nfsvattr dnfsva, nfsva; + struct vattr vattr; + time_t dmtime; *vpp = NULLVP; if ((flags & ISLASTCN) && (mp->mnt_flag & MNT_RDONLY) && @@ -1027,37 +1025,68 @@ nfs_lookup(struct vop_lookup_args *ap) if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); - if ((error = cache_lookup(dvp, vpp, cnp)) && - (error != ENOENT || newnfs_neglookup_enable != 0)) { - struct vattr vattr; - - if (error == ENOENT) { - if (!VOP_GETATTR(dvp, &vattr, cnp->cn_cred) && - vattr.va_mtime.tv_sec == np->n_dmtime) { - NFSINCRGLOBAL(newnfsstats.lookupcache_hits); - return (ENOENT); - } - cache_purge_negative(dvp); - np->n_dmtime = 0; - } else { - newvp = *vpp; - if (nfscl_nodeleg(newvp, 0) == 0 || - (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) && - vattr.va_ctime.tv_sec==VTONFS(newvp)->n_ctime)) { - NFSINCRGLOBAL(newnfsstats.lookupcache_hits); - if (cnp->cn_nameiop != LOOKUP && - (flags & ISLASTCN)) - cnp->cn_flags |= SAVENAME; - return (0); - } - cache_purge(newvp); - if (dvp != newvp) - vput(newvp); - else - vrele(newvp); - *vpp = NULLVP; + error = cache_lookup(dvp, vpp, cnp); + if (error > 0 && error != ENOENT) + return (error); + if (error == -1) { + /* + * We only accept a positive hit in the cache if the + * change time of the file matches our cached copy. + * Otherwise, we discard the cache entry and fallback + * to doing a lookup RPC. + */ + newvp = *vpp; + if (nfscl_nodeleg(newvp, 0) == 0 || + (!VOP_GETATTR(newvp, &vattr, cnp->cn_cred) + && vattr.va_ctime.tv_sec == VTONFS(newvp)->n_ctime)) { + NFSINCRGLOBAL(newnfsstats.lookupcache_hits); + if (cnp->cn_nameiop != LOOKUP && + (flags & ISLASTCN)) + cnp->cn_flags |= SAVENAME; + return (0); } + cache_purge(newvp); + if (dvp != newvp) + vput(newvp); + else + vrele(newvp); + *vpp = NULLVP; + } else if (error == ENOENT) { + if (dvp->v_iflag & VI_DOOMED) + return (ENOENT); + /* + * We only accept a negative hit in the cache if the + * modification time of the parent directory matches + * our cached copy. Otherwise, we discard all of the + * negative cache entries for this directory. We also + * only trust -ve cache entries for less than + * nm_negative_namecache_timeout seconds. + */ + if ((u_int)(ticks - np->n_dmtime_ticks) < + (nmp->nm_negnametimeo * hz) && + VOP_GETATTR(dvp, &vattr, cnp->cn_cred) == 0 && + vattr.va_mtime.tv_sec == np->n_dmtime) { + NFSINCRGLOBAL(newnfsstats.lookupcache_hits); + return (ENOENT); + } + cache_purge_negative(dvp); + mtx_lock(&np->n_mtx); + np->n_dmtime = 0; + mtx_unlock(&np->n_mtx); } + + /* + * Cache the modification time of the parent directory in case + * the lookup fails and results in adding the first negative + * name cache entry for the directory. Since this is reading + * a single time_t, don't bother with locking. The + * modification time may be a bit stale, but it must be read + * before performing the lookup RPC to prevent a race where + * another lookup updates the timestamp on the directory after + * the lookup RPC has been performed on the server but before + * n_dmtime is set at the end of this function. + */ + dmtime = np->n_vattr.na_mtime.tv_sec; error = 0; newvp = NULLVP; NFSINCRGLOBAL(newnfsstats.lookupcache_misses); @@ -1067,29 +1096,60 @@ nfs_lookup(struct vop_lookup_args *ap) if (dattrflag) (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); if (error) { - if (newnfs_neglookup_enable != 0 && - error == ENOENT && (cnp->cn_flags & MAKEENTRY) && - cnp->cn_nameiop != CREATE) { - if (np->n_dmtime == 0) - np->n_dmtime = np->n_vattr.na_mtime.tv_sec; - cache_enter(dvp, NULL, cnp); - } if (newvp != NULLVP) { vput(newvp); *vpp = NULLVP; } + + if (error != ENOENT) { + if (NFS_ISV4(dvp)) + error = nfscl_maperr(td, error, (uid_t)0, + (gid_t)0); + return (error); + } + + /* The requested file was not found. */ if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && - (flags & ISLASTCN) && error == ENOENT) { + (flags & ISLASTCN)) { + /* + * XXX: UFS does a full VOP_ACCESS(dvp, + * VWRITE) here instead of just checking + * MNT_RDONLY. + */ if (mp->mnt_flag & MNT_RDONLY) - error = EROFS; - else - error = EJUSTRETURN; - } - if (cnp->cn_nameiop != LOOKUP && (flags & ISLASTCN)) + return (EROFS); cnp->cn_flags |= SAVENAME; - if (NFS_ISV4(dvp)) - error = nfscl_maperr(td, error, (uid_t)0, (gid_t)0); - return (error); + return (EJUSTRETURN); + } + + if ((cnp->cn_flags & MAKEENTRY) && cnp->cn_nameiop != CREATE) { + /* + * Maintain n_dmtime as the modification time + * of the parent directory when the oldest -ve + * name cache entry for this directory was + * added. If a -ve cache entry has already + * been added with a newer modification time + * by a concurrent lookup, then don't bother + * adding a cache entry. The modification + * time of the directory might have changed + * due to the file this lookup failed to find + * being created. In that case a subsequent + * lookup would incorrectly use the entry + * added here instead of doing an extra + * lookup. + */ + mtx_lock(&np->n_mtx); + if (np->n_dmtime <= dmtime) { + if (np->n_dmtime == 0) { + np->n_dmtime = dmtime; + np->n_dmtime_ticks = ticks; + } + mtx_unlock(&np->n_mtx); + cache_enter(dvp, NULL, cnp); + } else + mtx_unlock(&np->n_mtx); + } + return (ENOENT); } /* @@ -1829,7 +1889,7 @@ nfs_link(struct vop_link_args *ap) * but if negative caching is enabled, then the system * must care about lookup caching hit rate, so... */ - if (newnfs_neglookup_enable != 0 && + if (VFSTONFS(vp->v_mount)->nm_negnametimeo != 0 && (cnp->cn_flags & MAKEENTRY)) cache_enter(tdvp, vp, cnp); if (error && NFS_ISV4(vp)) @@ -1893,7 +1953,7 @@ nfs_symlink(struct vop_symlink_args *ap) * but if negative caching is enabled, then the system * must care about lookup caching hit rate, so... */ - if (newnfs_neglookup_enable != 0 && + if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && (cnp->cn_flags & MAKEENTRY)) cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; @@ -1973,7 +2033,7 @@ nfs_mkdir(struct vop_mkdir_args *ap) * but if negative caching is enabled, then the system * must care about lookup caching hit rate, so... */ - if (newnfs_neglookup_enable != 0 && + if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && (cnp->cn_flags & MAKEENTRY)) cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; Modified: stable/8/sys/fs/nfsclient/nfsmount.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsmount.h Sun Feb 14 00:30:24 2010 (r203850) +++ stable/8/sys/fs/nfsclient/nfsmount.h Sun Feb 14 00:43:42 2010 (r203851) @@ -69,6 +69,7 @@ struct nfsmount { u_int64_t nm_maxfilesize; /* maximum file size */ int nm_tprintf_initial_delay; /* initial delay */ int nm_tprintf_delay; /* interval for messages */ + int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* Newnfs additions */ struct nfsclclient *nm_clp; @@ -99,6 +100,10 @@ struct nfsmount { */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) +#ifndef NFS_DEFAULT_NEGNAMETIMEO +#define NFS_DEFAULT_NEGNAMETIMEO 60 +#endif + #endif /* _KERNEL */ #endif /* _NFSCLIENT_NFSMOUNT_H_ */ Modified: stable/8/sys/fs/nfsclient/nfsnode.h ============================================================================== --- stable/8/sys/fs/nfsclient/nfsnode.h Sun Feb 14 00:30:24 2010 (r203850) +++ stable/8/sys/fs/nfsclient/nfsnode.h Sun Feb 14 00:43:42 2010 (r203851) @@ -108,6 +108,7 @@ struct nfsnode { struct timespec n_mtime; /* Prev modify time. */ time_t n_ctime; /* Prev create time. */ time_t n_dmtime; /* Prev dir modify time. */ + int n_dmtime_ticks; /* Tick of -ve cache entry */ time_t n_expiry; /* Lease expiry time */ struct nfsfh *n_fhp; /* NFS File Handle */ struct vnode *n_vnode; /* associated vnode */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 09:34:28 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26F79106566B; Sun, 14 Feb 2010 09:34:28 +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 150CA8FC0C; Sun, 14 Feb 2010 09:34: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 o1E9YRlm028386; Sun, 14 Feb 2010 09:34:27 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E9YRRi028384; Sun, 14 Feb 2010 09:34:27 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002140934.o1E9YRRi028384@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 14 Feb 2010 09:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203855 - stable/8/sys/dev/wpi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 09:34:28 -0000 Author: gavin Date: Sun Feb 14 09:34:27 2010 New Revision: 203855 URL: http://svn.freebsd.org/changeset/base/203855 Log: Merge r200530 from head: Don't panic on failure to attach if we fail before or during the if_alloc() of ifp. This fixes the panic reported in the PRs, but not the attach failure. PR: kern/139079, kern/143874 Tested by: Steven Noonan Reviewed by: thompsa Modified: stable/8/sys/dev/wpi/if_wpi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/8/sys/dev/wpi/if_wpi.c Sun Feb 14 07:20:58 2010 (r203854) +++ stable/8/sys/dev/wpi/if_wpi.c Sun Feb 14 09:34:27 2010 (r203855) @@ -713,13 +713,14 @@ wpi_detach(device_t dev) { struct wpi_softc *sc = device_get_softc(dev); struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; + struct ieee80211com *ic; int ac; - ieee80211_draintask(ic, &sc->sc_restarttask); - ieee80211_draintask(ic, &sc->sc_radiotask); - if (ifp != NULL) { + ic = ifp->if_l2com; + + ieee80211_draintask(ic, &sc->sc_restarttask); + ieee80211_draintask(ic, &sc->sc_radiotask); wpi_stop(sc); callout_drain(&sc->watchdog_to); callout_drain(&sc->calib_to); From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 09:37:14 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 937E6106566B; Sun, 14 Feb 2010 09:37:13 +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 81B9B8FC08; Sun, 14 Feb 2010 09:37:13 +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 o1E9bD67029063; Sun, 14 Feb 2010 09:37:13 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E9bDgA029061; Sun, 14 Feb 2010 09:37:13 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002140937.o1E9bDgA029061@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 14 Feb 2010 09:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203856 - stable/8/share/man/man9 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 09:37:14 -0000 Author: gavin Date: Sun Feb 14 09:37:13 2010 New Revision: 203856 URL: http://svn.freebsd.org/changeset/base/203856 Log: Merge r203636 from head: Correct arguments to free_unr(), "item" was missing. Modified: stable/8/share/man/man9/alloc_unr.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/alloc_unr.9 ============================================================================== --- stable/8/share/man/man9/alloc_unr.9 Sun Feb 14 09:34:27 2010 (r203855) +++ stable/8/share/man/man9/alloc_unr.9 Sun Feb 14 09:37:13 2010 (r203856) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2005 +.Dd February 7, 2010 .Dt ALLOC_UNR 9 .Os .Sh NAME @@ -81,7 +81,7 @@ is returned. Same as .Fn alloc_unr except that mutex is assumed to be already locked and thus is not used. -.It Fn free_unr uh +.It Fn free_unr uh item Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked variant. From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 09:40:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB618106566B; Sun, 14 Feb 2010 09:40:58 +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 A9E5F8FC15; Sun, 14 Feb 2010 09:40: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 o1E9ew6V029904; Sun, 14 Feb 2010 09:40:58 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E9ewMJ029902; Sun, 14 Feb 2010 09:40:58 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002140940.o1E9ewMJ029902@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 14 Feb 2010 09:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203857 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 09:40:58 -0000 Author: gavin Date: Sun Feb 14 09:40:58 2010 New Revision: 203857 URL: http://svn.freebsd.org/changeset/base/203857 Log: Merge r203620,203621 from head: Document support for the D-Link DFE520-TX card (supported with the vr(4) driver) PR: kern/135989 Submitted by: "Rashid N. Achilov" citycat4 ngs.ru Modified: stable/8/share/man/man4/vr.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/vr.4 ============================================================================== --- stable/8/share/man/man4/vr.4 Sun Feb 14 09:37:13 2010 (r203856) +++ stable/8/share/man/man4/vr.4 Sun Feb 14 09:40:58 2010 (r203857) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2008 +.Dd February 7, 2010 .Dt VR 4 .Os .Sh NAME @@ -130,6 +130,8 @@ Fast Ethernet adapters including: .It AOpen/Acer ALN-320 .It +D-Link DFE520-TX +.It D-Link DFE530-TX .It Hawking Technologies PN102TX From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 09:48:56 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17E6910656A8; Sun, 14 Feb 2010 09:48:55 +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 DA3058FC1F; Sun, 14 Feb 2010 09:48:53 +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 o1E9mrlh031689; Sun, 14 Feb 2010 09:48:53 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1E9mr0h031686; Sun, 14 Feb 2010 09:48:53 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002140948.o1E9mr0h031686@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 14 Feb 2010 09:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203858 - stable/8/sbin/sysctl X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 09:49:00 -0000 Author: gavin Date: Sun Feb 14 09:48:53 2010 New Revision: 203858 URL: http://svn.freebsd.org/changeset/base/203858 Log: Merge r203310,203547,203717 from head: Implement the "-i" option to sysctl(8), to ignore failures while retrieving individual OIDs. This allows the same list of OIDs to be passed to sysctl(8) across different systems where particular OIDs may not exist, and still get as much information as possible from them. PR: bin/123644 Submitted by: dhw Modified: stable/8/sbin/sysctl/sysctl.8 stable/8/sbin/sysctl/sysctl.c Directory Properties: stable/8/sbin/sysctl/ (props changed) Modified: stable/8/sbin/sysctl/sysctl.8 ============================================================================== --- stable/8/sbin/sysctl/sysctl.8 Sun Feb 14 09:40:58 2010 (r203857) +++ stable/8/sbin/sysctl/sysctl.8 Sun Feb 14 09:48:53 2010 (r203858) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 28, 2007 +.Dd February 6, 2010 .Dt SYSCTL 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehNnoqx +.Op Fl bdehiNnoqx .Ar name Ns Op = Ns Ar value .Ar ... .Nm @@ -82,6 +82,12 @@ or is specified, or a variable is being set. .It Fl h Format output for human, rather than machine, readability. +.It Fl i +Ignore unknown OIDs. +The purpose is to make use of +.Nm +for collecting data from a variety of machines (not all of which +are necessarily running exactly the same software) easier. .It Fl N Show only variable names, not their values. This is particularly useful with shells that offer programmable Modified: stable/8/sbin/sysctl/sysctl.c ============================================================================== --- stable/8/sbin/sysctl/sysctl.c Sun Feb 14 09:40:58 2010 (r203857) +++ stable/8/sbin/sysctl/sysctl.c Sun Feb 14 09:48:53 2010 (r203858) @@ -58,8 +58,8 @@ static const char rcsid[] = #include #include -static int aflag, bflag, dflag, eflag, hflag, Nflag, nflag, oflag; -static int qflag, xflag, warncount; +static int aflag, bflag, dflag, eflag, hflag, iflag; +static int Nflag, nflag, oflag, qflag, xflag, warncount; static int oidfmt(int *, int, char *, u_int *); static void parse(char *); @@ -75,7 +75,7 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehNnoqx] name[=value] ...", + "usage: sysctl [-bdehiNnoqx] name[=value] ...", " sysctl [-bdehNnoqx] -a"); exit(1); } @@ -89,7 +89,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdehNnoqwxX")) != -1) { + while ((ch = getopt(argc, argv, "AabdehiNnoqwxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -110,6 +110,9 @@ main(int argc, char **argv) case 'h': hflag = 1; break; + case 'i': + iflag = 1; + break; case 'N': Nflag = 1; break; @@ -187,6 +190,8 @@ parse(char *string) len = name2oid(bufp, mib); if (len < 0) { + if (iflag) + return; if (qflag) exit(1); else From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 11:53:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC4551065672; Sun, 14 Feb 2010 11:53:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 90EEE8FC08; Sun, 14 Feb 2010 11:53: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 o1EBrpgK061918; Sun, 14 Feb 2010 11:53:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EBrpZm061915; Sun, 14 Feb 2010 11:53:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141153.o1EBrpZm061915@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 11:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203860 - stable/8/sys/dev/sound/pcm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 11:53:51 -0000 Author: mav Date: Sun Feb 14 11:53:51 2010 New Revision: 203860 URL: http://svn.freebsd.org/changeset/base/203860 Log: MFC r202150, r202170: Make OSS_GETVERSION ioctl really work. It has 'M' group, not 'P', as different nearby ones, and was grabbed by MIXER_xxx() handler. While there, replace '(cmd & MIXER_xxx(0)) == MIXER_xxx(0)' expressions with more correct '(cmd & ~0xff) == MIXER_xxx(0)'. Use of bit operations to compare numeric fields doesn't looks sane. Modified: stable/8/sys/dev/sound/pcm/dsp.c stable/8/sys/dev/sound/pcm/mixer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/8/sys/dev/sound/pcm/dsp.c Sun Feb 14 11:04:52 2010 (r203859) +++ stable/8/sys/dev/sound/pcm/dsp.c Sun Feb 14 11:53:51 2010 (r203860) @@ -1003,7 +1003,7 @@ dsp_ioctl_channel(struct cdev *dev, stru if (volch != NULL && ((j == SOUND_MIXER_PCM && volch->direction == PCMDIR_PLAY) || (j == SOUND_MIXER_RECLEV && volch->direction == PCMDIR_REC))) { - if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) { + if ((cmd & ~0xff) == MIXER_WRITE(0)) { int left, right, center; left = *(int *)arg & 0x7f; @@ -1011,7 +1011,7 @@ dsp_ioctl_channel(struct cdev *dev, stru center = (left + right) >> 1; chn_setvolume_multi(volch, SND_VOL_C_PCM, left, right, center); - } else if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + } else if ((cmd & ~0xff) == MIXER_READ(0)) { *(int *)arg = CHN_GETVOLUME(volch, SND_VOL_C_PCM, SND_CHN_T_FL); *(int *)arg |= CHN_GETVOLUME(volch, @@ -1023,7 +1023,7 @@ dsp_ioctl_channel(struct cdev *dev, stru case SOUND_MIXER_DEVMASK: case SOUND_MIXER_CAPS: case SOUND_MIXER_STEREODEVS: - if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + if ((cmd & ~0xff) == MIXER_READ(0)) { *(int *)arg = 0; if (rdch != NULL) *(int *)arg |= SOUND_MASK_RECLEV; @@ -1034,7 +1034,7 @@ dsp_ioctl_channel(struct cdev *dev, stru break; case SOUND_MIXER_RECMASK: case SOUND_MIXER_RECSRC: - if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) + if ((cmd & ~0xff) == MIXER_READ(0)) *(int *)arg = 0; ret = 0; break; @@ -1069,6 +1069,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd chn = NULL; if (IOCGROUP(cmd) == 'M') { + if (cmd == OSS_GETVERSION) { + *arg_i = SOUND_VERSION; + return (0); + } ret = dsp_ioctl_channel(i_dev, PCM_VOLCH(i_dev), cmd, arg); if (ret != -1) { PCM_GIANT_EXIT(d); Modified: stable/8/sys/dev/sound/pcm/mixer.c ============================================================================== --- stable/8/sys/dev/sound/pcm/mixer.c Sun Feb 14 11:04:52 2010 (r203859) +++ stable/8/sys/dev/sound/pcm/mixer.c Sun Feb 14 11:53:51 2010 (r203860) @@ -1136,7 +1136,7 @@ mixer_ioctl_channel(struct cdev *dev, u_ if ((j == SOUND_MIXER_DEVMASK || j == SOUND_MIXER_CAPS || j == SOUND_MIXER_STEREODEVS) && - (cmd & MIXER_READ(0)) == MIXER_READ(0)) { + (cmd & ~0xff) == MIXER_READ(0)) { snd_mtxlock(m->lock); *(int *)arg = mix_getdevs(m); snd_mtxunlock(m->lock); @@ -1154,14 +1154,14 @@ mixer_ioctl_channel_proc: KASSERT(c != NULL, ("%s(): NULL channel", __func__)); CHN_LOCKASSERT(c); - if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) { + if ((cmd & ~0xff) == MIXER_WRITE(0)) { int left, right, center; left = *(int *)arg & 0x7f; right = (*(int *)arg >> 8) & 0x7f; center = (left + right) >> 1; chn_setvolume_multi(c, SND_VOL_C_PCM, left, right, center); - } else if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + } else if ((cmd & ~0xff) == MIXER_READ(0)) { *(int *)arg = CHN_GETVOLUME(c, SND_VOL_C_PCM, SND_CHN_T_FL); *(int *)arg |= CHN_GETVOLUME(c, SND_VOL_C_PCM, SND_CHN_T_FR) << 8; @@ -1214,7 +1214,7 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo struct thread *td, int from) { struct snd_mixer *m; - int ret, *arg_i = (int *)arg; + int ret = EINVAL, *arg_i = (int *)arg; int v = -1, j = cmd & 0xff; /* @@ -1248,8 +1248,23 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo snd_mtxunlock(m->lock); return (EBADF); } - - if ((cmd & MIXER_WRITE(0)) == MIXER_WRITE(0)) { + switch (cmd) { + case SNDCTL_DSP_GET_RECSRC_NAMES: + bcopy((void *)&m->enuminfo, arg, sizeof(oss_mixer_enuminfo)); + ret = 0; + goto done; + case SNDCTL_DSP_GET_RECSRC: + ret = mixer_get_recroute(m, arg_i); + goto done; + case SNDCTL_DSP_SET_RECSRC: + ret = mixer_set_recroute(m, *arg_i); + goto done; + case OSS_GETVERSION: + *arg_i = SOUND_VERSION; + ret = 0; + goto done; + } + if ((cmd & ~0xff) == MIXER_WRITE(0)) { if (j == SOUND_MIXER_RECSRC) ret = mixer_setrecsrc(m, *arg_i); else @@ -1257,23 +1272,19 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo snd_mtxunlock(m->lock); return ((ret == 0) ? 0 : ENXIO); } - - if ((cmd & MIXER_READ(0)) == MIXER_READ(0)) { + if ((cmd & ~0xff) == MIXER_READ(0)) { switch (j) { - case SOUND_MIXER_DEVMASK: - case SOUND_MIXER_CAPS: - case SOUND_MIXER_STEREODEVS: + case SOUND_MIXER_DEVMASK: + case SOUND_MIXER_CAPS: + case SOUND_MIXER_STEREODEVS: v = mix_getdevs(m); break; - - case SOUND_MIXER_RECMASK: + case SOUND_MIXER_RECMASK: v = mix_getrecdevs(m); break; - - case SOUND_MIXER_RECSRC: + case SOUND_MIXER_RECSRC: v = mixer_getrecsrc(m); break; - default: v = mixer_get(m, j); } @@ -1281,29 +1292,8 @@ mixer_ioctl_cmd(struct cdev *i_dev, u_lo snd_mtxunlock(m->lock); return ((v != -1) ? 0 : ENXIO); } - - ret = 0; - - switch (cmd) { - case SNDCTL_DSP_GET_RECSRC_NAMES: - bcopy((void *)&m->enuminfo, arg, sizeof(oss_mixer_enuminfo)); - break; - case SNDCTL_DSP_GET_RECSRC: - ret = mixer_get_recroute(m, arg_i); - break; - case SNDCTL_DSP_SET_RECSRC: - ret = mixer_set_recroute(m, *arg_i); - break; - case OSS_GETVERSION: - *arg_i = SOUND_VERSION; - break; - default: - ret = EINVAL; - break; - } - +done: snd_mtxunlock(m->lock); - return (ret); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 12:00:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BDBE106575A; Sun, 14 Feb 2010 12:00:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19DD38FC0A; Sun, 14 Feb 2010 12:00:24 +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 o1EC0NNA063496; Sun, 14 Feb 2010 12:00:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EC0NfK063493; Sun, 14 Feb 2010 12:00:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141200.o1EC0NfK063493@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 12:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203861 - stable/8/sys/dev/mpt X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:00:24 -0000 Author: mav Date: Sun Feb 14 12:00:23 2010 New Revision: 203861 URL: http://svn.freebsd.org/changeset/base/203861 Log: MFC r203484: Do not release device, when changing number of openings. Modified: stable/8/sys/dev/mpt/mpt_cam.c stable/8/sys/dev/mpt/mpt_raid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/mpt/mpt_cam.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_cam.c Sun Feb 14 11:53:51 2010 (r203860) +++ stable/8/sys/dev/mpt/mpt_cam.c Sun Feb 14 12:00:23 2010 (r203861) @@ -2553,6 +2553,7 @@ mpt_cam_event(struct mpt_softc *mpt, req } xpt_setup_ccb(&crs.ccb_h, tmppath, 5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = pqf->CurrentDepth - 1; xpt_action((union ccb *)&crs); Modified: stable/8/sys/dev/mpt/mpt_raid.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_raid.c Sun Feb 14 11:53:51 2010 (r203860) +++ stable/8/sys/dev/mpt/mpt_raid.c Sun Feb 14 12:00:23 2010 (r203861) @@ -1062,6 +1062,7 @@ mpt_adjust_queue_depth(struct mpt_softc xpt_setup_ccb(&crs.ccb_h, path, /*priority*/5); crs.ccb_h.func_code = XPT_REL_SIMQ; + crs.ccb_h.flags = CAM_DEV_QFREEZE; crs.release_flags = RELSIM_ADJUST_OPENINGS; crs.openings = mpt->raid_queue_depth; xpt_action((union ccb *)&crs); From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 12:03:05 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5062D10656AA; Sun, 14 Feb 2010 12:03:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06FCE8FC0A; Sun, 14 Feb 2010 12:03:05 +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 o1EC34nM064231; Sun, 14 Feb 2010 12:03:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EC34Ao064229; Sun, 14 Feb 2010 12:03:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141203.o1EC34Ao064229@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 12:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203863 - stable/8/sys/dev/ciss X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:03:05 -0000 Author: mav Date: Sun Feb 14 12:03:04 2010 New Revision: 203863 URL: http://svn.freebsd.org/changeset/base/203863 Log: MFC r203489: Return CAM_RELEASE_SIMQ flag only when it is needed, when SIM really was frozen before and should be released. Modified: stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Sun Feb 14 12:00:42 2010 (r203862) +++ stable/8/sys/dev/ciss/ciss.c Sun Feb 14 12:03:04 2010 (r203863) @@ -3101,6 +3101,7 @@ ciss_cam_action_io(struct cam_sim *sim, */ if ((error = ciss_get_request(sc, &cr)) != 0) { xpt_freeze_simq(sim, 1); + csio->ccb_h.status |= CAM_RELEASE_SIMQ; csio->ccb_h.status |= CAM_REQUEUE_REQ; return(error); } @@ -3152,8 +3153,8 @@ ciss_cam_action_io(struct cam_sim *sim, */ if ((error = ciss_start(cr)) != 0) { xpt_freeze_simq(sim, 1); + csio->ccb_h.status |= CAM_RELEASE_SIMQ; if (error == EINPROGRESS) { - csio->ccb_h.status |= CAM_RELEASE_SIMQ; error = 0; } else { csio->ccb_h.status |= CAM_REQUEUE_REQ; @@ -3181,7 +3182,7 @@ ciss_cam_emulate(struct ciss_softc *sc, if (CISS_IS_PHYSICAL(bus)) { if (sc->ciss_physical[CISS_CAM_TO_PBUS(bus)][target].cp_online != 1) { - csio->ccb_h.status = CAM_SEL_TIMEOUT; + csio->ccb_h.status |= CAM_SEL_TIMEOUT; xpt_done((union ccb *)csio); return(1); } else @@ -3194,7 +3195,7 @@ ciss_cam_emulate(struct ciss_softc *sc, * Other errors might be better. */ if (sc->ciss_logical[bus][target].cl_status != CISS_LD_ONLINE) { - csio->ccb_h.status = CAM_SEL_TIMEOUT; + csio->ccb_h.status |= CAM_SEL_TIMEOUT; xpt_done((union ccb *)csio); return(1); } @@ -3208,7 +3209,7 @@ ciss_cam_emulate(struct ciss_softc *sc, if (((csio->ccb_h.flags & CAM_CDB_POINTER) ? *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE) { ciss_flush_adapter(sc); - csio->ccb_h.status = CAM_REQ_CMP; + csio->ccb_h.status |= CAM_REQ_CMP; xpt_done((union ccb *)csio); return(1); } @@ -3269,13 +3270,13 @@ ciss_cam_complete(struct ciss_request *c /* no status due to adapter error */ case -1: debug(0, "adapter error"); - csio->ccb_h.status = CAM_REQ_CMP_ERR; + csio->ccb_h.status |= CAM_REQ_CMP_ERR; break; /* no status due to command completed OK */ case SCSI_STATUS_OK: /* CISS_SCSI_STATUS_GOOD */ debug(2, "SCSI_STATUS_OK"); - csio->ccb_h.status = CAM_REQ_CMP; + csio->ccb_h.status |= CAM_REQ_CMP; break; /* check condition, sense data included */ @@ -3286,7 +3287,7 @@ ciss_cam_complete(struct ciss_request *c bcopy(&ce->sense_info[0], &csio->sense_data, ce->sense_length); csio->sense_len = ce->sense_length; csio->resid = ce->residual_count; - csio->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; + csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; #ifdef CISS_DEBUG { struct scsi_sense_data *sns = (struct scsi_sense_data *)&ce->sense_info[0]; @@ -3297,21 +3298,18 @@ ciss_cam_complete(struct ciss_request *c case SCSI_STATUS_BUSY: /* CISS_SCSI_STATUS_BUSY */ debug(0, "SCSI_STATUS_BUSY"); - csio->ccb_h.status = CAM_SCSI_BUSY; + csio->ccb_h.status |= CAM_SCSI_BUSY; break; default: debug(0, "unknown status 0x%x", csio->scsi_status); - csio->ccb_h.status = CAM_REQ_CMP_ERR; + csio->ccb_h.status |= CAM_REQ_CMP_ERR; break; } /* handle post-command fixup */ ciss_cam_complete_fixup(sc, csio); - /* tell CAM we're ready for more commands */ - csio->ccb_h.status |= CAM_RELEASE_SIMQ; - ciss_release_request(cr); xpt_done((union ccb *)csio); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 12:04:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D227E106566B; Sun, 14 Feb 2010 12:04:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C11EE8FC0A; Sun, 14 Feb 2010 12:04: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 o1EC4Ppj064594; Sun, 14 Feb 2010 12:04:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EC4PDR064592; Sun, 14 Feb 2010 12:04:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141204.o1EC4PDR064592@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 12:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203864 - stable/8/sys/dev/ciss X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:04:25 -0000 Author: mav Date: Sun Feb 14 12:04:25 2010 New Revision: 203864 URL: http://svn.freebsd.org/changeset/base/203864 Log: MFC r203524: When hacking INQUIRY result, make sure that it is right INQUIRY and there is enough of result to hack. Modified: stable/8/sys/dev/ciss/ciss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ciss/ciss.c ============================================================================== --- stable/8/sys/dev/ciss/ciss.c Sun Feb 14 12:03:04 2010 (r203863) +++ stable/8/sys/dev/ciss/ciss.c Sun Feb 14 12:04:25 2010 (r203864) @@ -3322,10 +3322,15 @@ ciss_cam_complete_fixup(struct ciss_soft { struct scsi_inquiry_data *inq; struct ciss_ldrive *cl; + uint8_t *cdb; int bus, target; - if (((csio->ccb_h.flags & CAM_CDB_POINTER) ? - *(u_int8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes[0]) == INQUIRY) { + cdb = (csio->ccb_h.flags & CAM_CDB_POINTER) ? + (uint8_t *)csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes; + if (cdb[0] == INQUIRY && + (cdb[1] & SI_EVPD) == 0 && + (csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN && + csio->dxfer_len >= SHORT_INQUIRY_LENGTH) { inq = (struct scsi_inquiry_data *)csio->data_ptr; target = csio->ccb_h.target_id; From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 12:24:13 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D1B106566B; Sun, 14 Feb 2010 12:24:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0972E8FC13; Sun, 14 Feb 2010 12:24:13 +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 o1ECOCFN069048; Sun, 14 Feb 2010 12:24:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1ECOCht069047; Sun, 14 Feb 2010 12:24:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141224.o1ECOCht069047@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 12:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203867 - stable/8/sys/dev/siis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 12:24:13 -0000 Author: mav Date: Sun Feb 14 12:24:12 2010 New Revision: 203867 URL: http://svn.freebsd.org/changeset/base/203867 Log: MFp4: After last running command completed, give commands in timeout state second time. Modified: stable/8/sys/dev/siis/siis.c Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Sun Feb 14 12:10:49 2010 (r203866) +++ stable/8/sys/dev/siis/siis.c Sun Feb 14 12:24:12 2010 (r203867) @@ -1056,6 +1056,28 @@ siis_process_timeout(device_t dev) } } +/* Must be called with channel locked. */ +static void +siis_rearm_timeout(device_t dev) +{ + struct siis_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + for (i = 0; i < SIIS_MAX_SLOTS; i++) { + struct siis_slot *slot = &ch->slot[i]; + + /* Do we have a running request on slot? */ + if (slot->state < SIIS_SLOT_RUNNING) + continue; + if ((ch->toslots & (1 << i)) == 0) + continue; + callout_reset(&slot->timeout, + (int)slot->ccb->ccb_h.timeout * hz / 1000, + (timeout_t*)siis_timeout, slot); + } +} + /* Locked by callout mechanism. */ static void siis_timeout(struct siis_slot *slot) @@ -1216,8 +1238,9 @@ siis_end_transaction(struct siis_slot *s siis_issue_read_log(dev); } /* If all the reset of commands are in timeout - abort them. */ - } else if ((ch->rslots & ~ch->toslots) == 0) - siis_process_timeout(dev); + } else if ((ch->rslots & ~ch->toslots) == 0 && + et != SIIS_ERR_TIMEOUT) + siis_rearm_timeout(dev); } static void From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:23:05 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7095D106566C; Sun, 14 Feb 2010 19:23:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F18E8FC14; Sun, 14 Feb 2010 19:23:05 +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 o1EJN5qu061928; Sun, 14 Feb 2010 19:23:05 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJN5f8061926; Sun, 14 Feb 2010 19:23:05 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141923.o1EJN5f8061926@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203887 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:23:05 -0000 Author: mav Date: Sun Feb 14 19:23:05 2010 New Revision: 203887 URL: http://svn.freebsd.org/changeset/base/203887 Log: MFC r202699: Make ata_getrev() an optional method by implementing ata_null_getrev(). This fixes a bogus '???' boot message on Cambria boards with a CompactFlash card. Modified: stable/8/sys/dev/ata/ata_if.m Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ata/ata_if.m ============================================================================== --- stable/8/sys/dev/ata/ata_if.m Sun Feb 14 18:09:18 2010 (r203886) +++ stable/8/sys/dev/ata/ata_if.m Sun Feb 14 19:23:05 2010 (r203887) @@ -71,10 +71,17 @@ METHOD int setmode { int mode; } DEFAULT ata_null_setmode; +CODE { + static int ata_null_getrev(device_t dev, int target) + { + return (0); + } +}; + METHOD int getrev { device_t dev; int target; -}; +} DEFAULT ata_null_getrev; METHOD void reset { device_t channel; From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:28:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77D611065679; Sun, 14 Feb 2010 19:28:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63CB98FC13; Sun, 14 Feb 2010 19:28:45 +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 o1EJSjH1063269; Sun, 14 Feb 2010 19:28:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJSj1A063264; Sun, 14 Feb 2010 19:28:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141928.o1EJSj1A063264@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203888 - in stable/8/sys/dev: ahci ata ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:28:45 -0000 Author: mav Date: Sun Feb 14 19:28:45 2010 New Revision: 203888 URL: http://svn.freebsd.org/changeset/base/203888 Log: MFC r203030: Add support for SATA part of Marvell 88SE912x controllers to ahci(4). Limit early revisions from 6Gb/s to 3Gb/s by default, or they negotiate only 1.5Gb/s, when 3Gb/s devices connected. Add dummy driver for PATA part of these controllers, preventing generic driver attach them. It causes system freeze when SATA controller used after PATA was touched. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/ata-pci.h stable/8/sys/dev/ata/chipsets/ata-marvell.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:23:05 2010 (r203887) +++ stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:28:45 2010 (r203888) @@ -98,6 +98,7 @@ MALLOC_DEFINE(M_AHCI, "AHCI driver", "AH static struct { uint32_t id; + uint8_t rev; const char *name; int quirks; #define AHCI_Q_NOFORCE 1 @@ -107,135 +108,138 @@ static struct { #define AHCI_Q_2CH 16 #define AHCI_Q_4CH 32 #define AHCI_Q_EDGEIS 64 +#define AHCI_Q_SATA2 128 } ahci_ids[] = { - {0x43801002, "ATI IXP600", 0}, - {0x43901002, "ATI IXP700", 0}, - {0x43911002, "ATI IXP700", 0}, - {0x43921002, "ATI IXP700", 0}, - {0x43931002, "ATI IXP700", 0}, - {0x43941002, "ATI IXP800", 0}, - {0x43951002, "ATI IXP800", 0}, - {0x26528086, "Intel ICH6", AHCI_Q_NOFORCE}, - {0x26538086, "Intel ICH6M", AHCI_Q_NOFORCE}, - {0x26818086, "Intel ESB2", 0}, - {0x26828086, "Intel ESB2", 0}, - {0x26838086, "Intel ESB2", 0}, - {0x27c18086, "Intel ICH7", 0}, - {0x27c38086, "Intel ICH7", 0}, - {0x27c58086, "Intel ICH7M", 0}, - {0x27c68086, "Intel ICH7M", 0}, - {0x28218086, "Intel ICH8", 0}, - {0x28228086, "Intel ICH8", 0}, - {0x28248086, "Intel ICH8", 0}, - {0x28298086, "Intel ICH8M", 0}, - {0x282a8086, "Intel ICH8M", 0}, - {0x29228086, "Intel ICH9", 0}, - {0x29238086, "Intel ICH9", 0}, - {0x29248086, "Intel ICH9", 0}, - {0x29258086, "Intel ICH9", 0}, - {0x29278086, "Intel ICH9", 0}, - {0x29298086, "Intel ICH9M", 0}, - {0x292a8086, "Intel ICH9M", 0}, - {0x292b8086, "Intel ICH9M", 0}, - {0x292c8086, "Intel ICH9M", 0}, - {0x292f8086, "Intel ICH9M", 0}, - {0x294d8086, "Intel ICH9", 0}, - {0x294e8086, "Intel ICH9M", 0}, - {0x3a058086, "Intel ICH10", 0}, - {0x3a228086, "Intel ICH10", 0}, - {0x3a258086, "Intel ICH10", 0}, - {0x3b228086, "Intel PCH", 0}, - {0x3b238086, "Intel PCH", 0}, - {0x3b248086, "Intel PCH", 0}, - {0x3b258086, "Intel PCH", 0}, - {0x3b298086, "Intel PCH", 0}, - {0x3b2b8086, "Intel PCH", 0}, - {0x3b2c8086, "Intel PCH", 0}, - {0x3b2f8086, "Intel PCH", 0}, - {0x2361197b, "JMicron JMB361", AHCI_Q_NOFORCE}, - {0x2363197b, "JMicron JMB363", AHCI_Q_NOFORCE}, - {0x2365197b, "JMicron JMB365", AHCI_Q_NOFORCE}, - {0x2366197b, "JMicron JMB366", AHCI_Q_NOFORCE}, - {0x2368197b, "JMicron JMB368", AHCI_Q_NOFORCE}, - {0x611111ab, "Marvell 88SX6111", AHCI_Q_NOFORCE|AHCI_Q_1CH|AHCI_Q_EDGEIS}, - {0x612111ab, "Marvell 88SX6121", AHCI_Q_NOFORCE|AHCI_Q_2CH|AHCI_Q_EDGEIS}, - {0x614111ab, "Marvell 88SX6141", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, - {0x614511ab, "Marvell 88SX6145", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, - {0x044c10de, "NVIDIA MCP65", 0}, - {0x044d10de, "NVIDIA MCP65", 0}, - {0x044e10de, "NVIDIA MCP65", 0}, - {0x044f10de, "NVIDIA MCP65", 0}, - {0x045c10de, "NVIDIA MCP65", 0}, - {0x045d10de, "NVIDIA MCP65", 0}, - {0x045e10de, "NVIDIA MCP65", 0}, - {0x045f10de, "NVIDIA MCP65", 0}, - {0x055010de, "NVIDIA MCP67", 0}, - {0x055110de, "NVIDIA MCP67", 0}, - {0x055210de, "NVIDIA MCP67", 0}, - {0x055310de, "NVIDIA MCP67", 0}, - {0x055410de, "NVIDIA MCP67", 0}, - {0x055510de, "NVIDIA MCP67", 0}, - {0x055610de, "NVIDIA MCP67", 0}, - {0x055710de, "NVIDIA MCP67", 0}, - {0x055810de, "NVIDIA MCP67", 0}, - {0x055910de, "NVIDIA MCP67", 0}, - {0x055A10de, "NVIDIA MCP67", 0}, - {0x055B10de, "NVIDIA MCP67", 0}, - {0x058410de, "NVIDIA MCP67", 0}, - {0x07f010de, "NVIDIA MCP73", 0}, - {0x07f110de, "NVIDIA MCP73", 0}, - {0x07f210de, "NVIDIA MCP73", 0}, - {0x07f310de, "NVIDIA MCP73", 0}, - {0x07f410de, "NVIDIA MCP73", 0}, - {0x07f510de, "NVIDIA MCP73", 0}, - {0x07f610de, "NVIDIA MCP73", 0}, - {0x07f710de, "NVIDIA MCP73", 0}, - {0x07f810de, "NVIDIA MCP73", 0}, - {0x07f910de, "NVIDIA MCP73", 0}, - {0x07fa10de, "NVIDIA MCP73", 0}, - {0x07fb10de, "NVIDIA MCP73", 0}, - {0x0ad010de, "NVIDIA MCP77", 0}, - {0x0ad110de, "NVIDIA MCP77", 0}, - {0x0ad210de, "NVIDIA MCP77", 0}, - {0x0ad310de, "NVIDIA MCP77", 0}, - {0x0ad410de, "NVIDIA MCP77", 0}, - {0x0ad510de, "NVIDIA MCP77", 0}, - {0x0ad610de, "NVIDIA MCP77", 0}, - {0x0ad710de, "NVIDIA MCP77", 0}, - {0x0ad810de, "NVIDIA MCP77", 0}, - {0x0ad910de, "NVIDIA MCP77", 0}, - {0x0ada10de, "NVIDIA MCP77", 0}, - {0x0adb10de, "NVIDIA MCP77", 0}, - {0x0ab410de, "NVIDIA MCP79", 0}, - {0x0ab510de, "NVIDIA MCP79", 0}, - {0x0ab610de, "NVIDIA MCP79", 0}, - {0x0ab710de, "NVIDIA MCP79", 0}, - {0x0ab810de, "NVIDIA MCP79", 0}, - {0x0ab910de, "NVIDIA MCP79", 0}, - {0x0aba10de, "NVIDIA MCP79", 0}, - {0x0abb10de, "NVIDIA MCP79", 0}, - {0x0abc10de, "NVIDIA MCP79", 0}, - {0x0abd10de, "NVIDIA MCP79", 0}, - {0x0abe10de, "NVIDIA MCP79", 0}, - {0x0abf10de, "NVIDIA MCP79", 0}, - {0x0d8410de, "NVIDIA MCP89", 0}, - {0x0d8510de, "NVIDIA MCP89", 0}, - {0x0d8610de, "NVIDIA MCP89", 0}, - {0x0d8710de, "NVIDIA MCP89", 0}, - {0x0d8810de, "NVIDIA MCP89", 0}, - {0x0d8910de, "NVIDIA MCP89", 0}, - {0x0d8a10de, "NVIDIA MCP89", 0}, - {0x0d8b10de, "NVIDIA MCP89", 0}, - {0x0d8c10de, "NVIDIA MCP89", 0}, - {0x0d8d10de, "NVIDIA MCP89", 0}, - {0x0d8e10de, "NVIDIA MCP89", 0}, - {0x0d8f10de, "NVIDIA MCP89", 0}, - {0x33491106, "VIA VT8251", 0}, - {0x62871106, "VIA VT8251", 0}, - {0x11841039, "SiS 966", 0}, - {0x11851039, "SiS 968", 0}, - {0x01861039, "SiS 968", 0}, - {0, NULL, 0} + {0x43801002, 0x00, "ATI IXP600", 0}, + {0x43901002, 0x00, "ATI IXP700", 0}, + {0x43911002, 0x00, "ATI IXP700", 0}, + {0x43921002, 0x00, "ATI IXP700", 0}, + {0x43931002, 0x00, "ATI IXP700", 0}, + {0x43941002, 0x00, "ATI IXP800", 0}, + {0x43951002, 0x00, "ATI IXP800", 0}, + {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, + {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, + {0x26818086, 0x00, "Intel ESB2", 0}, + {0x26828086, 0x00, "Intel ESB2", 0}, + {0x26838086, 0x00, "Intel ESB2", 0}, + {0x27c18086, 0x00, "Intel ICH7", 0}, + {0x27c38086, 0x00, "Intel ICH7", 0}, + {0x27c58086, 0x00, "Intel ICH7M", 0}, + {0x27c68086, 0x00, "Intel ICH7M", 0}, + {0x28218086, 0x00, "Intel ICH8", 0}, + {0x28228086, 0x00, "Intel ICH8", 0}, + {0x28248086, 0x00, "Intel ICH8", 0}, + {0x28298086, 0x00, "Intel ICH8M", 0}, + {0x282a8086, 0x00, "Intel ICH8M", 0}, + {0x29228086, 0x00, "Intel ICH9", 0}, + {0x29238086, 0x00, "Intel ICH9", 0}, + {0x29248086, 0x00, "Intel ICH9", 0}, + {0x29258086, 0x00, "Intel ICH9", 0}, + {0x29278086, 0x00, "Intel ICH9", 0}, + {0x29298086, 0x00, "Intel ICH9M", 0}, + {0x292a8086, 0x00, "Intel ICH9M", 0}, + {0x292b8086, 0x00, "Intel ICH9M", 0}, + {0x292c8086, 0x00, "Intel ICH9M", 0}, + {0x292f8086, 0x00, "Intel ICH9M", 0}, + {0x294d8086, 0x00, "Intel ICH9", 0}, + {0x294e8086, 0x00, "Intel ICH9M", 0}, + {0x3a058086, 0x00, "Intel ICH10", 0}, + {0x3a228086, 0x00, "Intel ICH10", 0}, + {0x3a258086, 0x00, "Intel ICH10", 0}, + {0x3b228086, 0x00, "Intel PCH", 0}, + {0x3b238086, 0x00, "Intel PCH", 0}, + {0x3b248086, 0x00, "Intel PCH", 0}, + {0x3b258086, 0x00, "Intel PCH", 0}, + {0x3b298086, 0x00, "Intel PCH", 0}, + {0x3b2b8086, 0x00, "Intel PCH", 0}, + {0x3b2c8086, 0x00, "Intel PCH", 0}, + {0x3b2f8086, 0x00, "Intel PCH", 0}, + {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, + {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, + {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, + {0x2366197b, 0x00, "JMicron JMB366", AHCI_Q_NOFORCE}, + {0x2368197b, 0x00, "JMicron JMB368", AHCI_Q_NOFORCE}, + {0x611111ab, 0x00, "Marvell 88SX6111", AHCI_Q_NOFORCE|AHCI_Q_1CH|AHCI_Q_EDGEIS}, + {0x612111ab, 0x00, "Marvell 88SX6121", AHCI_Q_NOFORCE|AHCI_Q_2CH|AHCI_Q_EDGEIS}, + {0x614111ab, 0x00, "Marvell 88SX6141", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, + {0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, + {0x91231b4b, 0x11, "Marvell 88SE912x", 0}, + {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2}, + {0x044c10de, 0x00, "NVIDIA MCP65", 0}, + {0x044d10de, 0x00, "NVIDIA MCP65", 0}, + {0x044e10de, 0x00, "NVIDIA MCP65", 0}, + {0x044f10de, 0x00, "NVIDIA MCP65", 0}, + {0x045c10de, 0x00, "NVIDIA MCP65", 0}, + {0x045d10de, 0x00, "NVIDIA MCP65", 0}, + {0x045e10de, 0x00, "NVIDIA MCP65", 0}, + {0x045f10de, 0x00, "NVIDIA MCP65", 0}, + {0x055010de, 0x00, "NVIDIA MCP67", 0}, + {0x055110de, 0x00, "NVIDIA MCP67", 0}, + {0x055210de, 0x00, "NVIDIA MCP67", 0}, + {0x055310de, 0x00, "NVIDIA MCP67", 0}, + {0x055410de, 0x00, "NVIDIA MCP67", 0}, + {0x055510de, 0x00, "NVIDIA MCP67", 0}, + {0x055610de, 0x00, "NVIDIA MCP67", 0}, + {0x055710de, 0x00, "NVIDIA MCP67", 0}, + {0x055810de, 0x00, "NVIDIA MCP67", 0}, + {0x055910de, 0x00, "NVIDIA MCP67", 0}, + {0x055A10de, 0x00, "NVIDIA MCP67", 0}, + {0x055B10de, 0x00, "NVIDIA MCP67", 0}, + {0x058410de, 0x00, "NVIDIA MCP67", 0}, + {0x07f010de, 0x00, "NVIDIA MCP73", 0}, + {0x07f110de, 0x00, "NVIDIA MCP73", 0}, + {0x07f210de, 0x00, "NVIDIA MCP73", 0}, + {0x07f310de, 0x00, "NVIDIA MCP73", 0}, + {0x07f410de, 0x00, "NVIDIA MCP73", 0}, + {0x07f510de, 0x00, "NVIDIA MCP73", 0}, + {0x07f610de, 0x00, "NVIDIA MCP73", 0}, + {0x07f710de, 0x00, "NVIDIA MCP73", 0}, + {0x07f810de, 0x00, "NVIDIA MCP73", 0}, + {0x07f910de, 0x00, "NVIDIA MCP73", 0}, + {0x07fa10de, 0x00, "NVIDIA MCP73", 0}, + {0x07fb10de, 0x00, "NVIDIA MCP73", 0}, + {0x0ad010de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad110de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad210de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad310de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad410de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad510de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad610de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad710de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad810de, 0x00, "NVIDIA MCP77", 0}, + {0x0ad910de, 0x00, "NVIDIA MCP77", 0}, + {0x0ada10de, 0x00, "NVIDIA MCP77", 0}, + {0x0adb10de, 0x00, "NVIDIA MCP77", 0}, + {0x0ab410de, 0x00, "NVIDIA MCP79", 0}, + {0x0ab510de, 0x00, "NVIDIA MCP79", 0}, + {0x0ab610de, 0x00, "NVIDIA MCP79", 0}, + {0x0ab710de, 0x00, "NVIDIA MCP79", 0}, + {0x0ab810de, 0x00, "NVIDIA MCP79", 0}, + {0x0ab910de, 0x00, "NVIDIA MCP79", 0}, + {0x0aba10de, 0x00, "NVIDIA MCP79", 0}, + {0x0abb10de, 0x00, "NVIDIA MCP79", 0}, + {0x0abc10de, 0x00, "NVIDIA MCP79", 0}, + {0x0abd10de, 0x00, "NVIDIA MCP79", 0}, + {0x0abe10de, 0x00, "NVIDIA MCP79", 0}, + {0x0abf10de, 0x00, "NVIDIA MCP79", 0}, + {0x0d8410de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8510de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8610de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8710de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8810de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8910de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8a10de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8b10de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8c10de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8d10de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8e10de, 0x00, "NVIDIA MCP89", 0}, + {0x0d8f10de, 0x00, "NVIDIA MCP89", 0}, + {0x33491106, 0x00, "VIA VT8251", 0}, + {0x62871106, 0x00, "VIA VT8251", 0}, + {0x11841039, 0x00, "SiS 966", 0}, + {0x11851039, 0x00, "SiS 968", 0}, + {0x01861039, 0x00, "SiS 968", 0}, + {0x00000000, 0x00, NULL, 0} }; static int @@ -244,6 +248,7 @@ ahci_probe(device_t dev) char buf[64]; int i, valid = 0; uint32_t devid = pci_get_devid(dev); + uint8_t revid = pci_get_revid(dev); /* Is this a possible AHCI candidate? */ if (pci_get_class(dev) == PCIC_STORAGE && @@ -253,6 +258,7 @@ ahci_probe(device_t dev) /* Is this a known AHCI chip? */ for (i = 0; ahci_ids[i].id != 0; i++) { if (ahci_ids[i].id == devid && + ahci_ids[i].rev <= revid && (valid || !(ahci_ids[i].quirks & AHCI_Q_NOFORCE))) { /* Do not attach JMicrons with single PCI function. */ if (pci_get_vendor(dev) == 0x197b && @@ -276,12 +282,14 @@ ahci_ata_probe(device_t dev) char buf[64]; int i; uint32_t devid = pci_get_devid(dev); + uint8_t revid = pci_get_revid(dev); if ((intptr_t)device_get_ivars(dev) >= 0) return (ENXIO); /* Is this a known AHCI chip? */ for (i = 0; ahci_ids[i].id != 0; i++) { - if (ahci_ids[i].id == devid) { + if (ahci_ids[i].id == devid && + ahci_ids[i].rev <= revid) { snprintf(buf, sizeof(buf), "%s AHCI SATA controller", ahci_ids[i].name); device_set_desc_copy(dev, buf); @@ -299,11 +307,14 @@ ahci_attach(device_t dev) device_t child; int error, unit, speed, i; uint32_t devid = pci_get_devid(dev); + uint8_t revid = pci_get_revid(dev); u_int32_t version; ctlr->dev = dev; i = 0; - while (ahci_ids[i].id != 0 && ahci_ids[i].id != devid) + while (ahci_ids[i].id != 0 && + (ahci_ids[i].id != devid || + ahci_ids[i].rev > revid)) i++; ctlr->quirks = ahci_ids[i].quirks; resource_int_value(device_get_name(dev), @@ -800,6 +811,8 @@ ahci_ch_attach(device_t dev) pci_get_subdevice(ctlr->dev) == 0x81e4 && ch->unit == 0) sata_rev = 1; + if (ch->quirks & AHCI_Q_SATA2) + sata_rev = 2; resource_int_value(device_get_name(dev), device_get_unit(dev), "sata_rev", &sata_rev); for (i = 0; i < 16; i++) { Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Sun Feb 14 19:23:05 2010 (r203887) +++ stable/8/sys/dev/ata/ata-pci.c Sun Feb 14 19:28:45 2010 (r203888) @@ -877,6 +877,7 @@ ata_pcivendor2str(device_t dev) case ATA_ITE_ID: return "ITE"; case ATA_JMICRON_ID: return "JMicron"; case ATA_MARVELL_ID: return "Marvell"; + case ATA_MARVELL2_ID: return "Marvell"; case ATA_NATIONAL_ID: return "National"; case ATA_NETCELL_ID: return "Netcell"; case ATA_NVIDIA_ID: return "nVidia"; Modified: stable/8/sys/dev/ata/ata-pci.h ============================================================================== --- stable/8/sys/dev/ata/ata-pci.h Sun Feb 14 19:23:05 2010 (r203887) +++ stable/8/sys/dev/ata/ata-pci.h Sun Feb 14 19:28:45 2010 (r203888) @@ -234,6 +234,7 @@ struct ata_pci_controller { #define ATA_M88SX6121 0x612111ab #define ATA_M88SX6141 0x614111ab #define ATA_M88SX6145 0x614511ab +#define ATA_MARVELL2_ID 0x1b4b #define ATA_MICRON_ID 0x1042 #define ATA_MICRON_RZ1000 0x10001042 Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-marvell.c Sun Feb 14 19:23:05 2010 (r203887) +++ stable/8/sys/dev/ata/chipsets/ata-marvell.c Sun Feb 14 19:28:45 2010 (r203888) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); static int ata_marvell_chipinit(device_t dev); static int ata_marvell_ch_attach(device_t dev); static int ata_marvell_setmode(device_t dev, int target, int mode); +static int ata_marvell_dummy_chipinit(device_t dev); static int ata_marvell_edma_ch_attach(device_t dev); static int ata_marvell_edma_ch_detach(device_t dev); static int ata_marvell_edma_status(device_t dev); @@ -70,7 +71,7 @@ static void ata_marvell_edma_dmainit(dev #define MV_6042 62 #define MV_7042 72 #define MV_61XX 61 - +#define MV_91XX 91 /* * Marvell chipset support functions @@ -113,9 +114,11 @@ ata_marvell_probe(device_t dev) { ATA_M88SX6121, 0, 2, MV_61XX, ATA_UDMA6, "88SX6121" }, { ATA_M88SX6141, 0, 4, MV_61XX, ATA_UDMA6, "88SX6141" }, { ATA_M88SX6145, 0, 4, MV_61XX, ATA_UDMA6, "88SX6145" }, + { 0x91a41b4b, 0, 0, MV_91XX, ATA_UDMA6, "88SE912x" }, { 0, 0, 0, 0, 0, 0}}; - if (pci_get_vendor(dev) != ATA_MARVELL_ID) + if (pci_get_vendor(dev) != ATA_MARVELL_ID && + pci_get_vendor(dev) != ATA_MARVELL2_ID) return ENXIO; if (!(ctlr->chip = ata_match_chip(dev, ids))) @@ -133,6 +136,9 @@ ata_marvell_probe(device_t dev) case MV_61XX: ctlr->chipinit = ata_marvell_chipinit; break; + case MV_91XX: + ctlr->chipinit = ata_marvell_dummy_chipinit; + break; } return (BUS_PROBE_DEFAULT); } @@ -190,6 +196,15 @@ ata_marvell_setmode(device_t dev, int ta return (mode); } +static int +ata_marvell_dummy_chipinit(device_t dev) +{ + struct ata_pci_controller *ctlr = device_get_softc(dev); + + ctlr->channels = 0; + return (0); +} + int ata_marvell_edma_chipinit(device_t dev) { From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:38:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94882106568D; Sun, 14 Feb 2010 19:38:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F71D8FC15; Sun, 14 Feb 2010 19:38:27 +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 o1EJcRJl065480; Sun, 14 Feb 2010 19:38:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJcRpx065470; Sun, 14 Feb 2010 19:38:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141938.o1EJcRpx065470@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:38:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:38:27 -0000 Author: mav Date: Sun Feb 14 19:38:27 2010 New Revision: 203889 URL: http://svn.freebsd.org/changeset/base/203889 Log: MFC r203108: Large set of CAM improvements: - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs. Modified: stable/8/sys/cam/ata/ata_all.c stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/ata/ata_pmp.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam.c stable/8/sys/cam/cam.h stable/8/sys/cam/cam_ccb.h stable/8/sys/cam/cam_periph.c stable/8/sys/cam/cam_periph.h stable/8/sys/cam/cam_queue.h stable/8/sys/cam/cam_sim.c stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/cam_xpt.h stable/8/sys/cam/cam_xpt_internal.h stable/8/sys/cam/cam_xpt_periph.h stable/8/sys/cam/cam_xpt_sim.h stable/8/sys/cam/scsi/scsi_all.c stable/8/sys/cam/scsi/scsi_cd.c stable/8/sys/cam/scsi/scsi_ch.c stable/8/sys/cam/scsi/scsi_da.c stable/8/sys/cam/scsi/scsi_low.c stable/8/sys/cam/scsi/scsi_pass.c stable/8/sys/cam/scsi/scsi_xpt.c stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h stable/8/sys/dev/asr/asr.c stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/atapi-cam.c stable/8/sys/dev/ciss/ciss.c stable/8/sys/dev/hptiop/hptiop.c stable/8/sys/dev/hptrr/hptrr_osm_bsd.c stable/8/sys/dev/hptrr/os_bsd.h stable/8/sys/dev/mly/mly.c stable/8/sys/dev/mpt/mpt_cam.h stable/8/sys/dev/mpt/mpt_raid.c stable/8/sys/dev/ppbus/vpo.c stable/8/sys/dev/siis/siis.c stable/8/sys/dev/trm/trm.c stable/8/sys/dev/twa/tw_osl_cam.c stable/8/sys/dev/usb/storage/umass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/ata/ata_all.c Sun Feb 14 19:38:27 2010 (r203889) @@ -198,7 +198,7 @@ ata_command_sbuf(struct ccb_ataio *ataio { char cmd_str[(12 * 3) + 1]; - sbuf_printf(sb, "CMD: %s: %s", + sbuf_printf(sb, "%s. ACB: %s", ata_op_string(&ataio->cmd), ata_cmd_string(&ataio->cmd, cmd_str, sizeof(cmd_str))); @@ -212,7 +212,7 @@ int ata_status_sbuf(struct ccb_ataio *ataio, struct sbuf *sb) { - sbuf_printf(sb, "ATA Status: %02x (%s%s%s%s%s%s%s%s)", + sbuf_printf(sb, "ATA status: %02x (%s%s%s%s%s%s%s%s)", ataio->res.status, (ataio->res.status & 0x80) ? "BSY " : "", (ataio->res.status & 0x40) ? "DRDY " : "", @@ -223,7 +223,7 @@ ata_status_sbuf(struct ccb_ataio *ataio, (ataio->res.status & 0x02) ? "IDX " : "", (ataio->res.status & 0x01) ? "ERR" : ""); if (ataio->res.status & 1) { - sbuf_printf(sb, ", Error: %02x (%s%s%s%s%s%s%s%s)", + sbuf_printf(sb, ", error: %02x (%s%s%s%s%s%s%s%s)", ataio->res.error, (ataio->res.error & 0x80) ? "ICRC " : "", (ataio->res.error & 0x40) ? "UNC " : "", Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/ata/ata_da.c Sun Feb 14 19:38:27 2010 (r203889) @@ -689,7 +689,7 @@ adaregister(struct cam_periph *periph, v /* Check if the SIM does not want queued commands */ bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); if (cpi.ccb_h.status != CAM_REQ_CMP || Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/ata/ata_pmp.c Sun Feb 14 19:38:27 2010 (r203889) @@ -98,6 +98,9 @@ struct pmp_softc { int reset; int frozen; int restart; + int events; +#define PMP_EV_RESET 1 +#define PMP_EV_RESCAN 2 union ccb saved_ccb; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; @@ -179,7 +182,8 @@ pmpfreeze(struct cam_periph *periph, int i, 0) == CAM_REQ_CMP) { softc->frozen |= (1 << i); xpt_acquire_device(dpath->device); - cam_freeze_devq(dpath); + cam_freeze_devq_arg(dpath, + RELSIM_RELEASE_RUNLEVEL, CAM_RL_BUS + 1); xpt_free_path(dpath); } } @@ -200,7 +204,8 @@ pmprelease(struct cam_periph *periph, in xpt_path_path_id(periph->path), i, 0) == CAM_REQ_CMP) { softc->frozen &= ~(1 << i); - cam_release_devq(dpath, 0, 0, 0, FALSE); + cam_release_devq(dpath, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_BUS + 1, FALSE); xpt_release_device(dpath->device); xpt_free_path(dpath); } @@ -298,19 +303,20 @@ pmpasync(void *callback_arg, u_int32_t c case AC_BUS_RESET: softc = (struct pmp_softc *)periph->softc; cam_periph_async(periph, code, path, arg); - if (code == AC_SCSI_AEN && softc->state != PMP_STATE_NORMAL && - softc->state != PMP_STATE_SCAN) - break; - if (softc->state != PMP_STATE_SCAN) - pmpfreeze(periph, softc->found); + if (code == AC_SCSI_AEN) + softc->events |= PMP_EV_RESCAN; else - pmpfreeze(periph, softc->found & ~(1 << softc->pm_step)); + softc->events |= PMP_EV_RESET; + if (code == AC_SCSI_AEN && softc->state != PMP_STATE_NORMAL) + break; + xpt_hold_boot(); + pmpfreeze(periph, softc->found); if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PORTS; + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); - xpt_schedule(periph, CAM_PRIORITY_BUS); + xpt_schedule(periph, CAM_PRIORITY_DEV); } else softc->restart = 1; break; @@ -353,7 +359,6 @@ static cam_status pmpregister(struct cam_periph *periph, void *arg) { struct pmp_softc *softc; - struct ccb_pathinq cpi; struct ccb_getdev *cgd; cgd = (struct ccb_getdev *)arg; @@ -377,16 +382,8 @@ pmpregister(struct cam_periph *periph, v } periph->softc = softc; - softc->state = PMP_STATE_PORTS; softc->pm_pid = ((uint32_t *)&cgd->ident_data)[0]; softc->pm_prv = ((uint32_t *)&cgd->ident_data)[1]; - - /* Check if the SIM does not want queued commands */ - bzero(&cpi, sizeof(cpi)); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); - TASK_INIT(&softc->sysctl_task, 0, pmpsysctlinit, periph); xpt_announce_periph(periph, NULL); @@ -408,7 +405,10 @@ pmpregister(struct cam_periph *periph, v * the end of probe. */ (void)cam_periph_acquire(periph); - xpt_schedule(periph, CAM_PRIORITY_BUS); + xpt_hold_boot(); + softc->state = PMP_STATE_PORTS; + softc->events = PMP_EV_RESCAN; + xpt_schedule(periph, CAM_PRIORITY_DEV); return(CAM_REQ_CMP); } @@ -416,17 +416,35 @@ pmpregister(struct cam_periph *periph, v static void pmpstart(struct cam_periph *periph, union ccb *start_ccb) { + struct ccb_trans_settings cts; struct ccb_ataio *ataio; struct pmp_softc *softc; + struct cam_path *dpath; + int revision = 0; softc = (struct pmp_softc *)periph->softc; ataio = &start_ccb->ataio; if (softc->restart) { softc->restart = 0; - softc->state = PMP_STATE_PORTS; + softc->state = min(softc->state, PMP_STATE_PRECONFIG); + } + /* Fetch user wanted device speed. */ + if (softc->state == PMP_STATE_RESET || + softc->state == PMP_STATE_CONNECT) { + if (xpt_create_path(&dpath, periph, + xpt_path_path_id(periph->path), + softc->pm_step, 0) == CAM_REQ_CMP) { + bzero(&cts, sizeof(cts)); + xpt_setup_ccb(&cts.ccb_h, dpath, CAM_PRIORITY_NONE); + cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; + cts.type = CTS_TYPE_USER_SETTINGS; + xpt_action((union ccb *)&cts); + if (cts.xport_specific.sata.valid & CTS_SATA_VALID_REVISION) + revision = cts.xport_specific.sata.revision; + xpt_free_path(dpath); + } } - switch (softc->state) { case PMP_STATE_PORTS: cam_fill_ataio(ataio, @@ -460,7 +478,8 @@ pmpstart(struct cam_periph *periph, unio /*dxfer_len*/0, pmp_default_timeout * 1000); ata_pm_write_cmd(ataio, 2, softc->pm_step, - (softc->found & (1 << softc->pm_step)) ? 0 : 1); + (revision << 4) | + ((softc->found & (1 << softc->pm_step)) ? 0 : 1)); break; case PMP_STATE_CONNECT: cam_fill_ataio(ataio, @@ -471,7 +490,8 @@ pmpstart(struct cam_periph *periph, unio /*data_ptr*/NULL, /*dxfer_len*/0, pmp_default_timeout * 1000); - ata_pm_write_cmd(ataio, 2, softc->pm_step, 0); + ata_pm_write_cmd(ataio, 2, softc->pm_step, + (revision << 4)); break; case PMP_STATE_CHECK: cam_fill_ataio(ataio, @@ -519,9 +539,9 @@ pmpdone(struct cam_periph *periph, union struct ccb_trans_settings cts; struct pmp_softc *softc; struct ccb_ataio *ataio; - union ccb *work_ccb; struct cam_path *path, *dpath; u_int32_t priority, res; + int i; softc = (struct pmp_softc *)periph->softc; ataio = &done_ccb->ataio; @@ -547,16 +567,8 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; - if (softc->state == PMP_STATE_SCAN) { - pmpfreeze(periph, 1 << softc->pm_step); - work_ccb = done_ccb; - done_ccb = (union ccb*)work_ccb->ccb_h.ppriv_ptr0; - /* Free the current request path- we're done with it. */ - xpt_free_path(work_ccb->ccb_h.path); - xpt_free_ccb(work_ccb); - } xpt_release_ccb(done_ccb); - softc->state = PMP_STATE_PORTS; + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -645,7 +657,7 @@ pmpdone(struct cam_periph *periph, union xpt_path_path_id(periph->path), softc->pm_step, 0) == CAM_REQ_CMP) { bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, dpath, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, dpath, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cts.xport_specific.sata.revision = (res & 0x0f0) >> 4; @@ -705,53 +717,43 @@ pmpdone(struct cam_periph *periph, union xpt_schedule(periph, priority); return; case PMP_STATE_CONFIG: - if (softc->found) { - softc->pm_step = 0; - softc->state = PMP_STATE_SCAN; - work_ccb = xpt_alloc_ccb_nowait(); - if (work_ccb != NULL) - goto do_scan; - xpt_release_ccb(done_ccb); + for (i = 0; i < softc->pm_ports; i++) { + union ccb *ccb; + + if ((softc->found & (1 << i)) == 0) + continue; + if (xpt_create_path(&dpath, periph, + xpt_path_path_id(periph->path), + i, 0) != CAM_REQ_CMP) { + printf("pmpdone: xpt_create_path failed" + ", bus scan halted\n"); + xpt_free_ccb(done_ccb); + goto done; + } + /* If we did hard reset to this device, inform XPT. */ + if ((softc->reset & softc->found & (1 << i)) != 0) + xpt_async(AC_SENT_BDR, dpath, NULL); + /* If rescan requested, scan this device. */ + if (softc->events & PMP_EV_RESCAN) { + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + xpt_free_path(dpath); + goto done; + } + xpt_setup_ccb(&ccb->ccb_h, dpath, CAM_PRIORITY_XPT); + xpt_rescan(ccb); + } else + xpt_free_path(dpath); } break; - case PMP_STATE_SCAN: - work_ccb = done_ccb; - done_ccb = (union ccb*)work_ccb->ccb_h.ppriv_ptr0; - /* Free the current request path- we're done with it. */ - xpt_free_path(work_ccb->ccb_h.path); - softc->pm_step++; -do_scan: - while (softc->pm_step < softc->pm_ports && - (softc->found & (1 << softc->pm_step)) == 0) { - softc->pm_step++; - } - if (softc->pm_step >= softc->pm_ports) { - xpt_free_ccb(work_ccb); - break; - } - if (xpt_create_path(&dpath, periph, - done_ccb->ccb_h.path_id, - softc->pm_step, 0) != CAM_REQ_CMP) { - printf("pmpdone: xpt_create_path failed" - ", bus scan halted\n"); - xpt_free_ccb(work_ccb); - break; - } - xpt_setup_ccb(&work_ccb->ccb_h, dpath, - done_ccb->ccb_h.pinfo.priority); - work_ccb->ccb_h.func_code = XPT_SCAN_LUN; - work_ccb->ccb_h.cbfcnp = pmpdone; - work_ccb->ccb_h.ppriv_ptr0 = done_ccb; - work_ccb->crcn.flags = done_ccb->crcn.flags; - xpt_action(work_ccb); - pmprelease(periph, 1 << softc->pm_step); - return; default: break; } done: xpt_release_ccb(done_ccb); softc->state = PMP_STATE_NORMAL; + softc->events = 0; + xpt_release_boot(); pmprelease(periph, -1); cam_periph_release_locked(periph); } Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:38:27 2010 (r203889) @@ -130,6 +130,7 @@ typedef struct { u_int8_t digest[16]; uint32_t pm_pid; uint32_t pm_prv; + int restart; struct cam_periph *periph; } probe_softc; @@ -231,15 +232,11 @@ proberegister(struct cam_periph *periph, if (status != CAM_REQ_CMP) { return (status); } - - /* - * Ensure we've waited at least a bus settle - * delay before attempting to probe the device. - * For HBAs that don't do bus resets, this won't make a difference. + * Ensure nobody slip in until probe finish. */ - cam_periph_freeze_after_event(periph, &periph->path->bus->last_reset, - scsi_delay); + cam_freeze_devq_arg(periph->path, + RELSIM_RELEASE_RUNLEVEL, CAM_RL_XPT + 1); probeschedule(periph); return(CAM_REQ_CMP); } @@ -247,17 +244,12 @@ proberegister(struct cam_periph *periph, static void probeschedule(struct cam_periph *periph) { - struct ccb_pathinq cpi; union ccb *ccb; probe_softc *softc; softc = (probe_softc *)periph->softc; ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); - xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - cpi.ccb_h.func_code = XPT_PATH_INQ; - xpt_action((union ccb *)&cpi); - if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) || periph->path->device->protocol == PROTO_SATAPM) PROBE_SET_ACTION(softc, PROBE_RESET); @@ -269,7 +261,7 @@ probeschedule(struct cam_periph *periph) else softc->flags &= ~PROBE_NO_ANNOUNCE; - xpt_schedule(periph, ccb->ccb_h.pinfo.priority); + xpt_schedule(periph, CAM_PRIORITY_XPT); } static void @@ -290,6 +282,14 @@ probestart(struct cam_periph *periph, un csio = &start_ccb->csio; ident_buf = &periph->path->device->ident_data; + if (softc->restart) { + softc->restart = 0; + if ((path->device->flags & CAM_DEV_UNCONFIGURED) || + path->device->protocol == PROTO_SATAPM) + softc->action = PROBE_RESET; + else + softc->action = PROBE_IDENTIFY; + } switch (softc->action) { case PROBE_RESET: cam_fill_ataio(ataio, @@ -299,7 +299,7 @@ probestart(struct cam_periph *periph, un 0, /*data_ptr*/NULL, /*dxfer_len*/0, - (start_ccb->ccb_h.target_id == 15 ? 3 : 15) * 1000); + 15 * 1000); ata_reset_cmd(ataio); break; case PROBE_IDENTIFY: @@ -339,7 +339,7 @@ probestart(struct cam_periph *periph, un mode = 0; /* Fetch user modes from SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); @@ -355,7 +355,7 @@ negotiate: wantmode = mode = ata_max_mode(ident_buf, mode); /* Report modes to SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; if (path->device->transport == XPORT_ATA) { @@ -368,7 +368,7 @@ negotiate: xpt_action((union ccb *)&cts); /* Fetch current modes from SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); @@ -400,7 +400,7 @@ negotiate: bytecount = 8192; /* SATA maximum */ /* Fetch user bytecount from SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); @@ -416,7 +416,7 @@ negotiate: bytecount / ata_logical_sector_size(ident_buf))); /* Report bytecount to SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; if (path->device->transport == XPORT_ATA) { @@ -431,7 +431,7 @@ negotiate: xpt_action((union ccb *)&cts); /* Fetch current bytecount from SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); @@ -462,7 +462,7 @@ negotiate: bytecount = 8192; /* SATA maximum */ /* Fetch user bytecount from SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); @@ -482,7 +482,7 @@ negotiate: } /* Report bytecount to SIM. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; if (path->device->transport == XPORT_ATA) { @@ -560,7 +560,7 @@ proberequestdefaultnegotiation(struct ca { struct ccb_trans_settings cts; - xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); @@ -582,7 +582,7 @@ proberequestbackoff(struct cam_periph *p struct ccb_trans_settings_spi *spi; memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); @@ -739,7 +739,7 @@ noerror: done_ccb->ccb_h.target_id == 15) { /* Report SIM that PM is present. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cts.xport_specific.sata.pm_present = 1; @@ -836,7 +836,7 @@ noerror: path->bus->sim->max_tagged_dev_openings != 0) { /* Report SIM which tags are allowed. */ bzero(&cts, sizeof(cts)); - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cts.xport_specific.sata.tags = path->device->maxtags; @@ -957,18 +957,23 @@ noerror: break; } done: - xpt_release_ccb(done_ccb); - done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs); - TAILQ_REMOVE(&softc->request_ccbs, &done_ccb->ccb_h, periph_links.tqe); - done_ccb->ccb_h.status = CAM_REQ_CMP; - done_ccb->ccb_h.ppriv_field1 = found; - xpt_done(done_ccb); - if (TAILQ_FIRST(&softc->request_ccbs) == NULL) { - cam_periph_invalidate(periph); - cam_periph_release_locked(periph); - } else { + if (softc->restart) { + softc->restart = 0; + xpt_release_ccb(done_ccb); probeschedule(periph); + return; } + xpt_release_ccb(done_ccb); + while ((done_ccb = (union ccb *)TAILQ_FIRST(&softc->request_ccbs))) { + TAILQ_REMOVE(&softc->request_ccbs, + &done_ccb->ccb_h, periph_links.tqe); + done_ccb->ccb_h.status = found ? CAM_REQ_CMP : CAM_REQ_CMP_ERR; + xpt_done(done_ccb); + } + cam_release_devq(periph->path, + RELSIM_RELEASE_RUNLEVEL, 0, CAM_RL_XPT + 1, FALSE); + cam_periph_invalidate(periph); + cam_periph_release_locked(periph); } static void @@ -1013,7 +1018,7 @@ ata_scan_bus(struct cam_periph *periph, { struct cam_path *path; ata_scan_bus_info *scan_info; - union ccb *work_ccb; + union ccb *work_ccb, *reset_ccb; cam_status status; CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, @@ -1038,6 +1043,26 @@ ata_scan_bus(struct cam_periph *periph, return; } + /* We may need to reset bus first, if we haven't done it yet. */ + if ((work_ccb->cpi.hba_inquiry & + (PI_WIDE_32|PI_WIDE_16|PI_SDTR_ABLE)) && + !(work_ccb->cpi.hba_misc & PIM_NOBUSRESET) && + !timevalisset(&request_ccb->ccb_h.path->bus->last_reset)) { + reset_ccb = xpt_alloc_ccb_nowait(); + xpt_setup_ccb(&reset_ccb->ccb_h, request_ccb->ccb_h.path, + CAM_PRIORITY_NONE); + reset_ccb->ccb_h.func_code = XPT_RESET_BUS; + xpt_action(reset_ccb); + if (reset_ccb->ccb_h.status != CAM_REQ_CMP) { + request_ccb->ccb_h.status = reset_ccb->ccb_h.status; + xpt_free_ccb(reset_ccb); + xpt_free_ccb(work_ccb); + xpt_done(request_ccb); + return; + } + xpt_free_ccb(reset_ccb); + } + /* Save some state for use while we probe for devices */ scan_info = (ata_scan_bus_info *) malloc(sizeof(ata_scan_bus_info), M_CAMXPT, M_NOWAIT); @@ -1071,7 +1096,7 @@ ata_scan_bus(struct cam_periph *periph, /* If there is PMP... */ if ((scan_info->cpi->hba_inquiry & PI_SATAPM) && (scan_info->counter == scan_info->cpi->max_target)) { - if (work_ccb->ccb_h.ppriv_field1 != 0) { + if (work_ccb->ccb_h.status == CAM_REQ_CMP) { /* everything else willbe probed by it */ goto done; } else { @@ -1141,10 +1166,9 @@ ata_scan_lun(struct cam_periph *periph, struct cam_path *new_path; struct cam_periph *old_periph; - CAM_DEBUG(request_ccb->ccb_h.path, CAM_DEBUG_TRACE, - ("xpt_scan_lun\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_scan_lun\n")); - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -1182,7 +1206,7 @@ ata_scan_lun(struct cam_periph *periph, free(new_path, M_CAMXPT); return; } - xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_XPT); request_ccb->ccb_h.cbfcnp = xptscandone; request_ccb->ccb_h.func_code = XPT_SCAN_LUN; request_ccb->crcn.flags = flags; @@ -1194,6 +1218,7 @@ ata_scan_lun(struct cam_periph *periph, softc = (probe_softc *)old_periph->softc; TAILQ_INSERT_TAIL(&softc->request_ccbs, &request_ccb->ccb_h, periph_links.tqe); + softc->restart = 1; } else { status = cam_periph_alloc(proberegister, NULL, probecleanup, probestart, "aprobe", @@ -1281,7 +1306,7 @@ ata_device_transport(struct cam_path *pa struct ata_params *ident_buf = NULL; /* Get transport information from the SIM */ - xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cpi.ccb_h, path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -1301,7 +1326,7 @@ ata_device_transport(struct cam_path *pa ata_version(ident_buf->version_major) : cpi.transport_version; /* Tell the controller what we think */ - xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cts.transport = path->device->transport; @@ -1429,7 +1454,7 @@ ata_set_transfer_settings(struct ccb_tra inq_data = &device->inq_data; scsi = &cts->proto_specific.scsi; - xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cpi.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); @@ -1450,7 +1475,7 @@ ata_set_transfer_settings(struct ccb_tra * Perform sanity checking against what the * controller and device can do. */ - xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&cur_cts.ccb_h, cts->ccb_h.path, CAM_PRIORITY_NONE); cur_cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cur_cts.type = cts->type; xpt_action((union ccb *)&cur_cts); @@ -1550,6 +1575,10 @@ ata_dev_async(u_int32_t async_code, stru */ ata_scan_lun(newpath.periph, &newpath, CAM_EXPECT_INQ_CHANGE, NULL); + } else { + /* We need to reinitialize device after reset. */ + ata_scan_lun(newpath.periph, &newpath, + 0, NULL); } xpt_release_path(&newpath); } else if (async_code == AC_LOST_DEVICE && Modified: stable/8/sys/cam/cam.c ============================================================================== --- stable/8/sys/cam/cam.c Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/cam.c Sun Feb 14 19:38:27 2010 (r203889) @@ -305,10 +305,10 @@ cam_error_string(struct cam_device *devi entry = cam_fetch_status_entry(status); if (entry == NULL) - sbuf_printf(&sb, "CAM Status: Unknown (%#x)\n", + sbuf_printf(&sb, "CAM status: Unknown (%#x)\n", ccb->ccb_h.status); else - sbuf_printf(&sb, "CAM Status: %s\n", + sbuf_printf(&sb, "CAM status: %s\n", entry->status_text); } @@ -338,7 +338,7 @@ cam_error_string(struct cam_device *devi if (proto_flags & CAM_ESF_PRINT_STATUS) { sbuf_cat(&sb, path_str); - sbuf_printf(&sb, "SCSI Status: %s\n", + sbuf_printf(&sb, "SCSI status: %s\n", scsi_status_string(&ccb->csio)); } Modified: stable/8/sys/cam/cam.h ============================================================================== --- stable/8/sys/cam/cam.h Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/cam.h Sun Feb 14 19:38:27 2010 (r203889) @@ -60,16 +60,29 @@ typedef u_int lun_id_t; struct cam_periph; /* - * Priority information for a CAM structure. The generation number is - * incremented everytime a new entry is entered into the queue giving round - * robin per priority level scheduling. + * Priority information for a CAM structure. + */ +typedef enum { + CAM_RL_HOST, + CAM_RL_BUS, + CAM_RL_XPT, + CAM_RL_DEV, + CAM_RL_NORMAL, + CAM_RL_VALUES +} cam_rl; +/* + * The generation number is incremented everytime a new entry is entered into + * the queue giving round robin per priority level scheduling. */ typedef struct { u_int32_t priority; -#define CAM_PRIORITY_BUS 0 -#define CAM_PRIORITY_DEV 0 -#define CAM_PRIORITY_NORMAL 1 +#define CAM_PRIORITY_HOST ((CAM_RL_HOST << 8) + 0x80) +#define CAM_PRIORITY_BUS ((CAM_RL_BUS << 8) + 0x80) +#define CAM_PRIORITY_XPT ((CAM_RL_XPT << 8) + 0x80) +#define CAM_PRIORITY_DEV ((CAM_RL_DEV << 8) + 0x80) +#define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 +#define CAM_PRIORITY_TO_RL(x) ((x) >> 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: stable/8/sys/cam/cam_ccb.h ============================================================================== --- stable/8/sys/cam/cam_ccb.h Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/cam_ccb.h Sun Feb 14 19:38:27 2010 (r203889) @@ -126,7 +126,7 @@ typedef enum { XPT_PATH_INQ = 0x04, /* Path routing inquiry */ XPT_REL_SIMQ = 0x05, - /* Release a frozen SIM queue */ + /* Release a frozen device queue */ XPT_SASYNC_CB = 0x06, /* Set Asynchronous Callback Parameters */ XPT_SDEV_TYPE = 0x07, @@ -142,6 +142,8 @@ typedef enum { /* Path statistics (error counts, etc.) */ XPT_GDEV_STATS = 0x0c, /* Device statistics (error counts, etc.) */ + XPT_FREEZE_QUEUE = 0x0d, + /* Freeze device queue */ /* SCSI Control Functions: 0x10->0x1F */ XPT_ABORT = 0x10, /* Abort the specified CCB */ @@ -685,8 +687,9 @@ struct ccb_relsim { #define RELSIM_RELEASE_AFTER_TIMEOUT 0x02 #define RELSIM_RELEASE_AFTER_CMDCMPLT 0x04 #define RELSIM_RELEASE_AFTER_QEMPTY 0x08 +#define RELSIM_RELEASE_RUNLEVEL 0x10 u_int32_t openings; - u_int32_t release_timeout; + u_int32_t release_timeout; /* Abstract argument. */ u_int32_t qfrozen_cnt; }; Modified: stable/8/sys/cam/cam_periph.c ============================================================================== --- stable/8/sys/cam/cam_periph.c Sun Feb 14 19:28:45 2010 (r203888) +++ stable/8/sys/cam/cam_periph.c Sun Feb 14 19:38:27 2010 (r203889) @@ -71,19 +71,20 @@ static void camperiphfree(struct cam_p static int camperiphscsistatuserror(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, - union ccb *save_ccb, int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout); + u_int32_t *timeout, + const char **action_string); static int camperiphscsisenseerror(union ccb *ccb, cam_flags camflags, u_int32_t sense_flags, - union ccb *save_ccb, int *openings, u_int32_t *relsim_flags, - u_int32_t *timeout); + u_int32_t *timeout, + const char **action_string); static int nperiph_drivers; +static int initialized = 0; struct periph_driver **periph_drivers; MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers"); @@ -99,6 +100,7 @@ TUNABLE_INT("kern.cam.periph_busy_delay" void periphdriver_register(void *data) { + struct periph_driver *drv = (struct periph_driver *)data; struct periph_driver **newdrivers, **old; int ndrivers; @@ -108,13 +110,30 @@ periphdriver_register(void *data) if (periph_drivers) bcopy(periph_drivers, newdrivers, sizeof(*newdrivers) * nperiph_drivers); - newdrivers[nperiph_drivers] = (struct periph_driver *)data; + newdrivers[nperiph_drivers] = drv; newdrivers[nperiph_drivers + 1] = NULL; old = periph_drivers; periph_drivers = newdrivers; if (old) free(old, M_CAMPERIPH); nperiph_drivers++; + /* If driver marked as early or it is late now, initialize it. */ + if (((drv->flags & CAM_PERIPH_DRV_EARLY) != 0 && initialized > 0) || + initialized > 1) + (*drv->init)(); +} + +void +periphdriver_init(int level) +{ + int i, early; + + initialized = max(initialized, level); + for (i = 0; periph_drivers[i] != NULL; i++) { + early = (periph_drivers[i]->flags & CAM_PERIPH_DRV_EARLY) ? 1 : 2; + if (early == initialized) + (*periph_drivers[i]->init)(); + } } cam_status @@ -915,12 +934,14 @@ cam_periph_runccb(union ccb *ccb, } while (error == ERESTART); - if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { cam_release_devq(ccb->ccb_h.path, /* relsim_flags */0, /* openings */0, /* timeout */0, /* getcount_only */ FALSE); + ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + } if (ds != NULL) { if (ccb->ccb_h.func_code == XPT_SCSI_IO) { @@ -950,17 +971,26 @@ cam_periph_runccb(union ccb *ccb, void cam_freeze_devq(struct cam_path *path) { - struct ccb_hdr ccb_h; - xpt_setup_ccb(&ccb_h, path, CAM_PRIORITY_NORMAL); - ccb_h.func_code = XPT_NOOP; - ccb_h.flags = CAM_DEV_QFREEZE; - xpt_action((union ccb *)&ccb_h); + cam_freeze_devq_arg(path, 0, 0); +} + +void +cam_freeze_devq_arg(struct cam_path *path, uint32_t flags, uint32_t arg) +{ + struct ccb_relsim crs; + + xpt_setup_ccb(&crs.ccb_h, path, CAM_PRIORITY_NONE); + crs.ccb_h.func_code = XPT_FREEZE_QUEUE; + crs.release_flags = flags; + crs.openings = arg; + crs.release_timeout = arg; + xpt_action((union ccb *)&crs); } u_int32_t cam_release_devq(struct cam_path *path, u_int32_t relsim_flags, - u_int32_t openings, u_int32_t timeout, + u_int32_t openings, u_int32_t arg, int getcount_only) { struct ccb_relsim crs; @@ -970,22 +1000,92 @@ cam_release_devq(struct cam_path *path, crs.ccb_h.flags = getcount_only ? CAM_DEV_QFREEZE : 0; crs.release_flags = relsim_flags; crs.openings = openings; - crs.release_timeout = timeout; + crs.release_timeout = arg; xpt_action((union ccb *)&crs); return (crs.qfrozen_cnt); } #define saved_ccb_ptr ppriv_ptr0 +#define recovery_depth ppriv_field1 +static void +camperiphsensedone(struct cam_periph *periph, union ccb *done_ccb) +{ + union ccb *saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; + cam_status status; + int frozen = 0; + u_int sense_key; + int depth = done_ccb->ccb_h.recovery_depth; + + status = done_ccb->ccb_h.status; + if (status & CAM_DEV_QFRZN) { + frozen = 1; + /* + * Clear freeze flag now for case of retry, + * freeze will be dropped later. + */ + done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + } + status &= CAM_STATUS_MASK; + switch (status) { + case CAM_REQ_CMP: + { + /* + * If we manually retrieved sense into a CCB and got + * something other than "NO SENSE" send the updated CCB + * back to the client via xpt_done() to be processed via + * the error recovery code again. + */ + sense_key = saved_ccb->csio.sense_data.flags; + sense_key &= SSD_KEY; + if (sense_key != SSD_KEY_NO_SENSE) { + saved_ccb->ccb_h.status |= + CAM_AUTOSNS_VALID; + } else { + saved_ccb->ccb_h.status &= + ~CAM_STATUS_MASK; + saved_ccb->ccb_h.status |= + CAM_AUTOSENSE_FAIL; + } + bcopy(saved_ccb, done_ccb, sizeof(union ccb)); + xpt_free_ccb(saved_ccb); + break; + } + default: + bcopy(saved_ccb, done_ccb, sizeof(union ccb)); + xpt_free_ccb(saved_ccb); + done_ccb->ccb_h.status &= ~CAM_STATUS_MASK; + done_ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL; + break; + } + periph->flags &= ~CAM_PERIPH_SENSE_INPROG; + /* + * If it is the end of recovery, drop freeze, taken due to + * CAM_DEV_QFREEZE flag, set on recovery request. + */ + if (depth == 0) { + cam_release_devq(done_ccb->ccb_h.path, + /*relsim_flags*/0, + /*openings*/0, + /*timeout*/0, + /*getcount_only*/0); + } + /* + * Copy frozen flag from recovery request if it is set there + * for some reason. + */ + if (frozen != 0) + done_ccb->ccb_h.status |= CAM_DEV_QFRZN; + (*done_ccb->ccb_h.cbfcnp)(periph, done_ccb); +} + static void camperiphdone(struct cam_periph *periph, union ccb *done_ccb) { - union ccb *saved_ccb; + union ccb *saved_ccb, *save_ccb; cam_status status; int frozen = 0; - int sense; struct scsi_start_stop_unit *scsi_cmd; u_int32_t relsim_flags, timeout; - int xpt_done_ccb = FALSE; status = done_ccb->ccb_h.status; if (status & CAM_DEV_QFRZN) { @@ -996,14 +1096,12 @@ camperiphdone(struct cam_periph *periph, */ done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; } - sense = (status & CAM_AUTOSNS_VALID) != 0; - status &= CAM_STATUS_MASK; timeout = 0; relsim_flags = 0; saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; - switch (status) { + switch (status & CAM_STATUS_MASK) { case CAM_REQ_CMP: { /* @@ -1012,57 +1110,19 @@ camperiphdone(struct cam_periph *periph, * the inquiry information. Many devices (mostly disks) * don't properly report their inquiry information unless * they are spun up. - * - * If we manually retrieved sense into a CCB and got - * something other than "NO SENSE" send the updated CCB - * back to the client via xpt_done() to be processed via - * the error recovery code again. */ - if (done_ccb->ccb_h.func_code == XPT_SCSI_IO) { - scsi_cmd = (struct scsi_start_stop_unit *) - &done_ccb->csio.cdb_io.cdb_bytes; - - if (scsi_cmd->opcode == START_STOP_UNIT) - xpt_async(AC_INQ_CHANGED, - done_ccb->ccb_h.path, NULL); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:44:49 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D818106566B; Sun, 14 Feb 2010 19:44:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18BA78FC13; Sun, 14 Feb 2010 19:44: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 o1EJinHr066982; Sun, 14 Feb 2010 19:44:49 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJimcD066971; Sun, 14 Feb 2010 19:44:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141944.o1EJimcD066971@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203890 - in stable/8: . contrib/top lib/libusb sbin/camcontrol sys/cam sys/cam/ata sys/dev/ahci sys/dev/ata sys/dev/siis tools/regression/lib/msun tools/regression/usr.bin/pkill tools/... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:44:49 -0000 Author: mav Date: Sun Feb 14 19:44:48 2010 New Revision: 203890 URL: http://svn.freebsd.org/changeset/base/203890 Log: MFC r203376, r203384: - Give ATA/SATA SIMs info about ATAPI packet size, supported by device. - Make ATA XPT to reject longer SCSI CDBs then supported by device, or any SCSI CDBs, if device doesn't support ATAPI. Modified: stable/8/sbin/camcontrol/camcontrol.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/cam/cam_ccb.h stable/8/sys/cam/cam_xpt.c stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h stable/8/sys/dev/ata/ata-all.c stable/8/sys/dev/ata/ata-all.h stable/8/sys/dev/siis/siis.c stable/8/sys/dev/siis/siis.h Directory Properties: stable/8/ (props changed) stable/8/Makefile.inc1 (props changed) stable/8/ObsoleteFiles.inc (props changed) stable/8/UPDATING (props changed) stable/8/bin/ (props changed) stable/8/bin/chmod/ (props changed) stable/8/bin/cp/ (props changed) stable/8/bin/csh/ (props changed) stable/8/bin/getfacl/ (props changed) stable/8/bin/ls/ (props changed) stable/8/bin/mv/ (props changed) stable/8/bin/pax/ (props changed) stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/bin/setfacl/ (props changed) stable/8/bin/sh/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zdb/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/contrib/bind9/ (props changed) stable/8/contrib/bsnmp/ (props changed) stable/8/contrib/bzip2/ (props changed) stable/8/contrib/cpio/ (props changed) stable/8/contrib/csup/ (props changed) stable/8/contrib/ee/ (props changed) stable/8/contrib/expat/ (props changed) stable/8/contrib/file/ (props changed) stable/8/contrib/gcc/ (props changed) stable/8/contrib/gdb/ (props changed) stable/8/contrib/gdtoa/ (props changed) stable/8/contrib/groff/ (props changed) stable/8/contrib/less/ (props changed) stable/8/contrib/libpcap/ (props changed) stable/8/contrib/ncurses/ (props changed) stable/8/contrib/netcat/ (props changed) stable/8/contrib/ntp/ (props changed) stable/8/contrib/one-true-awk/ (props changed) stable/8/contrib/openbsm/ (props changed) stable/8/contrib/openpam/ (props changed) stable/8/contrib/pf/ (props changed) stable/8/contrib/sendmail/ (props changed) stable/8/contrib/tcpdump/ (props changed) stable/8/contrib/tcsh/ (props changed) stable/8/contrib/top/ (props changed) stable/8/contrib/top/install-sh (props changed) stable/8/contrib/traceroute/ (props changed) stable/8/contrib/wpa/ (props changed) stable/8/crypto/heimdal/ (props changed) stable/8/crypto/openssh/ (props changed) stable/8/crypto/openssl/ (props changed) stable/8/etc/ (props changed) stable/8/games/factor/ (props changed) stable/8/games/fortune/ (props changed) stable/8/games/fortune/datfiles/ (props changed) stable/8/gnu/usr.bin/groff/ (props changed) stable/8/gnu/usr.bin/patch/ (props changed) stable/8/include/ (props changed) stable/8/kerberos5/lib/libgssapi_krb5/ (props changed) stable/8/kerberos5/lib/libgssapi_spnego/ (props changed) stable/8/kerberos5/usr.bin/kdestroy/ (props changed) stable/8/kerberos5/usr.bin/kpasswd/ (props changed) stable/8/lib/bind/ (props changed) stable/8/lib/csu/ (props changed) stable/8/lib/libarchive/ (props changed) stable/8/lib/libbluetooth/ (props changed) stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libdevinfo/ (props changed) stable/8/lib/libdisk/ (props changed) stable/8/lib/libelf/ (props changed) stable/8/lib/libexpat/ (props changed) stable/8/lib/libfetch/ (props changed) stable/8/lib/libgpib/ (props changed) stable/8/lib/libgssapi/ (props changed) stable/8/lib/libjail/ (props changed) stable/8/lib/libkvm/ (props changed) stable/8/lib/libpmc/ (props changed) stable/8/lib/libradius/ (props changed) stable/8/lib/librpcsec_gss/ (props changed) stable/8/lib/libstand/ (props changed) stable/8/lib/libtacplus/ (props changed) stable/8/lib/libthr/ (props changed) stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) stable/8/lib/libutil/ (props changed) stable/8/libexec/rtld-elf/ (props changed) stable/8/release/ (props changed) stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/umount/ (props changed) stable/8/secure/usr.bin/bdes/ (props changed) stable/8/share/examples/ (props changed) stable/8/share/man/man3/ (props changed) stable/8/share/man/man4/ (props changed) stable/8/share/man/man5/ (props changed) stable/8/share/man/man7/ (props changed) stable/8/share/man/man8/ (props changed) stable/8/share/man/man9/ (props changed) stable/8/share/misc/ (props changed) stable/8/share/mk/ (props changed) stable/8/share/timedef/ (props changed) stable/8/share/zoneinfo/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) stable/8/usr.bin/awk/ (props changed) stable/8/usr.bin/calendar/ (props changed) stable/8/usr.bin/catman/ (props changed) stable/8/usr.bin/comm/ (props changed) stable/8/usr.bin/csup/ (props changed) stable/8/usr.bin/fetch/ (props changed) stable/8/usr.bin/find/ (props changed) stable/8/usr.bin/finger/ (props changed) stable/8/usr.bin/fstat/ (props changed) stable/8/usr.bin/gcore/ (props changed) stable/8/usr.bin/gzip/ (props changed) stable/8/usr.bin/kdump/ (props changed) stable/8/usr.bin/locale/ (props changed) stable/8/usr.bin/look/ (props changed) stable/8/usr.bin/makewhatis/ (props changed) stable/8/usr.bin/netstat/ (props changed) stable/8/usr.bin/perror/ (props changed) stable/8/usr.bin/procstat/ (props changed) stable/8/usr.bin/systat/ (props changed) stable/8/usr.bin/tftp/ (props changed) stable/8/usr.bin/truss/ (props changed) stable/8/usr.bin/unifdef/ (props changed) stable/8/usr.bin/uniq/ (props changed) stable/8/usr.bin/vmstat/ (props changed) stable/8/usr.bin/w/ (props changed) stable/8/usr.bin/whois/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/Makefile (props changed) stable/8/usr.sbin/acpi/ (props changed) stable/8/usr.sbin/arp/ (props changed) stable/8/usr.sbin/bsnmpd/ (props changed) stable/8/usr.sbin/burncd/ (props changed) stable/8/usr.sbin/cdcontrol/ (props changed) stable/8/usr.sbin/cpucontrol/ (props changed) stable/8/usr.sbin/crashinfo/ (props changed) stable/8/usr.sbin/cron/ (props changed) stable/8/usr.sbin/diskinfo/ (props changed) stable/8/usr.sbin/dumpcis/cardinfo.h (props changed) stable/8/usr.sbin/dumpcis/cis.h (props changed) stable/8/usr.sbin/faithd/ (props changed) stable/8/usr.sbin/freebsd-update/ (props changed) stable/8/usr.sbin/inetd/ (props changed) stable/8/usr.sbin/iostat/ (props changed) stable/8/usr.sbin/jail/ (props changed) stable/8/usr.sbin/jls/ (props changed) stable/8/usr.sbin/lpr/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) stable/8/usr.sbin/mergemaster/ (props changed) stable/8/usr.sbin/mfiutil/mfiutil.8 (props changed) stable/8/usr.sbin/ndp/ (props changed) stable/8/usr.sbin/newsyslog/ (props changed) stable/8/usr.sbin/ntp/ (props changed) stable/8/usr.sbin/pmcstat/ (props changed) stable/8/usr.sbin/powerd/ (props changed) stable/8/usr.sbin/ppp/ (props changed) stable/8/usr.sbin/pstat/ (props changed) stable/8/usr.sbin/rpc.umntall/ (props changed) stable/8/usr.sbin/rtsold/ (props changed) stable/8/usr.sbin/service/ (props changed) stable/8/usr.sbin/sysinstall/ (props changed) stable/8/usr.sbin/syslogd/ (props changed) stable/8/usr.sbin/traceroute/ (props changed) stable/8/usr.sbin/traceroute6/ (props changed) stable/8/usr.sbin/usbconfig/ (props changed) stable/8/usr.sbin/wpa/ (props changed) stable/8/usr.sbin/ypserv/ (props changed) stable/8/usr.sbin/zic/ (props changed) Modified: stable/8/sbin/camcontrol/camcontrol.c ============================================================================== --- stable/8/sbin/camcontrol/camcontrol.c Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sbin/camcontrol/camcontrol.c Sun Feb 14 19:44:48 2010 (r203890) @@ -1010,8 +1010,10 @@ camxferrate(struct cam_device *device) printf(" ("); if (ata->valid & CTS_ATA_VALID_MODE) printf("%s, ", ata_mode2string(ata->mode)); + if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) + printf("ATAPI %dbytes, ", ata->atapi); if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO size %dbytes", ata->bytecount); + printf("PIO %dbytes", ata->bytecount); printf(")"); } else if (ccb->cts.transport == XPORT_SATA) { struct ccb_trans_settings_sata *sata = @@ -1022,8 +1024,10 @@ camxferrate(struct cam_device *device) printf("SATA %d.x, ", sata->revision); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); + if ((sata->valid & CTS_SATA_VALID_ATAPI) && sata->atapi != 0) + printf("ATAPI %dbytes, ", sata->atapi); if (sata->valid & CTS_SATA_VALID_BYTECOUNT) - printf("PIO size %dbytes", sata->bytecount); + printf("PIO %dbytes", sata->bytecount); printf(")"); } @@ -2800,6 +2804,10 @@ cts_print(struct cam_device *device, str fprintf(stdout, "%sATA mode: %s\n", pathstr, ata_mode2string(ata->mode)); } + if ((ata->valid & CTS_ATA_VALID_ATAPI) != 0) { + fprintf(stdout, "%sATAPI packet length: %d\n", pathstr, + ata->atapi); + } if ((ata->valid & CTS_ATA_VALID_BYTECOUNT) != 0) { fprintf(stdout, "%sPIO transaction length: %d\n", pathstr, ata->bytecount); @@ -2817,6 +2825,10 @@ cts_print(struct cam_device *device, str fprintf(stdout, "%sATA mode: %s\n", pathstr, ata_mode2string(sata->mode)); } + if ((sata->valid & CTS_SATA_VALID_ATAPI) != 0) { + fprintf(stdout, "%sATAPI packet length: %d\n", pathstr, + sata->atapi); + } if ((sata->valid & CTS_SATA_VALID_BYTECOUNT) != 0) { fprintf(stdout, "%sPIO transaction length: %d\n", pathstr, sata->bytecount); Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:44:48 2010 (r203890) @@ -1334,7 +1334,20 @@ ata_device_transport(struct cam_path *pa cts.protocol = path->device->protocol; cts.protocol_version = path->device->protocol_version; cts.proto_specific.valid = 0; - cts.xport_specific.valid = 0; + if (ident_buf) { + if (path->device->transport == XPORT_ATA) { + cts.xport_specific.ata.atapi = + ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) ? 16 : + ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) ? 12 : 0; + cts.xport_specific.ata.valid = CTS_ATA_VALID_ATAPI; + } else { + cts.xport_specific.sata.atapi = + ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_16) ? 16 : + ((ident_buf->config & ATA_PROTO_MASK) == ATA_PROTO_ATAPI_12) ? 12 : 0; + cts.xport_specific.sata.valid = CTS_SATA_VALID_ATAPI; + } + } else + cts.xport_specific.valid = 0; xpt_action((union ccb *)&cts); } @@ -1366,6 +1379,27 @@ ata_action(union ccb *start_ccb) (*(sim->sim_action))(sim, start_ccb); break; } + case XPT_SCSI_IO: + { + struct cam_ed *device; + u_int maxlen = 0; + + device = start_ccb->ccb_h.path->device; + if (device->protocol == PROTO_SCSI && + (device->flags & CAM_DEV_IDENTIFY_DATA_VALID)) { + uint16_t p = + device->ident_data.config & ATA_PROTO_MASK; + + maxlen = (p == ATA_PROTO_ATAPI_16) ? 16 : + (p == ATA_PROTO_ATAPI_12) ? 12 : 0; + } + if (start_ccb->csio.cdb_len > maxlen) { + start_ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(start_ccb); + break; + } + /* FALLTHROUGH */ + } default: xpt_action_default(start_ccb); break; Modified: stable/8/sys/cam/cam_ccb.h ============================================================================== --- stable/8/sys/cam/cam_ccb.h Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/cam/cam_ccb.h Sun Feb 14 19:44:48 2010 (r203890) @@ -823,8 +823,10 @@ struct ccb_trans_settings_ata { u_int valid; /* Which fields to honor */ #define CTS_ATA_VALID_MODE 0x01 #define CTS_ATA_VALID_BYTECOUNT 0x02 +#define CTS_ATA_VALID_ATAPI 0x20 int mode; /* Mode */ u_int bytecount; /* Length of PIO transaction */ + u_int atapi; /* Length of ATAPI CDB */ }; struct ccb_trans_settings_sata { @@ -834,11 +836,13 @@ struct ccb_trans_settings_sata { #define CTS_SATA_VALID_REVISION 0x04 #define CTS_SATA_VALID_PM 0x08 #define CTS_SATA_VALID_TAGS 0x10 +#define CTS_SATA_VALID_ATAPI 0x20 int mode; /* Legacy PATA mode */ u_int bytecount; /* Length of PIO transaction */ int revision; /* SATA revision */ u_int pm_present; /* PM is present (XPT->SIM) */ u_int tags; /* Number of allowed tags */ + u_int atapi; /* Length of ATAPI CDB */ }; /* Get/Set transfer rate/width/disconnection/tag queueing settings */ Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/cam/cam_xpt.c Sun Feb 14 19:44:48 2010 (r203890) @@ -1201,8 +1201,10 @@ xpt_announce_periph(struct cam_periph *p printf(" ("); if (ata->valid & CTS_ATA_VALID_MODE) printf("%s, ", ata_mode2string(ata->mode)); + if ((ata->valid & CTS_ATA_VALID_ATAPI) && ata->atapi != 0) + printf("ATAPI %dbytes, ", ata->atapi); if (ata->valid & CTS_ATA_VALID_BYTECOUNT) - printf("PIO size %dbytes", ata->bytecount); + printf("PIO %dbytes", ata->bytecount); printf(")"); } if (cts.ccb_h.status == CAM_REQ_CMP && cts.transport == XPORT_SATA) { @@ -1214,8 +1216,10 @@ xpt_announce_periph(struct cam_periph *p printf("SATA %d.x, ", sata->revision); if (sata->valid & CTS_SATA_VALID_MODE) printf("%s, ", ata_mode2string(sata->mode)); + if ((sata->valid & CTS_ATA_VALID_ATAPI) && sata->atapi != 0) + printf("ATAPI %dbytes, ", sata->atapi); if (sata->valid & CTS_SATA_VALID_BYTECOUNT) - printf("PIO size %dbytes", sata->bytecount); + printf("PIO %dbytes", sata->bytecount); printf(")"); } if (path->device->inq_flags & SID_CmdQue Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:44:48 2010 (r203890) @@ -2213,6 +2213,8 @@ ahciaction(struct cam_sim *sim, union cc d->tags = min(ch->numslots, cts->xport_specific.sata.tags); if (cts->xport_specific.sata.valid & CTS_SATA_VALID_PM) ch->pm_present = cts->xport_specific.sata.pm_present; + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_ATAPI) + d->atapi = cts->xport_specific.sata.atapi; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -2256,6 +2258,8 @@ ahciaction(struct cam_sim *sim, union cc cts->xport_specific.sata.valid |= CTS_SATA_VALID_PM; cts->xport_specific.sata.tags = d->tags; cts->xport_specific.sata.valid |= CTS_SATA_VALID_TAGS; + cts->xport_specific.sata.atapi = d->atapi; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; Modified: stable/8/sys/dev/ahci/ahci.h ============================================================================== --- stable/8/sys/dev/ahci/ahci.h Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/dev/ahci/ahci.h Sun Feb 14 19:44:48 2010 (r203890) @@ -358,6 +358,7 @@ struct ahci_device { int revision; int mode; u_int bytecount; + u_int atapi; u_int tags; }; Modified: stable/8/sys/dev/ata/ata-all.c ============================================================================== --- stable/8/sys/dev/ata/ata-all.c Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/dev/ata/ata-all.c Sun Feb 14 19:44:48 2010 (r203890) @@ -1348,6 +1348,8 @@ ata_cam_begin_transaction(device_t dev, ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes, request->u.atapi.ccb, ccb->csio.cdb_len); request->flags |= ATA_R_ATAPI; + if (ch->curr[ccb->ccb_h.target_id].atapi == 16) + request->flags |= ATA_R_ATAPI16; if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE && ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA) request->flags |= ATA_R_DMA; @@ -1358,7 +1360,6 @@ ata_cam_begin_transaction(device_t dev, } request->transfersize = min(request->bytecount, ch->curr[ccb->ccb_h.target_id].bytecount); -// request->callback = ad_done; request->retries = 0; request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); @@ -1491,7 +1492,7 @@ ataaction(struct cam_sim *sim, union ccb if (ch->flags & ATA_SATA) { if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION) d->revision = cts->xport_specific.sata.revision; - if (cts->xport_specific.ata.valid & CTS_SATA_VALID_MODE) { + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_MODE) { if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { d->mode = ATA_SETMODE(ch->dev, ccb->ccb_h.target_id, @@ -1499,8 +1500,10 @@ ataaction(struct cam_sim *sim, union ccb } else d->mode = cts->xport_specific.sata.mode; } - if (cts->xport_specific.ata.valid & CTS_SATA_VALID_BYTECOUNT) + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT) d->bytecount = min(8192, cts->xport_specific.sata.bytecount); + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_ATAPI) + d->atapi = cts->xport_specific.sata.atapi; } else { if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) { if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { @@ -1512,6 +1515,8 @@ ataaction(struct cam_sim *sim, union ccb } if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT) d->bytecount = cts->xport_specific.ata.bytecount; + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_ATAPI) + d->atapi = cts->xport_specific.ata.atapi; } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -1541,6 +1546,8 @@ ataaction(struct cam_sim *sim, union ccb } else cts->xport_specific.sata.revision = d->revision; cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; + cts->xport_specific.sata.atapi = d->atapi; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; } else { cts->transport = XPORT_ATA; cts->transport_version = XPORT_VERSION_UNSPECIFIED; @@ -1548,6 +1555,8 @@ ataaction(struct cam_sim *sim, union ccb cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; cts->xport_specific.ata.bytecount = d->bytecount; cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + cts->xport_specific.ata.atapi = d->atapi; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_ATAPI; } ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); Modified: stable/8/sys/dev/ata/ata-all.h ============================================================================== --- stable/8/sys/dev/ata/ata-all.h Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/dev/ata/ata-all.h Sun Feb 14 19:44:48 2010 (r203890) @@ -539,6 +539,7 @@ struct ata_cam_device { u_int revision; int mode; u_int bytecount; + u_int atapi; }; #endif Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/dev/siis/siis.c Sun Feb 14 19:44:48 2010 (r203890) @@ -1671,6 +1671,8 @@ siisaction(struct cam_sim *sim, union cc else ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_PME); } + if (cts->xport_specific.sata.valid & CTS_SATA_VALID_TAGS) + d->atapi = cts->xport_specific.sata.atapi; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -1714,6 +1716,8 @@ siisaction(struct cam_sim *sim, union cc cts->xport_specific.sata.valid |= CTS_SATA_VALID_PM; cts->xport_specific.sata.tags = d->tags; cts->xport_specific.sata.valid |= CTS_SATA_VALID_TAGS; + cts->xport_specific.sata.atapi = d->atapi; + cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; Modified: stable/8/sys/dev/siis/siis.h ============================================================================== --- stable/8/sys/dev/siis/siis.h Sun Feb 14 19:38:27 2010 (r203889) +++ stable/8/sys/dev/siis/siis.h Sun Feb 14 19:44:48 2010 (r203890) @@ -356,6 +356,7 @@ struct siis_device { int revision; int mode; u_int bytecount; + u_int atapi; u_int tags; }; From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:46:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E73106566B; Sun, 14 Feb 2010 19:46:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D74238FC14; Sun, 14 Feb 2010 19:46: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 o1EJksjD067491; Sun, 14 Feb 2010 19:46:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJksAg067487; Sun, 14 Feb 2010 19:46:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141946.o1EJksAg067487@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203891 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:46:55 -0000 Author: mav Date: Sun Feb 14 19:46:54 2010 New Revision: 203891 URL: http://svn.freebsd.org/changeset/base/203891 Log: MFC r203385: - Use separate buffer for identify data fetching. We can't use main buffer here if device already running, as data need to be formatted before use. - Remove some saved_ccb variables. They are unused now. Modified: stable/8/sys/cam/ata/ata_da.c stable/8/sys/cam/ata/ata_pmp.c stable/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/ata/ata_da.c ============================================================================== --- stable/8/sys/cam/ata/ata_da.c Sun Feb 14 19:44:48 2010 (r203890) +++ stable/8/sys/cam/ata/ata_da.c Sun Feb 14 19:46:54 2010 (r203891) @@ -123,7 +123,6 @@ struct ada_softc { int trim_running; struct disk_params params; struct disk *disk; - union ccb saved_ccb; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -1098,8 +1097,7 @@ adaerror(union ccb *ccb, u_int32_t cam_f periph = xpt_path_periph(ccb->ccb_h.path); softc = (struct ada_softc *)periph->softc; - return(cam_periph_error(ccb, cam_flags, sense_flags, - &softc->saved_ccb)); + return(cam_periph_error(ccb, cam_flags, sense_flags, NULL)); } static void Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Sun Feb 14 19:44:48 2010 (r203890) +++ stable/8/sys/cam/ata/ata_pmp.c Sun Feb 14 19:46:54 2010 (r203891) @@ -101,7 +101,6 @@ struct pmp_softc { int events; #define PMP_EV_RESET 1 #define PMP_EV_RESCAN 2 - union ccb saved_ccb; struct task sysctl_task; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; @@ -552,8 +551,7 @@ pmpdone(struct cam_periph *periph, union priority = done_ccb->ccb_h.pinfo.priority; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { - if (cam_periph_error(done_ccb, 0, 0, - &softc->saved_ccb) == ERESTART) { + if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) { return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { cam_release_devq(done_ccb->ccb_h.path, Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:44:48 2010 (r203890) +++ stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:46:54 2010 (r203891) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -124,10 +123,9 @@ typedef enum { typedef struct { TAILQ_HEAD(, ccb_hdr) request_ccbs; + struct ata_params ident_data; probe_action action; - union ccb saved_ccb; probe_flags flags; - u_int8_t digest[16]; uint32_t pm_pid; uint32_t pm_prv; int restart; @@ -303,29 +301,13 @@ probestart(struct cam_periph *periph, un ata_reset_cmd(ataio); break; case PROBE_IDENTIFY: - if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { - /* Prepare check that it is the same device. */ - MD5_CTX context; - - MD5Init(&context); - MD5Update(&context, - (unsigned char *)ident_buf->model, - sizeof(ident_buf->model)); - MD5Update(&context, - (unsigned char *)ident_buf->revision, - sizeof(ident_buf->revision)); - MD5Update(&context, - (unsigned char *)ident_buf->serial, - sizeof(ident_buf->serial)); - MD5Final(softc->digest, &context); - } cam_fill_ataio(ataio, 1, probedone, /*flags*/CAM_DIR_IN, 0, - /*data_ptr*/(u_int8_t *)ident_buf, - /*dxfer_len*/sizeof(struct ata_params), + /*data_ptr*/(u_int8_t *)&softc->ident_data, + /*dxfer_len*/sizeof(softc->ident_data), 30 * 1000); if (periph->path->device->protocol == PROTO_ATA) ata_28bit_cmd(ataio, ATA_ATA_IDENTIFY, 0, 0, 0); @@ -695,8 +677,7 @@ probedone(struct cam_periph *periph, uni ident_buf = &path->device->ident_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { -device_fail: if (cam_periph_error(done_ccb, 0, 0, - &softc->saved_ccb) == ERESTART) { +device_fail: if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) { return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ @@ -724,6 +705,8 @@ device_fail: if (cam_periph_error(done_c goto done; } noerror: + if (softc->restart) + goto done; switch (softc->action) { case PROBE_RESET: { @@ -766,6 +749,7 @@ noerror: { int16_t *ptr; + ident_buf = &softc->ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); @@ -784,28 +768,22 @@ noerror: ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + ident_buf = &path->device->ident_data; if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { /* Check that it is the same device. */ - MD5_CTX context; - u_int8_t digest[16]; - - MD5Init(&context); - MD5Update(&context, - (unsigned char *)ident_buf->model, - sizeof(ident_buf->model)); - MD5Update(&context, - (unsigned char *)ident_buf->revision, - sizeof(ident_buf->revision)); - MD5Update(&context, - (unsigned char *)ident_buf->serial, - sizeof(ident_buf->serial)); - MD5Final(digest, &context); - if (bcmp(digest, softc->digest, sizeof(digest))) { + if (bcmp(softc->ident_data.model, ident_buf->model, + sizeof(ident_buf->model)) || + bcmp(softc->ident_data.revision, ident_buf->revision, + sizeof(ident_buf->revision)) || + bcmp(softc->ident_data.serial, ident_buf->serial, + sizeof(ident_buf->serial))) { /* Device changed. */ xpt_async(AC_LOST_DEVICE, path, NULL); - } + } else + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); } else { + bcopy(&softc->ident_data, ident_buf, sizeof(struct ata_params)); /* Clean up from previous instance of this device */ if (path->device->serial_num != NULL) { free(path->device->serial_num, M_CAMXPT); From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:48:53 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5959106566B; Sun, 14 Feb 2010 19:48:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9A7178FC13; Sun, 14 Feb 2010 19:48:53 +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 o1EJmrSn067960; Sun, 14 Feb 2010 19:48:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJmrYo067958; Sun, 14 Feb 2010 19:48:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141948.o1EJmrYo067958@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203892 - stable/8/sys/cam X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:48:53 -0000 Author: mav Date: Sun Feb 14 19:48:53 2010 New Revision: 203892 URL: http://svn.freebsd.org/changeset/base/203892 Log: MFC r203386: Change the way in which fake async events generated. Do not use taskqueue for lock decoupling, as it causes unwanted races. Modified: stable/8/sys/cam/cam_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sun Feb 14 19:46:54 2010 (r203891) +++ stable/8/sys/cam/cam_xpt.c Sun Feb 14 19:48:53 2010 (r203892) @@ -2392,9 +2392,7 @@ xptsetasyncfunc(struct cam_ed *device, v { struct cam_path path; struct ccb_getdev cgd; - struct async_node *cur_entry; - - cur_entry = (struct async_node *)arg; + struct ccb_setasync *csa = (struct ccb_setasync *)arg; /* * Don't report unconfigured devices (Wildcard devs, @@ -2413,7 +2411,7 @@ xptsetasyncfunc(struct cam_ed *device, v xpt_setup_ccb(&cgd.ccb_h, &path, CAM_PRIORITY_NORMAL); cgd.ccb_h.func_code = XPT_GDEV_TYPE; xpt_action((union ccb *)&cgd); - cur_entry->callback(cur_entry->callback_arg, + csa->callback(csa->callback_arg, AC_FOUND_DEVICE, &path, &cgd); xpt_release_path(&path); @@ -2426,9 +2424,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, v { struct cam_path path; struct ccb_pathinq cpi; - struct async_node *cur_entry; - - cur_entry = (struct async_node *)arg; + struct ccb_setasync *csa = (struct ccb_setasync *)arg; xpt_compile_path(&path, /*periph*/NULL, bus->sim->path_id, @@ -2437,7 +2433,7 @@ xptsetasyncbusfunc(struct cam_eb *bus, v xpt_setup_ccb(&cpi.ccb_h, &path, CAM_PRIORITY_NORMAL); cpi.ccb_h.func_code = XPT_PATH_INQ; xpt_action((union ccb *)&cpi); - cur_entry->callback(cur_entry->callback_arg, + csa->callback(csa->callback_arg, AC_PATH_REGISTERED, &path, &cpi); xpt_release_path(&path); @@ -2445,35 +2441,6 @@ xptsetasyncbusfunc(struct cam_eb *bus, v return(1); } -static void -xpt_action_sasync_cb(void *context, int pending) -{ - struct async_node *cur_entry; - struct xpt_task *task; - uint32_t added; - - task = (struct xpt_task *)context; - cur_entry = (struct async_node *)task->data1; - added = task->data2; - - if ((added & AC_FOUND_DEVICE) != 0) { - /* - * Get this peripheral up to date with all - * the currently existing devices. - */ - xpt_for_all_devices(xptsetasyncfunc, cur_entry); - } - if ((added & AC_PATH_REGISTERED) != 0) { - /* - * Get this peripheral up to date with all - * the currently existing busses. - */ - xpt_for_all_busses(xptsetasyncbusfunc, cur_entry); - } - - free(task, M_CAMXPT); -} - void xpt_action(union ccb *start_ccb) { @@ -2885,11 +2852,12 @@ xpt_action_default(union ccb *start_ccb) if (csa->event_enable == 0) { SLIST_REMOVE(async_head, cur_entry, async_node, links); - csa->ccb_h.path->device->refcount--; + xpt_release_device(csa->ccb_h.path->device); free(cur_entry, M_CAMXPT); } else { cur_entry->event_enable = csa->event_enable; } + csa->event_enable = added; } else { cur_entry = malloc(sizeof(*cur_entry), M_CAMXPT, M_NOWAIT); @@ -2901,29 +2869,8 @@ xpt_action_default(union ccb *start_ccb) cur_entry->callback_arg = csa->callback_arg; cur_entry->callback = csa->callback; SLIST_INSERT_HEAD(async_head, cur_entry, links); - csa->ccb_h.path->device->refcount++; + xpt_acquire_device(csa->ccb_h.path->device); } - - /* - * Need to decouple this operation via a taqskqueue so that - * the locking doesn't become a mess. - */ - if ((added & (AC_FOUND_DEVICE | AC_PATH_REGISTERED)) != 0) { - struct xpt_task *task; - - task = malloc(sizeof(struct xpt_task), M_CAMXPT, - M_NOWAIT); - if (task == NULL) { - csa->ccb_h.status = CAM_RESRC_UNAVAIL; - break; - } - - TASK_INIT(&task->task, 0, xpt_action_sasync_cb, task); - task->data1 = cur_entry; - task->data2 = added; - taskqueue_enqueue(taskqueue_thread, &task->task); - } - start_ccb->ccb_h.status = CAM_REQ_CMP; break; } @@ -4823,6 +4770,23 @@ xpt_register_async(int event, ac_callbac if (xptpath) { xpt_free_path(path); mtx_unlock(&xsoftc.xpt_lock); + + if ((status == CAM_REQ_CMP) && + (csa.event_enable & AC_FOUND_DEVICE)) { + /* + * Get this peripheral up to date with all + * the currently existing devices. + */ + xpt_for_all_devices(xptsetasyncfunc, &csa); + } + if ((status == CAM_REQ_CMP) && + (csa.event_enable & AC_PATH_REGISTERED)) { + /* + * Get this peripheral up to date with all + * the currently existing busses. + */ + xpt_for_all_busses(xptsetasyncbusfunc, &csa); + } } return (status); } From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:50:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DB11065672; Sun, 14 Feb 2010 19:50:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 704F98FC14; Sun, 14 Feb 2010 19:50:33 +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 o1EJoX3u068377; Sun, 14 Feb 2010 19:50:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJoXj9068373; Sun, 14 Feb 2010 19:50:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141950.o1EJoXj9068373@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203893 - in stable/8/sys: cam/ata sys X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:50:33 -0000 Author: mav Date: Sun Feb 14 19:50:33 2010 New Revision: 203893 URL: http://svn.freebsd.org/changeset/base/203893 Log: MFC r203421: Add Power Up In Stand-by feature support. Device with PUIS enabled require explicit command to do initial spin-up. Mark that command with CAM_HIGH_POWER flag, to allow CAM manage staggered spin-up. Modified: stable/8/sys/cam/ata/ata_all.c stable/8/sys/cam/ata/ata_xpt.c stable/8/sys/sys/ata.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/ata/ata_all.c ============================================================================== --- stable/8/sys/cam/ata/ata_all.c Sun Feb 14 19:48:53 2010 (r203892) +++ stable/8/sys/cam/ata/ata_all.c Sun Feb 14 19:50:33 2010 (r203893) @@ -146,6 +146,9 @@ ata_op_string(struct ata_cmd *cmd) case 0x03: return ("SETFEATURES SET TRANSFER MODE"); case 0x02: return ("SETFEATURES ENABLE WCACHE"); case 0x82: return ("SETFEATURES DISABLE WCACHE"); + case 0x06: return ("SETFEATURES ENABLE PUIS"); + case 0x86: return ("SETFEATURES DISABLE PUIS"); + case 0x07: return ("SETFEATURES SPIN-UP"); case 0xaa: return ("SETFEATURES ENABLE RCACHE"); case 0x55: return ("SETFEATURES DISABLE RCACHE"); } Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:48:53 2010 (r203892) +++ stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:50:33 2010 (r203893) @@ -86,6 +86,7 @@ PERIPHDRIVER_DECLARE(aprobe, probe_drive typedef enum { PROBE_RESET, PROBE_IDENTIFY, + PROBE_SPINUP, PROBE_SETMODE, PROBE_SET_MULTI, PROBE_INQUIRY, @@ -98,6 +99,7 @@ typedef enum { static char *probe_action_text[] = { "PROBE_RESET", "PROBE_IDENTIFY", + "PROBE_SPINUP", "PROBE_SETMODE", "PROBE_SET_MULTI", "PROBE_INQUIRY", @@ -129,6 +131,7 @@ typedef struct { uint32_t pm_pid; uint32_t pm_prv; int restart; + int spinup; struct cam_periph *periph; } probe_softc; @@ -212,7 +215,7 @@ proberegister(struct cam_periph *periph, return(CAM_REQ_CMP_ERR); } - softc = (probe_softc *)malloc(sizeof(*softc), M_CAMXPT, M_NOWAIT); + softc = (probe_softc *)malloc(sizeof(*softc), M_CAMXPT, M_ZERO | M_NOWAIT); if (softc == NULL) { printf("proberegister: Unable to probe new device. " @@ -314,6 +317,19 @@ probestart(struct cam_periph *periph, un else ata_28bit_cmd(ataio, ATA_ATAPI_IDENTIFY, 0, 0, 0); break; + case PROBE_SPINUP: + if (bootverbose) + xpt_print(path, "Spinning up device\n"); + cam_fill_ataio(ataio, + 1, + probedone, + /*flags*/CAM_DIR_NONE | CAM_HIGH_POWER, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + 30 * 1000); + ata_28bit_cmd(ataio, ATA_SETFEATURES, ATA_SF_PUIS_SPINUP, 0, 0); + break; case PROBE_SETMODE: { int mode, wantmode; @@ -768,8 +784,18 @@ noerror: ata_bpack(ident_buf->revision, ident_buf->revision, sizeof(ident_buf->revision)); ata_btrim(ident_buf->serial, sizeof(ident_buf->serial)); ata_bpack(ident_buf->serial, ident_buf->serial, sizeof(ident_buf->serial)); + /* Device may need spin-up before IDENTIFY become valid. */ + if ((ident_buf->config & ATA_RESP_INCOMPLETE) || + ((ident_buf->support.command2 & ATA_SUPPORT_STANDBY) && + (ident_buf->enabled.command2 & ATA_SUPPORT_STANDBY) && + (ident_buf->support.command2 & ATA_SUPPORT_SPINUP) && + softc->spinup == 0)) { + PROBE_SET_ACTION(softc, PROBE_SPINUP); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + } ident_buf = &path->device->ident_data; - if ((periph->path->device->flags & CAM_DEV_UNCONFIGURED) == 0) { /* Check that it is the same device. */ if (bcmp(softc->ident_data.model, ident_buf->model, @@ -829,6 +855,14 @@ noerror: xpt_schedule(periph, priority); return; } + case PROBE_SPINUP: + if (bootverbose) + xpt_print(path, "Spin-up done\n"); + softc->spinup = 1; + PROBE_SET_ACTION(softc, PROBE_IDENTIFY); + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; case PROBE_SETMODE: if (path->device->protocol == PROTO_ATA) { PROBE_SET_ACTION(softc, PROBE_SET_MULTI); Modified: stable/8/sys/sys/ata.h ============================================================================== --- stable/8/sys/sys/ata.h Sun Feb 14 19:48:53 2010 (r203892) +++ stable/8/sys/sys/ata.h Sun Feb 14 19:50:33 2010 (r203893) @@ -48,6 +48,7 @@ struct ata_params { #define ATA_DRQ_SLOW 0x0000 /* cpu 3 ms delay */ #define ATA_DRQ_INTR 0x0020 /* interrupt 10 ms delay */ #define ATA_DRQ_FAST 0x0040 /* accel 50 us delay */ +#define ATA_RESP_INCOMPLETE 0x0004 /*001*/ u_int16_t cylinders; /* # of cylinders */ u_int16_t reserved2; @@ -345,6 +346,9 @@ struct ata_params { #define ATA_SF_SETXFER 0x03 /* set transfer mode */ #define ATA_SF_ENAB_WCACHE 0x02 /* enable write cache */ #define ATA_SF_DIS_WCACHE 0x82 /* disable write cache */ +#define ATA_SF_ENAB_PUIS 0x06 /* enable PUIS */ +#define ATA_SF_DIS_PUIS 0x86 /* disable PUIS */ +#define ATA_SF_PUIS_SPINUP 0x07 /* PUIS spin-up */ #define ATA_SF_ENAB_RCACHE 0xaa /* enable readahead cache */ #define ATA_SF_DIS_RCACHE 0x55 /* disable readahead cache */ #define ATA_SF_ENAB_RELIRQ 0x5d /* enable release interrupt */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:51:39 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D6A71065672; Sun, 14 Feb 2010 19:51:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC8D8FC1D; Sun, 14 Feb 2010 19:51:39 +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 o1EJpdYa068654; Sun, 14 Feb 2010 19:51:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJpd10068652; Sun, 14 Feb 2010 19:51:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141951.o1EJpd10068652@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203894 - stable/8/sys/cam/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:51:39 -0000 Author: mav Date: Sun Feb 14 19:51:39 2010 New Revision: 203894 URL: http://svn.freebsd.org/changeset/base/203894 Log: MFC r203499: On probe error, if restart requested, skip any retries and recovery. Just restart probe from the beginning immediately. Modified: stable/8/sys/cam/ata/ata_xpt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:50:33 2010 (r203893) +++ stable/8/sys/cam/ata/ata_xpt.c Sun Feb 14 19:51:39 2010 (r203894) @@ -693,7 +693,8 @@ probedone(struct cam_periph *periph, uni ident_buf = &path->device->ident_data; if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { -device_fail: if (cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) { +device_fail: if ((!softc->restart) && + cam_periph_error(done_ccb, 0, 0, NULL) == ERESTART) { return; } else if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { /* Don't wedge the queue */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:53:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D6011065670; Sun, 14 Feb 2010 19:53:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C8E08FC22; Sun, 14 Feb 2010 19:53: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 o1EJr96R069034; Sun, 14 Feb 2010 19:53:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJr9pd069032; Sun, 14 Feb 2010 19:53:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141953.o1EJr9pd069032@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:53:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203895 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:53:09 -0000 Author: mav Date: Sun Feb 14 19:53:09 2010 New Revision: 203895 URL: http://svn.freebsd.org/changeset/base/203895 Log: MFC r203445: Report to CAM unit number of underlying ataX bus device, instead of this atapicamX. It is more apropriate and useful together with "ata" name. Modified: stable/8/sys/dev/ata/atapi-cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ata/atapi-cam.c ============================================================================== --- stable/8/sys/dev/ata/atapi-cam.c Sun Feb 14 19:51:39 2010 (r203894) +++ stable/8/sys/dev/ata/atapi-cam.c Sun Feb 14 19:53:09 2010 (r203895) @@ -201,7 +201,7 @@ atapi_cam_attach(device_t dev) scp->parent = device_get_parent(dev); scp->ata_ch = device_get_softc(scp->parent); TAILQ_INIT(&scp->pending_hcbs); - unit = device_get_unit(dev); + unit = device_get_unit(device_get_parent(dev)); if ((devq = cam_simq_alloc(16)) == NULL) { error = ENOMEM; From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:54:16 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AAB4210656A3; Sun, 14 Feb 2010 19:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9990A8FC21; Sun, 14 Feb 2010 19:54:16 +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 o1EJsGh8069351; Sun, 14 Feb 2010 19:54:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJsGj9069349; Sun, 14 Feb 2010 19:54:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141954.o1EJsGj9069349@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203897 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:54:16 -0000 Author: mav Date: Sun Feb 14 19:54:16 2010 New Revision: 203897 URL: http://svn.freebsd.org/changeset/base/203897 Log: MFC r203525: Report SATA300 chips also as SATA. Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Sun Feb 14 19:53:45 2010 (r203896) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Sun Feb 14 19:54:16 2010 (r203897) @@ -471,7 +471,8 @@ ata_siiprb_ch_attach(device_t dev) ch->hw.softreset = ata_siiprb_softreset; ch->hw.pm_read = ata_siiprb_pm_read; ch->hw.pm_write = ata_siiprb_pm_write; - + ch->flags |= ATA_NO_SLAVE; + ch->flags |= ATA_SATA; return 0; } From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:55:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 973A7106566C; Sun, 14 Feb 2010 19:55:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 867098FC27; Sun, 14 Feb 2010 19:55:41 +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 o1EJtf7g069754; Sun, 14 Feb 2010 19:55:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJtfpa069752; Sun, 14 Feb 2010 19:55:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141955.o1EJtfpa069752@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203898 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:55:41 -0000 Author: mav Date: Sun Feb 14 19:55:41 2010 New Revision: 203898 URL: http://svn.freebsd.org/changeset/base/203898 Log: MFC r203347: NetCell is a PCI hardware RAID without cable and mode setting. Modified: stable/8/sys/dev/ata/chipsets/ata-netcell.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-netcell.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-netcell.c Sun Feb 14 19:54:16 2010 (r203897) +++ stable/8/sys/dev/ata/chipsets/ata-netcell.c Sun Feb 14 19:55:41 2010 (r203898) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); /* local prototypes */ static int ata_netcell_chipinit(device_t dev); static int ata_netcell_ch_attach(device_t dev); +static int ata_netcell_setmode(device_t dev, int target, int mode); /* * NetCell chipset support functions @@ -80,7 +81,7 @@ ata_netcell_chipinit(device_t dev) return ENXIO; ctlr->ch_attach = ata_netcell_ch_attach; - ctlr->setmode = ata_generic_setmode; + ctlr->setmode = ata_netcell_setmode; return 0; } @@ -95,7 +96,16 @@ ata_netcell_ch_attach(device_t dev) /* the NetCell only supports 16 bit PIO transfers */ ch->flags |= ATA_USE_16BIT; + /* It is a hardware RAID without cable. */ + ch->flags |= ATA_CHECKS_CABLE; return 0; } +static int +ata_netcell_setmode(device_t dev, int target, int mode) +{ + + return (min(mode, ATA_UDMA6)); +} + ATA_DECLARE_DRIVER(ata_netcell); From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:56:43 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 487FA106568F; Sun, 14 Feb 2010 19:56:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37E0A8FC19; Sun, 14 Feb 2010 19:56: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 o1EJuhp9070072; Sun, 14 Feb 2010 19:56:43 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJuh5X070070; Sun, 14 Feb 2010 19:56:43 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141956.o1EJuh5X070070@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203900 - stable/8/sys/dev/ata X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:56:43 -0000 Author: mav Date: Sun Feb 14 19:56:42 2010 New Revision: 203900 URL: http://svn.freebsd.org/changeset/base/203900 Log: MFC r203449: Implement poll method for atapicam. It is not perfect, but better then nothing. Modified: stable/8/sys/dev/ata/atapi-cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ata/atapi-cam.c ============================================================================== --- stable/8/sys/dev/ata/atapi-cam.c Sun Feb 14 19:56:05 2010 (r203899) +++ stable/8/sys/dev/ata/atapi-cam.c Sun Feb 14 19:56:42 2010 (r203900) @@ -682,8 +682,12 @@ action_invalid: static void atapi_poll(struct cam_sim *sim) { - /* do nothing - we do not actually service any interrupts */ - printf("atapi_poll called!\n"); + struct atapi_xpt_softc *softc = + (struct atapi_xpt_softc*)cam_sim_softc(sim); + + mtx_unlock(&softc->state_lock); + ata_interrupt(softc->ata_ch); + mtx_lock(&softc->state_lock); } static void From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:57:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 85AAC1065670; Sun, 14 Feb 2010 19:57:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7374C8FC13; Sun, 14 Feb 2010 19:57: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 o1EJvs3F070385; Sun, 14 Feb 2010 19:57:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJvsBX070382; Sun, 14 Feb 2010 19:57:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141957.o1EJvsBX070382@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:57:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203901 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:57:54 -0000 Author: mav Date: Sun Feb 14 19:57:54 2010 New Revision: 203901 URL: http://svn.freebsd.org/changeset/base/203901 Log: MFC r203123: Add FIS-based switching support. If controller supports FBS, it allows several devices beyond Port Multiplier to work simultaneously, substantially increasing performance. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:56:42 2010 (r203900) +++ stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:57:54 2010 (r203901) @@ -78,7 +78,7 @@ static void ahci_dmafini(device_t dev); static void ahci_slotsalloc(device_t dev); static void ahci_slotsfree(device_t dev); static void ahci_reset(device_t dev); -static void ahci_start(device_t dev); +static void ahci_start(device_t dev, int fbs); static void ahci_stop(device_t dev); static void ahci_clo(device_t dev); static void ahci_start_fr(device_t dev); @@ -86,6 +86,7 @@ static void ahci_stop_fr(device_t dev); static int ahci_sata_connect(struct ahci_channel *ch); static int ahci_sata_phy_reset(device_t dev); +static int ahci_wait_ready(device_t dev, int t); static void ahci_issue_read_log(device_t dev); static void ahci_process_read_log(device_t dev, union ccb *ccb); @@ -108,6 +109,7 @@ static struct { #define AHCI_Q_4CH 32 #define AHCI_Q_EDGEIS 64 #define AHCI_Q_SATA2 128 +#define AHCI_Q_NOBSYRES 256 } ahci_ids[] = { {0x43801002, 0x00, "ATI IXP600", 0}, {0x43901002, 0x00, "ATI IXP700", 0}, @@ -162,8 +164,8 @@ static struct { {0x612111ab, 0x00, "Marvell 88SX6121", AHCI_Q_NOFORCE|AHCI_Q_2CH|AHCI_Q_EDGEIS}, {0x614111ab, 0x00, "Marvell 88SX6141", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, {0x614511ab, 0x00, "Marvell 88SX6145", AHCI_Q_NOFORCE|AHCI_Q_4CH|AHCI_Q_EDGEIS}, - {0x91231b4b, 0x11, "Marvell 88SE912x", 0}, - {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2}, + {0x91231b4b, 0x11, "Marvell 88SE912x", AHCI_Q_NOBSYRES}, + {0x91231b4b, 0x00, "Marvell 88SE912x", AHCI_Q_EDGEIS|AHCI_Q_SATA2|AHCI_Q_NOBSYRES}, {0x044c10de, 0x00, "NVIDIA MCP65", 0}, {0x044d10de, 0x00, "NVIDIA MCP65", 0}, {0x044e10de, 0x00, "NVIDIA MCP65", 0}, @@ -379,14 +381,16 @@ ahci_attach(device_t dev) /* Announce HW capabilities. */ speed = (ctlr->caps & AHCI_CAP_ISS) >> AHCI_CAP_ISS_SHIFT; device_printf(dev, - "AHCI v%x.%02x with %d %sGbps ports, Port Multiplier %s\n", + "AHCI v%x.%02x with %d %sGbps ports, Port Multiplier %s%s\n", ((version >> 20) & 0xf0) + ((version >> 16) & 0x0f), ((version >> 4) & 0xf0) + (version & 0x0f), (ctlr->caps & AHCI_CAP_NPMASK) + 1, ((speed == 1) ? "1.5":((speed == 2) ? "3": ((speed == 3) ? "6":"?"))), (ctlr->caps & AHCI_CAP_SPM) ? - "supported" : "not supported"); + "supported" : "not supported", + (ctlr->caps & AHCI_CAP_FBSS) ? + " with FBS" : ""); if (bootverbose) { device_printf(dev, "Caps:%s%s%s%s%s%s%s%s %sGbps", (ctlr->caps & AHCI_CAP_64BIT) ? " 64bit":"", @@ -419,7 +423,7 @@ ahci_attach(device_t dev) (ctlr->caps2 & AHCI_CAP2_BOH) ? " BOH":""); } if (bootverbose && (ctlr->caps & AHCI_CAP_EMS)) { - device_printf(dev, "EM Caps: %s%s%s%s%s%s%s%s\n", + device_printf(dev, "EM Caps:%s%s%s%s%s%s%s%s\n", (ctlr->capsem & AHCI_EM_PM) ? " PM":"", (ctlr->capsem & AHCI_EM_ALHD) ? " ALHD":"", (ctlr->capsem & AHCI_EM_XMT) ? " XMT":"", @@ -804,6 +808,7 @@ ahci_ch_attach(device_t dev) struct ahci_channel *ch = device_get_softc(dev); struct cam_devq *devq; int rid, error, i, sata_rev = 0; + u_int32_t version; ch->dev = dev; ch->unit = (intptr_t)device_get_ivars(dev); @@ -855,6 +860,18 @@ ahci_ch_attach(device_t dev) error = ENXIO; goto err1; } + ch->chcaps = ATA_INL(ch->r_mem, AHCI_P_CMD); + version = ATA_INL(ctlr->r_mem, AHCI_VS); + if (version < 0x00010020 && (ctlr->caps & AHCI_CAP_FBSS)) + ch->chcaps |= AHCI_P_CMD_FBSCP; + if (bootverbose) { + device_printf(dev, "Caps:%s%s%s%s%s\n", + (ch->chcaps & AHCI_P_CMD_HPCP) ? " HPCP":"", + (ch->chcaps & AHCI_P_CMD_MPSP) ? " MPSP":"", + (ch->chcaps & AHCI_P_CMD_CPD) ? " CPD":"", + (ch->chcaps & AHCI_P_CMD_ESP) ? " ESP":"", + (ch->chcaps & AHCI_P_CMD_FBSCP) ? " FBSCP":""); + } /* Create the device queue for our SIM. */ devq = cam_simq_alloc(ch->numslots); if (devq == NULL) { @@ -971,7 +988,7 @@ ahci_ch_resume(device_t dev) ((ch->pm_level == 2 || ch->pm_level == 3) ? AHCI_P_CMD_ALPE : 0) | ((ch->pm_level > 2) ? AHCI_P_CMD_ASP : 0 ))); ahci_start_fr(dev); - ahci_start(dev); + ahci_start(dev, 1); return (0); } @@ -1001,6 +1018,7 @@ ahci_dmainit(device_t dev) { struct ahci_channel *ch = device_get_softc(dev); struct ahci_dc_cb_args dcba; + size_t rfsize; if (ch->caps & AHCI_CAP_64BIT) ch->dma.max_address = BUS_SPACE_MAXADDR; @@ -1022,16 +1040,20 @@ ahci_dmainit(device_t dev) } ch->dma.work_bus = dcba.maddr; /* FIS receive area. */ - if (bus_dma_tag_create(bus_get_dma_tag(dev), 4096, 0, + if (ch->chcaps & AHCI_P_CMD_FBSCP) + rfsize = 4096; + else + rfsize = 256; + if (bus_dma_tag_create(bus_get_dma_tag(dev), rfsize, 0, ch->dma.max_address, BUS_SPACE_MAXADDR, - NULL, NULL, 4096, 1, 4096, + NULL, NULL, rfsize, 1, rfsize, 0, NULL, NULL, &ch->dma.rfis_tag)) goto error; if (bus_dmamem_alloc(ch->dma.rfis_tag, (void **)&ch->dma.rfis, 0, &ch->dma.rfis_map)) goto error; if (bus_dmamap_load(ch->dma.rfis_tag, ch->dma.rfis_map, ch->dma.rfis, - 4096, ahci_dmasetupc_cb, &dcba, 0) || dcba.error) { + rfsize, ahci_dmasetupc_cb, &dcba, 0) || dcba.error) { bus_dmamem_free(ch->dma.rfis_tag, ch->dma.rfis, ch->dma.rfis_map); goto error; } @@ -1219,7 +1241,7 @@ ahci_ch_intr(void *data) struct ahci_channel *ch = device_get_softc(dev); uint32_t istatus, sstatus, cstatus, serr = 0, sntf = 0, ok, err; enum ahci_err_type et; - int i, ccs, ncq_err = 0; + int i, ccs, port; /* Read and clear interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); @@ -1232,7 +1254,17 @@ ahci_ch_intr(void *data) if (istatus & AHCI_P_IX_SDB) { if (ch->caps & AHCI_CAP_SSNTF) sntf = ATA_INL(ch->r_mem, AHCI_P_SNTF); - else { + else if (ch->fbs_enabled) { + u_int8_t *fis = ch->dma.rfis + 0x58; + + for (i = 0; i < 16; i++) { + if (fis[1] & 0x80) { + fis[1] &= 0x7f; + sntf |= 1 << i; + } + fis += 256; + } + } else { u_int8_t *fis = ch->dma.rfis + 0x58; if (fis[1] & 0x80) @@ -1251,18 +1283,35 @@ ahci_ch_intr(void *data) /* Process command errors */ if (istatus & (AHCI_P_IX_OF | AHCI_P_IX_IF | AHCI_P_IX_HBD | AHCI_P_IX_HBF | AHCI_P_IX_TFE)) { -//device_printf(dev, "%s ERROR is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x\n", -// __func__, istatus, cstatus, sstatus, ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), -// serr); ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT; +//device_printf(dev, "%s ERROR is %08x cs %08x ss %08x rs %08x tfd %02x serr %08x fbs %08x ccs %d\n", +// __func__, istatus, cstatus, sstatus, ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), +// serr, ATA_INL(ch->r_mem, AHCI_P_FBS), ccs); + port = -1; + if (ch->fbs_enabled) { + uint32_t fbs = ATA_INL(ch->r_mem, AHCI_P_FBS); + if (fbs & AHCI_P_FBS_SDE) { + port = (fbs & AHCI_P_FBS_DWE) + >> AHCI_P_FBS_DWE_SHIFT; + } else { + for (i = 0; i < 16; i++) { + if (ch->numrslotspd[i] == 0) + continue; + if (port == -1) + port = i; + else if (port != i) { + port = -2; + break; + } + } + } + } err = ch->rslots & (cstatus | sstatus); - /* Kick controller into sane state */ - ahci_stop(dev); - ahci_start(dev); } else { ccs = 0; err = 0; + port = -1; } /* Complete all successfull commands. */ ok = ch->rslots & ~(cstatus | sstatus); @@ -1286,9 +1335,14 @@ ahci_ch_intr(void *data) /* XXX: reqests in loading state. */ if (((err >> i) & 1) == 0) continue; + if (port >= 0 && + ch->slot[i].ccb->ccb_h.target_id != port) + continue; if (istatus & AHCI_P_IX_TFE) { + if (port != -2) { /* Task File Error */ - if (ch->numtslots == 0) { + if (ch->numtslotspd[ + ch->slot[i].ccb->ccb_h.target_id] == 0) { /* Untagged operation. */ if (i == ccs) et = AHCI_ERR_TFE; @@ -1297,10 +1351,13 @@ ahci_ch_intr(void *data) } else { /* Tagged operation. */ et = AHCI_ERR_NCQ; - ncq_err = 1; } + } else { + et = AHCI_ERR_TFE; + ch->fatalerr = 1; + } } else if (istatus & AHCI_P_IX_IF) { - if (ch->numtslots == 0 && i != ccs) + if (ch->numtslots == 0 && i != ccs && port != -2) et = AHCI_ERR_INNOCENT; else et = AHCI_ERR_SATA; @@ -1308,8 +1365,12 @@ ahci_ch_intr(void *data) et = AHCI_ERR_INVALID; ahci_end_transaction(&ch->slot[i], et); } - if (ncq_err) - ahci_issue_read_log(dev); + /* + * We can't reinit port if there are some other + * commands active, use resume to complete them. + */ + if (ch->rslots != 0) + ATA_OUTL(ch->r_mem, AHCI_P_FBS, AHCI_P_FBS_EN | AHCI_P_FBS_DEC); } /* Process NOTIFY events */ if (sntf) @@ -1321,24 +1382,39 @@ static int ahci_check_collision(device_t dev, union ccb *ccb) { struct ahci_channel *ch = device_get_softc(dev); + int t = ccb->ccb_h.target_id; if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { - /* Tagged command while untagged are active. */ - if (ch->numrslots != 0 && ch->numtslots == 0) - return (1); - /* Tagged command while tagged to other target is active. */ - if (ch->numtslots != 0 && - ch->taggedtarget != ccb->ccb_h.target_id) - return (1); /* Tagged command while we have no supported tag free. */ if (((~ch->oslots) & (0xffffffff >> (32 - - ch->curr[ccb->ccb_h.target_id].tags))) == 0) + ch->curr[t].tags))) == 0) return (1); + /* If we have FBS */ + if (ch->fbs_enabled) { + /* Tagged command while untagged are active. */ + if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] == 0) + return (1); + } else { + /* Tagged command while untagged are active. */ + if (ch->numrslots != 0 && ch->numtslots == 0) + return (1); + /* Tagged command while tagged to other target is active. */ + if (ch->numtslots != 0 && + ch->taggedtarget != ccb->ccb_h.target_id) + return (1); + } } else { - /* Untagged command while tagged are active. */ - if (ch->numrslots != 0 && ch->numtslots != 0) - return (1); + /* If we have FBS */ + if (ch->fbs_enabled) { + /* Untagged command while tagged are active. */ + if (ch->numrslotspd[t] != 0 && ch->numtslotspd[t] != 0) + return (1); + } else { + /* Untagged command while tagged are active. */ + if (ch->numrslots != 0 && ch->numtslots != 0) + return (1); + } } if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & (CAM_ATAIO_CONTROL | CAM_ATAIO_NEEDRESULT))) { @@ -1383,9 +1459,11 @@ ahci_begin_transaction(device_t dev, uni /* Update channel stats. */ ch->oslots |= (1 << slot->slot); ch->numrslots++; + ch->numrslotspd[ccb->ccb_h.target_id]++; if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { ch->numtslots++; + ch->numtslotspd[ccb->ccb_h.target_id]++; ch->taggedtarget = ccb->ccb_h.target_id; } if ((ccb->ccb_h.func_code == XPT_ATA_IO) && @@ -1453,7 +1531,9 @@ ahci_execute_transaction(struct ahci_slo struct ahci_cmd_list *clp; union ccb *ccb = slot->ccb; int port = ccb->ccb_h.target_id & 0x0f; - int fis_size; + int fis_size, i; + uint8_t *fis = ch->dma.rfis + 0x40; + uint8_t val; /* Get a piece of the workspace for this request */ ctp = (struct ahci_cmd_tab *) @@ -1475,13 +1555,18 @@ ahci_execute_transaction(struct ahci_slo (port << 12); /* Special handling for Soft Reset command. */ if ((ccb->ccb_h.func_code == XPT_ATA_IO) && - (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && - (ccb->ataio.cmd.control & ATA_A_RESET)) { - /* Kick controller into sane state */ - ahci_stop(dev); - ahci_clo(dev); - ahci_start(dev); - clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY; + (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) { + if (ccb->ataio.cmd.control & ATA_A_RESET) { + /* Kick controller into sane state */ + ahci_stop(dev); + ahci_clo(dev); + ahci_start(dev, 0); + clp->cmd_flags |= AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY; + } else { + /* Prepare FIS receive area for check. */ + for (i = 0; i < 20; i++) + fis[i] = 0xff; + } } clp->bytecount = 0; clp->cmd_table_phys = htole64(ch->dma.work_bus + AHCI_CT_OFFSET + @@ -1495,6 +1580,11 @@ ahci_execute_transaction(struct ahci_slo (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { ATA_OUTL(ch->r_mem, AHCI_P_SACT, 1 << slot->slot); } + /* If FBS is enabled, set PMP port. */ + if (ch->fbs_enabled) { + ATA_OUTL(ch->r_mem, AHCI_P_FBS, AHCI_P_FBS_EN | + (port << AHCI_P_FBS_DEV_SHIFT)); + } /* Issue command to the controller. */ slot->state = AHCI_SLOT_RUNNING; ch->rslots |= (1 << slot->slot); @@ -1537,12 +1627,30 @@ ahci_execute_transaction(struct ahci_slo ATA_INL(ch->r_mem, AHCI_P_SERR)); et = AHCI_ERR_TIMEOUT; } - if (et != AHCI_ERR_NONE) { - /* Kick controller into sane state */ - ahci_stop(ch->dev); - ahci_start(ch->dev); + /* Marvell controllers do not wait for readyness. */ + if ((ch->quirks & AHCI_Q_NOBSYRES) && + (ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && + (ccb->ataio.cmd.control & ATA_A_RESET) == 0) { + while ((val = fis[2]) & (ATA_S_BUSY | ATA_S_DRQ)) { + DELAY(1000); + if (count++ >= timeout) { + device_printf(dev, "device is not " + "ready after soft-reset: " + "tfd = %08x\n", val); + et = AHCI_ERR_TIMEOUT; + break; + } + } } ahci_end_transaction(slot, et); + /* Kick controller into sane state and enable FBS. */ + if ((ccb->ccb_h.func_code == XPT_ATA_IO) && + (ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) && + (ccb->ataio.cmd.control & ATA_A_RESET) == 0) { + ahci_stop(ch->dev); + ahci_start(ch->dev, 1); + } return; } /* Start command execution timeout */ @@ -1571,7 +1679,8 @@ ahci_timeout(struct ahci_slot *slot) sstatus = ATA_INL(ch->r_mem, AHCI_P_SACT); ccs = (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CCS_MASK) >> AHCI_P_CMD_CCS_SHIFT; - if ((sstatus & (1 << slot->slot)) != 0 || ccs == slot->slot) + if ((sstatus & (1 << slot->slot)) != 0 || ccs == slot->slot || + ch->fbs_enabled) slot->state = AHCI_SLOT_EXECUTING; callout_reset(&slot->timeout, @@ -1629,12 +1738,19 @@ ahci_end_transaction(struct ahci_slot *s if ((et == AHCI_ERR_TFE) || (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT)) { u_int8_t *fis = ch->dma.rfis + 0x40; - uint16_t tfd = ATA_INL(ch->r_mem, AHCI_P_TFD); bus_dmamap_sync(ch->dma.rfis_tag, ch->dma.rfis_map, BUS_DMASYNC_POSTREAD); - res->status = tfd; - res->error = tfd >> 8; + if (ch->fbs_enabled) { + fis += ccb->ccb_h.target_id * 256; + res->status = fis[2]; + res->error = fis[3]; + } else { + uint16_t tfd = ATA_INL(ch->r_mem, AHCI_P_TFD); + + res->status = tfd; + res->error = tfd >> 8; + } res->lba_low = fis[4]; res->lba_mid = fis[5]; res->lba_high = fis[6]; @@ -1653,6 +1769,8 @@ ahci_end_transaction(struct ahci_slot *s BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(ch->dma.data_tag, slot->dma.data_map); } + if (et != AHCI_ERR_NONE) + ch->eslots |= (1 << slot->slot); /* In case of error, freeze device for proper recovery. */ if ((et != AHCI_ERR_NONE) && (!ch->readlog) && !(ccb->ccb_h.status & CAM_DEV_QFRZN)) { @@ -1716,9 +1834,11 @@ ahci_end_transaction(struct ahci_slot *s slot->ccb = NULL; /* Update channel stats. */ ch->numrslots--; + ch->numrslotspd[ccb->ccb_h.target_id]--; if ((ccb->ccb_h.func_code == XPT_ATA_IO) && (ccb->ataio.cmd.flags & CAM_ATAIO_FPDMA)) { ch->numtslots--; + ch->numtslotspd[ccb->ccb_h.target_id]--; } /* If it was first request of reset sequence and there is no error, * proceed to second request. */ @@ -1736,6 +1856,7 @@ ahci_end_transaction(struct ahci_slot *s /* If it was NCQ command error, put result on hold. */ } else if (et == AHCI_ERR_NCQ) { ch->hold[slot->slot] = ccb; + ch->numhslots++; } else xpt_done(ccb); /* Unfreeze frozen command. */ @@ -1750,6 +1871,15 @@ ahci_end_transaction(struct ahci_slot *s /* if there was fatal error - reset port. */ if (ch->fatalerr) { ahci_reset(dev); + } else { + /* if we have slots in error, we can reinit port. */ + if (ch->eslots != 0) { + ahci_stop(dev); + ahci_start(dev, 1); + } + /* if there commands on hold, we can do READ LOG. */ + if (!ch->readlog && ch->numhslots) + ahci_issue_read_log(dev); } } /* Start PM timer. */ @@ -1837,6 +1967,7 @@ ahci_process_read_log(device_t dev, unio } xpt_done(ch->hold[i]); ch->hold[i] = NULL; + ch->numhslots--; } } else { if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) @@ -1849,6 +1980,7 @@ ahci_process_read_log(device_t dev, unio continue; xpt_done(ch->hold[i]); ch->hold[i] = NULL; + ch->numhslots--; } } free(ccb->ataio.data_ptr, M_AHCI); @@ -1857,7 +1989,7 @@ ahci_process_read_log(device_t dev, unio } static void -ahci_start(device_t dev) +ahci_start(device_t dev, int fbs) { struct ahci_channel *ch = device_get_softc(dev); u_int32_t cmd; @@ -1866,6 +1998,12 @@ ahci_start(device_t dev) ATA_OUTL(ch->r_mem, AHCI_P_SERR, 0xFFFFFFFF); /* Clear any interrupts pending on this channel */ ATA_OUTL(ch->r_mem, AHCI_P_IS, 0xFFFFFFFF); + /* Configure FIS-based switching if supported. */ + if (ch->chcaps & AHCI_P_CMD_FBSCP) { + ch->fbs_enabled = (fbs && ch->pm_present) ? 1 : 0; + ATA_OUTL(ch->r_mem, AHCI_P_FBS, + ch->fbs_enabled ? AHCI_P_FBS_EN : 0); + } /* Start operations on this channel */ cmd = ATA_INL(ch->r_mem, AHCI_P_CMD); ATA_OUTL(ch->r_mem, AHCI_P_CMD, cmd | AHCI_P_CMD_ST | @@ -1891,6 +2029,7 @@ ahci_stop(device_t dev) break; } } while (ATA_INL(ch->r_mem, AHCI_P_CMD) & AHCI_P_CMD_CR); + ch->eslots = 0; } static void @@ -2004,7 +2143,9 @@ ahci_reset(device_t dev) continue; xpt_done(ch->hold[i]); ch->hold[i] = NULL; + ch->numhslots--; } + ch->eslots = 0; ch->fatalerr = 0; /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); @@ -2025,7 +2166,7 @@ ahci_reset(device_t dev) /* Wait for clearing busy status. */ if (ahci_wait_ready(dev, 15000)) ahci_clo(dev); - ahci_start(dev); + ahci_start(dev, 1); ch->devices = 1; /* Enable wanted port interrupts */ ATA_OUTL(ch->r_mem, AHCI_P_IE, Modified: stable/8/sys/dev/ahci/ahci.h ============================================================================== --- stable/8/sys/dev/ahci/ahci.h Sun Feb 14 19:56:42 2010 (r203900) +++ stable/8/sys/dev/ahci/ahci.h Sun Feb 14 19:57:54 2010 (r203901) @@ -247,8 +247,11 @@ #define AHCI_P_CMD_CPS 0x00010000 #define AHCI_P_CMD_PMA 0x00020000 #define AHCI_P_CMD_HPCP 0x00040000 -#define AHCI_P_CMD_ISP 0x00080000 +#define AHCI_P_CMD_MPSP 0x00080000 #define AHCI_P_CMD_CPD 0x00100000 +#define AHCI_P_CMD_ESP 0x00200000 +#define AHCI_P_CMD_FBSCP 0x00400000 +#define AHCI_P_CMD_APSTE 0x00800000 #define AHCI_P_CMD_ATAPI 0x01000000 #define AHCI_P_CMD_DLAE 0x02000000 #define AHCI_P_CMD_ALPE 0x04000000 @@ -268,6 +271,15 @@ #define AHCI_P_CI 0x38 #define AHCI_P_SNTF 0x3C #define AHCI_P_FBS 0x40 +#define AHCI_P_FBS_EN 0x00000001 +#define AHCI_P_FBS_DEC 0x00000002 +#define AHCI_P_FBS_SDE 0x00000004 +#define AHCI_P_FBS_DEV 0x00000f00 +#define AHCI_P_FBS_DEV_SHIFT 8 +#define AHCI_P_FBS_ADO 0x0000f000 +#define AHCI_P_FBS_ADO_SHIFT 12 +#define AHCI_P_FBS_DWE 0x000f0000 +#define AHCI_P_FBS_DWE_SHIFT 16 /* Just to be sure, if building as module. */ #if MAXPHYS < 512 * 1024 @@ -374,6 +386,7 @@ struct ahci_channel { struct cam_path *path; uint32_t caps; /* Controller capabilities */ uint32_t caps2; /* Controller capabilities */ + uint32_t chcaps; /* Channel capabilities */ int quirks; int numslots; /* Number of present slots */ int pm_level; /* power management level */ @@ -383,11 +396,16 @@ struct ahci_channel { struct mtx mtx; /* state lock */ int devices; /* What is present */ int pm_present; /* PM presence reported */ + int fbs_enabled; /* FIS-based switching enabled */ uint32_t oslots; /* Occupied slots */ uint32_t rslots; /* Running slots */ uint32_t aslots; /* Slots with atomic commands */ + uint32_t eslots; /* Slots in error */ int numrslots; /* Number of running slots */ + int numrslotspd[16];/* Number of running slots per dev */ int numtslots; /* Number of tagged slots */ + int numtslotspd[16];/* Number of tagged slots per dev */ + int numhslots; /* Number of holden slots */ int readlog; /* Our READ LOG active */ int fatalerr; /* Fatal error happend */ int lastslot; /* Last used slot */ From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 19:59:07 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34DB7106566B; Sun, 14 Feb 2010 19:59:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6D38FC08; Sun, 14 Feb 2010 19:59:07 +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 o1EJx6H9070695; Sun, 14 Feb 2010 19:59:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EJx6tM070692; Sun, 14 Feb 2010 19:59:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002141959.o1EJx6tM070692@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 19:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203902 - in stable/8/sys/dev: ahci siis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 19:59:07 -0000 Author: mav Date: Sun Feb 14 19:59:06 2010 New Revision: 203902 URL: http://svn.freebsd.org/changeset/base/203902 Log: MFC r203165: Reset port on disconnect event, to abort any running requests. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/siis/siis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:57:54 2010 (r203901) +++ stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:59:06 2010 (r203902) @@ -1161,17 +1161,15 @@ ahci_phy_check_events(device_t dev, u_in u_int32_t status = ATA_INL(ch->r_mem, AHCI_P_SSTS); union ccb *ccb; - if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && - ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && - ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { - if (bootverbose) + if (bootverbose) { + if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && + ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && + ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { device_printf(dev, "CONNECT requested\n"); - ahci_reset(dev); - } else { - if (bootverbose) + } else device_printf(dev, "DISCONNECT requested\n"); - ch->devices = 0; } + ahci_reset(dev); if ((ccb = xpt_alloc_ccb_nowait()) == NULL) return; if (xpt_create_path(&ccb->ccb_h.path, NULL, Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Sun Feb 14 19:57:54 2010 (r203901) +++ stable/8/sys/dev/siis/siis.c Sun Feb 14 19:59:06 2010 (r203902) @@ -728,17 +728,15 @@ siis_phy_check_events(device_t dev) u_int32_t status = ATA_INL(ch->r_mem, SIIS_P_SSTS); union ccb *ccb; - if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && - ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && - ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { - if (bootverbose) + if (bootverbose) { + if (((status & ATA_SS_DET_MASK) == ATA_SS_DET_PHY_ONLINE) && + ((status & ATA_SS_SPD_MASK) != ATA_SS_SPD_NO_SPEED) && + ((status & ATA_SS_IPM_MASK) == ATA_SS_IPM_ACTIVE)) { device_printf(dev, "CONNECT requested\n"); - siis_reset(dev); - } else { - if (bootverbose) + } else device_printf(dev, "DISCONNECT requested\n"); - ch->devices = 0; } + siis_reset(dev); if ((ccb = xpt_alloc_ccb_nowait()) == NULL) return; if (xpt_create_path(&ccb->ccb_h.path, NULL, From owner-svn-src-stable-8@FreeBSD.ORG Sun Feb 14 20:00:21 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D48E9106568D; Sun, 14 Feb 2010 20:00:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3FDB8FC16; Sun, 14 Feb 2010 20:00: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 o1EK0LjP071073; Sun, 14 Feb 2010 20:00:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1EK0L0Q071071; Sun, 14 Feb 2010 20:00:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002142000.o1EK0L0Q071071@svn.freebsd.org> From: Alexander Motin Date: Sun, 14 Feb 2010 20:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203904 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Feb 2010 20:00:21 -0000 Author: mav Date: Sun Feb 14 20:00:21 2010 New Revision: 203904 URL: http://svn.freebsd.org/changeset/base/203904 Log: MFC r203426: Disable PHY of unconnected ports when interface power management enabled. It allows to save a bit more power (about 0.5W on 2 unused ports of ICH8M). Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Sun Feb 14 19:59:19 2010 (r203903) +++ stable/8/sys/dev/ahci/ahci.c Sun Feb 14 20:00:21 2010 (r203904) @@ -2291,7 +2291,12 @@ ahci_sata_phy_reset(device_t dev) ATA_SC_DET_IDLE | val | ((ch->pm_level > 0) ? 0 : (ATA_SC_IPM_DIS_PARTIAL | ATA_SC_IPM_DIS_SLUMBER))); DELAY(5000); - return (ahci_sata_connect(ch)); + if (!ahci_sata_connect(ch)) { + if (ch->pm_level > 0) + ATA_OUTL(ch->r_mem, AHCI_P_SCTL, ATA_SC_DET_DISABLE); + return (0); + } + return (1); } static void From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 15 11:29:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1B02106566B; Mon, 15 Feb 2010 11:29:27 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75CA88FC08; Mon, 15 Feb 2010 11:29:27 +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 o1FBTR3u085571; Mon, 15 Feb 2010 11:29:27 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FBTReE085569; Mon, 15 Feb 2010 11:29:27 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002151129.o1FBTReE085569@svn.freebsd.org> From: Ruslan Ermilov Date: Mon, 15 Feb 2010 11:29:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203914 - in stable/8/tools: . regression/lib/msun regression/usr.bin/pkill tools/ath/common tools/termcap X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 11:29:27 -0000 Author: ru Date: Mon Feb 15 11:29:27 2010 New Revision: 203914 URL: http://svn.freebsd.org/changeset/base/203914 Log: MFC: r202969: Actualize. Modified: stable/8/tools/make_libdeps.sh Directory Properties: stable/8/tools/ (props changed) stable/8/tools/kerneldoc/subsys/ (props changed) stable/8/tools/regression/acltools/ (props changed) stable/8/tools/regression/bin/sh/ (props changed) stable/8/tools/regression/fifo/ (props changed) stable/8/tools/regression/geom/ (props changed) stable/8/tools/regression/lib/libc/ (props changed) stable/8/tools/regression/lib/msun/test-conj.t (props changed) stable/8/tools/regression/poll/ (props changed) stable/8/tools/regression/priv/ (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_g.t (props changed) stable/8/tools/regression/usr.bin/pkill/pgrep-_s.t (props changed) stable/8/tools/regression/usr.bin/pkill/pkill-_g.t (props changed) stable/8/tools/tools/ath/ (props changed) stable/8/tools/tools/ath/common/dumpregs.h (props changed) stable/8/tools/tools/ath/common/dumpregs_5210.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5211.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5212.c (props changed) stable/8/tools/tools/ath/common/dumpregs_5416.c (props changed) stable/8/tools/tools/termcap/termcap.pl (props changed) stable/8/tools/tools/vimage/ (props changed) Modified: stable/8/tools/make_libdeps.sh ============================================================================== --- stable/8/tools/make_libdeps.sh Mon Feb 15 09:19:07 2010 (r203913) +++ stable/8/tools/make_libdeps.sh Mon Feb 15 11:29:27 2010 (r203914) @@ -47,9 +47,12 @@ sed -E -e's; ;! ;g' -e's;$;!;' -e's;-lbsdxml!;lib/libexpat;g' + -e's;-lpthread!;lib/libthr;g' -e's;-lm!;lib/msun;g' - -e's;-l(supc\+\+)!;gnu/lib/lib\1;g' - -e's;-l(asn1|krb5|roken)!;kerberos5/lib/lib\1;g' + -e's;-l(ncurses|termcap)!;lib/ncurses/ncurses;g' + -e's;-l(gcc)!;gnu/lib/lib\1;g' + -e's;-lssp_nonshared!;gnu/lib/libssp/libssp_nonshared;g' + -e's;-l(asn1|heimntlm|hx509|krb5|roken)!;kerberos5/lib/lib\1;g' -e's;-l(crypto|ssh|ssl)!;secure/lib/lib\1;g' -e's;-l([^!]+)!;lib/lib\1;g' " From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 15 15:00:41 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26366106568B; Mon, 15 Feb 2010 15:00:41 +0000 (UTC) (envelope-from raj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13C778FC0A; Mon, 15 Feb 2010 15:00:41 +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 o1FF0eoi033486; Mon, 15 Feb 2010 15:00:40 GMT (envelope-from raj@svn.freebsd.org) Received: (from raj@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FF0eMo033484; Mon, 15 Feb 2010 15:00:40 GMT (envelope-from raj@svn.freebsd.org) Message-Id: <201002151500.o1FF0eMo033484@svn.freebsd.org> From: Rafal Jaworowski Date: Mon, 15 Feb 2010 15:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203925 - stable/8/sys/arm/arm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 15:00:41 -0000 Author: raj Date: Mon Feb 15 15:00:40 2010 New Revision: 203925 URL: http://svn.freebsd.org/changeset/base/203925 Log: MFC r203637: Improve checking whether an ARM VA has a valid mapping before performing cache sync. VIPT/PIPT caches need valid VA-PA mapping in PTE for a cache operation to succeed (unlike VIVT). Prior to this fix pmap was using l2pte_valid() for that check, but this is not sufficient as the function merely checks if a PTE exists (there can be existing but _invalid_ entries in the table). A new pmap_has_valid_mapping() routine is introduced to do this job right by checking proper PTE flags. Among other potential problems this cures coherency issues with L2 caches on MV-78100. Submitted by: Grzegorz Bernacki, Piotr Ziecik Reviewed, tested by: marcel Obtained from: Semihalf Modified: stable/8/sys/arm/arm/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/arm/arm/pmap.c ============================================================================== --- stable/8/sys/arm/arm/pmap.c Mon Feb 15 14:38:30 2010 (r203924) +++ stable/8/sys/arm/arm/pmap.c Mon Feb 15 15:00:40 2010 (r203925) @@ -1199,79 +1199,38 @@ pmap_tlb_flushD(pmap_t pm) cpu_tlb_flushD(); } -static PMAP_INLINE void -pmap_l2cache_wbinv_range(pmap_t pm, vm_offset_t va, vm_size_t len) +static int +pmap_has_valid_mapping(pmap_t pm, vm_offset_t va) { - vm_size_t rest; pd_entry_t *pde; pt_entry_t *ptep; - rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); - - while (len > 0) { - CTR4(KTR_PMAP, "pmap_l2cache_wbinv_range: pmap %p is_kernel %d " - "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); - if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wbinv_range(va, rest); - - len -= rest; - va += rest; + if (pmap_get_pde_pte(pm, va, &pde, &ptep) && + ptep && ((*ptep & L2_TYPE_MASK) != L2_TYPE_INV)) + return (1); - rest = MIN(PAGE_SIZE, len); - } + return (0); } static PMAP_INLINE void pmap_idcache_wbinv_range(pmap_t pm, vm_offset_t va, vm_size_t len) { - - if (pmap_is_current(pm)) { - cpu_idcache_wbinv_range(va, len); - pmap_l2cache_wbinv_range(pm, va, len); - } -} - -static PMAP_INLINE void -pmap_l2cache_wb_range(pmap_t pm, vm_offset_t va, vm_size_t len) -{ - vm_size_t rest; - pd_entry_t *pde; - pt_entry_t *ptep; - - rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); - - while (len > 0) { - CTR4(KTR_PMAP, "pmap_l2cache_wb_range: pmap %p is_kernel %d " - "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); - if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_wb_range(va, rest); - - len -= rest; - va += rest; - - rest = MIN(PAGE_SIZE, len); - } -} - -static PMAP_INLINE void -pmap_l2cache_inv_range(pmap_t pm, vm_offset_t va, vm_size_t len) -{ vm_size_t rest; - pd_entry_t *pde; - pt_entry_t *ptep; - - rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); - while (len > 0) { - CTR4(KTR_PMAP, "pmap_l2cache_wb_range: pmap %p is_kernel %d " - "va 0x%08x len 0x%x ", pm, pm == pmap_kernel(), va, rest); - if (pmap_get_pde_pte(pm, va, &pde, &ptep) && l2pte_valid(*ptep)) - cpu_l2cache_inv_range(va, rest); + CTR4(KTR_PMAP, "pmap_dcache_wbinv_range: pmap %p is_kernel %d va 0x%08x" + " len 0x%x ", pm, pm == pmap_kernel(), va, len); - len -= rest; - va += rest; - - rest = MIN(PAGE_SIZE, len); + if (pmap_is_current(pm) || pm == pmap_kernel()) { + rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); + while (len > 0) { + if (pmap_has_valid_mapping(pm, va)) { + cpu_idcache_wbinv_range(va, rest); + cpu_l2cache_wbinv_range(va, rest); + } + len -= rest; + va += rest; + rest = MIN(PAGE_SIZE, len); + } } } @@ -1279,24 +1238,31 @@ static PMAP_INLINE void pmap_dcache_wb_range(pmap_t pm, vm_offset_t va, vm_size_t len, boolean_t do_inv, boolean_t rd_only) { + vm_size_t rest; CTR4(KTR_PMAP, "pmap_dcache_wb_range: pmap %p is_kernel %d va 0x%08x " "len 0x%x ", pm, pm == pmap_kernel(), va, len); CTR2(KTR_PMAP, " do_inv %d rd_only %d", do_inv, rd_only); if (pmap_is_current(pm)) { - if (do_inv) { - if (rd_only) { - cpu_dcache_inv_range(va, len); - pmap_l2cache_inv_range(pm, va, len); - } - else { - cpu_dcache_wbinv_range(va, len); - pmap_l2cache_wbinv_range(pm, va, len); - } - } else if (!rd_only) { - cpu_dcache_wb_range(va, len); - pmap_l2cache_wb_range(pm, va, len); + rest = MIN(PAGE_SIZE - (va & PAGE_MASK), len); + while (len > 0) { + if (pmap_has_valid_mapping(pm, va)) { + if (do_inv && rd_only) { + cpu_dcache_inv_range(va, rest); + cpu_l2cache_inv_range(va, rest); + } else if (do_inv) { + cpu_dcache_wbinv_range(va, rest); + cpu_l2cache_wbinv_range(va, rest); + } else if (!rd_only) { + cpu_dcache_wb_range(va, rest); + cpu_l2cache_wb_range(va, rest); + } + } + len -= rest; + va += rest; + + rest = MIN(PAGE_SIZE, len); } } } @@ -3225,7 +3191,8 @@ pmap_remove_all(vm_page_t m) */ if (pmap_is_current(pv->pv_pmap)) { cpu_dcache_inv_range(pv->pv_va, PAGE_SIZE); - cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); + if (pmap_has_valid_mapping(pv->pv_pmap, pv->pv_va)) + cpu_l2cache_inv_range(pv->pv_va, PAGE_SIZE); } if (pv->pv_flags & PVF_UNMAN) { @@ -3512,9 +3479,10 @@ do_l2b_alloc: if (pmap_is_current(pmap) && (oflags & PVF_NC) == 0 && (opte & L2_S_PROT_W) != 0 && - (prot & VM_PROT_WRITE) == 0) { + (prot & VM_PROT_WRITE) == 0 && + (opte & L2_TYPE_MASK) != L2_TYPE_INV) { cpu_dcache_wb_range(va, PAGE_SIZE); - pmap_l2cache_wb_range(pmap, va, PAGE_SIZE); + cpu_l2cache_wb_range(va, PAGE_SIZE); } } else { /* From owner-svn-src-stable-8@FreeBSD.ORG Mon Feb 15 16:41:30 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B357F1065676; Mon, 15 Feb 2010 16:41:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97FA58FC08; Mon, 15 Feb 2010 16:41: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 o1FGfURj055803; Mon, 15 Feb 2010 16:41:30 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1FGfURF055801; Mon, 15 Feb 2010 16:41:30 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002151641.o1FGfURF055801@svn.freebsd.org> From: Alexander Motin Date: Mon, 15 Feb 2010 16:41:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203928 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2010 16:41:30 -0000 Author: mav Date: Mon Feb 15 16:41:30 2010 New Revision: 203928 URL: http://svn.freebsd.org/changeset/base/203928 Log: MFC r203124: Note added FIS-based switching support. Modified: stable/8/share/man/man4/ahci.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/ahci.4 ============================================================================== --- stable/8/share/man/man4/ahci.4 Mon Feb 15 15:19:15 2010 (r203927) +++ stable/8/share/man/man4/ahci.4 Mon Feb 15 16:41:30 2010 (r203928) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2009 +.Dd January 28, 2010 .Dt AHCI 4 .Os .Sh NAME @@ -114,14 +114,11 @@ ATAPI devices are handled by the SCSI pr etc. .Pp Driver features include support for Serial ATA and ATAPI devices, -Port Multipliers, hardware command queues (up to 32 commands per port), +Port Multipliers (including FIS-based switching, when supported), +hardware command queues (up to 32 commands per port), Native Command Queuing, SATA interface Power Management, device hot-plug and Message Signaled Interrupts. .Pp -The Port Multiplier FIS Based Switching feature added in the AHCI 1.2 -specification, which is required for effective parallel operation of devices -behind Port Multipliers, is not yet supported. -.Pp AHCI hardware is also supported by ataahci driver from .Xr ata 4 subsystem. If both drivers are loaded at the same time, this one will be @@ -131,6 +128,10 @@ The .Nm driver supports AHCI compatible controllers having PCI class 1 (mass storage), subclass 6 (SATA) and programming interface 1 (AHCI). +.Pp +Also, in cooperation with atamarvell and atajmicron drivers of ata(4), +it supports AHCI part of legacy-PATA + AHCI-SATA combined controllers, +such as JMicron JMB36x and Marvell 88SX61xx. .Sh SEE ALSO .Xr ada 4 , .Xr cd 4 , From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 16 06:34:45 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41B6D10656A5; Tue, 16 Feb 2010 06:34:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 304158FC24; Tue, 16 Feb 2010 06:34:45 +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 o1G6YjSU041022; Tue, 16 Feb 2010 06:34:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1G6YjSP041020; Tue, 16 Feb 2010 06:34:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201002160634.o1G6YjSP041020@svn.freebsd.org> From: Xin LI Date: Tue, 16 Feb 2010 06:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203949 - stable/8/sys/geom/virstor X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 06:34:45 -0000 Author: delphij Date: Tue Feb 16 06:34:44 2010 New Revision: 203949 URL: http://svn.freebsd.org/changeset/base/203949 Log: MFC r203408: Prevent NULL deference by checking return value of gctl_get_asciiparam. Modified: stable/8/sys/geom/virstor/g_virstor.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/geom/virstor/g_virstor.c ============================================================================== --- stable/8/sys/geom/virstor/g_virstor.c Tue Feb 16 05:14:51 2010 (r203948) +++ stable/8/sys/geom/virstor/g_virstor.c Tue Feb 16 06:34:44 2010 (r203949) @@ -311,6 +311,11 @@ virstor_ctl_add(struct gctl_req *req, st snprintf(aname, sizeof aname, "arg%d", i); prov_name = gctl_get_asciiparam(req, aname); + if (prov_name == NULL) { + gctl_error(req, "Error fetching argument '%s'", aname); + g_topology_unlock(); + return; + } if (strncmp(prov_name, _PATH_DEV, strlen(_PATH_DEV)) == 0) prov_name += strlen(_PATH_DEV); @@ -565,6 +570,10 @@ virstor_ctl_remove(struct gctl_req *req, sprintf(param, "arg%d", i); prov_name = gctl_get_asciiparam(req, param); + if (prov_name == NULL) { + gctl_error(req, "Error fetching argument '%s'", param); + return; + } if (strncmp(prov_name, _PATH_DEV, strlen(_PATH_DEV)) == 0) prov_name += strlen(_PATH_DEV); From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 16 19:00:48 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6200C1065693; Tue, 16 Feb 2010 19:00:48 +0000 (UTC) (envelope-from emax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E3548FC1D; Tue, 16 Feb 2010 19:00: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 o1GJ0mih007373; Tue, 16 Feb 2010 19:00:48 GMT (envelope-from emax@svn.freebsd.org) Received: (from emax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GJ0mV3007369; Tue, 16 Feb 2010 19:00:48 GMT (envelope-from emax@svn.freebsd.org) Message-Id: <201002161900.o1GJ0mV3007369@svn.freebsd.org> From: Maksim Yevmenkin Date: Tue, 16 Feb 2010 19:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203962 - in stable/8: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 19:00:48 -0000 Author: emax Date: Tue Feb 16 19:00:47 2010 New Revision: 203962 URL: http://svn.freebsd.org/changeset/base/203962 Log: MFC: r203676 Introduce new rc.conf variable firewall_coscripts. It can be used to specify list of executables and/or rc scripts that should be executed after firewall starts/stops. Submitted by: Yuri Kurenkov Reviewed by: rhodes, rc@ Modified: stable/8/etc/defaults/rc.conf stable/8/etc/rc.d/ipfw stable/8/share/man/man5/rc.conf.5 Directory Properties: stable/8/etc/ (props changed) stable/8/share/man/man5/ (props changed) Modified: stable/8/etc/defaults/rc.conf ============================================================================== --- stable/8/etc/defaults/rc.conf Tue Feb 16 18:10:35 2010 (r203961) +++ stable/8/etc/defaults/rc.conf Tue Feb 16 19:00:47 2010 (r203962) @@ -118,6 +118,8 @@ firewall_type="UNKNOWN" # Firewall type firewall_quiet="NO" # Set to YES to suppress rule display firewall_logging="NO" # Set to YES to enable events logging firewall_flags="" # Flags passed to ipfw when type is a file +firewall_coscripts="" # List of executables/scripts to run after + # firewall starts/stops firewall_client_net="192.0.2.0/24" # Network address for "client" firewall. firewall_simple_iif="ed1" # Inside network interface for "simple" # firewall. Modified: stable/8/etc/rc.d/ipfw ============================================================================== --- stable/8/etc/rc.d/ipfw Tue Feb 16 18:10:35 2010 (r203961) +++ stable/8/etc/rc.d/ipfw Tue Feb 16 19:00:47 2010 (r203962) @@ -14,6 +14,7 @@ name="ipfw" rcvar="firewall_enable" start_cmd="ipfw_start" start_precmd="ipfw_prestart" +start_postcmd="ipfw_poststart" stop_cmd="ipfw_stop" required_modules="ipfw" @@ -40,9 +41,6 @@ ipfw_start() [ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall if [ -r "${firewall_script}" ]; then - if [ -f /etc/rc.d/natd ] ; then - /etc/rc.d/natd quietstart - fi /bin/sh "${firewall_script}" "${_firewall_type}" echo 'Firewall rules loaded.' elif [ "`ipfw list 65535`" = "65535 deny ip from any to any" ]; then @@ -57,6 +55,19 @@ ipfw_start() echo 'Firewall logging enabled.' sysctl net.inet.ip.fw.verbose=1 >/dev/null fi +} + +ipfw_poststart() +{ + local _coscript + + # Start firewall coscripts + # + for _coscript in ${firewall_coscripts} ; do + if [ -f "${_coscript}" ]; then + ${_coscript} quietstart + fi + done # Enable the firewall # @@ -67,13 +78,22 @@ ipfw_start() ipfw_stop() { + local _coscript + # Disable the firewall # ${SYSCTL_W} net.inet.ip.fw.enable=0 - if [ -f /etc/rc.d/natd ] ; then - /etc/rc.d/natd quietstop - fi + + # Stop firewall coscripts + # + for _coscript in `reverse_list ${firewall_coscripts}` ; do + if [ -f "${_coscript}" ]; then + ${_coscript} quietstop + fi + done } load_rc_config $name +firewall_coscripts="/etc/rc.d/natd ${firewall_coscripts}" + run_rc_command $* Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Tue Feb 16 18:10:35 2010 (r203961) +++ stable/8/share/man/man5/rc.conf.5 Tue Feb 16 19:00:47 2010 (r203962) @@ -512,6 +512,10 @@ specifies a filename. .Pq Vt str The IPv6 equivalent of .Va firewall_flags . +.It Va firewall_coscripts +.Pq Vt str +List of executables and/or rc scripts to run after firewall starts/stops. +Default is empty. .\" ----- firewall_nat_enable setting -------------------------------- .It Va firewall_nat_enable .Pq Vt bool From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 16 22:19:55 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4778106566C; Tue, 16 Feb 2010 22:19:55 +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 9A33E8FC17; Tue, 16 Feb 2010 22:19:55 +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 o1GMJtBq051862; Tue, 16 Feb 2010 22:19:55 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GMJtZi051858; Tue, 16 Feb 2010 22:19:55 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002162219.o1GMJtZi051858@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 16 Feb 2010 22:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203975 - stable/8/bin/cp X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 22:19:55 -0000 Author: gavin Date: Tue Feb 16 22:19:55 2010 New Revision: 203975 URL: http://svn.freebsd.org/changeset/base/203975 Log: Merge r202461 from head: Implement an "-x" option to cp(1), for compatibility with Linux and feature parity with du(1) and similar: When set, cp(1) will not traverse mount points. PR: bin/88056 Initial patch by: Graham J Lee leeg teaching.physics.ox.ac.uk Modified: stable/8/bin/cp/cp.1 stable/8/bin/cp/cp.c stable/8/bin/cp/utils.c Directory Properties: stable/8/bin/cp/ (props changed) Modified: stable/8/bin/cp/cp.1 ============================================================================== --- stable/8/bin/cp/cp.1 Tue Feb 16 21:59:17 2010 (r203974) +++ stable/8/bin/cp/cp.1 Tue Feb 16 22:19:55 2010 (r203975) @@ -32,7 +32,7 @@ .\" @(#)cp.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 27, 2006 +.Dd January 17, 2010 .Dt CP 1 .Os .Sh NAME @@ -45,7 +45,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i | n -.Op Fl alpv +.Op Fl alpvx .Ar source_file target_file .Nm .Oo @@ -53,7 +53,7 @@ .Op Fl H | Fl L | Fl P .Oc .Op Fl f | i | n -.Op Fl alpv +.Op Fl alpvx .Ar source_file ... target_directory .Sh DESCRIPTION In the first synopsis form, the @@ -183,6 +183,8 @@ permissions. Cause .Nm to be verbose, showing files as they are copied. +.It Fl x +File system mount points are not traversed. .El .Pp For each destination file that already exists, its contents are Modified: stable/8/bin/cp/cp.c ============================================================================== --- stable/8/bin/cp/cp.c Tue Feb 16 21:59:17 2010 (r203974) +++ stable/8/bin/cp/cp.c Tue Feb 16 22:19:55 2010 (r203975) @@ -101,8 +101,9 @@ main(int argc, char *argv[]) int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash; char *target; + fts_options = FTS_NOCHDIR | FTS_PHYSICAL; Hflag = Lflag = Pflag = 0; - while ((ch = getopt(argc, argv, "HLPRafilnprv")) != -1) + while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1) switch (ch) { case 'H': Hflag = 1; @@ -150,6 +151,9 @@ main(int argc, char *argv[]) case 'v': vflag = 1; break; + case 'x': + fts_options |= FTS_XDEV; + break; default: usage(); break; @@ -160,7 +164,6 @@ main(int argc, char *argv[]) if (argc < 2) usage(); - fts_options = FTS_NOCHDIR | FTS_PHYSICAL; if (Rflag && rflag) errx(1, "the -R and -r options may not be specified together"); if (rflag) Modified: stable/8/bin/cp/utils.c ============================================================================== --- stable/8/bin/cp/utils.c Tue Feb 16 21:59:17 2010 (r203974) +++ stable/8/bin/cp/utils.c Tue Feb 16 22:19:55 2010 (r203975) @@ -518,8 +518,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", -"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file", -" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... " +"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file", +" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... " "target_directory"); exit(EX_USAGE); } From owner-svn-src-stable-8@FreeBSD.ORG Tue Feb 16 22:23:33 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E35D106566C; Tue, 16 Feb 2010 22:23:33 +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 5CF4B8FC17; Tue, 16 Feb 2010 22:23:33 +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 o1GMNXEc052714; Tue, 16 Feb 2010 22:23:33 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1GMNX8i052710; Tue, 16 Feb 2010 22:23:33 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201002162223.o1GMNX8i052710@svn.freebsd.org> From: Gavin Atkinson Date: Tue, 16 Feb 2010 22:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203976 - in stable/8/share/man/man4: . man4.i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2010 22:23:33 -0000 Author: gavin Date: Tue Feb 16 22:23:33 2010 New Revision: 203976 URL: http://svn.freebsd.org/changeset/base/203976 Log: Merge 203689 from head: Install the padlock(4) man page on amd64 as well as i386, to match the platforms where the driver itself is compiled and installed. PR: docs/130895 Reported by: George Hartzell Added: stable/8/share/man/man4/padlock.4 - copied unchanged from r203689, head/share/man/man4/padlock.4 Deleted: stable/8/share/man/man4/man4.i386/padlock.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/man4.i386/Makefile Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile ============================================================================== --- stable/8/share/man/man4/Makefile Tue Feb 16 22:19:55 2010 (r203975) +++ stable/8/share/man/man4/Makefile Tue Feb 16 22:23:33 2010 (r203976) @@ -294,6 +294,7 @@ MAN= aac.4 \ ${_nxge.4} \ ohci.4 \ orm.4 \ + ${_padlock.4} \ pass.4 \ patm.4 \ pccard.4 \ @@ -641,6 +642,7 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_padlock.4= padlock.4 _rr232x.4= rr232x.4 _speaker.4= speaker.4 _spkr.4= spkr.4 Modified: stable/8/share/man/man4/man4.i386/Makefile ============================================================================== --- stable/8/share/man/man4/man4.i386/Makefile Tue Feb 16 22:19:55 2010 (r203975) +++ stable/8/share/man/man4/man4.i386/Makefile Tue Feb 16 22:23:33 2010 (r203976) @@ -21,7 +21,6 @@ MAN= aic.4 \ mcd.4 \ mse.4 \ npx.4 \ - padlock.4 \ pae.4 \ pbio.4 \ pcf.4 \ Copied: stable/8/share/man/man4/padlock.4 (from r203689, head/share/man/man4/padlock.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man4/padlock.4 Tue Feb 16 22:23:33 2010 (r203976, copy of r203689, head/share/man/man4/padlock.4) @@ -0,0 +1,97 @@ +.\" Copyright (c) 2005 Christian Brueffer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 8, 2010 +.Dt PADLOCK 4 +.Os +.Sh NAME +.Nm padlock +.Nd "driver for the cryptographic functions and RNG in VIA C3, C7 and Eden processors" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device crypto" +.Cd "device padlock" +.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 +padlock_load="YES" +.Ed +.Sh DESCRIPTION +The C3 and Eden processor series from VIA include hardware acceleration for +AES. +The C7 series includes hardware acceleration for AES, SHA1, SHA256 and RSA. +All of the above processor series include a hardware random number generator. +.Pp +The +.Nm +driver registers itself to accelerate AES operations and, if available, HMAC/SHA1 +and HMAC/SHA256 for +.Xr crypto 4 . +It also registers itself to accelerate other HMAC algorithms, although +there is no hardware acceleration for those algorithms. +This is only needed so +.Nm +can work with +.Xr ipsec 4 . +.Pp +The hardware random number generator supplies data for the kernel +.Xr random 4 +subsystem. +.Sh SEE ALSO +.Xr crypt 3 , +.Xr crypto 4 , +.Xr intro 4 , +.Xr ipsec 4 , +.Xr random 4 , +.Xr crypto 9 +.Sh HISTORY +The +.Nm +driver first appeared in +.Ox . +The first +.Fx +release to include it was +.Fx 6.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver with AES encryption support was written by +.An Jason Wright Aq jason@OpenBSD.org . +It was ported to +.Fx +and then extended to support SHA1 and SHA256 +by +.An Pawel Jakub Dawidek Aq pjd@FreeBSD.org . +This manual page was written by +.An Christian Brueffer Aq brueffer@FreeBSD.org . From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 17 09:03:38 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4AFC1065672; Wed, 17 Feb 2010 09:03:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B39198FC0A; Wed, 17 Feb 2010 09:03:38 +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 o1H93cNP094194; Wed, 17 Feb 2010 09:03:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1H93c6M094192; Wed, 17 Feb 2010 09:03:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002170903.o1H93c6M094192@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 17 Feb 2010 09:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203988 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 09:03:38 -0000 Author: kib Date: Wed Feb 17 09:03:38 2010 New Revision: 203988 URL: http://svn.freebsd.org/changeset/base/203988 Log: MFC r203875: Do not leak process lock when current thread is not allowed to see target. Modified: stable/8/sys/kern/kern_event.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/kern/kern_event.c ============================================================================== --- stable/8/sys/kern/kern_event.c Wed Feb 17 08:40:54 2010 (r203987) +++ stable/8/sys/kern/kern_event.c Wed Feb 17 09:03:38 2010 (r203988) @@ -334,8 +334,10 @@ filt_procattach(struct knote *kn) if (p == NULL) return (ESRCH); - if ((error = p_cansee(curthread, p))) + if ((error = p_cansee(curthread, p))) { + PROC_UNLOCK(p); return (error); + } kn->kn_ptr.p_proc = p; kn->kn_flags |= EV_CLEAR; /* automatically set */ From owner-svn-src-stable-8@FreeBSD.ORG Wed Feb 17 09:09:12 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF870106566B; Wed, 17 Feb 2010 09:09:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BDA808FC08; Wed, 17 Feb 2010 09:09: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 o1H99CT5095449; Wed, 17 Feb 2010 09:09:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1H99C2G095444; Wed, 17 Feb 2010 09:09:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002170909.o1H99C2G095444@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 17 Feb 2010 09:09:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r203989 - in stable/8/lib/msun: amd64 i387 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Feb 2010 09:09:12 -0000 Author: kib Date: Wed Feb 17 09:09:12 2010 New Revision: 203989 URL: http://svn.freebsd.org/changeset/base/203989 Log: MFC r203441: Placate new binutils, by using 16-bit %ax instead of 32-bit %eax as an argument for fnstsw. Explicitely specify sizes for the XMM control and status word and X87 control and status words. Modified: stable/8/lib/msun/amd64/fenv.c stable/8/lib/msun/amd64/fenv.h stable/8/lib/msun/i387/fenv.c stable/8/lib/msun/i387/fenv.h Directory Properties: stable/8/lib/msun/ (props changed) Modified: stable/8/lib/msun/amd64/fenv.c ============================================================================== --- stable/8/lib/msun/amd64/fenv.c Wed Feb 17 09:03:38 2010 (r203988) +++ stable/8/lib/msun/amd64/fenv.c Wed Feb 17 09:09:12 2010 (r203989) @@ -86,7 +86,7 @@ fegetenv(fenv_t *envp) int feholdexcept(fenv_t *envp) { - int mxcsr; + __uint32_t mxcsr; __stmxcsr(&mxcsr); __fnstenv(&envp->__x87); @@ -101,7 +101,8 @@ feholdexcept(fenv_t *envp) int feupdateenv(const fenv_t *envp) { - int mxcsr, status; + __uint32_t mxcsr; + __uint16_t status; __fnstsw(&status); __stmxcsr(&mxcsr); @@ -113,7 +114,8 @@ feupdateenv(const fenv_t *envp) int __feenableexcept(int mask) { - int mxcsr, control, omask; + __uint32_t mxcsr, omask; + __uint16_t control; mask &= FE_ALL_EXCEPT; __fnstcw(&control); @@ -129,7 +131,8 @@ __feenableexcept(int mask) int __fedisableexcept(int mask) { - int mxcsr, control, omask; + __uint32_t mxcsr, omask; + __uint16_t control; mask &= FE_ALL_EXCEPT; __fnstcw(&control); Modified: stable/8/lib/msun/amd64/fenv.h ============================================================================== --- stable/8/lib/msun/amd64/fenv.h Wed Feb 17 09:03:38 2010 (r203988) +++ stable/8/lib/msun/amd64/fenv.h Wed Feb 17 09:09:12 2010 (r203989) @@ -110,7 +110,8 @@ feclearexcept(int __excepts) static __inline int fegetexceptflag(fexcept_t *__flagp, int __excepts) { - int __mxcsr, __status; + __uint32_t __mxcsr; + __uint16_t __status; __stmxcsr(&__mxcsr); __fnstsw(&__status); @@ -124,7 +125,8 @@ int feraiseexcept(int __excepts); static __inline int fetestexcept(int __excepts) { - int __mxcsr, __status; + __uint32_t __mxcsr; + __uint16_t __status; __stmxcsr(&__mxcsr); __fnstsw(&__status); @@ -134,7 +136,7 @@ fetestexcept(int __excepts) static __inline int fegetround(void) { - int __control; + __uint16_t __control; /* * We assume that the x87 and the SSE unit agree on the @@ -149,7 +151,8 @@ fegetround(void) static __inline int fesetround(int __round) { - int __mxcsr, __control; + __uint32_t __mxcsr; + __uint16_t __control; if (__round & ~_ROUND_MASK) return (-1); @@ -197,7 +200,7 @@ int fedisableexcept(int __mask); static __inline int fegetexcept(void) { - int __control; + __uint16_t __control; /* * We assume that the masks for the x87 and the SSE unit are Modified: stable/8/lib/msun/i387/fenv.c ============================================================================== --- stable/8/lib/msun/i387/fenv.c Wed Feb 17 09:03:38 2010 (r203988) +++ stable/8/lib/msun/i387/fenv.c Wed Feb 17 09:09:12 2010 (r203989) @@ -87,7 +87,7 @@ int fesetexceptflag(const fexcept_t *flagp, int excepts) { fenv_t env; - int mxcsr; + __uint32_t mxcsr; __fnstenv(&env); env.__status &= ~excepts; @@ -117,7 +117,7 @@ feraiseexcept(int excepts) int fegetenv(fenv_t *envp) { - int mxcsr; + __uint32_t mxcsr; __fnstenv(envp); /* @@ -135,7 +135,7 @@ fegetenv(fenv_t *envp) int feholdexcept(fenv_t *envp) { - int mxcsr; + __uint32_t mxcsr; __fnstenv(envp); __fnclex(); @@ -152,7 +152,8 @@ feholdexcept(fenv_t *envp) int feupdateenv(const fenv_t *envp) { - int mxcsr, status; + __uint32_t mxcsr; + __uint16_t status; __fnstsw(&status); if (__HAS_SSE()) @@ -167,7 +168,8 @@ feupdateenv(const fenv_t *envp) int __feenableexcept(int mask) { - int mxcsr, control, omask; + __uint32_t mxcsr, omask; + __uint16_t control; mask &= FE_ALL_EXCEPT; __fnstcw(&control); @@ -188,7 +190,8 @@ __feenableexcept(int mask) int __fedisableexcept(int mask) { - int mxcsr, control, omask; + __uint32_t mxcsr, omask; + __uint16_t control; mask &= FE_ALL_EXCEPT; __fnstcw(&control); Modified: stable/8/lib/msun/i387/fenv.h ============================================================================== --- stable/8/lib/msun/i387/fenv.h Wed Feb 17 09:03:38 2010 (r203988) +++ stable/8/lib/msun/i387/fenv.h Wed Feb 17 09:09:12 2010 (r203989) @@ -114,7 +114,7 @@ static __inline int feclearexcept(int __excepts) { fenv_t __env; - int __mxcsr; + __uint32_t __mxcsr; if (__excepts == FE_ALL_EXCEPT) { __fnclex(); @@ -134,7 +134,8 @@ feclearexcept(int __excepts) static __inline int fegetexceptflag(fexcept_t *__flagp, int __excepts) { - int __mxcsr, __status; + __uint32_t __mxcsr; + __uint16_t __status; __fnstsw(&__status); if (__HAS_SSE()) @@ -151,7 +152,8 @@ int feraiseexcept(int __excepts); static __inline int fetestexcept(int __excepts) { - int __mxcsr, __status; + __uint32_t __mxcsr; + __uint16_t __status; __fnstsw(&__status); if (__HAS_SSE()) @@ -164,7 +166,7 @@ fetestexcept(int __excepts) static __inline int fegetround(void) { - int __control; + __uint16_t __control; /* * We assume that the x87 and the SSE unit agree on the @@ -179,7 +181,8 @@ fegetround(void) static __inline int fesetround(int __round) { - int __mxcsr, __control; + __uint32_t __mxcsr; + __uint16_t __control; if (__round & ~_ROUND_MASK) return (-1); @@ -206,7 +209,7 @@ static __inline int fesetenv(const fenv_t *__envp) { fenv_t __env = *__envp; - int __mxcsr; + __uint32_t __mxcsr; __mxcsr = __get_mxcsr(__env); __set_mxcsr(__env, 0xffffffff); @@ -234,7 +237,7 @@ int fedisableexcept(int __mask); static __inline int fegetexcept(void) { - int __control; + __uint16_t __control; /* * We assume that the masks for the x87 and the SSE unit are From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 01:15:58 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AB20106566B; Thu, 18 Feb 2010 01:15:58 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48D6E8FC0A; Thu, 18 Feb 2010 01:15: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 o1I1Fwo9012445; Thu, 18 Feb 2010 01:15:58 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1I1FwZk012443; Thu, 18 Feb 2010 01:15:58 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201002180115.o1I1FwZk012443@svn.freebsd.org> From: Matt Jacob Date: Thu, 18 Feb 2010 01:15:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204023 - stable/8/sbin/geom/class/multipath X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 01:15:58 -0000 Author: mjacob Date: Thu Feb 18 01:15:58 2010 New Revision: 204023 URL: http://svn.freebsd.org/changeset/base/204023 Log: Add the long missing "destroy" option [mfc of 203505] Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c Directory Properties: stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/stripe/ (props changed) Modified: stable/8/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- stable/8/sbin/geom/class/multipath/geom_multipath.c Wed Feb 17 23:54:54 2010 (r204022) +++ stable/8/sbin/geom/class/multipath/geom_multipath.c Thu Feb 18 01:15:58 2010 (r204023) @@ -55,6 +55,10 @@ struct g_command class_commands[] = { NULL, "[-v] name prov ..." }, { + "destroy", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, + NULL, "[-v] prov ..." + }, + { "clear", G_FLAG_VERBOSE, mp_main, G_NULL_OPTS, NULL, "[-v] prov ..." }, From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 10:39:54 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64B26106568D; Thu, 18 Feb 2010 10:39:54 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 530E68FC12; Thu, 18 Feb 2010 10:39: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 o1IAdsnW039107; Thu, 18 Feb 2010 10:39:54 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IAdsSO039106; Thu, 18 Feb 2010 10:39:54 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181039.o1IAdsSO039106@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 10:39:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204032 - stable/8/share/man/man4 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 10:39:54 -0000 Author: brucec Date: Thu Feb 18 10:39:53 2010 New Revision: 204032 URL: http://svn.freebsd.org/changeset/base/204032 Log: MFC r203681: Fix typo and remove extra spaces. Approved by: rrs (mentor) Modified: stable/8/share/man/man4/sctp.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/sctp.4 ============================================================================== --- stable/8/share/man/man4/sctp.4 Thu Feb 18 05:49:52 2010 (r204031) +++ stable/8/share/man/man4/sctp.4 Thu Feb 18 10:39:53 2010 (r204032) @@ -154,8 +154,8 @@ also supports the following extensions: This extension allows one to have message be skipped and not delivered based on some user specified parameters. .It "sctp dynamic addressing" - This extension allows addresses to be added and deleted -dynammically from an existing association. +This extension allows addresses to be added and deleted +dynamically from an existing association. .It "sctp authentication" This extension allows the user to authenticate specific peer chunks (including data) to validate that the peer @@ -164,7 +164,7 @@ association. A shared key option is also provided for so that two stacks can pre-share keys. .It "packet drop" - Some routers support a special satellite protocol that +Some routers support a special satellite protocol that will report losses due to corruption. This allows retransmissions without subsequent loss in bandwidth utilization. From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 10:46:25 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9009106568B; Thu, 18 Feb 2010 10:46:25 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D3F88FC14; Thu, 18 Feb 2010 10:46: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 o1IAkPPW040652; Thu, 18 Feb 2010 10:46:25 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IAkP2k040648; Thu, 18 Feb 2010 10:46:25 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181046.o1IAkP2k040648@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 10:46:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204033 - in stable/8: bin/pkill bin/ps usr.bin/w X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 10:46:25 -0000 Author: brucec Date: Thu Feb 18 10:46:25 2010 New Revision: 204033 URL: http://svn.freebsd.org/changeset/base/204033 Log: MFC r203688: Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows the -M option to be used without specifying -N. PR: bin/138146 Approved by: rrs (mentor) Modified: stable/8/bin/pkill/pkill.c stable/8/bin/ps/ps.c stable/8/usr.bin/w/w.c Directory Properties: stable/8/bin/pkill/ (props changed) stable/8/bin/ps/ (props changed) stable/8/usr.bin/w/ (props changed) Modified: stable/8/bin/pkill/pkill.c ============================================================================== --- stable/8/bin/pkill/pkill.c Thu Feb 18 10:39:53 2010 (r204032) +++ stable/8/bin/pkill/pkill.c Thu Feb 18 10:46:25 2010 (r204033) @@ -180,7 +180,8 @@ main(int argc, char **argv) debug_opt = 0; pidfile = NULL; pidfilelock = 0; - execf = coref = _PATH_DEVNULL; + execf = NULL; + coref = _PATH_DEVNULL; while ((ch = getopt(argc, argv, "DF:G:ILM:N:P:SU:ad:fg:ij:lnos:t:u:vx")) != -1) switch (ch) { Modified: stable/8/bin/ps/ps.c ============================================================================== --- stable/8/bin/ps/ps.c Thu Feb 18 10:39:53 2010 (r204032) +++ stable/8/bin/ps/ps.c Thu Feb 18 10:46:25 2010 (r204033) @@ -212,7 +212,8 @@ main(int argc, char *argv[]) init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id"); init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty"); init_list(&uidlist, addelem_uid, sizeof(uid_t), "user"); - memf = nlistf = _PATH_DEVNULL; + memf = _PATH_DEVNULL; + nlistf = NULL; while ((ch = getopt(argc, argv, PS_ARGS)) != -1) switch (ch) { case 'A': Modified: stable/8/usr.bin/w/w.c ============================================================================== --- stable/8/usr.bin/w/w.c Thu Feb 18 10:39:53 2010 (r204032) +++ stable/8/usr.bin/w/w.c Thu Feb 18 10:46:25 2010 (r204033) @@ -158,7 +158,8 @@ main(int argc, char *argv[]) } dropgid = 0; - memf = nlistf = _PATH_DEVNULL; + memf = _PATH_DEVNULL; + nlistf = NULL; while ((ch = getopt(argc, argv, p)) != -1) switch (ch) { case 'd': From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 10:48:37 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA9F106566B; Thu, 18 Feb 2010 10:48:37 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 591C28FC13; Thu, 18 Feb 2010 10:48:37 +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 o1IAmbsc041165; Thu, 18 Feb 2010 10:48:37 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IAmbw7041163; Thu, 18 Feb 2010 10:48:37 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181048.o1IAmbw7041163@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 10:48:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204034 - stable/8/usr.sbin/sysinstall X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 10:48:37 -0000 Author: brucec Date: Thu Feb 18 10:48:37 2010 New Revision: 204034 URL: http://svn.freebsd.org/changeset/base/204034 Log: MFC r203690: Xorg isn't treated as a distribution, so /usr/X11R6/lib shouldn't be configured when running ldconfig. PR: bin/138945 Approved by: rrs (mentor) Modified: stable/8/usr.sbin/sysinstall/package.c Directory Properties: stable/8/usr.sbin/sysinstall/ (props changed) Modified: stable/8/usr.sbin/sysinstall/package.c ============================================================================== --- stable/8/usr.sbin/sysinstall/package.c Thu Feb 18 10:46:25 2010 (r204033) +++ stable/8/usr.sbin/sysinstall/package.c Thu Feb 18 10:48:37 2010 (r204034) @@ -139,7 +139,7 @@ package_extract(Device *dev, char *name, /* If necessary, initialize the ldconfig hints */ if (!file_readable("/var/run/ld-elf.so.hints")) - vsystem("ldconfig /usr/lib /usr/lib/compat /usr/local/lib /usr/X11R6/lib"); + vsystem("ldconfig /usr/lib /usr/lib/compat /usr/local/lib"); /* Be initially optimistic */ ret = DITEM_SUCCESS; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 10:51:31 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93AEA1065695; Thu, 18 Feb 2010 10:51:31 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 691508FC1D; Thu, 18 Feb 2010 10:51:31 +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 o1IApVKo041861; Thu, 18 Feb 2010 10:51:31 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IApVih041856; Thu, 18 Feb 2010 10:51:31 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181051.o1IApVih041856@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 10:51:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204035 - stable/8/lib/libc/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 10:51:31 -0000 Author: brucec Date: Thu Feb 18 10:51:31 2010 New Revision: 204035 URL: http://svn.freebsd.org/changeset/base/204035 Log: MFC r203322: Fix typo of ENOTCONN. Add missing RETURN VALUES section in sctp_opt_info(3). Approved by: rrs (mentor) Modified: stable/8/lib/libc/net/sctp_opt_info.3 stable/8/lib/libc/net/sctp_recvmsg.3 stable/8/lib/libc/net/sctp_send.3 stable/8/lib/libc/net/sctp_sendmsg.3 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/net/sctp_opt_info.3 ============================================================================== --- stable/8/lib/libc/net/sctp_opt_info.3 Thu Feb 18 10:48:37 2010 (r204034) +++ stable/8/lib/libc/net/sctp_opt_info.3 Thu Feb 18 10:51:31 2010 (r204035) @@ -87,6 +87,8 @@ socket options. .Dv SCTP_PEER_AUTH_CHUNKS .Pp .Dv SCTP_LOCAL_AUTH_CHUNKS +.Sh RETURN VALUES +The call returns 0 on success and -1 upon error. .Sh ERRORS The .Fn sctp_opt_info Modified: stable/8/lib/libc/net/sctp_recvmsg.3 ============================================================================== --- stable/8/lib/libc/net/sctp_recvmsg.3 Thu Feb 18 10:48:37 2010 (r204034) +++ stable/8/lib/libc/net/sctp_recvmsg.3 Thu Feb 18 10:51:31 2010 (r204035) @@ -269,7 +269,7 @@ This generally indicates that the interf but may be caused by transient congestion. .It Bq Er EHOSTUNREACH The remote host was unreachable. -.It Bq Er ENOTCON +.It Bq Er ENOTCONN On a one-to-one style socket no association exists. .It Bq Er ECONNRESET An abort was received by the stack while the user was Modified: stable/8/lib/libc/net/sctp_send.3 ============================================================================== --- stable/8/lib/libc/net/sctp_send.3 Thu Feb 18 10:48:37 2010 (r204034) +++ stable/8/lib/libc/net/sctp_send.3 Thu Feb 18 10:51:31 2010 (r204035) @@ -319,7 +319,7 @@ This generally indicates that the interf but may be caused by transient congestion. .It Bq Er EHOSTUNREACH The remote host was unreachable. -.It Bq Er ENOTCON +.It Bq Er ENOTCONN On a one-to-one style socket no association exists. .It Bq Er ECONNRESET An abort was received by the stack while the user was Modified: stable/8/lib/libc/net/sctp_sendmsg.3 ============================================================================== --- stable/8/lib/libc/net/sctp_sendmsg.3 Thu Feb 18 10:48:37 2010 (r204034) +++ stable/8/lib/libc/net/sctp_sendmsg.3 Thu Feb 18 10:51:31 2010 (r204035) @@ -296,7 +296,7 @@ This generally indicates that the interf but may be caused by transient congestion. .It Bq Er EHOSTUNREACH The remote host was unreachable. -.It Bq Er ENOTCON +.It Bq Er ENOTCONN On a one-to-one style socket no association exists. .It Bq Er ECONNRESET An abort was received by the stack while the user was From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 10:55:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F08BF106566C; Thu, 18 Feb 2010 10:55:42 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF31C8FC14; Thu, 18 Feb 2010 10:55:42 +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 o1IAtgJL042828; Thu, 18 Feb 2010 10:55:42 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IAtgXJ042826; Thu, 18 Feb 2010 10:55:42 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181055.o1IAtgXJ042826@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 10:55:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204036 - stable/8/lib/libc/net X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 10:55:43 -0000 Author: brucec Date: Thu Feb 18 10:55:42 2010 New Revision: 204036 URL: http://svn.freebsd.org/changeset/base/204036 Log: MFC r203323: Remove extra semicolon. Approved by: rrs (mentor) Modified: stable/8/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/stdtime/ (props changed) Modified: stable/8/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/8/lib/libc/net/sctp_sys_calls.c Thu Feb 18 10:51:31 2010 (r204035) +++ stable/8/lib/libc/net/sctp_sys_calls.c Thu Feb 18 10:55:42 2010 (r204036) @@ -784,7 +784,7 @@ sctp_sendx(int sd, const void *msg, size free(buf); if (ret != 0) { if (errno == EALREADY) { - no_end_cx = 1;; + no_end_cx = 1; goto continue_send; } return (ret); From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 10:59:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6424B1065672; Thu, 18 Feb 2010 10:59:32 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 51F1B8FC1D; Thu, 18 Feb 2010 10:59: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 o1IAxWvu043723; Thu, 18 Feb 2010 10:59:32 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IAxWiv043720; Thu, 18 Feb 2010 10:59:32 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181059.o1IAxWiv043720@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 10:59:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204037 - stable/8/sys/dev/sound/usb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 10:59:32 -0000 Author: brucec Date: Thu Feb 18 10:59:32 2010 New Revision: 204037 URL: http://svn.freebsd.org/changeset/base/204037 Log: MFC r203678: Rename usb2_ structures and variables to usb_. Approved by: rrs (mentor) Modified: stable/8/sys/dev/sound/usb/uaudio.c stable/8/sys/dev/sound/usb/uaudioreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Thu Feb 18 10:55:42 2010 (r204036) +++ stable/8/sys/dev/sound/usb/uaudio.c Thu Feb 18 10:59:32 2010 (r204037) @@ -155,16 +155,16 @@ struct uaudio_chan { struct pcmchan_caps pcm_cap; /* capabilities */ struct snd_dbuf *pcm_buf; - const struct usb_config *usb2_cfg; + const struct usb_config *usb_cfg; struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; - const struct usb2_audio_streaming_interface_descriptor *p_asid; - const struct usb2_audio_streaming_type1_descriptor *p_asf1d; - const struct usb2_audio_streaming_endpoint_descriptor *p_sed; - const usb2_endpoint_descriptor_audio_t *p_ed1; - const usb2_endpoint_descriptor_audio_t *p_ed2; + const struct usb_audio_streaming_interface_descriptor *p_asid; + const struct usb_audio_streaming_type1_descriptor *p_asf1d; + const struct usb_audio_streaming_endpoint_descriptor *p_sed; + const usb_endpoint_descriptor_audio_t *p_ed1; + const usb_endpoint_descriptor_audio_t *p_ed2; const struct uaudio_format *p_fmt; uint8_t *buf; /* pointer to buffer */ @@ -278,13 +278,13 @@ struct uaudio_search_result { struct uaudio_terminal_node { union { const struct usb_descriptor *desc; - const struct usb2_audio_input_terminal *it; - const struct usb2_audio_output_terminal *ot; - const struct usb2_audio_mixer_unit_0 *mu; - const struct usb2_audio_selector_unit *su; - const struct usb2_audio_feature_unit *fu; - const struct usb2_audio_processing_unit_0 *pu; - const struct usb2_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it; + const struct usb_audio_output_terminal *ot; + const struct usb_audio_mixer_unit_0 *mu; + const struct usb_audio_selector_unit *su; + const struct usb_audio_feature_unit *fu; + const struct usb_audio_processing_unit_0 *pu; + const struct usb_audio_extension_unit_0 *eu; } u; struct uaudio_search_result usr; struct uaudio_terminal_node *root; @@ -359,7 +359,7 @@ static void uaudio_mixer_add_mixer(struc static void uaudio_mixer_add_selector(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static uint32_t uaudio_mixer_feature_get_bmaControls( - const struct usb2_audio_feature_unit *, uint8_t); + const struct usb_audio_feature_unit *, uint8_t); static void uaudio_mixer_add_feature(struct uaudio_softc *, const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_processing_updown(struct uaudio_softc *, @@ -368,7 +368,7 @@ static void uaudio_mixer_add_processing( const struct uaudio_terminal_node *, int); static void uaudio_mixer_add_extension(struct uaudio_softc *, const struct uaudio_terminal_node *, int); -static struct usb2_audio_cluster uaudio_mixer_get_cluster(uint8_t, +static struct usb_audio_cluster uaudio_mixer_get_cluster(uint8_t, const struct uaudio_terminal_node *); static uint16_t uaudio_mixer_determine_class(const struct uaudio_terminal_node *, struct uaudio_mixer_node *); @@ -408,7 +408,7 @@ static int32_t umidi_detach(device_t dev #if USB_DEBUG static void uaudio_chan_dump_ep_desc( - const usb2_endpoint_descriptor_audio_t *); + const usb_endpoint_descriptor_audio_t *); static void uaudio_mixer_dump_cluster(uint8_t, const struct uaudio_terminal_node *); static const char *uaudio_mixer_get_terminal_name(uint16_t); @@ -782,7 +782,7 @@ uaudio_detach(device_t dev) #if USB_DEBUG static void -uaudio_chan_dump_ep_desc(const usb2_endpoint_descriptor_audio_t *ed) +uaudio_chan_dump_ep_desc(const usb_endpoint_descriptor_audio_t *ed) { if (ed) { DPRINTF("endpoint=%p bLength=%d bDescriptorType=%d \n" @@ -803,11 +803,11 @@ uaudio_chan_fill_info_sub(struct uaudio_ uint32_t rate, uint8_t channels, uint8_t bit_resolution) { struct usb_descriptor *desc = NULL; - const struct usb2_audio_streaming_interface_descriptor *asid = NULL; - const struct usb2_audio_streaming_type1_descriptor *asf1d = NULL; - const struct usb2_audio_streaming_endpoint_descriptor *sed = NULL; - const usb2_endpoint_descriptor_audio_t *ed1 = NULL; - const usb2_endpoint_descriptor_audio_t *ed2 = NULL; + const struct usb_audio_streaming_interface_descriptor *asid = NULL; + const struct usb_audio_streaming_type1_descriptor *asf1d = NULL; + const struct usb_audio_streaming_endpoint_descriptor *sed = NULL; + const usb_endpoint_descriptor_audio_t *ed1 = NULL; + const usb_endpoint_descriptor_audio_t *ed2 = NULL; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); struct usb_interface_descriptor *id; const struct uaudio_format *p_fmt; @@ -1045,10 +1045,10 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan->iface_alt_index = alt_index; if (ep_dir == UE_DIR_IN) - chan->usb2_cfg = + chan->usb_cfg = uaudio_cfg_record; else - chan->usb2_cfg = + chan->usb_cfg = uaudio_cfg_play; chan->sample_size = (( @@ -1429,7 +1429,7 @@ uaudio_chan_init(struct uaudio_softc *sc } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, - ch->usb2_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { + ch->usb_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { DPRINTF("could not allocate USB transfers!\n"); goto error; } @@ -1709,7 +1709,7 @@ uaudio_mixer_add_input(struct uaudio_sof const struct uaudio_terminal_node *iot, int id) { #if USB_DEBUG - const struct usb2_audio_input_terminal *d = iot[id].u.it; + const struct usb_audio_input_terminal *d = iot[id].u.it; DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " "bAssocTerminal=%d bNrChannels=%d wChannelConfig=%d " @@ -1725,7 +1725,7 @@ uaudio_mixer_add_output(struct uaudio_so const struct uaudio_terminal_node *iot, int id) { #if USB_DEBUG - const struct usb2_audio_output_terminal *d = iot[id].u.ot; + const struct usb_audio_output_terminal *d = iot[id].u.ot; DPRINTFN(3, "bTerminalId=%d wTerminalType=0x%04x " "bAssocTerminal=%d bSourceId=%d iTerminal=%d\n", @@ -1740,8 +1740,8 @@ uaudio_mixer_add_mixer(struct uaudio_sof { struct uaudio_mixer_node mix; - const struct usb2_audio_mixer_unit_0 *d0 = iot[id].u.mu; - const struct usb2_audio_mixer_unit_1 *d1; + const struct usb_audio_mixer_unit_0 *d0 = iot[id].u.mu; + const struct usb_audio_mixer_unit_1 *d1; uint32_t bno; /* bit number */ uint32_t p; /* bit number accumulator */ @@ -1823,7 +1823,7 @@ static void uaudio_mixer_add_selector(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_selector_unit *d = iot[id].u.su; + const struct usb_audio_selector_unit *d = iot[id].u.su; struct uaudio_mixer_node mix; uint16_t i; @@ -1864,7 +1864,7 @@ uaudio_mixer_add_selector(struct uaudio_ } static uint32_t -uaudio_mixer_feature_get_bmaControls(const struct usb2_audio_feature_unit *d, +uaudio_mixer_feature_get_bmaControls(const struct usb_audio_feature_unit *d, uint8_t index) { uint32_t temp = 0; @@ -1889,7 +1889,7 @@ static void uaudio_mixer_add_feature(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_feature_unit *d = iot[id].u.fu; + const struct usb_audio_feature_unit *d = iot[id].u.fu; struct uaudio_mixer_node mix; uint32_t fumask; uint32_t mmask; @@ -2015,10 +2015,10 @@ static void uaudio_mixer_add_processing_updown(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_processing_unit_0 *d0 = iot[id].u.pu; - const struct usb2_audio_processing_unit_1 *d1 = + const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu; + const struct usb_audio_processing_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); - const struct usb2_audio_processing_unit_updown *ud = + const struct usb_audio_processing_unit_updown *ud = (const void *)(d1->bmControls + d1->bControlSize); struct uaudio_mixer_node mix; uint8_t i; @@ -2057,8 +2057,8 @@ static void uaudio_mixer_add_processing(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_processing_unit_0 *d0 = iot[id].u.pu; - const struct usb2_audio_processing_unit_1 *d1 = + const struct usb_audio_processing_unit_0 *d0 = iot[id].u.pu; + const struct usb_audio_processing_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); struct uaudio_mixer_node mix; uint16_t ptype; @@ -2102,8 +2102,8 @@ static void uaudio_mixer_add_extension(struct uaudio_softc *sc, const struct uaudio_terminal_node *iot, int id) { - const struct usb2_audio_extension_unit_0 *d0 = iot[id].u.eu; - const struct usb2_audio_extension_unit_1 *d1 = + const struct usb_audio_extension_unit_0 *d0 = iot[id].u.eu; + const struct usb_audio_extension_unit_1 *d1 = (const void *)(d0->baSourceId + d0->bNrInPins); struct uaudio_mixer_node mix; @@ -2133,19 +2133,19 @@ uaudio_mixer_add_extension(struct uaudio static const void * uaudio_mixer_verify_desc(const void *arg, uint32_t len) { - const struct usb2_audio_mixer_unit_1 *d1; - const struct usb2_audio_extension_unit_1 *e1; - const struct usb2_audio_processing_unit_1 *u1; + const struct usb_audio_mixer_unit_1 *d1; + const struct usb_audio_extension_unit_1 *e1; + const struct usb_audio_processing_unit_1 *u1; union { const struct usb_descriptor *desc; - const struct usb2_audio_input_terminal *it; - const struct usb2_audio_output_terminal *ot; - const struct usb2_audio_mixer_unit_0 *mu; - const struct usb2_audio_selector_unit *su; - const struct usb2_audio_feature_unit *fu; - const struct usb2_audio_processing_unit_0 *pu; - const struct usb2_audio_extension_unit_0 *eu; + const struct usb_audio_input_terminal *it; + const struct usb_audio_output_terminal *ot; + const struct usb_audio_mixer_unit_0 *mu; + const struct usb_audio_selector_unit *su; + const struct usb_audio_feature_unit *fu; + const struct usb_audio_processing_unit_0 *pu; + const struct usb_audio_extension_unit_0 *eu; } u; u.desc = arg; @@ -2269,7 +2269,7 @@ uaudio_mixer_dump_cluster(uint8_t id, co }; uint16_t cc; uint8_t i; - const struct usb2_audio_cluster cl = uaudio_mixer_get_cluster(id, iot); + const struct usb_audio_cluster cl = uaudio_mixer_get_cluster(id, iot); cc = UGETW(cl.wChannelConfig); @@ -2286,10 +2286,10 @@ uaudio_mixer_dump_cluster(uint8_t id, co #endif -static struct usb2_audio_cluster +static struct usb_audio_cluster uaudio_mixer_get_cluster(uint8_t id, const struct uaudio_terminal_node *iot) { - struct usb2_audio_cluster r; + struct usb_audio_cluster r; const struct usb_descriptor *dp; uint8_t i; @@ -2311,7 +2311,7 @@ uaudio_mixer_get_cluster(uint8_t id, con break; case UDESCSUB_AC_MIXER: - r = *(const struct usb2_audio_cluster *) + r = *(const struct usb_audio_cluster *) &iot[id].u.mu->baSourceId[iot[id].u.mu-> bNrInPins]; goto done; @@ -2328,13 +2328,13 @@ uaudio_mixer_get_cluster(uint8_t id, con break; case UDESCSUB_AC_PROCESSING: - r = *((const struct usb2_audio_cluster *) + r = *((const struct usb_audio_cluster *) &iot[id].u.pu->baSourceId[iot[id].u.pu-> bNrInPins]); goto done; case UDESCSUB_AC_EXTENSION: - r = *((const struct usb2_audio_cluster *) + r = *((const struct usb_audio_cluster *) &iot[id].u.eu->baSourceId[iot[id].u.eu-> bNrInPins]); goto done; @@ -2760,10 +2760,10 @@ static void uaudio_mixer_fill_info(struct uaudio_softc *sc, struct usb_device *udev, void *desc) { - const struct usb2_audio_control_descriptor *acdp; + const struct usb_audio_control_descriptor *acdp; struct usb_config_descriptor *cd = usbd_get_config_descriptor(udev); const struct usb_descriptor *dp; - const struct usb2_audio_unit *au; + const struct usb_audio_unit *au; struct uaudio_terminal_node *iot = NULL; uint16_t wTotalLen; uint8_t ID_max = 0; /* inclusive */ Modified: stable/8/sys/dev/sound/usb/uaudioreg.h ============================================================================== --- stable/8/sys/dev/sound/usb/uaudioreg.h Thu Feb 18 10:55:42 2010 (r204036) +++ stable/8/sys/dev/sound/usb/uaudioreg.h Thu Feb 18 10:59:32 2010 (r204037) @@ -64,9 +64,9 @@ typedef struct { */ uByte bRefresh; uByte bSynchAddress; -} __packed usb2_endpoint_descriptor_audio_t; +} __packed usb_endpoint_descriptor_audio_t; -struct usb2_audio_control_descriptor { +struct usb_audio_control_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -76,7 +76,7 @@ struct usb2_audio_control_descriptor { uByte baInterfaceNr[1]; } __packed; -struct usb2_audio_streaming_interface_descriptor { +struct usb_audio_streaming_interface_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -85,7 +85,7 @@ struct usb2_audio_streaming_interface_de uWord wFormatTag; } __packed; -struct usb2_audio_streaming_endpoint_descriptor { +struct usb_audio_streaming_endpoint_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -97,7 +97,7 @@ struct usb2_audio_streaming_endpoint_des uWord wLockDelay; } __packed; -struct usb2_audio_streaming_type1_descriptor { +struct usb_audio_streaming_type1_descriptor { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -115,7 +115,7 @@ struct usb2_audio_streaming_type1_descri #define UA_SAMP_HI(p) UA_GETSAMP(p, 1) } __packed; -struct usb2_audio_cluster { +struct usb_audio_cluster { uByte bNrChannels; uWord wChannelConfig; #define UA_CHANNEL_LEFT 0x0001 @@ -134,7 +134,7 @@ struct usb2_audio_cluster { } __packed; /* Shared by all units and terminals */ -struct usb2_audio_unit { +struct usb_audio_unit { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -142,7 +142,7 @@ struct usb2_audio_unit { }; /* UDESCSUB_AC_INPUT */ -struct usb2_audio_input_terminal { +struct usb_audio_input_terminal { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -156,7 +156,7 @@ struct usb2_audio_input_terminal { } __packed; /* UDESCSUB_AC_OUTPUT */ -struct usb2_audio_output_terminal { +struct usb_audio_output_terminal { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -168,16 +168,16 @@ struct usb2_audio_output_terminal { } __packed; /* UDESCSUB_AC_MIXER */ -struct usb2_audio_mixer_unit_0 { +struct usb_audio_mixer_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; uByte bUnitId; uByte bNrInPins; uByte baSourceId[0]; /* [bNrInPins] */ - /* struct usb2_audio_mixer_unit_1 */ + /* struct usb_audio_mixer_unit_1 */ } __packed; -struct usb2_audio_mixer_unit_1 { +struct usb_audio_mixer_unit_1 { uByte bNrChannels; uWord wChannelConfig; uByte iChannelNames; @@ -186,7 +186,7 @@ struct usb2_audio_mixer_unit_1 { } __packed; /* UDESCSUB_AC_SELECTOR */ -struct usb2_audio_selector_unit { +struct usb_audio_selector_unit { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -197,7 +197,7 @@ struct usb2_audio_selector_unit { } __packed; /* UDESCSUB_AC_FEATURE */ -struct usb2_audio_feature_unit { +struct usb_audio_feature_unit { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -209,7 +209,7 @@ struct usb2_audio_feature_unit { } __packed; /* UDESCSUB_AC_PROCESSING */ -struct usb2_audio_processing_unit_0 { +struct usb_audio_processing_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -217,9 +217,9 @@ struct usb2_audio_processing_unit_0 { uWord wProcessType; uByte bNrInPins; uByte baSourceId[0]; /* [bNrInPins] */ - /* struct usb2_audio_processing_unit_1 */ + /* struct usb_audio_processing_unit_1 */ } __packed; -struct usb2_audio_processing_unit_1 { +struct usb_audio_processing_unit_1 { uByte bNrChannels; uWord wChannelConfig; uByte iChannelNames; @@ -228,14 +228,14 @@ struct usb2_audio_processing_unit_1 { #define UA_PROC_ENABLE_MASK 1 } __packed; -struct usb2_audio_processing_unit_updown { +struct usb_audio_processing_unit_updown { uByte iProcessing; uByte bNrModes; uWord waModes[0]; /* [bNrModes] */ } __packed; /* UDESCSUB_AC_EXTENSION */ -struct usb2_audio_extension_unit_0 { +struct usb_audio_extension_unit_0 { uByte bLength; uByte bDescriptorType; uByte bDescriptorSubtype; @@ -243,9 +243,9 @@ struct usb2_audio_extension_unit_0 { uWord wExtensionCode; uByte bNrInPins; uByte baSourceId[0]; /* [bNrInPins] */ - /* struct usb2_audio_extension_unit_1 */ + /* struct usb_audio_extension_unit_1 */ } __packed; -struct usb2_audio_extension_unit_1 { +struct usb_audio_extension_unit_1 { uByte bNrChannels; uWord wChannelConfig; uByte iChannelNames; From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 11:03:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13BA81065676; Thu, 18 Feb 2010 11:03:36 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 016CE8FC08; Thu, 18 Feb 2010 11:03: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 o1IB3Zq7044678; Thu, 18 Feb 2010 11:03:35 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IB3ZEG044672; Thu, 18 Feb 2010 11:03:35 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181103.o1IB3ZEG044672@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 11:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204038 - stable/8/sys/conf X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 11:03:36 -0000 Author: brucec Date: Thu Feb 18 11:03:35 2010 New Revision: 204038 URL: http://svn.freebsd.org/changeset/base/204038 Log: MFC r203679: Remove the usb2_input_kbd directive that was missed during the renaming of the drivers in the usb2 stack. Approved by: rrs (mentor) Modified: stable/8/sys/conf/files.amd64 stable/8/sys/conf/files.i386 stable/8/sys/conf/files.ia64 stable/8/sys/conf/files.pc98 stable/8/sys/conf/files.sparc64 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/conf/files.amd64 ============================================================================== --- stable/8/sys/conf/files.amd64 Thu Feb 18 10:59:32 2010 (r204037) +++ stable/8/sys/conf/files.amd64 Thu Feb 18 11:03:35 2010 (r204038) @@ -205,7 +205,7 @@ dev/hwpmc/hwpmc_core.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/mem/memutil.c optional mem Modified: stable/8/sys/conf/files.i386 ============================================================================== --- stable/8/sys/conf/files.i386 Thu Feb 18 10:59:32 2010 (r204037) +++ stable/8/sys/conf/files.i386 Thu Feb 18 11:03:35 2010 (r204038) @@ -197,7 +197,7 @@ dev/ipmi/ipmi_smbios.c optional ipmi dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/le/if_le_isa.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev Modified: stable/8/sys/conf/files.ia64 ============================================================================== --- stable/8/sys/conf/files.ia64 Thu Feb 18 10:59:32 2010 (r204037) +++ stable/8/sys/conf/files.ia64 Thu Feb 18 11:03:35 2010 (r204038) @@ -57,7 +57,7 @@ dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc Modified: stable/8/sys/conf/files.pc98 ============================================================================== --- stable/8/sys/conf/files.pc98 Thu Feb 18 10:59:32 2010 (r204037) +++ stable/8/sys/conf/files.pc98 Thu Feb 18 11:03:35 2010 (r204038) @@ -105,7 +105,7 @@ dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional pckbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional pckbd | sc | ukbd dev/le/if_le_cbus.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Thu Feb 18 10:59:32 2010 (r204037) +++ stable/8/sys/conf/files.sparc64 Thu Feb 18 11:03:35 2010 (r204038) @@ -38,7 +38,7 @@ dev/fb/fb.c optional sc dev/fb/gallant12x22.c optional sc dev/fb/machfb.c optional machfb sc dev/hwpmc/hwpmc_sparc64.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd | usb2_input_kbd +dev/kbd/kbd.c optional atkbd | sc | ukbd dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus dev/le/lebuffer_sbus.c optional le sbus From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 11:07:36 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB2CE1065672; Thu, 18 Feb 2010 11:07:36 +0000 (UTC) (envelope-from brucec@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FF168FC18; Thu, 18 Feb 2010 11:07: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 o1IB7anr045576; Thu, 18 Feb 2010 11:07:36 GMT (envelope-from brucec@svn.freebsd.org) Received: (from brucec@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IB7aG8045573; Thu, 18 Feb 2010 11:07:36 GMT (envelope-from brucec@svn.freebsd.org) Message-Id: <201002181107.o1IB7aG8045573@svn.freebsd.org> From: Bruce Cran Date: Thu, 18 Feb 2010 11:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204039 - in stable/8/sys: conf dev/aic7xxx X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 11:07:36 -0000 Author: brucec Date: Thu Feb 18 11:07:36 2010 New Revision: 204039 URL: http://svn.freebsd.org/changeset/base/204039 Log: MFC r203685: Document the usfs driver and the NO_SYSCTL_DESCR option, and update the comment for umass. Don't include the sysctl description variables in aic7xxx when NO_SYSCTL_DESCR is used. Approved by: rrs (mentor) Modified: stable/8/sys/conf/NOTES stable/8/sys/dev/aic7xxx/aic79xx_osm.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/conf/NOTES ============================================================================== --- stable/8/sys/conf/NOTES Thu Feb 18 11:03:35 2010 (r204038) +++ stable/8/sys/conf/NOTES Thu Feb 18 11:07:36 2010 (r204039) @@ -377,6 +377,11 @@ options KDTRACE_HOOKS options SYSCTL_DEBUG # +# NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the +# resulting kernel. +options NO_SYSCTL_DESCR + +# # DEBUG_MEMGUARD builds and enables memguard(9), a replacement allocator # for the kernel used to detect modify-after-free scenarios. See the # memguard(9) man page for more information on usage. @@ -2529,8 +2534,10 @@ device uhid device ukbd # USB printer device ulpt -# USB Iomega Zip 100 Drive (Requires scbus and da) +# USB mass storage driver (Requires scbus and da) device umass +# USB mass storage driver for device-side mode +device usfs # USB support for Belkin F5U109 and Magic Control Technology serial adapters device umct # USB modem support Modified: stable/8/sys/dev/aic7xxx/aic79xx_osm.c ============================================================================== --- stable/8/sys/dev/aic7xxx/aic79xx_osm.c Thu Feb 18 11:03:35 2010 (r204038) +++ stable/8/sys/dev/aic7xxx/aic79xx_osm.c Thu Feb 18 11:07:36 2010 (r204039) @@ -83,11 +83,13 @@ static const char *ahd_sysctl_node_eleme "debug" }; +#ifndef NO_SYSCTL_DESCR static const char *ahd_sysctl_node_descriptions[] = { "root error collection for aic79xx controllers", "summary collection for aic79xx controllers", "debug collection for aic79xx controllers" }; +#endif static const char *ahd_sysctl_errors_elements[] = { "Cerrors", @@ -95,11 +97,13 @@ static const char *ahd_sysctl_errors_ele "Ferrors" }; +#ifndef NO_SYSCTL_DESCR static const char *ahd_sysctl_errors_descriptions[] = { "Correctable errors", "Uncorrectable errors", "Fatal errors" }; +#endif static int ahd_set_debugcounters(SYSCTL_HANDLER_ARGS) From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 14:27:41 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A64B41065672; Thu, 18 Feb 2010 14:27:41 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 340548FC14; Thu, 18 Feb 2010 14:27:41 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 230C27E878; Fri, 19 Feb 2010 01:07:17 +1100 (EST) Message-ID: <4B7D4962.8070706@freebsd.org> Date: Fri, 19 Feb 2010 01:06:26 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.5) Gecko/20100105 Thunderbird/3.0 MIME-Version: 1.0 To: Alexander Motin References: <201002141938.o1EJcRpx065470@svn.freebsd.org> In-Reply-To: <201002141938.o1EJcRpx065470@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 14:27:41 -0000 Hi Alexander and all, On 02/15/10 06:38, Alexander Motin wrote: > Author: mav > Date: Sun Feb 14 19:38:27 2010 > New Revision: 203889 > URL: http://svn.freebsd.org/changeset/base/203889 > > Log: > MFC r203108: > Large set of CAM improvements: [snip] I've been having issues with the mpt-driven LSI SAS adapter in my SunFire X4100 server running FreeBSD 8-STABLE r202132. Under certain disk workloads like running an svn update of the src tree or kernel compile, the disk subsystem will become extremely unresponsive in a stalled like state, and /var/log/messages will report a number of these: mpt0: mpt_cam_event: 0x16 It does eventually come good after a minute or two even though the svn op or build is still running, then it will maybe repeat a few times stalled/good behaviour sometimes with minutes between events. A couple of times it has gotten even more upset reporting things like this: mpt0: mpt_cam_event: 0x16 mpt0: mpt_cam_event: 0x16 mpt0: request 0xffffff80002f1400:54058 timed out for ccb 0xffffff0001c65000 (req->ccb 0xffffff0001c65000) mpt0: attempting to abort req 0xffffff80002f1400:54058 function 0 mpt0: request 0xffffff80002fd100:54059 timed out for ccb 0xffffff009f3ec800 (req->ccb 0xffffff009f3ec800) mpt0: request 0xffffff80002efcf0:54060 timed out for ccb 0xffffff0001bd2000 (req->ccb 0xffffff0001bd2000) mpt0: mpt_recover_commands: IOC Status 0x4a. Resetting controller. mpt0: mpt_cam_event: 0x0 mpt0: mpt_cam_event: 0x0 mpt0: completing timedout/aborted req 0xffffff80002f1400:54058 mpt0: completing timedout/aborted req 0xffffff80002fd100:54059 mpt0: completing timedout/aborted req 0xffffff80002efcf0:54060 mpt0: mpt_cam_event: 0x16 mpt0: mpt_cam_event: 0x12 mpt0: mpt_cam_event: 0x12 mpt0: mpt_cam_event: 0x16 mpt0: Volume(0:2): Volume Status Changed mpt0: request 0xffffff80002f8990:0 timed out for ccb 0xffffff009f3cb800 (req->ccb 0) No ill effects are observed after such an episode and the array remains in healthy as-normal state. The only observable problem is the stall of all disk IO while these events occur. The disk configuration is 2 x 320GB WD3200BEKT 7200RPM SATA HDDs in RAID1. The hardware reports itself as: mpt0: port 0xa800-0xa8ff mem 0xfc4fc000-0xfc4fffff,0xfc4e0000-0xfc4effff irq 28 at device 3.0 on pci2 mpt0: [ITHREAD] mpt0: MPI Version=1.5.13.0 mpt0: Capabilities: ( RAID-0 RAID-1E RAID-1 ) mpt0: 1 Active Volume (2 Max) mpt0: 2 Hidden Drive Members (10 Max) mpt0@pci0:2:3:0: class=0x010000 card=0x30601000 chip=0x00501000 rev=0x02 hdr=0x00 vendor = 'LSI Logic (Was: Symbios Logic, NCR)' device = 'SAS 3000 series, 4-port with 1064 -StorPort' class = mass storage subclass = SCSI As best I can tell, the hardware is ok, both disks report as fine without SMART errors and are only 2 months old, so wanted to rule out software issues. On upgrading to recent 8-STABLE, I got a page fault kernel panic on boot in the mpt driver mpt_raid0 kproc. After some trial and error, r203888 is the most recent revision that boots fine, whilst r203889 exhibits the page fault. I should also note that r203888 still sees the "mpt0: mpt_cam_event: 0x16" messages and associated disk IO stalls. I compiled DDB into my r203889 kernel. Unfortunately my ILO emulates a USB keyboard so I can't do anything in DDB which is a huge pain, but here's the info I did get (hand transcribed): Fatal trap 12: page fault while in kernel mode current process: mpt_raid0 Stopped at xpt_rescan+0x1d: movq 0x10(%rsi),%rdx So there are two separate issues here: 1. Any thoughts on how to resolve the regression in the mpt driver with the r203889 commit? 2. Any thoughts on the behaviour I'm seeing with the mpt_cam_event messages? Is it possible it's just a driver issue? Is the hardware likely bad? I'm really hoping they'll go away once the driver issue is resolved as the freezes are fairly unacceptable on a production machine and the hardware appears to pass all checks I've done so far. Cheers, Lawrence From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 16:05:27 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 501CE10656AA; Thu, 18 Feb 2010 16:05:27 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id 27CBA8FC14; Thu, 18 Feb 2010 16:05:26 +0000 (UTC) Received: from [192.168.0.101] (m206-63.dsl.tsoft.com [198.144.206.63]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o1IFr7OB079807; Thu, 18 Feb 2010 07:53:07 -0800 (PST) (envelope-from mj@feral.com) Message-ID: <4B7D626A.9040301@feral.com> Date: Thu, 18 Feb 2010 07:53:14 -0800 From: Matthew Jacob User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 MIME-Version: 1.0 To: Lawrence Stewart References: <201002141938.o1EJcRpx065470@svn.freebsd.org> <4B7D4962.8070706@freebsd.org> In-Reply-To: <4B7D4962.8070706@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-4.2.3 (ns1.feral.com [192.67.166.1]); Thu, 18 Feb 2010 07:53:07 -0800 (PST) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 16:05:27 -0000 Just a total swag here, but reduce the openings via camcontrol to < 32, or even < 16 > > 1. Any thoughts on how to resolve the regression in the mpt driver > with the r203889 commit? > > 2. Any thoughts on the behaviour I'm seeing with the mpt_cam_event > messages? Is it possible it's just a driver issue? Is the hardware > likely bad? I'm really hoping they'll go away once the driver issue is > resolved as the freezes are fairly unacceptable on a production > machine and the hardware appears to pass all checks I've done so far. > > Cheers, > Lawrence From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 16:23:14 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59B691065694; Thu, 18 Feb 2010 16:23:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48DBE8FC15; Thu, 18 Feb 2010 16:23:14 +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 o1IGNElF015784; Thu, 18 Feb 2010 16:23:14 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IGNEqB015782; Thu, 18 Feb 2010 16:23:14 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002181623.o1IGNEqB015782@svn.freebsd.org> From: Rick Macklem Date: Thu, 18 Feb 2010 16:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204046 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 16:23:14 -0000 Author: rmacklem Date: Thu Feb 18 16:23:13 2010 New Revision: 204046 URL: http://svn.freebsd.org/changeset/base/204046 Log: MFC: r203848 This fixes the experimental NFS server so that it won't crash in the caching code for IPv6 by fixing a typo that used the incorrect variable. It also fixes the indentation of the statement above it. Reported by: simon AT comsys.ntu-kpi.kiev.ua Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Thu Feb 18 16:05:09 2010 (r204045) +++ stable/8/sys/fs/nfsserver/nfs_nfsdcache.c Thu Feb 18 16:23:13 2010 (r204046) @@ -386,9 +386,9 @@ loop: newrp->rc_inet = saddr->sin_addr.s_addr; else if (saddr->sin_family == AF_INET6) { saddr6 = (struct sockaddr_in6 *)saddr; - NFSBCOPY((caddr_t)&saddr6->sin6_addr,(caddr_t)&newrp->rc_inet6, - sizeof (struct in6_addr)); - rp->rc_flag |= RC_INETIPV6; + NFSBCOPY((caddr_t)&saddr6->sin6_addr, (caddr_t)&newrp->rc_inet6, + sizeof (struct in6_addr)); + newrp->rc_flag |= RC_INETIPV6; } LIST_INSERT_HEAD(hp, newrp, rc_hash); TAILQ_INSERT_TAIL(&nfsrvudplru, newrp, rc_lru); From owner-svn-src-stable-8@FreeBSD.ORG Thu Feb 18 16:52:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17AA2106566C; Thu, 18 Feb 2010 16:52:50 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E1C388FC13; Thu, 18 Feb 2010 16:52: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 o1IGqnMa022410; Thu, 18 Feb 2010 16:52:49 GMT (envelope-from ru@svn.freebsd.org) Received: (from ru@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1IGqnqR022408; Thu, 18 Feb 2010 16:52:49 GMT (envelope-from ru@svn.freebsd.org) Message-Id: <201002181652.o1IGqnqR022408@svn.freebsd.org> From: Ruslan Ermilov Date: Thu, 18 Feb 2010 16:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204048 - in stable/8/lib: libc_r libkse X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2010 16:52:50 -0000 Author: ru Date: Thu Feb 18 16:52:49 2010 New Revision: 204048 URL: http://svn.freebsd.org/changeset/base/204048 Log: MFC: r203918: Unbreak makefiles by removing mentions of DEFAULT_THREAD_LIB. Modified: stable/8/lib/libc_r/Makefile stable/8/lib/libkse/Makefile Directory Properties: stable/8/lib/libc_r/ (props changed) stable/8/lib/libkse/ (props changed) Modified: stable/8/lib/libc_r/Makefile ============================================================================== --- stable/8/lib/libc_r/Makefile Thu Feb 18 16:25:38 2010 (r204047) +++ stable/8/lib/libc_r/Makefile Thu Feb 18 16:52:49 2010 (r204048) @@ -10,10 +10,6 @@ .include -.if ${DEFAULT_THREAD_LIB} == "libc_r" && ${SHLIBDIR} == "/usr/lib" -SHLIBDIR= /lib -.endif - LIB=c_r SHLIB_MAJOR= 7 CFLAGS+=-DPTHREAD_KERNEL @@ -32,16 +28,4 @@ PRECIOUSLIB= .include "${.CURDIR}/uthread/Makefile.inc" .include "${.CURDIR}/sys/Makefile.inc" -.if ${DEFAULT_THREAD_LIB} == "libc_r" -.if ${MK_INSTALLLIB} != "no" -SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a -.endif -.if !defined(NO_PIC) -SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so -.endif -.if ${MK_PROFILE} != "no" -SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a -.endif -.endif - .include Modified: stable/8/lib/libkse/Makefile ============================================================================== --- stable/8/lib/libkse/Makefile Thu Feb 18 16:25:38 2010 (r204047) +++ stable/8/lib/libkse/Makefile Thu Feb 18 16:52:49 2010 (r204048) @@ -10,15 +10,7 @@ .include -.if ${DEFAULT_THREAD_LIB} == "libkse" || ${MK_LIBTHR} == "no" -LIB=kse -.if ${SHLIBDIR} == "/usr/lib" -SHLIBDIR= /lib -.endif -.else SHLIB=kse -.endif - SHLIB_MAJOR= 4 CFLAGS+=-DPTHREAD_KERNEL CFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \ @@ -51,16 +43,4 @@ PRECIOUSLIB= .include "${.CURDIR}/sys/Makefile.inc" .include "${.CURDIR}/thread/Makefile.inc" -.if ${DEFAULT_THREAD_LIB} == "libkse" || ${MK_LIBTHR} == "no" -.if ${MK_INSTALLLIB} != "no" -SYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a -.endif -.if !defined(NO_PIC) -SYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so -.endif -.if ${MK_PROFILE} != "no" -SYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a -.endif -.endif - .include From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 06:11:41 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95915106566B; Fri, 19 Feb 2010 06:11:41 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 4EEE38FC17; Fri, 19 Feb 2010 06:11:40 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id DF7F07E87D; Fri, 19 Feb 2010 17:11:35 +1100 (EST) Message-ID: <4B7E2B94.3090605@freebsd.org> Date: Fri, 19 Feb 2010 17:11:32 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.5) Gecko/20100105 Thunderbird/3.0 MIME-Version: 1.0 To: Matthew Jacob References: <201002141938.o1EJcRpx065470@svn.freebsd.org> <4B7D4962.8070706@freebsd.org> <4B7D626A.9040301@feral.com> In-Reply-To: <4B7D626A.9040301@feral.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 06:11:41 -0000 Hi Matt, On 02/19/10 02:53, Matthew Jacob wrote: > Just a total swag here, but reduce the openings via camcontrol to < 32, > or even < 16 Thanks for the suggestion. camcontrol doesn't seem able to futz with the mpt controller e.g.: root@server# camcontrol identify da0 -v (pass0:mpt0:0:2:0): ATAPI_IDENTIFY. ACB: a1 00 00 00 00 40 00 00 00 00 00 00 (pass0:mpt0:0:2:0): CAM status: CCB request was invalid However, there does appear to be a relevant sysctl: root@server# sysctl dev.mpt.0 dev.mpt.0.%desc: LSILogic SAS/SATA Adapter dev.mpt.0.%driver: mpt dev.mpt.0.%location: slot=3 function=0 dev.mpt.0.%pnpinfo: vendor=0x1000 device=0x0050 subvendor=0x1000 subdevice=0x3060 class=0x010000 dev.mpt.0.%parent: pci2 dev.mpt.0.debug: 3 dev.mpt.0.role: 1 dev.mpt.0.vol_member_wce: NC dev.mpt.0.vol_queue_depth: 128 dev.mpt.0.vol_resync_rate: 0 dev.mpt.0.nonoptimal_volumes: 0 Setting dev.mpt.0.vol_queue_depth=32, I can still trigger the "mpt0: mpt_cam_event: 0x16" messages by doing an svn up on the src tree. Same if I set depth to 16, so unfortunately it doesn't seem to do help in this case. Cheers, Lawrence From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 08:50:42 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7381C106566B; Fri, 19 Feb 2010 08:50:42 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-yw0-f204.google.com (mail-yw0-f204.google.com [209.85.211.204]) by mx1.freebsd.org (Postfix) with ESMTP id DAC158FC0C; Fri, 19 Feb 2010 08:50:41 +0000 (UTC) Received: by ywh42 with SMTP id 42so1793488ywh.7 for ; Fri, 19 Feb 2010 00:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=ByywCu2yMGi4wzWsjPtnPjKOX/rhdJRkSDimtVloQWM=; b=QdkfSLW7Kj002WE147aniYtiBeETLRwm4vXg1Sv5uSid8zE6HelcIsGqiETGjDqAet QfG2Drfs8sCYudeJkkLPLMzXqrO1feco2dhmOGpxl7LJJkpYgWAQefeiUyYgIVb5etzH tB4owXIWIZcX9vbF5C/hvlUeQ8A1dzjYfNjXU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=L/jrwd9GXiIakkgMCtXUGqVUB9MwOB4egF02r/jPTupjtF3C9Jmwgilqs9LOaPCk+S 8vZ5U374F98inIds9LAlEOjFjtY/sfqPx9Xwr7HdvKwmqMwwcTMCfH0VHpc1HMze92N4 uKH9VbmJAQB+7HCsAU5ZbSbRkBZpMd376n+os= Received: by 10.103.87.34 with SMTP id p34mr7793573mul.18.1266569440397; Fri, 19 Feb 2010 00:50:40 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n10sm8652890mue.14.2010.02.19.00.50.37 (version=SSLv3 cipher=RC4-MD5); Fri, 19 Feb 2010 00:50:38 -0800 (PST) Sender: Alexander Motin Message-ID: <4B7E50DC.3070103@FreeBSD.org> Date: Fri, 19 Feb 2010 10:50:36 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Lawrence Stewart References: <201002141938.o1EJcRpx065470@svn.freebsd.org> <4B7D4962.8070706@freebsd.org> <4B7D626A.9040301@feral.com> <4B7E2B94.3090605@freebsd.org> In-Reply-To: <4B7E2B94.3090605@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Matthew Jacob , svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 08:50:42 -0000 Lawrence Stewart wrote: > On 02/19/10 02:53, Matthew Jacob wrote: >> Just a total swag here, but reduce the openings via camcontrol to < 32, >> or even < 16 > > Thanks for the suggestion. camcontrol doesn't seem able to futz with the > mpt controller e.g.: > > root@server# camcontrol identify da0 -v > (pass0:mpt0:0:2:0): ATAPI_IDENTIFY. ACB: a1 00 00 00 00 40 00 00 00 00 > 00 00 > (pass0:mpt0:0:2:0): CAM status: CCB request was invalid IDENTIFY is an ATA command. It is not working there now, as mpt on some level translates ATA into SCSI. `camcontrol inquiry da0` and the others probably should work. > However, there does appear to be a relevant sysctl: > > root@server# sysctl dev.mpt.0 > dev.mpt.0.%desc: LSILogic SAS/SATA Adapter > dev.mpt.0.%driver: mpt > dev.mpt.0.%location: slot=3 function=0 > dev.mpt.0.%pnpinfo: vendor=0x1000 device=0x0050 subvendor=0x1000 > subdevice=0x3060 class=0x010000 > dev.mpt.0.%parent: pci2 > dev.mpt.0.debug: 3 > dev.mpt.0.role: 1 > dev.mpt.0.vol_member_wce: NC > dev.mpt.0.vol_queue_depth: 128 > dev.mpt.0.vol_resync_rate: 0 > dev.mpt.0.nonoptimal_volumes: 0 > > Setting dev.mpt.0.vol_queue_depth=32, I can still trigger the > "mpt0: mpt_cam_event: 0x16" messages by doing an svn up on the src tree. > Same if I set depth to 16, so unfortunately it doesn't seem to do help > in this case. I am not sure what this sysctl does, but it is mpt driver own sysctl. It has nothing common with number of tags used by CAM (at least directly). -- Alexander Motin From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 13:56:21 2010 Return-Path: Delivered-To: svn-src-stable-8@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DC711065670; Fri, 19 Feb 2010 13:56:21 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6398FC14; Fri, 19 Feb 2010 13:56:21 +0000 (UTC) Received: from lawrence1.loshell.room52.net (unknown [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id 6AED77E87D; Sat, 20 Feb 2010 00:56:19 +1100 (EST) Message-ID: <4B7E9882.3000703@freebsd.org> Date: Sat, 20 Feb 2010 00:56:18 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-AU; rv:1.9.1.5) Gecko/20100105 Thunderbird/3.0 MIME-Version: 1.0 To: Alexander Motin References: <201002141938.o1EJcRpx065470@svn.freebsd.org> <4B7D4962.8070706@freebsd.org> <4B7D626A.9040301@feral.com> <4B7E2B94.3090605@freebsd.org> <4B7E50DC.3070103@FreeBSD.org> In-Reply-To: <4B7E50DC.3070103@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Matthew Jacob , svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 13:56:21 -0000 On 02/19/10 19:50, Alexander Motin wrote: > Lawrence Stewart wrote: >> On 02/19/10 02:53, Matthew Jacob wrote: >>> Just a total swag here, but reduce the openings via camcontrol to< 32, >>> or even< 16 >> >> Thanks for the suggestion. camcontrol doesn't seem able to futz with the >> mpt controller e.g.: >> >> root@server# camcontrol identify da0 -v >> (pass0:mpt0:0:2:0): ATAPI_IDENTIFY. ACB: a1 00 00 00 00 40 00 00 00 00 >> 00 00 >> (pass0:mpt0:0:2:0): CAM status: CCB request was invalid > > IDENTIFY is an ATA command. It is not working there now, as mpt on some > level translates ATA into SCSI. `camcontrol inquiry da0` and the others > probably should work. root@server# camcontrol inquiry da0 pass0: Fixed Direct Access SCSI-2 device pass0: 300.000MB/s transfers, Command Queueing Enabled > >> However, there does appear to be a relevant sysctl: >> >> root@server# sysctl dev.mpt.0 >> dev.mpt.0.%desc: LSILogic SAS/SATA Adapter >> dev.mpt.0.%driver: mpt >> dev.mpt.0.%location: slot=3 function=0 >> dev.mpt.0.%pnpinfo: vendor=0x1000 device=0x0050 subvendor=0x1000 >> subdevice=0x3060 class=0x010000 >> dev.mpt.0.%parent: pci2 >> dev.mpt.0.debug: 3 >> dev.mpt.0.role: 1 >> dev.mpt.0.vol_member_wce: NC >> dev.mpt.0.vol_queue_depth: 128 >> dev.mpt.0.vol_resync_rate: 0 >> dev.mpt.0.nonoptimal_volumes: 0 >> >> Setting dev.mpt.0.vol_queue_depth=32, I can still trigger the >> "mpt0: mpt_cam_event: 0x16" messages by doing an svn up on the src tree. >> Same if I set depth to 16, so unfortunately it doesn't seem to do help >> in this case. > > I am not sure what this sysctl does, but it is mpt driver own sysctl. It > has nothing common with number of tags used by CAM (at least directly). Ah ok, I misunderstood what openings meant in this context... I thought it was the queue depth. So if I restore dev.mpt.0.vol_queue_depth=128 and do the following: root@server# camcontrol tags da0 (pass0:mpt0:0:2:0): device openings: 255 root@server# camcontrol tags da0 -N 64 (pass0:mpt0:0:2:0): tagged openings now 64 (pass0:mpt0:0:2:0): device openings: 64 I can still trigger the "mpt0: mpt_cam_event: 0x16" messages. Same with openings set to 32. If I lower the openings down to 16, I still get fairly large stalls in disk IO, but the mpt_cam_event messages no longer appear. Hmmmm... Cheers, Lawrence From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 16:36:09 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C83E10656B7; Fri, 19 Feb 2010 16:36:09 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA558FC5E; Fri, 19 Feb 2010 16:36: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 o1JGa9vY038998; Fri, 19 Feb 2010 16:36:09 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JGa9hO038996; Fri, 19 Feb 2010 16:36:09 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201002191636.o1JGa9hO038996@svn.freebsd.org> From: Rick Macklem Date: Fri, 19 Feb 2010 16:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204091 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 16:36:09 -0000 Author: rmacklem Date: Fri Feb 19 16:36:08 2010 New Revision: 204091 URL: http://svn.freebsd.org/changeset/base/204091 Log: MFC: r203849 Change the default value for vfs.newnfs.enable_locallocks to 0 for the experimental NFS server, since local locking is known to be broken and the patch to fix it is still a work in progress. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Feb 19 15:16:00 2010 (r204090) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Fri Feb 19 16:36:08 2010 (r204091) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); struct nfsrv_stablefirst nfsrv_stablefirst; int nfsrv_issuedelegs = 0; -int nfsrv_dolocallocks = 1; +int nfsrv_dolocallocks = 0; struct nfsv4lock nfsv4rootfs_lock; extern int newnfs_numnfsd; From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 17:16:24 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D59C1065679; Fri, 19 Feb 2010 17:16:24 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 74D6D8FC0C; Fri, 19 Feb 2010 17:16:23 +0000 (UTC) Received: by bwz8 with SMTP id 8so268318bwz.3 for ; Fri, 19 Feb 2010 09:16:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=ea9HO/1vXWD2SYmglKJ6ozzZhS3pvikX3bOMpG3WFJg=; b=c5WmUj92dgS0KgQuOOjf32XPQYpyJiVwWvEMz9LLVqUFlv15Gbyr2z42dZpjdcVc30 TNRgwOWDfq6EWx/sqvJ9L4cAU5gXsOcY+aXz7RZWeAHsE0sqqZev8KS0G+AuraJMWSMq gfXXiNWr1AzrzJuxX1QCHEWYUFe2/mkjmntnM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=WsPFk5747X6u+nuU4vMffWFGM9KvhuwwhzYu1+cY5JdS2tW88WGQ6o9g12NndUvgCr 1FN593sLoQdLEUN/jTPWK4HVksVKdjFXAs6A4pkkGxBwIL8+nEOUDiHMQmmB0S1yn/cs YYjrcrpoSqiurl1FeDMYpBwjSoMcgZP0Z1pXk= Received: by 10.103.48.13 with SMTP id a13mr8266777muk.14.1266599782198; Fri, 19 Feb 2010 09:16:22 -0800 (PST) Received: from mavbook.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id j10sm1821397muh.26.2010.02.19.09.16.20 (version=SSLv3 cipher=RC4-MD5); Fri, 19 Feb 2010 09:16:21 -0800 (PST) Sender: Alexander Motin Message-ID: <4B7EC763.4090507@FreeBSD.org> Date: Fri, 19 Feb 2010 19:16:19 +0200 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: Lawrence Stewart References: <201002141938.o1EJcRpx065470@svn.freebsd.org> <4B7D4962.8070706@freebsd.org> In-Reply-To: <4B7D4962.8070706@freebsd.org> X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r203889 - in stable/8/sys: cam cam/ata cam/scsi dev/ahci dev/asr dev/ata dev/ciss dev/hptiop dev/hptrr dev/mly dev/mpt dev/ppbus dev/siis dev/trm dev/twa dev/usb/storage X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 17:16:24 -0000 Lawrence Stewart wrote: > A couple of times it has gotten even more upset reporting things like this: > > mpt0: mpt_cam_event: 0x16 > mpt0: mpt_cam_event: 0x16 > mpt0: request 0xffffff80002f1400:54058 timed out for ccb > 0xffffff0001c65000 (req->ccb 0xffffff0001c65000) > mpt0: attempting to abort req 0xffffff80002f1400:54058 function 0 > mpt0: request 0xffffff80002fd100:54059 timed out for ccb > 0xffffff009f3ec800 (req->ccb 0xffffff009f3ec800) > mpt0: request 0xffffff80002efcf0:54060 timed out for ccb > 0xffffff0001bd2000 (req->ccb 0xffffff0001bd2000) > mpt0: mpt_recover_commands: IOC Status 0x4a. Resetting controller. > mpt0: mpt_cam_event: 0x0 > mpt0: mpt_cam_event: 0x0 > mpt0: completing timedout/aborted req 0xffffff80002f1400:54058 > mpt0: completing timedout/aborted req 0xffffff80002fd100:54059 > mpt0: completing timedout/aborted req 0xffffff80002efcf0:54060 > mpt0: mpt_cam_event: 0x16 > mpt0: mpt_cam_event: 0x12 > mpt0: mpt_cam_event: 0x12 > mpt0: mpt_cam_event: 0x16 > mpt0: Volume(0:2): Volume Status Changed > mpt0: request 0xffffff80002f8990:0 timed out for ccb 0xffffff009f3cb800 > (req->ccb 0) > > No ill effects are observed after such an episode and the array remains > in healthy as-normal state. The only observable problem is the stall of > all disk IO while these events occur. I have no idea how mpt driver works, neither I have hardware to play, but quick look shows that 0x12 event is MPI_EVENT_SAS_PHY_LINK_STATUS, and 0x16 is MPI_EVENT_SAS_DISCOVERY. Both are not handled by mpt driver and so logged. I would say something is going on at physical level of your SAN. Timeouts are also could be the result of physical issues. > As best I can tell, the hardware is ok, both disks report as fine > without SMART errors and are only 2 months old, so wanted to rule out > software issues. On upgrading to recent 8-STABLE, I got a page fault > kernel panic on boot in the mpt driver mpt_raid0 kproc. After some trial > and error, r203888 is the most recent revision that boots fine, whilst > r203889 exhibits the page fault. I should also note that r203888 still > sees the "mpt0: mpt_cam_event: 0x16" messages and associated disk IO > stalls. > > I compiled DDB into my r203889 kernel. Unfortunately my ILO emulates a > USB keyboard so I can't do anything in DDB which is a huge pain, but > here's the info I did get (hand transcribed): > > Fatal trap 12: page fault while in kernel mode > current process: mpt_raid0 > Stopped at xpt_rescan+0x1d: movq 0x10(%rsi),%rdx > > 1. Any thoughts on how to resolve the regression in the mpt driver with > the r203889 commit? Any thoughts where to find a good telepath? :) For the beginning, show at least verbose boot messages up to the crash. Full panic message could also be useful, it may show address of the fault instruction, which may be resolved to source line with addr2line tool. If you could find a good old PS/2 keyboard, backtrace would be interesting to see. -- Alexander Motin From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 17:45:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6E69106566B; Fri, 19 Feb 2010 17:45:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B49718FC1B; Fri, 19 Feb 2010 17:45: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 o1JHjlsI054491; Fri, 19 Feb 2010 17:45:47 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JHjlCp054489; Fri, 19 Feb 2010 17:45:47 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002191745.o1JHjlCp054489@svn.freebsd.org> From: Alexander Motin Date: Fri, 19 Feb 2010 17:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204094 - stable/8/sys/cam/scsi X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 17:45:47 -0000 Author: mav Date: Fri Feb 19 17:45:47 2010 New Revision: 204094 URL: http://svn.freebsd.org/changeset/base/204094 Log: MFC r203931: Make CD driver a bit more robust and predictable to unreported errors. Modified: stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Fri Feb 19 17:37:46 2010 (r204093) +++ stable/8/sys/cam/scsi/scsi_cd.c Fri Feb 19 17:45:47 2010 (r204094) @@ -638,15 +638,14 @@ cdregister(struct cam_periph *periph, vo return(CAM_REQ_CMP_ERR); } - softc = (struct cd_softc *)malloc(sizeof(*softc),M_DEVBUF,M_NOWAIT); - + softc = (struct cd_softc *)malloc(sizeof(*softc),M_DEVBUF, + M_NOWAIT | M_ZERO); if (softc == NULL) { printf("cdregister: Unable to probe new device. " "Unable to allocate softc\n"); return(CAM_REQ_CMP_ERR); } - bzero(softc, sizeof(*softc)); LIST_INIT(&softc->pending_ccbs); STAILQ_INIT(&softc->mode_queue); softc->state = CD_STATE_PROBE; @@ -861,8 +860,7 @@ cdregister(struct cam_periph *periph, vo */ else { nchanger = malloc(sizeof(struct cdchanger), - M_DEVBUF, M_NOWAIT); - + M_DEVBUF, M_NOWAIT | M_ZERO); if (nchanger == NULL) { softc->flags &= ~CD_FLAG_CHANGER; printf("cdregister: unable to malloc " @@ -875,10 +873,6 @@ cdregister(struct cam_periph *periph, vo */ goto cdregisterexit; } - - /* zero the structure */ - bzero(nchanger, sizeof(struct cdchanger)); - if (camq_init(&nchanger->devq, 1) != 0) { softc->flags &= ~CD_FLAG_CHANGER; printf("cdregister: changer support " @@ -1506,8 +1500,7 @@ cdstart(struct cam_periph *periph, union { rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcap), - M_SCSICD, - M_NOWAIT); + M_SCSICD, M_NOWAIT | M_ZERO); if (rcap == NULL) { xpt_print(periph->path, "cdstart: Couldn't malloc read_capacity data\n"); @@ -2073,7 +2066,7 @@ cdioctl(struct disk *dp, u_long cmd, voi u_int32_t len = args->data_len; data = malloc(sizeof(struct cd_sub_channel_info), - M_SCSICD, M_WAITOK); + M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2125,7 +2118,7 @@ cdioctl(struct disk *dp, u_long cmd, voi struct ioc_toc_header *th; th = malloc(sizeof(struct ioc_toc_header), M_SCSICD, - M_WAITOK); + M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2162,8 +2155,8 @@ cdioctl(struct disk *dp, u_long cmd, voi u_int32_t len, readlen, idx, num; u_int32_t starting_track = te->starting_track; - data = malloc(sizeof(*data), M_SCSICD, M_WAITOK); - lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK); + data = malloc(sizeof(*data), M_SCSICD, M_WAITOK | M_ZERO); + lead = malloc(sizeof(*lead), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2291,7 +2284,7 @@ cdioctl(struct disk *dp, u_long cmd, voi struct ioc_toc_header *th; u_int32_t track; - data = malloc(sizeof(*data), M_SCSICD, M_WAITOK); + data = malloc(sizeof(*data), M_SCSICD, M_WAITOK | M_ZERO); cam_periph_lock(periph); CAM_DEBUG(periph->path, CAM_DEBUG_SUBTRACE, @@ -2910,7 +2903,7 @@ cdsize(struct cam_periph *periph, u_int3 /* XXX Should be M_WAITOK */ rcap_buf = malloc(sizeof(struct scsi_read_capacity_data), - M_SCSICD, M_NOWAIT); + M_SCSICD, M_NOWAIT | M_ZERO); if (rcap_buf == NULL) return (ENOMEM); @@ -2929,6 +2922,9 @@ cdsize(struct cam_periph *periph, u_int3 softc->params.disksize = scsi_4btoul(rcap_buf->addr) + 1; softc->params.blksize = scsi_4btoul(rcap_buf->length); + /* Make sure we got at least some block size. */ + if (error == 0 && softc->params.blksize == 0) + error = EIO; /* * SCSI-3 mandates that the reported blocksize shall be 2048. * Older drives sometimes report funny values, trim it down to From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 17:54:03 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6828106568F; Fri, 19 Feb 2010 17:54:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BC58FC08; Fri, 19 Feb 2010 17:54: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 o1JHs3iL056375; Fri, 19 Feb 2010 17:54:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JHs3Ge056372; Fri, 19 Feb 2010 17:54:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002191754.o1JHs3Ge056372@svn.freebsd.org> From: Alexander Motin Date: Fri, 19 Feb 2010 17:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204095 - stable/8/sys/dev/ahci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 17:54:03 -0000 Author: mav Date: Fri Feb 19 17:54:03 2010 New Revision: 204095 URL: http://svn.freebsd.org/changeset/base/204095 Log: MFC r203873: With FBS enabled, we have no idea what command caused timeout. Implement same logic as in siis(4) - wait for other commands complete or timeout and then give some more time. Modified: stable/8/sys/dev/ahci/ahci.c stable/8/sys/dev/ahci/ahci.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Fri Feb 19 17:45:47 2010 (r204094) +++ stable/8/sys/dev/ahci/ahci.c Fri Feb 19 17:54:03 2010 (r204095) @@ -1657,6 +1657,45 @@ ahci_execute_transaction(struct ahci_slo return; } +/* Must be called with channel locked. */ +static void +ahci_process_timeout(device_t dev) +{ + struct ahci_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + /* Handle the rest of commands. */ + for (i = 0; i < ch->numslots; i++) { + /* Do we have a running request on slot? */ + if (ch->slot[i].state < AHCI_SLOT_RUNNING) + continue; + ahci_end_transaction(&ch->slot[i], AHCI_ERR_TIMEOUT); + } +} + +/* Must be called with channel locked. */ +static void +ahci_rearm_timeout(device_t dev) +{ + struct ahci_channel *ch = device_get_softc(dev); + int i; + + mtx_assert(&ch->mtx, MA_OWNED); + for (i = 0; i < ch->numslots; i++) { + struct ahci_slot *slot = &ch->slot[i]; + + /* Do we have a running request on slot? */ + if (slot->state < AHCI_SLOT_RUNNING) + continue; + if ((ch->toslots & (1 << i)) == 0) + continue; + callout_reset(&slot->timeout, + (int)slot->ccb->ccb_h.timeout * hz / 2000, + (timeout_t*)ahci_timeout, slot); + } +} + /* Locked by callout mechanism. */ static void ahci_timeout(struct ahci_slot *slot) @@ -1693,7 +1732,6 @@ ahci_timeout(struct ahci_slot *slot) ATA_INL(ch->r_mem, AHCI_P_SACT), ch->rslots, ATA_INL(ch->r_mem, AHCI_P_TFD), ATA_INL(ch->r_mem, AHCI_P_SERR)); - ch->fatalerr = 1; /* Handle frozen command. */ if (ch->frozen) { union ccb *fccb = ch->frozen; @@ -1705,14 +1743,28 @@ ahci_timeout(struct ahci_slot *slot) } xpt_done(fccb); } - /* Handle command with timeout. */ - ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT); - /* Handle the rest of commands. */ - for (i = 0; i < ch->numslots; i++) { - /* Do we have a running request on slot? */ - if (ch->slot[i].state < AHCI_SLOT_RUNNING) - continue; - ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT); + if (!ch->fbs_enabled) { + /* Without FBS we know real timeout source. */ + ch->fatalerr = 1; + /* Handle command with timeout. */ + ahci_end_transaction(&ch->slot[slot->slot], AHCI_ERR_TIMEOUT); + /* Handle the rest of commands. */ + for (i = 0; i < ch->numslots; i++) { + /* Do we have a running request on slot? */ + if (ch->slot[i].state < AHCI_SLOT_RUNNING) + continue; + ahci_end_transaction(&ch->slot[i], AHCI_ERR_INNOCENT); + } + } else { + /* With FBS we wait for other commands timeout and pray. */ + if (ch->toslots == 0) + xpt_freeze_simq(ch->sim, 1); + ch->toslots |= (1 << slot->slot); + if ((ch->rslots & ~ch->toslots) == 0) + ahci_process_timeout(dev); + else + device_printf(dev, " ... waiting for slots %08x\n", + ch->rslots & ~ch->toslots); } } @@ -1809,10 +1861,6 @@ ahci_end_transaction(struct ahci_slot *s ccb->ccb_h.status |= CAM_UNCOR_PARITY; break; case AHCI_ERR_TIMEOUT: - /* Do no treat soft-reset timeout as fatal here. */ - if (ccb->ccb_h.func_code != XPT_ATA_IO || - !(ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL)) - ch->fatalerr = 1; if (!ch->readlog) { xpt_freeze_simq(ch->sim, 1); ccb->ccb_h.status &= ~CAM_STATUS_MASK; @@ -1828,6 +1876,11 @@ ahci_end_transaction(struct ahci_slot *s ch->oslots &= ~(1 << slot->slot); ch->rslots &= ~(1 << slot->slot); ch->aslots &= ~(1 << slot->slot); + if (et != AHCI_ERR_TIMEOUT) { + if (ch->toslots == (1 << slot->slot)) + xpt_release_simq(ch->sim, TRUE); + ch->toslots &= ~(1 << slot->slot); + } slot->state = AHCI_SLOT_EMPTY; slot->ccb = NULL; /* Update channel stats. */ @@ -1867,7 +1920,7 @@ ahci_end_transaction(struct ahci_slot *s /* If we have no other active commands, ... */ if (ch->rslots == 0) { /* if there was fatal error - reset port. */ - if (ch->fatalerr) { + if (ch->toslots != 0 || ch->fatalerr) { ahci_reset(dev); } else { /* if we have slots in error, we can reinit port. */ @@ -1879,7 +1932,10 @@ ahci_end_transaction(struct ahci_slot *s if (!ch->readlog && ch->numhslots) ahci_issue_read_log(dev); } - } + /* If all the rest of commands are in timeout - give them chance. */ + } else if ((ch->rslots & ~ch->toslots) == 0 && + et != AHCI_ERR_TIMEOUT) + ahci_rearm_timeout(dev); /* Start PM timer. */ if (ch->numrslots == 0 && ch->pm_level > 3) { callout_schedule(&ch->pm_timer, @@ -2143,7 +2199,10 @@ ahci_reset(device_t dev) ch->hold[i] = NULL; ch->numhslots--; } + if (ch->toslots != 0) + xpt_release_simq(ch->sim, TRUE); ch->eslots = 0; + ch->toslots = 0; ch->fatalerr = 0; /* Tell the XPT about the event */ xpt_async(AC_BUS_RESET, ch->path, NULL); Modified: stable/8/sys/dev/ahci/ahci.h ============================================================================== --- stable/8/sys/dev/ahci/ahci.h Fri Feb 19 17:45:47 2010 (r204094) +++ stable/8/sys/dev/ahci/ahci.h Fri Feb 19 17:54:03 2010 (r204095) @@ -401,6 +401,7 @@ struct ahci_channel { uint32_t rslots; /* Running slots */ uint32_t aslots; /* Slots with atomic commands */ uint32_t eslots; /* Slots in error */ + uint32_t toslots; /* Slots in timeout */ int numrslots; /* Number of running slots */ int numrslotspd[16];/* Number of running slots per dev */ int numtslots; /* Number of tagged slots */ From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 18:01:32 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F068F1065693; Fri, 19 Feb 2010 18:01:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDB208FC17; Fri, 19 Feb 2010 18:01: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 o1JI1Wh9058184; Fri, 19 Feb 2010 18:01:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JI1WRv058183; Fri, 19 Feb 2010 18:01:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002191801.o1JI1WRv058183@svn.freebsd.org> From: Alexander Motin Date: Fri, 19 Feb 2010 18:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204097 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 18:01:33 -0000 Author: mav Date: Fri Feb 19 18:01:32 2010 New Revision: 204097 URL: http://svn.freebsd.org/changeset/base/204097 Log: Mark r203870 as merged. It was accidentally committed before. Modified: Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 18:07:51 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 769EE106566B; Fri, 19 Feb 2010 18:07:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B81B8FC14; Fri, 19 Feb 2010 18:07: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 o1JI7pHh059659; Fri, 19 Feb 2010 18:07:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JI7pg6059635; Fri, 19 Feb 2010 18:07:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002191807.o1JI7pg6059635@svn.freebsd.org> From: Alexander Motin Date: Fri, 19 Feb 2010 18:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204098 - stable/8/sys/dev/pci X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 18:07:51 -0000 Author: mav Date: Fri Feb 19 18:07:51 2010 New Revision: 204098 URL: http://svn.freebsd.org/changeset/base/204098 Log: MFC r203528: Add pci_get|set_max_read_req() helper functions to control maximum PCIe read request size. Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pcivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Fri Feb 19 18:01:32 2010 (r204097) +++ stable/8/sys/dev/pci/pci.c Fri Feb 19 18:07:51 2010 (r204098) @@ -1592,6 +1592,40 @@ pci_ht_map_msi(device_t dev, uint64_t ad } } +int +pci_get_max_read_req(device_t dev) +{ + int cap; + uint16_t val; + + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) != 0) + return (0); + val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); + val &= PCIM_EXP_CTL_MAX_READ_REQUEST; + val >>= 12; + return (1 << (val + 7)); +} + +int +pci_set_max_read_req(device_t dev, int size) +{ + int cap; + uint16_t val; + + if (pci_find_extcap(dev, PCIY_EXPRESS, &cap) != 0) + return (0); + if (size < 128) + size = 128; + if (size > 4096) + size = 4096; + size = (1 << (fls(size) - 1)); + val = pci_read_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, 2); + val &= ~PCIM_EXP_CTL_MAX_READ_REQUEST; + val |= (fls(size) - 8) << 12; + pci_write_config(dev, cap + PCIR_EXPRESS_DEVICE_CTL, val, 2); + return (size); +} + /* * Support for MSI message signalled interrupts. */ Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Fri Feb 19 18:01:32 2010 (r204097) +++ stable/8/sys/dev/pci/pcivar.h Fri Feb 19 18:07:51 2010 (r204098) @@ -458,6 +458,9 @@ int pci_msi_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); +int pci_get_max_read_req(device_t dev); +int pci_set_max_read_req(device_t dev, int size); + #endif /* _SYS_BUS_H_ */ /* From owner-svn-src-stable-8@FreeBSD.ORG Fri Feb 19 18:15:46 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13EEE106566B; Fri, 19 Feb 2010 18:15:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 023738FC08; Fri, 19 Feb 2010 18:15:46 +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 o1JIFjWM061436; Fri, 19 Feb 2010 18:15:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1JIFjvK061434; Fri, 19 Feb 2010 18:15:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201002191815.o1JIFjvK061434@svn.freebsd.org> From: Alexander Motin Date: Fri, 19 Feb 2010 18:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204099 - stable/8/sys/dev/siis X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2010 18:15:46 -0000 Author: mav Date: Fri Feb 19 18:15:45 2010 New Revision: 204099 URL: http://svn.freebsd.org/changeset/base/204099 Log: MFC r200291, r203529: Increase Max Read Request Size for PCIe chips from 512 to 1024 bytes. It gives those beasts additional 10% of write bandwidth. Use new helper functions to do it. Modified: stable/8/sys/dev/siis/siis.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/dev/siis/siis.c ============================================================================== --- stable/8/sys/dev/siis/siis.c Fri Feb 19 18:07:51 2010 (r204098) +++ stable/8/sys/dev/siis/siis.c Fri Feb 19 18:15:45 2010 (r204099) @@ -231,6 +231,9 @@ siis_resume(device_t dev) { struct siis_controller *ctlr = device_get_softc(dev); + /* Set PCIe max read request size to at least 1024 bytes */ + if (pci_get_max_read_req(dev) < 1024) + pci_set_max_read_req(dev, 1024); /* Put controller into reset state. */ ctlr->gctl |= SIIS_GCTL_GRESET; ATA_OUTL(ctlr->r_gmem, SIIS_GCTL, ctlr->gctl); From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 20 11:50:50 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6F45106566C; Sat, 20 Feb 2010 11:50:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B624C8FC08; Sat, 20 Feb 2010 11:50:50 +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 o1KBooGf094279; Sat, 20 Feb 2010 11:50:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KBoo7P094278; Sat, 20 Feb 2010 11:50:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002201150.o1KBoo7P094278@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 20 Feb 2010 11:50:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204112 - stable/8/sys/ufs/ffs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 11:50:50 -0000 Author: kib Date: Sat Feb 20 11:50:50 2010 New Revision: 204112 URL: http://svn.freebsd.org/changeset/base/204112 Log: MFC r203818: Clear the bp pointer when buffer is already brelse()d. Modified: stable/8/sys/ufs/ffs/ffs_alloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_alloc.c Sat Feb 20 10:19:19 2010 (r204111) +++ stable/8/sys/ufs/ffs/ffs_alloc.c Sat Feb 20 11:50:50 2010 (r204112) @@ -425,8 +425,10 @@ nospace: reclaimed = 1; softdep_request_cleanup(fs, vp); UFS_UNLOCK(ump); - if (bp) + if (bp) { brelse(bp); + bp = NULL; + } UFS_LOCK(ump); goto retry; } From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 20 11:54:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2766D106566C; Sat, 20 Feb 2010 11:54:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 16CCF8FC18; Sat, 20 Feb 2010 11:54: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 o1KBsJJP095114; Sat, 20 Feb 2010 11:54:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KBsI9J095112; Sat, 20 Feb 2010 11:54:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002201154.o1KBsI9J095112@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 20 Feb 2010 11:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204113 - stable/8/sys/fs/msdosfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 11:54:20 -0000 Author: kib Date: Sat Feb 20 11:54:18 2010 New Revision: 204113 URL: http://svn.freebsd.org/changeset/base/204113 Log: MFC r203822: Remove unused macros. Modified: stable/8/sys/fs/msdosfs/denode.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/msdosfs/denode.h ============================================================================== --- stable/8/sys/fs/msdosfs/denode.h Sat Feb 20 11:50:50 2010 (r204112) +++ stable/8/sys/fs/msdosfs/denode.h Sat Feb 20 11:54:18 2010 (r204113) @@ -207,9 +207,6 @@ struct denode { ((dep)->de_Attributes & ATTR_DIRECTORY) ? 0 : (dep)->de_FileSize), \ putushort((dp)->deHighClust, (dep)->de_StartCluster >> 16)) -#define de_forw de_chain[0] -#define de_back de_chain[1] - #ifdef _KERNEL #define VTODE(vp) ((struct denode *)(vp)->v_data) From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 20 11:58:20 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66A92106568D; Sat, 20 Feb 2010 11:58:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 561E28FC0C; Sat, 20 Feb 2010 11:58: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 o1KBwK43096083; Sat, 20 Feb 2010 11:58:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KBwJbM096082; Sat, 20 Feb 2010 11:58:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201002201158.o1KBwJbM096082@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 20 Feb 2010 11:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204114 - stable/8/sys/fs/msdosfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 11:58:20 -0000 Author: kib Date: Sat Feb 20 11:58:19 2010 New Revision: 204114 URL: http://svn.freebsd.org/changeset/base/204114 Log: MFC r203826: Use M_ZERO instead of calling bzero(). Fix function name in the comment. MFC r203828: Fix function name in the comment in the second location too. Modified: stable/8/sys/fs/msdosfs/msdosfs_denode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_denode.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_denode.c Sat Feb 20 11:54:18 2010 (r204113) +++ stable/8/sys/fs/msdosfs/msdosfs_denode.c Sat Feb 20 11:58:19 2010 (r204114) @@ -144,11 +144,11 @@ deget(pmp, dirclust, diroffset, depp) } /* - * Do the MALLOC before the getnewvnode since doing so afterward + * Do the malloc before the getnewvnode since doing so afterward * might cause a bogus v_data pointer to get dereferenced - * elsewhere if MALLOC should block. + * elsewhere if malloc should block. */ - ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK); + ldep = malloc(sizeof(struct denode), M_MSDOSFSNODE, M_WAITOK | M_ZERO); /* * Directory entry was not in cache, have to create a vnode and @@ -161,7 +161,6 @@ deget(pmp, dirclust, diroffset, depp) free(ldep, M_MSDOSFSNODE); return error; } - bzero((caddr_t)ldep, sizeof *ldep); nvp->v_data = ldep; ldep->de_vnode = nvp; ldep->de_flag = 0; From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 20 12:48:44 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2750106566C; Sat, 20 Feb 2010 12:48:44 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D21198FC1E; Sat, 20 Feb 2010 12:48: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 o1KCmitH007418; Sat, 20 Feb 2010 12:48:44 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KCmi3Q007416; Sat, 20 Feb 2010 12:48:44 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201002201248.o1KCmi3Q007416@svn.freebsd.org> From: Antoine Brodin Date: Sat, 20 Feb 2010 12:48:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204117 - stable/8 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 12:48:45 -0000 Author: antoine Date: Sat Feb 20 12:48:44 2010 New Revision: 204117 URL: http://svn.freebsd.org/changeset/base/204117 Log: MFC from head to stable/8: r202896: Unbreak world: - WITHOUT_OPENSSH (and WITH_KERBEROS) - WITHOUT_KERBEROS and WITH_GSSAPI PR: 137483 Submitted by: bf r203016 by ru@: Regen the list of prebuild libraries using tools/make_libdeps.sh. Reviewed by: ru@ Modified: stable/8/Makefile.inc1 (contents, props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Sat Feb 20 12:34:14 2010 (r204116) +++ stable/8/Makefile.inc1 Sat Feb 20 12:48:44 2010 (r204117) @@ -1087,19 +1087,19 @@ _startup_libs+= lib/libc gnu/lib/libgcc__L: lib/libc__L -_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libkrb5} \ - ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libroken} \ - ${_kerberos5_lib_libheimntlm} ${_kerberos5_lib_libgssapi_krb5} \ - lib/libbz2 lib/libcom_err lib/libcrypt lib/libelf \ +_prebuild_libs= ${_kerberos5_lib_libasn1} ${_kerberos5_lib_libheimntlm} \ + ${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \ + ${_kerberos5_lib_libroken} \ + lib/libbz2 lib/libcom_err lib/libcrypt \ lib/libexpat \ - ${_lib_cddl} ${_lib_libgssapi} ${_lib_libipx} \ + ${_lib_libgssapi} ${_lib_libipx} \ lib/libkiconv lib/libkvm lib/libmd \ lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus lib/libutil \ ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ - ${_secure_lib_libssl} lib/libdwarf lib/libproc + ${_secure_lib_libssl} .if ${MK_LIBTHR} != "no" _lib_libthr= lib/libthr @@ -1121,18 +1121,20 @@ lib/libradius__L secure/lib/libssl__L: s .if ${MK_OPENSSH} != "no" _secure_lib_libssh= secure/lib/libssh secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L -.if ${MK_KERBEROS} != "no" -kerberos5/lib/libgssapi_krb5__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ +.if ${MK_KERBEROS_SUPPORT} != "no" +secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \ kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \ - lib/libmd__L kerberos5/lib/libroken__L secure/lib/libcrypto__L \ - lib/libcrypt__L -secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libgssapi_krb5__L + lib/libmd__L kerberos5/lib/libroken__L .endif .endif .endif _secure_lib= secure/lib .endif +.if ${MK_GSSAPI} != "no" +_lib_libgssapi= lib/libgssapi +.endif + .if ${MK_IPX} != "no" _lib_libipx= lib/libipx .endif @@ -1144,8 +1146,6 @@ _kerberos5_lib_libkrb5= kerberos5/lib/li _kerberos5_lib_libhx509= kerberos5/lib/libhx509 _kerberos5_lib_libroken= kerberos5/lib/libroken _kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm -_kerberos5_lib_libgssapi_krb5= kerberos5/lib/libgssapi_krb5 -_lib_libgssapi= lib/libgssapi .endif .if ${MK_NIS} != "no" From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 20 13:35:06 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363A31065670; Sat, 20 Feb 2010 13:35:06 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2631C8FC0A; Sat, 20 Feb 2010 13:35: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 o1KDZ6kJ017670; Sat, 20 Feb 2010 13:35:06 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KDZ6nm017668; Sat, 20 Feb 2010 13:35:06 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201002201335.o1KDZ6nm017668@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 20 Feb 2010 13:35:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204119 - stable/8/sbin/restore X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 13:35:06 -0000 Author: jh Date: Sat Feb 20 13:35:05 2010 New Revision: 204119 URL: http://svn.freebsd.org/changeset/base/204119 Log: MFC r203157, r203816: Handle short reads when the -P option is used and remove some dead code. PR: bin/121502 Modified: stable/8/sbin/restore/tape.c Directory Properties: stable/8/sbin/restore/ (props changed) Modified: stable/8/sbin/restore/tape.c ============================================================================== --- stable/8/sbin/restore/tape.c Sat Feb 20 13:33:50 2010 (r204118) +++ stable/8/sbin/restore/tape.c Sat Feb 20 13:35:05 2010 (r204119) @@ -227,7 +227,7 @@ setup(void) volno = 1; setdumpnum(); FLUSHTAPEBUF(); - if (!pipein && !bflag) + if (!pipein && !pipecmdin && !bflag) findtapeblksize(); if (gethead(&spcl) == FAIL) { fprintf(stderr, "Tape is not a dump tape\n"); @@ -333,10 +333,6 @@ getvol(long nextvol) } if (volno == 1) return; - if (pipecmdin) { - closemt(); - goto getpipecmdhdr; - } goto gethdr; } again: @@ -400,7 +396,6 @@ again: if (pipecmdin) { char volno[sizeof("2147483647")]; -getpipecmdhdr: (void)sprintf(volno, "%d", newvol); if (setenv("RESTORE_VOLUME", volno, 1) == -1) { fprintf(stderr, "Cannot set $RESTORE_VOLUME: %s\n", @@ -1204,17 +1199,17 @@ getmore: * Check for mid-tape short read error. * If found, skip rest of buffer and start with the next. */ - if (!pipein && numtrec < ntrec && i > 0) { + if (!pipein && !pipecmdin && numtrec < ntrec && i > 0) { dprintf(stdout, "mid-media short read error.\n"); numtrec = ntrec; } /* * Handle partial block read. */ - if (pipein && i == 0 && rd > 0) + if ((pipein || pipecmdin) && i == 0 && rd > 0) i = rd; else if (i > 0 && i != ntrec * TP_BSIZE) { - if (pipein) { + if (pipein || pipecmdin) { rd += i; cnt -= i; if (cnt > 0) From owner-svn-src-stable-8@FreeBSD.ORG Sat Feb 20 22:43:13 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82D731065670; Sat, 20 Feb 2010 22:43:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2FE8FC19; Sat, 20 Feb 2010 22:43:13 +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 o1KMhDX0039859; Sat, 20 Feb 2010 22:43:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o1KMhDKZ039845; Sat, 20 Feb 2010 22:43:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201002202243.o1KMhDKZ039845@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 20 Feb 2010 22:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r204148 - in stable/8/sys/ia64: acpica ia64 include X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Feb 2010 22:43:13 -0000 Author: marcel Date: Sat Feb 20 22:43:12 2010 New Revision: 204148 URL: http://svn.freebsd.org/changeset/base/204148 Log: MFC rev 203883: o Eliminate IA64_PHYS_TO_RR6 by calling bus_space_map() or pmap_mapdev(). o Implement bus_space_map() in terms of pmap_mapdev(). o Have ia64_pib hold the uncached virtual address of the PIB. Modified: stable/8/sys/ia64/acpica/madt.c stable/8/sys/ia64/ia64/bus_machdep.c stable/8/sys/ia64/ia64/efi.c stable/8/sys/ia64/ia64/interrupt.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/ia64/ia64/mp_machdep.c stable/8/sys/ia64/ia64/pmap.c stable/8/sys/ia64/ia64/sapic.c stable/8/sys/ia64/include/bus.h stable/8/sys/ia64/include/intr.h stable/8/sys/ia64/include/md_var.h stable/8/sys/ia64/include/pmap.h stable/8/sys/ia64/include/vmparam.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/netinet/ (props changed) Modified: stable/8/sys/ia64/acpica/madt.c ============================================================================== --- stable/8/sys/ia64/acpica/madt.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/acpica/madt.c Sat Feb 20 22:43:12 2010 (r204148) @@ -31,8 +31,6 @@ #include -extern u_int64_t ia64_lapic_address; - struct sapic *sapic_create(int, int, u_int64_t); static void @@ -150,7 +148,7 @@ ia64_probe_sapics(void) /* Save the address of the processor interrupt block. */ if (bootverbose) printf("\tLocal APIC address=0x%x\n", table->Address); - ia64_lapic_address = table->Address; + ia64_lapic_addr = table->Address; end = (char *)table + table->Header.Length; p = (char *)(table + 1); @@ -172,7 +170,7 @@ ia64_probe_sapics(void) case ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE: { ACPI_MADT_LOCAL_APIC_OVERRIDE *lapic = (ACPI_MADT_LOCAL_APIC_OVERRIDE *)entry; - ia64_lapic_address = lapic->Address; + ia64_lapic_addr = lapic->Address; break; } Modified: stable/8/sys/ia64/ia64/bus_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/bus_machdep.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/bus_machdep.c Sat Feb 20 22:43:12 2010 (r204148) @@ -29,12 +29,33 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include extern u_long ia64_port_base; #define __PIO_ADDR(port) \ (void *)(ia64_port_base | (((port) & 0xfffc) << 10) | ((port) & 0xFFF)) +int +bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size, + int flags __unused, bus_space_handle_t *bshp) +{ + + *bshp = (__predict_false(bst == IA64_BUS_SPACE_IO)) + ? addr : (uintptr_t)pmap_mapdev(addr, size); + return (0); +} + + +void +bus_space_unmap(bus_space_tag_t bst __unused, bus_space_handle_t bsh, + bus_size_t size) +{ + + pmap_unmapdev(bsh, size); +} + uint8_t bus_space_read_io_1(u_long port) { Modified: stable/8/sys/ia64/ia64/efi.c ============================================================================== --- stable/8/sys/ia64/ia64/efi.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/efi.c Sat Feb 20 22:43:12 2010 (r204148) @@ -33,6 +33,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include extern uint64_t ia64_call_efi_physical(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t); @@ -123,8 +125,8 @@ efi_boot_minimal(uint64_t systbl) md->md_virt = (void *)IA64_PHYS_TO_RR7(md->md_phys); else if (md->md_attr & EFI_MD_ATTR_UC) - md->md_virt = - (void *)IA64_PHYS_TO_RR6(md->md_phys); + md->md_virt = pmap_mapdev(md->md_phys, + md->md_pages * EFI_PAGE_SIZE); } md = efi_md_next(md); } Modified: stable/8/sys/ia64/ia64/interrupt.c ============================================================================== --- stable/8/sys/ia64/ia64/interrupt.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/interrupt.c Sat Feb 20 22:43:12 2010 (r204148) @@ -106,7 +106,6 @@ void interrupt(struct trapframe *tf) { struct thread *td; - volatile struct ia64_interrupt_block *ib = IA64_INTERRUPT_BLOCK; uint64_t adj, clk, itc; int64_t delta; u_int vector; @@ -130,7 +129,7 @@ interrupt(struct trapframe *tf) */ if (vector == 0) { PCPU_INC(md.stats.pcs_nextints); - inta = ib->ib_inta; + inta = ia64_ld1(&ia64_pib->ib_inta); if (inta == 15) { PCPU_INC(md.stats.pcs_nstrays); __asm __volatile("mov cr.eoi = r0;; srlz.d"); Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/machdep.c Sat Feb 20 22:43:12 2010 (r204148) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -134,6 +135,10 @@ struct fpswa_iface *fpswa_iface; u_int64_t ia64_pal_base; u_int64_t ia64_port_base; +u_int64_t ia64_lapic_addr = PAL_PIB_DEFAULT_ADDR; + +struct ia64_pib *ia64_pib; + static int ia64_sync_icache_needed; char machine[] = MACHINE; @@ -308,6 +313,8 @@ cpu_startup(void *dummy) * information. */ ia64_probe_sapics(); + ia64_pib = pmap_mapdev(ia64_lapic_addr, sizeof(*ia64_pib)); + ia64_mca_init(); /* @@ -684,7 +691,8 @@ ia64_init(void) for (md = efi_md_first(); md != NULL; md = efi_md_next(md)) { switch (md->md_type) { case EFI_MD_TYPE_IOPORT: - ia64_port_base = IA64_PHYS_TO_RR6(md->md_phys); + ia64_port_base = (uintptr_t)pmap_mapdev(md->md_phys, + md->md_pages * EFI_PAGE_SIZE); break; case EFI_MD_TYPE_PALCODE: ia64_pal_base = md->md_phys; Modified: stable/8/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/mp_machdep.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/mp_machdep.c Sat Feb 20 22:43:12 2010 (r204148) @@ -68,8 +68,9 @@ MALLOC_DEFINE(M_SMP, "SMP", "SMP related void ia64_ap_startup(void); -#define LID_SAPIC_ID(x) ((int)((x) >> 24) & 0xff) -#define LID_SAPIC_EID(x) ((int)((x) >> 16) & 0xff) +#define LID_SAPIC(x) ((u_int)((x) >> 16)) +#define LID_SAPIC_ID(x) ((u_int)((x) >> 24) & 0xff) +#define LID_SAPIC_EID(x) ((u_int)((x) >> 16) & 0xff) #define LID_SAPIC_SET(id,eid) (((id & 0xff) << 8 | (eid & 0xff)) << 16); #define LID_SAPIC_MASK 0xffff0000UL @@ -114,7 +115,6 @@ ia64_store_mca_state(void* arg) void ia64_ap_startup(void) { - volatile struct ia64_interrupt_block *ib = IA64_INTERRUPT_BLOCK; uint64_t vhpt; int vector; @@ -153,7 +153,7 @@ ia64_ap_startup(void) while (vector != 15) { ia64_srlz_d(); if (vector == 0) - vector = (int)ib->ib_inta; + vector = (int)ia64_ld1(&ia64_pib->ib_inta); ia64_set_eoi(0); ia64_srlz_d(); vector = ia64_get_ivr(); @@ -363,16 +363,18 @@ ipi_all_but_self(int ipi) void ipi_send(struct pcpu *cpu, int ipi) { - volatile uint64_t *pipi; - uint64_t vector; + u_int lid; + uint8_t vector; - pipi = (void *)IA64_PHYS_TO_RR6(ia64_lapic_address | - ((cpu->pc_md.lid & LID_SAPIC_MASK) >> 12)); - vector = (uint64_t)(ipi_vector[ipi] & 0xff); + lid = LID_SAPIC(cpu->pc_md.lid); + vector = ipi_vector[ipi]; KASSERT(vector != 0, ("IPI %d is not assigned a vector", ipi)); - *pipi = vector; - CTR3(KTR_SMP, "ipi_send(%p, %ld), cpuid=%d", pipi, vector, - PCPU_GET(cpuid)); + + ia64_mf(); + ia64_st8(&(ia64_pib->ib_ipi[lid][0]), vector); + ia64_mf_a(); + CTR4(KTR_SMP, "ipi_send(%p, %ld): cpuid=%d, vector=%u", cpu, ipi, + PCPU_GET(cpuid), vector); } SYSINIT(start_aps, SI_SUB_SMP, SI_ORDER_FIRST, cpu_mp_unleash, NULL); Modified: stable/8/sys/ia64/ia64/pmap.c ============================================================================== --- stable/8/sys/ia64/ia64/pmap.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/pmap.c Sat Feb 20 22:43:12 2010 (r204148) @@ -2145,9 +2145,12 @@ pmap_remove_write(vm_page_t m) * NOT real memory. */ void * -pmap_mapdev(vm_offset_t pa, vm_size_t size) +pmap_mapdev(vm_paddr_t pa, vm_size_t size) { - return (void*) IA64_PHYS_TO_RR6(pa); + vm_offset_t va; + + va = pa | IA64_RR_BASE(6); + return ((void *)va); } /* @@ -2156,7 +2159,6 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si void pmap_unmapdev(vm_offset_t va, vm_size_t size) { - return; } /* Modified: stable/8/sys/ia64/ia64/sapic.c ============================================================================== --- stable/8/sys/ia64/ia64/sapic.c Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/ia64/sapic.c Sat Feb 20 22:43:12 2010 (r204148) @@ -42,6 +42,9 @@ #include #include +#include +#include + static MALLOC_DEFINE(M_SAPIC, "sapic", "I/O SAPIC devices"); static int sysctl_machdep_apic(SYSCTL_HANDLER_ARGS); @@ -52,8 +55,6 @@ SYSCTL_OID(_machdep, OID_AUTO, apic, CTL struct sapic *ia64_sapics[16]; /* XXX make this resizable */ int ia64_sapic_count; -u_int64_t ia64_lapic_address = PAL_PIB_DEFAULT_ADDR; - struct sapic_rte { u_int64_t rte_vector :8; u_int64_t rte_delivery_mode :3; @@ -165,7 +166,7 @@ sapic_create(u_int id, u_int base, u_int sa->sa_id = id; sa->sa_base = base; - sa->sa_registers = IA64_PHYS_TO_RR6(address); + sa->sa_registers = (uintptr_t)pmap_mapdev(address, 1048576); mtx_init(&sa->sa_mtx, "I/O SAPIC lock", NULL, MTX_SPIN); Modified: stable/8/sys/ia64/include/bus.h ============================================================================== --- stable/8/sys/ia64/include/bus.h Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/include/bus.h Sat Feb 20 22:43:12 2010 (r204148) @@ -132,28 +132,14 @@ /* - * Map a region of device bus space into CPU virtual address space. + * Map and unmap a region of device bus space into CPU virtual address space. */ -static __inline int -bus_space_map(bus_space_tag_t bst, bus_addr_t addr, bus_size_t size __unused, - int flags __unused, bus_space_handle_t *bshp) -{ - - *bshp = (__predict_false(bst == IA64_BUS_SPACE_IO)) - ? addr : IA64_PHYS_TO_RR6(addr); - return (0); -} - - -/* - * Unmap a region of device bus space. - */ -static __inline void -bus_space_unmap(bus_space_tag_t bst __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) -{ -} +int +bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, int, + bus_space_handle_t *); +void +bus_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t size); /* * Get a new handle for a subregion of an already-mapped area of bus space. Modified: stable/8/sys/ia64/include/intr.h ============================================================================== --- stable/8/sys/ia64/include/intr.h Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/include/intr.h Sat Feb 20 22:43:12 2010 (r204148) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2007-2010 Marcel Moolenaar * Copyright (c) 1998 Doug Rabson * All rights reserved. * @@ -27,26 +28,23 @@ */ #ifndef _MACHINE_INTR_H_ -#define _MACHINE_INTR_H_ +#define _MACHINE_INTR_H_ /* * Layout of the Processor Interrupt Block. */ -struct ia64_interrupt_block +struct ia64_pib { - u_int64_t ib_ipi[0x20000]; /* 1Mb of IPI interrupts */ - u_int8_t ib_reserved1[0xe0000]; - u_int8_t ib_inta; /* Generate INTA cycle */ - u_int8_t ib_reserved2[7]; - u_int8_t ib_xtp; /* XTP cycle */ - u_int8_t ib_reserved3[7]; - u_int8_t ib_reserved4[0x1fff0]; + uint64_t ib_ipi[65536][2]; /* 64K-way IPIs (1MB area). */ + uint8_t _rsvd1[0xe0000]; + uint8_t ib_inta; /* Generate INTA cycle. */ + uint8_t _rsvd2[7]; + uint8_t ib_xtp; /* External Task Priority. */ + uint8_t _rsvd3[7]; + uint8_t _rsvd4[0x1fff0]; }; -extern u_int64_t ia64_lapic_address; - -#define IA64_INTERRUPT_BLOCK \ - (struct ia64_interrupt_block *)IA64_PHYS_TO_RR6(ia64_lapic_address) +extern struct ia64_pib *ia64_pib; int ia64_setup_intr(const char *name, int irq, driver_filter_t filter, driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep); Modified: stable/8/sys/ia64/include/md_var.h ============================================================================== --- stable/8/sys/ia64/include/md_var.h Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/include/md_var.h Sat Feb 20 22:43:12 2010 (r204148) @@ -49,7 +49,7 @@ struct ia64_fdesc { #define IA64_CFM_RRB_FR(x) (((x) >> 25) & 0x7f) #define IA64_CFM_RRB_PR(x) (((x) >> 32) & 0x3f) -/* Concenience function (inline) to adjust backingstore pointers. */ +/* Convenience function (inline) to adjust backingstore pointers. */ static __inline uint64_t ia64_bsp_adjust(uint64_t bsp, int nslots) { @@ -60,22 +60,22 @@ ia64_bsp_adjust(uint64_t bsp, int nslots #ifdef _KERNEL -extern char sigcode[]; -extern char esigcode[]; -extern int szsigcode; -extern long Maxmem; - struct _special; -struct fpreg; -struct reg; struct thread; struct trapframe; +/* + * Return value from ia64_init. Describes stack to switch to. + */ struct ia64_init_return { uint64_t bspstore; uint64_t sp; }; +extern uint64_t ia64_lapic_addr; + +extern long Maxmem; + void busdma_swi(void); int copyout_regstack(struct thread *, uint64_t *, uint64_t *); void cpu_mp_add(u_int, u_int, u_int); Modified: stable/8/sys/ia64/include/pmap.h ============================================================================== --- stable/8/sys/ia64/include/pmap.h Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/include/pmap.h Sat Feb 20 22:43:12 2010 (r204148) @@ -132,7 +132,7 @@ vm_paddr_t pmap_kextract(vm_offset_t va) void pmap_kremove(vm_offset_t); void pmap_setdevram(unsigned long long basea, vm_offset_t sizea); int pmap_uses_prom_console(void); -void *pmap_mapdev(vm_offset_t, vm_size_t); +void *pmap_mapdev(vm_paddr_t, vm_size_t); void pmap_unmapdev(vm_offset_t, vm_size_t); unsigned *pmap_pte(pmap_t, vm_offset_t) __pure2; void pmap_set_opt (unsigned *); Modified: stable/8/sys/ia64/include/vmparam.h ============================================================================== --- stable/8/sys/ia64/include/vmparam.h Sat Feb 20 22:29:28 2010 (r204147) +++ stable/8/sys/ia64/include/vmparam.h Sat Feb 20 22:43:12 2010 (r204148) @@ -132,7 +132,6 @@ #define IA64_RR_BASE(n) (((u_int64_t) (n)) << 61) #define IA64_RR_MASK(x) ((x) & ((1L << 61) - 1)) -#define IA64_PHYS_TO_RR6(x) ((x) | IA64_RR_BASE(6)) #define IA64_PHYS_TO_RR7(x) ((x) | IA64_RR_BASE(7)) /*